/* 4smile-Designsprache (CRM-Palette) */
:root {
  --brand-50: #f8f5f3;
  --brand-100: #f2dfdc;
  --brand-300: #d8ecec;
  --brand-400: #b4ddde;
  --brand-600: #627596;
  --brand-700: #2d4267;
  --brand-800: #192946;
  --accent: #ecc9c3;
  --mint: #b4ddde;
  --steel: #b5c4db;
  --canvas: #fffdfa;
  --ink: #1d1d1b;
  --warn: #b4442f;
  --shadow-card: 0 20px 60px rgba(25, 41, 70, 0.12);

  /* Plan */
  --urlaub: #2d4267;
  --urlaub-hell: #9aa9c2;
  --feiertag: #ecc9c3;
  --ferien: #dcefef;
  --wochenende: #ebe6e1;
  --linie: #e4ddd7;
  --wochenlinie: #8a97ad;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-700); }
h1 { font-size: 1.9rem; line-height: 1; margin: 0; color: var(--brand-800); }
h2 { font-size: 1.2rem; margin: 0 0 0.6rem; color: var(--brand-800); }
p { margin: 0 0 0.6rem; }
.eyebrow { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.18em; color: var(--brand-600); margin: 0 0 0.45rem; font-weight: 600; }
.eyebrow.on-dark { color: var(--steel); }
.muted { color: var(--brand-600); }
.small { font-size: 0.82rem; }
.leer { color: var(--brand-600); font-style: italic; margin: 0; }
.laden { color: var(--brand-600); padding: 2rem 0; }
[hidden] { display: none !important; }

.app { padding: 1.25rem; max-width: 1920px; margin: 0 auto; }

/* Kopfleiste (Navy-Fläche wie die Sidebar, quer) */
.kopfleiste {
  display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap;
  background: var(--brand-800); color: #fff; border: 4px solid var(--brand-800); border-radius: 34px;
  padding: 0.9rem 1.25rem; box-shadow: var(--shadow-card); margin-bottom: 1rem;
}
.logo-box { display: block; background: #fff; border-radius: 22px; padding: 0.7rem 0.9rem; }
.logo-box img { display: block; width: 130px; height: auto; }
.titel { flex: 1; min-width: 14rem; }
.highlight { display: inline-block; background: var(--accent); color: var(--brand-800); padding: 0.35rem 0.7rem; }
.kopf-rechts { text-align: right; }
.jahr-wahl { font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.12em; color: var(--steel); display: inline-flex; align-items: center; gap: 0.5rem; }
.stand { margin: 0.45rem 0 0; font-size: 0.8rem; color: var(--steel); }

/* Buttons & Eingaben */
.btn {
  display: inline-flex; min-height: 2.75rem; align-items: center; justify-content: center; gap: 0.4rem;
  border-radius: 999px; border: 1px solid transparent; padding: 0.6rem 1.15rem;
  font: inherit; font-size: 0.82rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.02em;
  text-decoration: none; cursor: pointer; transition: 0.15s; color: var(--brand-800); background: transparent; white-space: nowrap;
}
.btn:focus-visible, .input:focus-visible, .pill:focus-visible, .chip input:focus-visible + span { outline: none; box-shadow: 0 0 0 3px var(--brand-300); }
.btn.primary { border-color: var(--brand-400); background: var(--mint); box-shadow: inset 0 -2px 0 rgba(25, 41, 70, 0.12); }
.btn.primary:hover { background: var(--brand-300); }
.btn.outline { border-color: var(--brand-800); background: #fff; }
.btn.small { min-height: 2.2rem; padding: 0.35rem 0.95rem; font-size: 0.74rem; }
.input {
  font: inherit; font-size: 0.95rem; color: var(--ink); background: #fff;
  border: 2px solid var(--brand-800); border-radius: 18px; padding: 0.45rem 0.85rem;
}
.input.compact { padding: 0.3rem 0.75rem; font-size: 0.85rem; border-radius: 999px; }
.kopfleiste .input.compact { border-color: #fff; font-weight: 700; color: var(--brand-800); }

/* Karten */
.card {
  border-radius: 30px; border: 4px solid var(--brand-800); background: rgba(255, 255, 255, 0.9);
  padding: 1.1rem 1.25rem; box-shadow: var(--shadow-card); margin-bottom: 1rem;
}
.card.soft { border-width: 2px; box-shadow: none; }
.card.warnung { border-width: 2px; border-color: var(--accent); background: var(--brand-100); box-shadow: none; }

/* Filter */
.filter { display: flex; flex-direction: column; gap: 0.7rem; }
.filter-zeile { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.filter-label { width: 8.5rem; flex: 0 0 auto; font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.14em; color: var(--brand-600); }
.druck-zeile { padding-top: 0.7rem; border-top: 2px solid var(--brand-50); }
.pills, .chips { display: flex; gap: 0.45rem; flex-wrap: wrap; }
.pill {
  border-radius: 999px; border: 2px solid var(--brand-800); background: #fff; color: var(--brand-800);
  padding: 0.4rem 0.95rem; font: inherit; font-size: 0.8rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.03em; cursor: pointer; transition: 0.15s;
}
.pill:hover { background: var(--accent); }
.pill.active { border-color: var(--brand-400); background: var(--mint); }
.chip { position: relative; display: inline-flex; cursor: pointer; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  border-radius: 999px; border: 2px solid var(--brand-100); background: var(--brand-50); color: var(--brand-600);
  padding: 0.35rem 0.9rem 0.35rem 2rem; font-size: 0.82rem; font-weight: 700; position: relative; transition: 0.15s;
}
.chip span::before {
  content: ''; position: absolute; left: 0.6rem; top: 50%; width: 0.9rem; height: 0.9rem; transform: translateY(-50%);
  border-radius: 4px; border: 2px solid currentColor; background: #fff;
}
.chip input:checked + span { border-color: var(--brand-800); background: #fff; color: var(--brand-800); }
.chip input:checked + span::before { background: var(--brand-800); box-shadow: inset 0 0 0 2px #fff; }

/* Legende */
.legende { display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; font-size: 0.8rem; color: var(--brand-700); margin: 0 0.25rem 0.8rem; }
.legende span { display: inline-flex; align-items: center; gap: 0.4rem; }
.lg {
  display: inline-block; width: 1.1rem; height: 0.8rem; border: 1px solid var(--linie); background: #fff;
  font-style: normal; font-size: 0.65rem; line-height: 0.75rem; text-align: center; font-weight: 700;
}
.lg.u { background: var(--urlaub); border-color: var(--urlaub); }
.lg.u.b { background: repeating-linear-gradient(135deg, var(--urlaub) 0 1.5px, #fff 1.5px 4px); }
.lg.u.hv { background: linear-gradient(to right, var(--urlaub) 50%, #fff 50%); }
.lg.ft { background: var(--feiertag); }
.lg.fe { background: var(--ferien); }
.lg.we { background: var(--wochenende); }
.lg.eng { background: var(--brand-50); color: var(--warn); width: 1.1rem; }

/* ===== Plan (Bildschirm und Druck) ===== */
.plan-bereich { min-height: 10rem; }
.band-wrap {
  background: #fff; border: 2px solid var(--brand-800); border-radius: 18px; overflow: hidden; margin-bottom: 1rem;
}
.band { border-collapse: collapse; table-layout: fixed; width: 100%; font-size: var(--schrift); }
.band col.c-name { width: var(--name); }
.band col.c-tage { width: var(--tage); }
.band col.c-tag { width: var(--tag); }
.band col.c-we { width: var(--we); }
.band th, .band td {
  height: var(--zeile); padding: 0; border: 0.5px solid var(--linie); line-height: 1;
  overflow: hidden; white-space: nowrap; text-align: center; font-weight: 400;
  --bg: #fff; background-color: var(--bg);
}
.band .fe { --bg: var(--ferien); }
.band .we { --bg: var(--wochenende); }
.band .ft { --bg: var(--feiertag); }
.band .mo { border-left: 1.5px solid var(--wochenlinie); }
.band .ax { opacity: 0.45; }

/* Kopfzeilen */
.band thead th { height: var(--kopf); font-size: var(--kopf-schrift); color: var(--brand-800); }
.band thead .r-monat th { background: var(--brand-800); color: #fff; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; border-color: var(--brand-800); }
.band thead .r-monat th.ms { border-left: 1.5px solid var(--accent); text-align: left; padding-left: 0.3em; }
.band thead .r-kw th { background: var(--brand-50); color: var(--brand-600); font-weight: 600; text-align: left; padding-left: 0.25em; }
.band thead .r-tag th { font-variant-numeric: tabular-nums; }
.band thead .r-tag th.ft { font-weight: 700; color: var(--warn); }
.band thead .r-ferien th { font-size: calc(var(--kopf-schrift) * 0.95); color: var(--brand-700); font-weight: 600; text-overflow: ellipsis; }
.band thead th.name {
  background: var(--brand-800); color: #fff; text-align: left; padding: 0 0.5em; vertical-align: bottom;
  border-bottom: 2px solid var(--accent);
}
.band-label { display: block; font-size: var(--kopf-schrift); font-weight: 700; letter-spacing: 0.04em; padding-bottom: 0.4em; }
.band thead th.tage { background: var(--brand-800); color: var(--steel); font-size: calc(var(--kopf-schrift) * 0.9); white-space: normal; border-bottom: 2px solid var(--accent); }

/* Gruppen- und Personenzeilen */
.band tbody th.name { text-align: left; padding: 0 0.5em; text-overflow: ellipsis; font-weight: 500; color: var(--ink); }
.band td.tage { font-variant-numeric: tabular-nums; color: var(--brand-700); font-weight: 600; border-right: 1.5px solid var(--wochenlinie); }
.band .r-gruppe th, .band .r-gruppe td { --bg: var(--brand-300); border-top: 1.5px solid var(--brand-800); }
.band .r-gruppe .we { --bg: #c9dcdc; }
.band .r-gruppe .ft { --bg: #e3c4bf; }
.band .r-gruppe th.name { font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--brand-800); font-size: calc(var(--schrift) * 0.9); }
.band .r-gruppe .anzahl { font-weight: 600; color: var(--brand-600); margin-left: 0.3em; }
.band .r-gruppe td { font-size: calc(var(--schrift) * 0.8); color: var(--brand-700); font-weight: 700; font-variant-numeric: tabular-nums; }
.band .r-gruppe td.eng { color: #fff; --bg: var(--warn); }
.marke { font-size: 0.75em; font-weight: 700; color: var(--brand-600); background: var(--brand-50); border-radius: 999px; padding: 0 0.4em; margin-left: 0.2em; }
.band tbody tr.r-person:hover th, .band tbody tr.r-person:hover td:not(.u) { filter: brightness(0.96); }

/* Urlaub: Tagesfarbe bleibt Hintergrundfarbe, Urlaub liegt als Bild darüber */
.band td.u { --uc: var(--urlaub); --fill: linear-gradient(var(--uc), var(--uc)); background-image: var(--fill); }
.band td.u.we, .band td.u.ft { --uc: var(--urlaub-hell); }
.band td.u.b { --fill: repeating-linear-gradient(135deg, var(--uc) 0 1.4px, transparent 1.4px 3.6px); }
.band td.u.hv { background-image: linear-gradient(to right, transparent 50%, var(--bg) 50%), var(--fill); }
.band td.u.hn { background-image: linear-gradient(to right, var(--bg) 50%, transparent 50%), var(--fill); }
.band td.ia { background-image: repeating-linear-gradient(45deg, #cfc8c1 0 0.6px, transparent 0.6px 3px); }

.fuss { margin: 0.5rem 0.25rem 2rem; line-height: 1.6; }

@media (max-width: 700px) {
  .app { padding: 0.75rem; }
  .kopfleiste { border-radius: 26px; }
  .kopf-rechts { text-align: left; }
  .filter-label { width: 100%; }
  h1 { font-size: 1.5rem; }
}

/* ===== Druck: A3 quer ===== */
.druck { display: none; }
/* Messmodus: Blätter unsichtbar in Druckgröße aufbauen, um die Zeilenhöhe einzupassen */
.druck.messen { display: block; position: absolute; left: -10000px; top: 0; visibility: hidden; }
.druck.messen .blatt { height: auto; overflow: visible; }
.blatt { width: 404mm; height: 279mm; overflow: hidden; display: flex; flex-direction: column; background: #fff; }
.blatt-kopf { height: 12mm; flex: 0 0 auto; display: flex; align-items: flex-start; gap: 6mm; border-bottom: 0.6mm solid var(--brand-800); margin-bottom: 2mm; }
.blatt-titel { display: inline-block; background: var(--accent); color: var(--brand-800); font-weight: 700; font-size: 5mm; padding: 0.8mm 2.2mm; margin-right: 3mm; }
.blatt-praxis { font-size: 5.4mm; font-weight: 700; color: var(--brand-800); }
.blatt-meta { font-size: 2.4mm; color: var(--brand-600); line-height: 1.35; white-space: nowrap; }
.druck-legende { margin: 0 0 0 auto; font-size: 2.3mm; gap: 0.6mm 3mm; justify-content: flex-end; max-width: 175mm; }
.druck-legende .lg { width: 4mm; height: 2.8mm; font-size: 2mm; line-height: 2.6mm; }
.blatt .band-wrap { border-width: 0.35mm; border-radius: 2mm; margin-bottom: 3mm; flex: 0 0 auto; }
.blatt .band th, .blatt .band td { border-width: 0.15mm; }
.blatt .band .mo { border-left-width: 0.4mm; }
.kw-datum { font-weight: 400; color: var(--brand-600); }
.blatt-fuss { margin-top: auto; flex: 0 0 auto; font-size: 2.2mm; line-height: 1.4; color: var(--brand-700); }
@page { size: A3 landscape; margin: 8mm; }
@media print {
  html, body { background: #fff; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .app { display: none !important; }
  .druck { display: block; }
  .blatt { break-after: page; page-break-after: always; }
  .blatt:last-child { break-after: auto; page-break-after: auto; }
}
