/* UCS – umc Customer Service Portal · Hausfarben Grau & Vanille */
@font-face { font-family: 'Jakarta'; src: url('/fonts/jakarta.woff2') format('woff2'); font-weight: 200 800; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215; }
@font-face { font-family: 'Jakarta'; src: url('/fonts/jakarta-ext.woff2') format('woff2'); font-weight: 200 800; font-display: swap; unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'JBMono'; src: url('/fonts/mono.woff2') format('woff2'); font-weight: 100 800; font-display: swap; }

:root {
  --vanilla: #F3E5AB;
  --vanilla-strong: #E8D387;
  --vanilla-soft: #FBF5DF;
  --vanilla-ink: #6E5A12;
  --graphite: #1D1E21;
  --graphite-2: #26282C;
  --graphite-3: #34363B;
  --bg: #F3F2EE;
  --card: #FFFFFF;
  --card-2: #FAF9F6;
  --ink: #1B1C1F;
  --ink-2: #44474D;
  --muted: #73777E;
  --line: #E5E3DC;
  --line-2: #EFEDE7;
  --focus: #C9A63E;
  --blue: #4E73B8; --blue-bg: #EAF0FA;
  --amber: #B7791F; --amber-bg: #FBF0DD;
  --teal: #20806F; --teal-bg: #E2F3EF;
  --green: #2E7D4A; --green-bg: #E5F3E9;
  --red: #B9382F; --red-bg: #FBE8E6;
  --chart-1: #9A7A1F; --chart-2: #4E73B8; --chart-grid: #ECEAE4;
  --shadow-sm: 0 1px 2px rgba(20, 20, 18, .05);
  --shadow: 0 1px 2px rgba(20, 20, 18, .04), 0 8px 24px -12px rgba(20, 20, 18, .12);
  --shadow-lg: 0 24px 60px -20px rgba(20, 20, 18, .35);
  --r: 14px; --r-sm: 9px;
  --sidebar: 248px;
  font-family: 'Jakarta', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
[data-theme="dark"] {
  --bg: #121315; --card: #1A1B1E; --card-2: #1F2024; --ink: #ECEAE4; --ink-2: #C3C1BA; --muted: #8F9299;
  --line: #2B2D32; --line-2: #24262A; --vanilla-soft: #2A2618; --vanilla-ink: #E8D387;
  --blue-bg: #1C2534; --amber-bg: #2C2416; --teal-bg: #15292596; --green-bg: #17271C; --red-bg: #2E1A18;
  --blue: #7D9BE0; --amber: #E0A54A; --teal: #4FC0AB; --green: #63BE82; --red: #EE7A70;
  --chart-1: #B08C28; --chart-2: #6587D2; --chart-grid: #26282C;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px -12px rgba(0,0,0,.5);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
.mono { font-family: 'JBMono', ui-monospace, monospace; font-size: .92em; letter-spacing: -.01em; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.ico { flex: none; vertical-align: middle; }
.hidden { display: none !important; }
::selection { background: var(--vanilla); color: #000; }

/* ---------- App-Layout ---------- */
.app { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; background: var(--graphite); color: #D9D8D3;
  display: flex; flex-direction: column; padding: 18px 14px; gap: 6px; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 6px 8px 18px; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 11px; background: var(--vanilla); color: #1D1E21;
  display: grid; place-items: center; font-weight: 800; font-size: 13.5px; letter-spacing: -.02em;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.08);
}
.brand-mark img { max-width: 30px; max-height: 30px; }
.brand-text b { display: block; color: #fff; font-size: 16px; letter-spacing: .02em; }
.brand-text span { display: block; font-size: 11px; color: #9C9EA4; line-height: 1.25; }
.nav-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em; color: #74777E; padding: 14px 10px 6px; font-weight: 700; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 10px; color: #C4C3BE;
  font-weight: 550; transition: background .15s, color .15s; position: relative;
}
.nav a:hover { background: var(--graphite-2); color: #fff; }
.nav a.active { background: var(--graphite-3); color: #fff; }
.nav a.active::before { content: ''; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0; background: var(--vanilla); }
.nav a.active .ico { color: var(--vanilla); }
.nav .badge-count { margin-left: auto; background: var(--vanilla); color: #1D1E21; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 99px; }
.sidebar-foot { margin-top: auto; border-top: 1px solid var(--graphite-3); padding-top: 12px; display: flex; flex-direction: column; gap: 4px; }
.me { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; cursor: pointer; }
.me:hover { background: var(--graphite-2); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--vanilla), #D8C27A); color: #1D1E21; display: grid; place-items: center; font-weight: 750; font-size: 12.5px; flex: none; }
.avatar.sm { width: 26px; height: 26px; font-size: 10.5px; }
.me b { color: #fff; font-weight: 600; display: block; font-size: 13px; }
.me span { color: #8C8F95; font-size: 11.5px; }
.side-btns { display: flex; gap: 6px; padding: 0 4px; }
.side-btns button { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; background: var(--graphite-2); border: 0; color: #BDBCB6; border-radius: 9px; padding: 8px; cursor: pointer; font-size: 12.5px; }
.side-btns button:hover { color: #fff; background: var(--graphite-3); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px;
  padding: 14px 32px; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
}
.topbar.scrolled { border-bottom-color: var(--line); }
.crumbs { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; min-width: 0; }
.crumbs a:hover { color: var(--ink); }
.crumbs b { color: var(--ink); font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-trigger {
  margin-left: auto; display: flex; align-items: center; gap: 10px; width: min(360px, 34vw); padding: 9px 12px;
  border: 1px solid var(--line); border-radius: 11px; background: var(--card); color: var(--muted); cursor: pointer; box-shadow: var(--shadow-sm);
}
.search-trigger span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.search-trigger kbd { margin-left: auto; white-space: nowrap; }
kbd { font-family: 'JBMono', monospace; font-size: 11px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px; background: var(--card-2); color: var(--muted); }
.content { padding: 8px 32px 48px; max-width: 1480px; width: 100%; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin: 10px 0 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 27px; letter-spacing: -.025em; margin: 0; font-weight: 750; line-height: 1.15; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--card); color: var(--ink);
  padding: 8px 14px; border-radius: 10px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: transform .06s, background .15s, border-color .15s, box-shadow .15s;
  box-shadow: var(--shadow-sm); font-size: 13.5px; line-height: 1.3;
}
.btn:hover { border-color: #CFCCC2; background: var(--card-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--vanilla); border-color: #E2CF84; color: #141414; }
.btn.primary:hover { background: var(--vanilla-strong); }
.btn.dark { background: var(--graphite); border-color: var(--graphite); color: #fff; }
.btn.dark:hover { background: var(--graphite-3); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--line-2); }
.btn.danger { color: var(--red); }
.btn.danger:hover { background: var(--red-bg); border-color: color-mix(in srgb, var(--red) 30%, transparent); }
.btn.sm { padding: 5px 10px; font-size: 12.5px; border-radius: 8px; gap: 6px; }
.btn.icon { padding: 7px; }
.btn.lg { padding: 11px 18px; font-size: 14.5px; border-radius: 12px; }
[data-theme="dark"] .btn:hover { border-color: #3A3C42; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------- Karten ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; gap: 10px; padding: 16px 20px 0; }
.card-h h3 { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.card-h .right { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.card-b { padding: 16px 20px 20px; }
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
@media (max-width: 1180px) { .g4 { grid-template-columns: repeat(2, 1fr); } .g-main, .g3 { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .app { grid-template-columns: 1fr; } .sidebar { display: none; } .g2, .g4 { grid-template-columns: 1fr; } .content, .topbar { padding-left: 16px; padding-right: 16px; } }

/* KPI-Kacheln */
.kpi { padding: 18px 20px; position: relative; overflow: hidden; cursor: default; }
a.kpi { cursor: pointer; transition: transform .12s, box-shadow .12s; }
a.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow), 0 10px 30px -14px rgba(0,0,0,.25); }
.kpi .k-label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 600; font-size: 12.5px; }
.kpi .k-ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--card-2); border: 1px solid var(--line); color: var(--ink-2); }
.kpi .k-val { font-size: 30px; font-weight: 750; letter-spacing: -.035em; margin-top: 12px; line-height: 1; font-variant-numeric: tabular-nums; }
.kpi .k-sub { margin-top: 8px; font-size: 12.5px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.kpi.accent { background: var(--vanilla); border-color: #E2CF84; color: #141414; }
.kpi.accent .k-label, .kpi.accent .k-sub { color: #5A4C1A; }
.kpi.accent .k-ico { background: rgba(255,255,255,.55); border-color: transparent; color: #141414; }
.kpi .deco { position: absolute; right: -22px; bottom: -22px; width: 96px; height: 96px; border-radius: 50%; border: 14px solid rgba(255,255,255,.35); }
.delta { font-weight: 700; display: inline-flex; align-items: center; gap: 2px; }
.delta.up { color: var(--green); } .delta.down { color: var(--red); }
.kpi.accent .delta.up { color: #1F5E35; } .kpi.accent .delta.down { color: #8C2A22; }

/* ---------- Tabellen ---------- */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: separate; border-spacing: 0; }
.t th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--card); position: sticky; top: 0; }
.t td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr.click { cursor: pointer; }
.t tbody tr.click:hover td { background: var(--card-2); }
.t .r { text-align: right; } .t .c { text-align: center; }
.t td.strong { font-weight: 650; }
.t-sub { display: block; color: var(--muted); font-size: 12px; margin-top: 1px; }
.empty { text-align: center; padding: 46px 20px; color: var(--muted); }
.empty .ico { color: #B8B5AA; margin-bottom: 8px; }
.empty b { display: block; color: var(--ink); font-size: 15px; margin-bottom: 4px; }

/* Status-Pillen */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 99px; font-size: 12px; font-weight: 650; white-space: nowrap; border: 1px solid transparent; }
.pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.bestellt { color: var(--blue); background: var(--blue-bg); }
.pill.teilgeliefert { color: var(--amber); background: var(--amber-bg); }
.pill.geliefert { color: var(--teal); background: var(--teal-bg); }
.pill.abgeschlossen { color: var(--green); background: var(--green-bg); }
.pill.storniert { color: var(--red); background: var(--red-bg); }
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 7px; font-size: 12px; font-weight: 600; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.tag .dot { width: 8px; height: 8px; border-radius: 3px; }
.tag.main { background: var(--vanilla-soft); color: var(--vanilla-ink); border: 1px solid color-mix(in srgb, var(--vanilla-strong) 60%, transparent); }
.tag.ok { background: var(--green-bg); color: var(--green); } .tag.warn { background: var(--amber-bg); color: var(--amber); } .tag.err { background: var(--red-bg); color: var(--red); } .tag.info { background: var(--blue-bg); color: var(--blue); }
.tags { display: flex; flex-wrap: wrap; gap: 5px; }

.progress { height: 6px; background: var(--line-2); border-radius: 99px; overflow: hidden; min-width: 70px; }
.progress > i { display: block; height: 100%; background: var(--teal); border-radius: 99px; }
.progress.full > i { background: var(--green); }
.bar-share { height: 8px; border-radius: 4px; background: var(--chart-1); min-width: 2px; }

/* ---------- Formulare ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span, .label { font-size: 12.5px; font-weight: 650; color: var(--ink-2); }
.field > span .req { color: var(--red); }
.input, .field input, .field select, .field textarea, select.input {
  width: 100%; border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 9px 12px; outline: none;
  transition: border-color .15s, box-shadow .15s; min-height: 39px;
}
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { border-color: var(--focus); box-shadow: 0 0 0 4px color-mix(in srgb, var(--vanilla) 55%, transparent); }
.field textarea { min-height: 80px; resize: vertical; }
.field .hint { font-size: 12px; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 14px; }
.form-grid > .s12 { grid-column: span 12; } .form-grid > .s8 { grid-column: span 8; } .form-grid > .s6 { grid-column: span 6; } .form-grid > .s4 { grid-column: span 4; } .form-grid > .s3 { grid-column: span 3; } .form-grid > .s9 { grid-column: span 9; }
@media (max-width: 760px) { .form-grid > * { grid-column: span 12 !important; } }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.check input { width: 17px; height: 17px; accent-color: #B8952F; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .input { width: auto; }
.search-box { position: relative; flex: 1; min-width: 220px; max-width: 420px; }
.search-box .ico { position: absolute; left: 12px; top: 11px; color: var(--muted); }
.toolbar .search-box input, .search-box input { padding-left: 38px; width: 100%; }
.seg { display: inline-flex; background: var(--card); border: 1px solid var(--line); border-radius: 11px; padding: 3px; gap: 2px; box-shadow: var(--shadow-sm); flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; cursor: pointer; font-weight: 600; color: var(--muted); font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--graphite); color: #fff; }
[data-theme="dark"] .seg button.on { background: var(--vanilla); color: #141414; }
.seg button .cnt { font-size: 11px; background: var(--line-2); color: var(--ink-2); border-radius: 99px; padding: 0 6px; }
.seg button.on .cnt { background: rgba(255,255,255,.18); color: inherit; }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 10px 14px; cursor: pointer; font-weight: 650; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; gap: 8px; align-items: center; white-space: nowrap; }
.tabs button:hover { color: var(--ink); }
.tabs button.on { color: var(--ink); border-bottom-color: #C9A63E; }
.tabs .cnt { font-size: 11px; background: var(--line-2); border-radius: 99px; padding: 0 7px; color: var(--ink-2); }

/* ---------- Dropzone ---------- */
.drop {
  border: 2px dashed #D6D2C4; border-radius: var(--r); padding: 34px 20px; text-align: center; background: var(--card-2);
  cursor: pointer; transition: border-color .15s, background .15s; position: relative;
}
.drop:hover, .drop.over { border-color: #C9A63E; background: var(--vanilla-soft); }
.drop.disabled { opacity: .55; cursor: not-allowed; }
.drop .drop-ico { width: 54px; height: 54px; margin: 0 auto 12px; border-radius: 15px; background: var(--vanilla); color: #1D1E21; display: grid; place-items: center; box-shadow: 0 8px 20px -8px rgba(160, 130, 30, .6); }
.drop b { display: block; font-size: 15px; }
.drop span { color: var(--muted); font-size: 13px; }
.drop input { display: none; }

/* ---------- Modal ---------- */
.overlay { position: fixed; inset: 0; background: rgba(15, 15, 16, .45); backdrop-filter: blur(3px); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; overflow-y: auto; animation: fade .15s; }
.modal { background: var(--card); border-radius: 18px; width: 100%; max-width: 620px; box-shadow: var(--shadow-lg); animation: pop .18s cubic-bezier(.2, .9, .3, 1.2); border: 1px solid var(--line); }
.modal.wide { max-width: 980px; } .modal.xwide { max-width: 1320px; }
.modal-h { display: flex; align-items: center; gap: 12px; padding: 20px 24px 6px; }
.modal-h h2 { margin: 0; font-size: 19px; letter-spacing: -.02em; }
.modal-h .x { margin-left: auto; }
.modal-b { padding: 14px 24px 8px; }
.modal-f { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 24px 20px; }
.modal-f .left { margin-right: auto; display: flex; gap: 8px; align-items: center; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }

/* Toasts */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--graphite); color: #F0EFEA; padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); display: flex; align-items: flex-start; gap: 10px; max-width: 420px; animation: pop .2s; font-weight: 550; }
.toast .ico { margin-top: 1px; }
.toast.ok .ico { color: #8FD3A6; } .toast.err .ico { color: #F2958C; } .toast.warn .ico { color: var(--vanilla); }

/* Command-Palette */
.palette { max-width: 640px; overflow: hidden; }
.palette-in { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.palette-in input { border: 0; outline: 0; background: none; font-size: 17px; flex: 1; }
.palette-list { max-height: 420px; overflow-y: auto; padding: 8px; }
.palette-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; cursor: pointer; }
.palette-item.on, .palette-item:hover { background: var(--vanilla-soft); }
.palette-item .pi-ico { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--line-2); flex: none; }
.palette-item b { display: block; font-weight: 650; }
.palette-item span { color: var(--muted); font-size: 12.5px; }
.palette-group { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; padding: 10px 12px 4px; }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art { background: var(--graphite); color: #fff; padding: 48px; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.login-art .tiles { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; padding: 14px; opacity: .9; transform: rotate(-8deg) scale(1.35); transform-origin: 70% 40%; }
.login-art .tiles i { border-radius: 18px; background: #2A2C30; aspect-ratio: 1; }
.login-art .tiles i.v { background: var(--vanilla); }
.login-art .tiles i.g { background: #3A3C41; }
.login-art .tiles i.o { background: transparent; border: 2px solid #3A3C41; }
.login-art > * { position: relative; }
.login-art .shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(29,30,33,.2) 0%, rgba(29,30,33,.65) 55%, #1D1E21 88%); }
.login-art .claim { margin-top: auto; }
.login-art h1 { font-size: 64px; margin: 0; letter-spacing: -.045em; line-height: .95; font-weight: 800; }
.login-art h1 em { font-style: normal; color: var(--vanilla); }
.login-art p { color: #BDBCB6; font-size: 16px; max-width: 420px; }
.login-form { display: flex; align-items: center; justify-content: center; padding: 40px; }
.login-form .box { width: 100%; max-width: 380px; }
.login-form h2 { font-size: 26px; letter-spacing: -.025em; margin: 0 0 6px; }
.login-form .err { background: var(--red-bg); color: var(--red); padding: 10px 12px; border-radius: 10px; font-weight: 600; font-size: 13px; }
@media (max-width: 900px) { .login { grid-template-columns: 1fr; } .login-art { display: none; } }

/* ---------- Bestellung Detail ---------- */
.hero { padding: 22px 24px; display: flex; gap: 20px; flex-wrap: wrap; align-items: flex-start; }
.hero h1 { margin: 0; font-size: 25px; letter-spacing: -.025em; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.hero .meta { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 14px; }
.hero .meta div { min-width: 120px; }
.hero .meta small { display: block; color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.hero .meta b, .hero .meta a { font-weight: 650; }
.hero .meta a:hover { text-decoration: underline; text-decoration-color: #C9A63E; text-underline-offset: 3px; }
.hero .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.stepper { display: flex; gap: 0; padding: 0 24px 22px; }
.step { flex: 1; display: flex; align-items: center; gap: 10px; position: relative; color: var(--muted); font-weight: 600; font-size: 13px; }
.step .dot { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; background: var(--card); z-index: 1; flex: none; }
.step::after { content: ''; flex: 1; height: 2px; background: var(--line); margin-right: 10px; }
.step:last-child::after { display: none; }
.step.done { color: var(--ink); }
.step.done .dot { background: var(--graphite); border-color: var(--graphite); color: var(--vanilla); }
.step.done::after { background: var(--graphite); }
.step.cur .dot { border-color: #C9A63E; background: var(--vanilla); color: #141414; }
[data-theme="dark"] .step.done .dot { background: var(--vanilla); color: #141414; border-color: var(--vanilla); }
[data-theme="dark"] .step.done::after { background: var(--vanilla); }
.serials { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; align-items: center; }
.sn { font-family: 'JBMono', monospace; font-size: 11.5px; background: var(--card-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 4px 1px 7px; display: inline-flex; align-items: center; gap: 4px; }
.sn button { border: 0; background: none; cursor: pointer; color: var(--muted); padding: 0 2px; line-height: 1; }
.sn button:hover { color: var(--red); }
.sn.delivered { border-color: color-mix(in srgb, var(--teal) 40%, transparent); background: var(--teal-bg); }
.sn-input { display: inline-flex; align-items: center; gap: 4px; }
.sn-input input { width: 170px; padding: 4px 8px; min-height: 0; border-radius: 7px; font-family: 'JBMono', monospace; font-size: 12px; }
.addsn { border: 1px dashed #CFCBBE; background: none; border-radius: 6px; font-size: 11.5px; padding: 1px 8px; cursor: pointer; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.addsn:hover { border-color: #C9A63E; color: var(--ink); background: var(--vanilla-soft); }
.sn-count { font-size: 11px; color: var(--muted); }
.sn-count.ok { color: var(--green); font-weight: 700; }

.split { display: grid; grid-template-columns: minmax(0, .78fr) minmax(0, 1.5fr); gap: 18px; }
@media (max-width: 1100px) { .split { grid-template-columns: 1fr; } }
.pdf-frame { width: 100%; height: 72vh; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.conf { display: flex; align-items: center; gap: 10px; }
.conf .meter { width: 120px; height: 8px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.conf .meter i { display: block; height: 100%; border-radius: 99px; }
.alert { display: flex; gap: 10px; padding: 11px 14px; border-radius: 11px; font-size: 13px; align-items: flex-start; }
.alert.warn { background: var(--amber-bg); color: var(--amber); }
.alert.ok { background: var(--green-bg); color: var(--green); }
.alert.err { background: var(--red-bg); color: var(--red); }
.alert.info { background: var(--blue-bg); color: var(--blue); }
.alert ul { margin: 2px 0 0; padding-left: 18px; }
.alert b { font-weight: 700; }
.items-edit { table-layout: fixed; min-width: 820px; }
.items-edit td { padding: 5px 4px; }
.items-edit th { padding: 8px 4px; }
.items-edit input { width: 100%; border: 1px solid transparent; background: transparent; border-radius: 7px; padding: 6px 7px; min-height: 0; }
.items-edit input:hover { border-color: var(--line); }
.items-edit input:focus { border-color: var(--focus); background: var(--card); outline: none; }
.items-edit input.r { text-align: right; }
.totals { display: grid; grid-template-columns: auto auto; gap: 6px 22px; justify-content: end; margin-top: 12px; align-items: center; }
.totals .lbl { color: var(--muted); text-align: right; }
.totals input { width: 130px; text-align: right; }
.totals .grand { font-weight: 750; font-size: 16px; }

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 12px; padding: 0 0 16px; position: relative; }
.timeline li::before { content: ''; position: absolute; left: 13px; top: 28px; bottom: 0; width: 2px; background: var(--line-2); }
.timeline li:last-child::before { display: none; }
.timeline .tl-ico { width: 28px; height: 28px; border-radius: 50%; background: var(--card-2); border: 1px solid var(--line); display: grid; place-items: center; flex: none; color: var(--ink-2); }
.timeline b { font-weight: 600; }
.timeline .when { color: var(--muted); font-size: 12px; }

/* Händler-Karten */
.wcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.wcard { padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; cursor: pointer; transition: transform .12s, box-shadow .12s, border-color .12s; }
.wcard:hover { transform: translateY(-2px); border-color: #DCD6C2; }
.wcard.inactive { opacity: .55; }
.wcard .w-top { display: flex; gap: 12px; align-items: center; }
.monogram { width: 44px; height: 44px; border-radius: 12px; background: var(--graphite); color: var(--vanilla); display: grid; place-items: center; font-weight: 800; font-size: 15px; flex: none; letter-spacing: -.02em; }
.wcard h3 { margin: 0; font-size: 15.5px; letter-spacing: -.01em; }
.wcard .kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 13px; }
.wcard .kv span { color: var(--muted); }
.copyable { cursor: copy; border-bottom: 1px dashed transparent; }
.copyable:hover { border-bottom-color: #C9A63E; }
.wcard .w-foot { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line-2); padding-top: 12px; margin-top: auto; font-size: 12.5px; }

/* Sortiment */
.matrix { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.mcat { padding: 16px 18px; }
.mcat h4 { margin: 0 0 10px; display: flex; align-items: center; gap: 9px; font-size: 14.5px; }
.mcat h4 .dot { width: 12px; height: 12px; border-radius: 4px; }
.mrow { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; }
.mrow:hover { background: var(--card-2); }
.mrow .rank { min-width: 24px; padding: 0 5px; height: 24px; border-radius: 7px; display: grid; place-items: center; font-size: 11px; font-weight: 800; flex: none; }
.mrow .rank.r1 { background: var(--vanilla); color: #141414; }
.mrow .rank.r2 { background: var(--line-2); color: var(--muted); }
.mrow b { font-weight: 650; display: block; }
.mrow small { color: var(--muted); }

/* Chart */
.chart-box { position: relative; height: 260px; }
.chart-box.tall { height: 320px; }
.legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--ink-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* Rechte-Matrix */
.perm-matrix th:not(:first-child), .perm-matrix td:not(:first-child) { text-align: center; }
.perm-matrix td:first-child { font-weight: 550; }
.perm-matrix td:first-child small { display: block; color: var(--muted); font-weight: 400; font-family: 'JBMono', monospace; font-size: 11px; }

.section-title { font-size: 12px; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); font-weight: 700; margin: 22px 0 10px; }
.kvs { display: grid; grid-template-columns: 140px 1fr; gap: 9px 14px; font-size: 13.5px; }
.kvs span { color: var(--muted); }
.contact { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.contact:last-child { border-bottom: 0; }
.link-ico { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); }
.link-ico:hover { color: var(--ink); text-decoration: underline; text-decoration-color: #C9A63E; text-underline-offset: 3px; }
.code-lines { font-family: 'JBMono', monospace; font-size: 11.5px; background: var(--card-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px; max-height: 320px; overflow: auto; white-space: pre; line-height: 1.55; }
.code-lines .ln { color: #AAA79C; user-select: none; display: inline-block; width: 30px; }
.spinner { width: 18px; height: 18px; border: 2.5px solid var(--line); border-top-color: #C9A63E; border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 60px; color: var(--muted); }
.scan-big { font-family: 'JBMono', monospace; font-size: 20px !important; padding: 14px 16px !important; letter-spacing: .02em; }
.scan-target { padding: 12px 14px; border-radius: 12px; background: var(--vanilla-soft); border: 1px solid color-mix(in srgb, var(--vanilla-strong) 70%, transparent); }
video.cam { width: 100%; border-radius: 12px; background: #000; max-height: 260px; object-fit: cover; }
.fade-in { animation: fade .25s; }

/* Mobil: Menü-Schalter */
.menu-btn { display: none; }
@media (max-width: 760px) {
  .menu-btn { display: inline-flex; }
  .app.menu-open .sidebar { display: flex; position: fixed; inset: 0 auto 0 0; width: 270px; z-index: 60; box-shadow: var(--shadow-lg); }
  .search-trigger span, .search-trigger kbd, .topbar .btn.primary span { display: none; }
  .search-trigger { width: auto; }
  .hero .actions { margin-left: 0; }
  .stepper { overflow-x: auto; } .step { flex: none; padding-right: 8px; } .step::after { width: 24px; flex: none; }
}

/* Druck (Berichte) */
@media print {
  .sidebar, .topbar, .page-head .actions, .tabs a, .toasts { display: none !important; }
  .app { display: block; }
  .content { padding: 0; }
  .card { box-shadow: none; break-inside: avoid; }
  body, html { background: #fff; }
}
