/* =====================================================================
   PLANBAR Masterdashboard
   CI-Basis uebernommen aus "Planbar POS\public\app.css", damit die Module
   optisch nicht auseinanderlaufen. Erweitert um Kacheln, Ampeln, Heatmap
   und die SVG-Diagramme.
   Regel bleibt: KEINE runden Ecken, 1.5px Ink-Rahmen, gepunktete Trenner.
   ===================================================================== */
@font-face {
  font-family: 'Zalando Sans';
  src: url('/assets/ZalandoSans-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --orange: #f3562e; --orange-hover: #d9431d; --rhubarb: #ffb09c;
  --pickle: #00363e; --seaweed: #565438; --matcha: #e0ebde;
  --cherry: #531f28; --almond: #bcad96;
  --paper: #fef7ec; --card: #FBFAF5; --ink: #171511; --ink-soft: #5d584f;
  --line: rgba(23, 21, 17, .16);
  --dots: 1px dotted rgba(23, 21, 17, .35);
  --border: 1.5px solid var(--ink);
  --shadow: 4px 4px 0 rgba(23, 21, 17, .14);
  /* Ampel, identisch zu Ergebnisrechnung und Personalkosten-Rechner */
  --gruen: #2f7d4f; --gelb: #c9962a; --amber: #d9431d; --rot: #a11626;
  --grau: #8b867d;
}
* { box-sizing: border-box; border-radius: 0 !important; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Zalando Sans', 'Segoe UI', system-ui, sans-serif;
  background: var(--paper); color: var(--ink);
  font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; font-size: 14px; }
input, select { font-family: inherit; font-size: 16px; color: var(--ink); background: #fff; border: var(--border); padding: 10px 12px; width: 100%; }
input:focus, select:focus, button:focus-visible { outline: none; box-shadow: 3px 3px 0 var(--rhubarb); }
label { display: block; font-size: 11px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; color: var(--pickle); margin: 14px 0 5px; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -.01em; }
a { color: var(--ink); }
.muted { color: var(--ink-soft); }
.boot { padding: 80px 20px; text-align: center; color: var(--ink-soft); }

/* ---------- Anmeldung ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-box { background: #fff; border: 2px solid var(--ink); box-shadow: var(--shadow); padding: 30px 28px; width: 100%; max-width: 420px; }
.login-box img { height: 44px; margin-bottom: 16px; }
.login-box h1 { font-size: 1.35rem; font-weight: 900; text-transform: uppercase; font-stretch: 112%; }
.login-box .sub { font-size: 12.5px; color: var(--ink-soft); margin: 4px 0 14px; }
.login-err { background: var(--rhubarb); color: var(--cherry); font-weight: 700; font-size: 13px; padding: 9px 12px; margin-bottom: 10px; }
.login-box .demo { margin-top: 16px; padding-top: 14px; border-top: var(--dots); font-size: 12px; color: var(--ink-soft); }

/* Namensauswahl der Anmeldung, gleiche Optik wie an der Kasse:
   je Person eine volle Zeile, Name links, Rolle rechts. */
.stafflist { display: grid; gap: 8px; }
.staffbtn {
  border: var(--border); background: #fff; padding: 13px 15px; text-align: left;
  display: flex; align-items: baseline; gap: 10px; min-height: 54px; width: 100%; color: var(--ink);
}
.staffbtn:hover { background: var(--orange); border-color: var(--orange); color: #fff; }
.staffbtn:active { transform: translate(1px, 1px); }
.staffbtn .nm { font-weight: 800; font-size: 16px; }
.staffbtn .rl {
  margin-left: auto; font-size: 10px; font-weight: 800; letter-spacing: .1em;
  text-transform: uppercase; color: var(--pickle); white-space: nowrap;
}
.staffbtn:hover .rl { color: #fff; }

/* ---------- Kopf ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30; background: var(--paper);
  border-bottom: 2px solid var(--ink);
  display: flex; align-items: center; gap: 12px; padding: 9px 16px; flex-wrap: wrap;
}
.topbar img.logo { height: 32px; }
.topbar .tt { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.topbar .tt b { font-size: 15px; font-weight: 900; white-space: nowrap; text-transform: uppercase; font-stretch: 110%; letter-spacing: .01em; }
.topbar .tt span { font-size: 10.5px; color: var(--ink-soft); white-space: nowrap; }
.topbar .spacer { flex: 1; }
.topbar .who { text-align: right; font-size: 11.5px; color: var(--ink-soft); line-height: 1.25; white-space: nowrap; }
.topbar .who b { color: var(--ink); font-size: 12.5px; display: block; }
.topbar .who .rolle { text-transform: uppercase; letter-spacing: .1em; font-size: 9px; font-weight: 800; color: var(--pickle); }
.topbar .tagwahl { display: flex; align-items: center; gap: 6px; }
.topbar .tagwahl input { width: auto; padding: 5px 8px; font-size: 13px; }
.iconbtn { border: var(--border); background: #fff; padding: 7px 11px; font-weight: 700; font-size: 12px; }
.iconbtn:hover { background: var(--ink); color: var(--paper); }

/* ---------- Registerreihe ---------- */
nav.tabs { background: var(--paper); border-bottom: 1.5px solid var(--line); position: sticky; top: 52px; z-index: 29; overflow-x: auto; }
.tabs-inner { display: flex; gap: 2px; padding: 0 10px; min-width: max-content; }
.tabs-inner button {
  background: none; border: none; color: var(--ink-soft);
  font-size: 13.5px; font-weight: 800; padding: 11px 13px 8px;
  border-bottom: 4px solid transparent; white-space: nowrap;
  text-transform: uppercase; letter-spacing: .05em;
}
.tabs-inner button.on { color: var(--ink); border-bottom-color: var(--orange); }
.tabs-inner button:hover { color: var(--ink); }
.tabs-inner .zaehler { font-size: 10px; font-weight: 800; background: var(--ink); color: var(--paper); padding: 0 5px; margin-left: 5px; }
.tabs-inner button.on .zaehler { background: var(--orange); }

/* ---------- Zeitachse ---------- */
.zeitachse { display: flex; gap: 0; border: var(--border); margin: 16px 0 18px; background: #fff; }
.zeitachse button {
  flex: 1; min-height: 46px; background: #fff; border: none;
  border-right: var(--border); font-weight: 800; font-size: 13px;
  text-transform: uppercase; letter-spacing: .09em; color: var(--ink-soft);
}
.zeitachse button:last-child { border-right: none; }
.zeitachse button.on { background: var(--orange); color: #fff; }
.zeitachse button:hover:not(.on) { background: var(--matcha); color: var(--ink); }

.content { padding: 16px 16px 70px; max-width: 1320px; margin: 0 auto; }

/* ---------- Bausteine ---------- */
.panel { background: #fff; border: var(--border); margin-bottom: 16px; }
.panel > header { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; padding: 12px 15px; border-bottom: var(--border); }
.panel > header h2 { font-size: .98rem; font-weight: 900; text-transform: uppercase; letter-spacing: .04em; font-stretch: 108%; }
.panel > header .spacer { flex: 1; }
.pbody { padding: 13px 15px; }
.pbody.tight { padding: 0; }
.hint { font-size: 12.5px; color: var(--ink-soft); }
.hint.warn { color: var(--cherry); }

.chip { display: inline-block; font-size: 9.5px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; padding: 2px 6px; white-space: nowrap; vertical-align: middle; }
.chip.gemessen { background: var(--matcha); color: var(--pickle); }
.chip.geplant { background: #fff; color: var(--ink); border: 1.5px solid var(--ink); }
.chip.erfasst { background: var(--pickle); color: #fff; }
.chip.geschaetzt { background: var(--rhubarb); color: var(--cherry); }
.chip.fehlt { background: #eee; color: #777; border: 1px solid #ccc; }
.chip.veraltet { background: #eee; color: #777; border: 1px solid #ccc; }
.chip.accent { background: var(--orange); color: #fff; }
.chip.dark { background: var(--ink); color: var(--paper); }

.btn { border: var(--border); background: #fff; color: var(--ink); padding: 9px 14px; font-weight: 700; min-height: 40px; }
.btn:hover { background: var(--ink); color: var(--paper); }
.btn.klein { min-height: 30px; padding: 4px 9px; font-size: 12px; }
.btn.accent { background: var(--orange); color: #fff; border-color: var(--orange); }
.btn.accent:hover { background: var(--orange-hover); border-color: var(--orange-hover); }

/* ---------- Kachelraster ---------- */
.raster { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); margin-bottom: 16px; }
.raster.breit { grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); }
/* Rasterkinder haben von Haus aus min-width:auto und lassen sich deshalb von
   einer breiten Tabelle aufblaehen, statt sie scrollen zu lassen. Das ist der
   Grund fuer waagerechtes Scrollen der ganzen Seite auf schmalen Geraeten. */
.raster > * { min-width: 0; }
.panel { min-width: 0; max-width: 100%; }

.kachel { background: #fff; border: var(--border); padding: 13px 15px 12px; display: flex; flex-direction: column; min-height: 128px; }
.kachel .kopf { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 6px; }
.kachel .titel { font-size: 10.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--pickle); line-height: 1.3; }
.kachel .wert { font-size: 2.05rem; font-weight: 900; line-height: 1.05; font-stretch: 106%; letter-spacing: -.02em; }
.kachel .wert.klein { font-size: 1.5rem; }
.kachel .wert .einheit { font-size: .95rem; font-weight: 800; color: var(--ink-soft); margin-left: 3px; }
.kachel .wert.leer { color: var(--grau); font-size: 1.15rem; font-weight: 800; }
.kachel .unter { font-size: 12px; color: var(--ink-soft); margin-top: 3px; line-height: 1.35; }
.kachel .fuss { margin-top: auto; padding-top: 8px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.kachel.klick { cursor: pointer; }
.kachel.klick:hover { box-shadow: var(--shadow); }
.kachel.leer { background: #f6f4ef; border-color: var(--line); }

/* Ampelbalken links an der Kachel */
.kachel { position: relative; }
.kachel[data-ampel]::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; }
.kachel[data-ampel="gruen"]::before { background: var(--gruen); }
.kachel[data-ampel="gelb"]::before { background: var(--gelb); }
.kachel[data-ampel="orange"]::before { background: var(--amber); }
.kachel[data-ampel="rot"]::before { background: var(--rot); }
.ampeltext.gruen { color: var(--gruen); } .ampeltext.gelb { color: var(--gelb); }
.ampeltext.orange { color: var(--amber); } .ampeltext.rot { color: var(--rot); }

/* ---------- Hero ---------- */
.hero { background: #fff; border: 2px solid var(--ink); box-shadow: var(--shadow); padding: 20px 22px; margin-bottom: 16px; }
.hero .titel { font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--pickle); }
.hero .zahl { font-size: clamp(2.5rem, 6vw, 4.5rem); font-weight: 900; line-height: 1; font-stretch: 112%; letter-spacing: -.03em; margin: 4px 0 2px; }
.hero .zahl.leer { font-size: clamp(1.2rem, 2.6vw, 1.7rem); color: var(--grau); }
.hero .zeile { font-size: 13.5px; color: var(--ink-soft); display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.hero .zeile b { color: var(--ink); }
.rechenweg { margin-top: 12px; border-top: var(--dots); padding-top: 10px; }
.rechenweg table { width: 100%; border-collapse: collapse; font-size: 13px; }
.rechenweg td { padding: 4px 0; border-bottom: var(--dots); }
.rechenweg td:last-child { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
.rechenweg tr:last-child td { border-bottom: none; border-top: 1.5px solid var(--ink); font-weight: 900; padding-top: 7px; }
.aufklapp { background: none; border: none; color: var(--pickle); font-weight: 800; font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; padding: 2px 0; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Tabellen ---------- */
table.liste { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.liste th {
  text-align: left; font-size: 9.5px; font-weight: 800; letter-spacing: .1em;
  text-transform: uppercase; color: var(--pickle); padding: 9px 15px; border-bottom: var(--border); white-space: nowrap;
}
table.liste td { padding: 8px 15px; border-bottom: var(--dots); vertical-align: middle; }
table.liste tr:last-child td { border-bottom: none; }
table.liste td.zahl, table.liste th.zahl { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.liste td.stark { font-weight: 800; color: var(--orange); }
table.liste tbody tr:hover { background: var(--card); }
.tabwrap { overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; }

/* ---------- Anteilsstreifen ---------- */
.anteil { display: flex; height: 32px; border: var(--border); margin-bottom: 10px; }
.anteil > span { border-right: var(--border); display: flex; align-items: center; justify-content: center; font-size: 10.5px; font-weight: 800; color: #fff; overflow: hidden; }
.anteil > span:last-child { border-right: none; }
.legende { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; }
.legende i { display: inline-block; width: 13px; height: 13px; border: 1.5px solid var(--ink); margin-right: 5px; vertical-align: -2px; }

/* Balken in Listenzeilen */
.bartrack { background: var(--card); border: 1.5px solid var(--ink); height: 15px; min-width: 60px; position: relative; }
.barfill { background: var(--orange); height: 100%; }

/* ---------- Heatmap ---------- */
.heat { display: grid; gap: 1.5px; background: var(--ink); border: var(--border); font-size: 11px; overflow-x: auto; }
.heat > div { background: #fff; min-height: 32px; display: flex; align-items: center; justify-content: center; font-weight: 800; }
.heat > div.kopf { background: var(--paper); font-size: 9.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--pickle); }
.heat > div.zeile { background: var(--paper); font-size: 10.5px; justify-content: flex-start; padding-left: 8px; }
.heat .s0 { background: #fff; color: var(--grau); }
.heat .s1 { background: var(--paper); }
.heat .s2 { background: var(--rhubarb); }
.heat .s3 { background: var(--orange); color: #fff; }
.heat .s4 { background: var(--orange-hover); color: #fff; }

/* ---------- Diagramme ---------- */
svg.chart { width: 100%; height: auto; display: block; }
svg.spark { width: 96px; height: 26px; display: block; }

/* ---------- Modul-Statusleiste ---------- */
.modulleiste { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.modulleiste .m { border: 1.5px solid var(--ink); background: #fff; padding: 4px 8px; font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; display: flex; align-items: center; gap: 5px; }
.modulleiste .m i { width: 8px; height: 8px; display: inline-block; }
.modulleiste .m.ok i { background: var(--gruen); }
.modulleiste .m.stale i { background: var(--gelb); }
.modulleiste .m.aus i { background: var(--grau); }
.modulleiste .m.fehlt i, .modulleiste .m.fehler i { background: var(--rot); }
.modulleiste .m.aus, .modulleiste .m.fehlt, .modulleiste .m.fehler { color: var(--ink-soft); border-color: var(--line); }

/* ---------- Handlungsbedarf ---------- */
.hbliste { list-style: none; }
.hbliste li { display: flex; align-items: center; gap: 9px; padding: 8px 0; border-bottom: var(--dots); cursor: pointer; }
.hbliste li:last-child { border-bottom: none; }
.hbliste li:hover { color: var(--orange); }
.hbliste .n { font-weight: 900; font-size: 1.05rem; min-width: 30px; text-align: right; font-variant-numeric: tabular-nums; }
.hbliste .p { width: 5px; height: 22px; flex: none; }
.hbliste .p.gelb { background: var(--gelb); } .hbliste .p.orange { background: var(--amber); } .hbliste .p.rot { background: var(--rot); }

/* ---------- Datenlage ---------- */
.konflikt { border: 1.5px solid var(--ink); padding: 11px 13px; margin-bottom: 10px; background: #fff; }
.konflikt .kopf { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; margin-bottom: 6px; }
.konflikt .kopf b { font-size: 13.5px; }
.konflikt .q { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; padding: 4px 0; border-bottom: var(--dots); }
.konflikt .q:last-child { border-bottom: none; }
.konflikt .q.fuehrend { font-weight: 800; }
.konflikt .warum { font-size: 12px; color: var(--ink-soft); margin-top: 7px; padding-top: 7px; border-top: var(--dots); }

/* ---------- Demo-Fahne ---------- */
.demofahne {
  position: fixed; right: 0; bottom: 0; z-index: 50;
  background: var(--ink); color: var(--paper);
  font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
  padding: 6px 12px; border-left: 2px solid var(--orange); border-top: 2px solid var(--orange);
}

/* ---------- Kleine Bildschirme ---------- */
@media (max-width: 760px) {
  .topbar { padding: 8px 12px; gap: 8px; }
  .topbar .tt b { font-size: 13.5px; }
  nav.tabs { top: 48px; }
  .content { padding: 12px 12px 70px; }
  .raster, .raster.breit { grid-template-columns: 1fr; }
  .kachel .wert { font-size: 1.8rem; }
  .zeitachse button { font-size: 11px; letter-spacing: .04em; }
  table.liste th, table.liste td { padding: 7px 10px; }
}

/* ---------- Druck ---------- */
@media print {
  nav.tabs, .zeitachse, .topbar .tagwahl, .iconbtn, .demofahne { display: none !important; }
  body { background: #fff; font-size: 11pt; }
  .panel, .kachel, .hero { break-inside: avoid; box-shadow: none; }
  .content { max-width: none; padding: 0; }
}
