:root{
  --blau:#143d69;
  --hellgrau:#bdc3c7;
  --schriftgrau:#34495e;
  --hintergrund:#f4f7f9;
  --weiss:#ffffff;
  --akzent-rot:#c0392b;
  --akzent-gruen:#27ae60;
}

/* ====== Basis ====== */
body{
  font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;
  margin:0; background:var(--hintergrund); color:var(--schriftgrau);
}
.hidden{display:none!important}

/* ====== Login ====== */
.login-container{display:flex;flex-direction:column;height:100vh}
.login-header{flex-shrink:0;background:var(--blau);padding:1rem 2rem;box-shadow:0 2px 4px rgba(0,0,0,.1)}
img.logo{height:55px;width:auto}
.login-main{flex:1;display:flex;justify-content:center;align-items:center;padding:2rem}
.login-box{background:var(--weiss);padding:2.5rem;border-radius:12px;box-shadow:0 8px 30px rgba(0,0,0,.08);width:100%;max-width:400px}
.login-box .form-actions{justify-content:center;margin-top:2rem}
.login-button{width:100%;padding:.8rem;font-size:1rem;background:var(--blau)!important}
.input-group{position:relative;margin-bottom:2rem}
.input-group input{width:100%;padding:10px 0;font-size:1rem;border:0;border-bottom:2px solid var(--hellgrau);outline:0;background:transparent}
.input-group label{position:absolute;top:10px;left:0;font-size:1rem;color:var(--hellgrau);pointer-events:none;transition:.2s}
.input-group input:focus+label,.input-group input:valid+label{top:-15px;font-size:.8rem;color:var(--blau)}
.input-group input:focus{border-bottom-color:var(--blau)}

/* ====== App Layout ====== */
.module{display:flex;flex-direction:column;height:100vh}
.module-header{flex-shrink:0;background:var(--blau);color:#fff;padding:1rem 2rem;display:flex;justify-content:space-between;align-items:center;box-shadow:0 2px 4px rgba(0,0,0,.1);gap:1rem;flex-wrap:wrap}
.module-header h1,.module-header h2{margin:0;white-space:nowrap}
.module-content{flex:1;padding:2rem;overflow-y:auto}

.dashboard-main{display:flex;flex-wrap:wrap;gap:2rem;justify-content:center;padding:1rem 0}
.tile{background:var(--weiss);border-radius:8px;box-shadow:0 4px 8px rgba(0,0,0,.1);width:280px;padding:1.5rem;cursor:pointer;transition:.2s; border-left:5px solid var(--blau)}
.tile:hover{transform:translateY(-5px);box-shadow:0 6px 12px rgba(0,0,0,.15)}
.tile h2{margin-top:0;color:var(--blau)}

.content-area,.form-container{background:var(--weiss);padding:2rem;border-radius:8px;box-shadow:0 2px 4px rgba(0,0,0,.1);max-width:1200px;margin:0 auto}
.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:1.5rem}
.form-group{display:flex;flex-direction:column;gap:.5rem;margin-bottom:1rem}
.form-actions{display:flex;justify-content:flex-end;gap:1rem;margin-top:1.5rem;grid-column:1/-1}

.data-table{width:100%;border-collapse:collapse;background:var(--weiss)}
.data-table th,.data-table td{border:1px solid var(--hellgrau);padding:.75rem;text-align:left;vertical-align:middle}
.data-table th{background:var(--blau);color:#fff;text-align:center}

.content-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:1.5rem;flex-wrap:wrap;gap:1rem}
.roster-table-container{overflow-x:auto}
.roster-table-container td{vertical-align:top;min-height:80px;cursor:pointer}

.shift{background:#e9ecef;color:var(--schriftgrau);border-left:4px solid var(--blau);padding:.5rem;border-radius:4px;margin-bottom:.5rem;font-size:.9rem;cursor:pointer;position:relative}
.shift:hover{background:#dee2e6}
.shift strong{display:block}
.delete-shift-btn{position:absolute;top:1px;right:4px;background:none;border:none;color:var(--hellgrau);cursor:pointer;font-weight:700;font-size:1.2rem}
.delete-shift-btn:hover{color:var(--akzent-rot)}

button{padding:.6rem 1.2rem;border-radius:4px;border:none;background:var(--hellgrau);color:var(--schriftgrau);font-weight:700;cursor:pointer;transition:filter .2s}
button.primary,button[type="submit"]{background:var(--blau);color:#fff}
button.danger{background:var(--akzent-rot);color:#fff}
button:hover{filter:brightness(.95)}
.back-button{margin-bottom:1.5rem}

input,select{padding:.8rem;border-radius:4px;border:1px solid var(--hellgrau);width:100%;box-sizing:border-box;font-size:1rem;background:#fff}
.search-input{min-width:200px}
#object-content-area > .filter-controls{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;align-items:center;margin:0 0 20px}
#object-content-area > .filter-controls > input,#object-content-area > .filter-controls > select{width:100%;min-width:0;height:48px;margin:0;box-sizing:border-box}
@media(max-width:850px){#object-content-area > .filter-controls{grid-template-columns:repeat(2,minmax(0,1fr))}#object-content-area #object-search-input{grid-column:1/-1}}
@media(max-width:500px){#object-content-area > .filter-controls{grid-template-columns:minmax(0,1fr)}}
.week-navigation{display:flex;align-items:center;gap:.5rem}

#toast-notification{position:fixed;bottom:20px;left:50%;transform:translateX(-50%);padding:1rem 2rem;border-radius:8px;color:#fff;box-shadow:0 4px 12px rgba(0,0,0,.2);z-index:2000;opacity:0;transition:opacity .5s,bottom .5s;pointer-events:none}
#toast-notification.show{opacity:1;bottom:30px}
#toast-notification.success{background:var(--akzent-gruen)}
#toast-notification.error{background:var(--akzent-rot)}

.modal{position:fixed;z-index:1000;inset:0;background:rgba(0,0,0,.5);display:flex;justify-content:center;align-items:center}
.modal-content{background:var(--weiss);border-radius:8px;width:90%;max-width:500px;padding:2rem;position:relative}
.close-button{position:absolute;top:10px;right:20px;font-size:2rem;font-weight:700;cursor:pointer;color:var(--hellgrau)}

.employee-search-group{position:relative}
.search-results-list{position:absolute;top:100%;left:0;right:0;background:var(--weiss);border:1px solid var(--hellgrau);border-top:none;border-radius:0 0 4px 4px;max-height:150px;overflow-y:auto;z-index:1001}
.search-results-list div{padding:.8rem;cursor:pointer}
.search-results-list div:hover{background:var(--hintergrund)}

.roster-table-container .data-table td.is-sunday{background:#fffbe6}
.roster-table-container .data-table td.is-holiday{background:#ffebee}

.weekday-checkboxes{display:flex;flex-wrap:wrap;gap:1.5rem;padding-top:.5rem;justify-content:space-between}
.weekday-checkboxes label{display:flex;align-items:center;gap:.3rem;cursor:pointer;font-size:.9rem}
.weekday-checkboxes input[type="checkbox"]{width:auto;margin:0}

.report-tile{text-align:center}
.report-value{font-size:3rem;font-weight:700;color:var(--blau);line-height:1;margin-bottom:.75rem}
.report-tile h2{font-size:1.2rem}

/* Abwesenheiten */
.absence-entry{padding:.5rem;color:#fff;border-radius:4px;margin:2px 0;font-size:.9em;cursor:pointer;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.absence-entry.sick{background:var(--akzent-rot)}
.absence-entry.vacation{background:#f39c12}

/* Dashboard Kacheln kompakt */
.dashboard-main .tile{width:250px;padding:1.2rem}
.dashboard-main .tile h2{font-size:1.1rem}
.dashboard-main .tile p{font-size:.9rem}
.dashboard-main .report-tile h2{font-size:1rem}

/* Bemerkungskarten im Raster */
.remark{
  background:#e74c3c;color:#fff;border-left:4px solid #c0392b;padding:.5rem;border-radius:4px;margin-top:.5rem;font-size:.9rem;cursor:pointer;position:relative;word-wrap:break-word
}
.remark:hover{background:#c0392b}
.remark strong{display:block;font-weight:600}
.remark span{font-size:.9em;display:block;margin-top:2px}

/* Suche im Header */
.header-actions .employee-search-group{position:relative;display:inline-block}
.header-actions .search-input{min-width:220px}

/* Zusatzbreite für Intervall-Feld in Templates */
.template-shift-row .form-group.week-type-selector{flex-grow:1.5}

/* ====== Print ====== */
@media print{
  /* Querformat für Browser-Seitendruck des Wochenrasters */
  @page{size:A4 landscape;margin:10mm}

  /* Bemerkungen im Druck klar */
  .assignment .note,
  .remark{
    background:none!important;
    color:#000!important;
    border-left:3px solid #c0392b!important;
    font-size:12px;
    padding-left:6px;
  }
  .assignment .note strong,
  .remark strong{font-weight:700}
  .assignment .note span,
  .remark span{font-size:.85em}
}

#shift-template-modal .modal-content {
  max-height: 85vh; /* Legt die maximale Höhe auf 85% der Bildschirmhöhe fest */
  overflow-y: auto; /* Fügt eine Scrollleiste hinzu, wenn der Inhalt höher ist */
}

/* Stil für offene, unbesetzte Schichten */
.shift-open {
  background: #fff0f0; /* Heller, dezenter Rotton als Hintergrund */
  color: var(--akzent-rot);
  border-left: 4px solid var(--akzent-rot);
  padding: .5rem;
  border-radius: 4px;
  margin-bottom: .5rem;
  font-size: .9rem;
  cursor: pointer;
  position: relative;
}

.shift-open strong {
  display: block;
  font-weight: 700; /* Stellt sicher, dass "OFFEN" fett gedruckt ist */
}

.shift-open:hover {
  background: #ffdbdb; /* Etwas dunklerer Rotton beim Darüberfahren */
}

/* Ausgefallene Besetzung bleibt lesbar; nur der Name wird durchgestrichen. */
.shift-sick, .shift-vacation {
  background: #fff0f0;
  color: var(--akzent-rot);
  border-left: 4px solid var(--akzent-rot);
  padding: .5rem;
  border-radius: 4px;
  margin-bottom: .5rem;
  font-size: .9rem;
  cursor: default;
}
.shift-vacation { background: #fff8e6; color: #795400; border-left-color: #f39c12; }
.shift-sick strong, .shift-vacation strong { display: block; }
.shift-sick s, .shift-vacation s { text-decoration: line-through; }

/* BLÄSER roster: same calm navy and pale table colors as PDF exports. */
#roster-module .content-header{background:#173f67;color:#fff;padding:22px 24px;border-radius:14px;margin-bottom:20px;box-shadow:0 6px 18px #173f6714}
#roster-module .content-header h2{color:#fff;margin:0}
#roster-module .content-header button{border-radius:8px;min-height:42px}
.roster-table-container{border:1px solid #d9e2ea;border-radius:12px;background:#fff;box-shadow:0 4px 15px #173f6708}
.roster-table-container .data-table th{background:#e8eff5;color:#173f67;border-color:#d9e2ea;padding:15px 10px}
.roster-table-container .data-table td{border-color:#d9e2ea;padding:12px;background:#fff}
.roster-table-container .shift{background:#f0f5fa;border:1px solid #d9e5ee;border-left:4px solid #173f67;border-radius:8px;padding:10px 22px 10px 10px;color:#29445b;line-height:1.5}
.roster-table-container .shift:hover{background:#e5eff8;box-shadow:0 2px 7px #173f6714}
.roster-table-container .shift-open{background:#fff8e6;border-left-color:#ce8a1e}
.planning-month-control{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:12px 0;font-weight:600}.planning-month-control input{width:auto;min-width:180px;margin:0;background:#fff;color:#173f67;border:1px solid #cad9e6;border-radius:8px;padding:9px 12px;font:inherit}@media print{.planning-month-control{display:none}}

.overplanned-summary {background:#fff7ec;border:1px solid #e7b06c;border-radius:10px;padding:20px;margin:0 0 24px;color:#59390f;}
.overplanned-summary[hidden] {display:none;}
.overplanned-heading,.overplanned-person {display:flex;justify-content:space-between;align-items:center;gap:16px;flex-wrap:wrap;}
.overplanned-heading h3 {margin:0;color:#714612;}
.overplanned-person {padding:14px 0;border-top:1px solid #ead4b6;}
.overplanned-person span {flex:1;min-width:240px;font-weight:600;}
.overplanned-summary button {border:1px solid #b7884d;background:white;color:#654014;padding:10px 14px;border-radius:6px;font:inherit;cursor:pointer;}
#roster-module .shift-overplanned {border-left:5px solid #d67411;background:#fff0da;box-shadow:0 0 0 1px #d67411;}
.overplanned-badge {display:block!important;font-size:11px;font-weight:700;color:#8a4600;margin-top:5px;}
@media(max-width:600px){.overplanned-person span{min-width:100%;}.overplanned-summary{padding:14px;}}
#employee-content-area > .filter-controls {display:grid;grid-template-columns:minmax(220px,1.4fr) minmax(200px,1fr) minmax(140px,.7fr);gap:12px;align-items:center;margin:20px 0;}
#employee-content-area > .filter-controls > input,#employee-content-area > .filter-controls > select {width:100%;min-width:0;margin:0;box-sizing:border-box;}
@media(max-width:850px){#employee-content-area > .filter-controls{grid-template-columns:1fr 1fr;}#employee-search-input{grid-column:1/-1;}}
@media(max-width:500px){#employee-content-area > .filter-controls{grid-template-columns:1fr;}}

.planning-period-controls{display:flex;align-items:center;gap:16px;flex-wrap:wrap;margin:12px 0}.planning-period-controls .planning-month-control{margin:0}.planning-period-controls .week-navigation{gap:8px}.planning-period-controls .week-navigation input{margin:0;width:auto;min-width:175px;padding:9px 12px;border:1px solid #cad9e6;border-radius:8px;background:#fff;color:#173f67;font:inherit}.planning-period-controls .week-navigation button{margin:0;min-width:42px;padding:10px 14px;border:1px solid #cad9e6;border-radius:8px;background:#edf4f9;color:#173f67}.planning-period-controls .week-navigation button:hover{background:#dceaf5}@media(max-width:600px){.planning-period-controls{gap:10px}.planning-period-controls .week-navigation{width:100%}.planning-period-controls .week-navigation input{flex:1;min-width:0}}

.search-results-list{color:#29445b;background:#fff}
#roster-employee-list-container{max-height:260px;border:1px solid #dce5ee;border-radius:8px;box-shadow:0 8px 24px #173f6720;padding:4px}
#roster-employee-list-container .roster-employee-result{display:block;width:100%;margin:0;padding:12px;text-align:left;color:#173f67;background:#fff;border:0;border-radius:5px;font:inherit;white-space:normal;cursor:pointer}
#roster-employee-list-container .roster-employee-result:hover,#roster-employee-list-container .roster-employee-result:focus-visible{background:#eaf2f9;color:#173f67;outline:2px solid #83b4df;outline-offset:-2px}
#roster-employee-list-container .roster-search-empty{color:#657b8f;padding:12px;cursor:default}


/* One aligned row for roster actions and employee/object/region filters. */
#roster-module .content-header-left{width:100%;min-width:0}
#roster-module .roster-toolbar{display:grid;grid-template-columns:max-content max-content repeat(3,minmax(0,1fr)) minmax(130px,.75fr);gap:10px;align-items:center;width:100%}
#roster-module .roster-toolbar > .employee-search-group{display:block;min-width:0}
#roster-module .roster-toolbar > button,#roster-module .roster-toolbar > input,#roster-module .roster-toolbar > select,#roster-module .roster-toolbar .employee-search-group > input{width:100%;min-width:0;height:48px;margin:0;box-sizing:border-box}
#roster-module .roster-toolbar > input,#roster-module .roster-toolbar > select,#roster-module .roster-toolbar .employee-search-group > input{color:#173f67;background:#fff;border:1px solid #cad9e6;border-radius:8px}
@media(max-width:1300px){#roster-module .roster-toolbar{grid-template-columns:repeat(4,minmax(0,1fr))}#roster-module .roster-toolbar > button{grid-column:span 2}}
@media(max-width:1000px){#roster-module .roster-toolbar{grid-template-columns:repeat(2,minmax(0,1fr))}#roster-module .roster-toolbar > button{grid-column:auto}}
@media(max-width:560px){#roster-module .roster-toolbar{grid-template-columns:minmax(0,1fr)}}

/* Native disclosure preserves its open state when the roster refreshes. */
#overplanned-summary > summary{cursor:pointer;color:#714612;font-weight:700;line-height:1.5}
#overplanned-summary > summary:focus-visible{outline:3px solid #b7884d;outline-offset:5px;border-radius:3px}
#overplanned-summary .overplanned-count{display:inline-block;margin-left:12px;padding:2px 8px;border-radius:6px;background:#f5e6d1;font-size:.9em;white-space:nowrap}
#overplanned-summary .overplanned-body{margin-top:16px}
#overplanned-summary .overplanned-heading{justify-content:flex-end}

.roster-print-dialog{border:1px solid #d6e2ec;border-radius:16px;padding:26px;color:#173f67;max-width:min(560px,90vw)}
.roster-print-dialog::backdrop{background:#10283a66}
.roster-print-options{display:flex;flex-wrap:wrap;gap:12px;margin-top:20px}
