/* Verwaltung: ruhige Arbeitsoberfläche, warme Neutraltöne passend zu den Menüboards, ein Akzent (Glut-Orange) */
:root {
  --bg: #F6F4F1; --surface: #FFFFFF; --surface-2: #FBFAF8; --ink: #1E1A16; --muted: #6E665E; --line: #E4DFD8; --line-2: #D3CCC3;
  --accent: #D44A18; --accent-ink: #FFFFFF; --accent-soft: #FCE9E1;
  --ok: #2F8A4A; --ok-soft: #E3F3E7; --warn: #A86A10; --warn-soft: #FBF0DC; --bad: #B8321F; --bad-soft: #FBE5E1;
  --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --r: 10px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131110; --surface: #1C1917; --surface-2: #211E1B; --ink: #EDE8E2; --muted: #A49B91; --line: #2E2A26; --line-2: #3B3631;
    --accent: #EE6332; --accent-ink: #1A0F0B; --accent-soft: #3A1E14;
    --ok: #63C17D; --ok-soft: #1B2E21; --warn: #E2A84A; --warn-soft: #33270F; --bad: #EC7560; --bad-soft: #3A1C17; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #131110; --surface: #1C1917; --surface-2: #211E1B; --ink: #EDE8E2; --muted: #A49B91; --line: #2E2A26; --line-2: #3B3631;
  --accent: #EE6332; --accent-ink: #1A0F0B; --accent-soft: #3A1E14;
  --ok: #63C17D; --ok-soft: #1B2E21; --warn: #E2A84A; --warn-soft: #33270F; --bad: #EC7560; --bad-soft: #3A1C17; color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.55 var(--body); }
[hidden] { display: none !important; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); letter-spacing: -.01em; margin: 0; text-wrap: balance; }
h1 { font-size: 28px; font-weight: 700; }
h2 { font-size: 20px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }

/* Kopfzeile */
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
  padding-block: 12px; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px));
  background: var(--surface); border-bottom: 1px solid var(--line); }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--display); font-weight: 600; font-size: 16px; color: var(--muted); }
.logo img { height: 20px; width: auto; display: block; }
.logo-on-dark { display: none !important; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .logo-on-light { display: none !important; } :root:not([data-theme="light"]) .logo-on-dark { display: block !important; } }
:root[data-theme="dark"] .logo-on-light { display: none !important; }
:root[data-theme="dark"] .logo-on-dark { display: block !important; }
.login .brandmark { height: 28px; width: auto; margin-bottom: 8px; }
nav { display: flex; gap: 4px; flex-wrap: wrap; }
nav a { text-decoration: none; padding: 6px 12px; border-radius: 8px; color: var(--muted); font-weight: 600; }
nav a.on { background: var(--bg); color: var(--ink); }
.who { margin-left: auto; display: flex; gap: 14px; align-items: center; font-size: 14px; color: var(--muted); }

main { max-width: 1180px; margin: 0 auto; padding-block: 28px 80px;
  padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px));
  display: grid; gap: 24px; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.head .crumb { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.head .crumb a { text-decoration: none; }
.head .crumb a:hover { text-decoration: underline; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; display: grid; gap: 14px; min-width: 0; }
.card > header { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.stat b { display: block; font: 700 26px/1.1 var(--display); font-variant-numeric: tabular-nums; }
.stat span { font-size: 13px; color: var(--muted); }

/* Bedienelemente */
button, .btn { font: 600 14px var(--body); border-radius: 8px; padding: 8px 14px; cursor: pointer; border: 1px solid var(--line-2);
  background: var(--surface); color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
button:hover, .btn:hover { border-color: var(--muted); }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
button.danger { color: var(--bad); }
button.small, .btn.small { padding: 4px 10px; font-size: 13px; }
button.link { border: 0; background: none; padding: 0; color: inherit; font-weight: 600; }
button:disabled { opacity: .5; cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input, select, textarea { font: 15px var(--body); color: var(--ink); background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 8px; padding: 8px 10px; width: 100%; min-width: 0; }
textarea { min-height: 64px; resize: vertical; }
label.f { display: grid; gap: 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
.fields { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); }
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; font-weight: 600; color: var(--ink); }
.check input { width: auto; }
.switch { position: relative; width: 38px; height: 22px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; z-index: 1; }
.switch span { position: absolute; inset: 0; background: var(--line-2); border-radius: 22px; transition: background .2s; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; background: #fff; border-radius: 50%; transition: transform .2s; }
.switch input:checked + span { background: var(--bad); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Listen und Tabellen */
.list { display: grid; }
.list > a, .list > div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); text-decoration: none; align-items: center; }
.list > :first-child { border-top: 0; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }

/* Status */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 99px; white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.idle { background: var(--bg); color: var(--muted); }
.code { font: 700 18px var(--mono); letter-spacing: .14em; color: var(--accent); }

/* Speisekarte */
.cat-card .items { display: grid; }
.item { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto auto auto; gap: 14px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.item:first-child { border-top: 0; }
.thumb { width: 56px; height: 40px; border-radius: 6px; background: var(--bg) center/cover no-repeat; border: 1px solid var(--line); }
.item .nm { font-weight: 700; }
.item .ds { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .pr { font: 700 16px var(--display); font-variant-numeric: tabular-nums; }
.item.sold .nm, .item.sold .pr { color: var(--muted); text-decoration: line-through; }
.tagl { font-size: 11px; font-weight: 700; color: var(--accent); background: var(--accent-soft); padding: 1px 7px; border-radius: 99px; margin-left: 6px; text-transform: uppercase; letter-spacing: .04em; }
.so { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); font-weight: 600; }
.mv { display: flex; gap: 2px; }
.mv button { padding: 2px 7px; }
@media (max-width: 640px) {
  .item { grid-template-columns: 48px minmax(0, 1fr) auto; }
  .item .mv { display: none; }
  .item .so { grid-column: 2 / 4; }
}

/* Bildschirmwand */
.wall { display: grid; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.tv { aspect-ratio: 16 / 9; min-width: 190px; border-radius: 8px; border: 2px solid var(--line-2); background: var(--surface-2); padding: 10px 12px;
  display: flex; flex-direction: column; gap: 6px; position: relative; }
.tv.on { border-color: var(--ok); }
.tv.off { border-color: var(--bad); }
.tv .lbl { font: 700 16px var(--display); }
.tv .cnt { font-size: 12px; color: var(--muted); }
.tv .bot { margin-top: auto; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* Dialog und Meldungen */
dialog { border: 1px solid var(--line); border-radius: 14px; padding: 0; background: var(--surface); color: var(--ink); width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); }
dialog::backdrop { background: rgba(20, 16, 13, .45); }
#dlg-form { padding: 22px; display: grid; gap: 16px; }
#dlg-form .foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.err { color: var(--bad); font-size: 14px; font-weight: 600; }
#toast { position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--bg);
  padding: 10px 16px; border-radius: 10px; font-weight: 600; font-size: 14px; z-index: 50; max-width: calc(100vw - 32px); }
#toast.bad { background: var(--bad); color: #fff; }
.shot { width: 100%; border-radius: 8px; border: 1px solid var(--line); background: #000; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

/* Anmeldung */
.login { max-width: 380px; margin: 10vh auto 0; }
.login h1 { margin-bottom: 6px; }
.empty { padding: 28px; text-align: center; color: var(--muted); border: 1px dashed var(--line-2); border-radius: var(--r); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
