/* ════════════════════════════════════════════════════════════════
   BEHRENDT SERVICE — UI 2 (Bausteine über app.css)
   Arbeitsplätze, Auftragszeilen, „So geht's weiter", Anmeldung,
   Scanner und Auftragsseite. Nutzt die Tokens aus app.css.
   ════════════════════════════════════════════════════════════════ */

/* ─── Schriften lokal (funktioniert auch ohne Internet) ─── */
@font-face {
    font-family: 'Inter Tight'; font-style: normal; font-display: swap; font-weight: 100 900;
    src: url('/fonts/inter-tight-latin-wght-normal.woff2') format('woff2-variations'), url('/fonts/inter-tight-latin-wght-normal.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Inter Tight'; font-style: normal; font-display: swap; font-weight: 100 900;
    src: url('/fonts/inter-tight-latin-ext-wght-normal.woff2') format('woff2-variations'), url('/fonts/inter-tight-latin-ext-wght-normal.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-display: swap; font-weight: 400; src: url('/fonts/jetbrains-mono-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-display: swap; font-weight: 500 700; src: url('/fonts/jetbrains-mono-latin-500-normal.woff2') format('woff2'); }

/* ─── Fehlende Alias-Variablen (älteres Inline-CSS) ─── */
:root {
    --text-secondary: var(--ink-3);
    --text-tertiary: var(--ink-mute);
    --red: var(--pri-urgent);
    --green: var(--st-ready);
    --ease-glass: var(--ease-out);
    --glass-bg-hover: var(--surface-hover);
    --gold: #a07a2c;
    --gold-soft: color-mix(in oklab, var(--gold) 12%, var(--surface));
}
[data-theme="dark"] { --gold: #d6ad5c; }

.ico { width: 18px; height: 18px; flex-shrink: 0; }
.hidden { display: none !important; }

/* ─── Rahmen: Anmeldung und Kiosk ohne Seitenleiste ─── */
body.is-setup .app, body.is-kiosk .app { grid-template-columns: 1fr; }
body.is-setup .sidebar, body.is-kiosk .sidebar,
body.is-setup .bottom-nav, body.is-kiosk .bottom-nav,
body.is-setup #topBar { display: none !important; }
body.is-setup .app, body.is-kiosk .app { padding-bottom: 0; }
body.is-setup .main-content, body.is-kiosk .main-content { max-width: none; padding: 0; }
body.is-kiosk .top-bar-title .brand-mark,
body.is-kiosk .top-bar-title .brand-divider { display: inline-flex !important; }

/* Kopfleiste: Station + Name als eine klickbare Einheit */
.whoami {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 4px 12px 4px 4px; border-radius: 999px;
    border: 1px solid var(--border); background: var(--surface);
    font-size: 13px; line-height: 1.1; color: var(--ink-2);
    transition: border-color var(--duration-fast), background var(--duration-fast);
}
.whoami:hover { border-color: var(--border-strong); background: var(--surface-hover); }
.whoami-ico {
    width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
    background: color-mix(in oklab, var(--c, var(--ink)) 14%, var(--surface)); color: var(--c, var(--ink));
}
.whoami-ico .ico { width: 16px; height: 16px; }
.whoami-text { display: flex; flex-direction: column; text-align: left; }
.whoami-station { font-weight: 600; color: var(--ink); }
.whoami-name { font-size: 11px; color: var(--ink-mute); }
@media (max-width: 560px) { .whoami-text { display: none; } .whoami { padding: 3px; } }

/* ─── Seitenkopf ─── */
.page-head {
    display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-6);
    flex-wrap: wrap; margin-bottom: var(--s-6);
}
.page-head-text { min-width: 0; }
.page-eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
    color: var(--ink-mute); margin-bottom: 6px;
}
.page-eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--ink-mute)); }
.page-h1 { font-size: 30px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.12; color: var(--ink); }
.page-sub { margin-top: 6px; color: var(--ink-3); font-size: 15px; max-width: 64ch; }
.page-head-actions { display: flex; gap: var(--s-2); flex-wrap: wrap; }
@media (max-width: 640px) { .page-h1 { font-size: 24px; } .page-head { margin-bottom: var(--s-5); } }

.back-link {
    display: inline-flex; align-items: center; gap: 4px; margin: -4px 0 10px -6px;
    padding: 4px 8px 4px 4px; border-radius: 8px; font-size: 13px; font-weight: 500; color: var(--ink-3);
}
.back-link:hover { background: var(--surface-hover); color: var(--ink); }
.back-link .ico { width: 16px; height: 16px; }

/* ─── Abschnittstitel ─── */
.sec-title { margin: var(--s-8) 0 var(--s-3); }
.sec-title:first-child { margin-top: 0; }
.sec-title h3 { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 650; letter-spacing: -0.01em; }
.sec-title p { margin-top: 2px; font-size: 13px; color: var(--ink-mute); }
.sec-count {
    font-family: var(--font-mono); font-size: 12px; font-weight: 500;
    min-width: 24px; height: 22px; padding: 0 7px; border-radius: 11px;
    display: inline-grid; place-items: center; background: var(--bg-inset); color: var(--ink-3);
}
.sec-title.tone-wait .sec-count { background: color-mix(in oklab, var(--pri-high) 16%, var(--surface)); color: var(--pri-high); }
.sec-title.tone-need .sec-count { background: color-mix(in oklab, var(--pri-urgent) 14%, var(--surface)); color: var(--pri-urgent); }
.sec-title.tone-ok .sec-count { background: color-mix(in oklab, var(--st-ready) 16%, var(--surface)); color: var(--st-ready); }

/* ─── Leerzustand ─── */
.empty-block {
    text-align: center; padding: var(--s-10) var(--s-6);
    border: 1px dashed var(--border-strong); border-radius: var(--r-lg); background: var(--surface-2);
}
.empty-block-icon {
    width: 48px; height: 48px; margin: 0 auto var(--s-3); border-radius: 50%;
    display: grid; place-items: center; background: color-mix(in oklab, var(--st-ready) 12%, var(--surface)); color: var(--st-ready);
}
.empty-block-icon .ico { width: 22px; height: 22px; }
.empty-block-title { font-weight: 600; font-size: 16px; }
.empty-block-text { color: var(--ink-mute); font-size: 14px; margin-top: 4px; max-width: 46ch; margin-inline: auto; }
.empty-block.compact { padding: var(--s-6); }

/* ─── Kleine Status-Chips ─── */
.chip-s {
    display: inline-flex; align-items: center; gap: 5px;
    height: 24px; padding: 0 9px; border-radius: 999px;
    font-size: 12px; font-weight: 550; white-space: nowrap;
    background: var(--bg-inset); color: var(--ink-3);
}
.chip-s .ico { width: 13px; height: 13px; }
.chip-s.is-urgent { background: color-mix(in oklab, var(--pri-urgent) 14%, var(--surface)); color: var(--pri-urgent); }
.chip-s.is-high   { background: color-mix(in oklab, var(--pri-high) 14%, var(--surface)); color: var(--pri-high); }
.chip-s.is-wait   { background: color-mix(in oklab, var(--pri-high) 12%, var(--surface)); color: var(--pri-high); }
.chip-s.is-need   { background: color-mix(in oklab, var(--pri-urgent) 10%, var(--surface)); color: var(--pri-urgent); }
.chip-s.is-muted   { background: color-mix(in oklab, var(--ink-mute) 12%, var(--surface)); color: var(--ink-mute); }
.chip-s.is-complaint { background: color-mix(in oklab, var(--pri-urgent) 10%, var(--surface)); color: var(--pri-urgent); }
.chip-s.is-ok     { background: color-mix(in oklab, var(--st-ready) 13%, var(--surface)); color: var(--st-ready); }
.chip-s.is-engr   { background: color-mix(in oklab, var(--st-engraving) 12%, var(--surface)); color: var(--st-engraving); }
.chip-s.is-ext    { background: color-mix(in oklab, var(--st-external) 13%, var(--surface)); color: var(--st-external); }
.chip-s.is-info   { background: color-mix(in oklab, var(--st-intake) 12%, var(--surface)); color: var(--st-intake); }
.chip-s.is-late { background: color-mix(in oklab, var(--pri-urgent) 14%, var(--surface)); color: var(--pri-urgent); font-weight: 600; }
.chip-s.is-due.is-late { background: color-mix(in oklab, var(--pri-urgent) 14%, var(--surface)); color: var(--pri-urgent); }
.chip-s.is-due.is-today, .chip-s.is-due.is-soon { background: color-mix(in oklab, var(--pri-high) 14%, var(--surface)); color: var(--pri-high); }
.station-pill { white-space: nowrap; }

/* ─── Auftragszeile ─── */
.o-list { display: flex; flex-direction: column; gap: var(--s-2); }
.o-row {
    display: flex; align-items: center; gap: var(--s-4);
    padding: var(--s-3) var(--s-4) var(--s-3) var(--s-3);
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
    position: relative; transition: border-color var(--duration-fast), box-shadow var(--duration-fast), transform 80ms;
    color: inherit;
}
.o-row:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.o-row:active { transform: translateY(1px); }
.o-row.priority-urgent::before, .o-row.priority-high::before {
    content: ''; position: absolute; left: -1px; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0;
    background: var(--pri-urgent);
}
.o-row.priority-high::before { background: var(--pri-high); }
.o-row-thumb {
    width: 56px; height: 56px; border-radius: var(--r-md); flex-shrink: 0; overflow: hidden;
    display: grid; place-items: center; background: var(--bg-inset); color: var(--ink-mute);
}
.o-row-thumb img { width: 100%; height: 100%; object-fit: cover; }
.o-row-thumb .ico { width: 24px; height: 24px; }
.o-row-main { flex: 1; min-width: 0; }
.o-row-top { display: flex; align-items: center; gap: var(--s-2); font-size: 12px; color: var(--ink-mute); }
.o-row-no { font-weight: 600; color: var(--ink-3); }
.o-row-age::before { content: '·'; margin-right: var(--s-2); }
.o-row-title { font-weight: 620; font-size: 16px; letter-spacing: -0.01em; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.o-row-sub { font-size: 13px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.o-row-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.o-row-chips:empty { display: none; }
.o-row-go { color: var(--ink-faint); }
.o-row:hover .o-row-go { color: var(--ink-2); }
.o-row-engr {
    margin-top: 6px; padding: 6px 10px; border-radius: var(--r-sm);
    background: color-mix(in oklab, var(--st-engraving) 8%, var(--surface)); color: var(--ink);
    font-size: 14px; font-weight: 550; border-left: 3px solid var(--st-engraving);
}
@media (max-width: 560px) {
    .o-row { gap: var(--s-3); }
    .o-row-thumb { width: 44px; height: 44px; }
    .o-row-go { display: none; }
}

/* ─── Ladenplan (Weg der Aufträge) ─── */
.flow {
    display: flex; align-items: stretch; gap: var(--s-2); flex-wrap: wrap;
    padding: var(--s-4); border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface);
}
.flow-node {
    display: flex; align-items: center; gap: 10px; min-width: 0;
    padding: 10px 12px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--divider);
    text-align: left; transition: background var(--duration-fast), border-color var(--duration-fast);
}
.flow-node:hover { background: var(--surface-hover); border-color: var(--border-strong); }
.flow-node-icon {
    width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0;
    background: color-mix(in oklab, var(--station-color, var(--ink-mute)) 14%, var(--surface)); color: var(--station-color, var(--ink-mute));
}
.flow-node-icon .ico { width: 17px; height: 17px; }
.flow-node-label { font-size: 13px; font-weight: 550; color: var(--ink-2); white-space: nowrap; }
.flow-node-count { font-family: var(--font-mono); font-weight: 600; font-size: 18px; margin-left: auto; padding-left: 6px; color: var(--ink); }
.flow-arrow { align-self: center; color: var(--ink-faint); }
.flow-group { display: flex; flex-direction: column; gap: 6px; padding: 8px; border-radius: var(--r-md); border: 1px dashed var(--border-strong); }
.flow-group-label { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-mute); font-weight: 600; padding-left: 2px; }
.flow-group-nodes { display: flex; flex-direction: column; gap: 6px; }
.flow > .flow-node { align-self: center; }
.flow-side { display: flex; flex-direction: column; gap: 6px; margin-left: auto; justify-content: center; padding-left: var(--s-4); border-left: 1px solid var(--divider); }
.flow-node[data-station="goldsmith"] { --station-color: var(--st-goldsmith); }
.flow-node[data-station="watchmaker"] { --station-color: var(--st-watchmaker); }
.flow-node[data-station="engraving"] { --station-color: var(--st-engraving); }
.flow-node[data-station="ready"] { --station-color: var(--st-ready); }
.flow-node[data-station="office"] { --station-color: var(--st-office); }
.flow-node[data-station="external"] { --station-color: var(--st-external); }
@media (max-width: 1180px) {
    .flow-arrow { display: none; }
    .flow { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
    .flow-group, .flow-side { display: contents; }
    .flow-group-label { display: none; }
    .flow-group-nodes { display: contents; }
    .flow > .flow-node { align-self: stretch; }
}

/* ─── „So geht's weiter" ─── */
.next-step {
    display: flex; gap: var(--s-3); align-items: flex-start;
    padding: var(--s-4) var(--s-5); border-radius: var(--r-lg);
    background: color-mix(in oklab, var(--st-intake) 7%, var(--surface));
    border: 1px solid color-mix(in oklab, var(--st-intake) 22%, var(--border));
}
.next-step-icon {
    width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center;
    background: var(--st-intake); color: white;
}
.next-step-icon .ico { width: 17px; height: 17px; }
.next-step-label { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-mute); font-weight: 600; }
.next-step-label strong { color: var(--ink-2); }
.next-step-text { font-size: 15px; color: var(--ink); margin-top: 2px; line-height: 1.45; }
.next-step.tone-wait { background: color-mix(in oklab, var(--pri-high) 8%, var(--surface)); border-color: color-mix(in oklab, var(--pri-high) 28%, var(--border)); }
.next-step.tone-wait .next-step-icon { background: var(--pri-high); }
.next-step.tone-done { background: color-mix(in oklab, var(--st-ready) 8%, var(--surface)); border-color: color-mix(in oklab, var(--st-ready) 28%, var(--border)); }
.next-step.tone-done .next-step-icon { background: var(--st-ready); }
.next-step.tone-info { background: color-mix(in oklab, var(--st-ready) 7%, var(--surface)); border-color: color-mix(in oklab, var(--st-ready) 24%, var(--border)); }
.next-step.tone-info .next-step-icon { background: var(--st-ready); }

/* ─── Segment-Umschalter ─── */
.segmented { display: inline-flex; padding: 3px; gap: 2px; border-radius: 12px; background: var(--bg-inset); border: 1px solid var(--border); flex-wrap: wrap; }
.segmented button {
    height: 36px; padding: 0 14px; border-radius: 9px; font-size: 13px; font-weight: 550; color: var(--ink-3);
    display: inline-flex; align-items: center; gap: 8px;
}
.segmented button:hover { color: var(--ink); }
.segmented button.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm), 0 0 0 1px var(--border); }
.seg-count { font-family: var(--font-mono); font-size: 11px; padding: 1px 6px; border-radius: 8px; background: var(--bg-inset); }
.segmented button.active .seg-count { background: var(--ink); color: var(--accent-on); }

/* ─── Aktionskacheln (Startseiten) ─── */
.action-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--s-4); margin-bottom: var(--s-6); }
.action-tile {
    position: relative; overflow: hidden;
    display: flex; align-items: center; gap: var(--s-4); text-align: left;
    padding: var(--s-6); border-radius: var(--r-xl); min-height: 132px;
    background: var(--surface); border: 1px solid var(--border);
    transition: transform 120ms var(--ease-out), box-shadow var(--duration-base), border-color var(--duration-base);
}
.action-tile:hover { border-color: var(--border-strong); box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.action-tile:active { transform: translateY(0); }
.action-tile-icon {
    width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; flex-shrink: 0;
    background: var(--bg-inset); color: var(--ink);
}
.action-tile-icon .ico { width: 26px; height: 26px; }
.action-tile-title { font-size: 20px; font-weight: 650; letter-spacing: -0.02em; }
.action-tile-sub { font-size: 14px; color: var(--ink-3); margin-top: 3px; line-height: 1.4; }
.action-tile.is-primary { background: var(--ink); color: var(--accent-on); border-color: var(--ink); }
.action-tiles.is-hero { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--s-6); margin-top: var(--s-6); }
.action-tiles.is-hero .action-tile { min-height: 240px; flex-direction: column; justify-content: center; text-align: center; gap: var(--s-5); padding: var(--s-8, 40px); }
.action-tiles.is-hero .action-tile-icon { width: 84px; height: 84px; border-radius: 22px; }
.action-tiles.is-hero .action-tile-icon .ico { width: 40px; height: 40px; }
.action-tiles.is-hero .action-tile-title { font-size: 30px; }
.action-tiles.is-hero .action-tile-sub { font-size: 15px; max-width: 34ch; margin: 6px auto 0; }
.action-tile.is-primary .action-tile-sub { color: color-mix(in oklab, var(--accent-on) 70%, transparent); }
.action-tile.is-primary .action-tile-icon { background: color-mix(in oklab, var(--accent-on) 14%, transparent); color: var(--accent-on); }
.action-tile.is-primary::after {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background: radial-gradient(600px 200px at 100% 0%, color-mix(in oklab, var(--gold) 35%, transparent), transparent 60%);
    opacity: .55;
}
.action-tile kbd {
    position: absolute; top: 14px; right: 16px; font-family: var(--font-mono); font-size: 11px;
    padding: 2px 6px; border-radius: 6px; border: 1px solid currentColor; opacity: .45;
}

/* Zwei-Spalten-Raster für Listen */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s-6); align-items: start; }
@media (max-width: 1100px) { .split { grid-template-columns: minmax(0, 1fr); } }

/* Kompakte Suche im Kopf */
.quick-find { position: relative; max-width: 520px; width: 100%; }
.quick-find .ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-mute); pointer-events: none; }
.quick-find input {
    width: 100%; height: 48px; padding: 0 16px 0 42px; border-radius: 12px;
    border: 1px solid var(--border-strong); background: var(--surface); font-size: 15px;
}
.quick-find input:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 4px color-mix(in oklab, var(--focus) 8%, transparent); }

/* ════════════════════════════════════════════════════════════════
   ANMELDUNG
   ════════════════════════════════════════════════════════════════ */
.login {
    min-height: 100vh; display: grid; grid-template-columns: minmax(340px, 0.9fr) 1.1fr;
    background: var(--bg);
}
.login-brand {
    position: relative; overflow: hidden;
    background: #141414; color: #f3f1ea;
    display: flex; flex-direction: column; justify-content: space-between; padding: 48px;
}
.login-brand::before {
    content: ''; position: absolute; inset: 0;
    background:
        radial-gradient(700px 420px at 110% -10%, rgba(214, 173, 92, .28), transparent 60%),
        radial-gradient(500px 360px at -20% 120%, rgba(214, 173, 92, .14), transparent 60%);
}
.login-brand > * { position: relative; }
.login-brand .logo-wordmark { max-width: 300px; color: #f3f1ea; }
.login-brand-title { font-size: 34px; line-height: 1.15; font-weight: 600; letter-spacing: -0.02em; max-width: 14ch; }
.login-brand-sub { color: rgba(243, 241, 234, .65); margin-top: 12px; max-width: 38ch; font-size: 15px; }
.login-brand-foot { font-size: 12px; color: rgba(243, 241, 234, .45); letter-spacing: .08em; text-transform: uppercase; }
.login-panel { display: flex; align-items: center; justify-content: center; padding: 48px 32px; }
.login-card { width: 100%; max-width: 620px; }
.login-steps { display: flex; gap: 8px; align-items: center; margin-bottom: 28px; font-size: 13px; color: var(--ink-mute); }
.login-steps .ls { display: inline-flex; align-items: center; gap: 8px; }
.login-steps .ls-n { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 600; background: var(--bg-inset); color: var(--ink-3); }
.login-steps .ls.is-active { color: var(--ink); font-weight: 600; }
.login-steps .ls.is-active .ls-n { background: var(--ink); color: var(--accent-on); }
.login-steps .ls.is-done .ls-n { background: var(--st-ready); color: #fff; }
.login-steps .ls-line { flex: 0 0 28px; height: 1px; background: var(--border-strong); }
.login h2 { font-size: 26px; font-weight: 650; letter-spacing: -0.015em; }
.login-hint { color: var(--ink-3); margin: 4px 0 20px; font-size: 15px; }
.login-alert {
    display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: var(--r-md); margin-bottom: 18px;
    background: color-mix(in oklab, var(--pri-high) 10%, var(--surface)); border: 1px solid color-mix(in oklab, var(--pri-high) 30%, var(--border));
    font-size: 14px;
}
.station-select-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 0; }
.station-select-btn {
    display: flex; align-items: center; gap: 14px; text-align: left;
    padding: 14px 16px; min-height: 76px; border-radius: 14px;
    background: var(--surface); border: 1.5px solid var(--border); color: var(--ink);
    transition: border-color var(--duration-fast), background var(--duration-fast), box-shadow var(--duration-fast);
    font-weight: 500; font-size: 14px;
}
.station-select-btn:hover { border-color: var(--border-strong); background: var(--surface-2); }
.station-select-btn.selected { border-color: var(--ink); box-shadow: 0 0 0 3px color-mix(in oklab, var(--ink) 10%, transparent); }
.ssb-icon {
    width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0; display: grid; place-items: center;
    background: color-mix(in oklab, var(--c) 14%, var(--surface)); color: var(--c);
}
.ssb-icon .ico { width: 22px; height: 22px; }
.ssb-name { display: block; font-weight: 650; font-size: 15px; }
.ssb-desc { display: block; font-size: 12.5px; color: var(--ink-mute); line-height: 1.35; margin-top: 2px; }
.emp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.emp-btn {
    display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px;
    border: 1.5px solid var(--border); background: var(--surface); text-align: left; min-height: 60px;
}
.emp-btn:hover { border-color: var(--border-strong); background: var(--surface-2); }
.emp-btn.selected { border-color: var(--ink); box-shadow: 0 0 0 3px color-mix(in oklab, var(--ink) 10%, transparent); }
.emp-btn .avatar { width: 36px; height: 36px; font-size: 13px; }
.emp-btn-name { font-weight: 600; font-size: 14px; line-height: 1.2; }
.emp-btn-code { font-size: 11px; color: var(--ink-mute); font-family: var(--font-mono); }
.pin-wrap { display: flex; flex-direction: column; align-items: center; gap: 18px; margin-top: 8px; }
.pin-dots { display: flex; gap: 14px; }
.pin-dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border-strong); transition: all 120ms; }
.pin-dot.filled { background: var(--ink); border-color: var(--ink); transform: scale(1.05); }
.pin-wrap.is-error .pin-dots { animation: shake 360ms; }
.pin-wrap.is-error .pin-dot { border-color: var(--pri-urgent); }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.pin-input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
.keypad { display: grid; grid-template-columns: repeat(3, 76px); gap: 10px; }
.keypad button {
    height: 60px; border-radius: 14px; font-size: 22px; font-weight: 550; background: var(--surface);
    border: 1px solid var(--border); font-variant-numeric: tabular-nums;
}
.keypad button:hover { background: var(--surface-hover); }
.keypad button:active { transform: scale(.97); background: var(--bg-inset); }
.keypad .kp-muted { font-size: 14px; color: var(--ink-3); }
.login-actions { display: flex; gap: 10px; margin-top: 26px; }
.login-actions .btn { flex: 1; }
.login-actions .btn-outline { flex: 0 0 auto; }
@media (max-width: 900px) {
    .login { grid-template-columns: 1fr; }
    .login-brand { padding: 28px 24px; min-height: 0; }
    .login-brand-title, .login-brand-sub, .login-brand-foot { display: none; }
    .login-brand .logo-wordmark { max-width: 200px; margin: 0 auto; }
    .login-panel { padding: 24px 16px 40px; align-items: flex-start; }
}
@media (max-width: 520px) { .station-select-grid { grid-template-columns: 1fr; } .station-select-btn { min-height: 64px; } }

/* ════════════════════════════════════════════════════════════════
   SCANNER
   ════════════════════════════════════════════════════════════════ */
.scan-page { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr); gap: var(--s-6); align-items: start; }
@media (max-width: 1000px) { .scan-page { grid-template-columns: 1fr; } }
.scan-cam {
    position: relative; border-radius: var(--r-xl); overflow: hidden; background: #0d0d0e; color: #eee;
    aspect-ratio: 4 / 3; display: grid; place-items: center;
}
.scan-cam #qr-reader { width: 100%; height: 100%; max-width: none; border-radius: 0; }
.scan-cam #qr-reader video { display: block; width: 100% !important; height: 100% !important; object-fit: cover; border-radius: 0; }
.scan-cam #qr-reader > div { border: 0 !important; }
.scan-cam-msg {
    position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 10px; padding: 24px; text-align: center; color: rgba(255, 255, 255, .8); font-size: 14px; pointer-events: none;
}
.scan-cam-msg .ico { width: 40px; height: 40px; opacity: .6; }
.scan-cam-msg strong { color: #fff; font-size: 16px; }
.scan-cam.is-live .scan-cam-msg { display: none; }
/* Kamera nur über https (iPad): großer Knopf zur sicheren Adresse */
.scan-cam-msg a { pointer-events: auto; color: #fff; text-decoration: underline; }
.scan-cam-msg .scan-cam-cta {
    display: inline-flex; align-items: center; justify-content: center; min-height: 56px; padding: 0 28px; margin: 6px 0 2px;
    border-radius: 14px; background: #fff; color: #111; font-size: 17px; font-weight: 650; text-decoration: none;
}
.scan-cam-msg .scan-cam-always { color: #fff; font-weight: 600; font-size: 15px; }
.scan-frame {
    position: absolute; inset: 18% 26%; border-radius: 18px; pointer-events: none;
    box-shadow: 0 0 0 999px rgba(0, 0, 0, .25);
}
.scan-frame::before, .scan-frame::after {
    content: ''; position: absolute; inset: 0; border-radius: 18px;
    border: 3px solid rgba(255, 255, 255, .9);
    -webkit-mask: linear-gradient(#000 0 0) top left / 28px 28px no-repeat, linear-gradient(#000 0 0) top right / 28px 28px no-repeat,
                  linear-gradient(#000 0 0) bottom left / 28px 28px no-repeat, linear-gradient(#000 0 0) bottom right / 28px 28px no-repeat;
            mask: linear-gradient(#000 0 0) top left / 28px 28px no-repeat, linear-gradient(#000 0 0) top right / 28px 28px no-repeat,
                  linear-gradient(#000 0 0) bottom left / 28px 28px no-repeat, linear-gradient(#000 0 0) bottom right / 28px 28px no-repeat;
}
.scan-cam:not(.is-live) .scan-frame { display: none; }
.scan-cam-select { position: absolute; left: 12px; bottom: 12px; right: 12px; z-index: 3; display: flex; justify-content: flex-end; }
.scan-cam-select select {
    max-width: 260px; height: 34px; font-size: 12px; border-radius: 10px; padding: 0 30px 0 10px;
    background-color: rgba(0, 0, 0, .55); color: #fff; border: 1px solid rgba(255, 255, 255, .2);
}
.scan-side .card { margin-bottom: var(--s-4); }
.manual-entry { display: flex; gap: 8px; }
.manual-entry input { flex: 1; text-transform: uppercase; font-family: var(--font-mono); letter-spacing: .02em; }
.howto { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.howto li { display: flex; gap: 12px; font-size: 14px; color: var(--ink-2); }
.howto-n {
    width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center;
    font-size: 12px; font-weight: 650; background: var(--bg-inset); color: var(--ink-2);
}

/* Werkstatt-Eingang (Kiosk) */
.kiosk { min-height: calc(100vh - var(--topbar-h)); display: grid; grid-template-columns: minmax(0, 1fr) 380px; }
.kiosk-cam { position: relative; background: #0d0d0e; min-height: 420px; overflow: hidden; }
.kiosk-cam #qr-reader { position: absolute; inset: 0; width: auto; max-width: none; margin: 0; border-radius: 0; }
.kiosk-cam #qr-reader video { display: block; width: 100% !important; height: 100% !important; object-fit: cover; border-radius: 0; }
.kiosk-cam #qr-reader > div { border: 0 !important; }
.kiosk-cam .scan-cam-msg { color: rgba(255,255,255,.75); }
.kiosk-cam.is-live .scan-cam-msg { display: none; }
.kiosk-cam:not(.is-live) .scan-frame { display: none; }
.kiosk-banner {
    position: absolute; left: 50%; top: 24px; transform: translateX(-50%); z-index: 2;
    padding: 10px 18px; border-radius: 999px; background: rgba(0, 0, 0, .6); color: #fff; font-weight: 600; font-size: 15px;
    display: inline-flex; gap: 10px; align-items: center; white-space: nowrap; backdrop-filter: blur(8px);
}
.kiosk-side { background: var(--surface); border-left: 1px solid var(--border); padding: var(--s-6); display: flex; flex-direction: column; gap: var(--s-5); }
.kiosk-side h2 { font-size: 22px; font-weight: 650; letter-spacing: -0.02em; }
.kiosk-log { display: flex; flex-direction: column; gap: 8px; }
.kiosk-log-item {
    display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px;
    background: var(--surface-2); border: 1px solid var(--divider); font-size: 13px;
}
.kiosk-log-item .mono { font-weight: 600; }
.kiosk-log-item.is-err { background: color-mix(in oklab, var(--pri-urgent) 7%, var(--surface)); }
.kiosk-log-item .to { margin-left: auto; font-weight: 600; white-space: nowrap; }
@media (max-width: 900px) { .kiosk { grid-template-columns: 1fr; } .kiosk-cam { min-height: 58vh; } .kiosk-side { border-left: 0; border-top: 1px solid var(--border); } }

.flash {
    position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 24px;
    background: rgba(0, 0, 0, .35); animation: fadeIn 140ms ease-out;
}
.flash-card {
    width: min(440px, 100%); border-radius: 24px; padding: 36px 28px; text-align: center; color: #fff;
    background: var(--st-ready); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .5); animation: popIn 260ms var(--ease-spring);
}
.flash-card.is-err { background: var(--pri-urgent); }
.flash-icon { width: 72px; height: 72px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .22); }
.flash-icon .ico { width: 38px; height: 38px; stroke-width: 2.6; }
.flash-no { font-family: var(--font-mono); font-size: 22px; font-weight: 600; }
.flash-who { opacity: .9; margin-top: 2px; }
.flash-to { margin-top: 14px; font-size: 26px; font-weight: 700; letter-spacing: -0.02em; display: inline-flex; gap: 10px; align-items: center; }
.flash-to .ico { width: 26px; height: 26px; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes popIn { from { opacity: 0; transform: scale(.92); } }

/* ─── Scan-Ergebnis als Blatt ─── */
.sheet-overlay {
    position: fixed; inset: 0; z-index: 150; background: var(--overlay-bg);
    display: flex; align-items: center; justify-content: center; padding: 24px; animation: fadeIn 140ms ease-out;
    backdrop-filter: blur(2px);
}
.sheet {
    width: min(620px, 100%); max-height: calc(100vh - 48px); overflow: auto;
    background: var(--surface); border-radius: 22px; box-shadow: var(--shadow-lg); animation: popIn 220ms var(--ease-out);
}
.sheet-head { padding: 22px 24px 18px; border-bottom: 1px solid var(--divider); display: flex; gap: 14px; align-items: flex-start; position: sticky; top: 0; background: var(--surface); z-index: 1; }
.sheet-head-main { flex: 1; min-width: 0; }
.sheet-no { font-family: var(--font-mono); font-size: 13px; color: var(--ink-mute); font-weight: 600; }
.sheet-title { font-size: 22px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.2; margin-top: 2px; }
.sheet-sub { color: var(--ink-3); font-size: 14px; margin-top: 2px; }
.sheet-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.sheet-close { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: var(--ink-3); flex-shrink: 0; }
.sheet-close:hover { background: var(--surface-hover); color: var(--ink); }
.sheet-body { padding: 20px 24px 24px; display: flex; flex-direction: column; gap: 14px; }
.sheet-work { font-size: 15px; color: var(--ink-2); padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--divider); }
.sheet-work.is-note { background: color-mix(in oklab, var(--gold, #a07a2c) 7%, var(--surface)); }
.pre-line { white-space: pre-line; }
.sheet-work-label { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-mute); font-weight: 600; margin-bottom: 2px; }
.sheet-primary .btn { height: 60px; font-size: 17px; border-radius: 14px; }
.sheet-primary .btn .ico { width: 22px; height: 22px; }
.sheet-hint { font-size: 13px; color: var(--ink-mute); text-align: center; margin-top: 6px; }
.sheet-more { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.sheet-more > summary {
    list-style: none; cursor: pointer; padding: 14px 16px; font-weight: 600; font-size: 14px;
    display: flex; align-items: center; gap: 10px; color: var(--ink-2);
}
.sheet-more > summary::-webkit-details-marker { display: none; }
.sheet-more > summary::after { content: ''; margin-left: auto; width: 8px; height: 8px; border-right: 2px solid var(--ink-mute); border-bottom: 2px solid var(--ink-mute); transform: rotate(45deg); transition: transform 150ms; }
.sheet-more[open] > summary::after { transform: rotate(-135deg); }
.sheet-more > summary:hover { background: var(--surface-hover); }
.sheet-more-body { padding: 4px 16px 16px; display: flex; flex-direction: column; gap: 10px; }
.sheet-foot { display: flex; gap: 8px; justify-content: space-between; padding: 14px 24px; border-top: 1px solid var(--divider); background: var(--surface-2); position: sticky; bottom: 0; }
.quick-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.quick-tags button { height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border-strong); font-size: 13px; background: var(--surface); }
.quick-tags button:hover { background: var(--surface-hover); }
.price-row { display: flex; align-items: center; gap: 8px; }
.price-row input { max-width: 180px; font-variant-numeric: tabular-nums; }
.price-row span { color: var(--ink-mute); }
@media (max-width: 640px) {
    .sheet-overlay { padding: 0; align-items: flex-end; }
    .sheet { border-radius: 22px 22px 0 0; max-height: 92vh; }
}

/* ════════════════════════════════════════════════════════════════
   AUFTRAGSSEITE
   ════════════════════════════════════════════════════════════════ */
.od-hero {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--s-5); align-items: center;
    padding: var(--s-6); border-radius: var(--r-xl); background: var(--surface); border: 1px solid var(--border); margin-bottom: var(--s-4);
}
.od-photo { width: 96px; height: 96px; border-radius: 16px; overflow: hidden; background: var(--bg-inset); display: grid; place-items: center; color: var(--ink-mute); cursor: zoom-in; }
.od-photo img { width: 100%; height: 100%; object-fit: cover; }
.od-photo .ico { width: 36px; height: 36px; }
.od-no { font-family: var(--font-mono); font-size: 13px; color: var(--ink-mute); font-weight: 600; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.od-title { font-size: 28px; font-weight: 650; letter-spacing: -0.03em; line-height: 1.15; margin-top: 2px; }
.od-customer { color: var(--ink-3); margin-top: 4px; font-size: 15px; }
.od-customer a { color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; }
.od-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.od-status { text-align: right; }
.od-status-label { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-mute); font-weight: 600; margin-bottom: 6px; }
.od-status .station-pill { font-size: 15px; padding: 8px 14px; }
@media (max-width: 760px) {
    .od-hero { grid-template-columns: auto 1fr; padding: var(--s-4); gap: var(--s-4); }
    .od-status { grid-column: 1 / -1; text-align: left; display: flex; align-items: center; gap: 10px; }
    .od-status-label { margin: 0; }
    .od-photo { width: 64px; height: 64px; border-radius: 12px; }
    .od-title { font-size: 21px; }
}
.od-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--s-4); align-items: start; margin-top: var(--s-4); }
@media (max-width: 1100px) { .od-grid { grid-template-columns: 1fr; } }
.od-side { display: flex; flex-direction: column; gap: 0; position: sticky; top: calc(var(--topbar-h) + 16px); }
@media (max-width: 1100px) { .od-side { position: static; } }
.od-station-action { margin-top: var(--s-4); display: flex; gap: var(--s-3); align-items: center; flex-wrap: wrap; }
.kv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px 24px; }
.kv-item-label { font-size: 12px; color: var(--ink-mute); font-weight: 500; }
.kv-item-sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.kv-item-value { font-size: 15px; color: var(--ink); margin-top: 2px; word-break: break-word; }
.kv-item.is-wide { grid-column: 1 / -1; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: var(--s-4); }
.card-h h3 { font-size: 15px; font-weight: 650; display: inline-flex; gap: 8px; align-items: center; }
.card-h h3 .ico { color: var(--ink-mute); }
.action-list { display: flex; flex-direction: column; gap: 6px; }
.action-list .btn { justify-content: flex-start; width: 100%; }
.action-list .btn .ico { width: 17px; height: 17px; color: var(--ink-mute); }
.action-list .btn-primary .ico { color: inherit; }
.qr-mini { display: flex; gap: 14px; align-items: center; }
.qr-mini img { width: 88px; height: 88px; border-radius: 8px; background: #fff; padding: 4px; border: 1px solid var(--border); }
.money { font-size: 26px; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

/* Verlauf */
.tl { list-style: none; position: relative; }
.tl li { position: relative; padding: 0 0 18px 26px; }
.tl li::before { content: ''; position: absolute; left: 6px; top: 16px; bottom: -2px; width: 2px; background: var(--divider); }
.tl li:last-child::before { display: none; }
.tl-dot { position: absolute; left: 0; top: 4px; width: 14px; height: 14px; border-radius: 50%; border: 3px solid var(--surface); background: var(--station-color, var(--ink-mute)); box-shadow: 0 0 0 1px var(--border); }
.tl li.is-note .tl-dot { background: var(--surface); box-shadow: 0 0 0 2px var(--border-strong); }
.tl-head { font-size: 14px; font-weight: 600; }
.tl-meta { font-size: 12px; color: var(--ink-mute); margin-top: 1px; }
.tl-note { font-size: 14px; color: var(--ink-2); margin-top: 3px; }

/* Tastatur-Hinweis */
.kbd-hint { font-size: 12px; color: var(--ink-mute); display: inline-flex; gap: 6px; align-items: center; }
.kbd-hint kbd { font-family: var(--font-mono); font-size: 11px; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--border-strong); background: var(--surface); }

/* Toasts etwas präsenter */
.toast { font-weight: 500; }
.ico-inline { width: 14px; height: 14px; vertical-align: -2px; }
.divider-soft { border: 0; border-top: 1px solid var(--divider); margin: 4px 0; }
.kva-banner-sub { color: var(--ink-2); }
.od-main .card, .od-side .card { margin-bottom: var(--s-4); }
.gap-6 { gap: var(--s-6); }
.kiosk > #autoScanFeedback, .kiosk > #scanResultOverlay { position: absolute; width: 0; height: 0; }
body { word-spacing: 0.03em; }
.edit-actions {
    position: sticky; bottom: 0; z-index: 5; display: flex; gap: var(--s-3); justify-content: flex-end;
    padding: var(--s-4) 0; margin-top: var(--s-2);
    background: linear-gradient(to top, var(--bg) 70%, transparent);
}
@media (max-width: 1023px) { .edit-actions { bottom: var(--bottomnav-h); } }
.edit-actions .btn-primary { min-width: 240px; }
@media (max-width: 560px) { .edit-actions .btn { flex: 1; min-width: 0; } }
.scan-price-card { background: var(--surface-2); border-width: 1px; }
.scan-price-card .price-value { font-family: var(--font-sans); font-weight: 650; letter-spacing: -0.02em; color: var(--ink) !important; }
.scan-price-card.is-muted .price-value { color: var(--ink-mute) !important; }
.price-pill { letter-spacing: .04em; }

/* Abholung: weitere Stücke desselben Kunden */
.sheet-others-list { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 3px; font-size: 14px; }
.sheet-others-sub { margin-top: 8px; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-mute); }

/* Unterschrift des Kunden bei der Abholung (weißer Hintergrund, auch im Dunkelmodus) */
.sig-img { display: block; max-width: min(100%, 360px); max-height: 140px; background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 6px; cursor: zoom-in; }

/* Verbindung zum Server verloren */
.offline-bar {
    position: fixed; left: 0; right: 0; top: 0; z-index: 3000;
    padding: 10px 16px; text-align: center; font-weight: 600; font-size: 14px;
    background: var(--pri-urgent, #c0392b); color: #fff;
}
