/* Kitastempel – Gestaltung „Garderobe & Bauklötze“
   Himmelweiß als Grund, Nachtblau als Schrift, kräftige Bauklotzfarben als Akzente.
   Jede Person hat am Terminal ihr Garderobenzeichen; jeder Bereich der Leitung seine Farbe. */
/* Nunito (SIL Open Font License, siehe fonts/OFL-Nunito.txt), lokal ausgeliefert – kein Internet nötig */
@font-face {
  font-family: "Nunito";
  src: url("fonts/nunito.woff2") format("woff2");
  font-weight: 200 1000;
  font-style: normal;
  font-display: swap;
}
:root {
  --sky: #f2f6fc;
  --paper: #ffffff;
  --ink: #1e2b4a;
  --muted: #64708b;
  --line: #dce3ef;
  --line-strong: #c3cee0;

  /* Bauklötze */
  --blau: #2f6fde;
  --gruen: #2fa36b;
  --gelb: #ffc53d;
  --tomate: #ee5a47;
  --flieder: #8a67d6;
  --himbeer: #dc4f94;
  --orange: #ff8b3d;
  --tuerkis: #17a2b0;

  /* Dienst-Zustände */
  --gruppe: #1f8a57;   --gruppe-bg: #e2f5ea;  --gruppe-fill: var(--gruen);
  --verf: #5d3fb0;     --verf-bg: #eee8fb;    --verf-fill: var(--flieder);
  --pause: #8a5d00;    --pause-bg: #fff2cc;   --pause-fill: var(--gelb);
  --off: #64708b;      --off-bg: #eef1f6;

  --accent: var(--blau);
  --area: var(--blau);
  --pos: #1f8a57;
  --neg: #cf3f33;
  --warn-bg: #ffe9d9;
  --warn-ink: #a1440a;

  --r-lg: 20px;
  --r-md: 12px;
  --r-sm: 8px;

  font-family: "Nunito", "Quicksand", ui-rounded, "SF Pro Rounded", "Segoe UI Variable Text", "Segoe UI", Roboto, system-ui, sans-serif;
  color: var(--ink);
  background: var(--sky);
}
* { box-sizing: border-box; }
body { margin: 0; font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--blau); text-underline-offset: 2px; }
h1 { font-size: 1.85rem; line-height: 1.15; margin: 0 0 .9rem; font-weight: 800; letter-spacing: -.015em; }
h2 { font-size: 1.2rem; margin: 1.8rem 0 .7rem; font-weight: 800; }
.panel h2:first-child, .panel h1:first-child { margin-top: 0; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.nowrap { white-space: nowrap; }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
code { background: var(--off-bg); padding: .1em .4em; border-radius: 6px; }
:focus-visible { outline: 3px solid var(--gelb); outline-offset: 2px; border-radius: 6px; }

/* ---------------- Knöpfe ---------------- */
.btn, button.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  background: var(--accent); color: #fff; border: 2px solid transparent;
  border-radius: 999px; padding: .5em 1.15em; font: inherit; font-weight: 800;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  box-shadow: 0 2px 0 rgba(30, 43, 74, .18);
}
.btn:hover { filter: brightness(1.07); }
.btn:active { transform: translateY(1px); box-shadow: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.ghost { background: var(--paper); color: var(--ink); border-color: var(--line-strong); box-shadow: none; }
.btn.ghost:hover { border-color: var(--blau); color: var(--blau); filter: none; }
.btn.small { padding: .28em .8em; font-size: .85rem; }
.btn.danger { background: var(--paper); color: var(--neg); border-color: #f3c3bd; box-shadow: none; }
.btn.danger:hover { background: #fff1ef; filter: none; }
.linkbtn { background: none; border: 0; color: inherit; font: inherit; cursor: pointer; padding: 0; text-decoration: underline; text-underline-offset: 2px; }

/* =====================================================================
   Terminal – die „Wer ist heute da?“-Tafel
   ===================================================================== */
body.term { min-height: 100vh; user-select: none; -webkit-user-select: none;
  background:
    radial-gradient(circle at 92% -10%, #fff3c4 0 220px, transparent 221px),
    var(--sky); }
.terminal { max-width: 1240px; margin: 0 auto; padding: 26px 32px 18px; min-height: 100vh; display: flex; flex-direction: column; }
.t-head { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.t-left { display: flex; align-items: center; gap: 20px; }
.t-logo { height: 92px; width: auto; max-width: 220px; object-fit: contain; background: #fff; border-radius: 22px; padding: 8px; box-shadow: 0 4px 0 var(--line); }
.t-head h1 { font-size: 2.5rem; margin: 0; }
.t-head p { margin: 2px 0 0; color: var(--muted); font-size: 1.15rem; font-weight: 600; }
.clock { font-size: 3.6rem; font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1; letter-spacing: -.02em;
  background: var(--gelb); color: var(--ink); padding: 16px 26px; border-radius: 28px;
  box-shadow: 0 6px 0 #e3a514; }
.t-hint { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; color: var(--muted); margin: 22px 0 14px; font-size: 1.1rem; font-weight: 600; }
.t-hint b { color: var(--ink); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; flex: 1; align-content: start; }
.tile {
  --pc: var(--blau);
  position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px;
  background: var(--paper); border: 3px dashed var(--line-strong); border-radius: 26px;
  padding: 22px 14px 16px; font: inherit; color: inherit; cursor: pointer; min-height: 178px;
  transition: transform .08s ease;
}
.tile:active { transform: scale(.97); }
.tile::before { /* Garderobenhaken */
  content: ""; position: absolute; top: -9px; left: 50%; width: 26px; height: 14px; margin-left: -13px;
  border: 4px solid var(--line-strong); border-bottom: 0; border-radius: 14px 14px 0 0; background: var(--sky);
}
.avatar { width: 66px; height: 66px; border-radius: 50%; display: grid; place-items: center; font-size: 2.1rem; line-height: 1;
  background: color-mix(in srgb, var(--pc) 22%, white); box-shadow: inset 0 0 0 4px var(--pc); }
.t-name { font-size: 1.25rem; font-weight: 800; line-height: 1.2; }
.pill { display: inline-block; border-radius: 999px; padding: .2em .8em; font-size: .9rem; font-weight: 800; background: var(--off-bg); color: var(--off); white-space: nowrap; }
/* anwesend: Kachel leuchtet in der Farbe des Dienstes */
.tile.s-gruppe { border: 3px solid var(--gruppe-fill); background: var(--gruppe-bg); }
.tile.s-verfuegung { border: 3px solid var(--verf-fill); background: var(--verf-bg); }
.tile.s-pause { border: 3px solid var(--pause-fill); background: var(--pause-bg); }
.tile.s-gruppe::before { border-color: var(--gruppe-fill); }
.tile.s-verfuegung::before { border-color: var(--verf-fill); }
.tile.s-pause::before { border-color: var(--pause-fill); }
.tile.s-gruppe .pill, .pill.s-gruppe { background: var(--gruppe-fill); color: #fff; }
.tile.s-verfuegung .pill, .pill.s-verfuegung { background: var(--verf-fill); color: #fff; }
.tile.s-pause .pill, .pill.s-pause { background: var(--gelb); color: var(--ink); }
.tile.s-off .t-name { color: #44506d; }
.empty { color: var(--muted); font-size: 1.1rem; }
.offline { background: var(--warn-bg); color: var(--warn-ink); padding: 10px 14px; border-radius: var(--r-md); font-weight: 700; }
.t-foot { display: flex; justify-content: flex-end; gap: 20px; padding-top: 20px; }
.offline.queue { background: #e3edfd; color: #1f55b5; }
.t-foot a { color: var(--muted); font-size: .9rem; }

/* QR-Code auf der Kachel (freiwillige Handy-Anmeldung) */
.t-qr { position: absolute; top: 10px; right: 10px; width: 62px; height: 62px; padding: 3px; background: #fff;
  border-radius: 10px; box-shadow: 0 0 0 2px var(--line); display: block; }
.t-qr img { width: 100%; height: 100%; display: block; image-rendering: pixelated; }
.tile:has(.t-qr) { padding-top: 26px; }
.qr-big { position: fixed; inset: 0; background: rgba(30, 43, 74, .55); display: grid; place-items: center; padding: 20px; z-index: 20; }
.qr-big[hidden] { display: none; }
.qr-card { background: var(--paper); border-radius: 30px; padding: 26px 30px; text-align: center; width: min(460px, 100%);
  box-shadow: 0 24px 70px rgba(30, 43, 74, .35); }
.qr-card h2 { margin: 0 0 12px; font-size: 1.6rem; }
.qr-card img { width: min(320px, 80vw); height: auto; display: block; margin: 0 auto 14px; image-rendering: pixelated; }
.qr-card p { margin: 6px 0; font-weight: 600; }

/* Handy-Seite: eine Person, Stempelfenster fest im Bild */
body.handy { min-height: 100vh; }
.handy-wrap { max-width: 540px; margin: 0 auto; padding: 14px 16px 0; }
.h-head { display: flex; align-items: center; gap: 12px; }
.h-head > div:not(.h-clock) { flex: 1; display: flex; flex-direction: column; line-height: 1.2; }
.h-head span { color: var(--muted); font-size: .9rem; font-weight: 600; }
.h-logo { height: 44px; width: auto; max-width: 110px; object-fit: contain; background: #fff; border-radius: 12px; padding: 4px; }
.h-clock { font-size: 1.6rem; font-weight: 900; font-variant-numeric: tabular-nums; background: var(--gelb); padding: 6px 14px; border-radius: 16px; box-shadow: 0 4px 0 #e3a514; }
.h-note { color: var(--muted); font-size: .85rem; margin: 10px 0 0; }
.h-error { margin-top: 30px; }
body.handy .modal { position: static; background: none; padding: 12px 12px 30px; }
body.handy .sheet { box-shadow: 0 10px 30px rgba(30, 43, 74, .18); padding: 22px 18px 20px; }
body.handy .sheet .close { display: none; }
body.handy .teamnav { grid-template-columns: repeat(2, 1fr); }
.ev-src { font-size: .85em; margin-left: 2px; }
.qr-field { display: flex; gap: 16px; align-items: flex-start; }
.qr-field legend { width: 100%; }
.qr-preview { width: 120px; height: 120px; flex: none; background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: 4px; image-rendering: pixelated; }

/* PIN- und Aktionsfenster */
.modal { position: fixed; inset: 0; background: rgba(30, 43, 74, .5); display: grid; place-items: center; padding: 20px; z-index: 10; }
.modal[hidden] { display: none; }
.sheet { background: var(--paper); border-radius: 30px; padding: 28px 30px 26px; width: min(540px, 100%); position: relative;
  box-shadow: 0 24px 70px rgba(30, 43, 74, .35); border-top: 12px solid var(--pc, var(--blau)); }
.sheet h2 { margin: 0 0 4px; font-size: 1.75rem; }
.sheet .close { position: absolute; top: 10px; right: 14px; background: none; border: 0; font-size: 2.2rem; color: var(--muted); cursor: pointer; line-height: 1; padding: 6px 10px; }
.hint { color: var(--muted); margin: 0 0 12px; font-weight: 600; }
.pin-dots { display: flex; gap: 14px; justify-content: center; margin: 10px 0 20px; min-height: 20px; }
.pin-dots span { width: 18px; height: 18px; border-radius: 50%; border: 3px solid var(--line-strong); }
.pin-dots span.on { background: var(--pc, var(--blau)); border-color: var(--pc, var(--blau)); }
.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pad button { font: inherit; font-size: 1.8rem; font-weight: 800; padding: 15px 0; border-radius: 18px; border: 2px solid var(--line); background: var(--sky); color: var(--ink); cursor: pointer; }
.pad button:active { background: var(--line); }
.pad button.soft { color: var(--muted); background: var(--paper); }
.pad button.go { background: var(--blau); color: #fff; border-color: var(--blau); font-size: 1.35rem; }
.err { color: var(--neg); min-height: 1.4em; margin: 10px 0 0; text-align: center; font-weight: 800; }
.shake { animation: shake .35s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.status { font-size: 1.1rem; margin: 4px 0 12px; font-weight: 600; }
.today .evs { margin-bottom: 6px; }
.today .sum { color: var(--muted); margin: 6px 0 16px; font-size: .95rem; }
.actions { display: grid; gap: 10px; }
.act { font: inherit; font-size: 1.3rem; font-weight: 800; padding: 18px; border-radius: 18px; border: 0; cursor: pointer; color: #fff; box-shadow: 0 4px 0 rgba(30, 43, 74, .2); }
.act:active { transform: translateY(2px); box-shadow: none; }
.act:disabled { opacity: .5; }
.act-gruppe { background: var(--gruen); }
.act-verfuegung { background: var(--flieder); }
.act-pause { background: var(--gelb); color: var(--ink); }
.act-off { background: var(--ink); }
.act.suggest { outline: 4px solid var(--gelb); outline-offset: 3px; }
.act-pause.suggest { outline-color: var(--blau); }
.done-icon { width: 92px; height: 92px; border-radius: 50%; background: var(--gruen); color: #fff; display: grid; place-items: center; font-size: 3rem; font-weight: 900; margin: 10px auto; }
#step-done:not([hidden]) .done-icon { animation: pop .45s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes pop { from { transform: scale(.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.done-msg { text-align: center; font-size: 1.3rem; font-weight: 700; margin: 10px 0 20px; }
#step-done .btn { display: flex; width: 100%; padding: 14px; font-size: 1.1rem; }
.plan-today { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: -4px 0 12px; }
.plan-today .plan-label { font-size: .95rem; color: var(--muted); font-weight: 700; }
.plan-today .ev { font-size: .95rem; }
.teamnav { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 18px; }
.teamnav button { font: inherit; font-size: .92rem; font-weight: 800; padding: 11px 4px; border-radius: 14px; border: 2px solid var(--line); background: var(--sky); color: var(--ink); cursor: pointer; }
.teamnav button:nth-child(1) { border-color: color-mix(in srgb, var(--gruen) 45%, white); }
.teamnav button:nth-child(2) { border-color: color-mix(in srgb, var(--blau) 45%, white); }
.teamnav button:nth-child(3) { border-color: color-mix(in srgb, var(--gelb) 70%, white); }
.teamnav button:nth-child(4) { border-color: color-mix(in srgb, var(--himbeer) 45%, white); }
.teamnav button:nth-child(5) { border-color: color-mix(in srgb, var(--orange) 50%, white); }
.teamnav button:nth-child(6) { border-color: color-mix(in srgb, var(--tuerkis) 45%, white); }

/* Stempel-Chips */
div.evs { display: flex; flex-wrap: wrap; gap: 4px; }
td.evs .ev { margin: 1px 2px 1px 0; }
.ev { display: inline-block; font-size: .8rem; font-weight: 700; font-variant-numeric: tabular-nums; padding: .1em .55em; border-radius: 999px; background: var(--off-bg); color: var(--off); white-space: nowrap; }
.ev-gruppe { background: var(--gruppe-bg); color: var(--gruppe); }
.ev-verfuegung { background: var(--verf-bg); color: var(--verf); }
.ev-pause { background: var(--pause-bg); color: var(--pause); }

/* =====================================================================
   Leitung, Stellvertretung, Vorstand
   ===================================================================== */
.a-head { background: var(--ink); color: #fff; padding: 10px 26px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 24px; }
.brand { color: #fff; text-decoration: none; display: flex; align-items: center; gap: 12px; font-weight: 900; font-size: 1.1rem; line-height: 1.1; }
.brand-text > span { display: block; font-weight: 600; font-size: .76rem; color: #b9c4dc; }
.brand::before { /* vier Bauklötze als Zeichen */
  content: ""; width: 30px; height: 30px; flex: none; border-radius: 6px;
  background:
    linear-gradient(var(--gelb), var(--gelb)) 0 0 / 14px 14px no-repeat,
    linear-gradient(var(--tomate), var(--tomate)) 16px 0 / 14px 14px no-repeat,
    linear-gradient(var(--blau), var(--blau)) 0 16px / 14px 14px no-repeat,
    linear-gradient(var(--gruen), var(--gruen)) 16px 16px / 14px 14px no-repeat;
}
.brand-text { display: block; }
.brand.has-logo::before { display: none; }
.brand-logo { height: 36px; width: auto; max-width: 120px; object-fit: contain; background: #fff; border-radius: 8px; padding: 2px 4px; }
.a-head nav { display: flex; flex-wrap: wrap; gap: 2px; align-items: center; }
.a-head nav a { --c: var(--blau); color: #dfe6f3; text-decoration: none; padding: .42em .8em; border-radius: 999px; font-weight: 700; font-size: .94rem; }
.a-head nav a:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.a-head nav a.on { background: var(--c); color: #fff; }
.a-head nav a.n-home { --c: var(--tuerkis); }
.a-head nav a.n-plan { --c: var(--blau); }
.a-head nav a.n-zeit { --c: var(--gruen); }
.a-head nav a.n-abw { --c: var(--himbeer); }
.a-head nav a.n-bericht { --c: var(--orange); }
.a-head nav a.n-team { --c: var(--flieder); }
.a-head nav a.n-gruppen { --c: #e0a400; }
.a-head nav a.n-feiertage { --c: var(--tomate); }
.a-head nav a.n-protokoll { --c: #5b6b8c; }
.a-head nav a.n-benutzer, .a-head nav a.n-einst { --c: #5b6b8c; }
.a-head .who { margin-left: auto; display: flex; gap: 14px; align-items: center; }
.a-head .who a { text-decoration: none; color: #fff; font-weight: 800; display: flex; flex-direction: column; line-height: 1.15; text-align: right; }
.a-head .who a span { font-size: .75rem; color: #b9c4dc; font-weight: 600; }
.a-head .who .linkbtn { color: #b9c4dc; }

/* Bereichsfarbe für die jeweilige Seite */
.a-main { max-width: 1260px; margin: 0 auto; padding: 28px 28px 64px; }
.area-home { --area: var(--tuerkis); }
.area-plan { --area: var(--blau); }
.area-zeit { --area: var(--gruen); }
.area-abw { --area: var(--himbeer); }
.area-bericht { --area: var(--orange); }
.area-team { --area: var(--flieder); }
.area-gruppen { --area: #e0a400; }
.area-feiertage { --area: var(--tomate); }
.area-system { --area: #5b6b8c; }
.a-main > h1, .a-main > .titlebar > h1 { display: flex; align-items: center; gap: 12px; }
.a-main > h1::before, .a-main > .titlebar > h1::before {
  content: ""; width: 14px; height: 30px; border-radius: 5px; background: var(--area); flex: none;
}

.flash { padding: 11px 16px; border-radius: var(--r-md); margin-bottom: 14px; font-weight: 700; }
.flash.ok { background: var(--gruppe-bg); color: var(--gruppe); }
.flash.error { background: #ffe4e0; color: #b2332a; }
.flash.code { background: #fff4cc; color: #5c4200; border: 3px dashed var(--gelb); font-size: 1.05rem; }
.panel { background: var(--paper); border: 2px solid var(--line); border-radius: var(--r-lg); padding: 20px 22px; margin-bottom: 18px; }
.panel.empty { display: flex; gap: 16px; align-items: center; justify-content: space-between; border-style: dashed; }
.callout { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; padding: 12px 18px; border-color: var(--gelb); background: #fffbea; }
.narrow { max-width: 640px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; }
.two .panel { margin: 0; }
.two + .panel, .two + section { margin-top: 18px; }
.titlebar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-bottom: 18px; }
.titlebar h1, .titlebar h2 { margin: 0; margin-right: auto; }
.monthnav { display: flex; align-items: center; gap: 8px; font-weight: 800; }
.monthnav span { min-width: 150px; text-align: center; }
.monthnav .btn { padding: .3em .85em; font-size: 1.1rem; line-height: 1.2; }
select.big { font-size: 1.25rem; font-weight: 800; margin-right: auto; border-width: 2px; }

/* Tabellen */
table { border-collapse: collapse; width: 100%; }
.list, .days { background: var(--paper); border: 2px solid var(--line); border-radius: var(--r-lg); overflow: hidden; border-spacing: 0; border-collapse: separate; }
.list th, .days th { text-align: left; font-size: .84rem; font-weight: 800; color: var(--muted); padding: 11px 12px; border-bottom: 2px solid var(--line); background: #f7f9fd; }
.list td, .days td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.list tr:last-child td, .days tr:last-child td { border-bottom: 0; }
.list tbody tr:hover td { background: #f9fbff; }
.list.compact td { padding: 6px 10px; font-size: .93rem; }
.panel .list { border: 0; border-radius: 0; }
.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.r { text-align: right; white-space: nowrap; }
tr.inactive td { color: var(--muted); }
.days td { font-size: .92rem; }
.days .day { white-space: nowrap; }
.days tr.we td, .days tr.hol td { background: #f5f7fb; }
.days tr.fut td { color: #a9b2c4; }
.days tr.warn td.day { box-shadow: inset 4px 0 0 var(--tomate); }
.days .note { min-width: 160px; }
.tag { display: inline-block; font-size: .78rem; padding: .14em .6em; border-radius: 999px; margin: 1px 3px 1px 0; font-weight: 800; }
.tag-warn { background: var(--warn-bg); color: var(--warn-ink); }
.tag-abs { background: #fde6f1; color: #a62a68; }
.tag-hol { background: #ffe4e0; color: #b2332a; }
.tag-plan { background: #e3edfd; color: #1f55b5; }
.tag-wish { background: #fff2c2; color: #7a5600; }
.st-entwurf { background: var(--off-bg); color: var(--off); }
.st-vorgelegt { background: #fff2c2; color: #7a5600; }
.st-veroeffentlicht { background: var(--gruppe-bg); color: var(--gruppe); }
.wd { display: inline-block; width: 1.9em; text-align: center; font-size: .75rem; color: #b8c1d2; font-weight: 700; }
.wd.on { color: var(--ink); font-weight: 900; }
.scroll { max-height: 520px; overflow: auto; }
form.del { display: inline-flex; gap: 6px; }
form.del input { width: 140px; padding: .3em .5em; font-size: .85rem; }
form.adj { display: inline-flex; gap: 4px; justify-content: flex-end; }
form.adj input { width: 58px; padding: .25em .4em; font-size: .85rem; text-align: right; }

/* Kennzahlen: farbige Bauklötze statt gleicher Karten */
.cards { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-bottom: 16px; }
.card { background: var(--paper); border: 2px solid var(--line); border-radius: var(--r-md); padding: 10px 14px; display: flex; flex-direction: column; }
.card span { font-size: .8rem; color: var(--muted); font-weight: 700; }
.card b { font-size: 1.45rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.card small { color: var(--muted); font-size: .75rem; }
.card.c-gruppe { background: var(--gruppe-bg); border-color: transparent; }
.card.c-gruppe b { color: var(--gruppe); }
.card.c-verf { background: var(--verf-bg); border-color: transparent; }
.card.c-verf b { color: var(--verf); }
.card.strong { background: var(--ink); color: #fff; border-color: var(--ink); }
.card.strong span, .card.strong small { color: #b9c4dc; }
.card.strong .pos { color: #7be0ad; }
.card.strong .neg { color: #ff9c90; }

/* Formulare */
.form { display: grid; gap: 14px; margin-bottom: 10px; }
.form label { display: grid; gap: 5px; font-weight: 700; font-size: .93rem; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.form label.chk { display: flex; gap: 9px; align-items: flex-start; font-weight: 600; }
.form fieldset { border: 2px solid var(--line); border-radius: var(--r-md); padding: 10px 14px; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.form fieldset legend { font-weight: 800; font-size: .93rem; padding: 0 4px; }
.form fieldset label.chk { align-items: center; }
.form .btn { justify-self: start; }
.buttons { display: flex; gap: 10px; align-items: center; }
.spacer { flex: 1; }
input, select { font: inherit; padding: .5em .7em; border: 2px solid var(--line-strong); border-radius: 10px; background: #fff; color: var(--ink); }
input:focus, select:focus { border-color: var(--blau); outline: none; box-shadow: 0 0 0 3px #d6e4fb; }
input[type=checkbox], input[type=radio] { width: 19px; height: 19px; margin-top: 2px; accent-color: var(--blau); }
input[type=color] { width: 44px; height: 36px; padding: 2px; }
.inline-form { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0; }
.inline-form input:not([type=checkbox]):not([type=color]), .inline-form select { padding: .3em .55em; font-size: .9rem; }
input.tiny { width: 66px; }

/* ---------------- Dienstplan ---------------- */
.shiftmini { display: inline-block; font-size: .8rem; font-weight: 700; padding: .06em .55em; border-radius: 7px; margin: 1px 3px 1px 0;
  background: color-mix(in srgb, var(--gc) 16%, white); border-left: 4px solid var(--gc); white-space: nowrap; font-variant-numeric: tabular-nums; }
.plancell { white-space: nowrap; }
.statusbar { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; padding: 12px 18px; }
.statusbar p { margin: 0; }
.statusbar .flash { width: 100%; margin: 0; }
.approve { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.approve input { min-width: 260px; }
.planwrap { overflow-x: auto; margin-bottom: 8px; }
.plangrid { border-collapse: separate; border-spacing: 0; width: 100%; background: var(--paper); border: 2px solid var(--line); border-radius: var(--r-lg); table-layout: fixed; min-width: 860px; }
.plangrid th, .plangrid td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); padding: 6px; vertical-align: top; text-align: left; }
.plangrid tr > :last-child { border-right: 0; }
.plangrid tbody tr:last-child > * { border-bottom: 0; }
.plangrid thead th { background: #f7f9fd; font-size: .9rem; font-weight: 900; border-bottom: 2px solid var(--line); }
.plangrid thead th span { font-weight: 600; color: var(--muted); }
.plangrid thead th small { display: block; font-weight: 600; color: var(--muted); font-size: .72rem; }
.plangrid thead th.hol small { color: #b2332a; font-weight: 800; }
.plangrid .pg-name { width: 152px; background: #f7f9fd; font-size: .92rem; font-weight: 800; }
.plangrid .pg-name small { display: block; font-weight: 600; color: var(--muted); font-size: .75rem; }
.plangrid .pg-sum { width: 100px; font-size: .86rem; }
.plangrid thead th.today { background: var(--gelb); color: var(--ink); }
.plangrid thead th.today span { color: var(--ink); }
.plangrid td.today { background: #fffbea; }
.plangrid td.hol, .plangrid td.off { background: repeating-linear-gradient(135deg, #f4f6fa 0 6px, #eceff5 6px 12px); }
.plangrid td.abs .shift { opacity: .5; }
.plangrid tr.me > * { background: #eef8f2; }
.plangrid tr.me .pg-name { box-shadow: inset 5px 0 0 var(--gruen); }
.shift { display: block; width: 100%; text-align: left; font: inherit; font-size: .86rem; line-height: 1.25; color: var(--ink);
  background: color-mix(in srgb, var(--gc) 15%, white); border: 0; border-left: 5px solid var(--gc); border-radius: 9px;
  padding: 5px 8px; margin-bottom: 4px; font-variant-numeric: tabular-nums; }
.shift b { font-weight: 900; }
button.shift { cursor: pointer; }
button.shift:hover { background: color-mix(in srgb, var(--gc) 25%, white); }
.shift small { display: block; color: var(--muted); font-size: .74rem; font-weight: 600; }
.shift small.note { color: var(--ink); font-style: italic; }
.shift small.swap { color: #1f55b5; font-weight: 800; }
.shift.k-verfuegung { background: repeating-linear-gradient(135deg, var(--verf-bg) 0 6px, #f6f2fd 6px 12px); border-left-color: var(--flieder); }
.plangrid .tag { display: block; width: fit-content; margin: 2px 0; font-size: .72rem; }
.addshift { display: block; width: 100%; border: 2px dashed var(--line-strong); background: transparent; color: var(--muted); border-radius: 9px; cursor: pointer; font-size: 1rem; font-weight: 800; line-height: 1.2; padding: 1px 0; }
.addshift:hover { background: #fff; color: var(--blau); border-color: var(--blau); }
.covgrid td { padding: 7px 6px 4px; }
.gdot { display: inline-block; width: 12px; height: 12px; border-radius: 4px; background: var(--gc); margin-right: 7px; }
.cov { display: flex; gap: 2px; height: 20px; }
.slot { flex: 1; border-radius: 4px; background: #e3e8f1; }
.slot.ok { background: var(--gruen); }
.slot.low { background: var(--tomate); }
.covlbl { display: flex; justify-content: space-between; font-size: .72rem; color: var(--muted); margin-top: 3px; gap: 4px; font-weight: 600; }
.covlbl b { font-size: .74rem; }
.swaprow { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.swaprow:last-child { border-bottom: 0; }
p.changed { border-left: 4px solid var(--gelb); padding-left: 8px; }
.groupform { margin-bottom: 10px; }
.groupform .gname { font-weight: 900; font-size: 1.1rem; }
.staffform { margin-top: 10px; padding-top: 10px; border-top: 2px dashed var(--line); }
.staffform .days { display: inline-flex; gap: 6px; }
dialog.dlg { border: 0; border-radius: 26px; padding: 24px 26px; width: min(580px, 94vw); box-shadow: 0 24px 70px rgba(30, 43, 74, .35); background: var(--paper); color: var(--ink); border-top: 10px solid var(--blau); }
dialog.dlg::backdrop { background: rgba(30, 43, 74, .5); }
dialog.dlg h2 { margin: 0; }
dialog.dlg #dlg-who { margin: 0 0 6px; }

/* ---------------- Team-Bereich (Tablet) ---------------- */
body.team { background: var(--sky); }
.team-head { display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center; padding: 14px 24px; background: var(--ink); color: #fff; }
.team-head > div { display: flex; flex-direction: column; line-height: 1.2; font-size: 1.1rem; }
.team-head > div span { color: #b9c4dc; font-size: .85rem; }
.team-head nav { display: flex; gap: 6px; flex-wrap: wrap; margin-right: auto; }
.team-head nav a { padding: .55em 1.1em; border-radius: 999px; text-decoration: none; color: #dfe6f3; font-weight: 800; }
.team-head nav a:nth-child(1).on { background: var(--gruen); color: #fff; }
.team-head nav a:nth-child(2).on { background: var(--blau); color: #fff; }
.team-head nav a:nth-child(3).on { background: var(--gelb); color: var(--ink); }
.team-head nav a:nth-child(4).on { background: var(--himbeer); color: #fff; }
.team-head nav a:nth-child(5).on { background: var(--orange); color: #fff; }
.team-head nav a:nth-child(6).on { background: var(--tuerkis); color: #fff; }
.team-head nav a:nth-child(7).on { background: #5b6b8c; color: #fff; }

/* Urlaub, Vertretung, Kalender, Hilfe */
.lv-offen { background: #fff2c2; color: #7a5600; }
.lv-genehmigt { background: var(--gruppe-bg); color: var(--gruppe); }
.lv-abgelehnt { background: #ffe4e0; color: #b2332a; }
.lv-zurueckgezogen { background: var(--off-bg); color: var(--off); }
.vac-account { margin-bottom: 14px; }
.vac-bar { display: flex; height: 16px; border-radius: 999px; background: var(--gruppe-bg); overflow: hidden; margin: 6px 0 4px; box-shadow: inset 0 0 0 2px var(--line); }
.vac-bar .vb-taken { background: var(--himbeer); }
.vac-bar .vb-planned { background: repeating-linear-gradient(135deg, #f3a6cb 0 6px, #f8c9df 6px 12px); }
.leave-card .leave-head { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; }
.leave-card h2 { margin: 0; }
.leave-rest { text-align: right; display: flex; flex-direction: column; }
.leave-rest span, .leave-rest small { color: var(--muted); font-size: .8rem; font-weight: 700; }
.leave-rest b { font-size: 1.7rem; font-weight: 900; }
.leave-checks { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 4px; }
.leave-checks li { padding: 5px 10px 5px 12px; border-radius: 8px; font-weight: 600; font-size: .93rem; border-left: 4px solid var(--line-strong); background: #f7f9fd; }
.leave-checks li.warn { border-left-color: var(--gelb); background: #fffbea; }
.leave-checks li.bad { border-left-color: var(--tomate); background: #ffefec; }
.leave-checks li.good { border-left-color: var(--gruen); background: var(--gruppe-bg); }
.leave-actions { display: flex; flex-wrap: wrap; gap: 10px 20px; }
.subst-link { display: block; font-size: .74rem; font-weight: 800; color: var(--tomate); margin: -2px 0 4px; }
.subst-head { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.subst-head .shift { width: auto; min-width: 260px; margin: 0; font-size: 1rem; }
.cal-qr { width: 180px; height: 180px; margin: 4px 0 12px; }
.cal-qr svg { width: 100%; height: 100%; }
code.copy { display: block; padding: 8px 10px; word-break: break-all; user-select: all; }
.mt { margin-top: 14px; }
.blocked { margin: 10vh auto 0; }
.demo-band { background: repeating-linear-gradient(135deg, #ffe27a 0 18px, #ffd54a 18px 36px); color: var(--ink);
  text-align: center; padding: 6px 12px; font-size: .92rem; font-weight: 600; }
.demo-panel { border-color: var(--gelb); background: #fffdf0; }
.mail-log .tag-demo { background: #fff2c2; color: #7a5600; }
.blocked .t-logo { margin-bottom: 12px; }
.blocked li { margin-bottom: 6px; }
.a-foot { max-width: 1260px; margin: 0 auto; padding: 0 28px 28px; color: var(--muted); font-size: .82rem; display: flex; gap: 14px; flex-wrap: wrap; }
.a-foot a { color: var(--muted); }
.mail-log td { font-size: .85rem; }
.handbuch { max-width: 820px; line-height: 1.6; }
.handbuch h1 { font-size: 2rem; }
.handbuch h2 { margin-top: 2.2rem; padding-top: .6rem; border-top: 2px solid var(--line); }
.handbuch h3 { margin: 1.4rem 0 .4rem; font-size: 1.05rem; }
.handbuch table { border-collapse: collapse; margin: 10px 0 16px; background: var(--paper); }
.handbuch th, .handbuch td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; vertical-align: top; }
.handbuch th { background: #f7f9fd; }
.handbuch blockquote { margin: 12px 0; padding: 8px 14px; background: #fffbea; border-left: 4px solid var(--gelb); border-radius: 8px; }
.handbuch code { font-size: .9em; }
.help-layout { display: grid; grid-template-columns: 240px 1fr; gap: 28px; align-items: start; }
.help-toc { position: sticky; top: 16px; font-size: .9rem; background: var(--paper); border: 2px solid var(--line); border-radius: var(--r-lg); padding: 14px 16px; max-height: calc(100vh - 40px); overflow: auto; }
.help-toc ul { list-style: none; padding-left: 0; margin: 0; }
.help-toc ul ul { padding-left: 12px; }
.help-toc a { color: var(--ink); text-decoration: none; display: block; padding: 2px 0; }
.help-toc a:hover { color: var(--blau); }
.help-tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
@media (max-width: 900px) { .help-layout { grid-template-columns: 1fr; } .help-toc { position: static; max-height: none; } }
.team-head .btn { background: #fff; color: var(--ink); }
.team-logo { height: 40px; width: auto; max-width: 110px; object-fit: contain; background: #fff; border-radius: 9px; padding: 2px 4px; }
.logo-row { display: grid; grid-template-columns: 200px 1fr; gap: 22px; align-items: start; }
.logo-preview { height: 150px; border: 2px dashed var(--line-strong); border-radius: var(--r-lg); display: grid; place-items: center; background:
  repeating-conic-gradient(#f3f5f9 0 25%, #fff 0 50%) 0 0 / 18px 18px; padding: 10px; }
.logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.team-main { max-width: 1260px; margin: 0 auto; padding: 24px 24px 50px; }

/* ---------------- Bericht / Druck ---------------- */
body.report { background: var(--sky); }
.toolbar { max-width: 1120px; margin: 0 auto; padding: 16px 24px 0; display: flex; gap: 8px; align-items: center; }
.toolbar .spacer { flex: 1; }
.sheet-page { max-width: 1120px; margin: 14px auto 40px; background: #fff; border: 2px solid var(--line); border-radius: var(--r-lg); padding: 30px 34px; }
.r-head { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 18px; padding-bottom: 14px; border-bottom: 3px solid var(--ink); }
.r-head h1 { margin: 0; }
.r-title { display: flex; align-items: center; gap: 16px; }
.r-logo { height: 60px; width: auto; max-width: 170px; object-fit: contain; }
.r-head p { margin: 0; color: var(--muted); font-weight: 600; }
.r-meta { text-align: right; }
.sheet-page .days { border-radius: 0; border-left: 0; border-right: 0; }
.sign { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; margin-top: 50px; font-size: .85rem; color: var(--muted); }
.sign span { display: block; border-bottom: 1px solid var(--ink); height: 34px; margin-bottom: 4px; }

@media print {
  @page { size: A4 portrait; margin: 12mm; }
  :root { background: #fff; }
  body, body.report, body.team, body.admin { background: #fff; font-size: 10pt; color: #000; }
  .noprint, .a-head, .team-head { display: none !important; }
  .sheet-page { border: 0; padding: 0; margin: 0; max-width: none; border-radius: 0; }
  .cards { grid-template-columns: repeat(6, 1fr); gap: 6px; }
  .card, .card.c-gruppe, .card.c-verf, .card.strong { padding: 5px 8px; background: #fff; color: #000; border: 1px solid #999; }
  .card b, .card.strong .pos, .card.strong .neg { font-size: 12pt; color: #000; }
  .card span, .card small, .card.strong span, .card.strong small { color: #444; }
  .days, .list, .plangrid { border: 1px solid #999; border-radius: 0; }
  .days td, .days th { padding: 3px 6px; font-size: 8.5pt; }
  .ev, .tag, .shiftmini { font-size: 7.5pt; padding: 0 3px; }
  .days tr { break-inside: avoid; }
  .a-main > h1::before, .a-main > .titlebar > h1::before { display: none; }
  /* Dienstplan als Aushang: A4 quer */
  body.plan-page { page: quer; }
  .plan-page .a-main, .plan-page .team-main { padding: 0; max-width: none; }
  .plan-page .plangrid { min-width: 0; font-size: 8.5pt; }
  .plan-page .shift { font-size: 8pt; padding: 2px 4px; }
  .plan-page .two, .plan-page .statusbar, .plan-page .flash { display: none !important; }
  .plan-page .plangrid tr { break-inside: avoid; }
}
@page quer { size: A4 landscape; margin: 10mm; }

@media (max-width: 900px) {
  .two { grid-template-columns: 1fr; }
  .cards { grid-template-columns: repeat(3, 1fr); }
  .a-main { padding: 18px 14px 50px; }
  .days .evs { min-width: 120px; }
  .list, .days { display: block; overflow-x: auto; }
  .a-head .who { margin-left: 0; }
  .logo-row { grid-template-columns: 1fr; }
  .t-logo { height: 64px; }
}
@media (max-width: 600px) {
  .terminal { padding: 18px; }
  .t-head h1 { font-size: 1.8rem; }
  .clock { font-size: 2.4rem; padding: 10px 16px; }
  .form .row, .row3 { grid-template-columns: 1fr; }
  /* Team-Bereich und „Meine Zeiten“ auf dem Handy */
  .team-head { padding: 10px 12px; gap: 8px 12px; }
  .team-head nav { width: 100%; order: 3; margin-right: 0; gap: 4px; }
  .team-head nav a { padding: .45em .8em; font-size: .92rem; }
  .team-head .btn { margin-left: auto; }
  .team-main { padding: 14px 10px 40px; }
  .toolbar { padding: 12px 10px 0; flex-wrap: wrap; }
  .sheet-page { margin: 10px 0 30px; padding: 16px 12px; border-left: 0; border-right: 0; border-radius: 0; }
  .r-head { flex-direction: column; gap: 8px; }
  .r-head h1 { font-size: 1.5rem; }
  .r-meta { text-align: left; }
  .cards { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .card b { font-size: 1.2rem; }
  .qr-field { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
