    /* ════════════════════════════════════════════════════════════════
       BEHRENDT SERVICE SYSTEM — Klinikum Edition
       Klinisch, luftig, mono accents, viel Whitespace
       ════════════════════════════════════════════════════════════════ */

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

    /* ─── Design tokens (theme-independent) ─── */
    :root {
        --font-sans: 'Inter Tight', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
        --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

        --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px;
        --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-10: 40px;
        --s-12: 48px; --s-16: 64px; --s-20: 80px;

        --r-sm: 6px; --r-md: 10px; --r-lg: 14px; --r-xl: 20px;

        --topbar-h: 64px;
        --sidebar-w: 264px;
        --bottomnav-h: 72px;

        --duration-fast: 120ms;
        --duration-base: 180ms;
        --duration-slow: 280ms;
        --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
        --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    }

    /* ─── Light theme (default) ─── */
    :root, [data-theme="light"] {
        --bg:            #fafaf8;
        --bg-inset:      #f3f3ef;
        --surface:       #ffffff;
        --surface-2:     #fbfbf9;
        --surface-hover: #f5f5f1;

        --border:        #ececea;
        --border-strong: #dcdcd9;
        --divider:       #f0f0ee;

        --ink:           #18181a;
        --ink-2:         #3a3a3d;
        --ink-3:         #5d5d61;
        --ink-mute:      #8d8d92;
        --ink-faint:     #b8b8bc;

        --accent:        #18181a;
        --accent-on:     #ffffff;
        --focus:         #2a2a2d;

        --st-intake:       #5b6cff;
        --st-workshop_in:  #e87b3c;
        --st-goldsmith:    #c79b39;
        --st-watchmaker:   #5d7a93;
        --st-ready:        #3a9b5c;
        --st-picked_up:    #8d8d92;
        --st-office:       #8a5cb8;
        --st-external:     #b0713c;
        --st-engraving:    #b5487a;

        --pri-low:    #6d7681;
        --pri-normal: #18181a;
        --pri-high:   #c4732c;
        --pri-urgent: #c1453c;

        --shadow-sm: 0 1px 2px rgba(20,20,24,0.04);
        --shadow-md: 0 4px 16px -4px rgba(20,20,24,0.06), 0 1px 2px rgba(20,20,24,0.03);
        --shadow-lg: 0 12px 40px -12px rgba(20,20,24,0.12), 0 2px 4px rgba(20,20,24,0.04);

        --overlay-bg: rgba(20,20,24,0.4);
    }

    /* ─── Dark theme ─── */
    [data-theme="dark"] {
        --bg:            #0e0f10;
        --bg-inset:      #08090a;
        --surface:       #16181a;
        --surface-2:     #1a1c1f;
        --surface-hover: #1f2226;

        --border:        #25282d;
        --border-strong: #363a40;
        --divider:       #1d2024;

        --ink:           #f3f3f1;
        --ink-2:         #d4d4d1;
        --ink-3:         #a0a0a0;
        --ink-mute:      #74787e;
        --ink-faint:     #4e5258;

        --accent:        #f3f3f1;
        --accent-on:     #0e0f10;
        --focus:         #d4d4d1;

        --st-intake:       #7d8cff;
        --st-workshop_in:  #ff9a5b;
        --st-goldsmith:    #e0b454;
        --st-watchmaker:   #88a0b9;
        --st-ready:        #5fb37f;
        --st-picked_up:    #9aa0a8;
        --st-office:       #b282d8;
        --st-external:     #d99a63;
        --st-engraving:    #e07aa8;

        --pri-low:    #8c949d;
        --pri-normal: #f3f3f1;
        --pri-high:   #e0944e;
        --pri-urgent: #e87269;

        --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
        --shadow-md: 0 4px 16px -4px rgba(0,0,0,0.5);
        --shadow-lg: 0 12px 40px -12px rgba(0,0,0,0.6);

        --overlay-bg: rgba(0,0,0,0.65);
    }

    /* ─── Legacy aliases — existing render functions & inline styles ─── */
    :root {
        --color-bg: var(--bg);
        --color-bg-subtle: var(--bg-inset);
        --color-bg-muted: var(--bg-inset);
        --color-surface: var(--surface);
        --color-surface-hover: var(--surface-hover);
        --color-surface-active: var(--surface-hover);
        --color-surface-elevated: var(--surface);
        --color-surface-inverse: var(--ink);
        --color-border: var(--border);
        --color-border-strong: var(--border-strong);
        --color-border-subtle: var(--divider);
        --color-text: var(--ink);
        --color-text-secondary: var(--ink-2);
        --color-text-muted: var(--ink-mute);
        --color-text-disabled: var(--ink-faint);
        --color-text-inverse: var(--accent-on);
        --color-brand: var(--accent);
        --color-brand-hover: var(--ink-2);
        --color-brand-active: var(--ink);
        --color-brand-bg: var(--bg-inset);
        --color-brand-bg-strong: var(--border);
        --color-brand-fg: var(--accent-on);
        --color-success: var(--st-ready);
        --color-success-bg: color-mix(in oklab, var(--st-ready) 12%, var(--surface));
        --color-success-border: color-mix(in oklab, var(--st-ready) 30%, var(--border));
        --color-warning: var(--pri-high);
        --color-warning-bg: color-mix(in oklab, var(--pri-high) 12%, var(--surface));
        --color-warning-border: color-mix(in oklab, var(--pri-high) 30%, var(--border));
        --color-danger: var(--pri-urgent);
        --color-danger-bg: color-mix(in oklab, var(--pri-urgent) 12%, var(--surface));
        --color-danger-border: color-mix(in oklab, var(--pri-urgent) 30%, var(--border));
        --color-info: var(--st-intake);
        --color-info-bg: color-mix(in oklab, var(--st-intake) 12%, var(--surface));
        --color-station-intake-bg: color-mix(in oklab, var(--st-intake) 10%, var(--surface));
        --color-station-workshop_in-bg: color-mix(in oklab, var(--st-workshop_in) 10%, var(--surface));
        --color-station-goldsmith-bg: color-mix(in oklab, var(--st-goldsmith) 10%, var(--surface));
        --color-station-watchmaker-bg: color-mix(in oklab, var(--st-watchmaker) 10%, var(--surface));
        --color-station-ready-bg: color-mix(in oklab, var(--st-ready) 10%, var(--surface));
        --color-station-picked_up-bg: color-mix(in oklab, var(--st-picked_up) 10%, var(--surface));
        --color-station-office-bg: color-mix(in oklab, var(--st-office) 10%, var(--surface));
        --color-station-external-bg: color-mix(in oklab, var(--st-external) 10%, var(--surface));
        --color-station-engraving-bg: color-mix(in oklab, var(--st-engraving) 10%, var(--surface));
        --station-intake: var(--st-intake);
        --station-workshop_in: var(--st-workshop_in);
        --station-goldsmith: var(--st-goldsmith);
        --station-watchmaker: var(--st-watchmaker);
        --station-ready: var(--st-ready);
        --station-picked_up: var(--st-picked_up);
        --station-office: var(--st-office);
        --station-external: var(--st-external);
        --station-engraving: var(--st-engraving);
        --color-overlay: var(--overlay-bg);
        --color-scrim: var(--overlay-bg);
        --color-focus-ring: color-mix(in oklab, var(--focus) 8%, transparent);
        --shadow-xs: var(--shadow-sm);
        --shadow-xl: var(--shadow-lg);
        --shadow-overlay: var(--shadow-lg);
        --shadow-focus: 0 0 0 4px var(--color-focus-ring);
        --radius-sm: var(--r-sm);
        --radius-md: var(--r-md);
        --radius-lg: var(--r-lg);
        --radius-xl: var(--r-xl);
        --radius-2xl: 24px;
        --radius-full: 9999px;
        --space-1: var(--s-1);
        --space-2: var(--s-2);
        --space-3: var(--s-3);
        --space-4: var(--s-4);
        --space-5: var(--s-5);
        --space-6: var(--s-6);
        --space-8: var(--s-8);
        --space-10: var(--s-10);
        --space-12: var(--s-12);
        --space-16: var(--s-16);
        --space-20: var(--s-20);
        --text-2xs: 11px;
        --text-xs: 12px;
        --text-sm: 13px;
        --text-base: 14px;
        --text-md: 15px;
        --text-lg: 17px;
        --text-xl: 20px;
        --text-2xl: 28px;
        --text-3xl: 36px;
        --text-4xl: 48px;
        --leading-tight: 1.2;
        --leading-snug: 1.35;
        --leading-normal: 1.5;
        --container-max: 1280px;
    }

    /* ════════════════════════════════════════════════════════════════
       BASE
       ════════════════════════════════════════════════════════════════ */

    html { font-size: 15px; -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
    body {
        background: var(--bg);
        color: var(--ink);
        font-family: var(--font-sans);
        font-size: 15px;
        line-height: 1.5;
        font-feature-settings: 'cv11', 'ss01';
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        transition: background-color var(--duration-slow) var(--ease-out), color var(--duration-slow) var(--ease-out);
    }
    button, input, textarea, select { font: inherit; color: inherit; }
    button { cursor: pointer; background: none; border: none; }
    a { color: inherit; text-decoration: none; }
    img { display: block; max-width: 100%; }
    svg { width: 1em; height: 1em; flex-shrink: 0; }

    ::-webkit-scrollbar { width: 8px; height: 8px; }
    ::-webkit-scrollbar-track { background: transparent; }
    ::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
    ::-webkit-scrollbar-thumb:hover { background: var(--ink-mute); }
    ::selection { background: var(--ink); color: var(--accent-on); }

    :focus-visible { outline: none; box-shadow: var(--shadow-focus); border-radius: var(--r-md); }
    /* Clear keyboard-focus ring on custom interactive controls */
    .chip:focus-visible, .choice-card:focus-visible, .station-card:focus-visible,
    .order-card--clickable:focus-visible, .nav-item:focus-visible, .toggle-btn:focus-visible,
    .priority-btn:focus-visible, .customer-item:focus-visible {
        outline: 2px solid var(--ink);
        outline-offset: 2px;
        box-shadow: none;
    }

    .mono { font-family: var(--font-mono); font-feature-settings: 'tnum'; letter-spacing: -0.01em; }
    .tnum, .tabular { font-variant-numeric: tabular-nums; }

    /* ════════════════════════════════════════════════════════════════
       APP SHELL — Sidebar (desktop) + Topbar + Content + Bottom-nav
       ════════════════════════════════════════════════════════════════ */

    .app {
        display: grid;
        grid-template-columns: var(--sidebar-w) 1fr;
        min-height: 100vh;
        flex: 1;
    }
    @media (max-width: 1023px) {
        .app { grid-template-columns: 1fr; padding-bottom: var(--bottomnav-h); }
    }

    /* ─── Sidebar (desktop only) ─── */
    .sidebar {
        background: var(--surface);
        border-right: 1px solid var(--border);
        display: flex;
        flex-direction: column;
        position: sticky;
        top: 0;
        height: 100vh;
        overflow-y: auto;
    }
    @media (max-width: 1023px) { .sidebar { display: none; } }

    .sidebar-brand {
        height: var(--topbar-h);
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0 var(--s-6);
        border-bottom: 1px solid var(--divider);
        flex-shrink: 0;
    }
    .sidebar-brand-logo {
        display: block;
        width: 100%;
        max-width: 192px;
        color: var(--ink);
        transition: opacity var(--duration-fast) ease;
    }
    .sidebar-brand-logo:hover { opacity: 0.75; }
    /* Wortmarke: skaliert über width, Höhe folgt dem viewBox-Seitenverhältnis */
    .logo-wordmark { display: block; width: 100%; height: auto; }

    .sidebar-section { padding: var(--s-4) var(--s-3); }
    .sidebar-section-label {
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: 0.08em;
        color: var(--ink-mute);
        padding: var(--s-2) var(--s-3);
        margin-bottom: var(--s-1);
        font-weight: 500;
    }

    .nav-item {
        display: flex;
        align-items: center;
        gap: var(--s-3);
        width: 100%;
        padding: 10px var(--s-3);
        border-radius: var(--r-md);
        font-size: 14px;
        color: var(--ink-2);
        font-weight: 500;
        transition: background var(--duration-fast) ease;
        min-height: 40px;
        white-space: nowrap;
        text-align: left;
    }
    .nav-item > span { flex: 1; overflow: hidden; text-overflow: ellipsis; }
    .nav-item > .nav-item-dot,
    .nav-item > .nav-item-badge,
    .nav-item > .pill-dot { flex: 0 0 auto; }
    .nav-item:hover { background: var(--surface-hover); color: var(--ink); }
    .nav-item.active { background: var(--bg-inset); color: var(--ink); }
    .nav-item svg { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.85; }
    .nav-item-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: var(--c, var(--ink-mute)); }
    .nav-item-badge {
        margin-left: auto;
        font-family: var(--font-mono);
        font-size: 11px;
        background: var(--surface-hover);
        color: var(--ink-3);
        padding: 2px 7px;
        border-radius: 10px;
        min-width: 22px;
        text-align: center;
        font-weight: 500;
    }
    .nav-item.active .nav-item-badge { background: var(--ink); color: var(--accent-on); }

    .sidebar-spacer { flex: 1; }
    .sidebar-user {
        padding: var(--s-4);
        border-top: 1px solid var(--divider);
        display: flex;
        align-items: center;
        gap: var(--s-3);
    }
    .avatar {
        width: 32px; height: 32px;
        border-radius: 50%;
        background: var(--bg-inset);
        display: grid; place-items: center;
        font-size: 12px;
        font-weight: 600;
        font-family: var(--font-mono);
        color: var(--ink-2);
        flex-shrink: 0;
    }
    .avatar.lg { width: 44px; height: 44px; font-size: 14px; }
    .avatar.xs { width: 22px; height: 22px; font-size: 10px; }
    .sidebar-user-meta { min-width: 0; flex: 1; }
    .sidebar-user-name {
        font-size: 13px; font-weight: 500; color: var(--ink);
        white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }
    .sidebar-user-role {
        font-size: 11px; color: var(--ink-mute); font-family: var(--font-mono);
    }

    /* ─── Main column ─── */
    .main { display: flex; flex-direction: column; min-width: 0; }

    /* ─── Top bar ─── */
    .top-bar, .topbar {
        height: var(--topbar-h);
        border-bottom: 1px solid var(--border);
        background: var(--bg);
        display: flex;
        align-items: center;
        padding: 0 var(--s-8);
        gap: var(--s-4);
        position: sticky;
        top: 0;
        z-index: 20;
    }
    @media (max-width: 768px) { .top-bar, .topbar { padding: 0 var(--s-4); } }

    .top-bar-title {
        display: flex; align-items: center; gap: var(--s-3);
        min-width: 0;
        flex: 1;
    }
    @media (min-width: 1024px) { .top-bar-title .brand-mark, .top-bar-title .brand-divider { display: none; } }

    .brand-mark {
        display: inline-flex; align-items: center;
        color: var(--ink);
        transition: opacity var(--duration-fast) var(--ease-out);
        text-decoration: none;
        flex-shrink: 0;
    }
    .brand-mark:hover { opacity: 0.75; }
    .brand-mark .logo-wordmark { width: auto; height: 22px; }
    @media (max-width: 480px) { .brand-mark .logo-wordmark { height: 15px; } }
    .brand-divider { width: 1px; height: 22px; background: var(--border); flex-shrink: 0; }

    .page-title {
        font-size: 22px;
        font-weight: 600;
        color: var(--ink);
        letter-spacing: -0.02em;
        margin: 0;
        line-height: 1.2;
        min-width: 0;
        overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    }
    .page-title .page-title-context {
        color: var(--ink-mute);
        font-weight: 500;
        margin-left: var(--s-2);
        font-size: 14px;
        font-family: var(--font-mono);
    }

    .top-bar-info {
        display: flex; align-items: center; gap: var(--s-2);
        flex-shrink: 0;
    }

    .station-badge {
        display: inline-flex; align-items: center; gap: var(--s-2);
        padding: 5px 12px;
        border-radius: 999px;
        font-weight: 500;
        font-size: 12px;
        line-height: 1;
        white-space: nowrap;
        background: var(--bg-inset);
        color: var(--ink);
        border: 1px solid var(--border);
    }
    .station-badge::before {
        content: ''; width: 6px; height: 6px; border-radius: 50%;
        background: currentColor;
    }
    .employee-chip {
        display: inline-flex; align-items: center; gap: var(--s-2);
        padding: 5px 12px;
        border-radius: 999px;
        background: var(--bg-inset);
        color: var(--ink-2);
        font-size: 12px;
        font-weight: 500;
        font-family: var(--font-mono);
        line-height: 1;
    }
    .connection-dot {
        width: 8px; height: 8px; border-radius: 50%;
        background: var(--st-ready);
        display: inline-block;
        box-shadow: 0 0 0 3px color-mix(in oklab, var(--st-ready) 20%, transparent);
    }
    .connection-dot.disconnected {
        background: var(--pri-urgent);
        box-shadow: 0 0 0 3px color-mix(in oklab, var(--pri-urgent) 20%, transparent);
    }

    /* ─── Gerätestatus an der Kasse (device-status.js) ─── */
    .dev-status {
        position: relative;
        display: inline-flex; align-items: center; gap: 2px;
        padding: 2px;
        border-radius: 999px;
        border: 1px solid var(--border);
        background: var(--surface);
    }
    /* Alles gut: nur leise Punkte, kein Rahmen */
    .dev-status.is-calm { border-color: transparent; background: transparent; }
    .ds-pill {
        --ds-c: var(--st-ready);
        display: inline-flex; align-items: center; gap: 6px;
        height: 28px; padding: 0 10px;
        border: none; border-radius: 999px;
        background: transparent;
        color: var(--ink-mute);
        font: 500 12px/1 var(--font-sans);
        white-space: nowrap;
        cursor: pointer;
        transition: background var(--duration-fast);
    }
    .ds-pill:hover { background: var(--surface-hover); color: var(--ink-2); }
    .ds-pill.is-warn { --ds-c: var(--pri-high); color: var(--ink-2); background: color-mix(in oklab, var(--pri-high) 12%, var(--surface)); }
    .ds-pill.is-bad { --ds-c: var(--pri-urgent); color: var(--ink); font-weight: 600; background: color-mix(in oklab, var(--pri-urgent) 14%, var(--surface)); }
    .ds-pill.is-off { --ds-c: var(--ink-faint); }
    .ds-dot {
        width: 7px; height: 7px; border-radius: 50%;
        background: var(--ds-c);
        flex-shrink: 0;
    }
    .ds-pill.is-bad .ds-dot { box-shadow: 0 0 0 3px color-mix(in oklab, var(--pri-urgent) 22%, transparent); }
    @media (max-width: 768px) {
        .ds-label { display: none; }
        .ds-pill { padding: 0 7px; height: 26px; }
    }

    .ds-pop {
        position: absolute; top: calc(100% + 8px); right: 0;
        width: min(360px, calc(100vw - 24px));
        background: var(--surface);
        border: 1px solid var(--border-strong);
        border-radius: var(--r-lg);
        box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
        padding: var(--s-2);
        z-index: 40;
        cursor: default;
    }
    .ds-pop-h {
        display: flex; align-items: center; justify-content: space-between; gap: var(--s-2);
        padding: var(--s-1) var(--s-2) var(--s-2);
        font-size: 13px; font-weight: 600; color: var(--ink-2);
    }
    .ds-row {
        --ds-c: var(--st-ready);
        display: flex; gap: var(--s-3);
        padding: var(--s-3);
        border-radius: var(--r-md);
    }
    .ds-row + .ds-row { border-top: 1px solid var(--divider); }
    .ds-row.is-warn { --ds-c: var(--pri-high); }
    .ds-row.is-bad { --ds-c: var(--pri-urgent); background: color-mix(in oklab, var(--pri-urgent) 7%, var(--surface)); }
    .ds-row.is-off { --ds-c: var(--ink-faint); }
    .ds-row > .ds-dot { margin-top: 6px; width: 9px; height: 9px; }
    .ds-row-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
    .ds-row-t { display: flex; justify-content: space-between; gap: var(--s-2); font-size: 14px; font-weight: 600; color: var(--ink); }
    .ds-row-s { font-weight: 500; color: var(--ink-3); font-size: 13px; text-align: right; }
    .ds-row.is-bad .ds-row-s { color: var(--pri-urgent); font-weight: 600; }
    .ds-row.is-warn .ds-row-s { color: var(--pri-high); }
    .ds-row-name { font-family: var(--font-mono); font-size: 11px; color: var(--ink-mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .ds-row-d { font-size: 13px; line-height: 1.4; color: var(--ink-3); }
    .ds-row-err { font-size: 13px; line-height: 1.4; color: var(--ink); }
    .ds-row-a { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-2); }
    /* Schmal: Rechts neben den Punkten sitzen noch Verbindung und Abmelden,
       darum am Bildschirm statt an den Punkten ausrichten */
    @media (max-width: 768px) {
        .ds-pop { position: fixed; top: calc(var(--topbar-h) + 8px); left: 12px; right: 12px; width: auto; }
    }

    .icon-btn {
        display: inline-flex; align-items: center; justify-content: center;
        width: 40px; height: 40px;
        border-radius: var(--r-md);
        color: var(--ink-2);
        transition: background var(--duration-fast);
        border: none; background: none;
    }
    .icon-btn:hover { background: var(--surface-hover); color: var(--ink); }
    .icon-btn svg { width: 18px; height: 18px; }
    .icon-btn.danger:hover { color: var(--pri-urgent); background: color-mix(in oklab, var(--pri-urgent) 12%, var(--surface)); }

    /* ─── Main content ─── */
    .main-content, .content {
        flex: 1;
        padding: var(--s-8);
        min-width: 0;
        max-width: var(--container-max);
        margin: 0 auto;
        width: 100%;
    }
    @media (max-width: 768px) {
        .main-content, .content { padding: var(--s-5) var(--s-4); }
    }
    @media (max-width: 1023px) {
        .main-content, .content { padding-bottom: calc(var(--bottomnav-h) + var(--s-6)); }
    }

    .content-wide   { max-width: var(--container-max); margin: 0 auto; width: 100%; }
    .content-narrow { max-width: 880px; margin: 0 auto; width: 100%; }

    /* ─── Bottom nav (tablet/mobile) ─── */
    .bottom-nav {
        display: none;
        position: fixed;
        bottom: 0; left: 0; right: 0;
        height: var(--bottomnav-h);
        background: var(--surface);
        border-top: 1px solid var(--border);
        z-index: 30;
        padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
        justify-content: space-around;
    }
    @media (max-width: 1023px) { .bottom-nav { display: flex; } }
    .bottom-nav .nav-btn, .nav-btn {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        color: var(--ink-mute);
        border-radius: var(--r-md);
        font-size: 11px;
        font-weight: 500;
        min-height: 60px;
        background: none;
        border: none;
        transition: all var(--duration-fast);
    }
    .bottom-nav .nav-btn:hover { color: var(--ink-2); background: var(--surface-hover); }
    .bottom-nav .nav-btn svg { width: 22px; height: 22px; }
    .bottom-nav .nav-btn.active { color: var(--ink); background: var(--bg-inset); }

    /* ════════════════════════════════════════════════════════════════
       TYPOGRAPHY HELPERS
       ════════════════════════════════════════════════════════════════ */
    .h-display { font-size: 36px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; }
    .h1        { font-size: 28px; font-weight: 600; letter-spacing: -0.025em; line-height: 1.15; }
    .h2        { font-size: 20px; font-weight: 600; letter-spacing: -0.015em; }
    .h3        { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
    .muted     { color: var(--ink-mute); }
    .muted-2   { color: var(--ink-3); }
    .eyebrow {
        font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em;
        color: var(--ink-mute); font-weight: 500;
    }

    .section-header {
        font-size: 22px; font-weight: 600; letter-spacing: -0.02em;
        margin-bottom: var(--s-4);
        color: var(--ink);
    }
    .section-subheader {
        font-size: 13px;
        color: var(--ink-mute);
        margin-bottom: var(--s-4);
    }
    .subsection-header {
        display: flex; align-items: center; gap: var(--s-2);
        font-size: 14px;
        font-weight: 600;
        color: var(--ink);
        margin-bottom: var(--s-3);
        letter-spacing: -0.01em;
    }
    .subsection-header .dot {
        display: inline-block;
        width: 8px; height: 8px;
        border-radius: 50%;
    }
    .section-head {
        display: flex; align-items: baseline; justify-content: space-between;
        margin-bottom: var(--s-5);
        gap: var(--s-4);
        flex-wrap: wrap;
    }
    .section-head h2 { font-size: 20px; font-weight: 600; letter-spacing: -0.015em; }
    .section-head .muted { font-size: 13px; color: var(--ink-mute); font-family: var(--font-mono); }

    /* ════════════════════════════════════════════════════════════════
       BUTTONS
       ════════════════════════════════════════════════════════════════ */
    .btn {
        display: inline-flex; align-items: center; justify-content: center;
        gap: 8px;
        height: 44px;
        padding: 0 var(--s-5);
        border-radius: var(--r-md);
        font-family: inherit;
        font-size: 14px;
        font-weight: 500;
        line-height: 1;
        transition: background var(--duration-fast), transform 80ms, border-color var(--duration-fast);
        border: 1px solid transparent;
        white-space: nowrap;
        min-width: 44px;
        text-decoration: none;
        user-select: none;
    }
    .btn:active:not(:disabled) { transform: translateY(0.5px); }
    .btn:disabled { opacity: 0.45; cursor: not-allowed; }
    .btn svg { width: 16px; height: 16px; flex-shrink: 0; }

    .btn-primary { background: var(--ink); color: var(--accent-on); }
    .btn-primary:hover:not(:disabled) { background: var(--ink-2); }

    .btn-secondary, .btn-outline {
        border-color: var(--border-strong);
        color: var(--ink);
        background: var(--surface);
    }
    .btn-secondary:hover:not(:disabled), .btn-outline:hover:not(:disabled) {
        background: var(--surface-hover);
        border-color: var(--ink-3);
    }

    .btn-ghost { color: var(--ink-2); background: transparent; }
    .btn-ghost:hover:not(:disabled) { background: var(--surface-hover); color: var(--ink); }

    .btn-success {
        background: var(--st-ready);
        color: white;
        border-color: var(--st-ready);
        font-weight: 600;
    }
    .btn-success:hover:not(:disabled) { filter: brightness(0.95); }

    .btn-warning {
        background: var(--pri-high);
        color: white;
        border-color: var(--pri-high);
        font-weight: 600;
    }
    .btn-warning:hover:not(:disabled) { filter: brightness(0.95); }

    .btn-danger {
        background: var(--pri-urgent);
        color: white;
        border-color: var(--pri-urgent);
        font-weight: 600;
    }
    .btn-danger:hover:not(:disabled) { filter: brightness(0.95); }

    .btn-sm { height: 36px; padding: 0 var(--s-4); font-size: 13px; }
    .btn-lg { height: 52px; padding: 0 var(--s-6); font-size: 15px; font-weight: 600; }
    .btn-xl { height: 60px; padding: 0 var(--s-8); font-size: 16px; font-weight: 600; }
    .btn-block { width: 100%; }

    /* ════════════════════════════════════════════════════════════════
       FORMS
       ════════════════════════════════════════════════════════════════ */
    .form-group, .field { margin-bottom: var(--s-4); display: block; }
    .form-label, .field-label {
        display: block;
        font-size: 12px;
        color: var(--ink-mute);
        text-transform: uppercase;
        letter-spacing: 0.08em;
        font-weight: 500;
        margin-bottom: var(--s-2);
    }
    .form-input, .form-select, .form-textarea, .input, .textarea, .select {
        width: 100%;
        background: var(--surface);
        border: 1px solid var(--border-strong);
        border-radius: var(--r-md);
        padding: 0 var(--s-4);
        height: 48px;
        font-size: 15px;
        font-family: inherit;
        color: var(--ink);
        transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
    }
    .form-input::placeholder, .form-textarea::placeholder, .input::placeholder, .textarea::placeholder {
        color: var(--ink-faint);
    }
    .form-input:hover, .form-select:hover, .form-textarea:hover { border-color: var(--ink-3); }
    .form-input:focus, .form-select:focus, .form-textarea:focus,
    .input:focus, .textarea:focus, .select:focus {
        outline: none;
        border-color: var(--focus);
        box-shadow: 0 0 0 4px color-mix(in oklab, var(--focus) 8%, transparent);
    }
    .form-select, .select {
        appearance: none;
        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 fill='%238d8d92' d='M1.4 0L6 4.6 10.6 0 12 1.4l-6 6-6-6z'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 14px center;
        padding-right: 40px;
        cursor: pointer;
    }
    [data-theme="dark"] .form-select, [data-theme="dark"] .select {
        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 fill='%2374787e' d='M1.4 0L6 4.6 10.6 0 12 1.4l-6 6-6-6z'/%3E%3C/svg%3E");
    }
    .form-select option { background: var(--surface); color: var(--ink); }
    .form-textarea, .textarea {
        padding: var(--s-3) var(--s-4);
        height: auto;
        min-height: 96px;
        resize: vertical;
        line-height: 1.5;
    }

    .input-group { position: relative; }
    .input-group .input, .input-group .form-input { padding-left: 44px; }
    .input-group-icon {
        position: absolute;
        left: 14px; top: 50%;
        transform: translateY(-50%);
        color: var(--ink-mute);
        pointer-events: none;
    }
    .input-group-icon svg { width: 16px; height: 16px; }

    /* ════════════════════════════════════════════════════════════════
       CARDS
       ════════════════════════════════════════════════════════════════ */
    .card {
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: var(--r-lg);
        padding: var(--s-6);
        margin-bottom: var(--s-4);
    }
    .card-flat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); }
    .card-elevated { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-md); }
    .card-flush { padding: 0; overflow: hidden; }
    .card-link {
        display: block; text-align: left; width: 100%;
        transition: transform var(--duration-fast), border-color var(--duration-fast), background var(--duration-fast);
    }
    .card-link:hover { border-color: var(--border-strong); background: var(--surface-2); }
    .card-link:active { transform: translateY(1px); }

    .card-title {
        margin-bottom: var(--s-4);
        font-size: 16px;
        font-weight: 600;
        letter-spacing: -0.01em;
        color: var(--ink);
    }

    /* ════════════════════════════════════════════════════════════════
       PILLS / BADGES
       ════════════════════════════════════════════════════════════════ */
    .pill {
        display: inline-flex; align-items: center; gap: 6px;
        font-size: 12px; font-weight: 500;
        padding: 4px 10px;
        border-radius: 999px;
        background: var(--bg-inset);
        color: var(--ink-2);
        white-space: nowrap;
    }
    .pill-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
    .pill-strong { background: var(--ink); color: var(--accent-on); }

    .badge, .badge-pill {
        display: inline-flex; align-items: center;
        padding: 3px 10px;
        border-radius: 999px;
        font-size: 11px; font-weight: 500;
        line-height: 1.4;
        background: var(--bg-inset);
        color: var(--ink-2);
        border: 1px solid transparent;
    }

    /* Station pills — color-mixed background, full text color */
    .station-pill {
        --c: var(--ink);
        display: inline-flex; align-items: center; gap: 6px;
        font-size: 12px; font-weight: 500;
        padding: 4px 10px;
        border-radius: 999px;
        background: color-mix(in oklab, var(--c) 10%, var(--surface));
        color: var(--c);
        white-space: nowrap;
        line-height: 1.4;
    }
    [data-theme="dark"] .station-pill {
        background: color-mix(in oklab, var(--c) 18%, var(--surface));
    }
    .station-pill::before {
        content: ''; width: 6px; height: 6px; border-radius: 50%;
        background: var(--c);
    }
    .station-pill.station-intake,      [data-station="intake"]      { --c: var(--st-intake); }
    .station-pill.station-workshop_in, [data-station="workshop_in"] { --c: var(--st-workshop_in); }
    .station-pill.station-goldsmith,   [data-station="goldsmith"]   { --c: var(--st-goldsmith); }
    .station-pill.station-watchmaker,  [data-station="watchmaker"]  { --c: var(--st-watchmaker); }
    .station-pill.station-ready,       [data-station="ready"]       { --c: var(--st-ready); }
    .station-pill.station-picked_up,   [data-station="picked_up"]   { --c: var(--st-picked_up); }
    .station-pill.station-office,      [data-station="office"]      { --c: var(--st-office); }
    .station-pill.station-external,    [data-station="external"]    { --c: var(--st-external); }
    .station-pill.station-engraving,   [data-station="engraving"]   { --c: var(--st-engraving); }
    [data-station] { --station-color: var(--c); --station-bg: color-mix(in oklab, var(--c) 10%, var(--surface)); }
    .station-dot {
        display: inline-block; width: 8px; height: 8px;
        border-radius: 50%;
        background: var(--c, var(--ink-mute));
    }

    .priority-badge {
        display: inline-flex; align-items: center; gap: 6px;
        font-size: 11px; font-weight: 600;
        text-transform: uppercase; letter-spacing: 0.06em;
        font-family: var(--font-mono);
    }
    .priority-badge::before {
        content: ''; width: 6px; height: 6px; border-radius: 50%;
        background: currentColor;
    }
    .priority-badge.urgent { color: var(--pri-urgent); }
    .priority-badge.high   { color: var(--pri-high); }
    .priority-badge.normal { color: var(--ink-2); }
    .priority-badge.low    { color: var(--pri-low); }
    .priority-low    { color: var(--pri-low); }
    .priority-normal { color: var(--ink-2); }
    .priority-high   { color: var(--pri-high); }
    .priority-urgent { color: var(--pri-urgent); }

    .type-badge {
        display: inline-flex; align-items: center;
        padding: 3px var(--s-2);
        border-radius: var(--r-sm);
        font-size: 11px; font-weight: 500;
        line-height: 1.4;
        background: var(--bg-inset);
        color: var(--ink-2);
    }
    .type-badge.goldsmith  { background: color-mix(in oklab, var(--st-goldsmith) 10%, var(--surface)); color: var(--st-goldsmith); }
    .type-badge.watchmaker { background: color-mix(in oklab, var(--st-watchmaker) 10%, var(--surface)); color: var(--st-watchmaker); }

    .estimate-badge {
        display: inline-flex; align-items: center;
        padding: 2px var(--s-2);
        border-radius: var(--r-sm);
        font-size: 11px; font-weight: 500;
        line-height: 1.4;
    }
    .estimate-draft    { background: var(--bg-inset); color: var(--ink-mute); }
    .estimate-sent     { background: color-mix(in oklab, var(--st-intake) 10%, var(--surface)); color: var(--st-intake); }
    .estimate-accepted { background: color-mix(in oklab, var(--st-ready) 10%, var(--surface)); color: var(--st-ready); }
    .estimate-rejected { background: color-mix(in oklab, var(--pri-urgent) 10%, var(--surface)); color: var(--pri-urgent); }
    .kva-needed        { background: color-mix(in oklab, var(--st-goldsmith) 12%, var(--surface)); color: var(--st-goldsmith); }
    .kva-wait          { background: color-mix(in oklab, var(--st-workshop_in) 12%, var(--surface)); color: var(--st-workshop_in); }
    .badge-external    { background: color-mix(in oklab, var(--st-external) 12%, var(--surface)); color: var(--st-external); }
    .badge-engraving   { background: color-mix(in oklab, var(--st-engraving) 12%, var(--surface)); color: var(--st-engraving); }
    .engraving-block {
        text-align: left; margin-bottom: var(--s-4); padding: var(--s-3) var(--s-4);
        border-radius: var(--r-md);
        background: color-mix(in oklab, var(--st-engraving) 10%, var(--surface));
        border: 1px solid color-mix(in oklab, var(--st-engraving) 35%, var(--surface));
    }
    .engraving-block-title { font-size: .8rem; font-weight: 600; color: var(--st-engraving); margin-bottom: 4px; }
    .engraving-text { font-size: 1.15rem; font-weight: 600; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }

    /* KVA-Banner im Scan-Overlay — groß und unmissverständlich für die Werkbank */
    .kva-banner {
        border-radius: 12px;
        padding: 14px 16px;
        margin-bottom: 14px;
        text-align: left;
        border: 1.5px solid;
    }
    .kva-banner-title { font-weight: 700; font-size: 1.05rem; margin-bottom: 2px; }
    .kva-banner-sub   { font-size: 0.85rem; opacity: 0.9; line-height: 1.4; }
    .kva-banner.is-needed {
        background: color-mix(in oklab, var(--st-goldsmith) 12%, var(--surface));
        border-color: color-mix(in oklab, var(--st-goldsmith) 40%, var(--surface));
        color: var(--st-goldsmith);
    }
    .kva-banner.is-wait {
        background: color-mix(in oklab, var(--st-workshop_in) 12%, var(--surface));
        border-color: color-mix(in oklab, var(--st-workshop_in) 40%, var(--surface));
        color: var(--st-workshop_in);
    }
    .kva-banner.is-approved {
        background: color-mix(in oklab, var(--st-ready) 12%, var(--surface));
        border-color: color-mix(in oklab, var(--st-ready) 40%, var(--surface));
        color: var(--st-ready);
    }

    .days-badge {
        font-size: 12px;
        color: var(--ink-mute);
        font-weight: 500;
    }

    /* ════════════════════════════════════════════════════════════════
       STATUS STEPPER
       ════════════════════════════════════════════════════════════════ */
    .stepper {
        display: flex;
        align-items: center;
        gap: 0;
        width: 100%;
    }
    .stepper-step {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 6px;
        flex: 1;
        min-width: 0;
        position: relative;
    }
    .stepper-dot {
        width: 18px; height: 18px;
        border-radius: 50%;
        background: var(--surface);
        border: 1.5px solid var(--border-strong);
        position: relative;
        z-index: 1;
        transition: all 200ms;
    }
    .stepper-step.done .stepper-dot { background: var(--ink); border-color: var(--ink); }
    .stepper-step.current .stepper-dot {
        background: var(--surface);
        border-color: var(--ink);
        border-width: 4px;
        width: 22px; height: 22px;
    }
    .stepper-label {
        font-size: 11px;
        color: var(--ink-mute);
        font-weight: 500;
        white-space: nowrap;
        text-align: center;
    }
    .stepper-step.done .stepper-label,
    .stepper-step.current .stepper-label { color: var(--ink); }
    .stepper-line {
        flex: 1;
        height: 1.5px;
        background: var(--border-strong);
        margin: 0 -1px;
        margin-bottom: 22px;
        transition: background 200ms;
    }
    .stepper-line.done { background: var(--ink); }
    .stepper-compact { gap: 4px; }
    .stepper-compact .stepper-dot { width: 10px; height: 10px; border-width: 1.5px; }
    .stepper-compact .stepper-step.current .stepper-dot { width: 12px; height: 12px; border-width: 3px; }
    .stepper-compact .stepper-line { margin-bottom: 0; height: 1px; }
    .stepper-compact .stepper-label { display: none; }

    /* ════════════════════════════════════════════════════════════════
       ORDER CARDS
       ════════════════════════════════════════════════════════════════ */

    /* Compact row order card */
    .order-card {
        display: grid;
        grid-template-columns: 64px 1fr auto;
        gap: var(--s-5);
        padding: var(--s-5) var(--s-6);
        align-items: center;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: var(--r-lg);
        margin-bottom: var(--s-2);
        transition: background var(--duration-fast), border-color var(--duration-fast);
        position: relative;
    }
    .order-card:hover { background: var(--surface-2); border-color: var(--border-strong); }
    /* Karten ohne Vorschaubild (Büro-Anrufliste): Text links, Knöpfe rechts */
    .order-card--no-thumb { grid-template-columns: minmax(0, 1fr) auto; }

    /* Whole-card clickable variant (order lists) */
    .order-card--clickable { cursor: pointer; }
    .order-card--clickable:hover { box-shadow: var(--shadow-sm); }
    .order-card--clickable:active { transform: translateY(1px); }
    .order-card-chevron {
        display: inline-flex; align-items: center; gap: 4px;
        font-size: 13px; font-weight: 500;
        color: var(--ink-mute);
        white-space: nowrap;
        transition: color var(--duration-fast) var(--ease-out);
    }
    .order-card-chevron svg { width: 15px; height: 15px; transition: transform var(--duration-fast) var(--ease-out); }
    .order-card--clickable:hover .order-card-chevron { color: var(--ink); }
    .order-card--clickable:hover .order-card-chevron svg { transform: translateX(2px); }

    .order-card.priority-urgent { border-left: 3px solid var(--pri-urgent); }
    .order-card.priority-high   { border-left: 3px solid var(--pri-high); }
    .order-card.priority-normal { border-left: 3px solid transparent; }
    .order-card.priority-low    { border-left: 3px solid transparent; }

    .order-card-thumb {
        width: 64px; height: 64px;
        border-radius: var(--r-md);
        background: var(--bg-inset);
        display: grid; place-items: center;
        overflow: hidden;
        color: var(--ink-faint);
    }

    .order-card .order-info { min-width: 0; }
    .order-card-row { display: flex; align-items: baseline; gap: var(--s-3); flex-wrap: wrap; }
    .order-card-id, .order-card .order-number {
        font-family: var(--font-mono);
        font-size: 12px;
        color: var(--ink-mute);
        font-weight: 500;
    }
    .order-card-title { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; color: var(--ink); }
    .order-card .order-customer {
        font-size: 13px;
        color: var(--ink-2);
        margin-top: 2px;
        font-weight: 500;
    }
    .order-card .order-desc {
        font-size: 13px;
        color: var(--ink-3);
        margin-top: 2px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 100%;
    }
    .order-card .order-meta {
        display: flex; gap: var(--s-2);
        align-items: center;
        margin-top: var(--s-2);
        flex-wrap: wrap;
    }
    .order-card .order-actions, .order-card-right {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        gap: var(--s-2);
        flex-shrink: 0;
    }

    /* Big order card variant for grid */
    .order-card-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
        gap: var(--s-5);
    }
    .order-card-big {
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: var(--r-lg);
        padding: var(--s-6);
        display: flex;
        flex-direction: column;
        gap: var(--s-5);
        transition: border-color var(--duration-fast), transform var(--duration-fast);
        cursor: pointer;
        text-align: left;
        width: 100%;
    }
    .order-card-big:hover { border-color: var(--border-strong); }
    .order-card-big:active { transform: translateY(1px); }
    .order-card-big-head { display: flex; align-items: flex-start; gap: var(--s-4); }
    .order-card-big-thumb { width: 56px; height: 56px; border-radius: var(--r-md); flex-shrink: 0; background: var(--bg-inset); }
    .order-card-big-foot {
        display: flex; justify-content: space-between; align-items: center;
        padding-top: var(--s-4);
        border-top: 1px solid var(--divider);
        font-size: 13px;
    }

    /* Part order card (Bestellungen) */
    .part-order-card {
        display: flex;
        gap: var(--s-4);
        background: var(--surface);
        border: 1px solid var(--border);
        border-left: 3px solid var(--ink-mute);
        border-radius: var(--r-lg);
        padding: var(--s-4) var(--s-5);
        margin-bottom: var(--s-2);
        align-items: flex-start;
        transition: all var(--duration-fast);
    }
    .part-order-card:hover { box-shadow: var(--shadow-sm); border-color: var(--border-strong); }
    .part-order-card.is-pending {
        border-left-color: var(--st-office);
        background: color-mix(in oklab, var(--st-office) 4%, var(--surface));
    }
    .part-order-card.is-ordered {
        border-left-color: var(--st-intake);
        background: color-mix(in oklab, var(--st-intake) 4%, var(--surface));
    }

    /* ════════════════════════════════════════════════════════════════
       STATION CARDS / KPI / STATS
       ════════════════════════════════════════════════════════════════ */
    .station-card {
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: var(--r-lg);
        padding: var(--s-6);
        text-align: left;
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: var(--s-3);
        transition: border-color var(--duration-fast), transform var(--duration-fast);
        cursor: pointer;
        min-height: 144px;
        position: relative;
    }
    .station-card:hover { border-color: var(--border-strong); }
    .station-card:active { transform: translateY(1px); }
    .station-card::before { content: none; }
    .station-card .info h3 {
        font-size: 16px; font-weight: 600; letter-spacing: -0.01em;
        margin-bottom: 2px; color: var(--ink);
    }
    .station-card .info p { font-size: 12px; color: var(--ink-mute); }
    .station-card .count {
        font-family: var(--font-mono);
        font-size: 44px;
        font-weight: 500;
        letter-spacing: -0.04em;
        line-height: 1;
        color: var(--ink);
    }
    .station-card-head {
        display: flex; align-items: center; gap: var(--s-3);
        font-size: 12px;
        color: var(--ink-mute);
        text-transform: uppercase;
        letter-spacing: 0.08em;
        font-weight: 500;
    }
    .station-card-head::before {
        content: '';
        width: 8px; height: 8px; border-radius: 50%;
        background: var(--station-color, var(--ink));
    }

    .kpi-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: var(--s-5);
        margin-bottom: var(--s-6);
    }
    .kpi-card, .stat {
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: var(--r-lg);
        padding: var(--s-6);
    }
    .kpi-card .kpi-label, .stat-label {
        font-size: 12px;
        color: var(--ink-mute);
        text-transform: uppercase;
        letter-spacing: 0.08em;
        font-weight: 500;
        display: flex; align-items: center; gap: var(--s-2);
        margin-bottom: var(--s-3);
    }
    .kpi-card .kpi-value, .stat-val {
        font-family: var(--font-mono);
        font-size: 36px;
        font-weight: 500;
        letter-spacing: -0.04em;
        line-height: 1;
        color: var(--ink);
    }
    .kpi-card .kpi-sub, .stat-trend {
        font-size: 12px;
        color: var(--ink-mute);
        margin-top: var(--s-3);
        font-family: var(--font-mono);
    }
    .kpi-card.kpi-success .kpi-value { color: var(--st-ready); }
    .kpi-card.kpi-warning .kpi-value { color: var(--pri-high); }
    .kpi-card.kpi-danger  .kpi-value { color: var(--pri-urgent); }
    .kpi-card.kpi-info    .kpi-value { color: var(--st-intake); }
    .kpi-card.kpi-purple  .kpi-value { color: var(--st-office); }

    /* ════════════════════════════════════════════════════════════════
       INTAKE HERO (Annahme-Schnellzugriff)
       ════════════════════════════════════════════════════════════════ */
    .intake-hero {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr auto;
        gap: var(--s-8);
        align-items: center;
        background: var(--ink);
        color: var(--accent-on);
        border-radius: var(--r-xl);
        padding: var(--s-8) var(--s-10);
        margin-bottom: var(--s-8);
        position: relative;
        overflow: hidden;
        text-align: left;
        transition: transform 160ms var(--ease-spring), box-shadow 160ms;
        cursor: pointer;
        min-height: 168px;
        box-shadow: var(--shadow-md);
        border: none;
    }
    .intake-hero:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
    .intake-hero:active { transform: translateY(0); }
    .intake-hero-pattern {
        position: absolute; inset: 0;
        background:
            repeating-linear-gradient(
                135deg,
                transparent 0 22px,
                color-mix(in oklab, var(--accent-on) 4%, transparent) 22px 23px
            );
        pointer-events: none;
    }
    .intake-hero-content { position: relative; z-index: 1; min-width: 0; }
    .intake-hero-eyebrow {
        font-family: var(--font-mono);
        font-size: 12px;
        text-transform: uppercase;
        letter-spacing: 0.12em;
        color: color-mix(in oklab, var(--accent-on) 60%, transparent);
        margin-bottom: var(--s-3);
        display: inline-flex;
        align-items: center;
        gap: 10px;
    }
    .intake-hero-eyebrow::before {
        content: '';
        width: 24px; height: 1px;
        background: color-mix(in oklab, var(--accent-on) 60%, transparent);
    }
    .intake-hero-title {
        font-size: 44px;
        font-weight: 600;
        letter-spacing: -0.035em;
        line-height: 1.05;
        margin-bottom: var(--s-3);
    }
    .intake-hero-sub {
        font-size: 15px;
        color: color-mix(in oklab, var(--accent-on) 72%, transparent);
        max-width: 480px;
    }
    .intake-hero-cta { position: relative; z-index: 1; display: flex; align-items: center; justify-content: flex-end; }
    .intake-hero-plus {
        width: 88px; height: 88px;
        border-radius: 50%;
        background: var(--accent-on);
        color: var(--ink);
        display: grid;
        place-items: center;
        transition: transform 160ms var(--ease-spring);
        flex-shrink: 0;
    }
    .intake-hero-plus svg { width: 36px; height: 36px; }
    .intake-hero:hover .intake-hero-plus { transform: rotate(90deg) scale(1.05); }

    @media (max-width: 768px) {
        .intake-hero { padding: var(--s-6); grid-template-columns: 1fr; gap: var(--s-4); min-height: auto; }
        .intake-hero-title { font-size: 32px; }
        .intake-hero-plus { width: 64px; height: 64px; }
        .intake-hero-plus svg { width: 28px; height: 28px; }
        .intake-hero-cta { justify-content: flex-start; }
    }

    /* ════════════════════════════════════════════════════════════════
       CHOICE CARDS (radio-like large picker)
       ════════════════════════════════════════════════════════════════ */
    .choice-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: var(--s-4);
    }
    @media (max-width: 640px) { .choice-grid { grid-template-columns: 1fr; } }
    .choice-card {
        display: grid;
        grid-template-columns: 48px 1fr 24px;
        gap: var(--s-4);
        align-items: center;
        background: var(--surface);
        border: 1.5px solid var(--border-strong);
        border-radius: var(--r-lg);
        padding: var(--s-5) var(--s-6);
        text-align: left;
        width: 100%;
        min-height: 84px;
        transition: border-color var(--duration-fast), background var(--duration-fast), transform 80ms;
        cursor: pointer;
    }
    .choice-card:hover { border-color: var(--ink-3); background: var(--surface-2); }
    .choice-card:active { transform: translateY(0.5px); }
    .choice-card.active {
        border-color: var(--ink);
        background: var(--surface);
        box-shadow: 0 0 0 3px color-mix(in oklab, var(--ink) 8%, transparent);
    }
    .choice-card-icon {
        width: 48px; height: 48px;
        border-radius: 12px;
        background: var(--bg-inset);
        display: grid; place-items: center;
        color: var(--ink-2);
        flex-shrink: 0;
    }
    .choice-card-icon svg { width: 22px; height: 22px; }
    .choice-card.active .choice-card-icon { background: var(--ink); color: var(--accent-on); }
    .choice-card-body { min-width: 0; }
    .choice-card-title { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; color: var(--ink); margin-bottom: 2px; }
    .choice-card-sub { font-size: 13px; color: var(--ink-mute); }
    .choice-card-radio {
        width: 22px; height: 22px;
        border-radius: 50%;
        border: 1.5px solid var(--border-strong);
        background: var(--surface);
        transition: border-color var(--duration-fast), background var(--duration-fast);
    }
    .choice-card.active .choice-card-radio {
        border-color: var(--ink);
        border-width: 6px;
    }

    /* ════════════════════════════════════════════════════════════════
       CHIP GROUP (multi-select chips)
       ════════════════════════════════════════════════════════════════ */
    .chip-group { display: flex; flex-wrap: wrap; gap: 8px; }
    .chip {
        display: inline-flex; align-items: center; gap: 8px;
        padding: 10px 14px 10px 10px;
        background: var(--surface);
        border: 1.5px solid var(--border-strong);
        border-radius: var(--r-md);
        font-size: 14px;
        font-weight: 500;
        color: var(--ink-2);
        transition: border-color var(--duration-fast), background var(--duration-fast), color var(--duration-fast);
        min-height: 44px;
        cursor: pointer;
        white-space: nowrap;
        text-align: left;
    }
    .chip:hover { border-color: var(--ink-3); background: var(--surface-2); }
    .chip-check {
        width: 20px; height: 20px;
        border-radius: 5px;
        border: 1.5px solid var(--border-strong);
        background: var(--surface);
        display: grid; place-items: center;
        transition: background var(--duration-fast), border-color var(--duration-fast);
        flex-shrink: 0;
    }
    .chip-check svg { width: 14px; height: 14px; color: var(--accent-on); }
    .chip.active { border-color: var(--ink); background: var(--surface); color: var(--ink); }
    .chip.active .chip-check { background: var(--ink); border-color: var(--ink); }
    .chip-label { font-weight: 500; }
    .chip-expand { font-size: 12px; color: var(--ink-mute); font-weight: 400; margin-left: 2px; }
    .chip.active .chip-expand { color: var(--ink-3); }

    /* Admin employee / order rows */
    .admin-emp-row {
        display: flex;
        align-items: center;
        gap: var(--s-3);
        padding: var(--s-3) 0;
        border-bottom: 1px solid var(--divider);
    }
    .admin-emp-row:last-child { border-bottom: none; }
    .admin-emp-row.is-inactive { opacity: 0.55; }

    /* ════════════════════════════════════════════════════════════════
       KV LIST / DETAIL ROWS
       ════════════════════════════════════════════════════════════════ */
    .kv-list { display: grid; gap: var(--s-3); }
    .kv {
        display: grid;
        grid-template-columns: 140px 1fr;
        gap: var(--s-4);
        align-items: baseline;
        padding: var(--s-3) 0;
        border-bottom: 1px solid var(--divider);
    }
    .kv:last-child { border-bottom: none; }
    .kv-key {
        font-size: 12px; color: var(--ink-mute);
        text-transform: uppercase; letter-spacing: 0.06em; font-weight: 500;
    }
    .kv-val { font-size: 15px; color: var(--ink); }

    .detail-section {
        margin-bottom: var(--s-5);
        padding-bottom: var(--s-5);
        border-bottom: 1px solid var(--divider);
    }
    .detail-section:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
    .detail-row {
        display: flex;
        justify-content: space-between;
        gap: var(--s-3);
        padding: var(--s-2) 0;
        font-size: 13px;
    }
    .detail-row .label { color: var(--ink-mute); }
    .detail-row .value {
        font-weight: 500;
        text-align: right;
        color: var(--ink);
    }

    /* ════════════════════════════════════════════════════════════════
       TIMELINE
       ════════════════════════════════════════════════════════════════ */
    .timeline { position: relative; padding-left: 28px; }
    .timeline::before {
        content: '';
        position: absolute;
        left: 8px; top: 8px; bottom: 8px;
        width: 1.5px;
        background: var(--border-strong);
    }
    .timeline-item {
        position: relative;
        padding-bottom: var(--s-5);
        display: flex; gap: 0;
    }
    .timeline-item:last-child { padding-bottom: 0; }
    .timeline-item::before {
        content: '';
        position: absolute;
        left: -28px;
        top: 6px;
        width: 17px; height: 17px;
        border-radius: 50%;
        background: var(--surface);
        border: 1.5px solid var(--border-strong);
    }
    .timeline-item.done::before { background: var(--ink); border-color: var(--ink); }
    .timeline-dot { display: none; }
    .timeline-content { flex: 1; min-width: 0; }
    .timeline-station {
        font-weight: 600; font-size: 14px;
        color: var(--ink);
    }
    .timeline-meta {
        font-size: 11px;
        color: var(--ink-mute);
        font-family: var(--font-mono);
        margin-top: 2px;
    }

    /* ════════════════════════════════════════════════════════════════
       ACTIVITY FEED
       ════════════════════════════════════════════════════════════════ */
    .activity-row {
        display: grid;
        grid-template-columns: auto 1fr auto;
        gap: var(--s-3);
        padding: var(--s-3) var(--s-5);
        align-items: center;
        border-bottom: 1px solid var(--divider);
        font-size: 14px;
        cursor: pointer;
        transition: background var(--duration-fast);
    }
    .activity-row:last-child { border-bottom: none; }
    .activity-row:hover { background: var(--surface-2); }
    .activity-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--ink)); }
    .activity-item {
        display: flex;
        gap: var(--s-3);
        padding: var(--s-3) 0;
        border-bottom: 1px solid var(--divider);
        font-size: 14px;
    }
    .activity-item:last-child { border-bottom: none; }
    .activity-time { font-size: 11px; color: var(--ink-mute); font-family: var(--font-mono); margin-top: 2px; }

    /* ════════════════════════════════════════════════════════════════
       SEARCH / QUICK SEARCH
       ════════════════════════════════════════════════════════════════ */
    .quick-search-card {
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: var(--r-lg);
        padding: var(--s-3);
        margin-bottom: var(--s-5);
        position: relative;
        z-index: 50;
    }
    .quick-search-card .search-results { max-height: 50vh; }

    .search-container { position: relative; }
    .search-results {
        position: absolute;
        top: calc(100% + 4px);
        left: 0; right: 0;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: var(--r-md);
        max-height: 300px;
        overflow-y: auto;
        z-index: 1000;
        box-shadow: var(--shadow-lg);
        display: none;
    }
    .search-results.open { display: block; }
    .search-result-item {
        padding: var(--s-3) var(--s-4);
        cursor: pointer;
        border-bottom: 1px solid var(--divider);
        font-size: 14px;
        transition: background var(--duration-fast);
    }
    .search-result-item:last-child { border-bottom: none; }
    .search-result-item:hover { background: var(--surface-hover); }
    .search-result-item .name { font-weight: 600; color: var(--ink); }
    .search-result-item .detail {
        font-size: 12px;
        color: var(--ink-mute);
        margin-top: 2px;
    }

    /* ════════════════════════════════════════════════════════════════
       TOAST
       ════════════════════════════════════════════════════════════════ */
    .toast-container {
        position: fixed;
        top: calc(var(--topbar-h) + var(--s-3));
        right: var(--s-4);
        z-index: 200;
        display: flex;
        flex-direction: column;
        gap: var(--s-2);
        pointer-events: none;
    }
    .toast {
        background: var(--ink);
        color: var(--accent-on);
        padding: 12px 18px;
        border-radius: 999px;
        font-size: 13px;
        font-weight: 500;
        box-shadow: var(--shadow-lg);
        animation: toastIn 220ms var(--ease-spring);
        max-width: 380px;
        pointer-events: auto;
    }
    .toast.success { background: var(--st-ready); color: white; }
    .toast.error   { background: var(--pri-urgent); color: white; }
    .toast.info    { background: var(--ink); color: var(--accent-on); }
    @keyframes toastIn {
        from { transform: translateX(20px); opacity: 0; }
        to   { transform: translateX(0); opacity: 1; }
    }

    /* ════════════════════════════════════════════════════════════════
       LOADING / EMPTY STATES
       ════════════════════════════════════════════════════════════════ */
    .spinner {
        display: inline-block;
        width: 22px; height: 22px;
        border: 2px solid var(--border);
        border-top-color: var(--ink);
        border-radius: 50%;
        animation: spin 0.8s linear infinite;
    }
    @keyframes spin { to { transform: rotate(360deg); } }
    .loading-overlay {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: var(--s-12) var(--s-5);
        flex-direction: column;
        gap: var(--s-3);
        color: var(--ink-mute);
        font-size: 13px;
    }
    .empty, .empty-state {
        text-align: center;
        padding: var(--s-12) var(--s-5);
        color: var(--ink-mute);
    }
    .empty-mark, .empty-state svg {
        width: 48px; height: 48px;
        margin: 0 auto var(--s-3);
        color: var(--ink-mute);
        opacity: 0.5;
    }
    .empty-mark {
        border-radius: 50%;
        background: var(--bg-inset);
        display: grid; place-items: center;
        opacity: 1;
    }
    .empty-state h3, .empty h3 {
        font-size: 15px; font-weight: 600; color: var(--ink);
        margin-bottom: var(--s-1);
    }
    .empty-state p, .empty p { font-size: 13px; color: var(--ink-mute); }

    /* ════════════════════════════════════════════════════════════════
       QR SCANNER + SCAN OVERLAY
       ════════════════════════════════════════════════════════════════ */
    #qr-reader { width: 100%; max-width: 500px; margin: 0 auto; border-radius: var(--r-lg); overflow: hidden; }
    #qr-reader video { border-radius: var(--r-lg); }

    .scan-result-overlay {
        position: fixed;
        inset: 0;
        background: var(--overlay-bg);
        backdrop-filter: blur(6px);
        -webkit-backdrop-filter: blur(6px);
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 150;
        padding: var(--s-4);
        animation: overlayIn 200ms var(--ease-out);
    }
    @keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }
    .scan-result-card {
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: var(--r-xl);
        padding: var(--s-6);
        max-width: 460px;
        width: 100%;
        max-height: 90vh;
        overflow-y: auto;
        text-align: center;
        box-shadow: var(--shadow-lg);
        animation: cardIn 280ms var(--ease-spring);
    }
    @keyframes cardIn {
        from { opacity: 0; transform: translateY(10px) scale(0.96); }
        to   { opacity: 1; transform: translateY(0) scale(1); }
    }
    .scan-success-icon {
        width: 56px; height: 56px;
        border-radius: 50%;
        background: var(--ink);
        color: var(--accent-on);
        display: grid; place-items: center;
        margin: 0 auto var(--s-4);
    }
    .scan-success-icon svg { width: 28px; height: 28px; stroke-width: 2.5; color: var(--accent-on); }

    /* Scan price card (Kasse) */
    .scan-price-card {
        margin: var(--s-2) 0 var(--s-5);
        padding: var(--s-5) var(--s-4);
        background: var(--bg-inset);
        border: 1.5px solid var(--border-strong);
        border-radius: var(--r-lg);
        text-align: center;
    }
    .scan-price-card.is-success { border-color: var(--st-ready); }
    .scan-price-card.is-info { border-color: var(--st-intake); }
    .scan-price-card .price-label {
        font-size: 11px; color: var(--ink-mute);
        font-weight: 500; letter-spacing: 0.08em;
        text-transform: uppercase;
        margin-bottom: var(--s-1);
    }
    .scan-price-card .price-value {
        font-family: var(--font-mono);
        font-size: 36px;
        font-weight: 500;
        line-height: 1.1;
        letter-spacing: -0.04em;
    }
    .scan-price-card.is-success .price-value { color: var(--st-ready); }
    .scan-price-card.is-info .price-value    { color: var(--st-intake); }
    .scan-price-card.is-muted .price-value   { color: var(--ink-mute); font-size: 15px; font-weight: 500; }
    .scan-price-card .price-deposit { margin-top: var(--s-2); font-size: 14px; color: var(--ink-2); }
    .scan-price-card .price-deposit-nr { margin-top: var(--s-1); font-size: 14px; color: var(--ink-2); }
    .scan-price-card .price-deposit-nr strong { font-size: 16px; color: var(--ink); letter-spacing: 0.02em; }
    .price-pill {
        display: inline-block;
        margin-top: var(--s-2);
        padding: 4px 12px;
        color: white;
        font-size: 11px; font-weight: 600;
        border-radius: 999px;
        text-transform: uppercase;
        letter-spacing: 0.06em;
    }
    .price-pill.is-paid   { background: var(--st-ready); }
    .price-pill.is-unpaid { background: var(--pri-high); }

    /* Werkbank → Bestellung block */
    .scan-block {
        margin-bottom: var(--s-4);
        padding: var(--s-4);
        border: 1.5px dashed var(--pri-high);
        border-radius: var(--r-lg);
        background: color-mix(in oklab, var(--pri-high) 6%, var(--surface));
        text-align: left;
    }
    .scan-block .scan-block-title {
        font-size: 12px;
        color: var(--pri-high);
        margin-bottom: var(--s-2);
        font-weight: 600;
        letter-spacing: 0.06em;
        text-transform: uppercase;
    }
    .scan-section { margin-bottom: var(--s-3); text-align: left; }
    .scan-section-label {
        display: block;
        font-size: 11px;
        color: var(--ink-mute);
        margin-bottom: var(--s-2);
        font-weight: 500;
        text-transform: uppercase;
        letter-spacing: 0.06em;
    }
    .scan-quick-tags {
        display: flex; flex-wrap: wrap; gap: var(--s-1);
        margin-bottom: var(--s-2);
    }
    .scan-quick-tags .btn { font-size: 12px; padding: 0 var(--s-3); height: 40px; min-height: 40px; min-width: 0; }
    .scan-price-input { position: relative; }
    .scan-price-input input {
        padding-right: 36px;
        font-family: var(--font-mono);
        font-size: 16px;
        font-weight: 500;
    }
    .scan-price-input span {
        position: absolute;
        right: var(--s-3);
        top: 50%;
        transform: translateY(-50%);
        color: var(--ink-mute);
        font-size: 15px;
        font-weight: 500;
        pointer-events: none;
    }

    /* ════════════════════════════════════════════════════════════════
       MODAL
       ════════════════════════════════════════════════════════════════ */
    .modal-overlay, .scrim {
        position: fixed; inset: 0;
        background: var(--overlay-bg);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        display: flex;
        align-items: center;
        justify-content: center;
        /* über dem Scan-Blatt (.sheet-overlay 150) und der Erfolgsmeldung (.flash 200),
           damit Rückfragen aus dem Blatt heraus sichtbar sind */
        z-index: 250;
        padding: var(--s-4);
        animation: overlayIn 200ms var(--ease-out);
    }
    .modal {
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: var(--r-xl);
        padding: var(--s-6);
        max-width: 520px;
        width: 100%;
        max-height: 90vh;
        overflow-y: auto;
        box-shadow: var(--shadow-lg);
        animation: cardIn 280ms var(--ease-spring);
    }
    .modal h2 {
        margin-bottom: var(--s-4);
        letter-spacing: -0.02em;
        font-size: 20px;
        font-weight: 600;
        color: var(--ink);
    }

    /* ════════════════════════════════════════════════════════════════
       SETUP SCREEN
       ════════════════════════════════════════════════════════════════ */
    .setup-screen {
        min-height: 100vh;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: var(--s-5);
        background: var(--bg);
    }
    .setup-card {
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: var(--r-xl);
        padding: var(--s-12) var(--s-8);
        max-width: 560px;
        width: 100%;
        box-shadow: var(--shadow-md);
        text-align: center;
    }
    .setup-card h1 {
        font-size: 32px;
        margin-bottom: var(--s-2);
        letter-spacing: -0.03em;
        font-weight: 600;
        color: var(--ink);
    }
    .setup-card > p {
        color: var(--ink-mute);
        margin-bottom: var(--s-8);
        font-size: 15px;
    }
    .station-select-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: var(--s-2);
        margin-bottom: var(--s-6);
    }
    .station-select-btn {
        padding: var(--s-5);
        border: 1.5px solid var(--border-strong);
        border-radius: var(--r-md);
        background: var(--surface);
        cursor: pointer;
        font-size: 14px;
        font-weight: 600;
        font-family: inherit;
        transition: all var(--duration-fast);
        min-height: 72px;
        color: var(--ink-2);
        text-align: center;
    }
    .station-select-btn:hover {
        background: var(--surface-hover);
        border-color: var(--ink-3);
    }
    .station-select-btn[data-code="intake"]:hover,
    .station-select-btn[data-code="workshop_in"]:hover,
    .station-select-btn[data-code="goldsmith"]:hover,
    .station-select-btn[data-code="watchmaker"]:hover,
    .station-select-btn[data-code="engraving"]:hover,
    .station-select-btn[data-code="office"]:hover { color: var(--ink); }
    .station-select-btn.selected {
        border-color: var(--ink);
        background: var(--surface);
        color: var(--ink);
        box-shadow: 0 0 0 3px color-mix(in oklab, var(--ink) 8%, transparent);
    }

    /* ════════════════════════════════════════════════════════════════
       CUSTOMERS
       ════════════════════════════════════════════════════════════════ */
    .customer-item {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: var(--s-3);
        padding: var(--s-4) var(--s-5);
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: var(--r-lg);
        margin-bottom: var(--s-2);
        cursor: pointer;
        transition: all var(--duration-fast);
    }
    .customer-item:hover {
        border-color: var(--border-strong);
        background: var(--surface-2);
    }

    /* ════════════════════════════════════════════════════════════════
       TOGGLE / SEGMENTED / TABS
       ════════════════════════════════════════════════════════════════ */
    .toggle-group, .segmented {
        display: inline-flex;
        flex-wrap: wrap; /* schmale Bildschirme: umbrechen statt seitlich scrollen */
        max-width: 100%;
        background: var(--bg-inset);
        border-radius: var(--r-md);
        padding: 3px;
        gap: 2px;
    }
    .toggle-btn, .segmented button {
        padding: 0 var(--s-4);
        min-height: 36px;
        border: none;
        background: transparent;
        color: var(--ink-mute);
        font-size: 13px;
        font-weight: 500;
        font-family: inherit;
        cursor: pointer;
        transition: all var(--duration-fast);
        border-radius: 7px;
        white-space: nowrap;
    }
    .toggle-btn:hover, .segmented button:hover { color: var(--ink); }
    .toggle-btn:disabled { opacity: .4; cursor: not-allowed; }
    .toggle-btn.active, .segmented button.active {
        background: var(--surface);
        color: var(--ink);
        box-shadow: var(--shadow-sm);
    }

    .priority-group {
        display: flex;
        background: var(--bg-inset);
        border-radius: var(--r-md);
        padding: 3px;
        gap: 2px;
    }
    .priority-btn {
        flex: 1;
        padding: 0 var(--s-2);
        min-height: 40px;
        border: none;
        background: transparent;
        color: var(--ink-mute);
        font-size: 13px; font-weight: 500;
        font-family: inherit;
        cursor: pointer;
        transition: all var(--duration-fast);
        border-radius: 7px;
    }
    .priority-btn:hover { color: var(--ink); }
    .priority-btn.active-low      { background: var(--surface); color: var(--ink-2); box-shadow: var(--shadow-sm); }
    .priority-btn.active-normal   { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
    .priority-btn.active-high     { background: color-mix(in oklab, var(--pri-high) 14%, var(--surface)); color: var(--pri-high); box-shadow: var(--shadow-sm); }
    .priority-btn.active-urgent   { background: color-mix(in oklab, var(--pri-urgent) 14%, var(--surface)); color: var(--pri-urgent); box-shadow: var(--shadow-sm); }

    .tabs {
        display: flex;
        gap: 2px;
        border-bottom: 1px solid var(--border);
        margin-bottom: var(--s-6);
    }
    .tab {
        padding: 10px 16px;
        font-size: 14px;
        font-weight: 500;
        color: var(--ink-mute);
        position: relative;
        min-height: 44px;
        white-space: nowrap;
    }
    .tab:hover { color: var(--ink-2); }
    .tab.active { color: var(--ink); }
    .tab.active::after {
        content: '';
        position: absolute;
        left: 0; right: 0; bottom: -1px;
        height: 2px;
        background: var(--ink);
        border-radius: 1px 1px 0 0;
    }
    .tab-count {
        font-family: var(--font-mono);
        font-size: 11px;
        background: var(--bg-inset);
        color: var(--ink-3);
        padding: 1px 7px;
        border-radius: 10px;
        margin-left: 8px;
        font-weight: 500;
    }

    /* ════════════════════════════════════════════════════════════════
       PHOTOS
       ════════════════════════════════════════════════════════════════ */
    .photo-thumb { position: relative; display: inline-block; }
    .photo-thumb img {
        width: 120px; height: 120px;
        object-fit: cover;
        border-radius: var(--r-md);
        border: 1px solid var(--border);
        cursor: pointer;
        display: block;
    }
    .photo-thumb-del {
        position: absolute;
        top: -8px; right: -8px;
        width: 24px; height: 24px;
        border-radius: 50%;
        background: var(--pri-urgent);
        color: white;
        border: 2px solid var(--surface);
        font-size: 14px; font-weight: bold;
        line-height: 1;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .photo-thumb-del:hover { filter: brightness(1.1); }
    .photo-thumb img { cursor: zoom-in; }

    /* Image lightbox (popup viewer) */
    .lightbox-overlay {
        position: fixed; inset: 0;
        background: rgba(0,0,0,0.86);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        display: flex; align-items: center; justify-content: center;
        z-index: 400;
        padding: var(--s-6);
        cursor: zoom-out;
        animation: overlayIn 180ms var(--ease-out);
    }
    .lightbox-img {
        max-width: 92vw;
        max-height: 90vh;
        object-fit: contain;
        border-radius: var(--r-md);
        box-shadow: 0 20px 60px rgba(0,0,0,0.5);
        cursor: default;
        animation: cardIn 220ms var(--ease-spring);
    }
    .lightbox-close {
        position: fixed;
        top: 16px; right: 20px;
        width: 44px; height: 44px;
        border-radius: 50%;
        background: rgba(255,255,255,0.14);
        color: #fff;
        border: none;
        font-size: 26px;
        line-height: 1;
        cursor: pointer;
        display: grid; place-items: center;
        transition: background var(--duration-fast) var(--ease-out);
    }
    .lightbox-close:hover { background: rgba(255,255,255,0.28); }

    .photo-ph {
        width: 100%; height: 100%;
        background: linear-gradient(135deg, var(--ph-1, #e8d9b8), var(--ph-2, #b8993e));
        border-radius: inherit;
        position: relative;
        display: grid;
        place-items: center;
    }
    .photo-ph::before {
        content: '';
        position: absolute; inset: 0;
        background: repeating-linear-gradient(45deg, transparent 0 6px, rgba(255,255,255,0.08) 6px 7px);
        border-radius: inherit;
    }

    /* ════════════════════════════════════════════════════════════════
       TUTORIAL OVERLAY
       ════════════════════════════════════════════════════════════════ */
    .tutorial-overlay { position: fixed; inset: 0; z-index: 10000; pointer-events: none; }
    .tutorial-backdrop { position: fixed; inset: 0; z-index: 10001; pointer-events: auto; }
    .tutorial-spotlight {
        position: absolute;
        z-index: 10002;
        border-radius: var(--r-md);
        box-shadow: 0 0 0 9999px rgba(0,0,0,0.7);
        pointer-events: none;
        transition: all 400ms var(--ease-out);
    }
    [data-theme="dark"] .tutorial-spotlight { box-shadow: 0 0 0 9999px rgba(0,0,0,0.85); }
    .tutorial-card {
        position: absolute;
        z-index: 10003;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: var(--r-lg);
        padding: var(--s-6) var(--s-5) var(--s-5);
        max-width: 380px;
        width: calc(100vw - 32px);
        box-shadow: var(--shadow-lg);
        pointer-events: auto;
        animation: cardIn 280ms var(--ease-spring);
    }
    .tutorial-card-step {
        font-family: var(--font-mono);
        font-size: 11px;
        font-weight: 600;
        color: var(--ink);
        text-transform: uppercase;
        letter-spacing: 0.08em;
        margin-bottom: var(--s-2);
    }
    .tutorial-card-title {
        font-size: 18px;
        font-weight: 600;
        color: var(--ink);
        margin-bottom: var(--s-2);
        letter-spacing: -0.015em;
    }
    .tutorial-card-text {
        font-size: 14px;
        color: var(--ink-2);
        line-height: 1.5;
        margin-bottom: var(--s-5);
    }
    .tutorial-card-actions {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: var(--s-3);
    }
    .tutorial-card-actions .tutorial-dots { display: flex; gap: 6px; }
    .tutorial-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--border-strong); transition: all var(--duration-fast); }
    .tutorial-dot.active { background: var(--ink); width: 18px; border-radius: 999px; }
    .tutorial-dot.done { background: var(--st-ready); }
    .tutorial-btn {
        padding: var(--s-2) var(--s-5);
        border-radius: var(--r-md);
        font-size: 13px;
        font-weight: 500;
        font-family: inherit;
        cursor: pointer;
        border: none;
        transition: all var(--duration-fast);
        min-height: 36px;
    }
    .tutorial-btn-primary { background: var(--ink); color: var(--accent-on); }
    .tutorial-btn-primary:hover { background: var(--ink-2); }
    .tutorial-btn-secondary { background: transparent; color: var(--ink-mute); }
    .tutorial-btn-secondary:hover { color: var(--ink); background: var(--surface-hover); }
    .tutorial-btn-skip {
        background: transparent;
        color: var(--ink-mute);
        font-size: 12px;
        padding: var(--s-2) var(--s-3);
    }
    .tutorial-welcome {
        position: fixed; inset: 0;
        z-index: 10005;
        display: flex;
        align-items: center;
        justify-content: center;
        background: var(--overlay-bg);
        backdrop-filter: blur(8px);
        pointer-events: auto;
        animation: overlayIn 320ms var(--ease-out);
    }
    .tutorial-welcome-card {
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: var(--r-xl);
        padding: var(--s-10) var(--s-8);
        max-width: 460px;
        width: calc(100vw - 32px);
        text-align: center;
        box-shadow: var(--shadow-lg);
        animation: cardIn 380ms var(--ease-spring);
    }
    .tutorial-welcome-card h2 {
        font-size: 24px;
        font-weight: 600;
        margin-bottom: var(--s-3);
        letter-spacing: -0.02em;
        color: var(--ink);
    }
    .tutorial-welcome-card p {
        font-size: 15px;
        color: var(--ink-2);
        line-height: 1.5;
        margin-bottom: var(--s-8);
    }
    .tutorial-welcome-card .tutorial-btn {
        width: 100%;
        padding: var(--s-4);
        font-size: 15px;
        margin-bottom: var(--s-2);
        min-height: 52px;
    }

    /* ════════════════════════════════════════════════════════════════
       LINKS / QR / PRINT
       ════════════════════════════════════════════════════════════════ */
    a { color: var(--ink); text-decoration: none; font-weight: 500; }
    /* Nur einfache Textlinks unterstreichen, nicht Karten und Knöpfe aus <a> */
    a:not([class]):hover { text-decoration: underline; }
    a.muted { color: var(--ink-mute); }

    .modal img[src*="/qr"], .card img[src*="/qr"] {
        border-radius: var(--r-md);
        padding: var(--s-3);
        background: white;
    }

    .print-view {
        position: fixed; inset: 0;
        background: white;
        z-index: 300;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-direction: column;
        padding: var(--s-5);
    }
    .print-label {
        text-align: center;
        padding: var(--s-5);
        border: 2px dashed var(--ink-mute);
        width: 300px;
    }
    @media print {
        body { background: white; color: black; }
        .no-print { display: none !important; }
        .print-label { border: none; }
    }

    /* ════════════════════════════════════════════════════════════════
       UTILITIES
       ════════════════════════════════════════════════════════════════ */
    .stack { display: flex; flex-direction: column; }
    .row { display: flex; flex-direction: row; align-items: center; gap: var(--s-4); flex-wrap: wrap; }
    .row.tight { gap: var(--s-2); }
    .row-between { display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: var(--s-4); }
    .row-wrap { flex-wrap: wrap; }
    .col { display: flex; flex-direction: column; gap: var(--s-4); }
    .col.tight { gap: var(--s-2); }
    .center { display: flex; align-items: center; justify-content: center; }
    .grow { flex: 1 1 auto; min-width: 0; }
    .flex-1 { flex: 1; }
    .shrink-0 { flex-shrink: 0; }
    .items-center { align-items: center; }
    .justify-between { justify-content: space-between; }

    .gap-1 { gap: var(--s-1); } .gap-2 { gap: var(--s-2); } .gap-3 { gap: var(--s-3); }
    .gap-4 { gap: var(--s-4); } .gap-5 { gap: var(--s-5); } .gap-6 { gap: var(--s-6); }
    .gap-8 { gap: var(--s-8); }
    .gap-12 { gap: var(--s-3); } .gap-16 { gap: var(--s-4); }

    .mt-1 { margin-top: var(--s-1); } .mt-2 { margin-top: var(--s-2); }
    .mt-3 { margin-top: var(--s-3); } .mt-4 { margin-top: var(--s-4); }
    .mt-5 { margin-top: var(--s-5); } .mt-6 { margin-top: var(--s-6); }
    .mt-8 { margin-top: var(--s-8); }
    .mb-1 { margin-bottom: var(--s-1); } .mb-2 { margin-bottom: var(--s-2); }
    .mb-3 { margin-bottom: var(--s-3); } .mb-4 { margin-bottom: var(--s-4); }
    .mb-5 { margin-bottom: var(--s-5); } .mb-6 { margin-bottom: var(--s-6); }
    .mb-8 { margin-bottom: var(--s-8); }
    .mt-16 { margin-top: var(--s-4); } .mt-24 { margin-top: var(--s-6); }
    .mb-16 { margin-bottom: var(--s-4); } .mb-24 { margin-bottom: var(--s-6); }
    .my-2 { margin-top: var(--s-2); margin-bottom: var(--s-2); }
    .my-3 { margin-top: var(--s-3); margin-bottom: var(--s-3); }
    .my-4 { margin-top: var(--s-4); margin-bottom: var(--s-4); }

    .p-3 { padding: var(--s-3); } .p-4 { padding: var(--s-4); } .p-5 { padding: var(--s-5); }

    .text-center { text-align: center; }
    .text-right { text-align: right; }
    .text-secondary { color: var(--ink-2); }
    .text-muted { color: var(--ink-mute); }
    .text-success { color: var(--st-ready); }
    .text-danger { color: var(--pri-urgent); }
    .text-warning { color: var(--pri-high); }
    .text-brand { color: var(--ink); }

    .text-2xs { font-size: 11px; }
    .text-xs { font-size: 12px; }
    .text-sm { font-size: 13px; }
    .text-base { font-size: 14px; }
    .text-md { font-size: 15px; }
    .text-lg { font-size: 17px; }
    .text-xl { font-size: 20px; }
    .text-2xl { font-size: 28px; }
    .text-3xl { font-size: 36px; }

    .font-normal { font-weight: 400; }
    .font-medium, .fw-500 { font-weight: 500; }
    .font-semibold, .fw-600 { font-weight: 600; }
    .font-bold { font-weight: 700; }
    .truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

    .flex { display: flex; }
    .flex-wrap { flex-wrap: wrap; }
    .hidden { display: none !important; }
    .w-full { width: 100%; }

    .border { border: 1px solid var(--border); }
    .border-t { border-top: 1px solid var(--border); }
    .border-b { border-bottom: 1px solid var(--border); }
    .rounded { border-radius: var(--r-md); }
    .rounded-lg { border-radius: var(--r-lg); }

    .surface { background: var(--surface); }
    .surface-muted { background: var(--bg-inset); }
    .surface-subtle { background: var(--surface-2); }

    .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-5); }
    .grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-5); }
    .grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-5); }
    .grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--s-5); }
    @media (max-width: 1024px) {
        .grid-4 { grid-template-columns: repeat(2, 1fr); }
        .grid-3 { grid-template-columns: repeat(2, 1fr); }
    }
    @media (max-width: 640px) {
        .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    }

    @media (max-width: 768px) {
        .top-bar, .topbar { padding: 0 var(--s-3); }
        .top-bar-info { gap: var(--s-2); }
        .employee-chip { display: none; }
        .station-badge { padding: 4px 10px; font-size: 11px; }
        .page-title { font-size: 16px; }
        .page-title .page-title-context { display: none; }
        .scan-result-card { padding: var(--s-5); }
    }

    @media (prefers-reduced-motion: reduce) {
        *, *::before, *::after {
            animation-duration: 0.01ms !important;
            animation-iteration-count: 1 !important;
            transition-duration: 0.01ms !important;
        }
    }

    /* ════════════════════════════════════════════════════════════════
       STICKER PREVIEW (printable order ticket, jeweler green style)
       ════════════════════════════════════════════════════════════════ */
    .sticker {
        background: white;
        color: #1a3a2a;
        border: 1px solid #c5d4ca;
        border-radius: 10px;
        padding: 20px 22px 22px;
        text-align: left;
        font-family: var(--font-sans);
        max-width: 360px;
        margin: 0 auto;
        box-shadow: 0 8px 24px -8px rgba(20,20,24,0.18);
        line-height: 1.4;
    }
    .sticker-route {
        margin: -6px 0 10px; padding-bottom: 6px; border-bottom: 2px solid #1a3a2a;
        display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
        font-size: 22px; line-height: 1; font-weight: 700; letter-spacing: 3px;
    }
    .sticker-route-no { letter-spacing: 0; white-space: nowrap; }
    .sticker-kva {
        margin: 10px 0 0; padding: 4px 8px; border: 3px solid #e00; color: #e00; border-radius: 4px;
        text-align: center; font-size: 28px; line-height: 1; font-weight: 700; letter-spacing: 4px;
    }
    .sticker-head {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 16px;
        padding-bottom: 14px;
        border-bottom: 1px dashed #c5d4ca;
    }
    .sticker-brand {
        font-family: 'Times New Roman', Georgia, serif;
        font-size: 24px;
        font-weight: 700;
        color: #1a3a2a;
        letter-spacing: 0.02em;
        line-height: 1;
    }
    .sticker-brand-sub {
        font-size: 10px;
        color: #4a6650;
        margin-top: 4px;
        letter-spacing: 0.04em;
    }
    .sticker-no {
        font-family: var(--font-mono);
        font-weight: 600;
        font-size: 13px;
        color: #1a3a2a;
        text-align: right;
    }
    .sticker-no big {
        display: block;
        font-size: 18px;
        letter-spacing: 0.04em;
    }
    .sticker-body { padding-top: 14px; }
    .sticker-row {
        display: grid;
        grid-template-columns: 80px 1fr;
        gap: 10px;
        padding: 5px 0;
        font-size: 12px;
        border-bottom: 1px solid #e8efea;
        align-items: baseline;
        text-align: left;
    }
    .sticker-row:last-child { border-bottom: none; }
    .sticker-row-key {
        font-size: 10px;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        color: #4a6650;
        font-weight: 500;
    }
    .sticker-row-val {
        font-size: 13px;
        color: #1a3a2a;
        font-weight: 500;
        word-wrap: break-word;
    }
    .sticker-row-val.mono { font-family: var(--font-mono); }
    .sticker-row-val .tag {
        display: inline-block;
        padding: 2px 8px;
        background: #eaf1ec;
        border: 1px solid #d5e2db;
        border-radius: 4px;
        margin: 2px 4px 2px 0;
        font-size: 11px;
        font-weight: 500;
        white-space: nowrap;
        color: #1a3a2a;
    }
    .sticker-foot {
        margin-top: 14px;
        padding-top: 12px;
        border-top: 1px dashed #c5d4ca;
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
    }
    .sticker-qr-wrap {
        display: flex;
        align-items: center;
        gap: 12px;
    }
    .sticker-qr-wrap img {
        width: 70px;
        height: 70px;
        background: white;
        border-radius: 4px;
        padding: 0;
    }

    /* In dark mode keep the sticker as a "printed paper" preview — readable */
    [data-theme="dark"] .sticker {
        background: #f7faf7;
        color: #1a3a2a;
    }
    [data-theme="dark"] .sticker .sticker-brand,
    [data-theme="dark"] .sticker .sticker-no,
    [data-theme="dark"] .sticker .sticker-row-val { color: #1a3a2a; }
    [data-theme="dark"] .sticker .sticker-brand-sub,
    [data-theme="dark"] .sticker .sticker-row-key { color: #4a6650; }



/* ─── KVA: Posten, Staffelung, Verlauf (kva.js) ───────────────── */
.kva-items { list-style: none; margin: 10px 0 0; padding: 8px 12px; border-radius: 8px; background: color-mix(in srgb, currentColor 6%, transparent); font-size: 0.92rem; }
.kva-items li { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.kva-items li.is-declined .kva-it-label, .kva-items li.is-declined .kva-it-price { text-decoration: line-through; opacity: .6; }
.kva-items .kva-items-total { border-top: 1px solid color-mix(in srgb, currentColor 25%, transparent); margin-top: 4px; padding-top: 6px; font-weight: 700; }
.kva-items.is-compact { font-size: 0.85rem; }
.kva-it-label { flex: 1; min-width: 0; }
.kva-it-price { flex: none; }
.kva-it-mark { display: inline-flex; width: 16px; height: 16px; flex: none; }
.kva-it-mark svg { width: 16px; height: 16px; }
.kva-it-mark.is-yes { color: var(--st-ready, #1f7a4d); }
.kva-it-mark.is-no { color: var(--pri-urgent, #c0392b); }
.kva-ed-rows { display: grid; gap: 8px; }
.kva-ed-row { display: grid; grid-template-columns: minmax(0, 1fr) 9.5rem auto; gap: 8px; align-items: center; }
.kva-ed-row .price-row { margin: 0; }
.kva-ed-del { padding-inline: 8px; }
.kva-ed-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; flex-wrap: wrap; }
.kva-ed-sum { font-size: 0.95rem; }
@media (max-width: 520px) {
    .kva-ed-row { grid-template-columns: minmax(0, 1fr) 7.5rem auto; }
}
.kva-pick { display: grid; gap: 6px; }
.kva-pick-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border, #ddd); border-radius: 8px; cursor: pointer; font-size: 1rem; }
.kva-pick-row input { width: 20px; height: 20px; flex: none; }
.kva-pick-total { display: flex; justify-content: space-between; padding: 8px 12px 0; font-size: 1rem; }
.kva-history { margin: 0; padding: 10px 12px; border: 1px solid var(--border, #ddd); border-radius: 10px; font-size: 0.88rem; }
.kva-history-title { display: flex; align-items: center; gap: 6px; font-weight: 700; margin-bottom: 6px; }
.kva-history-title svg { width: 16px; height: 16px; }
.kva-history ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.kva-history li { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: 8px; }
.kva-history-when { color: var(--ink-3, #666); font-size: 0.8rem; padding-top: 1px; }
@media (max-width: 520px) { .kva-history li { grid-template-columns: 1fr; gap: 0; } }
