/* Layout: Kassen-Arbeitsplatz für Tablet quer — links offene Deckel, Mitte Getränkekarte, rechts aktueller Deckel. Stil wie schleifchen.tc74.de: weiß, TC-74-Rot, dunkle Buttons, Open Sans */
:root {
  --bg: #fafbfc;
  --surface: #ffffff;
  --line: #e5e5e5;
  --fg: #1a1a1a;
  --muted: #777777;
  --court: #d4111e;
  --court-ink: #ffffff;
  --court-soft: #fdecee;
  --ball: #d4111e;
  --ball-ink: #ffffff;
  --dark: #1a1a1a;
  --dark-ink: #ffffff;
  --tennis: #e8d44d;
  --chip: #f2f2f2;
  --clay: #b30e18;
  --clay-soft: #fdecee;
  --ok: #2c7a4b;
  --warn: #8a6100;
  --warn-soft: #fbf3d5;
  --font-display: "Open Sans", "Segoe UI", system-ui, sans-serif;
  --font-body: "Open Sans", "Segoe UI", system-ui, sans-serif;
  --r: 10px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141516; --surface: #1d1f21; --line: #313437; --fg: #eeeeee; --muted: #a0a4a8;
    --court: #ef4b55; --court-ink: #ffffff; --court-soft: #3a1c1f;
    --ball: #e8333f; --ball-ink: #ffffff; --dark: #eeeeee; --dark-ink: #141516;
    --tennis: #e8d44d; --chip: #2a2c2f; --clay: #ff7a82; --clay-soft: #3a1c1f;
    --ok: #5cc48a; --warn: #e5b649; --warn-soft: #3a2f14; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141516; --surface: #1d1f21; --line: #313437; --fg: #eeeeee; --muted: #a0a4a8;
  --court: #ef4b55; --court-ink: #ffffff; --court-soft: #3a1c1f;
  --ball: #e8333f; --ball-ink: #ffffff; --dark: #eeeeee; --dark-ink: #141516;
  --tennis: #e8d44d; --chip: #2a2c2f; --clay: #ff7a82; --clay-soft: #3a1c1f;
  --ok: #5cc48a; --warn: #e5b649; --warn-soft: #3a2f14; color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { background: var(--bg); color: var(--fg); font-family: var(--font-body); font-size: 16px; line-height: 1.45; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--court); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }

/* Kopfleiste */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--surface); color: var(--fg);
  border-top: 3px solid var(--court); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px 20px; flex-wrap: wrap; padding: 8px 16px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.logo { background: #ffffff; border-radius: 6px; padding: 3px 5px; display: block; }
.logo img { display: block; height: 38px; width: auto; }
.brand b { display: block; font-weight: 800; font-size: 21px; line-height: 1.1; letter-spacing: -.01em; }
.brand b span { color: var(--court); }
.brand small { display: block; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.nav { display: flex; gap: 4px; background: var(--chip); padding: 4px; border-radius: 999px; }
.nav button { border: 0; background: transparent; color: inherit; padding: 7px 16px; border-radius: 999px; font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; }
.nav button[aria-current="page"] { background: var(--dark); color: var(--dark-ink); }
.status { margin-left: auto; font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.status::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--ok); }
.status[data-s="local"]::before { background: var(--tennis); }
.status[data-s="pending"]::before { background: var(--tennis); animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .status::before { animation: none !important; } }

.wrap { padding: 16px; padding-block: 16px 32px; }
.view[hidden] { display: none !important; }

/* Kasse */
.pos { display: grid; gap: 16px; grid-template-columns: 240px minmax(0, 1fr) 340px; align-items: start; }
@media (max-width: 1150px) { .pos { grid-template-columns: 220px minmax(0, 1fr); } .bill { grid-column: 1 / -1; position: static; } }
@media (max-width: 760px) { .pos { grid-template-columns: minmax(0, 1fr); } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; min-width: 0; }
.h { font-family: var(--font-display); font-weight: 700; font-size: 15px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }

.newtab { display: flex; gap: 6px; margin-bottom: 12px; }
.newtab input { flex: 1; min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.btn { border: 1px solid var(--line); background: var(--surface); padding: 10px 14px; border-radius: 6px; font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; }
.btn.primary { background: var(--dark); color: var(--dark-ink); border-color: var(--dark); }
.btn.go { background: var(--ball); color: var(--ball-ink); border-color: var(--ball); }
.btn.danger { color: var(--clay); border-color: var(--clay); background: transparent; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.small { padding: 6px 10px; font-size: 14px; }

.tablist { display: flex; flex-direction: column; gap: 6px; max-height: 70vh; overflow: auto; }
@media (max-width: 760px) { .tablist { flex-direction: row; flex-wrap: wrap; max-height: none; } }
.tabbtn { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; text-align: left; border: 1px solid var(--line); background: var(--bg); border-radius: 8px; padding: 10px 12px; }
.tabbtn[aria-pressed="true"] { border-color: var(--court); background: var(--court-soft); }
.tabbtn .n { font-weight: 700; overflow-wrap: anywhere; }
.tabbtn .t { font-size: 14px; color: var(--muted); white-space: nowrap; }
.empty { color: var(--muted); font-size: 14px; padding: 6px 2px; }

.cat { margin-bottom: 14px; }
.cat:last-child { margin-bottom: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.prod { border: 1px solid var(--line); background: var(--bg); border-radius: 10px; padding: 10px 12px; min-height: 76px; text-align: left; display: flex; flex-direction: column; justify-content: space-between; gap: 4px; transition: transform .06s; }
.prod:active { transform: scale(.97); }
.prod .pn { font-weight: 700; line-height: 1.2; }
.prod .ps { font-size: 13px; color: var(--muted); }
.prod .pp { font-weight: 800; font-size: 18px; color: var(--court); }
.prod.noprice { border-style: dashed; border-color: var(--warn); background: var(--warn-soft); }
.prod.noprice .pp { font-family: var(--font-body); font-size: 13px; color: var(--warn); font-weight: 700; }
.prod:disabled { opacity: .5; }
.favs { padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.favhead { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.favhead .h { margin: 0; }
.prod.fav-toggle .star { font-size: 22px; line-height: 1; color: var(--muted); }
.prod.fav-toggle[aria-pressed="true"] { border-color: var(--court); }
.prod.fav-toggle[aria-pressed="true"] .star { color: var(--court); }
.pricefix { margin-top: 10px; padding: 12px; border-radius: 10px; background: var(--warn-soft); border: 1px solid var(--warn); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pricefix input { width: 110px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.hint { font-size: 14px; color: var(--muted); margin: 0 0 12px; }

/* Deckel */
.bill { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 76px); }
.billhead { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.billhead input { flex: 1; min-width: 0; font-family: var(--font-display); font-size: 24px; letter-spacing: -.01em; font-weight: 700; border: 1px solid transparent; background: transparent; padding: 2px 6px; border-radius: 6px; }
.billhead input:hover, .billhead input:focus { border-color: var(--line); background: var(--bg); }
.lines { list-style: none; margin: 0; padding: 0; border-top: 1px dashed var(--line); }
.lines li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.qty { display: flex; align-items: center; gap: 4px; }
.qty button { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); font-weight: 700; font-size: 18px; line-height: 1; }
.qty span { min-width: 22px; text-align: center; font-weight: 700; }
.lines .ln { overflow-wrap: anywhere; }
.lines .ln small { display: block; color: var(--muted); font-size: 13px; }
.total { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 0 12px; }
.total span:first-child { font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-size: 14px; }
.total .big { font-family: var(--font-display); font-weight: 800; font-size: 38px; line-height: 1; }
.billactions { display: grid; gap: 8px; }
.billactions .btn.go { font-size: 18px; padding: 14px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.row > * { flex: 1; }

/* Bezahlen */
.overlay { position: fixed; inset: 0; z-index: 20; background: rgba(10, 20, 15, .55); display: grid; place-items: center; padding: 16px; }
.sheet { background: var(--surface); color: var(--fg); border-radius: 14px; width: min(560px, 100%); max-height: 100%; overflow: auto; padding: 20px; display: grid; gap: 16px; }
.sheet h2 { margin: 0; font-family: var(--font-display); font-size: 28px; }
.due { display: flex; justify-content: space-between; align-items: baseline; background: var(--court-soft); border-radius: 10px; padding: 12px 16px; }
.due .big { font-family: var(--font-display); font-size: 44px; font-weight: 800; line-height: 1; }
.methods { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.methods button { padding: 16px; font-size: 20px; border-radius: 10px; border: 2px solid var(--line); background: var(--bg); font-weight: 700; }
.methods button[aria-pressed="true"] { border-color: var(--court); background: var(--court-soft); }
.cash { display: grid; gap: 10px; }
.cash label { font-weight: 700; }
.cash input { font-size: 28px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; width: 100%; background: var(--bg); }
.quick { display: flex; flex-wrap: wrap; gap: 6px; }
.quick button { flex: 1 1 70px; padding: 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); font-weight: 700; }
.change { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 16px; border-radius: 10px; background: var(--bg); }
.change .big { font-family: var(--font-display); font-size: 40px; font-weight: 700; }
.change.ok { background: var(--court-soft); }
.change.short { background: var(--clay-soft); color: var(--clay); }
.card { display: grid; justify-items: center; gap: 10px; text-align: center; }
.qrbox { background: #fff; padding: 12px; border-radius: 10px; }
.qrbox img, .qrbox canvas { display: block; width: 240px; height: 240px; max-width: 100%; object-fit: contain; }

/* Abschluss */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; }
.kpi .l { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.kpi .v { font-family: var(--font-display); font-size: 34px; font-weight: 700; }
.kpi.alert { border-color: var(--warn); background: var(--warn-soft); }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; align-items: start; }
@media (max-width: 400px) { .cols { grid-template-columns: minmax(0, 1fr); } }
.tbl { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
td.r, th.r { text-align: right; font-variant-numeric: tabular-nums; }
.pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--chip); color: var(--fg); }
.pill.bar { background: var(--warn-soft); color: var(--warn); }

/* Preise */
.prices td input[type="text"], .prices td input[type="number"], .prices td input:not([type]) { width: 100%; min-width: 80px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.prices td input.price { max-width: 110px; text-align: right; }
.prices td input.missing { border-color: var(--warn); background: var(--warn-soft); }
.settings { display: grid; gap: 12px; }
.settings input[type="url"], .settings input[type="text"] { width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.toast { position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--fg); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-weight: 700; z-index: 30; max-width: calc(100% - 32px); }

/* ---------- Ergänzungen Web-App ---------- */
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; padding-bottom: env(safe-area-inset-bottom, 0px); }
[hidden] { display: none !important; }
.top { padding-top: calc(8px + env(safe-area-inset-top, 0px)); top: 0; }
.user { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.user b { color: var(--fg); }

/* Anmeldung */
.login { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 16px; padding-block: 24px; }
.login-card { width: min(400px, 100%); background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--court); border-radius: 12px; padding: 24px; display: grid; gap: 14px; }
.login-card .logo { justify-self: center; padding: 6px 10px; }
.login-card .logo img { height: 64px; }
.login-card h1 { margin: 0; text-align: center; font-size: 22px; font-weight: 800; }
.login-card h1 span { color: var(--court); }
.login-card label { font-weight: 700; font-size: 14px; display: grid; gap: 6px; }
.login-card input { padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); font-size: 17px; }
.login-card .btn { padding: 14px; font-size: 15px; }
.msg { font-size: 14px; padding: 10px 12px; border-radius: 8px; background: var(--clay-soft); color: var(--clay); }
.msg.info { background: var(--chip); color: var(--fg); }

/* Verbindung */
.offline { background: var(--warn-soft); color: var(--warn); border-bottom: 1px solid var(--warn); text-align: center; padding: 8px 16px; font-weight: 700; font-size: 14px; }

/* Abschluss-Filter */
.filter { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.filter input[type="date"] { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }

/* Benutzer */
.members select, .members input { padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); width: 100%; min-width: 110px; }
.role-pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--chip); }
.role-pill.admin { background: var(--court); color: var(--court-ink); }
.role-pill.kasse { background: var(--dark); color: var(--dark-ink); }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 15px; }

/* Wer kassiert, Kassenstand, Stornos */
#modal { z-index: 25; }
#cashierbtn b { color: var(--court); }
.cashlog { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 15px; }
.cashlog small { color: var(--muted); }
.diff-ok { color: var(--ok); }
.diff-bad { color: var(--clay); }
.pricefix.free { background: var(--chip); border-color: var(--line); }
@media (max-width: 760px) { .user #whoami { display: none; } }
.cashbox { border-top: 1px dashed var(--line); padding-top: 14px; }
.cashbox small { font-weight: 400; color: var(--muted); }
.quick button[aria-pressed="true"] { border-color: var(--court); background: var(--court-soft); }

/* Bestellungen aus der Schleifchen-App */
.orders { border: 2px solid var(--court); margin-bottom: 16px; }
.orders .h { color: var(--court); }
.orderlist { display: grid; gap: 8px; }
.order { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 10px 12px; border-radius: 8px; background: var(--court-soft); }
.order-main { min-width: 0; display: grid; gap: 4px; }
.order-main .muted { color: var(--muted); font-size: 13px; }
.oi { display: inline-block; margin-right: 12px; }
.onote { font-size: 14px; color: var(--muted); font-style: italic; }
.order-actions { display: flex; gap: 8px; align-items: center; }
.order-actions > .num { font-weight: 800; margin-right: 4px; }
.tag { display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 1px 6px; border-radius: 999px; background: var(--chip); color: var(--muted); vertical-align: middle; }
