:root{
  --bg:#f5f7fb;
  --bg-grad-1:#f5f7fb;
  --bg-grad-2:#eef2f8;
  --panel:rgba(255,255,255,.84);
  --panel-strong:rgba(255,255,255,.94);
  --panel2:#f3f6fb;
  --line:#dde5ef;
  --line-soft:#e9eef5;
  --text:#0f172a;
  --muted:#64748b;
  --accent:#4f8df7;
  --accent-soft:rgba(79,141,247,.14);
  --accent-soft-2:rgba(79,141,247,.07);
  --ok:#22c55e;
  --ok-soft:rgba(34,197,94,.12);
  --warn:#f59e0b;
  --warn-soft:rgba(245,158,11,.12);
  --danger:#ef4444;
  --danger-soft:rgba(239,68,68,.10);
  --shadow:0 12px 34px rgba(15,23,42,.08);
  --radius-card:20px;
  --radius-input:14px;
  --radius-output:18px;
  --radius-pill:999px;
}
*{box-sizing:border-box}
html,body{min-height:100%}
html{-webkit-text-size-adjust:100%}
body{
  margin:0;
  font-family:-apple-system,BlinkMacSystemFont,"SF Pro Display","Inter","Segoe UI",Roboto,Arial,sans-serif;
  background:
    radial-gradient(circle at top center, rgba(79,141,247,.10), transparent 28%),
    linear-gradient(180deg,var(--bg-grad-1) 0%, var(--bg-grad-2) 100%);
  color:var(--text);
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}
h1,h2,h3{margin-top:0;letter-spacing:-0.02em}
h1{font-size:clamp(30px,4vw,40px);line-height:1.08}
h2{font-size:clamp(19px,2.4vw,22px);line-height:1.16}
h3{font-size:clamp(15px,2vw,17px);line-height:1.2}
.sub{
  margin:0 0 22px;
  color:var(--muted);
  line-height:1.5;
  font-size:15px;
}
.card{
  background:linear-gradient(180deg,var(--panel) 0%, var(--panel-strong) 100%);
  border:1px solid var(--line);
  border-radius:var(--radius-card);
  padding:18px;
  box-shadow:var(--shadow);
  backdrop-filter:blur(16px);
  -webkit-backdrop-filter:blur(16px);
}
.card h2{margin:0 0 12px;font-size:18px}
label{
  display:block;
  font-size:13px;
  color:var(--muted);
  margin-bottom:6px;
  font-weight:600;
}
input,select,textarea,button{
  width:100%;
  font:inherit;
  border-radius:var(--radius-input);
  border:1px solid var(--line);
  background:linear-gradient(180deg,#f8faff 0%, #f1f5fb 100%);
  color:var(--text);
  padding:11px 13px;
  outline:none;
  transition:border-color .16s ease, box-shadow .16s ease, transform .16s ease, background .16s ease;
}
input::placeholder, textarea::placeholder{color:#8b98ab}
input:focus, select:focus, textarea:focus{
  border-color:var(--accent);
  box-shadow:0 0 0 4px var(--accent-soft);
}
textarea{
  min-height:90px;
  resize:vertical;
  line-height:1.45;
}
button{cursor:pointer;font-weight:600}
button:hover{transform:translateY(-1px)}
button:active{transform:translateY(0)}
.btn-primary{
  background:linear-gradient(180deg,#5d99fb 0%, #4f8df7 100%);
  color:#ffffff;
  border-color:#4f8df7;
  font-weight:700;
}
.btn-soft{
  background:linear-gradient(180deg,rgba(79,141,247,.14) 0%, rgba(79,141,247,.08) 100%);
  color:#245dc8;
  border-color:#c7d9fb;
}
.btn-ok{
  background:linear-gradient(180deg,rgba(34,197,94,.14) 0%, rgba(34,197,94,.08) 100%);
  border-color:#bcebcf;
  color:#15713a;
}
.btn-danger{
  background:linear-gradient(180deg,rgba(239,68,68,.13) 0%, rgba(239,68,68,.07) 100%);
  border-color:#f0c2c2;
  color:#b42318;
}
.btn-inline{width:auto}
.actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
.grid2,.grid3,.grid4{display:grid;gap:12px}
.grid2{grid-template-columns:1fr 1fr}
.grid3{grid-template-columns:repeat(3,1fr)}
.grid4{grid-template-columns:repeat(4,1fr)}
.tiny{
  font-size:12px;
  color:var(--muted);
  line-height:1.45;
}
.output{
  white-space:pre-wrap;
  background:linear-gradient(180deg,#f9fbff 0%, #f2f6fc 100%);
  border:1px solid var(--line-soft);
  border-radius:var(--radius-output);
  min-height:420px;
  padding:16px;
  line-height:1.5;
}
.tableWrap{
  overflow:auto;
  border:1px solid var(--line);
  border-radius:16px;
  background:rgba(255,255,255,.55);
  -webkit-overflow-scrolling:touch;
}
table{width:100%;border-collapse:collapse}
th,td{
  border-bottom:1px solid var(--line-soft);
  padding:10px 12px;
  text-align:left;
  vertical-align:top;
}
th{
  background:#f1f5fb;
  font-size:13px;
  font-weight:700;
}
.area-badge{
  display:inline-flex;
  align-items:flex-start;
  flex-direction:column;
  border:1px solid var(--line);
  border-radius:var(--radius-pill);
  padding:6px 10px;
  font-size:12px;
  color:var(--muted);
  background:rgba(255,255,255,.7);
}
.staff-summary-detail{
  display:block;
  font-size:11px;
  color:var(--muted);
  margin-top:2px;
}
.pill{
  width:auto;
  border-radius:var(--radius-pill);
  padding:8px 12px;
  background:linear-gradient(180deg,#ffffff 0%, #f2f6fc 100%);
  border:1px solid var(--line);
  color:var(--text);
  font-size:13px;
}
.cch-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  margin-bottom:18px;
}
.cch-brand{
  display:flex;
  align-items:center;
  gap:14px;
  min-width:0;
}
.cch-logo{
  width:58px;
  height:58px;
  object-fit:contain;
  flex:0 0 auto;
  filter:drop-shadow(0 6px 16px rgba(15,23,42,.12));
}
.cch-brand-text{min-width:0}
.cch-eyebrow{
  display:inline-flex;
  align-items:center;
  gap:8px;
  border:1px solid var(--line);
  border-radius:var(--radius-pill);
  padding:6px 10px;
  color:var(--muted);
  background:rgba(255,255,255,.65);
  font-size:12px;
  margin-bottom:8px;
}
.cch-page-title{margin:0}
.cch-page-subtitle{
  margin:6px 0 0;
  color:var(--muted);
  line-height:1.45;
  font-size:15px;
}
.cch-header-side{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
  justify-content:flex-end;
}
.cch-chip{
  width:auto;
  border-radius:var(--radius-pill);
  padding:8px 12px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.65);
  color:var(--muted);
  font-size:12px;
}
.sep{
  height:1px;
  background:linear-gradient(90deg,transparent 0%, var(--line) 18%, var(--line) 82%, transparent 100%);
  margin:16px 0;
}
.shared-topnav{
  position:sticky;
  top:0;
  width:100%;
  z-index:9999;
  background:linear-gradient(180deg,rgba(255,255,255,.84),rgba(255,255,255,.72));
  border-bottom:1px solid var(--line);
  box-shadow:0 8px 24px rgba(15,23,42,.06);
  backdrop-filter:blur(16px);
  -webkit-backdrop-filter:blur(16px);
}
.shared-topnav-inner{
  width:min(calc(100% - 40px), 1620px);
  margin:0 auto;
  padding:12px 0;
  display:flex;
  justify-content:center;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}
.shared-topnav a{
  color:var(--muted);
  text-decoration:none;
  font-size:14px;
  line-height:1;
  padding:9px 12px;
  border-radius:10px;
  border:1px solid transparent;
  transition:background .15s ease,color .15s ease,border-color .15s ease,transform .15s ease;
}
.shared-topnav a:hover{
  background:#eef4ff;
  color:#163767;
  border-color:#d4e3ff;
  transform:translateY(-1px);
}
.shared-topnav a.active{
  background:linear-gradient(180deg,#5d99fb 0%, #4f8df7 100%);
  color:#fff;
  border-color:#4f8df7;
  font-weight:700;
}
body .wrap{padding-top:24px}
@media (max-width:1400px){
  .grid3,.grid4{grid-template-columns:1fr 1fr}
}
@media (max-width:980px){
  h1{font-size:clamp(28px,7vw,34px)}
  h2{font-size:clamp(18px,5vw,20px)}
  h3{font-size:15px}
  .grid2,.grid3,.grid4{grid-template-columns:1fr}
  .cch-header{
    flex-direction:column;
    align-items:flex-start;
    gap:14px;
  }
  .cch-brand{align-items:flex-start}
  .cch-header-side{
    justify-content:flex-start;
    width:100%;
  }
  .cch-page-title{
    font-size:clamp(28px,8vw,34px);
    line-height:1.12;
  }
  .cch-page-subtitle{
    font-size:14px;
    max-width:100%;
  }
  .cch-logo{
    width:50px;
    height:50px;
  }
  .actions{
    flex-direction:column;
    align-items:stretch;
  }
  .actions > *{width:100%}
  .btn-inline{width:100%}
  .pill{
    width:100%;
    text-align:center;
    justify-content:center;
  }
  .area-badge{
    width:100%;
    border-radius:16px;
  }
}
@media (max-width:900px){
  .shared-topnav-inner{
    width:min(calc(100% - 20px), 100%);
    padding:10px 0;
    justify-content:flex-start;
    gap:8px;
    overflow-x:auto;
    flex-wrap:nowrap;
    scrollbar-width:none;
  }
  .shared-topnav-inner::-webkit-scrollbar{display:none}
  .shared-topnav a{
    font-size:13px;
    padding:8px 10px;
    white-space:nowrap;
    flex:0 0 auto;
  }
  body .wrap{padding-top:18px}
  .card{
    padding:16px;
    border-radius:18px;
  }
  input,select,textarea,button{
    padding:12px 12px;
    font-size:16px;
  }
  select{min-height:46px}
  textarea{min-height:110px}
  .output{
    min-height:280px;
    padding:14px;
  }
  th,td{
    padding:9px 10px;
    font-size:13px;
  }
}
@media (max-width:560px){
  .cch-eyebrow,
  .cch-chip{
    font-size:11px;
    padding:6px 9px;
  }
  .card{padding:14px}
  .shared-topnav a{border-radius:9px}
  .sub,.cch-page-subtitle{line-height:1.4}
}


/* ===== LAYOUT INTEGRATED ===== */

.wrap{
  width:min(calc(100% - 40px), 1620px);
  margin:0 auto;
  padding:24px 0 28px;
}
.layout{
  display:grid;
  grid-template-columns:minmax(360px, 430px) minmax(0, 1fr);
  gap:18px;
  align-items:start;
}
.pair-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:18px;
  align-items:start;
}
.stack-md > * + *{
  margin-top:18px;
}
.module-inline-gap{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:flex-start;
}
.module-inline-gap > *{
  margin:0 !important;
}
@media (min-width:2560px){
  .wrap{
    width:min(calc(100vw - 500px), 1980px);
  }
}
@media (max-width:1400px){
  .layout{grid-template-columns:1fr}
}
@media (max-width:980px){
  .pair-grid{grid-template-columns:1fr}
  .layout{gap:16px}
  .stack-md > * + *{margin-top:16px}
}
@media (max-width:900px){
  .wrap{
    width:min(calc(100% - 20px), 100%);
    padding:18px 0 22px;
  }
  .layout{
    grid-template-columns:1fr;
    gap:14px;
  }
  .pair-grid{
    grid-template-columns:1fr;
    gap:14px;
  }
  .module-inline-gap{
    flex-direction:column;
    align-items:stretch;
  }
}
@media (max-width:560px){
  .wrap{
    width:min(calc(100% - 16px), 100%);
    padding:14px 0 18px;
  }
  .layout,.pair-grid{gap:12px}
  .stack-md > * + *{margin-top:12px}
}



/* ===== CCH DOKU / SPACING / COLLAPSE FIX ===== */
.stack,
.stack-md{
  display:flex;
  flex-direction:column;
  gap:18px;
}

.pillbar{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:flex-start;
}

.list-toggle-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin:12px 0 10px;
}

.list-toggle-head h3{
  margin:0;
  font-size:15px;
}

.collapse-toggle{
  width:auto !important;
  min-width:38px;
  height:38px;
  padding:0 12px;
  border-radius:12px;
  border:1px solid var(--line);
  background:linear-gradient(180deg,#ffffff 0%, #eef4fb 100%);
  color:var(--text);
  font-weight:800;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  box-shadow:0 2px 10px rgba(15,23,42,.05);
}

.actions.module-inline-gap{
  gap:10px;
}

.actions.module-inline-gap + .tableWrap,
.actions.module-inline-gap + .output{
  margin-top:4px;
}

.tableWrap + .pillbar,
.tableWrap + .tiny{
  margin-top:12px;
}

.small-table table{
  min-width:100%;
}

.checkitem{
  display:flex;
  gap:10px;
  align-items:flex-start;
}

.checkitem input{
  width:auto;
  margin-top:3px;
}

.area-add-list{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.area-add-item{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  padding:12px 14px;
  border:1px solid var(--line);
  border-radius:16px;
  background:rgba(255,255,255,.62);
}

.area-add-item strong{
  display:block;
  margin-bottom:3px;
}

.area-meta{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-top:4px;
}

.area-block{
  border:1px solid var(--line);
  border-radius:18px;
  overflow:hidden;
  background:rgba(255,255,255,.60);
  box-shadow:0 8px 20px rgba(15,23,42,.04);
  margin-top:12px;
}

.area-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  padding:14px 16px;
  background:linear-gradient(180deg,#f7faff 0%, #eef4fb 100%);
  border-bottom:1px solid var(--line);
}

.area-head strong,
.area-head b{
  font-size:15px;
}

.area-body{
  padding:16px;
}

.collapsed .area-body{
  display:none;
}

.task-group{
  border:1px solid var(--line);
  border-radius:14px;
  padding:12px;
  margin-bottom:12px;
  background:rgba(255,255,255,.7);
}

.task-group h4{
  margin:0 0 10px;
  font-size:14px;
}

.problem-box{
  margin-top:12px;
  padding-top:12px;
  border-top:1px dashed var(--line);
  display:none;
}

.problem-box.show{
  display:block;
}

.route-list .item,
.mini-list .item{
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:flex-start;
  padding:12px 14px;
  border:1px solid var(--line);
  border-radius:14px;
  background:rgba(255,255,255,.62);
  margin-bottom:10px;
}

.item strong{
  display:block;
}

#routeActionList{
  display:grid;
  gap:8px;
}

#activeAreas > * + *,
#areaAddList > * + *,
#addedAreaList > * + *,
.route-list > * + *{
  margin-top:10px;
}

#addRouteBtn{
  width:100%;
  min-height:48px;
}

#routeToTasks{
  width:auto !important;
}

#addProblemRow,
#addDocRow,
#addCommRow,
#addStaffRow,
#addTaskRow{
  width:auto !important;
}

#staffTimeSummary{
  margin-top:12px;
}

#activeAreas{
  margin-top:8px;
}

.card > h2 + .actions,
.card > h2 + .tiny,
.card > h2 + .grid2,
.card > h2 + .grid3,
.card > h2 + .grid4{
  margin-top:10px;
}

@media (max-width:980px){
  .list-toggle-head{
    align-items:flex-start;
  }

  .area-head{
    align-items:flex-start;
  }

  .route-list .item,
  .mini-list .item,
  .area-add-item{
    flex-direction:column;
    align-items:stretch;
  }
}



/* =========================================================
   CCH Dienstplan DB-only Clean Helpers
   ========================================================= */
body.cch-page-cch-dienstplan-erstellen .mt-8{margin-top:8px !important}
body.cch-page-cch-dienstplan-erstellen .mt-10{margin-top:10px !important}
body.cch-page-cch-dienstplan-erstellen .mt-12{margin-top:12px !important}
body.cch-page-cch-dienstplan-erstellen .mt-14{margin-top:14px !important}
body.cch-page-cch-dienstplan-erstellen .modal-title{margin:8px 0 0 !important}
body.cch-page-cch-dienstplan-erstellen .modal-subtitle{font-size:14px !important;margin-top:8px !important}
body.cch-page-cch-dienstplan-erstellen .modal-head{
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:flex-start;
}
body.cch-page-cch-dienstplan-erstellen .status-line{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  align-items:center;
}
body.cch-page-cch-dienstplan-erstellen .empty-state{
  padding:18px;
  border:1px dashed var(--line);
  border-radius:18px;
  color:var(--muted);
  text-align:center;
  background:rgba(255,255,255,.54);
}
@media(max-width:760px){
  body.cch-page-cch-dienstplan-erstellen .modal-head{
    flex-direction:column;
  }
}

/* =========================================================
   CCH UI STANDARD FOUNDATION v1.0.0
   Ziel: Ein gemeinsamer Modulstandard für alle CCH-Seiten.
   ========================================================= */
:root{
  --cch-wrap-max:1620px;
  --cch-wrap-pad-y:24px;
  --cch-gap:18px;
  --cch-gap-sm:12px;
  --cch-sidebar:360px;
  --cch-card-pad:18px;
  --cch-card-radius:22px;
  --cch-control-radius:14px;
  --cch-control-h:42px;
}
body[class*="cch-page-"]{overflow-x:hidden;}
body[class*="cch-page-"] .wrap,
body .cch-module-wrap{
  width:min(calc(100% - 40px), var(--cch-wrap-max));
  max-width:var(--cch-wrap-max);
  margin:0 auto;
  padding:var(--cch-wrap-pad-y) 0 56px;
  box-sizing:border-box;
}
body[class*="cch-page-"] .layout,
body .cch-module-layout{
  display:grid;
  grid-template-columns:minmax(var(--cch-sidebar), .38fr) minmax(0, 1fr);
  gap:var(--cch-gap);
  align-items:start;
}
body[class*="cch-page-"] .layout.layout-single,
body[class*="cch-page-"] .layout.single,
body .cch-module-layout.layout-single{grid-template-columns:minmax(0,1fr);}
body[class*="cch-page-"] .pair-grid,
body .cch-pair-grid{
  display:grid;
  grid-template-columns:1fr;
  gap:var(--cch-gap);
  align-items:start;
}
body[class*="cch-page-"] .stack,
body[class*="cch-page-"] .stack-md,
body .cch-stack{
  display:flex;
  flex-direction:column;
  gap:var(--cch-gap);
}
body[class*="cch-page-"] .stack-md > * + *,
body[class*="cch-page-"] .stack > * + *{margin-top:0!important;}
body[class*="cch-page-"] .card{
  border:1px solid var(--line);
  border-radius:var(--cch-card-radius);
  background:linear-gradient(180deg,var(--panel) 0%, var(--panel-strong) 100%);
  box-shadow:var(--shadow);
  backdrop-filter:blur(16px);
  -webkit-backdrop-filter:blur(16px);
  padding:var(--cch-card-pad);
  box-sizing:border-box;
}
body[class*="cch-page-"] .card > h2:first-child{margin:0 0 12px;font-size:18px;letter-spacing:-.025em;}
body[class*="cch-page-"] .card.collapsible{overflow:hidden;padding:0;}
body[class*="cch-page-"] .section-head,
body[class*="cch-page-"] .card-header,
body[class*="cch-page-"] .week-head,
body[class*="cch-page-"] .th-head,
body[class*="cch-page-"] .area-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  min-height:56px;
  padding:14px 16px;
  border-bottom:1px solid var(--line);
  background:linear-gradient(180deg,#f9fbff 0%, #eef4fb 100%);
  cursor:pointer;
  user-select:none;
}
body[class*="cch-page-"] .section-head h2,
body[class*="cch-page-"] .card-header h2,
body[class*="cch-page-"] .week-title,
body[class*="cch-page-"] .th-title-wrap,
body[class*="cch-page-"] .area-head strong{
  min-width:0;
  flex:1 1 auto;
  margin:0;
}
body[class*="cch-page-"] .card-body,
body[class*="cch-page-"] .week-body,
body[class*="cch-page-"] .th-body,
body[class*="cch-page-"] .area-body{padding:16px;}
body[class*="cch-page-"] .section-toggle,
body[class*="cch-page-"] .collapse-toggle,
body[class*="cch-page-"] .week-toggle{
  width:38px!important;
  min-width:38px!important;
  max-width:38px!important;
  height:38px!important;
  padding:0!important;
  border-radius:13px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  margin-left:auto!important;
  flex:0 0 38px!important;
  font-weight:900!important;
}
body[class*="cch-page-"] .collapsed .card-body,
body[class*="cch-page-"] .collapsed .week-body,
body[class*="cch-page-"] .collapsed .th-body,
body[class*="cch-page-"] .collapsed .area-body{display:none;}
body[class*="cch-page-"] label{margin:10px 0 6px;font-size:12px;font-weight:750;color:var(--muted);}
body[class*="cch-page-"] input,
body[class*="cch-page-"] select,
body[class*="cch-page-"] textarea{
  min-height:var(--cch-control-h);
  border-radius:var(--cch-control-radius);
  box-sizing:border-box;
}
body[class*="cch-page-"] textarea{min-height:96px;}
body[class*="cch-page-"] .grid2,
body[class*="cch-page-"] .grid3,
body[class*="cch-page-"] .grid4,
body[class*="cch-page-"] .form-grid,
body[class*="cch-page-"] .form-grid-3,
body[class*="cch-page-"] .builder-grid{display:grid;gap:var(--cch-gap-sm);}
body[class*="cch-page-"] .grid2{grid-template-columns:repeat(2,minmax(0,1fr));}
body[class*="cch-page-"] .grid3,
body[class*="cch-page-"] .form-grid-3{grid-template-columns:repeat(3,minmax(0,1fr));}
body[class*="cch-page-"] .grid4{grid-template-columns:repeat(4,minmax(0,1fr));}
body[class*="cch-page-"] .actions,
body[class*="cch-page-"] .toolbar,
body[class*="cch-page-"] .toolbar-row,
body[class*="cch-page-"] .secondary-actions,
body[class*="cch-page-"] .quick-actions,
body[class*="cch-page-"] .action-grid,
body[class*="cch-page-"] .btn-row,
body[class*="cch-page-"] .module-inline-gap{display:flex;flex-wrap:wrap;gap:8px;align-items:center;}
body[class*="cch-page-"] .actions > button,
body[class*="cch-page-"] .toolbar > button,
body[class*="cch-page-"] .toolbar-row > button{width:auto;min-height:40px;}
body[class*="cch-page-"] .tableWrap,
body[class*="cch-page-"] .table-wrap{
  width:100%;max-width:100%;overflow:auto;border:1px solid var(--line);border-radius:16px;background:rgba(255,255,255,.62);-webkit-overflow-scrolling:touch;
}
body[class*="cch-page-"] table{width:100%;border-collapse:collapse;}
body[class*="cch-page-"] .output{min-height:360px;border-radius:18px;}
body[class*="cch-page-"] .status,
body[class*="cch-page-"] .filehint,
body[class*="cch-page-"] .db-library-status,
body[class*="cch-page-"] .plan-auto-status,
body[class*="cch-page-"] #modeStatus{line-height:1.45;}
body[class*="cch-page-"] .status.ok,
body[class*="cch-page-"] .filehint.ok,
body[class*="cch-page-"] .db-library-status.ok,
body[class*="cch-page-"] .plan-auto-status.ok{color:#15713a;background:#f0fff5;border-color:#bcebcf;}
body[class*="cch-page-"] .status.warn,
body[class*="cch-page-"] .filehint.warn,
body[class*="cch-page-"] .db-library-status.warn,
body[class*="cch-page-"] .plan-auto-status.warn{color:#9a3412;background:#fff7ed;border-color:#fed7aa;}
body[class*="cch-page-"] .modal-backdrop,
body[class*="cch-page-"] .cch-admin-modal{z-index:2147482000;}
body[class*="cch-page-"] .modal-card,
body[class*="cch-page-"] .cch-admin-modal__dialog{border-radius:24px;box-shadow:0 24px 80px rgba(15,23,42,.28);}
.mt-8{margin-top:8px!important}.mt-10{margin-top:10px!important}.mt-12{margin-top:12px!important}.mt-14{margin-top:14px!important}.mt-16{margin-top:16px!important}.mt-18{margin-top:18px!important}
.mb-0{margin-bottom:0!important}.w-auto{width:auto!important}.text-muted{color:var(--muted)!important}.hidden{display:none!important}
@media (min-width:1600px){body[class*="cch-page-"] .layout:not(.layout-single):not(.single){grid-template-columns:minmax(340px, var(--cch-sidebar)) minmax(0, 1fr);}}
@media (max-width:1400px){body[class*="cch-page-"] .layout{grid-template-columns:1fr;}body[class*="cch-page-"] aside.stack,body[class*="cch-page-"] aside.card{position:static!important;top:auto!important;}body[class*="cch-page-"] .grid4{grid-template-columns:repeat(2,minmax(0,1fr));}}
@media (max-width:980px){body[class*="cch-page-"] .grid2,body[class*="cch-page-"] .grid3,body[class*="cch-page-"] .grid4,body[class*="cch-page-"] .form-grid,body[class*="cch-page-"] .form-grid-3,body[class*="cch-page-"] .builder-grid{grid-template-columns:1fr;}}
/* =========================================================
   CCH Mobile CSS – Hard Layout Override
   Loaded after cch-core.css and cch-nav.css.
   ========================================================= */

@media (max-width: 1100px) {
  html,
  body {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

  body {
    margin: 0 !important;
    padding: 0 !important;
  }

  .wrap,
  body .wrap,
  body[class*="cch-page-"] .wrap {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 10px !important;
  }

  .layout,
  body[class*="cch-page-"] .layout {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .grid2,
  .grid3,
  .grid4,
  .form-grid,
  .form-grid-3,
  .pair-grid,
  .builder-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    width: 100% !important;
    max-width: 100% !important;
    gap: 12px !important;
  }

  .stack,
  .stack-md {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-width: 100% !important;
    gap: 12px !important;
  }

  .stack-md > * + * {
    margin-top: 0 !important;
  }

  .card {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 0 12px 0 !important;
    padding: 14px !important;
    border-radius: 16px !important;
  }

  input,
  select,
  textarea {
    width: 100% !important;
    max-width: 100% !important;
    font-size: 16px !important;
  }

  button,
  .btn,
  .btn-primary,
  .btn-soft,
  .btn-ok,
  .btn-danger,
  .btn-inline {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 44px;
  }

  .actions,
  .toolbar-row,
  .secondary-actions,
  .quick-actions,
  .action-grid,
  .btn-row,
  .module-inline-gap {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 8px !important;
    width: 100% !important;
  }

  .tableWrap,
  .table-wrap {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  table {
    min-width: 760px;
  }

  .modal-backdrop {
    align-items: flex-end !important;
  }

  .modal-card {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 92vh !important;
    border-radius: 22px 22px 0 0 !important;
    padding: 16px !important;
  }

  .checkitem input[type="checkbox"],
  input[type="checkbox"] {
    width: auto !important;
    min-height: auto !important;
  }
}

@media (max-width: 760px) {
  h1,
  .cch-page-title {
    font-size: clamp(23px, 7vw, 31px) !important;
    line-height: 1.08 !important;
  }

  h2 {
    font-size: 18px !important;
  }

  .tiny,
  .week-help,
  .small-note,
  .muted-note,
  .cch-page-subtitle,
  .page-subtitle {
    font-size: 12px !important;
    line-height: 1.45 !important;
  }

  th,
  td {
    padding: 8px 9px !important;
    font-size: 12px;
  }

  body.cch-page-cch-monatsplan #planTable {
    min-width: 1180px;
  }
}

@media (max-width: 480px) {
  .wrap,
  body .wrap,
  body[class*="cch-page-"] .wrap {
    padding: 7px !important;
  }

  .card {
    padding: 11px !important;
  }

  .cch-app-topbar-inner {
    width: 100% !important;
    padding-left: 8px !important;
    padding-right: 8px !important;
  }

  .cch-app-title-text span {
    display: none !important;
  }
}

@media print {
  .cch-app-topbar,
  .cch-drawer,
  .cch-drawer-backdrop,
  .modal-backdrop {
    display: none !important;
  }

  .wrap,
  body .wrap {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
  }
}

/* =========================================================
   CCH MOBILE STANDARD v1.0.0
   Einheitlicher Mobile-Layer für alle CCH-Module.
   ========================================================= */
@media (max-width:1100px){
  body[class*="cch-page-"]{overflow-x:hidden!important;}
  body[class*="cch-page-"] .wrap,body .cch-module-wrap{width:100%!important;max-width:100%!important;margin:0!important;padding:10px!important;transform:none!important;}
  body[class*="cch-page-"] .layout,body .cch-module-layout{display:grid!important;grid-template-columns:1fr!important;gap:12px!important;width:100%!important;max-width:100%!important;transform:none!important;}
  body[class*="cch-page-"] .pair-grid,body[class*="cch-page-"] .grid2,body[class*="cch-page-"] .grid3,body[class*="cch-page-"] .grid4,body[class*="cch-page-"] .form-grid,body[class*="cch-page-"] .form-grid-3,body[class*="cch-page-"] .builder-grid{grid-template-columns:1fr!important;gap:12px!important;}
  body[class*="cch-page-"] .stack,body[class*="cch-page-"] .stack-md{gap:12px!important;}
  body[class*="cch-page-"] .card{width:100%!important;max-width:100%!important;margin:0 0 12px!important;border-radius:18px!important;padding:14px!important;}
  body[class*="cch-page-"] .card.collapsible{padding:0!important;}
  body[class*="cch-page-"] .card-body,body[class*="cch-page-"] .week-body,body[class*="cch-page-"] .th-body,body[class*="cch-page-"] .area-body{padding:14px!important;}
  body[class*="cch-page-"] .section-head,body[class*="cch-page-"] .card-header,body[class*="cch-page-"] .week-head,body[class*="cch-page-"] .th-head,body[class*="cch-page-"] .area-head{align-items:flex-start!important;padding:13px 14px!important;}
  body[class*="cch-page-"] .section-toggle,body[class*="cch-page-"] .collapse-toggle,body[class*="cch-page-"] .week-toggle{width:38px!important;min-width:38px!important;max-width:38px!important;height:38px!important;}
  body[class*="cch-page-"] input,body[class*="cch-page-"] select,body[class*="cch-page-"] textarea{width:100%!important;max-width:100%!important;font-size:16px!important;}
  body[class*="cch-page-"] button,body[class*="cch-page-"] .btn,body[class*="cch-page-"] .btn-primary,body[class*="cch-page-"] .btn-soft,body[class*="cch-page-"] .btn-ok,body[class*="cch-page-"] .btn-danger,body[class*="cch-page-"] .btn-inline{width:100%!important;max-width:100%!important;min-height:44px!important;}
  body[class*="cch-page-"] .section-toggle,body[class*="cch-page-"] .collapse-toggle,body[class*="cch-page-"] .week-toggle,body[class*="cch-page-"] input[type="checkbox"],body[class*="cch-page-"] input[type="radio"]{width:auto!important;}
  body[class*="cch-page-"] .actions,body[class*="cch-page-"] .toolbar,body[class*="cch-page-"] .toolbar-row,body[class*="cch-page-"] .secondary-actions,body[class*="cch-page-"] .quick-actions,body[class*="cch-page-"] .action-grid,body[class*="cch-page-"] .btn-row,body[class*="cch-page-"] .module-inline-gap{display:grid!important;grid-template-columns:1fr!important;gap:8px!important;width:100%!important;}
  body[class*="cch-page-"] .tableWrap,body[class*="cch-page-"] .table-wrap{width:100%!important;max-width:100%!important;overflow-x:auto!important;}
  body[class*="cch-page-"] table{min-width:760px;}
  body[class*="cch-page-"] .modal-backdrop{align-items:flex-end!important;padding:0!important;}
  body[class*="cch-page-"] .modal-card,body[class*="cch-page-"] .cch-admin-modal__dialog{width:100%!important;max-width:100%!important;max-height:92vh!important;margin:0!important;border-radius:22px 22px 0 0!important;padding:16px!important;}
}
@media (max-width:560px){body[class*="cch-page-"] .wrap{padding:8px!important;}body[class*="cch-page-"] .card{padding:12px!important;}body[class*="cch-page-"] .card.collapsible{padding:0!important;}body[class*="cch-page-"] .card-body,body[class*="cch-page-"] .week-body,body[class*="cch-page-"] .th-body,body[class*="cch-page-"] .area-body{padding:12px!important;}}
@media print{body[class*="cch-page-"] .wrap,body .wrap{width:100%!important;max-width:100%!important;margin:0!important;padding:0!important;transform:none!important;}body[class*="cch-page-"] .layout{display:block!important;}}

/* Optionaler Altmodul-Override. Nach lokalen <style>-Blöcken laden. */
body[class*="cch-page-"] .pair-grid{grid-template-columns:1fr!important;}
body.cch-page-cch-beschwerde .pair-grid{grid-template-columns:1fr!important;}
body.cch-page-cch-beschwerde .layout{grid-template-columns:1fr!important;}
body.cch-page-cch-beschwerde .wrap{width:min(calc(100% - 40px), var(--cch-wrap-max))!important;max-width:var(--cch-wrap-max)!important;padding:var(--cch-wrap-pad-y) 0 56px!important;}
body.cch-page-cch-dienstplan-erstellen .wrap{width:min(calc(100% - 40px), var(--cch-wrap-max))!important;max-width:var(--cch-wrap-max)!important;margin-left:auto!important;margin-right:auto!important;transform:none!important;padding:var(--cch-wrap-pad-y) 0 56px!important;}
body.cch-page-cch-dienstplan-erstellen .layout{grid-template-columns:minmax(var(--cch-sidebar), .38fr) minmax(0,1fr)!important;}
@media(max-width:1400px){body.cch-page-cch-dienstplan-erstellen .layout{grid-template-columns:1fr!important}}
@media(max-width:1100px){body.cch-page-cch-beschwerde .wrap,body.cch-page-cch-dienstplan-erstellen .wrap{width:100%!important;max-width:100%!important;padding:10px!important}}
