/* ============================================================
   Dienstplan – Stylesheet (Darkmode)
   Farben: Polizeiblau #0061A7 und Gelb #FDC300 wie im Excel-Dienstplan.
   Aufbau: 1 Variablen · 2 Grundlagen · 3 Kopfzeile · 4 Buttons/Formulare
           5 Login/Karten · 6 Startseite · 7 Zeiträume-Seite · 8 Wochenplan
           9 Jahresplan · 10 Kürzel-Auswahl und Wochenliste · 11 Handy
   ============================================================ */

/* 1 · Variablen – Standard ist hell; der Darkmode überschreibt sie unten (wird über assets/js/theme.js gesetzt) */
:root {
  color-scheme: light;
  --namew: 185px;            /* Breite der festen Namensspalte (am Handy schmaler) */
  --bg: #f1f5fa;
  --surface: #ffffff;
  --surface-2: #eef3f9;
  --surface-3: #e2eaf4;
  --border: #d6e0ec;
  --border-strong: #b3c4d8;
  --text: #14233a;
  --muted: #587089;
  --topbar-bg: rgba(255, 255, 255, .92);

  --primary: #0061a7;        /* Polizeiblau (Excel) */
  --primary-hover: #004f89;
  --primary-soft: rgba(0, 97, 167, .12);
  --primary-text: #0061a7;
  --accent: #fdc300;         /* Gelb (Excel: heutiger Tag) */
  --accent-text: #8a6500;    /* Gelb als Schrift auf hellem Grund */
  --focus: #0061a7;

  --danger: #e3000f;         /* Excel: Ruhezeit / fehlt */
  --danger-soft: rgba(227, 0, 15, .08);
  --err-text: #a3000c;
  --ok-text: #14532d;
  --ok-bg: rgba(166, 218, 188, .35);
  --success: #a6dabc;        /* Excel: Stärke erfüllt */
  --success-text: #004d20;

  --weekend: #e6eef8;
  --holiday: #f6d8e0;
  /* Zeiträume färben die ganze Spalte */
  --c-school: #feeaa6;       /* Ferien (Excel) */
  --c-event: #4cc9a0;        /* Veranstaltung */
  --c-other: #ba86e6;        /* Sonstiges */
  --tint-school: rgba(254, 214, 90, .5);
  --tint-event: rgba(76, 201, 160, .32);
  --tint-other: rgba(186, 134, 230, .3);
  --today: rgba(253, 195, 0, .3);
  --empty: #a7b6c9;          /* Platzhalter "–" in leeren Zellen */
  --weekline: #5d84b6;       /* Linie vor jedem Montag im Jahresplan */
  --srow: #51647d;           /* Zahlen in der Stärke-Übersicht */
  --auth-glow1: rgba(0, 97, 167, .16);
  --auth-glow2: rgba(253, 195, 0, .18);

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(20, 35, 58, .08), 0 8px 24px rgba(20, 35, 58, .08);
  --shadow-lg: 0 14px 40px rgba(20, 35, 58, .22);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #08121f;
  --surface: #0f2038;
  --surface-2: #132a47;
  --surface-3: #1a3558;
  --border: #1f3a5c;
  --border-strong: #2f5586;
  --text: #e8eef6;
  --muted: #8fa5bf;
  --topbar-bg: rgba(8, 18, 31, .92);

  --primary-hover: #0a77c8;
  --primary-soft: rgba(0, 97, 167, .22);
  --primary-text: #6cb6ee;
  --accent-text: #fdc300;
  --focus: #fdc300;

  --danger-soft: rgba(227, 0, 15, .16);
  --err-text: #ffb4b9;
  --ok-text: #b7ebcb;
  --ok-bg: rgba(166, 218, 188, .12);

  --weekend: #17335a;
  --holiday: #4a1d2e;
  --tint-school: rgba(254, 234, 166, .24);
  --tint-event: rgba(76, 201, 160, .26);
  --tint-other: rgba(186, 134, 230, .26);
  --today: rgba(253, 195, 0, .12);
  --empty: #3f5775;
  --weekline: #6f95c4;
  --srow: #9fb3cc;
  --auth-glow1: rgba(0, 97, 167, .55);
  --auth-glow2: rgba(253, 195, 0, .14);

  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 8px 24px rgba(0, 0, 0, .25);
  --shadow-lg: 0 14px 40px rgba(0, 0, 0, .5);
}
/* 2 · Grundlagen */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: Inter, "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
}
h1 { font-size: 1.45rem; line-height: 1.2; margin: 0; letter-spacing: -.02em; }
h2 { font-size: 1.05rem; margin: 0 0 12px; }
a { color: var(--primary-text); }
.muted { color: var(--muted); margin: 4px 0 0; }
.hint { color: var(--muted); font-size: .85rem; margin: 12px 0 0; }
.page { max-width: 1000px; margin: 0 auto; padding: 24px 20px 40px; }
.page-wide { max-width: none; padding: 12px 16px 16px; }
.page-title { margin-bottom: 16px; }
.page-title h1::after { content: ""; display: block; width: 44px; height: 4px; margin-top: 8px; border-radius: 2px; background: var(--accent); }
/* breite Planseiten: Titel und Hinweis in einer Zeile, spart Platz */
.page-wide .page-title { float: left; margin: 0 16px 8px 0; }
.page-wide .page-title h1 { font-size: 1.25rem; }
.page-wide .page-title h1::after { display: none; }
.page-wide .page-title .muted { display: none; }

/* 3 · Kopfzeile */
.topbar { position: sticky; top: 0; z-index: 30; background: var(--topbar-bg); backdrop-filter: blur(10px);
          border-bottom: 1px solid var(--border); box-shadow: 0 2px 0 var(--primary); }
.topbar-inner { display: flex; align-items: center; gap: 12px; margin: 0 auto; padding: 6px 16px; }
.topbar form { margin: 0; }
.spacer { flex: 1; }
.backlink { display: inline-flex; align-items: center; gap: 4px; padding: 5px 12px 5px 8px; border: 1px solid var(--border-strong); border-radius: 999px; color: var(--text);
             background: var(--surface); text-decoration: none; font-size: .85rem; font-weight: 600; white-space: nowrap; }
.backlink:hover { background: var(--primary); border-color: var(--primary); color: #fff; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1rem; color: var(--text); text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; color: var(--accent);
              background: var(--primary); box-shadow: inset 0 0 0 2px rgba(253, 195, 0, .55); }
.user-chip { display: flex; align-items: center; gap: 8px; padding: 3px 12px 3px 3px; border-radius: 999px;
             color: var(--text); text-decoration: none; background: var(--surface); border: 1px solid var(--border); }
.user-chip:hover { border-color: var(--border-strong); }
.avatar { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--accent);
          color: #1b1500; font-size: .75rem; font-weight: 700; }
.user-name { font-size: .85rem; font-weight: 500; }

/* Bestätigungsfenster (confirm.js) */
.dlg-backdrop { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 16px; background: rgba(8, 18, 31, .55); }
.dlg { width: min(440px, 100%); padding: 22px 24px 20px; background: var(--surface); color: var(--text); border: 1px solid var(--border-strong);
       border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.dlg h2 { margin: 0 0 8px; font-size: 1.1rem; }
.dlg p { margin: 0; color: var(--muted); font-size: .92rem; line-height: 1.5; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.dlg-head { display: flex; align-items: center; gap: 12px; margin: 0 0 8px; }
.dlg-head h2 { margin: 0; }
.dlg-alert { border-color: var(--danger); border-top: 6px solid var(--danger); }
.dlg-alert h2 { color: var(--err-text); }
.dlg-icon { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--danger); color: #fff; font-weight: 800; font-size: 1.1rem; }
.dlg-wide { width: min(580px, 100%); }
.dlg-details { margin-top: 14px; padding: 10px 14px; max-height: 38vh; overflow: auto; background: var(--danger-soft); border: 1px solid var(--danger); border-radius: var(--radius-sm); }
.dlg-sec + .dlg-sec { margin-top: 10px; }
.dlg-sec strong { color: var(--err-text); font-size: .86rem; }
.dlg-sec ul { margin: 4px 0 0; padding-left: 18px; font-size: .86rem; color: var(--text); line-height: 1.5; }
@media print { .dlg-backdrop { display: none !important; } }

/* Einstellungsmenü am Profil (Passwort ändern, Hell/Dunkel) */
.usermenu { position: relative; }
.usermenu summary { list-style: none; cursor: pointer; }
.usermenu summary::-webkit-details-marker { display: none; }
.user-chip .caret { color: var(--muted); font-size: .7rem; }
.usermenu .menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 50; min-width: 230px; padding: 6px;
                  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.menu-head { padding: 6px 10px 4px; font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.menu-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 9px 10px; border: 0;
             border-radius: var(--radius-sm); background: transparent; color: var(--text); font: inherit; text-align: left; text-decoration: none; cursor: pointer; }
.menu-item:hover { background: var(--surface-2); }
.switch { position: relative; flex: none; width: 36px; height: 20px; border-radius: 999px; background: var(--border-strong); transition: background .15s; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
[aria-pressed="true"] > .switch { background: var(--primary); }
[aria-pressed="true"] > .switch::after { transform: translateX(16px); }

/* Kopfzeile: Navigation mit Gruppen, Handy-Menü, Profilmenü */
.topbar-inner { min-height: 54px; }
.brand-mark { flex: none; }
.mainnav { display: flex; align-items: center; gap: 2px; margin-left: 14px; }
.navlink { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 9px 13px; border: 0; border-radius: 10px; background: transparent;
           color: var(--muted); font: inherit; font-size: .9rem; font-weight: 600; text-decoration: none; cursor: pointer; list-style: none; white-space: nowrap;
           transition: background .15s, color .15s; }
.navlink::-webkit-details-marker, .navgroup summary::-webkit-details-marker { display: none; }
.navlink:hover, .navgroup[open] > summary { background: var(--surface-2); color: var(--text); }
.navlink.active, .navgroup.active > summary { color: var(--primary-text); background: var(--primary-soft); box-shadow: inset 0 -3px 0 var(--accent); }
.navlink .caret { display: inline-flex; margin-left: -2px; opacity: .7; transition: transform .15s; }
.navgroup[open] > summary .caret { transform: rotate(180deg); }
.navgroup { position: relative; }
.navpanel { position: absolute; left: 0; top: calc(100% + 12px); z-index: 60; min-width: 340px; padding: 6px; background: var(--surface);
            border: 1px solid var(--border-strong); border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.navitem { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px; color: var(--text); text-decoration: none; }
.navitem:hover { background: var(--surface-2); }
.navitem.active { background: var(--primary-soft); }
.ni-icon { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: var(--primary-soft); color: var(--primary-text); }
.navitem:hover .ni-icon, .navitem.active .ni-icon { background: var(--primary); color: #fff; }
.ni-text strong { display: block; font-size: .92rem; }
.ni-text small { display: block; color: var(--muted); font-size: .78rem; line-height: 1.3; }
/* Handy-Menü (statt der Navigation) */
.mobilemenu { display: none; position: relative; }
.mm-btn { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface);
          color: var(--text); cursor: pointer; list-style: none; }
.mm-btn::-webkit-details-marker { display: none; }
.mobilemenu[open] > .mm-btn { background: var(--primary); border-color: var(--primary); color: #fff; }
.mm-panel { position: absolute; left: 0; top: calc(100% + 10px); z-index: 60; width: min(320px, 92vw); max-height: 80vh; overflow: auto; padding: 8px;
            background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.mm-head { padding: 10px 10px 4px; font-size: .68rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.mm-link { display: flex; align-items: center; gap: 12px; padding: 11px 10px; border-radius: 10px; color: var(--text); font-weight: 600; text-decoration: none; }
.mm-link:hover { background: var(--surface-2); }
.mm-link.active { background: var(--primary-soft); color: var(--primary-text); box-shadow: inset 3px 0 0 var(--accent); }
@media (max-width: 900px) {
  .mainnav { display: none; }
  .mobilemenu { display: block; }
}
/* Profilmenü: Name und Rolle oben, Abmelden unten */
.menu-user { display: flex; flex-direction: column; gap: 1px; padding: 8px 10px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--border); }
.menu-user small { color: var(--muted); font-size: .76rem; }
.menu-form { margin: 4px 0 0; padding-top: 4px; border-top: 1px solid var(--border); }
.menu-logout { color: var(--err-text); font-weight: 600; }
.menu-logout:hover { background: var(--danger-soft); }

.btn, button { font: inherit; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 14px; border-radius: var(--radius-sm);
       border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font-weight: 500; cursor: pointer;
       text-decoration: none; transition: background .15s, border-color .15s; }
.btn:hover { background: var(--surface-3); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #b8000c; border-color: #b8000c; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-block { width: 100%; padding: 11px 16px; }
.btn-sm { padding: 4px 10px; font-size: .85rem; }
input[type=text], input[type=password], input[type=number], input[type=date], select {
  font: inherit; color: var(--text); background: var(--surface-2); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); padding: 6px 9px;
}
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--focus); outline-offset: 2px;
}
select option, select optgroup { background: var(--surface); color: var(--text); }

/* 5 · Login und Karten */
.card { max-width: 440px; margin: 32px auto; padding: 28px; background: var(--surface); border: 1px solid var(--border);
        border-radius: var(--radius); box-shadow: var(--shadow); }
.card h1 { font-size: 1.4rem; margin-bottom: 4px; }
.card form { margin-top: 20px; }
.card label { display: block; margin-bottom: 14px; font-size: .85rem; font-weight: 500; color: var(--muted); }
.card input[type=text], .card input[type=password] { display: block; width: 100%; margin-top: 6px; padding: 10px 12px; }
.err { color: var(--err-text); background: var(--danger-soft); border: 1px solid rgba(227, 0, 15, .45); padding: 10px 12px;
       border-radius: var(--radius-sm); margin: 16px 0 0; font-size: .9rem; }
.ok { color: var(--ok-text); background: var(--ok-bg); border: 1px solid var(--success); padding: 10px 12px;
      border-radius: var(--radius-sm); margin: 0 0 16px; }
body.auth { min-height: 100vh; display: grid; place-items: center; padding: 16px;
            background: radial-gradient(900px 500px at 8% -10%, var(--auth-glow1) 0%, transparent 60%),
                        radial-gradient(700px 420px at 105% 110%, var(--auth-glow2) 0%, transparent 55%), var(--bg); }
.auth-card { width: 100%; box-shadow: var(--shadow-lg); margin: 0; border-top: 4px solid var(--accent); }
.auth-logo { display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 16px; border-radius: 14px;
             color: var(--accent); background: var(--primary); box-shadow: inset 0 0 0 2px rgba(253, 195, 0, .55); }

/* 6 · Startseite */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.tile { position: relative; display: block; padding: 22px; background: var(--surface); border-radius: var(--radius);
        color: inherit; text-decoration: none; box-shadow: var(--shadow); border: 1px solid var(--border);
        transition: transform .15s, border-color .15s, box-shadow .15s; }
a.tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--primary-hover); }
.tile-icon { display: grid; place-items: center; width: 46px; height: 46px; margin-bottom: 14px; border-radius: 12px;
             background: var(--primary-soft); color: var(--primary-text); }
.tile h2 { margin-bottom: 4px; font-size: 1.1rem; }
.tile p { margin: 0; color: var(--muted); font-size: .9rem; }
.tile-arrow { position: absolute; top: 20px; right: 20px; color: var(--muted); font-size: 1.2rem; transition: transform .15s, color .15s; }
a.tile:hover .tile-arrow { transform: translateX(4px); color: var(--accent-text); }
.tile.disabled { background: transparent; box-shadow: none; border: 1px dashed var(--border-strong); }
.tile.disabled .tile-icon { background: var(--surface-2); color: var(--muted); }
.badge { display: inline-block; margin-top: 12px; padding: 3px 10px; border-radius: 999px; background: var(--surface-2);
         color: var(--muted); font-size: .75rem; font-weight: 600; }

/* 7 · Zeiträume-Seite */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.pad { padding: 22px; margin-bottom: 20px; }
.form-grid { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
.form-grid label { display: flex; flex-direction: column; gap: 6px; font-size: .85rem; font-weight: 500; color: var(--muted); }
.form-grid label.grow { flex: 1; min-width: 220px; }
.list-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.list-head h2 { margin: 0; }
table.list { width: 100%; border-collapse: collapse; }
table.list th { text-align: left; font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
                padding: 8px 10px; border-bottom: 1px solid var(--border-strong); }
table.list td { padding: 10px; border-bottom: 1px solid var(--border); }
table.list td.right { text-align: right; }
table.list form { margin: 0; }
.sync-row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.sync-row form { margin: 0; }
.sync-row .hint { margin: 0; flex: 1; min-width: 260px; }
.muted-tag { color: var(--muted); font-size: .8rem; }
.kind { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; color: #000; }
.kind-holiday { background: var(--primary); color: #fff; }
.kind-school { background: var(--c-school); }
.kind-event { background: var(--c-event); }
.kind-other { background: var(--c-other); }

/* Mitarbeiter-Seite (Abschnitt 7): Gruppenzeilen, Rollen-Marken, Tauschknöpfe */
table.staff td.moves { white-space: nowrap; width: 1%; }
table.staff td.moves form { display: flex; gap: 2px; }
table.staff tr.staff-group th { padding: 10px 10px 4px; border-bottom: 1px solid var(--border-strong); color: var(--accent-text); font-size: .72rem; }
table.staff tr.inactive td { color: var(--muted); }
table.staff td.actions { white-space: nowrap; }
table.staff td.actions form { display: inline-block; margin: 0; }
.tablewrap.year { max-height: calc(100vh - 160px); }
.btn:disabled { opacity: .35; cursor: default; }
.role { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--surface-2); color: var(--muted); }
.role-planner { background: var(--primary-soft); color: var(--primary-text); }
.role-admin { background: var(--accent); color: #1b1500; }
.role-superadmin { background: #1b1500; color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); }

/* 8 · Wochenplan */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; min-height: 36px; margin-bottom: 8px; }
.segmented { display: inline-flex; align-items: center; background: var(--surface); border: 1px solid var(--border-strong);
             border-radius: var(--radius-sm); overflow: hidden; }
.segmented button, .segmented a, .segmented span { padding: 6px 12px; border: 0; background: transparent; cursor: pointer;
             font-weight: 500; color: var(--text); text-decoration: none; }
.segmented span { cursor: default; font-weight: 600; }
.segmented > * + * { border-left: 1px solid var(--border); }
.segmented button:hover, .segmented a:hover { background: var(--primary); color: #fff; }
.field-inline { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .85rem; font-weight: 500; }
.field-inline input[type=number] { width: 80px; }
.range { color: var(--text); font-weight: 600; margin-left: 4px; }
.status { color: var(--muted); font-size: .85rem; margin-left: auto; }

.tablewrap { overflow: auto; max-height: calc(100vh - 112px); }
table.plan { border-collapse: separate; border-spacing: 0; width: 100%; }
table.plan:not(.yeartable) { min-width: 760px; }
.plan th, .plan td { padding: 0; border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); text-align: center; }
.plan th:last-child, .plan td:last-child { border-right: 0; }

.plan thead th { position: sticky; top: 0; z-index: 3; background: var(--surface-2); padding: 3px 4px; font-weight: 600;
                 border-bottom: 2px solid var(--border-strong); line-height: 1.25; }
.dline { display: flex; align-items: baseline; gap: 6px; }
.plan th .dline { justify-content: center; }
.plan th .dt, .dline .dt { font-weight: 500; font-size: .72rem; color: var(--muted); }
.plan th.we { background: var(--weekend); }
.plan th.holiday { background: var(--primary); color: #fff; }
.plan th.holiday .dt { color: #cfe6f8; }
.plan th.p-school { box-shadow: inset 0 -4px 0 var(--c-school); }
.plan th.p-event { box-shadow: inset 0 -4px 0 var(--c-event); }
.plan th.p-other { box-shadow: inset 0 -4px 0 var(--c-other); }
.plan th.today { background: var(--accent); color: #1b1500; }
.plan th.today .dt { color: #3d3000; }
.tag { display: block; margin-top: 2px; padding: 0 5px; border-radius: 4px; font-size: .62rem; font-weight: 600; color: #000; }
.tag-holiday { background: #fff; color: var(--primary); }
.tag-school { background: var(--c-school); }
.tag-event { background: var(--c-event); }
.tag-other { background: var(--c-other); }

.plan th.name, .plan td.name { position: sticky; left: 0; z-index: 2; background: var(--surface); text-align: left;
                               white-space: nowrap; min-width: var(--namew); padding: 2px 10px; font-weight: 500; font-size: .84rem;
                               box-shadow: 1px 0 0 var(--border-strong); }
.plan thead th.name { z-index: 5; background: var(--surface-2); }
.plan tr.group th { background: var(--surface-3); text-align: left; padding: 1px 10px;
                    font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-text); font-weight: 700;
                    border-left: 3px solid var(--primary); }
.plan tr.group th:first-child { position: sticky; left: 0; z-index: 2; }
.plan tbody tr:not(.group):not(.strength):hover td.name { background: var(--surface-3); }

/* Zellen: Wochenenden, Feiertage und Zeiträume färben die ganze Spalte – auch ohne eingetragenen Dienst */
.plan td.cell { position: relative; height: 26px; padding: 2px 3px; background: var(--surface); }
.plan td.cell.we { background: var(--weekend); }
.plan td.cell.holiday { background: var(--holiday); }
.plan td.cell::before, .plan td.cell::after { content: ""; position: absolute; inset: 0; pointer-events: none; }
.plan td.cell.p-school::before { background: var(--tint-school); }
.plan td.cell.p-other::before { background: var(--tint-other); }
.plan td.cell.p-event::before { background: var(--tint-event); }
.plan td.cell.today::after { background: var(--today); }
.plan td.cell .code {
  position: relative; z-index: 1; display: block; width: 100%; height: 20px; border: 0; border-radius: 5px; background: transparent;
  color: var(--text); font-weight: 700; font-size: .74rem; text-align: center; line-height: 20px; padding: 0; font-family: inherit;
}
.plan td.cell .code.editable { cursor: pointer; }
.plan td.cell .code.editable:hover, .plan td.cell.editable:hover { box-shadow: inset 0 0 0 2px var(--accent); }
.plan td.cell .code.empty { color: var(--empty) !important; font-weight: 400; }
/* Ruhezeit: Nacht gefolgt von Früh (Excel: rot mit weißer Schrift) */
.plan td.warn .code { background: var(--danger) !important; color: #fff !important; }

/* Stärke */
.plan tr.strength-first td, .plan tr.strength-first th { border-top: 2px solid var(--border-strong); }
.plan tr.strength th.name { font-size: .78rem; color: var(--muted); font-weight: 600; }
.plan tr.strength td { padding: 3px 4px; font-size: .78rem; line-height: 1.25; font-weight: 700; }
.plan tr.strength td small { display: block; font-weight: 500; opacity: .85; }
.plan tr.strength td.good { background: var(--success); color: var(--success-text); }
.plan tr.strength td.bad { background: var(--danger); color: #fff; }

.legend { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; border: 1px solid var(--border-strong); }

/* 9 · Jahresplan */
table.yeartable { width: max-content; min-width: 100%; }
.plan th.name, .plan td.name { max-width: var(--namew); overflow: hidden; text-overflow: ellipsis; }
.yeartable td.cell { min-width: 38px; width: 38px; height: 22px; padding: 2px 1px; }
.yeartable td.editable { cursor: pointer; }
.yeartable td.cell .code { position: relative; z-index: 1; display: block; height: 18px; line-height: 18px; border-radius: 4px;
                           font-size: .6rem; font-weight: 700; text-align: center; white-space: nowrap; overflow: hidden; letter-spacing: -.03em; }
.yeartable td.warn { background: rgba(227, 0, 15, .3); }
.yeartable td.warn .code { background: var(--danger) !important; color: #fff !important; }
.yeartable th.daycol { min-width: 38px; width: 38px; padding: 3px 0; font-size: .72rem; }
.yeartable th .dline { flex-direction: column; align-items: center; gap: 0; line-height: 1.2; }
/* Wochengrenze: kräftige Linie vor jedem Montag, durch alle Zeilen (Spalte 1 = Name, Montage sind Spalte 2, 9, 16 ...) */
.yeartable th.daycol:nth-child(7n+2), .yeartable td:nth-child(7n+2):not(.name) { border-left: 2px solid var(--weekline); }
.yeartable tr.lane-periods td { border-left: 0; }
.yeartable th.kw { border-left: 2px solid var(--weekline); }

/* Kalenderwochen-Zeile: ruhig gehalten, nur die aktuelle Woche hat eine gelbe Linie */
.yeartable th.kw { padding: 0; text-align: left; background: var(--surface-3); border-left: 2px solid var(--bg); }
.yeartable th.kw.today { box-shadow: inset 0 3px 0 var(--accent); }
.yeartable th.kw.today .kwlink strong { color: var(--accent-text); }
.yeartable thead tr.kwrow th.name { background: var(--surface-3); }
.kwlink { display: flex; align-items: center; gap: 8px; padding: 3px 10px; color: var(--text); text-decoration: none; white-space: nowrap;
          position: sticky; left: calc(var(--namew) + 10px); width: max-content; font-size: .8rem; }
.kwlink .mon { font-size: .66rem; color: var(--muted); }
.kwlink .go { margin-left: 2px; padding: 0 8px; border-radius: 999px; border: 1px solid var(--accent-text); color: var(--accent-text); font-size: .68rem; font-weight: 600; }
.kwlink:hover .go { background: var(--accent); color: #1b1500; }

/* Zwei schmale Zeilen: Feiertage und Zeiträume */
.yeartable tr.lane th.name, .plan tr.total th.name { font-size: .72rem; color: var(--muted); background: var(--surface-2); padding: 2px 12px; font-weight: 600; }
.yeartable tr.lane td { position: relative; height: 20px; padding: 0; background: var(--surface); font-size: .68rem; font-weight: 600; }
.yeartable tr.lane td.we { background: var(--weekend); }
.yeartable td.lane-cell.hol { background: var(--primary); }
.holbar { position: absolute; left: 0; top: 2px; bottom: 2px; z-index: 2; display: block; padding: 0 6px; line-height: 16px;
          background: var(--primary); color: #fff; border-radius: 4px; font-size: .66rem; font-weight: 600; white-space: nowrap;
          overflow: hidden; text-overflow: ellipsis; }
.yeartable tr.lane td.lane-fill { padding: 0 6px; color: #000; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.yeartable tr.lane td.lane-fill.k-school { background: var(--c-school); }
.yeartable tr.lane td.lane-fill.k-event { background: var(--c-event); }
.yeartable tr.lane td.lane-fill.k-other { background: var(--c-other); }
.yeartable tr.lane td.lane-fill.k-multi, .tag-multi { background: repeating-linear-gradient(135deg, #8a63d2 0 8px, #6f4fc0 8px 16px); color: #fff; }
.has-pop { cursor: pointer; }
/* Jahresplan: großer Schieberegler zum Scrollen durch die Wochen */
.slider-row { display: flex; align-items: center; gap: 12px; margin: 0 0 8px; padding: 6px 12px; background: var(--surface);
              border: 1px solid var(--border-strong); border-radius: var(--radius-sm); }
.slider-row .slider-label { min-width: 150px; font-size: .8rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.slider-row input[type=range] { flex: 1; min-width: 0; height: 28px; margin: 0; background: transparent; cursor: pointer; accent-color: var(--primary); }
.slider-row input[type=range]::-webkit-slider-runnable-track { height: 10px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--border-strong); }
.slider-row input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 56px; height: 22px; margin-top: -7px; border-radius: 999px;
                                                      background: var(--primary); border: 2px solid var(--accent); }
.slider-row input[type=range]::-moz-range-track { height: 10px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--border-strong); }
.slider-row input[type=range]::-moz-range-thumb { width: 52px; height: 18px; border-radius: 999px; background: var(--primary); border: 2px solid var(--accent); }
.yeartable tr.total td { padding: 1px 0; font-size: .68rem; }

/* Stärke gesamt / Stärke-Übersicht (wie im Excel-Dienstplan) */
.plan tr.total th.name { border-bottom: 1px solid var(--border-strong); }
.plan tr.sgroup th { background: var(--surface-3); text-align: left; padding: 4px 12px; font-size: .7rem; letter-spacing: .1em;
                     text-transform: uppercase; color: var(--accent-text); font-weight: 700; border-top: 2px solid var(--border-strong); }
.plan tr.sgroup th.name { position: sticky; left: 0; z-index: 2; }
.plan tr.srow th.name { padding: 2px 12px 2px 8px; font-size: .78rem; font-weight: 500; color: var(--muted); }
.plan tr.sshift th { padding: 2px 10px; text-align: left; font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
                     border-top: 5px solid var(--bg); border-bottom: 1px solid var(--border-strong); }
.plan tr.sshift th.name { position: sticky; left: 0; z-index: 2; color: #000; }
.plan tr.sshift th.band { border-left: 0; }
.plan tr.srow td { padding: 2px 0; font-size: .76rem; font-weight: 500; color: var(--srow); }
.plan tr.srow td.bold { color: var(--text); font-weight: 700; }
.plan tr.srow td.aush { color: #444; }
.plan tr.srow td.soll { background: #fee180; color: #000; font-weight: 700; }
.plan tr.srow td.good { background: var(--success); color: var(--success-text); font-weight: 600; }
.plan tr.srow td.bad { background: var(--danger); color: #fff; font-weight: 700; }

/* Mehrere Zeiträume: Popover */
.popover { position: fixed; z-index: 100; min-width: 210px; max-width: 320px; padding: 8px 12px; background: var(--surface-3);
           border: 1px solid var(--border-strong); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); font-size: .82rem; }
.popover[hidden] { display: none; }
.pop-row { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.dot { flex: none; width: 10px; height: 10px; border-radius: 50%; }
.dot-school { background: var(--c-school); }
.dot-event { background: var(--c-event); }
.dot-other { background: var(--c-other); }
.dot-holiday { background: var(--primary); }
.pop-kind { margin-left: auto; padding-left: 12px; color: var(--muted); font-size: .72rem; }

/* Mein Wochenplan: drei Wochen untereinander */
.page-own { max-width: 1200px; margin: 0 auto; }
.weeks { display: grid; gap: 12px; }
.weekblock { overflow: hidden; }
.weekhead { display: flex; align-items: baseline; gap: 12px; padding: 8px 14px; background: var(--surface-3); border-bottom: 1px solid var(--border-strong); }
.weekrange { color: var(--muted); }
.badge-now, .badge-rel { margin-left: auto; padding: 1px 10px; border-radius: 999px; font-size: .72rem; font-weight: 700; }
.badge-now { background: var(--accent); color: #1b1500; }
.badge-rel { background: var(--surface); border: 1px solid var(--border-strong); color: var(--muted); font-weight: 600; }
.tablewrap-x { overflow-x: auto; }
table.plan.own { width: 100%; min-width: 640px; table-layout: fixed; }
.plan.own td.cell { height: 48px; }
.plan.own td.cell .code { height: 38px; line-height: 38px; font-size: .95rem; }
.plan.own th.daycol { padding: 6px 4px; }

.form-grid label.check { flex-direction: row; align-items: center; gap: 8px; padding-bottom: 9px; color: var(--text); }

/* 10 · Auswahl eines Kürzels (farbige Schaltflächen) und eigene Woche als Liste */
.picker-backdrop { position: fixed; inset: 0; z-index: 90; }
.picker { position: fixed; z-index: 91; width: min(360px, calc(100vw - 16px)); max-height: min(75vh, 540px); overflow-y: auto;
          padding: 10px 12px 12px; background: var(--surface-3); border: 1px solid var(--border-strong);
          border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.picker-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; font-size: .85rem; }
.picker-close { border: 0; background: transparent; color: var(--muted); font-size: 1.5rem; line-height: 1; padding: 0 6px; cursor: pointer; }
.picker-close:hover { color: var(--text); }
.picker-group { margin-bottom: 8px; }
.picker-gname { margin-bottom: 4px; font-size: .64rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.picker-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.picker-chip { min-width: 42px; padding: 5px 10px; border: 2px solid transparent; border-radius: 7px; background: var(--surface-2);
               font-weight: 700; font-size: .82rem; cursor: pointer; }
.picker-chip:hover { box-shadow: 0 0 0 2px var(--accent); }
.picker-chip.current { border-color: var(--text); }
.picker-clear { width: 100%; margin-top: 4px; padding: 8px; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm);
                background: transparent; color: var(--muted); cursor: pointer; }
.picker-clear:hover { color: var(--text); border-color: var(--accent); }

.daylist { display: grid; }
.dayitem { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px;
           background: var(--surface); border-bottom: 1px solid var(--border); border-left: 4px solid transparent; }
.dayitem:last-child { border-bottom: 0; }
.dayitem.we { background: var(--weekend); }
.dayitem.holiday { background: var(--holiday); }
.dayitem.p-school { border-left-color: var(--c-school); }
.dayitem.p-event { border-left-color: var(--c-event); }
.dayitem.p-other { border-left-color: var(--c-other); }
.dayitem.today { background-image: linear-gradient(var(--today), var(--today)); }
.dayitem.today .wd { color: var(--accent-text); }
.dayitem .wd { min-width: 26px; font-weight: 700; }
.dayitem .dt { color: var(--muted); }
.dayitem .tag { display: inline-block; margin: 3px 4px 0 0; }
.dayitem .code { min-width: 96px; height: 34px; padding: 0 12px; border-radius: 8px; line-height: 34px; text-align: center;
                 font-weight: 700; background: transparent; color: var(--text); }
.dayitem .code.empty { color: var(--empty) !important; font-weight: 400; }
.dayitem.warn .code { background: var(--danger) !important; color: #fff !important; }

/* Kleine Anmerkung zu einem Dienst (z. B. Wache bei Aushilfe) */
.cnote { margin-left: 5px; font-size: .62em; font-weight: 600; opacity: .8; }
.yeartable td.has-note::after { content: ""; position: absolute; top: 0; right: 0; z-index: 2; border-top: 7px solid var(--danger);
                                border-left: 7px solid transparent; pointer-events: none; }
.cal-note { display: block; position: relative; z-index: 1; margin-top: 1px; font-size: .56rem; line-height: 1.1; color: var(--muted);
            white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.picker-note { display: block; margin: 0 0 8px; font-size: .72rem; font-weight: 600; color: var(--muted); }
.picker-noterow { display: flex; align-items: center; gap: 6px; margin-top: 3px; }
.picker-noterow input { flex: 1; min-width: 0; }
.picker-noterow .btn:disabled { cursor: not-allowed; }

/* 12 · Jahreskalender (zwölf Monate, nur lesen) */
.page-cal .page-title { float: none; margin: 0 0 8px; }
.page-cal .page-title .muted { display: block; font-weight: 600; color: var(--text); }
.cal-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 12px; }
.cal-summary .sum-total { margin-right: 6px; font-weight: 700; }
.cal-months { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.cal-month { padding: 10px 10px 8px; }
.cal-month h3 { margin: 0 0 6px; font-size: .95rem; }
table.cal { width: 100%; border-collapse: separate; border-spacing: 2px; table-layout: fixed; }
table.cal th { padding: 2px 0; font-size: .68rem; font-weight: 700; color: var(--muted); text-align: center; }
table.cal th.we { color: var(--primary-text); }
.cal-day { position: relative; height: 52px; padding: 3px 3px 2px; vertical-align: top; background: var(--surface-2); border-radius: 6px; }
.cal-day.we { background: var(--weekend); }
.cal-day.holiday { background: var(--holiday); }
.cal-day::before { content: ""; position: absolute; inset: 0; border-radius: 6px; pointer-events: none; }
.cal-day.p-school::before { background: var(--tint-school); }
.cal-day.p-event::before { background: var(--tint-event); }
.cal-day.p-other::before { background: var(--tint-other); }
.cal-day.today { box-shadow: inset 0 0 0 2px var(--accent); }
.cal-empty { background: transparent; }
.cal-num { display: block; font-size: .68rem; font-weight: 600; color: var(--muted); line-height: 1.2; }
.cal-day.today .cal-num { color: var(--accent-text); font-weight: 800; }
.cal-day .code { position: relative; z-index: 1; display: block; margin-top: 3px; padding: 2px 0; border-radius: 5px; text-align: center;
                 font-size: .72rem; font-weight: 700; line-height: 1.2; white-space: nowrap; overflow: hidden; }
.cal-day.warn .code { background: var(--danger) !important; color: #fff !important; }

/* 13 · Druckansicht: A4-Blätter (immer hell, unabhängig vom Darkmode), Warnungen, Druckregeln */
.page-print .hint { margin: 0 0 12px; clear: both; }
/* Kopfbereich: Woche wählen, Seiten wählen, Drucken */
.print-bar { margin: 0 0 12px; padding: 12px 14px; display: grid; gap: 12px; background: var(--surface); border: 1px solid var(--border);
             border-radius: var(--radius); box-shadow: var(--shadow); }
.print-bar-top, .print-bar-bottom { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.print-bar-top h1 { margin-right: 6px; font-size: 1.25rem; }
.print-bar-bottom { padding-top: 12px; border-top: 1px solid var(--border); justify-content: space-between; }
.weeknav { display: inline-flex; align-items: stretch; background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: 999px; overflow: hidden; }
.navbtn { display: grid; place-items: center; width: 44px; border: 0; background: transparent; color: var(--primary-text); cursor: pointer; transition: background .15s, color .15s; }
.navbtn:hover { background: var(--primary); color: #fff; }
.weekinfo { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 170px; padding: 5px 14px; line-height: 1.2; }
.weeklabel { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: 1.05rem; }
.weeklabel select { padding: 1px 4px; font-size: 1rem; font-weight: 800; border-radius: 6px; }
.weekrange { font-size: .78rem; font-weight: 600; color: var(--muted); }
.toggles { display: flex; flex-wrap: wrap; gap: 8px; }
.toggle { position: relative; display: inline-flex; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.toggle span { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1px solid var(--border-strong); border-radius: 999px;
               background: var(--surface); color: var(--muted); font-size: .85rem; font-weight: 600; transition: background .15s, color .15s, border-color .15s; }
.toggle span::before { content: ""; width: 16px; height: 16px; border: 2px solid var(--border-strong); border-radius: 50%; box-sizing: border-box; transition: all .15s; }
.toggle:hover span { border-color: var(--primary); }
.toggle input:checked + span { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-text); }
.toggle input:checked + span::before { border-color: var(--primary); background: var(--primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.7 2.7L12 5.5' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% no-repeat; }
.toggle input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.btn-print { padding: 10px 22px; font-size: 1rem; }
/* Warnungen: Stärke und Ruhezeit */
.warns { display: grid; gap: 10px; margin: 0 0 12px; clear: both; }
.wcard { display: flex; gap: 14px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-left: 5px solid var(--danger);
         border-radius: var(--radius); box-shadow: var(--shadow); }
.wct-rest { border-left-color: #e79b00; }
.wc-icon { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--danger-soft); color: var(--danger); }
.wct-rest .wc-icon { background: rgba(231, 155, 0, .16); color: #b87400; }
.wc-body { flex: 1; min-width: 0; }
.wc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.wc-title { font-weight: 800; font-size: 1rem; }
.wc-sub { margin-top: 1px; font-size: .84rem; color: var(--muted); }
.wc-dismiss { flex: none; padding: 5px 12px; border: 1px solid var(--border-strong); border-radius: 999px; background: transparent; color: var(--muted);
              font: inherit; font-size: .8rem; font-weight: 600; cursor: pointer; }
.wc-dismiss:hover { background: var(--surface-2); color: var(--text); }
.wc-days, .wc-rests { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.wc-day { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 112px; padding: 8px 10px; background: var(--surface-2);
          border: 1px solid var(--border); border-radius: var(--radius-sm); }
.wc-dlabel { font-size: .78rem; font-weight: 800; }
.wc-chip { display: inline-block; padding: 2px 9px; border-radius: 999px; border: 1px solid rgba(0, 0, 0, .12); font-size: .75rem; font-weight: 700; color: #111; }
.wc-rest { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 7px 12px; background: var(--surface-2); border: 1px solid var(--border);
           border-left: 0; border-radius: 999px; font-size: .85rem; }
.wc-step { display: inline-flex; align-items: center; gap: 5px; }
.wc-sday { font-size: .75rem; color: var(--muted); }
.wc-arrow { color: var(--danger); font-weight: 800; }
.warn-hidden { margin: 0; color: var(--muted); font-size: .85rem; }.sheets { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.sheet-wrap { position: relative; overflow: hidden; background: #fff; box-shadow: var(--shadow-lg); }
.sheet { width: 210mm; height: 296mm; padding: 8mm; box-sizing: border-box; overflow: hidden; transform-origin: top left;
         background: #fff; color: #111; font: 8pt/1.2 "Segoe UI", Arial, sans-serif; --rowh: 6mm; }
.sheet-in { height: 100%; overflow: hidden; }
.sh-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 8mm; margin-bottom: 2mm; padding-bottom: 1.2mm; border-bottom: .8mm solid #0061a7; }
.sh-org { font-size: 8.5pt; font-weight: 700; color: #5b6f88; }
.sh-title { text-align: right; color: #0061a7; }
.sh-title strong { font-size: 14pt; font-weight: 800; }
.sh-sub { display: block; font-size: 9pt; color: #5b6f88; }
.sh-sub.inl { display: inline; margin-left: 4mm; font-size: 14pt; font-weight: 700; color: #0061a7; }
table.sp { border-collapse: collapse; table-layout: fixed; font-size: 8pt; width: 194mm; }
table.sp.sp-strength { width: 158mm; }
.sp col.c-grp { width: 11mm; }
.sp col.c-name { width: 42mm; }
.sp col.c-day { width: 15mm; }
.sp th, .sp td { padding: 0 1mm; border: .2mm solid #a9b6c6; text-align: center; overflow: hidden; white-space: nowrap; text-overflow: clip; background: #fff; color: #111; }
/* blauer Kopf */
.sp .hw, .sp .dh, .sp .dd, .sp .hfeier, .sp .hday { background: #0061a7; color: #fff; border-color: #0061a7; }
.sp .hw { font-size: 9.5pt; font-weight: 800; }
.sp .hnote { font-size: 8.5pt; padding: 0 2mm; }
.sp .dh { font-size: 9pt; font-weight: 800; height: 5.5mm; padding-top: 1mm; }
.sp .dd { font-size: 8pt; font-weight: 700; height: 4.5mm; }
.sp .hfeier { text-align: right; font-size: 6.5pt; font-weight: 600; font-style: italic; padding-right: 2mm; height: 4mm; }
.sp .hday { font-size: 6pt; font-weight: 600; height: 4mm; white-space: normal; line-height: 1; }
.sp th.dh.we, .sp th.dd.we, .sp th.hday.we, .sp th.dh.hol, .sp th.dd.hol, .sp th.hday.hol { background: #f4a6ae; color: #8a0010; border-color: #f4a6ae; }
/* Ferien / Veranstaltung / Sonstiges */
.sp tr.lane th, .sp tr.lane td { height: 3.8mm; font-size: 6pt; border-color: transparent; background: transparent; }
.sp tr.lane th.lane-lbl { text-align: right; font-size: 6pt; font-weight: 600; color: #5b6f88; padding-right: 2mm; }
.sp tr.lane td.lane-fill { font-weight: 700; color: #111; border-color: #fff; }
.sp td.lane-fill.k-school { background: #feeaa6; }
.sp td.lane-fill.k-event { background: #4cc9a0; }
.sp td.lane-fill.k-other { background: #ba86e6; }
/* Stärke gesamt */
.sp tr.total th, .sp tr.total td { height: 5mm; font-weight: 700; }
.sp th.tot-lbl { background: #cfe0ee; color: #0061a7; text-align: right; font-weight: 800; padding-right: 2mm; }
.sp td.good { background: #a6dabc; color: #004d20; }
.sp td.bad { background: #e3000f; color: #fff; }
.sp tr.total td.lane-empty { background: transparent; border-color: transparent; }
/* Personen */
.sp tr.gap td { height: 1.1mm; padding: 0; border: 0; background: #0061a7; }
.sp tr.person td, .sp tr.person th { height: var(--rowh); }
.sp th.grp { background: #cfe0ee; font-size: 8pt; font-weight: 800; color: #0061a7; padding: 0; }
.sp td.name { text-align: left; padding-left: 1.5mm; font-weight: 600; }
.sp td.cell { font-weight: 700; line-height: 1; }
.sp td.cell .c1 { display: block; }
.sp td.cell .c2 { display: block; margin-top: .3mm; font-size: 5pt; font-weight: 600; opacity: .85; overflow: hidden; text-overflow: ellipsis; }
.sp td.cell.we:empty, .sp td.cell.hol:empty { background: #fff; }
.sp td.cell.rest { background: #e3000f !important; color: #fff !important; }
.sp td.note { text-align: left; font-size: 7pt; cursor: text; }
.sp tr.xtra td, .sp tr.xtra th { height: 5.5mm; }
.sp td.xcell { cursor: text; font-size: 7pt; }
.sp td.note:focus, .sp td.xcell:focus, .sp th[contenteditable]:focus { outline: .4mm solid #0061a7; outline-offset: -.4mm; }
.sp td.lane-empty { background: transparent; border-color: transparent; }
/* Legende: nur Dienstarten */
.sh-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 1.5mm; margin-top: 3.5mm; }
.sh-legend > strong { margin-right: 2mm; font-size: 8pt; color: #5b6f88; }
.sh-legend .lg-box { min-width: 24mm; padding: 1.2mm 3mm; border: .2mm solid #a9b6c6; text-align: center; font-size: 7.5pt; font-weight: 700; color: #111; }
/* Seite 2 */
/* Seite 2: Stärke-Übersicht – je Schicht ein Block mit Abstand, Zählwerte oben, Ergebnis abgesetzt darunter */
table.sp.sp-strength { width: 194mm; border-collapse: separate; border-spacing: 0; }
.sp col.c-grp2 { width: 24mm; }
.sp col.c-name2 { width: 46mm; }
.sp-strength th, .sp-strength td { border: 0; border-bottom: .2mm solid #d3dce8; }
.sp-strength tr.sgap td { height: 7mm; padding: 0; border: 0; background: #fff; }
.sp-strength tr.srow td, .sp-strength tr.srow th { height: 8.2mm; }
.sp-strength th.shiftname { border: 0; font-weight: 800; font-size: 11pt; letter-spacing: .02em; color: #111; padding: 0; }
.sp-strength th.line-lbl { text-align: left; padding-left: 3mm; font-size: 8pt; font-weight: 500; color: #3b4a5f; background: #fff; }
.sp-strength td.we:not(.good):not(.bad):not(.aush) { background: #f4f7fb; }
.sp-strength td.hol:not(.good):not(.bad):not(.aush) { background: #fdeef0; }
.sp-strength td { font-size: 9pt; }
.sp-strength td.count { color: #3b4a5f; }
.sp-strength td.faint, .sp-strength th.faint { color: #7d8ba0; }
.sp-strength td.good { background: #d9f0e2; color: #1d6b3b; font-weight: 700; }
.sp-strength td.bad { background: #e3000f; color: #fff; font-weight: 800; }
.sp-strength th.line-lbl.aush, .sp-strength td.aush { font-style: italic; color: #5b6f88; font-size: 7.5pt; }
.sp-strength tr.sum-first th, .sp-strength tr.sum-first td { border-top: .35mm solid #3b4a5f; }
.sp-strength tr.result th.line-lbl, .sp-strength tr.result td { font-weight: 800; color: #111; }
.sp-strength tr.result td { background-color: #eef3f9; }
.sp-strength tr.result td.we { background-color: #e6edf6; }
.sp-strength tr.result td.bad { background: #e3000f; color: #fff; }
.sp-strength tr.miss td { font-size: 10pt; }
.sp-strength tr.shift-last td, .sp-strength tr.shift-last th { border-bottom: .5mm solid #0061a7; }
.sp-strength tr.shift-first th.shiftname { border-top: .5mm solid #0061a7; }
.sp-strength tr.shift-first td, .sp-strength tr.shift-first th.line-lbl { border-top: .5mm solid #0061a7; }
.sp-strength td.first-day { border-left: .5mm solid #0061a7; }
.sp-strength th.hw, .sp-strength th.dh, .sp-strength th.dd, .sp-strength th.hfeier, .sp-strength th.hday { border: 0; }.sh-note { margin: 2.5mm 0 0; font-size: 6.5pt; font-style: italic; color: #5b6f88; }
.sh-foot { margin-top: 3mm; padding-top: 1.5mm; border-top: .5mm solid #0061a7; text-align: right; font-size: 9pt; font-weight: 800; color: #0061a7; }
@media print {
  @page { size: A4 portrait; margin: 0; }
  html, body { background: #fff !important; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .topbar, .no-print, .popover { display: none !important; }
  .page-print { padding: 0; max-width: none; }
  .sheets { display: block; gap: 0; }
  .sheet-wrap { width: auto !important; height: auto !important; overflow: visible; box-shadow: none; }
  .sheet { transform: none !important; box-shadow: none; break-after: page; page-break-after: always; }
  .sheet-wrap:last-child .sheet { break-after: auto; page-break-after: auto; }
  .sp td.note:focus, .sp td.xcell:focus, .sp th[contenteditable]:focus { outline: none; }
}

/* 14 · Dienstwünsche */
.page-wish { max-width: 1060px; }
.err-text { color: var(--err-text); }
.wish-status { min-height: 1.3em; margin: 0 0 8px; }
.wish-intro { display: flex; gap: 14px; padding: 16px 18px; margin-bottom: 14px; border-left: 5px solid var(--primary); }
.wi-icon { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--primary-soft); color: var(--primary-text); }
.wish-intro ul { margin: 0; padding-left: 18px; font-size: .9rem; line-height: 1.55; color: var(--text); }
.wish-weeks { display: grid; gap: 16px; }
.wish-week { overflow: hidden; }
.ww-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; background: var(--surface-3); border-bottom: 1px solid var(--border-strong); }
.ww-title { font-size: 1.05rem; margin-right: 10px; }
.ww-range { color: var(--muted); font-weight: 600; }
.wdeadline { display: inline-flex; align-items: center; gap: 8px; padding: 5px 13px; border-radius: 999px; background: var(--primary-soft); color: var(--primary-text); font-size: .8rem; }
.wdeadline span { font-weight: 500; opacity: .85; }
.wdeadline.urgent { background: var(--danger-soft); color: var(--err-text); box-shadow: inset 0 0 0 1px var(--danger); }
.wday { display: grid; grid-template-columns: 96px minmax(0, 1fr) 230px; gap: 14px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.wday:last-child { border-bottom: 0; }
.wday.we { background: var(--weekend); }
.wday.has { box-shadow: inset 4px 0 0 var(--primary); }
.wdate strong { display: block; font-size: 1rem; }
.wdate span { color: var(--muted); font-size: .8rem; }
.wchoices { display: flex; flex-wrap: wrap; gap: 5px; }
.wchoice { padding: 6px 11px; border: 2px solid var(--border-strong); border-radius: 999px; background: var(--surface); color: var(--text); font: inherit; font-weight: 700;
           font-size: .85rem; cursor: pointer; transition: border-color .12s, transform .08s; }
.wchoice:hover { border-color: var(--primary); }
.wchoice:active { transform: scale(.96); }
.wchoice.on { border-color: var(--text); color: #111; }
.wchoice.on::before { content: "\2713\00a0"; }
.wmine { margin-top: 6px; font-size: .78rem; color: var(--muted); }
.wothers { font-size: .8rem; }
.wnone { color: var(--muted); }
.wcounts { display: flex; flex-wrap: wrap; gap: 5px; }
.wcount { padding: 2px 10px; border-radius: 999px; border: 1px solid rgba(0, 0, 0, .12); font-weight: 700; color: #111; }
.wwho { margin-top: 5px; }
.wwho summary { cursor: pointer; color: var(--primary-text); font-weight: 600; }
.wwho ul { margin: 4px 0 0; padding-left: 16px; line-height: 1.5; }
.wchoose { display: grid; gap: 8px; }
.wroles { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .8rem; }
.wroles.off { opacity: .5; }
.wroles-label { color: var(--muted); font-weight: 600; }
.wrole { padding: 4px 11px; border: 1.5px solid var(--border-strong); border-radius: 999px; background: transparent; color: var(--text); font: inherit; font-size: .8rem; font-weight: 600; cursor: pointer; }
.wrole:hover:not(:disabled) { border-color: var(--primary); }
.wrole.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.wrole:disabled { cursor: not-allowed; }
.wroles-hint { color: var(--muted); font-size: .75rem; }
.wsep { align-self: stretch; width: 2px; margin: 3px 6px; border-radius: 2px; background: var(--border-strong); }
.wchoices .wrole { padding: 6px 13px; border-width: 2px; font-size: .85rem; font-weight: 800; }
.wish-empty { padding: 22px; text-align: center; color: var(--muted); }
/* Planer: Wunsch-Zeichen in den Zellen, Sperre und Übernehmen */
.wishbar[hidden] { display: none; }
.wishbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 6px; padding: 5px 10px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font-size: .85rem; }
.wishbar .wb-state { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.wishbar .wb-dot { width: 9px; height: 9px; border-radius: 50%; background: #8a5fb0; }
.wishbar.locked .wb-dot { background: var(--danger); }
.wishbar.closed .wb-dot { background: var(--muted); }
.wishbar .wb-info { color: var(--muted); }
.wishtag { position: absolute; top: 0; left: 0; z-index: 3; padding: 0 5px 0 4px; border-radius: 0 0 7px 0; background: #8a5fb0; color: #fff; font-size: .62rem; font-weight: 800; line-height: 1.4; pointer-events: none; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.wishtag.wish-ok { background: #1f8a4c; }
.wishtag.wish-bad { background: var(--danger); }
.yeartable td.cell.wish-open { box-shadow: inset 3px 0 0 #8a5fb0; }
.yeartable td.cell.wish-ok { box-shadow: inset 3px 0 0 #1f8a4c; }
.yeartable td.cell.wish-bad { box-shadow: inset 3px 0 0 var(--danger); }
@media (max-width: 640px) {
  .wday { grid-template-columns: 64px minmax(0, 1fr); }
  .wothers { grid-column: 1 / -1; }
  .wish-intro { flex-direction: column; }
}

/* 15 · Wochenleiste (gemeinsam) und überarbeitete Wochenplanung */
.weekbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 0 0 10px; padding: 10px 14px; background: var(--surface);
           border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); clear: both; }
.weekbar .status { margin-left: 0; }
.weekbar-links { display: flex; flex-wrap: wrap; gap: 4px; }
.page-plan .page-title { float: none; margin: 0 0 10px; }
.page-plan .page-title h1 { font-size: 1.35rem; }
.page-plan .page-title h1::after { display: block; }
.page-plan .plan-hint { margin: 8px 2px 0; font-size: .8rem; }
.page-plan { --namew: 150px; padding-top: 8px; }
.page-plan .tablewrap { border-radius: var(--radius); max-height: calc(100vh - 175px); }
.page-plan .weekbar { padding: 5px 10px; gap: 8px; margin-bottom: 6px; }
.page-plan .navbtn { width: 36px; }
.page-plan .weekinfo { min-width: 150px; padding: 2px 10px; }
.page-plan .weeklabel { font-size: .95rem; }
.page-plan .weeklabel select { padding: 0 3px; font-size: .92rem; }
.page-plan .weekrange { font-size: .72rem; }
.page-plan table.plan:not(.yeartable) { min-width: 880px; }
.page-plan .plan th, .page-plan .plan td { border-right: 0; border-bottom: 1px solid var(--border); }
/* Kopf: Wochentag über dem Datum, heute mit gelber Linie */
.page-plan .plan thead th { padding: 4px 3px 3px; background: var(--surface); border-bottom: 2px solid var(--border-strong); }
.page-plan .plan thead th.name { background: var(--surface); font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.page-plan .plan th .dline { flex-direction: column; align-items: center; gap: 0; line-height: 1.2; }
.page-plan .plan th .wd { font-size: .84rem; font-weight: 800; }
.page-plan .plan th .dt { font-size: .7rem; }
.page-plan .plan th.we { background: var(--weekend); }
.page-plan .plan th.today { background: var(--primary-soft); color: var(--primary-text); box-shadow: inset 0 -4px 0 var(--accent); }
.page-plan .plan th.today .dt { color: inherit; }
.page-plan .plan th.holiday { background: var(--primary); color: #fff; }
.page-plan .plan th.holiday.today { box-shadow: inset 0 -4px 0 var(--accent); }
/* Personen: ruhige Zeilen, große Schaltflächen */
.page-plan .plan td.name { padding: 1px 10px; font-weight: 600; font-size: .83rem; }
.page-plan .plan td.cell { height: 31px; padding: 2px 4px; }
.page-plan .plan td.cell .code { height: 25px; line-height: 25px; border-radius: 7px; font-size: .78rem; }
.page-plan .plan td.cell .code.editable.empty::after { content: "+"; color: var(--muted); font-weight: 600; opacity: 0; transition: opacity .12s; }
.page-plan .plan td.cell .code.editable.empty:hover { background: var(--primary-soft) !important; box-shadow: none; }
.page-plan .plan td.cell .code.editable.empty:hover::after { opacity: 1; }
.page-plan .plan td.cell .code.editable:not(.empty):hover { box-shadow: 0 0 0 2px var(--primary); }
.page-plan .plan td.cell.editable:hover { box-shadow: none; }
.page-plan .plan tr.group th { padding: 1px 10px; background: var(--surface-2); color: var(--muted); font-size: .68rem; letter-spacing: .12em; border-left: 4px solid var(--primary); }
.page-plan .plan tbody tr:not(.group):not(.strength):not(.sshift):not(.srow):not(.sgroup):hover td.name { background: var(--surface-2); }
/* Stärke gesamt: ruhige Kopfzeile oben, Übersicht darunter */
.page-plan .plan tr.total th.name { background: var(--surface-2); font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; }
.page-plan .plan tr.total td { padding: 3px 4px; font-size: .74rem; }
.page-plan .plan tr.srow td { padding: 1px 0; font-size: .74rem; }
.page-plan .plan tr.srow th.name { padding: 1px 10px 1px 8px; font-size: .74rem; }
.page-plan .plan tr.sgroup th { padding: 6px 12px 4px; background: var(--surface); border-top: 3px solid var(--border-strong); color: var(--primary-text); font-size: .8rem; }
.page-plan .plan tr.sshift th { border-top-width: 6px; padding: 1px 10px; }
.page-plan .plan tr.srow td.wishrow { color: #3b2548; }

/* Wünsche in der Wochenplanung: deutliche Schaltfläche, gestricheltes Wunschfeld, farbiger Streifen */
.wtoggle { display: inline-flex; align-items: center; gap: 7px; padding: 6px 15px; border: 2px solid #8a5fb0; border-radius: 999px; background: var(--surface); color: #8a5fb0;
           font: inherit; font-size: .85rem; font-weight: 800; cursor: pointer; transition: background .15s, box-shadow .15s; }
.wtoggle:hover { background: rgba(138, 95, 176, .14); }
.wtoggle.on { background: #8a5fb0; color: #fff; box-shadow: 0 2px 9px rgba(138, 95, 176, .5); }
:root[data-theme="dark"] .wtoggle:not(.on) { color: #cfa9ee; border-color: #a77dd0; }
.page-plan .plan td.cell .code.wishghost { background: repeating-linear-gradient(135deg, rgba(138, 95, 176, .22) 0 6px, rgba(138, 95, 176, .08) 6px 12px) !important;
                                           border: 1.5px dashed #8a5fb0; color: #6b3f94 !important; font-weight: 800; line-height: 22px; }
:root[data-theme="dark"] .page-plan .plan td.cell .code.wishghost { color: #dcbcf5 !important; }
.page-plan .plan td.cell.has-wish.wish-open { box-shadow: inset 3px 0 0 #8a5fb0; }
.page-plan .plan td.cell.has-wish.wish-ok { box-shadow: inset 3px 0 0 #1f8a4c; }
.page-plan .plan td.cell.has-wish.wish-bad { box-shadow: inset 3px 0 0 var(--danger); }
.wishbar .wb-state { font-size: .82rem; }
.wishbar .btn-sm { padding: 3px 10px; }

/* Wünsche: Reiter, Wunschplanung (alle Wünsche als Tabelle) */
.wtabs { display: inline-flex; gap: 4px; margin: 0 0 12px; padding: 4px; background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: 999px; }
.wtab { padding: 7px 18px; border-radius: 999px; color: var(--muted); font-weight: 700; font-size: .88rem; text-decoration: none; }
.wtab:hover { color: var(--text); }
.wtab.active { background: var(--primary); color: #fff; }
.page-wishplan { padding-top: 12px; }
.weektabs { display: flex; flex-wrap: wrap; gap: 6px; }
.weektab { display: inline-flex; flex-direction: column; align-items: center; padding: 6px 16px; border: 2px solid var(--border-strong); border-radius: 12px; background: var(--surface);
           color: var(--text); font: inherit; font-weight: 800; cursor: pointer; line-height: 1.2; }
.weektab small { font-weight: 600; font-size: .72rem; color: var(--muted); }
.weektab:hover { border-color: var(--primary); }
.weektab.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.weektab.on small { color: #d6e9f8; }
.wp-legend { display: inline-flex; gap: 5px; }
.wp-key { padding: 2px 11px; border-radius: 999px; font-size: .75rem; font-weight: 700; color: #111; border: 1px solid rgba(0, 0, 0, .12); }
.wp-key[data-k="F"] { background: #99D5B2; } .wp-key[data-k="S"] { background: #99C0DC; } .wp-key[data-k="N"] { background: #F9CF99; } .wp-key[data-k="X"] { background: #D9DADA; }
table.wptable { width: 100%; min-width: 760px; }
.wptable tr.wsum th.name { font-size: .74rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.wptable tr.wsum td { padding: 5px 4px; background: var(--surface-2); }
.wsum-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px; }
.wsum-chip { padding: 0 7px; border-radius: 999px; font-size: .7rem; font-weight: 800; color: #111; border: 1px solid rgba(0, 0, 0, .1); }
.wsum-chip.zero { opacity: .35; }
.wptable td.cell { height: 34px; }
.wptable td.cell .code { height: 26px; line-height: 26px; font-size: .78rem; font-weight: 800; }
.wptable tr.me td.name { box-shadow: inset 4px 0 0 var(--accent); font-weight: 800; }
.wptable tr.me td.cell { background: var(--primary-soft); }
/* Wochenleiste: ruhig und in einer Zeile; Wunsch-Menü ausklappbar */
.yearinput { width: 4.6em; padding: 0 4px; border: 0; border-bottom: 1px dashed var(--border-strong); border-radius: 0; background: transparent; font-weight: 800; font-size: .95rem; }
.weeklabel { gap: 5px; }
.iconbtn { padding: 7px 9px; }
.wishbar-inline { display: inline-flex; align-items: center; gap: 8px; }
.wishmenu { position: relative; }
.wishmenu summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.wishmenu summary::-webkit-details-marker { display: none; }
.wishmenu[open] > summary { background: var(--surface-3); }
.wm-caret { font-size: .7rem; color: var(--muted); }
.wb-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: none; }
.wb-dot.is-open { background: #1f8a4c; box-shadow: 0 0 0 3px rgba(31, 138, 76, .2); }
.wb-dot.is-closed { background: var(--danger); }
.wm-panel { position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; display: grid; gap: 8px; min-width: 250px; padding: 12px; background: var(--surface);
            border: 1px solid var(--border-strong); border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.wm-status { font-weight: 800; }
.wm-info { margin-top: -4px; font-size: .82rem; color: var(--muted); }
/* Wochenplanung: feste Spaltenbreiten (Name schmal) und deutlich getrennte Gruppen */
.plan tr.group.g-Leitung { --gc: #b45309; }
.plan tr.group.g-WDF { --gc: #0f766e; }
.plan tr.group.g-OSK { --gc: #0061a7; }
.plan tr.group.g-DHF { --gc: #7c3aed; }
.page-plan table.plan:not(.yeartable), .page-wishplan table.plan { table-layout: fixed; width: 100%; min-width: 820px; }
.page-plan .plan th.name, .page-plan .plan td.name, .page-wishplan .plan th.name, .page-wishplan .plan td.name { width: 150px; min-width: 150px; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page-plan .plan tr.group th, .page-wishplan .plan tr.group th { height: 26px; padding: 0 12px; background: var(--gc, var(--primary)); color: #fff; font-size: .74rem; font-weight: 800;
                                                                    letter-spacing: .14em; border-left: 0; border-top: 10px solid var(--bg); border-bottom: 0; text-transform: uppercase; }
.page-plan .plan tr.group + tr th.name, .page-plan .plan tr.group + tr td.name { box-shadow: inset 4px 0 0 var(--gc, var(--primary)); }
.page-plan .plan tr.group:first-of-type th { border-top-width: 0; }
/* Ferien, Veranstaltungen und sonstige Zeiträume färben nur noch die Kopfzeile, nicht mehr die Zellen (Wochenenden bleiben getönt) */
.plan td.cell.p-school::before, .plan td.cell.p-event::before, .plan td.cell.p-other::before { background: none; }
/* Eiche als Logo (Kopfzeile, Anmeldung, Startseite) und als großes Hintergrundbild der Startseite */
.brand-oak { display: block; flex: none; width: 34px; height: auto; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .25)); }
.auth-logo { width: auto; height: auto; background: none; box-shadow: none; border-radius: 0; margin-bottom: 8px; }
.auth-logo img { display: block; width: 76px; height: auto; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .25)); }
body.start { position: relative; background: radial-gradient(900px 520px at 85% 95%, rgba(95, 174, 91, .16), transparent 65%),
                                              radial-gradient(800px 420px at 0% 0%, rgba(0, 97, 167, .08), transparent 60%), var(--bg); }
:root[data-theme="dark"] body.start { background: radial-gradient(900px 520px at 85% 95%, rgba(95, 174, 91, .12), transparent 65%),
                                                                radial-gradient(800px 420px at 0% 0%, rgba(0, 97, 167, .25), transparent 60%), var(--bg); }
body.start::before { content: ""; position: fixed; right: -3vw; bottom: -4vh; z-index: 0; width: min(72vw, 760px); aspect-ratio: 400 / 410; pointer-events: none;
                     background: url("../img/eiche.svg") center / contain no-repeat; opacity: .2; }
:root[data-theme="dark"] body.start::before { opacity: .14; }
body.start .page { position: relative; z-index: 1; }
body.start .topbar { position: sticky; }
.hero { display: flex; align-items: center; gap: 22px; margin: 6px 0 26px; }
.hero-oak { flex: none; width: 120px; height: auto; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .28)); }
.hero-text h1 { font-size: 2rem; letter-spacing: -.02em; }
.hero-text p { margin: 6px 0 0; color: var(--muted); font-size: 1.05rem; }
body.start .tile { background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(3px); }
body.start .tile.disabled { background: transparent; }
@media (max-width: 640px) {
  .hero { gap: 14px; margin-bottom: 18px; }
  .hero-oak { width: 84px; }
  .hero-text h1 { font-size: 1.45rem; }
  body.start::before { width: 120vw; right: -30vw; opacity: .16; }
}
/* Handy: Wunschplanung als Tageskarten, Wochenleiste, Kalender */
.wp-cards { display: grid; gap: 10px; }
.wp-card { overflow: hidden; }
.wp-card.we { background: var(--weekend); }
.wp-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.wp-card-head strong { margin-right: 8px; font-size: 1rem; }
.wp-card-head span { color: var(--muted); font-size: .85rem; }
.wp-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--border); }
.wp-row:last-child { border-bottom: 0; }
.wp-row.me { background: var(--primary-soft); font-weight: 800; }
.wp-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wp-pill { flex: none; padding: 3px 12px; border-radius: 999px; font-size: .8rem; font-weight: 800; color: #111; border: 1px solid rgba(0, 0, 0, .12); }
.wp-none { margin: 0; padding: 10px 12px; color: var(--muted); font-size: .85rem; }
@media (max-width: 640px) {
  .weekbar { gap: 8px; padding: 8px 10px; }
  .weeknav { flex: 1 1 100%; justify-content: space-between; }
  .weekinfo { flex: 1; min-width: 0; }
  .wishbar-inline { flex: 1 1 100%; flex-wrap: wrap; }
  .wm-panel { right: auto; left: 0; }
  .wtabs { display: flex; width: 100%; }
  .wtab { flex: 1; text-align: center; padding: 8px 6px; font-size: .82rem; }
  .weektabs { width: 100%; }
  .weektab { flex: 1 1 22%; padding: 6px 4px; font-size: .85rem; }
  .weektab small { font-size: .62rem; }
  .wp-legend { display: none; }
  .wday { grid-template-columns: 1fr; gap: 8px; padding: 12px; }
  .wdate { display: flex; align-items: baseline; gap: 8px; }
  .wdate strong { display: inline; }
  .wchoice { padding: 8px 12px; }
  .cal-months { grid-template-columns: 1fr; }
  .cal-day { height: 46px; }
  .page-cal .toolbar { gap: 8px; }
  .hero-text p { font-size: .95rem; }
}
.page-plan .plan tr.srow th.name, .page-plan .plan tr.sgroup th.name, .page-plan .plan tr.sshift th.name { white-space: normal; line-height: 1.15; }
.page-plan .plan tr.srow th.name .slabel { display: block; }
/* Status als kleine Einblendung unter der Wochenleiste: verschiebt nichts mehr */
.weekbar { position: relative; }
.weekbar .status { position: absolute; right: 12px; top: calc(100% + 4px); z-index: 25; margin: 0; padding: 3px 12px; border-radius: 999px; background: var(--surface);
                   border: 1px solid var(--border-strong); box-shadow: var(--shadow); font-size: .8rem; }
.weekbar .status:empty { display: none; }

/* Zeiträume (Ferien, Veranstaltung, Sonstiges): ein durchgehender Balken über den Tagen, Titel einmal */
.plan thead tr.lanehead th { height: 22px; padding: 2px 0 0; background: var(--surface); border: 0; }
.plan thead tr.lanehead th.lane-empty { background: var(--surface); }
.plan thead tr.lanehead th.lane-fill { padding: 0 8px; font-size: .72rem; font-weight: 800; line-height: 20px; color: #111; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: default; }
.plan thead tr.lanehead th.lane-fill.k-school { background: var(--c-school); }
.plan thead tr.lanehead th.lane-fill.k-event { background: var(--c-event); }
.plan thead tr.lanehead th.lane-fill.k-other { background: var(--c-other); }
.plan thead tr.lanehead th.lane-fill.k-multi { background: repeating-linear-gradient(135deg, #8a63d2 0 8px, #6f4fc0 8px 16px); color: #fff; }
.page-plan .plan th.p-school:not(.today), .page-plan .plan th.p-event:not(.today), .page-plan .plan th.p-other:not(.today),
.page-own .plan th.p-school:not(.today), .page-own .plan th.p-event:not(.today), .page-own .plan th.p-other:not(.today) { box-shadow: none; }

/* Wochenplanung ruhiger: schmalere Mitte, weichere Farben in der Stärke */
.page-plan { max-width: 1080px; margin-left: auto; margin-right: auto; }
.page-plan .plan td.bad, .page-plan .plan tr.srow td.bad { background: rgba(227, 0, 15, .15); color: var(--err-text); font-weight: 800; }
.page-plan .plan td.good, .page-plan .plan tr.srow td.good { background: var(--ok-bg); color: var(--ok-text); }
.page-plan .plan tr.srow td.soll { background: var(--surface-3); color: var(--text); }
.page-plan .plan td.cell { border-bottom-color: var(--border); }

/* Marke "Anmerkung am Dienst" im Jahresplan: dezent statt rot */
.yeartable td.has-note::after { border-top: 6px solid var(--primary-text); border-left: 6px solid transparent; }

/* Hinweise zu Tagen (Feiertag, Ferien, Veranstaltung) auf den Wunsch-Seiten */
.wtags { display: inline-flex; flex-wrap: wrap; gap: 3px; margin-left: 6px; vertical-align: middle; }
.wdate .wtags { display: flex; margin: 4px 0 0; }
.wtag { padding: 1px 8px; border-radius: 999px; font-size: .68rem; font-weight: 700; color: #111; white-space: nowrap; cursor: default; }
.wtag-holiday { background: var(--primary); color: #fff; }
.wtag-school { background: var(--c-school); }
.wtag-event { background: var(--c-event); }
.wtag-other { background: var(--c-other); color: #fff; }
.wtag-multi { background: repeating-linear-gradient(135deg, #8a63d2 0 8px, #6f4fc0 8px 16px); color: #fff; }
.wcomment { margin-top: 6px; }
.wcomment input { width: 100%; max-width: 380px; padding: 6px 12px; border-radius: 999px; font-size: .82rem; }
.wchoice.important { border-color: #d24b4b; color: var(--err-text); }
.wchoice.important.on { border-color: var(--text); color: #111; }
.wchoice:disabled { opacity: .45; cursor: not-allowed; }
.wcm { display: block; margin-top: 1px; font-size: .6rem; line-height: 1.1; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wp-comment { display: block; font-size: .72rem; font-weight: 500; color: var(--muted); white-space: normal; }
.wptable th.daycol .wtags { display: flex; justify-content: center; margin: 2px 0 0; }

/* Kopfzeile: nur die Eiche, daneben "Übersicht" */
.brand { gap: 0; padding-right: 4px; }
.brand-oak { width: 38px; }
/* Startseite: Bereiche mit einheitlichen, flachen Kacheln */
body.start .page { max-width: 980px; }
.start-section { margin: 0 0 26px; }
.start-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; margin: 0 0 10px; padding-bottom: 6px; border-bottom: 2px solid var(--border-strong); }
.start-head h2 { margin: 0; font-size: 1.05rem; letter-spacing: .01em; }
.start-head span { color: var(--muted); font-size: .85rem; }
body.start .tiles { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
body.start .tile { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px; box-shadow: none; }
body.start .tile .tile-icon { flex: none; margin: 0; width: 44px; height: 44px; }
.tile-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tile-body strong { font-size: .98rem; }
.tile-body small { color: var(--muted); font-size: .8rem; line-height: 1.3; }
body.start .tile .tile-arrow { position: static; flex: none; font-size: 1.6rem; line-height: 1; color: var(--muted); }
body.start a.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
body.start a.tile:hover .tile-arrow { color: var(--primary-text); transform: translateX(3px); }
/* Wochenleiste: KW und Jahr vollständig sichtbar */
.yearinput { width: 5.4em; min-width: 5.4em; padding: 0 6px; text-align: center; }
.weekinfo, .page-plan .weekinfo { min-width: 210px; padding-left: 12px; padding-right: 12px; }
.weeklabel { white-space: nowrap; }
.page-plan .weekbar .weeklabel select { min-width: 3.2em; }
/* Anmeldung: Warnung vor der Kontosperre; Markierung gesperrter Konten */
.warn { color: var(--text); background: rgba(231, 155, 0, .16); border: 1px solid #e79b00; border-left-width: 5px; padding: 10px 12px; border-radius: var(--radius-sm);
        margin: 12px 0 0; font-size: .9rem; font-weight: 600; }
.lockbadge { display: inline-block; margin-left: 6px; padding: 1px 9px; border-radius: 999px; background: var(--danger); color: #fff; font-size: .7rem; font-weight: 800; vertical-align: middle; }
/* DSM-Ansicht: Dienstauswahl und kleine Tabelle */
.page-dsm { max-width: 980px; margin-left: auto; margin-right: auto; padding-top: 8px; }
.dsm-pick { padding: 12px 14px; margin-bottom: 10px; }
.dsm-pick-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; margin-bottom: 8px; }
.dsm-pick-head .muted { margin: 0; flex: 1; font-size: .82rem; }
.dsm-codes { display: flex; flex-wrap: wrap; gap: 6px; }
.dsm-chip { min-width: 46px; padding: 6px 12px; border: 2px solid transparent; border-radius: 9px; background: var(--surface-2); font: inherit; font-weight: 800; font-size: .82rem; cursor: pointer; opacity: .6; }
.dsm-chip:hover { opacity: 1; box-shadow: 0 0 0 2px var(--primary); }
.dsm-chip.on { opacity: 1; border-color: var(--text); box-shadow: 0 2px 8px rgba(0, 0, 0, .22); }
.dsm-empty { padding: 22px; text-align: center; color: var(--muted); }
.dsm-table { table-layout: fixed; width: 100%; min-width: 640px; }
.dsm-table th.name, .dsm-table td.name { width: 150px; min-width: 150px; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dsm-table td.cell { height: 28px; padding: 2px 4px; }
.dsm-table td.cell .code { display: block; height: 22px; line-height: 22px; border-radius: 6px; font-size: .75rem; font-weight: 800; text-align: center; }
.dsm-table tr.group th { height: 22px; padding: 0 10px; background: var(--gc, var(--primary)); color: #fff; font-size: .68rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; border: 0; }
.dsm-table tr.dsm-sum th, .dsm-table tr.dsm-sum td { padding: 4px; background: var(--surface-2); font-weight: 800; font-size: .8rem; text-align: center; }
.dsm-table tr.dsm-sum th { text-align: left; padding-left: 10px; text-transform: uppercase; letter-spacing: .06em; font-size: .72rem; color: var(--muted); }
.dsm-table tr.dsm-sum td.none { color: var(--muted); font-weight: 500; }
/* Druck-Warnung Stärke: Funktion (FS/SP) und VUB-Hinweis je Schicht */
.wc-day { min-width: 190px; }
.wc-line { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; margin-top: 3px; }
.wc-vub { font-size: .72rem; font-weight: 600; color: var(--muted); }
.wc-vub.yes { color: var(--ok-text); font-weight: 800; }
/* Meine Wünsche: große Anzeige des eigenen Wunsches rechts neben der Auswahl */
.wsummary { display: flex; flex-direction: column; justify-content: center; gap: 5px; align-self: stretch; padding: 10px 14px; border: 2px dashed var(--border-strong); border-radius: 14px; background: var(--surface-2); text-align: center; }
.wsummary.set { border-style: solid; border-color: var(--border-strong); background: var(--surface); }
.wsum-label { font-size: .66rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.wsum-none { font-size: .9rem; font-weight: 600; color: var(--muted); }
.wsum-pill { display: block; padding: 7px 10px; border-radius: 999px; border: 1px solid rgba(0, 0, 0, .15); color: #111; font-size: 1rem; font-weight: 800; line-height: 1.2; }
.wsum-comment { font-size: .78rem; font-style: italic; color: var(--muted); overflow-wrap: anywhere; }
@media (max-width: 900px) {
  .wday { grid-template-columns: 96px minmax(0, 1fr); }
  .wsummary { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: flex-start; gap: 10px; padding: 8px 12px; text-align: left; }
}
@media (max-width: 640px) {
  .wday { grid-template-columns: 1fr; }
  .wsum-pill { display: inline-block; }
}
/* Diensttausch */
.dsm-swaphint { display: block; margin: 0 0 12px; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--danger-soft); border: 1px solid var(--danger); color: var(--err-text); text-decoration: none; }
.nav-badge { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 6px; border-radius: 999px; background: var(--danger); color: #fff; font-size: .72rem; font-weight: 800; line-height: 18px; text-align: center; }
.swap-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.swap-top h1 { margin: 0; }
.swap-status { margin: 8px 0 0; min-height: 1.2em; }
.swap-status.err-text { color: var(--err-text); font-weight: 700; }
.swap-new { padding: 18px 20px; margin: 14px 0 20px; }
.sw-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.sw-head h2 { margin: 0; font-size: 1.1rem; }
.sw-head .btn { margin-left: auto; }
.sw-count { background: var(--danger); color: #fff; border-radius: 999px; padding: 0 8px; font-size: .75rem; font-weight: 800; line-height: 18px; }
.sw-section { margin: 22px 0; }
.sw-section .sw-head .muted { margin: 0; font-size: .85rem; }
.sw-card { padding: 12px 14px; margin-bottom: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.sw-card.attention { border-left: 5px solid var(--accent); }
.sw-card.done { opacity: .75; }
.sw-card.history { opacity: .85; }
.sw-desc { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.sw-duty { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; background: var(--surface-2); border-radius: 8px; }
.sw-code { display: inline-block; padding: 1px 7px; border-radius: 6px; font-size: .8rem; font-weight: 700; background: var(--surface-2); }
.sw-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; font-size: .85rem; color: var(--muted); }
.sw-status { font-weight: 700; }
.sw-status.st-done { color: var(--ok-text); }
.sw-status.st-declined, .sw-status.st-invalid { color: var(--err-text); }
.sw-warning { color: var(--err-text); font-weight: 600; }
.sw-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.sw-offers { margin-top: 10px; padding: 8px 10px; background: var(--surface-2); border-radius: var(--radius-sm); }
.sw-offers-head { font-weight: 700; font-size: .85rem; margin-bottom: 4px; }
.sw-offer { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 4px 0; }
.sw-offer .sw-actions { margin: 0 0 0 auto; }
.sw-step { margin: 14px 0; }
.sw-step-title { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.sw-num { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--primary); color: #fff; font-size: .8rem; font-weight: 800; }
.sw-choice { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.sw-opt { padding: 8px 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.sw-opt.on { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 700; }
.sw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.sw-pick { display: flex; justify-content: space-between; align-items: center; gap: 6px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.sw-pick.on { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary); }
.sw-select, .swap-new input[type="text"] { width: 100%; max-width: 420px; }
.btn-send { margin-top: 6px; }
.btn-send:disabled { opacity: .5; cursor: not-allowed; }
.check-inline { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
@media (max-width: 640px) { .sw-offer .sw-actions { margin-left: 0; } .sw-actions .btn { flex: 1 1 auto; } }

/* 11 · Handy */
@media (max-width: 640px) {
  :root { --namew: 108px; }
  .topbar-inner { gap: 8px; padding: 6px 10px; }
  .user-name { display: none; }
  .backlink span { display: none; }
  .backlink { padding: 6px 8px; }
  .page { padding: 14px 10px 28px; }
  .page-wide { padding: 8px 8px 12px; }
  .page-wide .page-title { float: none; margin: 0 0 6px; }
  .page-wide .page-title h1 { font-size: 1.1rem; }
  .toolbar { gap: 8px; }
  .toolbar .range { order: 9; width: 100%; margin: 0; }
  .status { width: 100%; margin-left: 0; }
  .btn, .segmented button, .segmented a { padding: 9px 14px; }
  .field-inline input[type=number] { width: 72px; }
  .tablewrap { max-height: calc(100vh - 175px); }

  table.plan:not(.yeartable) { min-width: 0; }
  .plan th.daycol { min-width: 56px; }
  .plan th.name, .plan td.name { padding: 2px 6px; font-size: .78rem; }
  .plan td.cell { height: 36px; }
  .plan td.cell .code { height: 30px; line-height: 30px; font-size: .8rem; }
  .tag { font-size: .56rem; }
  .yeartable td.cell { height: 28px; }
  .yeartable td.cell .code { height: 24px; line-height: 24px; }

  .tiles { grid-template-columns: 1fr; }
  .card { margin: 16px auto; padding: 20px; }
  .pad { padding: 16px; }
  .form-grid > * { flex: 1 1 100%; }
  .form-grid label.grow { min-width: 0; }
  table.list { display: block; overflow-x: auto; }

  /* Auswahl als Sheet von unten */
  .picker-backdrop { background: rgba(0, 0, 0, .55); }
  .picker { left: 0 !important; right: 0; top: auto !important; bottom: 0; width: auto; max-height: 78vh;
            border-radius: 16px 16px 0 0; padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  .picker-chip { padding: 9px 12px; font-size: .9rem; }
}