/* Tavolata – Design-Tokens gemäss Design-Canvas */
@import url("https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,600;12..96,700&family=Inter:wght@400;500;600;700&display=swap");

:root {
  --bg:#F3F4EF; --surface:#FFFFFF; --surface2:#E9EBE4; --line:#D6DACF; --fg:#1A1E1B; --muted:#596059;
  --accent:#2E6A4E; --accentFg:#FFFFFF; --accentSoft:#DCEBE1; --cook:#8F5300; --cookSoft:#FBEBC8; --danger:#A4441C;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:#111412; --surface:#1A1F1C; --surface2:#232A26; --line:#313A34; --fg:#E8ECE9; --muted:#A3ACA6;
    --accent:#74C69A; --accentFg:#0E1A13; --accentSoft:#1F3A2C; --cook:#F2BE55; --cookSoft:#3A2E14; --danger:#F08A5D;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg:#111412; --surface:#1A1F1C; --surface2:#232A26; --line:#313A34; --fg:#E8ECE9; --muted:#A3ACA6;
  --accent:#74C69A; --accentFg:#0E1A13; --accentSoft:#1F3A2C; --cook:#F2BE55; --cookSoft:#3A2E14; --danger:#F08A5D;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); font-family: Inter, system-ui, sans-serif; -webkit-text-size-adjust: 100%; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--accent); }
.disp { font-family: "Bricolage Grotesque", system-ui, sans-serif; letter-spacing: -0.02em; }
.muted { color: var(--muted); }
.sr { position: absolute; left: -9999px; }
h1 { margin: 0; font-size: 30px; line-height: 1.1; }
h2 { margin: 0; font-size: 18px; }

/* Layout: Tabs unten (Phone), Seitennavigation links (Desktop) */
.shell { min-height: 100vh; display: flex; }
.view { flex: 1; min-width: 0; padding: 20px 16px 110px; max-width: 1240px; margin: 0 auto; outline: none; }
.side { display: none; }
.tabs { position: fixed; left: 0; right: 0; bottom: 0; display: flex; background: var(--surface); border-top: 1px solid var(--line);
  padding: 6px 8px calc(10px + env(safe-area-inset-bottom)); z-index: 10; }
.tabs a { flex: 1; min-height: 48px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 11px; font-weight: 500; text-decoration: none; color: var(--muted); }
.tabs a[aria-current="page"] { color: var(--accent); font-weight: 700; }
@media (min-width: 900px) {
  .tabs { display: none; }
  .side { display: flex; flex-direction: column; gap: 24px; width: 240px; flex-shrink: 0; padding: 24px 16px; background: var(--surface);
    border-right: 1px solid var(--line); position: sticky; top: 0; height: 100vh; }
  .side a { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border-radius: 10px; font-size: 14px;
    font-weight: 500; color: var(--fg); text-decoration: none; }
  .side a[aria-current="page"] { background: var(--accentSoft); color: var(--accent); font-weight: 700; }
  .view { padding: 32px 40px 48px; }
}
.shell.anon .tabs, .shell.anon .side { display: none; }

.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; }
.logo { width: 34px; height: 34px; border-radius: 10px; background: var(--accent); color: var(--accentFg); display: grid; place-items: center; }

/* Bausteine */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; align-items: center; gap: 8px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.btn { min-height: 44px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; cursor: pointer; }
.btn.primary { background: var(--accent); color: var(--accentFg); border-color: var(--accent); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--accent); }
.btn.icon { width: 44px; padding: 0; display: grid; place-items: center; }
.btn:disabled { opacity: .5; cursor: default; }
.input { width: 100%; min-height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); padding: 0 12px; font-size: 16px; }
.chip { display: inline-flex; align-items: center; gap: 5px; min-height: 28px; padding: 0 10px; border-radius: 999px; background: var(--surface2); font-size: 12px; font-weight: 600; }
.chip.cook { background: var(--cookSoft); color: var(--cook); }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; background: var(--surface2); border-radius: 12px; padding: 4px; }
.seg button { min-height: 36px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-weight: 600; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--fg); }
.label { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }

/* Woche */
.weekbar { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 4px; }
.day { display: flex; flex-direction: column; gap: 8px; }
.day-row { display: flex; align-items: center; gap: 6px; }
.day-date { width: 54px; flex-shrink: 0; }
.pill { flex: 1; min-width: 0; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface2); color: var(--muted);
  display: flex; align-items: center; justify-content: center; gap: 5px; font-size: 13px; font-weight: 600; cursor: pointer; }
.pill[aria-pressed="true"] { background: var(--accent); color: var(--accentFg); border-color: var(--accent); }
.hat { width: 40px; height: 44px; flex-shrink: 0; border-radius: 12px; border: 1px solid var(--line); background: transparent; color: var(--muted);
  display: grid; place-items: center; cursor: pointer; }
.hat[aria-pressed="true"] { background: var(--cookSoft); color: var(--cook); border-color: var(--cook); }
.pill:disabled, .hat:disabled { opacity: .55; cursor: default; }
.menu-line { display: flex; gap: 10px; font-size: 12px; color: var(--muted); padding-left: 60px; }
.menu-line span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Übersicht */
.avatars { display: flex; gap: 4px; flex-wrap: wrap; }
.av { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; }
.count { width: 52px; flex-shrink: 0; text-align: center; background: var(--surface2); border-radius: 12px; padding: 6px 0; }
.banner { display: flex; align-items: center; gap: 12px; background: var(--cookSoft); border: 1px solid var(--cook); border-radius: 14px; padding: 10px 10px 10px 14px; }
.table-wrap { overflow-x: auto; }
table.grid { width: 100%; min-width: 860px; border-collapse: collapse; font-size: 14px; }
table.grid th, table.grid td { border-bottom: 1px solid var(--line); padding: 6px 2px; text-align: center; }
table.grid th[scope="row"] { text-align: left; padding: 8px; white-space: nowrap; }
.cell { width: 30px; height: 30px; border-radius: 8px; display: inline-grid; place-items: center; font-weight: 700; }
.cell.in { background: var(--accentSoft); color: var(--accent); }
.cell.ck { background: var(--cookSoft); color: var(--cook); }
.cell.out { color: var(--muted); }
.cell.unk { color: var(--muted); border: 1px dashed var(--muted); }
.stats { display: flex; flex-wrap: wrap; gap: 12px; }
.stats .card { flex: 1 1 180px; padding: 16px 18px; }

/* Menüs */
.daychips { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.daychips button { height: 54px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; padding: 0; }
.daychips button[aria-pressed="true"] { background: var(--accent); color: var(--accentFg); border-color: var(--accent); }
.list { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.list > * { border-bottom: 1px solid var(--line); }
.list > *:last-child { border-bottom: 0; }
.li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; min-height: 48px; }
.done { text-decoration: line-through; color: var(--muted); }
input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--accent); }

.toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); background: var(--fg); color: var(--bg); padding: 10px 16px;
  border-radius: 12px; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 20; max-width: 90vw; }
.toast.show { opacity: 1; }
.login { max-width: 420px; margin: 0 auto; padding-top: 32px; }
.people-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.otp { height: 60px; font-size: 28px; font-weight: 700; letter-spacing: .4em; text-align: center; }
