/* Döner-Donnerstag – Farbschema angelehnt an die Imbiss-Karte:
   Paprika-Rot, Salat-Grün, Fladenbrot-Creme, Pommes-Gold */
:root {
  --bg: #FAF5EC;
  --surface: #FFFFFF;
  --surface-2: #F4ECDF;
  --border: #E7DCCB;
  --text: #2B1E16;
  --muted: #76614F;
  --faint: #A8968A;
  --primary: #C2381D;
  --primary-hover: #A62E17;
  --primary-soft: #FBE3DC;
  --on-primary: #FFFFFF;
  --accent: #2E7D4F;
  --accent-soft: #DDF0E3;
  --gold: #E3A93B;
  --gold-soft: #FBEFD5;
  --danger: #B42318;
  --danger-soft: #FDE4E1;
  --warn: #9A5B00;
  --warn-soft: #FDF0D5;
  --bar: #C2381D;
  --bar-2: #2E7D4F;
  --header: #B5341B;
  --header-text: #FFF4E0;
  --shadow: 0 1px 2px rgba(43, 30, 22, .06), 0 6px 20px rgba(43, 30, 22, .07);
  --radius: 16px;
  --radius-sm: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17110E; --surface: #221A15; --surface-2: #2C221C; --border: #3B2F27;
    --text: #F6EDE2; --muted: #C2AE9C; --faint: #8C7869;
    --primary: #E8593A; --primary-hover: #F2704F; --primary-soft: #43211A; --on-primary: #FFFFFF;
    --accent: #5BBE83; --accent-soft: #1C3326; --gold: #F0BC55; --gold-soft: #3A2D14;
    --danger: #F07A6E; --danger-soft: #401C18; --warn: #F0B44C; --warn-soft: #3A2B12;
    --bar: #E8593A; --bar-2: #5BBE83;
    --header: #3A1A12; --header-text: #FFE9D2;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #17110E; --surface: #221A15; --surface-2: #2C221C; --border: #3B2F27;
  --text: #F6EDE2; --muted: #C2AE9C; --faint: #8C7869;
  --primary: #E8593A; --primary-hover: #F2704F; --primary-soft: #43211A; --on-primary: #FFFFFF;
  --accent: #5BBE83; --accent-soft: #1C3326; --gold: #F0BC55; --gold-soft: #3A2D14;
  --danger: #F07A6E; --danger-soft: #401C18; --warn: #F0B44C; --warn-soft: #3A2B12;
  --bar: #E8593A; --bar-2: #5BBE83;
  --header: #3A1A12; --header-text: #FFE9D2;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-variant-numeric: tabular-nums;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; font-weight: 800; }
h2 { font-size: 1.15rem; font-weight: 750; }
h3 { font-size: 1rem; font-weight: 700; }
p { margin: 0 0 .75rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
[hidden] { display: none !important; }

/* ---------- Kopfzeile ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--header); color: var(--header-text);
  background-image: repeating-linear-gradient(135deg, rgba(255,255,255,.035) 0 12px, transparent 12px 24px);
  box-shadow: 0 2px 10px rgba(0,0,0,.15);
}
.topbar-inner { max-width: 1180px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--header-text); font-weight: 850; font-size: 1.15rem; letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand img { border-radius: 9px; box-shadow: 0 0 0 2px rgba(255,244,224,.35); }
.brand-sub { display: block; font-size: .7rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; opacity: .8; margin-top: -2px; }
.brand > span { display: flex; flex-direction: column; line-height: 1.1; }
.nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  color: var(--header-text); opacity: .85; padding: 7px 12px; border-radius: 999px; white-space: nowrap; font-weight: 600; font-size: .92rem;
}
.nav a:hover { opacity: 1; background: rgba(255,255,255,.1); text-decoration: none; }
.nav a.active { opacity: 1; background: rgba(255,244,224,.18); box-shadow: inset 0 0 0 1px rgba(255,244,224,.3); }
.nav .sep { width: 1px; background: rgba(255,244,224,.25); margin: 6px 4px; flex: none; }
.me-link {
  color: var(--header-text); display: flex; align-items: center; gap: 8px; font-weight: 600; white-space: nowrap;
}
.me-link:hover { text-decoration: none; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  background: var(--gold); color: #3A2410; font-weight: 800; font-size: .85rem;
}
@media (max-width: 760px) {
  .topbar-inner { flex-wrap: wrap; gap: 8px 12px; padding: 8px 12px; }
  .nav { order: 3; flex-basis: 100%; margin: 0 -12px; padding: 0 12px 2px; }
  .me-link { margin-left: auto; }
  .me-link .me-name { display: none; }
}

/* ---------- Layout ---------- */
.container { max-width: 1180px; margin: 0 auto; padding: 20px 16px 64px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h1 { margin: 0; }
.grid { display: grid; gap: 16px; }
.grid-2 { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); align-items: start; }
.grid-3 { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); align-items: start; }
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px;
}
.card.flat { box-shadow: none; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }

/* ---------- Hero (aktueller Tag) ---------- */
.hero {
  position: relative; overflow: hidden; border-radius: 20px; padding: 22px;
  background: linear-gradient(135deg, var(--primary) 0%, #8E2512 100%); color: #FFF6EA;
  box-shadow: var(--shadow);
}
.hero::after {
  content: ""; position: absolute; right: -40px; top: -30px; width: 220px; height: 220px; opacity: .13;
  background: url("/favicon.svg") center / contain no-repeat; transform: rotate(14deg);
}
.hero h1 { color: #FFF6EA; font-size: 1.75rem; margin-bottom: 4px; }
.hero .eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .72rem; font-weight: 700; opacity: .85; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; position: relative; z-index: 1; }
.hero-chip {
  background: rgba(255,246,234,.14); border: 1px solid rgba(255,246,234,.22); border-radius: 999px;
  padding: 6px 12px; font-size: .9rem; display: inline-flex; gap: 6px; align-items: center;
}
.hero-chip b { font-weight: 750; }
.hero .btn { position: relative; z-index: 1; }
.countdown { font-weight: 800; }
.countdown.urgent { color: var(--gold); }

/* ---------- Kennzahlen ---------- */
.tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.tile .label { color: var(--muted); font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.tile .value { font-size: 1.55rem; font-weight: 800; letter-spacing: -.02em; margin-top: 2px; }
.tile .sub { color: var(--muted); font-size: .85rem; }
.tile.good .value { color: var(--accent); }
.tile.bad .value { color: var(--danger); }

/* ---------- Buttons & Formulare ---------- */
.btn {
  appearance: none; border: 1px solid transparent; border-radius: 999px; padding: 9px 16px; cursor: pointer;
  font: inherit; font-weight: 650; display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  background: var(--surface-2); color: var(--text); border-color: var(--border); line-height: 1.2; white-space: nowrap;
  transition: background .15s, transform .05s;
}
.btn:hover { background: var(--border); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.btn.primary:hover { background: var(--primary-hover); }
.btn.green { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); }
.btn.light { background: #FFF6EA; color: #8E2512; border-color: transparent; }
.btn.light:hover { background: #FFE9D2; }
.btn.outline-light { background: transparent; color: #FFF6EA; border-color: rgba(255,246,234,.5); }
.btn.outline-light:hover { background: rgba(255,246,234,.12); }
.btn.sm { padding: 5px 11px; font-size: .85rem; }
.btn.lg { padding: 12px 22px; font-size: 1.05rem; }
.btn.block { width: 100%; }
.icon-btn { padding: 6px; border-radius: 8px; width: 32px; height: 32px; }

label.field { display: block; }
.field > span { display: block; font-size: .82rem; font-weight: 650; color: var(--muted); margin-bottom: 4px; }
input[type=text], input[type=password], input[type=date], input[type=time], input[type=number], input[type=search], select, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 9px 11px; min-height: 40px;
}
input:focus, select:focus, textarea:focus, .btn:focus-visible, .chip:focus-visible, .pick:focus-within {
  outline: 2px solid var(--primary); outline-offset: 1px;
}
textarea { min-height: 70px; resize: vertical; }
.form-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.check { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); }

/* Gerichte-Auswahl mit Baukasten direkt unter dem gewählten Gericht */
.cat-title { font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; margin: 14px 0 6px; }
.menu > .cat-title:first-of-type { margin-top: 4px; }
.picks { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); grid-auto-flow: row dense; }
.pick {
  appearance: none; font: inherit; color: var(--text); text-align: left; cursor: pointer;
  border: 1.5px solid var(--border); border-radius: 12px; padding: 10px 12px; background: var(--surface);
  display: flex; justify-content: space-between; gap: 8px; align-items: center; transition: border-color .12s, background .12s;
}
.pick:hover { border-color: var(--faint); }
.pick .pick-name { font-weight: 650; }
.pick .pick-price { color: var(--muted); font-weight: 600; white-space: nowrap; text-align: right; display: flex; flex-direction: column; line-height: 1.2; }
.pick .pick-price small { font-size: .72rem; font-weight: 500; }
.pick.on { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 1px var(--primary); }
.pick.on .pick-price { color: var(--primary); }
.builder {
  grid-column: 1 / -1; border: 1.5px solid var(--primary); border-radius: 14px; background: var(--surface);
  padding: 14px 16px; position: relative; margin-bottom: 6px; animation: pop .15s ease-out;
  box-shadow: 0 8px 24px rgba(194, 56, 29, .12);
}
.builder::before {
  content: ""; position: absolute; top: -8px; left: 28px; width: 14px; height: 14px; background: var(--surface);
  border-left: 1.5px solid var(--primary); border-top: 1.5px solid var(--primary); transform: rotate(45deg);
}
.b-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 6px; }
.b-title { font-weight: 800; font-size: 1.1rem; }
.b-price { font-weight: 800; font-size: 1.2rem; color: var(--primary); white-space: nowrap; }
.b-step { margin-top: 12px; }
.b-label, .b-step > span { display: block; font-size: .82rem; font-weight: 700; color: var(--muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .06em; }
.b-label .muted, .b-step > span .muted { text-transform: none; letter-spacing: 0; font-weight: 500; }
.seg-sep { width: 1px; background: var(--border); margin: 2px 4px; align-self: stretch; }
.b-summary { margin-top: 14px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: .9rem; color: var(--muted); }
.b-summary b { color: var(--text); }
.b-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; flex-wrap: wrap; }
.b-actions .btn.primary { min-width: 200px; }
@media screen and (max-width: 520px) { .b-actions .btn { flex: 1; } .b-actions .btn.primary { min-width: 0; } }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  appearance: none; font: inherit; font-size: .9rem; border: 1.5px solid var(--border); background: var(--surface);
  color: var(--text); border-radius: 999px; padding: 6px 12px; cursor: pointer; font-weight: 600;
}
.chip:hover { border-color: var(--faint); }
.chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.seg .chip.on { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.form-section { margin-top: 18px; }
.form-section > .label { font-weight: 700; margin-bottom: 8px; display: block; }
.form-section .seg + input { margin-top: 8px; }
.home-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: start; }
@media screen and (max-width: 900px) { .home-grid { grid-template-columns: 1fr; } }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 2px 9px; font-size: .78rem; font-weight: 700;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); white-space: nowrap;
}
.badge.paid { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.badge.open { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.badge.waived { background: var(--surface-2); color: var(--muted); }
.badge.st-offen { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.badge.st-bestellt { background: var(--gold-soft); color: var(--warn); border-color: transparent; }
.badge.st-abgeschlossen { background: var(--surface-2); color: var(--muted); }
.badge.admin { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
button.badge { cursor: pointer; font-family: inherit; }
button.badge:hover { filter: brightness(.95); }

/* ---------- Tabellen ---------- */
.table-wrap { overflow-x: auto; margin: 0 -18px; padding: 0 18px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tbl th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: var(--surface-2); }
.tbl .num { text-align: right; white-space: nowrap; }
.tbl tr.clickable { cursor: pointer; }
.tbl tfoot td { font-weight: 800; border-top: 2px solid var(--border); border-bottom: 0; }
.tbl .nr { color: var(--faint); font-weight: 700; width: 1%; }
.tbl .who { font-weight: 700; white-space: nowrap; }
.tbl tr.mine td { background: var(--gold-soft); }
/* Tagesliste: eine Gruppe (tbody) pro Person, mehrere Gerichte untereinander */
.tbl.grouped tbody.person td { border-bottom: 0; }
.tbl.grouped tbody.person tr:first-child td { border-top: 1px solid var(--border); }
.tbl.grouped tbody.person tr + tr td:not([rowspan]) { border-top: 1px dashed var(--border); }
.tbl.grouped tbody.person:first-of-type tr:first-child td { border-top: 0; }
.tbl.grouped tbody.person.mine td { background: var(--gold-soft); }
.tbl.grouped tbody.person:hover td { background: var(--surface-2); }
.tbl.grouped tbody.person.mine:hover td { background: var(--gold-soft); }
.tbl.grouped td.pay, .tbl.grouped td.who { vertical-align: top; }
.who-sub { font-weight: 500; white-space: nowrap; }
.dish-nr { color: var(--faint); font-weight: 700; }
.tbl.grouped tfoot td { border-top: 2px solid var(--border); }
@media screen and (max-width: 760px) {
  .tbl.responsive thead { display: none; }
  .tbl.responsive, .tbl.responsive tbody, .tbl.responsive tr, .tbl.responsive td { display: block; width: 100%; }
  .tbl.responsive tr { border: 1px solid var(--border); border-radius: 12px; margin-bottom: 10px; padding: 8px 12px; background: var(--surface); }
  .tbl.responsive td { border: 0; padding: 3px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .tbl.responsive td::before { content: attr(data-label); font-weight: 650; color: var(--muted); text-align: left; }
  .tbl.responsive td.nr::before, .tbl.responsive td.who::before { content: none; }
  .tbl.responsive td.who { font-size: 1.05rem; justify-content: flex-start; }
  .tbl.responsive td.nr { display: none; }
  .tbl.responsive tfoot { display: block; }
  .tbl.responsive tfoot tr { display: flex; }
  .table-wrap { margin: 0; padding: 0; }
  /* gruppiert: Person = Karte, Gerichte = Abschnitte darin */
  .tbl.grouped.responsive tbody.person { display: block; border: 1px solid var(--border); border-radius: 12px; margin-bottom: 10px; padding: 8px 12px; background: var(--surface); }
  .tbl.grouped.responsive tbody.person tr { border: 0; border-radius: 0; margin: 0; padding: 6px 0; background: none; }
  .tbl.grouped.responsive tbody.person tr + tr { border-top: 1px dashed var(--border); }
  .tbl.grouped.responsive tbody.person td { border: 0 !important; }
  .tbl.grouped.responsive td.who { display: flex; justify-content: space-between; align-items: baseline; }
  .tbl.grouped.responsive td.dish { font-weight: 700; }
  .tbl.grouped.responsive td.dish::before { content: none; }
  .tbl.grouped.responsive td.acts { justify-content: flex-end; }
}
.print-only { display: none !important; }

/* ---------- Listen ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.list > li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .title { font-weight: 700; }
.my-orders { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.order-card { padding: 12px 14px; background: var(--surface); display: flex; gap: 12px; align-items: flex-start; }
.order-card + .order-card { border-top: 1px solid var(--border); }
.order-card.editing { background: var(--primary-soft); }
.order-card .grow { flex: 1; min-width: 0; }
.order-card .title { font-weight: 750; font-size: 1.02rem; }
.order-card .details { color: var(--muted); font-size: .9rem; }
.order-nr { width: 26px; height: 26px; border-radius: 50%; background: var(--gold-soft); color: var(--warn); font-weight: 800; font-size: .85rem; display: grid; place-items: center; flex: none; margin-top: 1px; }
.order-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.order-total { display: flex; justify-content: space-between; padding: 10px 14px; background: var(--surface-2); border-top: 1px solid var(--border); font-weight: 650; }
.order-total b { font-size: 1.05rem; }
.empty { text-align: center; color: var(--muted); padding: 28px 12px; }
.empty .big { font-size: 2.4rem; display: block; margin-bottom: 6px; }

/* Bestellzettel */
.slip { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88rem; white-space: pre-wrap; background: var(--surface-2); border-radius: 12px; padding: 12px 14px; border: 1px dashed var(--border); max-height: 420px; overflow: auto; }
.summary-list { list-style: none; padding: 0; margin: 0; }
.summary-list li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--border); }
.summary-list li:last-child { border-bottom: 0; }
.summary-list .qty { font-weight: 800; color: var(--primary); min-width: 2.5em; }

/* Tagesnavigation */
.daynav { display: flex; align-items: center; gap: 8px; }
.daynav .btn { min-width: 40px; }

/* ---------- Diagramme ---------- */
.hbars { display: grid; gap: 8px; }
.hbar { display: grid; grid-template-columns: minmax(80px, 34%) 1fr auto; gap: 10px; align-items: center; font-size: .9rem; }
.hbar .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.hbar .track { height: 14px; position: relative; }
.hbar .fill { height: 100%; background: var(--bar); border-radius: 0 4px 4px 0; min-width: 2px; }
.hbar.alt .fill { background: var(--bar-2); }
.hbar .val { color: var(--text); font-weight: 700; white-space: nowrap; min-width: 5.5em; text-align: right; }
.hbar .val small { color: var(--muted); font-weight: 500; margin-left: 6px; display: inline-block; min-width: 3em; }
.hbar:hover .fill { filter: brightness(1.1); }
.hbar .fill { display: block; }

/* Achsen-Diagramme: y-Achse links, Gitterlinien, x-Beschriftung darunter */
.chart { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: 200px auto; column-gap: 10px; }
.chart-y { position: relative; min-width: 2.6em; }
.chart-y span { position: absolute; right: 0; transform: translateY(50%); font-size: .75rem; color: var(--muted); white-space: nowrap; line-height: 1; }
.chart-plot { position: relative; border-bottom: 1px solid var(--faint); }
.chart-plot .gridline { position: absolute; left: 0; right: 0; border-top: 1px solid var(--border); pointer-events: none; }
.chart-plot .vline { position: absolute; top: 0; bottom: 0; border-left: 1px dashed var(--border); pointer-events: none; }
.chart-bars { position: absolute; inset: 0; display: flex; align-items: flex-end; gap: 2px; }
.chart-bars .col { flex: 1; height: 100%; display: flex; align-items: flex-end; min-width: 2px; cursor: default; }
.chart-bars .bar { width: 100%; background: var(--bar); border-radius: 4px 4px 0 0; min-height: 1px; }
.chart.green .chart-bars .bar { background: var(--bar-2); }
.chart-bars .col:hover .bar, .chart-bars .col:focus .bar { filter: brightness(1.15); }
.chart-x { grid-column: 2; display: flex; gap: 2px; margin-top: 6px; min-height: 2.4em; }
.chart-x span { flex: 1; min-width: 0; position: relative; font-size: .75rem; color: var(--muted); }
.chart-x span:not(:empty) { overflow: visible; white-space: nowrap; }
.chart-x span b { display: block; font-weight: 700; color: var(--text); font-size: .72rem; }
.chart-x.abs { position: relative; display: block; }
.chart-x.abs span { position: absolute; transform: translateX(-50%); font-weight: 700; color: var(--text); }
.chart-x.abs span:first-child { transform: none; }
/* Preisentwicklung */
.price-chart { grid-template-rows: 220px auto; }
.price-chart svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.price-chart .ln { fill: none; stroke: var(--bar); stroke-width: 2.5; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.price-chart .area { fill: var(--primary-soft); opacity: .7; }
.price-chart .pt {
  position: absolute; width: 10px; height: 10px; border-radius: 50%; background: var(--bar); transform: translate(-50%, 50%);
  box-shadow: 0 0 0 2px var(--surface); cursor: default;
}
.price-chart .pt b {
  position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); font-size: .78rem; font-weight: 800; color: var(--text);
  background: var(--surface); padding: 1px 5px; border-radius: 6px; white-space: nowrap; border: 1px solid var(--border);
}
.price-chart .pt:first-of-type b { left: 0; transform: none; }
.price-chart .pt.last { width: 12px; height: 12px; }
.tip {
  position: fixed; z-index: 100; pointer-events: none; background: var(--text); color: var(--bg); padding: 6px 10px; border-radius: 8px;
  font-size: .82rem; font-weight: 600; box-shadow: var(--shadow); max-width: 260px; transform: translate(-50%, calc(-100% - 10px));
}

/* Vorschlag Fahrer */
.suggest { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); }
.suggest .s-card { border: 1px solid var(--border); border-radius: 14px; padding: 12px; background: var(--surface-2); }
.suggest .s-card:first-child { background: var(--gold-soft); border-color: var(--gold); }
.suggest .s-name { font-weight: 800; font-size: 1.05rem; }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background:
  radial-gradient(circle at 20% 10%, var(--primary-soft), transparent 50%), radial-gradient(circle at 90% 90%, var(--accent-soft), transparent 45%), var(--bg); }
.login-card { width: 100%; max-width: 380px; }
.login-logo { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 18px; text-align: center; }
.login-logo img { width: 72px; height: 72px; border-radius: 18px; box-shadow: var(--shadow); }
.login-logo h1 { margin: 6px 0 0; }

/* ---------- Modal & Toast ---------- */
.modal {
  border: 0; padding: 0; border-radius: 20px; background: var(--surface); color: var(--text);
  width: min(640px, calc(100vw - 24px)); max-height: calc(100vh - 32px); box-shadow: 0 20px 60px rgba(0,0,0,.35);
}
.modal.wide { width: min(900px, calc(100vw - 24px)); }
.modal::backdrop { background: rgba(23, 17, 14, .55); }
.price-list > li { padding: 6px 0; gap: 10px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px 0; }
.modal-head h2 { margin: 0; }
.modal-body { padding: 14px 18px 18px; }
.toasts { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 200; display: grid; gap: 8px; width: min(420px, calc(100vw - 32px)); }
.toast { background: var(--text); color: var(--bg); padding: 11px 16px; border-radius: 12px; font-weight: 600; box-shadow: var(--shadow); animation: pop .2s ease-out; }
.toast.error { background: var(--danger); color: #fff; }
.toast.ok { background: var(--accent); color: #fff; }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } }
.notice { border-radius: 12px; padding: 10px 14px; background: var(--gold-soft); color: var(--text); border: 1px solid var(--gold); }
.notice.red { background: var(--danger-soft); border-color: var(--danger); }
.notice.green { background: var(--accent-soft); border-color: var(--accent); }
.pw-show { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.4rem; font-weight: 800; letter-spacing: .12em; background: var(--surface-2); border-radius: 12px; padding: 12px; text-align: center; border: 1px dashed var(--border); user-select: all; }
details.box { border: 1px solid var(--border); border-radius: 12px; padding: 0 14px; background: var(--surface); }
details.box > summary { cursor: pointer; padding: 12px 0; font-weight: 700; list-style: none; display: flex; align-items: center; gap: 8px; }
details.box > summary::before { content: "▸"; color: var(--muted); transition: transform .15s; }
details.box[open] > summary::before { transform: rotate(90deg); }
details.box[open] { padding-bottom: 14px; }
.loading { text-align: center; padding: 60px 0; color: var(--muted); }
.spin { display: inline-block; width: 28px; height: 28px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.year-chips { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- Druck: Tagesliste auf eine A4-Seite ---------- */
@page { size: A4 portrait; margin: 10mm 10mm 12mm; }
@media print {
  :root { color-scheme: light; }
  html, body { background: #fff !important; color: #000 !important; font-size: 9.5pt; }
  .topbar, .no-print, .toasts, .modal, .tip { display: none !important; }
  .print-only { display: block !important; }
  th.print-only, td.print-only { display: table-cell !important; }
  .container { padding: 0; max-width: none; }
  .card, .tile { box-shadow: none !important; border: 0 !important; padding: 0 !important; background: none !important; }
  a { color: #000; }
  .print-head { border-bottom: 0.5mm solid #000; padding-bottom: 2mm; margin-bottom: 3mm; }
  .print-head h1 { font-size: 15pt; margin: 0 0 1mm; color: #000; }
  .print-head div { font-size: 9.5pt; }
  .list-card { margin-top: 0 !important; }
  .table-wrap { overflow: visible; margin: 0; padding: 0; }
  .tbl { font-size: 9pt; border-collapse: collapse; }
  .tbl th { color: #000; font-size: 7.5pt; padding: 1mm 1.5mm; border-bottom: 0.4mm solid #000; }
  .tbl td { padding: 1.1mm 1.5mm; background: none !important; }
  .tbl.grouped tbody.person { break-inside: avoid; }
  .tbl.grouped tbody.person tr:first-child td { border-top: 0.25mm solid #888 !important; }
  .tbl.grouped tbody.person tr + tr td:not([rowspan]) { border-top: 0.2mm dotted #bbb !important; }
  .tbl tfoot td { border-top: 0.4mm solid #000 !important; font-size: 9.5pt; }
  .badge { border: 0 !important; background: none !important; color: #000 !important; padding: 0; font-size: 8pt; font-weight: 600; }
  .badge.open { text-decoration: underline; }
  .who-sub { color: #444 !important; font-size: 7.5pt; }
  .check-col { width: 7mm; text-align: center; }
  .check-box { display: inline-block; width: 3.2mm; height: 3.2mm; border: 0.3mm solid #000; }
  .slip-grid { display: block !important; margin-top: 4mm !important; break-inside: avoid; }
  .slip-card h2 { font-size: 10pt; margin: 0 0 1.5mm; }
  .summary-list { columns: 3; column-gap: 6mm; font-size: 8.5pt; }
  .summary-list li { padding: 0.6mm 0; border: 0; break-inside: avoid; }
  .summary-list .qty { color: #000; }
  /* viele Gerichte: enger setzen, damit es auf einer Seite bleibt */
  .print-dense .tbl { font-size: 8pt; }
  .print-dense .tbl td { padding: 0.7mm 1.2mm; }
  .print-xdense .tbl { font-size: 7pt; }
  .print-xdense .tbl td { padding: 0.4mm 1mm; }
  .print-xdense .summary-list { columns: 4; font-size: 7.5pt; }
}
