/* ============================================================
   MKE Getränkekasse — Stylesheet
   „Soft System": Elfenbein-Flächen mit weichen Licht-/Schatten-
   Kanten (Soft UI), Kobaltblau als einzige Akzentfarbe,
   Überschriften in gesperrten Versalien.
   ============================================================ */

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

:root {
    /* Palette */
    --cobalt:   #1250DC;
    --cobalt-d: #0B3FB8;
    --sky:      #5C9BF2;
    --mist:     #CFD6E0;
    --ivory:    #F2EFEA;
    --charcoal: #1D222B;

    /* Flächen */
    --c-bg:       #F2EFEA;
    --c-surface:  #F5F2ED;   /* Karten */
    --c-raised:   #F8F6F2;   /* Kacheln/Buttons auf Karten */
    --c-sunken:   #ECE8E2;   /* Eingabefelder, Spuren */

    /* Kompatible Namen (werden auch im JS inline genutzt) */
    --c-dark:   var(--charcoal);
    --c-mid:    var(--cobalt);
    --c-light:  var(--sky);
    --c-accent-grad: linear-gradient(145deg, #2A66EE 0%, #1250DC 55%, #0D45C4 100%);
    --c-pos:    #0E8A5F;
    --c-neg:    #D23B3B;
    --c-warn:   #C77A12;
    --c-text:   #2A2F38;
    --c-muted:  #7A7F88;
    --c-border: rgba(29, 34, 43, .08);
    --c-card-bg: var(--c-raised);

    --radius:    18px;
    --radius-lg: 26px;

    /* Soft-UI-Schatten: Licht oben links, Schatten unten rechts */
    --sh-dark:   rgba(150, 138, 120, .30);
    --sh-light:  rgba(255, 255, 255, .95);
    --shadow-card:   10px 10px 26px var(--sh-dark), -10px -10px 26px var(--sh-light);
    --shadow-raised: 5px 5px 12px var(--sh-dark), -5px -5px 12px var(--sh-light);
    --shadow-small:  3px 3px 7px var(--sh-dark), -3px -3px 7px var(--sh-light);
    --shadow-inset:  inset 2px 2px 6px rgba(150, 138, 120, .24), inset -3px -3px 6px rgba(255, 255, 255, .85);
    --shadow-press:  inset 2px 2px 5px rgba(150, 138, 120, .32), inset -2px -2px 5px rgba(255, 255, 255, .85);
    --shadow-cobalt: 0 8px 18px rgba(18, 80, 220, .32), -4px -4px 10px var(--sh-light);

    --shadow-float:  0 24px 60px rgba(80, 70, 55, .26), -8px -8px 26px rgba(255, 255, 255, .7);

    /* Text & Zustände */
    --c-ink:          var(--charcoal);  /* Überschriften, starke Schrift */
    --c-accent-text:  var(--cobalt);    /* kobaltblaue Schrift (Preise, aktive Tabs, Links) */
    --c-pos-text:     #0A6B49;
    --c-neg-text:     #B02A2A;
    --c-pos-bg:       rgba(14, 138, 95, .12);   /* Saldo-Pillen auf Personenkarten */
    --c-neg-bg:       rgba(210, 59, 59, .11);
    --c-neg-grad:     linear-gradient(145deg, #E04848 0%, #C62F2F 60%, #AE2525 100%);
    --c-warn-text:    #8A5208;
    --c-placeholder:  #A3A6AC;
    --c-divider:      rgba(29, 34, 43, .11);
    --c-hover:        rgba(18, 80, 220, .035);
    --c-hover-strong: rgba(29, 34, 43, .07);
    --c-band:         #F0EDE7;          /* Zwischenzeilen in Tabellen */
    --c-row-filled:   #EAF0FC;
    --c-scrim:        rgba(230, 225, 217, .6);
    --c-glow:         rgba(245, 242, 237, .7);
    --c-tooltip:      var(--charcoal);
    --c-tooltip-text: #fff;

    /* Diagramme (charts.js): eine Akzentfarbe, Plus/Minus für Salden, Heatmap-Stufen */
    --chart-1:     var(--cobalt);
    --chart-pos:   #0E8A5F;
    --chart-neg:   #D23B3B;
    --chart-grid:  rgba(29, 34, 43, .08);
    --chart-zero:  rgba(29, 34, 43, .35);
    --chart-empty: #E6E2DB;
    --chart-area-pos: rgba(14, 138, 95, .14);
    --chart-area-neg: rgba(210, 59, 59, .14);
    --hm-1: #C9D8F6; --hm-2: #8AAEEE; --hm-3: #4C80E6; --hm-4: #1250DC;

    --focus-ring: 0 0 0 3px rgba(92, 155, 242, .45);
    --font: 'Inter', 'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}


/* ── Dunkelmodus (data-theme="dark", gesetzt von theme.js) ── */
:root[data-theme="dark"] {
    --c-bg:       #1A1D23;
    --c-surface:  #1E2229;
    --c-raised:   #232830;
    --c-sunken:   #171A1F;

    --c-text:   #D9DCE1;
    --c-dark:   var(--c-ink);
    --c-mid:    #7FAEFF;
    --c-muted:  #8C929C;
    --c-ink:    #F0F1F3;
    --c-accent-text: #7FAEFF;
    --c-pos:    #3CC48F;
    --c-neg:    #FF6B6B;
    --c-warn:   #E9A23B;
    --c-pos-text:  #5ED6A5;
    --c-neg-text:  #FF8A8A;
    --c-pos-bg:    rgba(60, 196, 143, .15);
    --c-neg-bg:    rgba(255, 107, 107, .15);
    --c-neg-grad:  linear-gradient(145deg, #C94040 0%, #A82C2C 60%, #8F2222 100%);
    --c-warn-text: #F0B75E;
    --c-border: rgba(255, 255, 255, .06);
    --c-placeholder: #636973;
    --c-divider:      rgba(255, 255, 255, .08);
    --c-hover:        rgba(127, 174, 255, .06);
    --c-hover-strong: rgba(255, 255, 255, .07);
    --c-band:         #1F242B;
    --c-row-filled:   #1D2A40;
    --c-scrim:        rgba(10, 12, 15, .55);
    --c-glow:         rgba(30, 34, 41, .7);
    --c-tooltip:      #F0F1F3;
    --c-tooltip-text: #1A1D23;

    --chart-1:     #7FAEFF;
    --chart-pos:   #3CC48F;
    --chart-neg:   #FF6B6B;
    --chart-grid:  rgba(255, 255, 255, .07);
    --chart-zero:  rgba(255, 255, 255, .35);
    --chart-empty: #262B33;
    --chart-area-pos: rgba(60, 196, 143, .16);
    --chart-area-neg: rgba(255, 107, 107, .16);
    --hm-1: #1F3358; --hm-2: #2D5299; --hm-3: #4E7FD6; --hm-4: #8DB6FF;

    --sh-dark:   rgba(0, 0, 0, .45);
    --sh-light:  rgba(255, 255, 255, .035);
    --shadow-inset:  inset 3px 3px 7px rgba(0, 0, 0, .45), inset -2px -2px 6px rgba(255, 255, 255, .03);
    --shadow-press:  inset 2px 2px 6px rgba(0, 0, 0, .5), inset -2px -2px 5px rgba(255, 255, 255, .03);
    --shadow-cobalt: 0 8px 20px rgba(18, 80, 220, .35), -3px -3px 8px rgba(255, 255, 255, .03);
    --shadow-float:  0 24px 60px rgba(0, 0, 0, .55);
    --focus-ring: 0 0 0 3px rgba(127, 174, 255, .45);
}

html { -webkit-text-size-adjust: 100%; background-color: var(--c-bg); }
/* Kein Doppeltipp-Zoom bei schnellem Tippen (Pinch-Zoom bleibt möglich) */
* { touch-action: manipulation; }

body {
    font-family: var(--font);
    background: var(--c-bg);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 16px;
    color: var(--c-text);
    -webkit-font-smoothing: antialiased;
    line-height: 1.4;
}

h1, h2, h3, h4 { color: var(--c-ink); font-weight: 600; letter-spacing: -.01em; }
strong { color: var(--c-ink); font-weight: 600; }
::selection { background: rgba(92, 155, 242, .3); }

.container { width: 100%; max-width: 1024px; flex: 1; display: flex; flex-direction: column; gap: 28px; }
.container--wide { max-width: none; }

.main-card {
    background: var(--c-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 30px;
    position: relative;
}

.hidden { display: none !important; }

/* ── Header ─────────────────────────────────────────────── */
.app-header { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; flex-wrap: wrap; }
.app-header .tally { width: 44px; height: 44px; flex: none; }
.app-title {
    font-size: 1.35rem; font-weight: 600; color: var(--c-ink); flex: 1; min-width: 150px;
    letter-spacing: .06em; text-transform: uppercase;
}
.app-title small {
    display: block; font-size: .68rem; font-weight: 500; color: var(--c-muted);
    letter-spacing: .28em; margin-top: 4px;
}

.mode-badge {
    background: var(--c-raised); color: var(--c-accent-text); box-shadow: var(--shadow-small);
    padding: 6px 14px; border-radius: 999px; font-size: .78rem; font-weight: 600; letter-spacing: .02em;
}
.mode-badge--normal { display: none; }

/* ── Buttons ────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    border: none; cursor: pointer; font-weight: 500; font-size: .95rem; font-family: inherit;
    border-radius: 999px; padding: 11px 22px; transition: box-shadow .2s ease, transform .15s ease, filter .2s ease;
    background: var(--c-raised); color: var(--c-ink);
    box-shadow: var(--shadow-raised);
    -webkit-tap-highlight-color: transparent;
}
.btn:hover { filter: brightness(1.01); box-shadow: 6px 6px 14px var(--sh-dark), -6px -6px 14px var(--sh-light); }
.btn:active { box-shadow: var(--shadow-press); transform: scale(.985); }
.btn:focus-visible { outline: none; box-shadow: var(--shadow-raised), var(--focus-ring); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn--primary { background: var(--c-accent-grad); color: #fff; font-weight: 600; box-shadow: var(--shadow-cobalt); }
.btn--primary:hover { filter: brightness(1.07); box-shadow: 0 10px 22px rgba(18, 80, 220, .38), -4px -4px 10px var(--sh-light); }
.btn--primary:active { box-shadow: inset 2px 2px 6px rgba(0, 20, 80, .35); }
.btn--primary:disabled { box-shadow: var(--shadow-small); }
.btn--danger { color: var(--c-neg); }
.btn--ghost { background: transparent; box-shadow: none; color: var(--c-accent-text); }
.btn--ghost:hover { box-shadow: var(--shadow-small); }
.btn--sm { padding: 7px 14px; font-size: .82rem; box-shadow: var(--shadow-small); }
.btn--block { width: 100%; }
.btn--big { padding: 16px 24px; font-size: 1.05rem; }

/* ── Login / PIN-Pad ───────────────────────────────────── */
.login-card { width: 100%; max-width: 420px; margin: 7vh auto 0; text-align: center; padding: 36px 30px; }
.login-card h1 { color: var(--c-ink); font-size: 1.5rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 8px; }
.login-card p { color: var(--c-muted); font-size: .72rem; letter-spacing: .22em; text-transform: uppercase; margin-bottom: 24px; }


.pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; max-width: 290px; margin: 0 auto; }
.pin-key {
    font-size: 1.45rem; font-weight: 500; color: var(--c-ink); font-family: inherit;
    background: var(--c-raised); border: none; box-shadow: var(--shadow-raised);
    border-radius: 20px; padding: 16px 0; cursor: pointer; transition: all .12s;
    -webkit-tap-highlight-color: transparent; user-select: none;
}
.pin-key:active { box-shadow: var(--shadow-press); color: var(--c-accent-text); transform: scale(.97); }
.pin-key--action { font-size: 1rem; color: var(--c-muted); }
.pin-key--ok { background: var(--c-accent-grad); color: #fff; box-shadow: var(--shadow-cobalt); }
.pin-key--ok:active { color: #fff; box-shadow: inset 2px 2px 6px rgba(0, 20, 80, .35); }

/* ── Messages / Toast ──────────────────────────────────── */
.message {
    border-radius: var(--radius); padding: 13px 18px 13px 42px; font-weight: 500; margin-bottom: 18px; font-size: .9rem;
    background: var(--c-raised); box-shadow: var(--shadow-small); position: relative; text-align: left; color: var(--c-ink);
}
.message::before {
    content: ''; position: absolute; left: 16px; top: 50%; width: 12px; height: 12px; margin-top: -6px;
    border-radius: 50%; background: var(--cobalt);
}
.message--error::before { background: var(--c-neg); }
.message--success::before { background: var(--c-pos); }
.message--info::before { background: var(--cobalt); }

#toast {
    position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
    background: var(--c-raised); color: var(--c-ink); padding: 14px 22px 14px 48px; border-radius: 20px;
    box-shadow: var(--shadow-float);
    font-weight: 500; z-index: 1000; max-width: 92vw; text-align: left;
    animation: toastIn .25s ease;
}
#toast::before {
    content: ''; position: absolute; left: 16px; top: 50%; width: 20px; height: 20px; margin-top: -10px;
    border-radius: 50%; background: var(--cobalt); box-shadow: 0 0 0 5px rgba(18, 80, 220, .12);
}
#toast.toast--success::before { background: var(--c-pos); box-shadow: 0 0 0 5px rgba(14, 138, 95, .14); }
#toast.toast--error::before { background: var(--c-neg); box-shadow: 0 0 0 5px rgba(210, 59, 59, .14); }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 12px); } }

/* ── Schritte (Kiosk) ──────────────────────────────────── */
.progress-steps { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 28px; flex-wrap: wrap; }
.step-circle {
    flex: none; width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: .9rem; background: var(--c-sunken); color: var(--c-muted);
    box-shadow: var(--shadow-inset); transition: all .3s;
}
.step-circle.active { background: var(--c-accent-grad); color: #fff; box-shadow: 0 5px 12px rgba(18, 80, 220, .35); }
.step-line { flex: 0 1 auto; min-width: 14px; width: 42px; height: 6px; background: var(--c-sunken); border-radius: 999px; box-shadow: var(--shadow-inset); }
.step-label { flex: none; white-space: nowrap; font-size: .7rem; color: var(--c-muted); margin-left: 2px; font-weight: 500; text-transform: uppercase; letter-spacing: .16em; }

.step-header { display: flex; align-items: center; justify-content: center; position: relative; margin-bottom: 22px; min-height: 40px; }
.step-title { font-size: 1rem; font-weight: 500; color: var(--c-ink); text-align: center; text-transform: uppercase; letter-spacing: .18em; }
.back-nav {
    position: absolute; left: 0; display: inline-flex; align-items: center; gap: 4px;
    background: var(--c-raised); border: none; color: var(--c-accent-text); font-weight: 500; cursor: pointer; font-size: .85rem;
    font-family: inherit; padding: 8px 14px 8px 10px; border-radius: 999px; box-shadow: var(--shadow-small);
}
.back-nav:active { box-shadow: var(--shadow-press); }
.back-nav svg { width: 18px; height: 18px; }

/* ── Karten-Grids ──────────────────────────────────────── */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 18px; }

.select-card {
    background: var(--c-raised); border: none; border-radius: 20px; box-shadow: var(--shadow-raised);
    padding: 18px 12px; text-align: center; cursor: pointer; transition: all .18s;
    -webkit-tap-highlight-color: transparent; user-select: none; position: relative;
}
.select-card:hover { transform: translateY(-2px); box-shadow: 8px 8px 18px var(--sh-dark), -8px -8px 18px var(--sh-light); }
.select-card:active { transform: none; box-shadow: var(--shadow-press); }
.select-card h3 { font-size: 1rem; font-weight: 600; color: var(--c-ink); }
.select-card .sub { font-size: .78rem; color: var(--c-muted); margin-top: 4px; }
.select-card .lock { position: absolute; top: 9px; right: 11px; font-size: .8rem; }

/* ── Produktliste ──────────────────────────────────────── */
.product-row {
    display: flex; align-items: center; gap: 12px; background: var(--c-raised);
    border: none; border-radius: 20px; box-shadow: var(--shadow-raised); padding: 14px 18px; margin-bottom: 14px;
    transition: box-shadow .2s;
}
.product-row.product-row--disabled { opacity: .45; }
.product-row.product-row--active { box-shadow: var(--shadow-raised), inset 0 0 0 2px rgba(92, 155, 242, .55); }
.product-info { flex: 1; min-width: 0; }
.product-info h4 { color: var(--c-ink); font-size: .98rem; font-weight: 600; }
.product-info .price { color: var(--c-accent-text); font-weight: 600; font-size: .9rem; }
.product-info .price .old { color: var(--c-muted); text-decoration: line-through; font-weight: 400; margin-right: 6px; }
.product-info .bemerkung { font-size: .75rem; color: var(--c-muted); }

.qty-controls { display: flex; align-items: center; gap: 12px; }
.qty-btn {
    width: 42px; height: 42px; border-radius: 50%; border: none; font-size: 1.3rem; font-weight: 500; font-family: inherit;
    background: var(--c-raised); color: var(--c-ink); cursor: pointer; transition: all .12s;
    box-shadow: var(--shadow-small);
    display: flex; align-items: center; justify-content: center;
    -webkit-tap-highlight-color: transparent;
}
.qty-btn:active { transform: scale(.94); box-shadow: var(--shadow-press); }
.qty-btn--plus { background: var(--c-accent-grad); color: #fff; box-shadow: 0 5px 12px rgba(18, 80, 220, .32); }
.qty-btn--plus:active { box-shadow: inset 2px 2px 5px rgba(0, 20, 80, .35); }
.qty-value { min-width: 26px; text-align: center; font-weight: 600; font-size: 1.1rem; color: var(--c-ink); }

.total-bar {
    display: flex; justify-content: space-between; align-items: center;
    background: var(--c-sunken); box-shadow: var(--shadow-inset); border-radius: 999px; padding: 14px 22px; margin: 18px 0;
    font-weight: 600; color: var(--c-ink); font-size: 1.1rem;
}

.comment-input, .form-input, .form-select {
    width: 100%; border: none; border-radius: 16px; padding: 12px 16px;
    font-size: .95rem; font-family: inherit; color: var(--c-text); background: var(--c-sunken);
    box-shadow: var(--shadow-inset);
    margin-bottom: 14px; transition: box-shadow .15s;
}
.comment-input::placeholder, .form-input::placeholder { color: var(--c-placeholder); }
.comment-input:focus, .form-input:focus, .form-select:focus { outline: none; box-shadow: var(--shadow-inset), var(--focus-ring); }
.form-select {
    -webkit-appearance: none; appearance: none; padding-right: 40px; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%237A7F88' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 16px center;
}
textarea.form-input, textarea.comment-input { resize: vertical; }
input[type="date"].form-input, input[type="datetime-local"].form-input { min-height: 45px; }

/* ── Saldo-Anzeigen ────────────────────────────────────── */
.balance-pill { font-weight: 600; }
.balance--pos { color: var(--c-pos); }
.balance--neg { color: var(--c-neg); }
.balance--zero { color: var(--c-muted); }
/* Saldo auf Personenkarten (Kiosk): farbige Pille, schlägt die graue .sub-Schrift */
.select-card .balance-pill { display: inline-block; padding: 3px 12px; border-radius: 999px; font-size: .88rem; font-weight: 700; margin-top: 6px; }
.select-card .balance-pill.balance--pos { color: var(--c-pos-text); background: var(--c-pos-bg); }
.select-card .balance-pill.balance--neg { color: var(--c-neg-text); background: var(--c-neg-bg); }
.select-card .balance-pill.balance--zero { color: var(--c-muted); background: var(--c-hover-strong); }

.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 18px; margin-bottom: 24px; }
.stat-card {
    background: var(--c-raised); border: none; box-shadow: var(--shadow-raised);
    border-radius: 20px; padding: 18px 16px; text-align: center;
}
.stat-card .value { font-size: 1.5rem; font-weight: 700; color: var(--c-ink); letter-spacing: -.01em; }
.stat-card .label { font-size: .66rem; color: var(--c-muted); font-weight: 500; text-transform: uppercase; letter-spacing: .18em; margin-top: 6px; }

/* ── Historie / Tabellen ───────────────────────────────── */
.history-item {
    display: flex; justify-content: space-between; align-items: center; gap: 10px;
    padding: 12px 4px; border-bottom: 1px solid var(--c-border); font-size: .9rem;
}
.history-item:last-child { border-bottom: none; }
.history-item__main { min-width: 0; flex: 1; }
.history-item__amounts { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.history-item .running { font-size: .75rem; white-space: nowrap; opacity: .85; }
.history-item .who { font-weight: 600; color: var(--c-ink); overflow-wrap: anywhere; }
.history-item .what { color: var(--c-muted); font-size: .82rem; }
.history-item .amount { font-weight: 600; white-space: nowrap; }

.table-wrap {
    overflow-x: auto; background: var(--c-raised); border-radius: 20px; box-shadow: var(--shadow-raised);
    padding: 6px 8px; margin-bottom: 6px;
}
table.data-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.data-table th {
    text-align: left; padding: 12px 10px; color: var(--c-muted); font-size: .66rem; font-weight: 500;
    text-transform: uppercase; letter-spacing: .16em; border-bottom: 1px solid var(--c-border);
    white-space: nowrap;
}
.data-table td { padding: 11px 10px; border-bottom: 1px solid var(--c-border); vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--c-hover); }
.data-table .num { text-align: right; white-space: nowrap; }

.tag { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .7rem; font-weight: 600; letter-spacing: .02em; }
.tag--kauf { background: rgba(18, 80, 220, .1); color: var(--c-accent-text); }
.tag--zahlung { background: rgba(14, 138, 95, .12); color: var(--c-pos-text); }
.tag--korrektur { background: rgba(199, 122, 18, .13); color: var(--c-warn-text); }
.tag--inactive { background: var(--c-hover-strong); color: var(--c-muted); }
.tag--pin { background: rgba(92, 155, 242, .18); color: var(--c-accent-text); }


.section-title {
    color: var(--c-ink); font-size: .82rem; font-weight: 500; text-transform: uppercase; letter-spacing: .2em;
    margin: 4px 0 18px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px;
}
.section-title .btn, .section-title small, .section-title span { text-transform: none; letter-spacing: normal; }

.filter-bar { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.filter-bar .form-input, .filter-bar .form-select { width: auto; flex: 1; min-width: 130px; margin-bottom: 0; }

/* ── Ninox-Import ──────────────────────────────────────── */
.ninox-intro { font-size: .85rem; color: var(--c-muted); margin-bottom: 16px; max-width: 760px; line-height: 1.55; }
.ninox-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.ninox-advanced { margin-bottom: 14px; font-size: .85rem; color: var(--c-muted); }
.ninox-advanced summary { cursor: pointer; font-weight: 500; margin-bottom: 8px; color: var(--c-accent-text); }
.ninox-when { font-size: .75rem; font-weight: 400; color: var(--c-muted); }
.ninox-diffs { margin: 6px 0 6px 18px; }
.ninox-actions { margin-top: 20px; }
.data-table .form-select { margin-bottom: 0; padding: 7px 34px 7px 12px; min-width: 180px; background-position: right 12px center; }

/* ── Umbuchungen ─────────────────────────────────────── */
.transfer-grid { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: end; }
.transfer-grid .form-select { margin-bottom: 14px; }
.transfer-arrow { font-size: 1.4rem; color: var(--c-accent-text); padding-bottom: 22px; }
.stat-card--total { box-shadow: var(--shadow-raised), inset 0 0 0 2px rgba(92, 155, 242, .45); }
.row--cancelled td { color: var(--c-muted); text-decoration: line-through; }
.row--cancelled td:last-child { text-decoration: none; }

/* ── Analoge Strichliste ────────────────────────────────── */
.tally-head { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.tally-wrap { max-height: 65vh; overflow: auto; border-radius: 20px; background: var(--c-raised); box-shadow: var(--shadow-raised); }
.tally-table thead th { position: sticky; top: 0; background: var(--c-raised); z-index: 3; }
.tally-table thead tr:first-child th { height: 40px; box-sizing: border-box; }
.tally-table thead tr.tally-prices th { top: 40px; background: var(--c-band); text-transform: none; letter-spacing: 0; font-weight: 500; }
.tally-table td, .tally-table th { padding: 6px 7px; }
.tally-table .tally-name { position: sticky; left: 0; background: var(--c-raised); z-index: 1; min-width: 130px; text-transform: none;
    letter-spacing: 0; font-size: .88rem; font-weight: 500; color: var(--c-ink); border-bottom: 1px solid var(--c-border); }
.tally-table .tally-name small { display: block; font-size: .72rem; font-weight: 600; }
.tally-table .tally-prod { text-align: center; }
.tally-reg td { background: var(--c-band); font-weight: 500; font-size: .68rem; color: var(--c-accent-text);
    text-transform: uppercase; letter-spacing: .16em; }
.tally-input { width: 58px; padding: 7px; border: none; border-radius: 10px; text-align: center;
    font-size: .95rem; font-family: inherit; background: var(--c-sunken); box-shadow: var(--shadow-inset); color: var(--c-text); }
.tally-input--money { width: 72px; }
.tally-input:focus { outline: none; box-shadow: var(--shadow-inset), var(--focus-ring); }
.tally-rowsum { font-weight: 600; color: var(--c-ink); min-width: 70px; }
tr.row--filled td, tr.row--filled th { background: var(--c-row-filled); }
tr.row--inactive .tally-name { color: var(--c-muted); }
.tally-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 18px; }

/* ── Kiosk: Favorit, Schnellbuchung, Bestätigung ───────── */
.kiosk-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.person-card { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.quick-book {
    margin-top: 10px; border: none; border-radius: 999px; padding: 8px 10px; width: 100%; font-family: inherit;
    background: var(--c-accent-grad); color: #fff; font-weight: 600; font-size: .8rem; cursor: pointer;
    box-shadow: 0 4px 10px rgba(18, 80, 220, .3);
    -webkit-tap-highlight-color: transparent;
}
.quick-book:active { transform: scale(.96); box-shadow: inset 2px 2px 5px rgba(0, 20, 80, .35); }
.fav-badge { display: inline-block; background: rgba(18, 80, 220, .1); color: var(--c-accent-text); border-radius: 999px;
    padding: 2px 9px; font-size: .68rem; font-weight: 600; vertical-align: middle; margin-left: 4px; }
.product-row--fav { box-shadow: var(--shadow-raised), inset 3px 0 0 var(--sky); }
.fav-line { margin-top: 12px; font-size: .85rem; color: var(--c-muted); }

.confirm-overlay {
    position: fixed; inset: 0; z-index: 800; background: var(--c-scrim); backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex; align-items: center; justify-content: center; padding: 16px; animation: modalIn .15s ease;
}
.confirm-box { background: var(--c-surface); border-radius: var(--radius-lg); padding: 28px; width: 100%; max-width: 370px; text-align: center;
    box-shadow: var(--shadow-float); }
.confirm-label { font-size: .68rem; text-transform: uppercase; letter-spacing: .22em; color: var(--c-muted); font-weight: 500; }
.confirm-name { font-size: 1.45rem; font-weight: 700; color: var(--c-ink); margin-top: 4px; }
.confirm-items { color: var(--c-muted); margin: 6px 0; }
.confirm-amount { font-size: 2rem; font-weight: 700; color: var(--c-ink); margin-bottom: 16px; }
.confirm-bar { height: 12px; background: var(--c-sunken); box-shadow: var(--shadow-inset); border-radius: 999px; overflow: hidden; margin-bottom: 18px; padding: 2px; }
.confirm-bar div { height: 100%; width: 100%; background: var(--c-accent-grad); border-radius: 999px; }

/* ── Historie nach Tagen ────────────────────────────────── */
.history-summary { background: var(--c-sunken); box-shadow: var(--shadow-inset); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 16px; font-size: .9rem; }
.history-summary .fav-line { margin-top: 4px; }
.history-day { margin-bottom: 12px; }
.history-day__head { display: flex; justify-content: space-between; gap: 10px; padding: 10px 4px 6px;
    border-bottom: 1px solid var(--c-divider); color: var(--c-ink); font-size: .75rem; font-weight: 500;
    text-transform: uppercase; letter-spacing: .12em; }
.ranking small { color: var(--c-muted); font-weight: 400; margin-left: 6px; font-size: .75rem; }
.history-item--void .who, .history-item--void .amount { opacity: .55; text-decoration: line-through; }
.month-balance { background: var(--c-sunken); box-shadow: var(--shadow-inset); border-radius: var(--radius); padding: 12px 16px; margin: 18px 0 10px; }
.month-balance__title { font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .14em; color: var(--c-ink); margin-bottom: 8px; }
.month-balance__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px 14px; }
.month-balance__grid div { display: flex; flex-direction: column; }
.month-balance__grid span { font-size: .68rem; color: var(--c-muted); text-transform: uppercase; letter-spacing: .1em; }
.month-balance__grid strong { font-size: .95rem; }

/* ── Admin: Personenkonto & Live ────────────────────────── */
.modal.modal--wide { max-width: 860px; }
.person-link { color: inherit; text-decoration: none; border-bottom: 1px dashed var(--c-accent-text); cursor: pointer; }
.person-link:hover { color: var(--c-accent-text); border-bottom-style: solid; }
.account-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 16px; }
.account-sub { font-size: .82rem; color: var(--c-muted); }
.account-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.account-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; align-items: end;
    background: var(--c-raised); box-shadow: var(--shadow-raised); border-radius: 20px; padding: 16px; margin-bottom: 16px; }
.account-form .form-input, .account-form .form-select { margin-bottom: 0; }
.live-banner { background: var(--c-raised); box-shadow: var(--shadow-small); color: var(--c-ink); border-radius: var(--radius);
    padding: 10px 14px 10px 36px; margin-bottom: 18px; position: relative;
    font-size: .88rem; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.live-banner::before { content: ''; position: absolute; left: 14px; top: 50%; width: 10px; height: 10px; margin-top: -5px;
    border-radius: 50%; background: var(--c-warn); }

/* ── Modal ─────────────────────────────────────────────── */
.overlay {
    position: fixed; inset: 0; background: var(--c-scrim); z-index: 500;
    display: flex; align-items: center; justify-content: center; padding: 16px;
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.modal {
    background: var(--c-surface); border-radius: var(--radius-lg); padding: 28px; width: 100%; max-width: 460px;
    max-height: 88vh; overflow-y: auto;
    box-shadow: var(--shadow-float);
    animation: modalIn .2s ease;
}
@keyframes modalIn { from { opacity: 0; transform: scale(.96); } }
.modal h3 { color: var(--c-ink); margin-bottom: 18px; font-size: .85rem; font-weight: 500; text-transform: uppercase; letter-spacing: .18em; }
.form-label { display: block; font-size: .66rem; font-weight: 500; color: var(--c-muted); margin: 0 0 6px 6px; text-transform: uppercase; letter-spacing: .16em; }
.modal-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 10px; flex-wrap: wrap; }

/* Checkbox im Soft-Stil: eingedrückt, angehakt kobaltblau */
.checkbox-row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; font-size: .9rem; cursor: pointer; }
input[type="checkbox"] {
    -webkit-appearance: none; appearance: none; flex: none; cursor: pointer;
    width: 22px; height: 22px; border-radius: 7px; margin: 0;
    background: var(--c-raised); box-shadow: var(--shadow-small); transition: all .15s;
    vertical-align: middle;
}
input[type="checkbox"]:checked {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M2.5 7.5l3 3 6-7' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"), var(--c-accent-grad);
    background-size: 14px 14px, 100% 100%; background-position: center; background-repeat: no-repeat;
    box-shadow: 0 3px 8px rgba(18, 80, 220, .35);
}
input[type="checkbox"]:focus-visible { outline: none; box-shadow: var(--shadow-small), var(--focus-ring); }
input[type="checkbox"]:disabled { opacity: .5; cursor: not-allowed; }
input[type="radio"] { accent-color: var(--c-accent-text); }

/* ── Mitglieder-Ansicht ────────────────────────────────── */
#view-member { width: 100%; max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; gap: 26px; }
#view-member .main-card { padding: 26px; }
#view-member .app-header { margin-bottom: 8px; }

.member-balance { position: relative; text-align: center; padding: 20px 0 8px; }
.member-balance__label { position: relative; z-index: 1; font-size: .7rem; font-weight: 500; text-transform: uppercase; letter-spacing: .24em; color: var(--c-muted); }
.member-balance__value { font-size: 2.8rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; margin-top: 4px; position: relative; z-index: 1; }
.member-balance__sub { color: var(--c-muted); font-size: .88rem; margin-top: 4px; position: relative; z-index: 1; }
.member-balance__anim { position: absolute; inset: -30px 0 -20px; margin: 0 auto; max-width: 300px; pointer-events: none; z-index: 0; opacity: .85; }

.score-row { display: flex; align-items: center; gap: 18px; }
.score-value {
    font-size: 1.9rem; font-weight: 700; flex: none; width: 76px; height: 76px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--c-raised); box-shadow: var(--shadow-raised);
}
.score-body { flex: 1; min-width: 0; }
.score-meta { font-size: .78rem; color: var(--c-muted); }
.score-bar-track { background: var(--c-sunken); box-shadow: var(--shadow-inset); height: 14px; border-radius: 999px; overflow: hidden; margin: 10px 0 8px; padding: 3px; }
.score-bar-fill { height: 100%; border-radius: 999px; transition: width .6s ease; }

.scroll-list { max-height: 420px; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.empty-hint { color: var(--c-muted); font-size: .9rem; text-align: center; padding: 14px 0; }
.loading-card { text-align: center; color: var(--c-muted); }
.lottie-loading { width: 120px; height: 60px; margin: 0 auto 6px; }

/* ── Bezahlen (Mitglied & Kiosk) ───────────────────────── */
.pay-buttons { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 20px; }
.pay-buttons:empty { display: none; }
.pay-buttons .btn { flex: 1; min-width: 150px; white-space: nowrap; }
a.btn { text-decoration: none; }

.saldo-box {
    display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap;
    background: var(--c-sunken); box-shadow: var(--shadow-inset); color: var(--c-ink); border-radius: var(--radius); padding: 12px 18px;
    margin-bottom: 18px; font-weight: 500; font-size: .92rem; text-align: center;
}

.pay-tabs { display: flex; gap: 6px; background: var(--c-sunken); box-shadow: var(--shadow-inset); padding: 5px; border-radius: 999px; margin-bottom: 18px; }
.pay-tab {
    flex: 1; border: none; background: transparent; padding: 9px 10px; border-radius: 999px; font-family: inherit;
    font-weight: 500; font-size: .9rem; color: var(--c-muted); cursor: pointer; transition: all .15s;
}
.pay-tab.active { background: var(--c-raised); color: var(--c-accent-text); font-weight: 600; box-shadow: var(--shadow-small); }
.pay-amount { display: flex; align-items: center; gap: 10px; }
.pay-amount .form-input { margin-bottom: 0; font-size: 1.1rem; font-weight: 600; }
.pay-amount span { font-weight: 600; color: var(--c-ink); }
.pay-details { font-size: .85rem; text-align: center; color: var(--c-muted); line-height: 1.55; }
.pay-details strong { color: var(--c-ink); }
.pay-details .hint { display: inline-block; margin-top: 6px; font-size: .78rem; }

.qr-holder { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 16px 0 6px; }
.qr-holder canvas { border-radius: 18px; border: 10px solid #fff; box-shadow: var(--shadow-raised); max-width: 100%; height: auto; }

/* ── Lottie-Overlay (Erfolg nach Buchung) ──────────────── */
.lottie-overlay {
    position: fixed; inset: 0; z-index: 900; pointer-events: none;
    display: flex; align-items: center; justify-content: center;
    background: radial-gradient(circle, var(--c-glow) 0%, transparent 60%);
    transition: opacity .25s ease;
}
.lottie-overlay--out { opacity: 0; }
.lottie-overlay__anim { width: min(220px, 50vw); height: min(220px, 50vw); }

/* ── Chart (Statistik, reine CSS-Balken) ───────────────── */
.bar-chart {
    display: flex; align-items: flex-end; gap: 5px; height: 140px; margin: 12px 0;
    background: var(--c-sunken); box-shadow: var(--shadow-inset); border-radius: var(--radius); padding: 14px 14px 10px;
}
.bar-chart .bar { flex: 1; background: linear-gradient(180deg, var(--sky), var(--cobalt)); border-radius: 999px 999px 4px 4px; min-height: 2px; position: relative; }
.bar-chart .bar:hover { filter: brightness(1.1); }
.bar-chart .bar:hover::after {
    content: attr(data-tip); position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%);
    background: var(--c-tooltip); color: var(--c-tooltip-text); font-size: .68rem; padding: 4px 9px; border-radius: 999px;
    white-space: nowrap; margin-bottom: 6px; z-index: 5;
}

.list-simple { list-style: none; }
.list-simple li { display: flex; justify-content: space-between; gap: 10px; padding: 9px 2px; border-bottom: 1px solid var(--c-border); font-size: .9rem; }
.list-simple li:last-child { border: none; }
.list-simple .rank { color: var(--c-muted); margin-right: 8px; }

/* ── Icons (Lordicon, assets/js/icons.js) ──────────────── */
.ic { display: inline-block; width: 1.2em; height: 1.2em; vertical-align: -.25em; fill: currentColor; flex: none; }
.ic--muted { color: var(--c-muted); }
.ic--pos { color: var(--c-pos); }
.ic--neg { color: var(--c-neg); }
.btn .ic, .pay-tab .ic { margin-right: 2px; }
.reminder-icon .ic { width: 2.6rem; height: 2.6rem; }
.made-with { margin-top: 8px; }
.made-with__heart { color: var(--c-neg); vertical-align: -.2em; }

/* ── Footer ────────────────────────────────────────────── */
.app-footer { text-align: center; color: var(--c-muted); font-size: .66rem; letter-spacing: .22em; text-transform: uppercase; padding: 22px 0 6px; }
.app-footer button { background: none; border: none; color: var(--c-accent-text); cursor: pointer; font: inherit; letter-spacing: inherit; text-transform: inherit; }
.app-footer button:hover { text-decoration: underline; }

/* Scrollbalken dezent */
.scroll-list, .table-wrap, .tally-wrap, .modal { scrollbar-width: thin; scrollbar-color: var(--mist) transparent; }

@media (max-width: 640px) {
    body { padding: 14px 12px; }
    .container { gap: 22px; }
    .kiosk-actions .btn span { display: none; }
    .main-card { padding: 20px; border-radius: 22px; }
    .grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 14px; }
    .app-title { font-size: 1.05rem; }
    .stat-cards { grid-template-columns: repeat(2, 1fr); gap: 14px; }
    #view-member .main-card { padding: 20px; }
    .member-balance__value { font-size: 2.3rem; }
    .product-row { padding: 12px 14px; }
    .qty-controls { gap: 8px; }
    .step-label { display: none; }
    .step-line { width: 30px; }
    .modal { padding: 22px; }
    /* Login am Handy ohne Karte: Logo oben, Tastenfeld unten in Daumennähe */
    #view-login.login-card {
        flex: 1; display: flex; flex-direction: column; margin: 0; max-width: none;
        background: transparent; box-shadow: none; border: none; border-radius: 0; padding: 5vh 2px 4px;
    }
    .login-card .pin-pad { margin-top: auto; width: 100%; }
    .login-tally { width: 120px; height: 120px; }
    .pin-pad { max-width: none; gap: 14px; }
    .pin-key { font-size: 1.75rem; padding: 22px 0; }
}

@media (prefers-reduced-motion: reduce) {
    .select-card:hover { transform: none; }
    .modal, .confirm-overlay, #toast { animation: none; }
}

/* ── Zahlungserinnerung (Kiosk-Banner, Mahnliste) und Admin-Hinweise ── */
.reminder-box { background: var(--c-neg-grad); color: #fff; }
.reminder-box .confirm-label, .reminder-box .confirm-name, .reminder-box .confirm-amount.balance--neg { color: #fff; }
.reminder-box .confirm-label { opacity: .85; }
.reminder-icon { font-size: 2.2rem; line-height: 1; margin-bottom: 8px; }
.reminder-text { font-size: .9rem; line-height: 1.45; margin: 0 0 16px; opacity: .95; }
.reminder-bar { background: rgba(255, 255, 255, .22); box-shadow: none; }
.reminder-bar div { background: #fff; }
.reminder-hint { flex-basis: 100%; color: var(--c-neg-text); font-size: .85rem; font-weight: 600; }
.reminder-link-row { display: flex; justify-content: center; margin: -8px 0 18px; }
.reminder-count { display: inline-block; min-width: 20px; padding: 1px 7px; margin-left: 4px; border-radius: 999px;
    background: var(--c-neg); color: #fff; font-size: .72rem; font-weight: 700; }
.reminder-list li { cursor: pointer; }
.reminder-list small { color: var(--c-muted); margin-left: 6px; }
.person-search-input { margin-bottom: 12px; }
.person-search-list li { cursor: pointer; align-items: center; }
.person-search-list small { color: var(--c-muted); margin-left: 6px; }
.person-search-list .lock { color: var(--c-muted); margin-left: 4px; }
.reminder-pay { margin-left: 6px; }
.hint { color: var(--c-muted); font-size: .85rem; }
.admin-notice { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.admin-notice a { color: inherit; text-decoration: underline; }


/* Saldo-Farben auch in Kennzahl-Kacheln */
.stat-card .value.balance--neg { color: var(--c-neg); }
.stat-card .value.balance--pos { color: var(--c-pos); }

/* ── Diagramme (charts.js) ─────────────────────────────── */
.chart { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); min-width: 0; grid-template-rows: var(--h, 200px) auto; column-gap: 8px; margin: 6px 0 18px; }
.chart-yaxis { position: relative; min-width: 44px; font-size: .68rem; color: var(--c-muted); }
.chart-yaxis span { position: absolute; right: 0; transform: translateY(50%); white-space: nowrap; font-variant-numeric: tabular-nums; }
.chart-plot { position: relative; min-width: 0; }
.chart-plot svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.chart-grid { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid var(--chart-grid); }
.chart-grid--zero { border-top-color: var(--chart-zero); }
.chart-xaxis { grid-column: 2; position: relative; height: 22px; font-size: .68rem; color: var(--c-muted); }
.chart-xaxis span { position: absolute; top: 6px; transform: translateX(-50%); white-space: nowrap; }
.chart-xaxis--bars { display: flex; gap: 2px; }
.chart-xaxis--bars span { position: static; transform: none; flex: 1 1 0; min-width: 0; text-align: center; white-space: nowrap; }
.chart-bars { position: absolute; inset: 0; display: flex; align-items: flex-end; gap: 2px; }
.chart-bar-slot { flex: 1 1 0; height: 100%; display: flex; align-items: flex-end; min-width: 0; }
.chart-bar { width: 100%; max-width: 38px; margin: 0 auto; background: var(--chart-1); border-radius: 4px 4px 0 0; }
.chart-bar-slot:hover .chart-bar { filter: brightness(1.15); }
.chart-line { fill: none; stroke-width: 2px; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.chart-line--main { stroke: var(--chart-1); }
.chart-line--pos { stroke: var(--chart-pos); }
.chart-line--neg { stroke: var(--chart-neg); }
.chart-area { stroke: none; }
.chart-area--pos { fill: var(--chart-area-pos); }
.chart-area--neg { fill: var(--chart-area-neg); }
.chart-cross { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1px dashed var(--chart-zero); opacity: 0; pointer-events: none; }
.chart-dot { position: absolute; width: 10px; height: 10px; margin: 0 0 -5px -5px; border-radius: 50%; background: var(--chart-1);
    box-shadow: 0 0 0 2px var(--c-surface); opacity: 0; pointer-events: none; }
.chart-dot--pos { background: var(--chart-pos); }
.chart-dot--neg { background: var(--chart-neg); }
.chart--line .chart-plot { cursor: crosshair; touch-action: pan-y; }
.chart-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: .78rem; color: var(--c-text); margin: 4px 0 2px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-key { display: inline-block; width: 14px; height: 3px; border-radius: 2px; background: var(--chart-1); flex: none; }
.chart-key--pos { background: var(--chart-pos); }
.chart-key--neg { background: var(--chart-neg); }
.chart-empty { padding: 26px 10px; text-align: center; color: var(--c-muted); font-size: .85rem; }
.chart-tip { position: fixed; z-index: 3000; pointer-events: none; background: var(--c-tooltip); color: var(--c-tooltip-text);
    font-size: .76rem; padding: 7px 10px; border-radius: 10px; box-shadow: 0 6px 18px rgba(0, 0, 0, .22); max-width: 260px; line-height: 1.4; }
.chart-tip[hidden] { display: none; }
.chart-tip__head { font-weight: 600; margin-bottom: 2px; }
.chart-tip__row { display: flex; align-items: center; gap: 6px; justify-content: space-between; }
.chart-tip__row strong { margin-left: auto; font-variant-numeric: tabular-nums; }

.hbars { display: flex; flex-direction: column; gap: 9px; margin: 6px 0 16px; }
.hbar { display: grid; grid-template-columns: minmax(90px, 34%) 1fr auto; gap: 10px; align-items: center; font-size: .84rem; }
.hbar__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--c-text); }
.hbar__label small { color: var(--c-muted); margin-left: 6px; font-size: .72rem; }
.hbar__track { height: 10px; border-radius: 999px; background: var(--chart-empty); overflow: hidden; }
.hbar__fill { height: 100%; border-radius: 999px; background: var(--chart-1); }
.hbar__value { font-weight: 600; color: var(--c-ink); font-variant-numeric: tabular-nums; white-space: nowrap; }

.hm-cell { display: block; border-radius: 3px; background: var(--chart-empty); aspect-ratio: 1; }
.hm-l1 { background: var(--hm-1); } .hm-l2 { background: var(--hm-2); } .hm-l3 { background: var(--hm-3); } .hm-l4 { background: var(--hm-4); }
.hm-none { background: transparent; }
.heatmap { display: grid; grid-template-columns: 26px repeat(var(--cols), minmax(0, 1fr)); gap: 3px; align-items: center; max-width: 720px; margin: 6px 0 8px; }
.heatmap__hour, .heatmap__wd { font-size: .64rem; color: var(--c-muted); text-align: center; }
.heatmap__wd { text-align: left; }
.heat-legend { display: flex; align-items: center; gap: 4px; font-size: .68rem; color: var(--c-muted); justify-content: flex-end; margin-bottom: 16px; }
.heat-legend .hm-cell { width: 11px; height: 11px; }
.cal-scroll { overflow-x: auto; padding-bottom: 4px; }
.cal { display: grid; grid-template-columns: 22px auto; grid-template-rows: auto auto; gap: 3px 4px; min-width: max-content; }
.cal-months { grid-column: 2; display: grid; grid-template-columns: repeat(53, 12px); column-gap: 3px; font-size: .64rem; color: var(--c-muted); height: 14px; }
.cal-months span { white-space: nowrap; }
.cal-wd { display: grid; grid-template-rows: repeat(7, 12px); row-gap: 3px; font-size: .6rem; color: var(--c-muted); line-height: 12px; }
.cal-grid { display: grid; grid-template-columns: repeat(53, 12px); column-gap: 3px; }
.cal-week { display: grid; grid-template-rows: repeat(7, 12px); row-gap: 3px; }
.cal-week .hm-cell { width: 12px; height: 12px; aspect-ratio: auto; border-radius: 2px; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 0 28px; }
.stats-controls { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.stats-controls .form-select { width: auto; min-width: 180px; margin-bottom: 0; }
.stats-controls .pay-tabs { margin-bottom: 0; }
.stat-card .trend { display: block; font-size: .72rem; font-weight: 600; margin-top: 4px; letter-spacing: 0; text-transform: none; }
.trend--up { color: var(--c-pos); }
.trend--down { color: var(--c-neg); }
.section-sub { font-size: .8rem; color: var(--c-muted); margin: -6px 0 10px; }
.loading-hint { color: var(--c-muted); }

/* ── Sortieren & Filtern (table.js) ── */
.table-tools { display: flex; gap: 10px 14px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.table-tools .table-search { width: auto; flex: 1 1 220px; max-width: 360px; margin-bottom: 0; }
.table-count { font-size: .78rem; color: var(--c-muted); margin-left: auto; }
.chip-row { display: flex; gap: 6px; flex-wrap: wrap; }
.th-sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.th-sortable::after { content: '↕'; margin-left: 5px; opacity: .3; font-size: .85em; }
.th-sortable[data-sort-dir="asc"]::after { content: '↑'; opacity: .9; }
.th-sortable[data-sort-dir="desc"]::after { content: '↓'; opacity: .9; }
.th-sortable:hover { color: var(--c-ink); }
.chip { border: none; font: inherit; font-size: .76rem; padding: 6px 13px; border-radius: 999px; cursor: pointer;
    background: var(--c-raised); color: var(--c-muted); box-shadow: var(--shadow-small); }
.chip.active { color: var(--c-accent-text); font-weight: 600; box-shadow: var(--shadow-press); background: var(--c-sunken); }
.chart-bar { border-radius: 999px 999px 4px 4px; }
.acc-chart { margin: 4px 0 14px; }
.acc-chart summary { cursor: pointer; list-style-position: inside; margin-bottom: 8px; }
.chart-title { font-size: .7rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--c-muted); margin: 14px 0 6px; }
.heatmap .hm-cell { aspect-ratio: auto; height: 18px; }

/* ── Getränkewünsche (wishes.js, Kiosk/Mitglied/Admin) ── */
.wish-strip {
    display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 22px; padding: 12px 18px;
    border: none; border-radius: var(--radius); background: var(--c-sunken); box-shadow: var(--shadow-inset);
    font-family: inherit; color: var(--c-text); cursor: pointer; text-align: left;
}
.wish-strip:hover { box-shadow: var(--shadow-inset), var(--focus-ring); }
.wish-strip__label { font-size: .7rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--c-accent-text); white-space: nowrap; }
.wish-strip__items { display: flex; flex-wrap: wrap; gap: 6px 14px; flex: 1; font-size: .9rem; }
.wish-strip__item b { color: var(--c-accent-text); margin-left: 2px; }
.wish-strip__more { font-size: .8rem; color: var(--c-muted); white-space: nowrap; }
.wish-row { display: flex; justify-content: center; margin: -6px 0 16px; }
.wish-count, .nav-badge { display: inline-block; min-width: 20px; padding: 1px 7px; margin-left: 4px; border-radius: 999px;
    background: var(--c-row-filled); color: var(--c-accent-text); font-size: .72rem; font-weight: 700; }
.nav-badge { background: var(--cobalt); color: #fff; }
.nav-badge.hidden { display: none; }
.wish-mine { background: var(--c-sunken); box-shadow: var(--shadow-inset); border-radius: var(--radius); padding: 12px 16px; margin: 12px 0 18px; }
.wish-mine__head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wish-mine__head .form-label { margin: 0; flex: 1; }
.wish-mine__head small { color: var(--c-muted); }
.wish-dots { display: inline-flex; gap: 4px; }
.wish-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--c-raised); box-shadow: var(--shadow-small); }
.wish-dot--used { background: var(--cobalt); box-shadow: none; }
.wish-list .wish-item { align-items: center; }
.wish-item__actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.wish-item--done span { color: var(--c-muted); }
.wish-item--mine > span { font-weight: 600; color: var(--c-ink); }
.wish-votes { color: var(--c-muted); font-size: .85rem; white-space: nowrap; }
.wish-vote {
    border: none; border-radius: 999px; padding: 6px 12px; min-width: 64px; font-family: inherit; font-weight: 600; font-size: .85rem;
    background: var(--c-raised); color: var(--c-text); box-shadow: var(--shadow-small); cursor: pointer; white-space: nowrap;
}
.wish-vote--on { background: var(--c-accent-grad); color: #fff; box-shadow: var(--shadow-cobalt); }
.wish-new { display: flex; gap: 10px; align-items: center; }
.wish-new .form-input { margin-bottom: 0; flex: 1; }
.wish-suggest { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; font-size: .85rem; color: var(--c-muted); }
.wish-section { font-size: .7rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--c-muted); margin: 20px 0 6px; }
.tag--wish { background: var(--c-row-filled); color: var(--c-accent-text); }
.tag--next { background: var(--c-neg-bg); color: var(--c-neg-text); }
.wish-details summary { cursor: pointer; }
.wish-history { list-style: none; margin: 8px 0 2px; font-size: .8rem; color: var(--c-text); }
.wish-history li { padding: 3px 0; }
.wish-history--ended { color: var(--c-muted); }
.wish-actions { white-space: nowrap; }
.wish-actions .btn { margin: 2px 0 2px 4px; }
@media (max-width: 520px) {
    .wish-strip { flex-direction: column; align-items: flex-start; gap: 6px; }
    .wish-new { flex-direction: column; align-items: stretch; }
    .wish-item__actions .btn { font-size: .75rem; }
}
.wish-summary { margin-bottom: 12px; line-height: 1.5; }

/* ── Admin-Seitenleiste ────────────────────────────────── */
.admin-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px; align-items: start; }
#view-admin.admin--collapsed .admin-layout { grid-template-columns: 70px minmax(0, 1fr); }
.admin-nav {
    display: flex; flex-direction: column; gap: 4px; position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto;
    padding: 12px 10px; background: var(--c-sunken); box-shadow: var(--shadow-inset); border-radius: var(--radius-lg);
}
.admin-nav button {
    display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; position: relative;
    border: none; background: transparent; color: var(--c-muted); font: inherit; font-size: .9rem; font-weight: 500;
    padding: 10px 14px; border-radius: 999px; cursor: pointer; white-space: nowrap; transition: color .15s, background .15s, box-shadow .15s;
}
.admin-nav button .ic { margin: 0; font-size: 1.05rem; }
.admin-nav button:hover { color: var(--c-ink); }
.admin-nav button.active { color: var(--c-accent-text); font-weight: 600; background: var(--c-raised); box-shadow: var(--shadow-small); }
.admin-nav .nav-badge { margin-left: auto; }
.admin-nav__group { margin: 12px 14px 4px; font-size: .66rem; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--c-muted); white-space: nowrap; }
.admin-nav__bottom { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--c-divider); }
#view-admin.admin--collapsed .admin-nav__group { font-size: 0; height: 1px; margin: 8px 10px; background: var(--c-divider); }
.admin-nav__toggle .ic { transform: rotate(180deg); transition: transform .2s; }
#view-admin.admin--collapsed .admin-nav__toggle .ic { transform: none; }
#view-admin.admin--collapsed .admin-nav__label { display: none; }
#view-admin.admin--collapsed .admin-nav button { justify-content: center; padding: 10px 0; }
#view-admin.admin--collapsed .admin-nav .nav-badge { position: absolute; top: 0; right: 0; margin: 0; min-width: 18px; padding: 0 5px; font-size: .62rem; }
.admin-menu-btn { display: none; }
.admin-scrim { display: none; }
.admin-main { min-width: 0; }

@media (max-width: 860px) {
    .admin-layout, #view-admin.admin--collapsed .admin-layout { display: block; }
    .admin-menu-btn {
        display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; flex: none;
        border: none; border-radius: 999px; background: var(--c-raised); box-shadow: var(--shadow-small);
        color: var(--c-ink); font-size: 1.15rem; cursor: pointer;
    }
    .admin-menu-btn .ic { margin: 0; }
    .admin-nav {
        position: fixed; top: 0; bottom: 0; left: 0; z-index: 600; width: min(270px, 82vw); max-height: none; margin: 0; border: none; border-radius: 0;
        padding: max(18px, env(safe-area-inset-top)) 14px 18px; background: var(--c-surface); box-shadow: var(--shadow-card);
        transform: translateX(-105%); transition: transform .22s ease;
    }
    #view-admin.admin--nav-open .admin-nav { transform: none; }
    #view-admin.admin--nav-open .admin-scrim { display: block; position: fixed; inset: 0; z-index: 590; background: var(--c-scrim); }
    /* Am Handy immer mit Beschriftung, Einklappen gibt es dort nicht */
    #view-admin.admin--collapsed .admin-nav__label { display: inline; }
    #view-admin.admin--collapsed .admin-nav button { justify-content: flex-start; padding: 10px 14px; }
    #view-admin.admin--collapsed .admin-nav .nav-badge { position: static; margin-left: auto; }
    .admin-nav__toggle { display: none !important; }
    #view-admin.admin--collapsed .admin-nav__group { font-size: .66rem; height: auto; margin: 12px 14px 4px; background: none; }
}
@media (prefers-reduced-motion: reduce) { .admin-nav { transition: none; } }

/* ── Hinweis „Neue Version verfügbar" (live.js) ─────────── */
.update-banner {
    position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 900;
    display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 18px; border-radius: 999px;
    background: var(--c-raised); color: var(--c-ink); box-shadow: var(--shadow-raised); font-size: .9rem; white-space: nowrap;
}

/* ── Logo als animierbare Strichliste (tally.js) ────────── */
.tally { display: block; width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-linecap: round; color: var(--c-ink); }
.tally__frame { stroke-width: 26; }
/* Unsichtbare Striche zusätzlich ausblenden: Safari zeichnet sonst die runden Enden
   des leeren Strichs als Punkte. Beim Wegnehmen erst zurückziehen, dann ausblenden. */
.tally__s { stroke-width: 38; stroke-dasharray: 1; stroke-dashoffset: 1; opacity: 0; transition: stroke-dashoffset .22s ease-out, opacity 0s linear .22s; }
.tally__s.on { stroke-dashoffset: 0; opacity: 1; transition: stroke-dashoffset .22s ease-out, opacity 0s; }
.tally--shake { animation: tallyShake .4s ease; }
@keyframes tallyShake {
    20% { transform: translateX(-9px); } 40% { transform: translateX(8px); }
    60% { transform: translateX(-5px); } 80% { transform: translateX(3px); }
}
.login-tally { width: 104px; height: 104px; margin: 0 auto 18px; flex: none; }
/* Ladeanimation: Striche werden in Schleife gezählt */
.tally--loop .tally__s { transition: none; animation: tallyCount 2.4s ease-in-out infinite; animation-delay: calc(var(--i) * .2s); }
@keyframes tallyCount {
    0% { stroke-dashoffset: 1; opacity: 0; } 1% { opacity: 1; } 12%, 70% { stroke-dashoffset: 0; }
    85% { stroke-dashoffset: 1; opacity: 1; } 86%, 100% { stroke-dashoffset: 1; opacity: 0; }
}
.tally-loader { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 28px 0; color: var(--c-muted); }
.tally-loader .tally { width: 56px; height: 56px; }
/* Bestätigung nach Buchung */
.tally-overlay {
    position: fixed; inset: 0; z-index: 900; pointer-events: none;
    display: flex; align-items: center; justify-content: center;
    background: radial-gradient(circle, var(--c-glow) 0%, transparent 60%);
    transition: opacity .3s ease;
}
.tally-overlay--out { opacity: 0; }
.tally--celebrate { width: min(200px, 46vw); height: min(200px, 46vw); color: var(--c-accent-text); animation: tallyPop .35s ease-out; }
.tally--celebrate .tally__s { transition-duration: .16s; }
@keyframes tallyPop { from { transform: scale(.85); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
    .tally__s { transition: none; }
    .tally--shake { animation: none; }
    .tally--loop .tally__s { animation: none; stroke-dashoffset: 0; opacity: 1; }
}
