/* Admin area – tablet-first, works down to ~375px. */
:root {
    --bg: #0f1218;
    --surface: #171b23;
    --surface-2: #1f2530;
    --border: #2b3240;
    --text: #eef1f6;
    --muted: #8d97a8;
    --primary: #ffb000;
    --primary-text: #1a1300;
    --up: #1fd67a;
    --down: #ff4d5e;
    --danger: #e0364a;
    --radius: 12px;
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

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

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    line-height: 1.45;
}

a { color: var(--primary); }
code { background: var(--surface-2); padding: 0 4px; border-radius: 4px; word-break: break-all; }
h1, h2, h3 { margin: 0 0 12px; line-height: 1.2; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1rem; margin-top: 16px; }

.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 0.9rem; margin: 8px 0 0; }
.text-up { color: var(--up); }
.text-down { color: var(--down); }
.nowrap { white-space: nowrap; }
.inline { display: inline; }

/* --- header / nav ------------------------------------------------------- */
.admin-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
    padding: 10px 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}
.admin-header__brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.admin-header__logo { color: var(--primary); font-weight: 900; letter-spacing: -2px; }
.admin-header__title { font-weight: 700; font-size: 1.1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.market-pill {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 999px;
    white-space: nowrap;
}
.market-pill--open { background: color-mix(in srgb, var(--up) 20%, transparent); color: var(--up); }
.market-pill--closed { background: var(--surface-2); color: var(--muted); }

.admin-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    overflow-x: auto;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}
.admin-nav__link {
    padding: 10px 14px;
    border-radius: 8px;
    color: var(--text);
    text-decoration: none;
    white-space: nowrap;
    font-weight: 600;
}
.admin-nav__link:hover { background: var(--surface-2); }
.admin-nav__link[data-active="True"] { background: var(--primary); color: var(--primary-text); }
.admin-nav__link--external { color: var(--muted); }
.admin-nav__logout { margin-left: 8px; }

.admin-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px;
    display: grid;
    gap: 16px;
}

/* --- building blocks ---------------------------------------------------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    min-width: 0;
}
.card__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card__head h1 { margin: 0; }

.alert { padding: 12px 14px; border-radius: 8px; font-weight: 600; }
.alert[hidden] { display: none; }
.alert--success { background: color-mix(in srgb, var(--up) 18%, var(--surface)); color: var(--up); }
.alert--info { background: var(--surface-2); color: inherit; font-weight: 400; }
.alert--error { background: color-mix(in srgb, var(--down) 18%, var(--surface)); color: #ffc2c8; }
.validation-summary.validation-summary-valid { display: none; }
.validation-summary ul { margin: 0; padding-left: 18px; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 44px;
    padding: 8px 18px;
    border: 1px solid transparent;
    border-radius: 8px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    color: var(--text);
    background: var(--surface-2);
}
.btn:disabled { opacity: 0.35; cursor: default; }
.btn--primary { background: var(--primary); color: var(--primary-text); }
.btn--danger { background: var(--danger); color: #fff; }
.btn--ghost { background: transparent; border-color: var(--border); }
.btn--small { min-height: 36px; padding: 4px 12px; font-size: 0.9rem; }
.btn--large { min-height: 56px; padding: 12px 28px; font-size: 1.1rem; }
.btn--block { width: 100%; }
.btn--icon { min-height: 36px; width: 36px; padding: 0; }
.btn[hidden] { display: none; }

/* --- forms -------------------------------------------------------------- */
.form { display: grid; gap: 14px; }
.form > .btn { justify-self: start; }
.form-row { display: flex; flex-wrap: wrap; gap: 12px; }
.form-row > .field { flex: 1 1 180px; }
.field { display: grid; gap: 4px; min-width: 0; }
.field--narrow { flex: 0 1 160px !important; max-width: 100%; }
.field__label { font-size: 0.85rem; color: var(--muted); font-weight: 600; }
.input {
    width: 100%;
    min-height: 44px;
    padding: 8px 12px;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    font: inherit;
}
.input:focus { outline: 2px solid var(--primary); outline-offset: 1px; }
.input--code { font-family: Consolas, Menlo, monospace; font-size: 0.9rem; resize: vertical; }
.input--pin { font-size: 1.8rem; letter-spacing: 0.4em; text-align: center; }
.input-validation-error { border-color: var(--down); }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.form-actions--sticky { position: sticky; bottom: 0; padding: 12px 0; background: linear-gradient(transparent, var(--bg) 40%); }

.setting {
    display: grid;
    grid-template-columns: minmax(0, 280px) minmax(0, 1fr);
    gap: 8px 20px;
    align-items: center;
    padding: 12px 0;
    border-top: 1px solid var(--border);
}
.setting:first-of-type { border-top: 0; }
.setting__help { margin: 0; color: var(--muted); font-size: 0.9rem; }
@media (max-width: 640px) {
    .setting { grid-template-columns: 1fr; }
}

.design-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; margin-top: 12px; }
.design-option { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.design-option:has(input:checked) { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 8%, transparent); }
.design-option input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--primary); flex: none; }
.design-option__body { display: grid; gap: 4px; min-width: 0; }
.design-option__link { font-size: .85rem; word-break: break-all; }

.drink-cell { display: inline-flex; align-items: center; gap: 10px; }
.drink-thumb { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; flex: none; }
.image-picker { border: 0; padding: 0; margin: 0; display: grid; gap: 10px; min-width: 0; }
.image-picker__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; }
.image-option { position: relative; display: grid; place-items: center; aspect-ratio: 1; border: 2px solid transparent; border-radius: 14px; cursor: pointer; }
.image-option input { position: absolute; opacity: 0; pointer-events: none; }
.image-option img { width: 100%; height: 100%; object-fit: cover; border-radius: 12px; }
.image-option__none { font-size: .8rem; color: var(--muted); text-align: center; }
.image-option:has(input:checked) { border-color: var(--primary); }
.image-option:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }

.check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.check input[type="checkbox"] { width: 24px; height: 24px; margin: 2px 0 0; accent-color: var(--primary); flex: none; }
.market-pill--demo { background: color-mix(in srgb, var(--primary) 22%, transparent); color: var(--primary); }

.login-card { max-width: 380px; width: 100%; margin: 8vh auto 0; }

/* --- tables ------------------------------------------------------------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.table th, .table td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.table th { color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tfoot th { color: var(--text); font-size: 0.95rem; }
.row--inactive td { opacity: 0.45; }
.row--inactive td:last-child, .row--inactive td:nth-last-child(2) { opacity: 1; }
.row--voided td { text-decoration: line-through; color: var(--muted); }
.row--voided td:last-child { text-decoration: none; }

.link-list { display: grid; gap: 8px; padding-left: 18px; }

.kpis { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface-2); border-radius: var(--radius); padding: 12px 18px; display: grid; min-width: 160px; }
.kpi__value { font-size: 1.6rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.kpi__label { color: var(--muted); font-size: 0.85rem; }

.crash-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.crash-list__item { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; background: var(--surface-2); border-radius: 8px; }

/* --- till (Verkauf) ---------------------------------------------------- */
/* Wide screens: tiles + fixed receipt column. Narrow: tiles + dock at the bottom, the receipt
   column becomes a pull-up sheet and the receipt confirmation a card above the dock.
   Nothing is inserted into the flow, so tapping never moves the tiles. */
.admin-main--till { max-width: none; padding-top: 12px; padding-bottom: 12px; }
.till { --panel-w: 380px; display: grid; grid-template-columns: minmax(0, 1fr) var(--panel-w); gap: 16px; align-items: start; }
.till__tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; align-content: start; }

.tile {
    position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 46px;
    min-height: 124px; background: var(--surface-2); border: 2px solid transparent; border-radius: var(--radius);
    touch-action: manipulation; user-select: none; transition: transform .08s, border-color .2s;
}
.tile:has(.tile__add:active) { transform: scale(.97); }
.tile.in-cart { border-color: var(--primary); }
.tile.is-crashed { box-shadow: 0 0 0 2px var(--down); }
.tile__add {
    display: grid; grid-template-rows: 1fr auto; gap: 8px; min-width: 0;
    padding: 14px 4px 14px 14px; border: 0; background: transparent; color: var(--text);
    font: inherit; text-align: left; cursor: pointer;
}
/* Picture above the name, so the name gets the full tile width; a word longer than the tile (German compounds) breaks too. */
.tile__head { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; }
.tile__img { width: 42px; height: 42px; border-radius: 10px; flex: none; }
.tile__name { font-weight: 700; font-size: 1.05rem; line-height: 1.2; overflow-wrap: anywhere; hyphens: auto; min-width: 0; }
.tile__price-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 6px; min-width: 0; }
.tile__price { font-size: 1.5rem; font-weight: 800; color: var(--primary); font-variant-numeric: tabular-nums; transition: color 1.2s; }
.tile__price.tick-up { color: var(--up); transition: none; }
.tile__price.tick-down { color: var(--down); transition: none; }
.tile__trend { font-size: .85rem; }
.tile__trend.up { color: var(--up); }
.tile__trend.down { color: var(--down); }
.tile__side { display: grid; grid-template-rows: auto 1fr auto; justify-items: center; padding: 10px 8px 10px 0; }
.tile__badge {
    grid-row: 1; min-width: 32px; height: 32px; padding: 0 8px; display: grid; place-items: center;
    border-radius: 999px; background: var(--primary); color: var(--primary-text); font-weight: 900;
    font-variant-numeric: tabular-nums; transform: scale(0); transition: transform .15s;
}
.tile.in-cart .tile__badge { transform: scale(1); }
.tile__badge.bump { animation: bump .25s; }
@keyframes bump { 50% { transform: scale(1.35); } }
.tile__minus {
    grid-row: 3; width: 40px; height: 44px; border-radius: 10px; border: 1px solid var(--border);
    background: var(--surface); color: var(--text); font: inherit; font-size: 1.5rem; font-weight: 900; line-height: 1; cursor: pointer;
    visibility: hidden; opacity: 0; transition: opacity .15s;
}
.tile.in-cart .tile__minus { visibility: visible; opacity: 1; }
.tile__minus:active { background: var(--border); }

/* receipt column */
.till__panel {
    position: sticky; top: calc(var(--header-h, 64px) + 12px);
    height: calc(100dvh - var(--header-h, 64px) - 24px);
    display: grid; grid-template-rows: auto minmax(0, 1fr) auto;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
}
.till__grip { display: none; }
.till__tabs { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--border); }
.till__tabs button { min-height: 48px; border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 700; cursor: pointer; border-bottom: 3px solid transparent; }
.till__tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--primary); }
.till__body { min-height: 0; overflow-y: auto; padding: 14px; }
.till__foot { display: grid; gap: 10px; padding: 14px; border-top: 1px solid var(--border); }
.till__sum { display: flex; justify-content: space-between; align-items: baseline; }
.till__sum b { font-size: 1.8rem; }

.checkout {
    width: 100%; min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 0 20px; border: 0; border-radius: 12px; background: var(--primary); color: var(--primary-text);
    font: inherit; font-size: 1.25rem; font-weight: 900; cursor: pointer;
}
.checkout:disabled { background: var(--surface-2); color: var(--muted); cursor: default; }
.checkout.is-busy { opacity: .6; }

.empty { display: grid; place-items: center; gap: 6px; height: 100%; padding: 30px 10px; text-align: center; color: var(--muted); }
.empty__icon { font-size: 2.2rem; }

.lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.line { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; padding: 10px 12px; background: var(--surface-2); border-radius: 10px; }
.line__name { font-weight: 700; overflow-wrap: break-word; }
.line__sub { font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
.line__meta { color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; }
.line__note { grid-column: 1 / -1; color: var(--primary); font-size: .8rem; }
.stepper { display: flex; align-items: center; gap: 4px; justify-self: end; }
.stepper button { width: 40px; height: 40px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: 1.3rem; font-weight: 800; cursor: pointer; touch-action: manipulation; }
.stepper span { min-width: 28px; text-align: center; font-weight: 800; font-size: 1.1rem; font-variant-numeric: tabular-nums; }

.receipt { display: grid; gap: 10px; align-content: start; }
.receipt__ok { color: var(--up); font-weight: 800; font-size: 1.05rem; }
.receipt__ok--voided { color: var(--muted); }
.receipt__total { font-size: 2.6rem; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; }
.receipt__total--voided { text-decoration: line-through; opacity: .5; }
.receipt__rows { display: grid; gap: 4px; font-size: .95rem; font-variant-numeric: tabular-nums; }
.receipt__rows div { display: flex; justify-content: space-between; gap: 10px; }
.receipt__rows .is-adjusted { color: var(--primary); }
.receipt__note { color: var(--primary); font-weight: 700; font-size: .9rem; }
.receipt__actions { display: flex; flex-wrap: wrap; gap: 8px; }

.history { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.history li { display: grid; gap: 4px; padding: 10px 12px; background: var(--surface-2); border-radius: 10px; }
.history li.is-voided { opacity: .55; }
.history li.is-voided .history__total { text-decoration: line-through; }
.history__head { display: flex; justify-content: space-between; gap: 10px; font-weight: 800; }
.history__total { font-variant-numeric: tabular-nums; }
.history__actions { display: flex; justify-content: flex-end; }

/* phone-only parts, hidden on wide screens */
.till__dock, .till__scrim, .till__toast { display: none; }

/* floating messages: fixed, so they never push content */
.till__error {
    position: fixed; left: 50%; top: calc(var(--header-h, 64px) + 12px); transform: translateX(-50%); z-index: 40;
    max-width: calc(100% - 32px); padding: 12px 16px; border-radius: 10px;
    background: color-mix(in srgb, var(--down) 25%, var(--surface)); border: 1px solid var(--down); color: #ffd4d9; font-weight: 700;
    box-shadow: 0 10px 30px #0008;
}
.till__offline { position: fixed; right: 12px; top: calc(var(--header-h, 64px) + 12px); z-index: 30; padding: 6px 12px; border-radius: 8px; background: var(--down); color: #fff; font-size: .85rem; font-weight: 700; }
.till__error[hidden], .till__offline[hidden] { display: none; }

@media (max-width: 900px) {
    .till { grid-template-columns: minmax(0, 1fr); }
    .till__tiles { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; padding-bottom: 110px; }
    .tile { min-height: 108px; }
    .tile__add { padding: 12px 2px 12px 12px; }
    .tile__price { font-size: 1.25rem; }
    .tile__img { width: 36px; height: 36px; }

    .till__dock {
        position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); z-index: 20;
        display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px;
        padding: 8px 8px 8px 6px; border-radius: 18px; background: #232a36f2; backdrop-filter: blur(10px); box-shadow: 0 10px 30px #0009;
    }
    .till__dock-info { display: grid; justify-items: start; gap: 2px; min-height: 52px; padding: 4px 10px; border: 0; background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
    .till__dock-info b { font-size: 1.3rem; }
    .checkout--dock { width: auto; min-height: 56px; font-size: 1.05rem; }

    .till__scrim { display: block; position: fixed; inset: 0; z-index: 25; background: #0009; opacity: 0; pointer-events: none; transition: opacity .25s; }
    .till__scrim.open { opacity: 1; pointer-events: auto; }
    .till__panel {
        position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 30; height: auto; max-height: 82dvh;
        grid-template-rows: auto auto minmax(0, 1fr) auto;
        border-radius: 22px 22px 0 0; border-bottom: 0; padding-bottom: env(safe-area-inset-bottom, 0px);
        transform: translateY(105%); transition: transform .28s cubic-bezier(.2, .8, .2, 1);
    }
    .till__panel.open { transform: translateY(0); }
    .till__grip { display: block; width: 100%; height: 26px; border: 0; background: transparent; cursor: pointer; position: relative; }
    .till__grip::after { content: ""; position: absolute; left: 50%; top: 10px; width: 44px; height: 5px; margin-left: -22px; border-radius: 3px; background: var(--border); }

    .till__toast {
        display: block; position: fixed; left: 10px; right: 10px; z-index: 22;
        bottom: calc(104px + env(safe-area-inset-bottom, 0px)); max-height: 55dvh; overflow-y: auto; padding: 14px 16px;
        background: var(--surface); border: 2px solid var(--up); border-radius: 18px; box-shadow: 0 12px 34px #000a;
        opacity: 0; transform: translateY(14px); pointer-events: none; transition: opacity .2s, transform .2s;
    }
    .till__toast.open { opacity: 1; transform: translateY(0); pointer-events: auto; }
    .till__toast.is-voided { border-color: var(--border); }
    .till__toast .receipt__total { font-size: 2rem; }
    .till__toast-close { position: absolute; top: 8px; right: 8px; width: 40px; height: 40px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-size: 1.3rem; cursor: pointer; }
}

@media (max-width: 480px) {
    .admin-main { padding: 12px; }
    .till__tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
}
/* --- outlet choice (/app) ----------------------------------------------- */
.outlet-list { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 8px; }
.outlet-list__link { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; padding: 12px 14px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); color: var(--text); text-decoration: none; }
.outlet-list__link:hover { border-color: var(--primary); }
.outlet-list__link .muted { grid-column: 1; font-size: 0.85rem; }
.outlet-list__link .market-pill { grid-column: 2; grid-row: 1 / 3; }

/* --- header: outlet switcher, market switch, account menu ---------------- */
.outlet-switch, .user-menu { position: relative; }
.outlet-switch > summary, .user-menu > summary { list-style: none; cursor: pointer; }
.outlet-switch > summary::-webkit-details-marker, .user-menu > summary::-webkit-details-marker { display: none; }
.outlet-switch > summary { display: grid; padding: 2px 8px; border-radius: 8px; line-height: 1.2; }
.outlet-switch > summary:hover { background: var(--surface-2); }
.outlet-switch small { color: var(--muted); font-size: 0.72rem; }
.outlet-switch span { font-weight: 700; font-size: 1.05rem; white-space: nowrap; }
.menu { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; min-width: 220px; margin: 0; padding: 6px; list-style: none;
    background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 16px 40px #0008; }
.menu--right { left: auto; right: 0; }
.menu a, .menu button { display: block; width: 100%; padding: 9px 10px; border: 0; border-radius: 7px; background: none; color: var(--text);
    font: inherit; text-align: left; text-decoration: none; cursor: pointer; }
.menu a:hover, .menu button:hover { background: var(--border); }
.menu a[aria-current="page"] { color: var(--primary); }
.menu__label { margin: 0; padding: 6px 10px 4px; font-size: 0.75rem; color: var(--muted); }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--surface-2);
    font-weight: 800; font-size: 0.8rem; }

.market-switch { margin: 0; }
.switch { display: inline-flex; align-items: center; gap: 8px; padding: 4px 6px; border: 0; border-radius: 8px; background: none;
    color: var(--muted); font: 700 0.85rem/1 inherit; font-family: inherit; cursor: pointer; white-space: nowrap; }
.switch:hover { background: var(--surface-2); }
.switch__track { position: relative; width: 38px; height: 22px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--border); }
.switch__track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: transform 0.2s; }
.switch[aria-checked="true"] { color: var(--up); }
.switch[aria-checked="true"] .switch__track { background: color-mix(in srgb, var(--up) 30%, transparent); border-color: var(--up); }
.switch[aria-checked="true"] .switch__track::after { transform: translateX(16px); background: var(--up); }

/* --- toasts and the unsaved-changes bar: overlays, never shift the page --- */
.toasts { position: fixed; z-index: 50; left: 50%; bottom: 20px; transform: translateX(-50%); display: grid; gap: 8px;
    width: min(440px, calc(100vw - 24px)); pointer-events: none; }
.toast { padding: 12px 16px; border-radius: 12px; background: var(--text); color: var(--bg); font-weight: 600;
    box-shadow: 0 12px 30px #0009; pointer-events: auto; animation: toast-in 0.25s ease-out; transition: opacity 0.3s, transform 0.3s; }
.toast--error { background: var(--danger); color: #fff; }
.toast--out { opacity: 0; transform: translateY(10px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }
.unsaved { position: fixed; z-index: 40; left: 50%; bottom: 20px; display: flex; align-items: center; gap: 8px; padding: 10px 12px 10px 16px;
    border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); box-shadow: 0 16px 40px #000a;
    transform: translate(-50%, 160%); visibility: hidden; transition: transform 0.25s ease-out, visibility 0.25s; }
.unsaved span { font-weight: 700; margin-right: 6px; }
.unsaved--show { transform: translate(-50%, 0); visibility: visible; }
.unsaved--show ~ .toasts, .toasts:has(~ .unsaved--show) { bottom: 84px; }

/* --- settings: areas with their own page and form ------------------------ */
.settings { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 20px; align-items: start; }
.settings__nav { position: sticky; top: 76px; display: grid; gap: 2px; }
.settings__nav a { padding: 8px 10px; border-radius: 8px; color: var(--text); text-decoration: none; font-weight: 600; }
.settings__nav a:hover { background: var(--surface); }
.settings__nav a[aria-current="page"] { background: var(--surface-2); color: var(--primary); }
.settings__group { padding: 12px 10px 4px; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
@media (max-width: 760px) {
    .settings { grid-template-columns: minmax(0, 1fr); }
    .settings__nav { position: static; display: flex; overflow-x: auto; gap: 4px; }
    .settings__group { display: none; }
    .settings__nav a { white-space: nowrap; background: var(--surface); }
}
.presets { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-bottom: 14px; }
.preset { display: grid; gap: 4px; padding: 12px 14px; border-radius: var(--radius); border: 2px solid var(--border); background: var(--surface-2);
    color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.preset span { font-size: 0.82rem; color: var(--muted); }
.preset[aria-pressed="true"], .preset--custom { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 8%, var(--surface-2)); }
.preset--custom { cursor: default; }
.expert { margin: 6px 0 4px; }
.expert > summary { cursor: pointer; font-weight: 700; padding: 8px 0; }
[hidden] { display: none !important; }
.inline-form { display: flex; gap: 6px; align-items: center; margin-left: auto; }
.inline-form .input { width: auto; }

/* --- till: PIN pad and current person ------------------------------------ */
.pinpad__keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.pinpad__key { height: 56px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
    font: 700 1.4rem/1 inherit; font-family: inherit; cursor: pointer; touch-action: manipulation; /* "1122": no double-tap zoom */ }
.pinpad__key:active { background: var(--border); }
.till-person { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 0 0 8px; font-size: 0.9rem; color: var(--muted); }
.till-person strong { color: var(--text); }

/* Team */
.input--small { min-height: 36px; padding: 4px 10px; font-size: 0.9rem; }
.input--pin-small { width: 90px !important; }
.table td .inline-form { margin-left: 0; }
.rights-table .center { text-align: center; }
.rights-table td.center { color: var(--up); font-weight: 700; }

/* Screens */
.card--highlight { border-color: var(--primary); }
.copy-field { display: flex; gap: 8px; }
.copy-field .input { flex: 1; min-width: 0; }
.inline-form--start { margin-left: 0; flex-wrap: wrap; }
.screen-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 0; border-top: 1px solid var(--border); }
.screen-row__status { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); flex: none; }
.screen-row__status.is-online { background: var(--up); box-shadow: 0 0 0 4px color-mix(in srgb, var(--up) 25%, transparent); }
.screen-row__form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.screen-row__form .input { width: auto; }
.screen-row__seen { font-size: 0.85rem; }
.screen-row__actions { display: flex; gap: 6px; margin-left: auto; }

/* ===================== Drinks page v2 ===================== */
:root { --crash: #ff3b5c; --info: #4db4ff; --surface-3: #2a3140; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.page-head h1 { margin: 0; }
.page-head .grow { flex: 1; }
.search-input { width: 220px; }
.tabs { display: flex; gap: 4px; margin: 0 0 14px; border-bottom: 1px solid var(--border); }
.tabs a { padding: 10px 16px; color: var(--muted); font-weight: 700; text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a[aria-current="page"] { color: var(--text); border-color: var(--primary); }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 99px; background: var(--surface-2);
    border: 1px solid var(--border); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.03em; color: var(--muted); white-space: nowrap; }
.badge--crash { background: color-mix(in srgb, var(--crash) 18%, transparent); border-color: var(--crash); color: var(--crash); }
.badge--warn { background: color-mix(in srgb, var(--primary) 15%, transparent); border-color: var(--primary); color: var(--primary); }
.num { font-variant-numeric: tabular-nums; }

/* today bar */
.today { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; margin-bottom: 14px; }
.today__label { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.16em; color: var(--muted); margin-right: 4px; }
.tb { display: inline-flex; align-items: center; gap: 10px; padding: 4px 4px 4px 12px; border-radius: 10px; background: var(--surface-2);
    border: 1px solid var(--border); font-size: 0.88rem; }
.tb strong { font-weight: 700; }
.tb--run { border-color: color-mix(in srgb, var(--crash) 65%, transparent); background: color-mix(in srgb, var(--crash) 12%, var(--surface-2)); }
.tb--run::before { content: "⚡"; color: var(--crash); }
.tb--plan::before { content: "🕑"; }
.tb--auto { border-style: dashed; border-color: var(--info); }
.tb--auto::before { content: "↻"; color: var(--info); font-weight: 800; }

/* list */
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.chip { padding: 6px 12px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); color: var(--text);
    font: 600 0.85rem/1.2 inherit; font-family: inherit; cursor: pointer; max-width: 100%; overflow-wrap: anywhere; }
.chip b { color: var(--muted); margin-left: 4px; }
.chip[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
.chip[aria-pressed="true"] b { color: inherit; opacity: 0.7; }
.dgroup { margin-bottom: 14px; }
.dgroup__head { margin: 0 0 6px; padding: 4px; overflow-wrap: anywhere; color: var(--muted); font-size: 0.74rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; }
.drow { display: grid; grid-template-columns: 20px 18px 40px minmax(0, 1fr) auto auto auto auto auto 40px; gap: 12px; align-items: center;
    padding: 8px 10px; margin-bottom: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.drow.is-selected { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 6%, var(--surface)); }
.drow.is-off .drow__img, .drow.is-off .drow__name, .drow.is-off .drow__live, .drow.is-off .drow__band { opacity: 0.45; }
.drow.is-crash { border-color: color-mix(in srgb, var(--crash) 70%, transparent); box-shadow: inset 4px 0 0 var(--crash); }
.drow.is-dragging { position: fixed; z-index: 30; margin: 0; box-shadow: 0 16px 40px #000b; pointer-events: none; border-color: var(--primary); }
.drow--placeholder { display: block; background: none; border: 2px dashed var(--border); }
.drow input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--primary); margin: 0; }
.drow__grip { color: var(--muted); cursor: grab; touch-action: none; user-select: none; text-align: center; font-size: 1.1rem; line-height: 1; }
.drow__img { width: 40px; height: 40px; border-radius: 10px; background: var(--surface-2); object-fit: cover; }
.drow__name { min-width: 0; color: var(--text); text-decoration: none; }
.drow__name b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drow__name span { font-size: 0.8rem; color: var(--muted); overflow-wrap: anywhere; }
.drow__live { display: flex; align-items: center; gap: 10px; min-width: 190px; }
.drow__price { flex: none; font-weight: 700; min-width: 70px; text-align: right; }
.drow__change { font-size: 0.8rem; min-width: 56px; }
.drow__band { display: grid; gap: 4px; min-width: 190px; font-size: 0.78rem; color: var(--muted); }
.drow__band .v { display: flex; justify-content: space-between; gap: 8px; }
.drow__band .v b { color: var(--text); font-weight: 600; }
.mb { position: relative; height: 4px; border-radius: 2px; background: var(--surface-3); }
.mb__base { position: absolute; top: -3px; width: 2px; height: 10px; background: var(--muted); }
.mb__cur { position: absolute; top: -3px; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; background: var(--primary); transition: left 0.6s; }
.is-crash .mb__cur { background: var(--crash); }
.spark { width: 70px; height: 22px; }
.spark polyline { fill: none; stroke: var(--muted); stroke-width: 1.6; }
.spark.up polyline { stroke: var(--up); }
.spark.down polyline, .spark.crash polyline { stroke: var(--down); }
.btn--crash { color: var(--crash); border-color: color-mix(in srgb, var(--crash) 45%, transparent); background: transparent; }
.btn--crash:hover { border-color: var(--crash); background: color-mix(in srgb, var(--crash) 10%, transparent); }
.btn--crash-solid { background: var(--crash); color: #fff; }
.more { position: relative; }
.more > summary { list-style: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; cursor: pointer; color: var(--muted); font-weight: 800; }
.more > summary::-webkit-details-marker { display: none; }
.more > summary:hover { background: var(--surface-2); }
@media (max-width: 1080px) { .drow__band { display: none; } }
@media (max-width: 860px) { .drow .switch span:last-child { display: none; } .drow__live .spark { display: none; } .drow__live { min-width: 0; } }
@media (max-width: 620px) {
    .drow { grid-template-columns: 20px 18px 36px minmax(0, 1fr) auto 40px; row-gap: 8px; }
    .drow__live { grid-column: 4 / 5; grid-row: 2; }
    .drow [data-toggle="active"] { grid-column: 1 / 4; grid-row: 2; }
    .drow [data-toggle="autoCrash"] { display: none; }
    .search-input { width: 100%; }
}

/* floating bulk bar */
.floatbar { position: fixed; z-index: 40; left: 50%; bottom: 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px;
    max-width: calc(100vw - 24px); border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); box-shadow: 0 16px 40px #000a;
    transform: translate(-50%, 180%); visibility: hidden; transition: transform 0.25s ease-out, visibility 0.25s; }
.floatbar.is-shown { transform: translate(-50%, 0); visibility: visible; }

/* side panels: overlay, never push the page */
.panel { position: fixed; z-index: 45; top: 0; right: 0; bottom: 0; width: min(480px, 100vw); display: flex; flex-direction: column;
    background: var(--surface); border-left: 1px solid var(--border); box-shadow: -20px 0 50px #0009; transform: translateX(105%); visibility: hidden;
    transition: transform 0.25s ease-out, visibility 0.25s; }
.panel.is-open { transform: none; visibility: visible; }
.panel__head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.panel__head h2 { flex: 1; margin: 0; }
.panel__body { flex: 1; overflow-y: auto; padding: 16px; }
.panel__body h3 { margin: 18px 0 8px; font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.panel__foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); }
.panel-backdrop { position: fixed; inset: 0; z-index: 44; background: #0007; }
.panel-backdrop[hidden] { display: none; }
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); margin-bottom: 14px; }
.seg label { position: relative; padding: 7px 14px; border-radius: 8px; font-weight: 700; color: var(--muted); cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:checked) { background: var(--primary); color: var(--primary-text); }
.chipsel { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.chipsel label { padding: 7px 12px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface-2); font-weight: 600; font-size: 0.85rem; cursor: pointer; }
.chipsel input[type="radio"], .chipsel input[type="checkbox"] { position: absolute; opacity: 0; pointer-events: none; }
.chipsel label:has(input:checked) { background: var(--primary); color: var(--primary-text); border-color: var(--primary); }
.opt { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; cursor: pointer; }
.opt:has(input[type="radio"]:checked) { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 7%, transparent); }
.opt input[type="radio"] { accent-color: var(--primary); width: 18px; height: 18px; margin: 0; }
.opt .input { width: 100px; min-height: 34px; margin-left: auto; }
.picked { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.picked span { display: inline-flex; align-items: center; gap: 6px; padding: 4px 4px 4px 10px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border); font-size: 0.85rem; }
.picked button { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 1rem; }
details.adv { border: 1px solid var(--border); border-radius: 10px; padding: 0 12px; margin-top: 12px; }
details.adv summary { padding: 12px 0; cursor: pointer; font-weight: 700; }
.warn { padding: 10px 12px; border-radius: 10px; margin-bottom: 10px; font-size: 0.88rem;
    background: color-mix(in srgb, var(--primary) 12%, transparent); border: 1px solid color-mix(in srgb, var(--primary) 40%, transparent); }
.price-band { position: relative; height: 54px; margin: 6px 0 12px; }
.price-band__track { position: absolute; left: 0; right: 0; top: 22px; height: 8px; border-radius: 4px;
    background: linear-gradient(90deg, color-mix(in srgb, var(--down) 45%, transparent), var(--surface-3) 50%, color-mix(in srgb, var(--up) 45%, transparent)); }
.price-band__mark { position: absolute; top: 0; transform: translateX(-50%); font-size: 0.72rem; color: var(--muted); white-space: nowrap; }
.price-band__mark::after { content: ""; display: block; width: 2px; height: 22px; margin: 2px auto 0; background: var(--muted); }
.price-band__ends { position: absolute; top: 34px; left: 0; right: 0; display: flex; justify-content: space-between; font-size: 0.72rem; color: var(--muted); }
.input.is-bad { border-color: var(--down); }
.stat3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat3 div { background: var(--surface-2); border-radius: 10px; padding: 10px; }
.stat3 small { display: block; color: var(--muted); font-size: 0.75rem; }

/* crashes tab */
.timeline { position: relative; margin: 8px 0 4px; border-radius: 10px; background: var(--bg); overflow: hidden; }
.timeline__hour { position: absolute; top: 0; bottom: 0; border-left: 1px solid #ffffff0d; font-size: 0.7rem; color: var(--muted); padding: 4px 0 0 4px; }
.timeline__block { position: absolute; height: 28px; min-width: 70px; border-radius: 7px; padding: 4px 8px; font-size: 0.75rem; font-weight: 700;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: inherit; text-decoration: none; }
.timeline__block--past { background: var(--surface-3); color: var(--muted); }
.timeline__block--run { background: var(--crash); color: #fff; }
.timeline__block--plan { background: color-mix(in srgb, var(--primary) 25%, transparent); color: var(--primary); border: 1px solid var(--primary); }
.timeline__block--auto { background: color-mix(in srgb, var(--info) 15%, transparent); color: var(--info); border: 1px dashed var(--info); }
.timeline__block--skip { background: transparent; color: var(--muted); border: 1px dashed var(--border); text-decoration: line-through; }
.timeline__now { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--up); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 0.8rem; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.day-list { display: grid; gap: 12px; }
.day-list h3 { margin: 0 0 6px; }
.plan-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 0; border-top: 1px solid var(--border); }
.plan-row__time { font-weight: 800; min-width: 52px; }
.plan-row__what { flex: 1; min-width: 200px; }
.plan-row details { position: relative; }
.plan-row details > summary { list-style: none; }
.plan-row details form { position: absolute; right: 0; z-index: 20; display: flex; gap: 6px; padding: 10px; margin-top: 6px; background: var(--surface-2);
    border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 12px 30px #0008; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.tpl { display: grid; gap: 6px; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.tpl .row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }

/* Quick crash at the till */
.till-crash { position: relative; margin-right: auto; }
.till-crash > summary { list-style: none; }
.till-crash > summary::-webkit-details-marker { display: none; }
.till-crash__box { position: absolute; z-index: 35; top: calc(100% + 6px); left: 0; width: min(360px, 90vw); padding: 12px; background: var(--surface-2);
    border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 16px 40px #000a; }
.till-crash__running { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; font-size: 0.9rem; }
.till-crash__drinks { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; margin-bottom: 10px; max-height: 240px; overflow-y: auto; }
.till-crash__drinks label { display: flex; align-items: center; gap: 6px; min-height: 36px; }
.till-crash__drinks input { width: 20px; height: 20px; accent-color: var(--crash); }

/* CSV import */
.panel--wide { width: min(900px, 100vw); }
.steps { display: flex; gap: 6px; margin-bottom: 16px; font-size: 0.8rem; color: var(--muted); }
.steps span { padding: 4px 10px; border-radius: 99px; background: var(--surface-2); }
.steps span.is-on { background: var(--primary); color: var(--primary-text); font-weight: 700; }
.drop { display: grid; place-items: center; gap: 10px; text-align: center; padding: 36px 16px; border: 2px dashed var(--border); border-radius: 14px; color: var(--muted); }
.import-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.csv td { white-space: nowrap; }
.csv td small { display: block; font-size: 0.72rem; color: var(--muted); }
.csv td.is-changed { background: color-mix(in srgb, var(--primary) 14%, transparent); }
.csv td.is-bad { background: color-mix(in srgb, var(--down) 18%, transparent); color: #ff9aa6; }
.csv td.is-bad small { color: #ff9aa6; }
.csv tr.is-skipped td { opacity: 0.55; }

/* Board settings */
.checks { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.colors { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.color-field { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 10px; }
.color-field input[type="color"] { width: 36px; height: 30px; padding: 0; border: 0; background: none; cursor: pointer; }
.info-thumb { max-width: 220px; max-height: 140px; border-radius: 10px; border: 1px solid var(--border); }
.info-thumb--small { width: 48px; height: 36px; object-fit: cover; }
.info-rows td { padding: 4px; }
.info-rows .input { min-width: 90px; }
.color-input { width: 40px; height: 32px; padding: 0; border: 0; background: none; }

/* Board settings with live preview */
.admin-main--wide { max-width: 1680px; }
.with-preview { display: grid; grid-template-columns: minmax(340px, 1fr) minmax(0, 1.4fr); gap: 16px; align-items: start; }
.board-preview { position: sticky; top: 76px; display: grid; gap: 8px; }
.board-preview__bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 700; color: var(--muted); }
.board-preview__frame { width: 100%; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; border: 6px solid #050505; box-shadow: 0 10px 30px #0008; background: #000; margin: 0 auto; }
/* upright shapes: as large as the column allows, but never taller than the window */
.board-preview__frame[data-shape="portrait"] { width: min(70%, calc((100vh - 230px) * 9 / 16)); aspect-ratio: 9 / 16; }
.board-preview__frame[data-shape="phone"] { width: min(50%, calc((100vh - 230px) * 9 / 19.5)); aspect-ratio: 9 / 19.5; border-radius: 22px; border-width: 8px; }
.board-preview__frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.branding-pic { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
@media (max-width: 1000px) { .with-preview { grid-template-columns: 1fr; } .board-preview { position: static; } }

/* Statistics */
.stats-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 6px; }
.stats-filters .input { width: auto; }
.stats-range { margin: 0 0 14px; font-size: 0.85rem; }
.stats-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 14px; }
.stats-kpi { display: grid; gap: 2px; align-content: start; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.stats-kpi small { color: var(--muted); font-size: 0.8rem; font-weight: 600; }
.stats-kpi b { font-size: 1.6rem; }
.stats-kpi span { font-size: 0.82rem; font-weight: 700; }
.stats-kpi--pair { grid-column: span 2; grid-template-columns: 1fr 1fr; padding: 0; gap: 0; }
.stats-kpi--pair > div { display: grid; gap: 2px; padding: 14px; }
.stats-kpi--pair > div + div { border-left: 1px solid var(--border); }
.stats-kpi--pair p { grid-column: 1 / -1; margin: 0; padding: 8px 14px; border-top: 1px solid var(--border); font-size: 0.78rem; color: var(--muted); }
@media (max-width: 560px) { .stats-kpi--pair { grid-column: span 1; grid-template-columns: 1fr; } .stats-kpi--pair > div + div { border-left: 0; border-top: 1px solid var(--border); } }
.stats-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: 0.8rem; color: var(--muted); }
.stats-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: -8px; }
.stats-legend i.is-now { background: var(--primary); }
.stats-legend i.is-cmp { border: 2px solid var(--muted); }
.stats-legend i.is-crash { background: var(--crash); opacity: 0.35; }
.stats-chart { display: block; width: 100%; height: auto; margin-top: 8px; overflow: visible; }
.stats-chart__grid { stroke: var(--border); stroke-width: 1; }
.stats-chart__axis { fill: var(--muted); font-size: 11px; font-family: inherit; }
.stats-chart__bar { fill: var(--primary); }
.stats-chart__cmp { stroke: var(--muted); stroke-width: 2; }
.stats-chart__crash { fill: var(--crash); opacity: 0.14; }
.stats-chart__hit { fill: transparent; }
.stats-chart g:hover .stats-chart__hit { fill: #ffffff0d; }
.table th a { color: inherit; text-decoration: none; }
.table th a:hover { color: var(--text); }
.table tfoot td { border-top: 2px solid var(--border); }
.meter { position: relative; display: inline-block; width: 60px; height: 6px; border-radius: 3px; background: var(--surface-3); vertical-align: middle; margin-left: 8px; }
.meter i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: var(--crash); }
.export-menu { position: relative; }
.export-menu > summary { list-style: none; }
.export-menu > summary::-webkit-details-marker { display: none; }

/* Sponsor report: filter above the crash table, printable as a one-pager */
.stats-sponsor { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 10px; }
.stats-sponsor label { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 0.9rem; }
.stats-sponsor select { padding: 6px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: inherit; font: inherit; }
.sponsor-report header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 12px; }
.sponsor-report h2 { margin: 0; }
.sponsor-report .stats-kpis { margin-bottom: 0; }

@media print {
    :root { --bg: #fff; --surface: #fff; --surface-2: #f3f4f6; --border: #d5d9e0; --text: #111; --muted: #5b6372; --up: #0a7d43; --down: #c4182b; }
    body.admin { background: #fff; color: #111; }
    .admin-header, .toasts, .page-head, .stats-filters, .tabs, .stats-sponsor, .export-menu { display: none !important; }
    .admin-main { padding: 0; max-width: none; }
    .card, .stats-kpi { box-shadow: none; break-inside: avoid; }
    .table a { color: inherit; text-decoration: none; }
    body.is-sponsor-print .admin-main > :not(.sponsor-report):not(.table-wrap) { display: none !important; }
}

/* Outlet overview (owners) */
.outlets-page { width: 100%; max-width: 1100px; margin: 0 auto; }
[data-outlet-panel] .panel__body { display: grid; gap: 16px; align-content: start; }
[data-outlet-panel] .hint { margin: 0; }
.outlets-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-bottom: 18px; }
.outlets-sum > div { display: grid; gap: 2px; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.outlets-sum small, .outlet-card dt { color: var(--muted); font-size: 0.8rem; font-weight: 600; }
.outlets-sum b { font-size: 1.5rem; }
.outlets-sum span { font-size: 0.8rem; }
.outlets-org { margin: 22px 0 10px; font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.outlet-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(330px, 100%), 1fr)); gap: 12px; }
.outlet-card { display: grid; gap: 12px; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.outlet-card.is-warn { border-color: color-mix(in srgb, var(--primary) 60%, var(--border)); }
.outlet-card header, .outlet-card footer { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.outlet-card header a { color: var(--text); text-decoration: none; font-size: 1.05rem; }
.outlet-card header a:hover { color: var(--primary); }
.outlet-card .grow { flex: 1; }
.outlet-card dl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0; }
.outlet-card dl div { display: grid; gap: 2px; }
.outlet-card dd { margin: 0; font-weight: 700; font-size: 1.1rem; }
.outlet-card__warn { margin: 0; padding: 8px 10px; border-radius: 8px; font-size: 0.85rem; font-weight: 600;
    background: color-mix(in srgb, var(--primary) 14%, transparent); color: var(--primary); }
.outlet-card__slug { font-size: 0.8rem; text-decoration: none; }
.text-crash { color: var(--crash); }
.slug-field { display: flex; align-items: center; gap: 6px; }
.slug-field .input { flex: 1; font-family: Consolas, Menlo, monospace; }
.slug-hint--ok { color: var(--up); }
.slug-hint--bad { color: var(--down); }
.slug-suggest { display: flex; flex-wrap: wrap; gap: 6px; }
.slug-suggest:empty { display: none; }
.slug-suggest button { padding: 3px 10px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
    font: inherit; font-size: 0.82rem; cursor: pointer; }
.slug-suggest button:hover { border-color: var(--primary); }
.menu__sep { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 4px; }
