/* Essbuch — ruhig und minimal: fast weißer Grund, Hairlines, Burgund nur als Akzent. */

:root {
  --burgund: #8c2f39;
  --burgund-dark: #43141b;
  --bg: #fdfdfb;
  --ink: #2e2628;
  --muted: #8f8781;
  --line: rgba(0, 0, 0, .12);
  --line-soft: rgba(0, 0, 0, .06);
  --tint: rgba(140, 47, 57, .06);
  --mono: "IBM Plex Mono", monospace;
  --sans: "Archivo", sans-serif;
  --radius: 10px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
}

.hidden { display: none !important; }

button { font-family: var(--sans); }

/* ---------------------------------------------------------------- Header */

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 20px 14px;
  max-width: 680px; margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 12px; }

/* Erk-Badge: Wortmarke im Rahmen, ohne Jahreszahl */
.badge {
  border: 2px solid var(--burgund); border-radius: 9px;
  padding: 6px 10px; color: var(--burgund);
  font-weight: 800; font-size: 15px; letter-spacing: .05em; line-height: 1;
}
.brand-title { font-weight: 700; font-size: 19px; letter-spacing: -.01em; }
.brand-sub {
  font-family: var(--mono); font-size: 9px; letter-spacing: .18em;
  color: var(--muted); margin-top: 2px;
}

/* ---------------------------------------------------------------- Layout */

.view { max-width: 680px; margin: 0 auto; padding: 4px 16px 24px; }

h2.section {
  font-size: 12px; font-family: var(--mono); font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
  margin: 28px 2px 10px;
}
h2.section:first-child { margin-top: 8px; }

.panel {
  background: #fff; border: 1px solid var(--line-soft);
  border-radius: var(--radius); padding: 14px 16px; margin-bottom: 10px;
}

.hint { font-size: 13px; color: var(--muted); margin: 6px 2px 14px; line-height: 1.5; }

/* ---------------------------------------------------------------- Auth */

.auth-card { max-width: 380px; margin: 10vh auto 0; padding: 0 4px; }
.auth-card h1 { font-size: 22px; letter-spacing: -.02em; margin-bottom: 18px; }
.auth-card label {
  display: block; font-size: 13px; font-weight: 600; margin-bottom: 14px;
}
.auth-card .opt { font-weight: 400; color: var(--muted); }
.auth-card input {
  display: block; width: 100%; margin-top: 6px;
  font: 16px var(--sans); color: var(--ink);
  padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 8px; background: #fff;
  transition: border-color .15s;
}
.auth-card input:focus { outline: none; border-color: var(--burgund); }
.auth-error { color: var(--burgund); font-size: 14px; margin-top: 12px; }

.primary-btn {
  width: 100%; padding: 12px; margin-top: 6px;
  font: 600 15px var(--sans); color: #fff;
  background: var(--burgund); border: none; border-radius: 8px;
  cursor: pointer; transition: background .15s;
}
.primary-btn:hover { background: var(--burgund-dark); }

.link-btn {
  display: block; margin: 18px auto 0; background: none; border: none;
  color: var(--muted); font: 14px var(--sans); cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px;
}
.link-btn:hover { color: var(--burgund); }

.ghost-btn {
  background: none; border: 1px solid var(--line); border-radius: 8px;
  color: var(--muted); font: 13px var(--sans); padding: 7px 12px;
  cursor: pointer; transition: color .15s, border-color .15s;
}
.ghost-btn:hover { color: var(--burgund); border-color: var(--burgund); }

/* ---------------------------------------------------------------- Späteressen */

.late-card {
  border: 1px solid var(--burgund); border-radius: var(--radius);
  background: #fff; padding: 12px 14px; margin-bottom: 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.late-card .q { font-size: 14px; font-weight: 600; }
.late-card .sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.late-card button, .latepanel button {
  flex-shrink: 0; padding: 9px 14px; border-radius: 8px; cursor: pointer;
  font: 600 13px var(--sans); border: 1px solid var(--burgund);
  background: var(--burgund); color: #fff;
}
.late-card button.done, .latepanel button.done {
  background: transparent; color: var(--burgund);
}

/* ---------------------------------------------------------------- Heute */

.today-head { display: flex; align-items: baseline; gap: 10px; margin: 4px 2px 14px; }
.today-head .day { font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.today-head .date { font-family: var(--mono); font-size: 12.5px; color: var(--muted); }

.meal-col h3 {
  font-size: 14px; font-weight: 700; display: flex; align-items: baseline;
  justify-content: space-between; margin-bottom: 8px;
}
.meal-col h3 .count {
  font-family: var(--mono); font-size: 11.5px; color: var(--muted); font-weight: 400;
}
.namelist { list-style: none; }
.namelist li {
  padding: 6px 0; font-size: 14px;
  border-top: 1px solid var(--line-soft);
  display: flex; justify-content: space-between; align-items: center;
}
.namelist li .tag { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.namelist li .tag.eaten { color: #4a7c59; }
.namelist .empty { color: var(--muted); font-style: italic; border-top: none; }
.guestline {
  margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line-soft);
  font-size: 13px; color: var(--muted);
}

.twocol { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 540px) { .twocol { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- Wochenliste */

.week-label {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted); margin: 24px 2px 6px;
}
.week-label:first-of-type { margin-top: 10px; }

.listhead, .mainline {
  display: grid; grid-template-columns: 4.6em 1fr 1fr 2.6em;
  gap: 8px; align-items: center;
}
.listhead {
  padding: 0 10px 6px; font-family: var(--mono); font-size: 10.5px;
  letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
}
.listhead span:nth-child(2), .listhead span:nth-child(3) { text-align: center; }

.dayline {
  background: #fff; border: 1px solid var(--line-soft);
  border-radius: var(--radius); padding: 8px 10px; margin-bottom: 6px;
}
.dayline.weekend { background: #f7f5f1; }
.dayline.today { border-color: var(--burgund); }
.dayline.locked .mainline { opacity: .4; }

.dcol { display: flex; flex-direction: column; line-height: 1.25; }
.dcol .wd { font-weight: 700; font-size: 14px; }
.dayline.weekend .dcol .wd { color: var(--burgund); }
.dcol .dt { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.dcol .tpl { font-family: var(--mono); font-size: 9px; letter-spacing: .08em; color: var(--muted); }

/* Tipp-Feld: 1× = x (pünktlich), 2× = s (später), 3× = abgemeldet */
.cyc {
  padding: 10px 0; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; font: 600 14px var(--mono); cursor: pointer;
  color: var(--muted); text-align: center; transition: background .12s, color .12s, border-color .12s;
}
.cyc.on { background: var(--burgund); border-color: var(--burgund); color: #fff; }
.cyc.late { background: #fff; border-color: var(--burgund); color: var(--burgund); }
.cyc:disabled { cursor: default; }

/* Gäste */
.gbtn {
  height: 36px; border: 1px solid var(--line-soft); border-radius: 8px;
  background: none; color: var(--muted); font: 500 13px var(--mono);
  cursor: pointer;
}
.gbtn.has { border-color: var(--line); color: var(--ink); font-weight: 600; }
.gpanel {
  display: flex; gap: 18px; flex-wrap: wrap; align-items: center;
  margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line-soft);
  font-size: 12.5px; color: var(--muted);
}
.stepper { display: inline-flex; align-items: center; gap: 4px; }
.stepper button {
  width: 26px; height: 26px; border-radius: 7px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); font: 600 15px var(--sans);
  cursor: pointer; line-height: 1;
}
.stepper button:disabled { color: var(--line); cursor: default; }
.stepper .n {
  min-width: 20px; text-align: center; font-family: var(--mono); font-size: 13px;
  color: var(--ink);
}

.latepanel {
  margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line-soft);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: 13px;
}

/* ---------------------------------------------------------------- Verwaltung */

.vw-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.vw-table th {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted); font-weight: 500;
  text-align: right; padding: 8px 6px; border-bottom: 1px solid var(--line);
}
.vw-table th:first-child { text-align: left; }
.vw-table td {
  padding: 10px 6px; text-align: right; border-bottom: 1px solid var(--line-soft);
  font-family: var(--mono); font-size: 14px;
}
.vw-table td:first-child { text-align: left; font-family: var(--sans); font-weight: 600; }
.vw-table td .dt { font-family: var(--mono); font-weight: 400; font-size: 11px; color: var(--muted); display: block; }
.vw-table tr.fixed td { background: var(--tint); }
.vw-big { font-size: 16px; font-weight: 600; }

/* ---------------------------------------------------------------- Admin */

.userrow {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 0; border-top: 1px solid var(--line-soft);
}
.userrow:first-child { border-top: none; }
.userrow .uname { font-weight: 600; font-size: 14px; }
.userrow .uuser { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.userrow .duty-info { font-size: 12px; color: var(--burgund); margin-top: 2px; }
.userrow .rolebadge {
  font-family: var(--mono); font-size: 10px; letter-spacing: .08em;
  padding: 3px 7px; border-radius: 6px;
  border: 1px solid var(--line); color: var(--muted); background: none;
}
.userrow .rolebadge.warn { border-color: var(--burgund); color: var(--burgund); }
.userrow .spacer { flex: 1; }
.userrow .mini {
  font: 12px var(--sans); color: var(--ink); background: none;
  border: 1px solid var(--line); border-radius: 7px; padding: 5px 9px; cursor: pointer;
}
.userrow .mini:hover { border-color: var(--burgund); color: var(--burgund); }

.seg { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button {
  flex: 1; padding: 8px 0; border: none; background: #fff;
  font: 600 13px var(--mono); color: var(--muted); cursor: pointer;
  border-left: 1px solid var(--line-soft);
}
.seg button:first-child { border-left: none; }
.seg button.on { background: var(--burgund); color: #fff; }
.seg button.on.late-on { background: #fff; color: var(--burgund); box-shadow: inset 0 0 0 1px var(--burgund); }

.admin-day-nav { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.admin-day-nav input[type=date] {
  font: 14px var(--mono); padding: 8px 10px; border: 1px solid var(--line);
  border-radius: 8px; background: #fff; color: var(--ink);
}
.admin-unlocked-warn { font-size: 12.5px; color: var(--burgund); margin-bottom: 10px; }

/* ---------------------------------------------------------------- Tabbar */

.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: rgba(253, 253, 251, .94); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line-soft);
  display: flex; justify-content: center; gap: 2px;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
}
.tab {
  border: none; background: none; font: 600 13px var(--sans);
  color: var(--muted); padding: 9px 13px; border-radius: 8px;
  cursor: pointer; transition: color .15s, background .15s;
}
.tab.active { color: var(--burgund); background: var(--tint); }
@media (max-width: 430px) {
  .tabbar { gap: 0; }
  .tab { font-size: 12px; padding: 9px 9px; }
}

/* ---------------------------------------------------------------- Toast */

.toast {
  position: fixed; bottom: calc(80px + env(safe-area-inset-bottom));
  left: 50%; transform: translateX(-50%);
  background: var(--burgund-dark); color: #fff;
  font-size: 13px; padding: 10px 18px; border-radius: 10px;
  z-index: 50; max-width: 90vw; text-align: center;
}
