/* ============================================================
   med|CREW Partner Portal – Design angelehnt an med-crew.de
   Inter · Navy #11326A · Primary #4352C9 · Akzent #51CEE5
   Alle Farben als Tokens; Dark Mode über prefers-color-scheme
   oder data-theme="dark" auf <html> (Umschalter im Benutzermenü).
   ============================================================ */

:root {
    color-scheme: light;

    --heading: #11326a;
    --text: #11326a;
    --muted: #677da3;
    --muted-2: #95a6c4;

    --primary: #4352c9;
    --primary-600: #3644b3;
    --primary-50: #eef0fb;
    --primary-100: #dfe3f8;
    --on-primary: #ffffff;
    --accent: #51cee5;
    --accent-50: #e7f8fc;
    --accent-ink: #1793ab;

    --bg: #f6faff;
    --surface: #ffffff;
    --surface-2: #fafcff;
    --input-bg: #ffffff;
    --border: #e1e8f4;
    --border-strong: #cdd7e9;
    --dots: #d7e0f0;
    --logo: #8e9bb0;

    --success: #13a37a;
    --success-50: #e3f6f0;
    --success-ink: #0d6e52;
    --warning: #d98b0b;
    --warning-50: #fdf3e1;
    --warning-ink: #8a5806;
    --danger: #d64550;
    --danger-50: #fcebec;
    --danger-ink: #9c2731;
    --danger-border: #f0c4c8;
    --info: #2f8fd8;
    --info-50: #e6f2fc;
    --info-ink: #1d5e8f;
    --neutral-50: #eef2f8;

    --focus-ring: rgba(67, 82, 201, 0.14);
    --backdrop: rgba(17, 50, 106, 0.35);
    --toast-bg: #11326a;
    --toast-error-bg: #8f1f2a;

    --radius-card: 18px;
    --radius-input: 12px;
    --radius-pill: 999px;
    --shadow-card: 0 0 25px rgba(17, 50, 106, 0.07);
    --shadow-pop: 0 18px 50px rgba(17, 50, 106, 0.18);

    --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --sidebar-w: 264px;
}

/* Dunkles Farbschema: navy-getönte Flächen statt Schwarz */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark;

        --heading: #eef3fc;
        --text: #d5dff1;
        --muted: #93a6c8;
        --muted-2: #6c80a6;

        --primary: #8d98f3;
        --primary-600: #a7b0f6;
        --primary-50: rgba(141, 152, 243, 0.13);
        --primary-100: rgba(141, 152, 243, 0.24);
        --on-primary: #0b1426;
        --accent: #51cee5;
        --accent-50: rgba(81, 206, 229, 0.12);
        --accent-ink: #7fdcee;

        --bg: #0a1325;
        --surface: #111d33;
        --surface-2: #16243f;
        --input-bg: #0d182c;
        --border: #213252;
        --border-strong: #2e4369;
        --dots: #17253f;
        --logo: #a9b5c9;

        --success: #34c99c;
        --success-50: rgba(52, 201, 156, 0.14);
        --success-ink: #72e2bf;
        --warning: #f0a93a;
        --warning-50: rgba(240, 169, 58, 0.14);
        --warning-ink: #f5c477;
        --danger: #f06a74;
        --danger-50: rgba(240, 106, 116, 0.14);
        --danger-ink: #f6a0a7;
        --danger-border: rgba(240, 106, 116, 0.4);
        --info: #5aaef0;
        --info-50: rgba(90, 174, 240, 0.14);
        --info-ink: #96caf6;
        --neutral-50: rgba(147, 166, 200, 0.12);

        --focus-ring: rgba(141, 152, 243, 0.25);
        --backdrop: rgba(3, 8, 18, 0.62);
        --toast-bg: #1f2f50;
        --toast-error-bg: #7a1f29;
        --shadow-card: 0 0 0 1px var(--border);
        --shadow-pop: 0 18px 50px rgba(0, 0, 0, 0.55);
    }
}

:root[data-theme="dark"] {
    color-scheme: dark;

    --heading: #eef3fc;
    --text: #d5dff1;
    --muted: #93a6c8;
    --muted-2: #6c80a6;

    --primary: #8d98f3;
    --primary-600: #a7b0f6;
    --primary-50: rgba(141, 152, 243, 0.13);
    --primary-100: rgba(141, 152, 243, 0.24);
    --on-primary: #0b1426;
    --accent: #51cee5;
    --accent-50: rgba(81, 206, 229, 0.12);
    --accent-ink: #7fdcee;

    --bg: #0a1325;
    --surface: #111d33;
    --surface-2: #16243f;
    --input-bg: #0d182c;
    --border: #213252;
    --border-strong: #2e4369;
    --dots: #17253f;
    --logo: #a9b5c9;

    --success: #34c99c;
    --success-50: rgba(52, 201, 156, 0.14);
    --success-ink: #72e2bf;
    --warning: #f0a93a;
    --warning-50: rgba(240, 169, 58, 0.14);
    --warning-ink: #f5c477;
    --danger: #f06a74;
    --danger-50: rgba(240, 106, 116, 0.14);
    --danger-ink: #f6a0a7;
    --danger-border: rgba(240, 106, 116, 0.4);
    --info: #5aaef0;
    --info-50: rgba(90, 174, 240, 0.14);
    --info-ink: #96caf6;
    --neutral-50: rgba(147, 166, 200, 0.12);

    --focus-ring: rgba(141, 152, 243, 0.25);
    --backdrop: rgba(3, 8, 18, 0.62);
    --toast-bg: #1f2f50;
    --toast-error-bg: #7a1f29;
    --shadow-card: 0 0 0 1px var(--border);
    --shadow-pop: 0 18px 50px rgba(0, 0, 0, 0.55);
}

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

html, body {
    margin: 0;
    padding: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { color: var(--heading); margin: 0; font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: 30px; line-height: 1.2; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
h1:focus { outline: none; }
p { margin: 0 0 0.75em; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
strong { color: var(--heading); font-weight: 600; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
.hl { color: var(--primary); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.xs { font-size: 12px; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.right { text-align: right; }
.grow { flex: 1 1 auto; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.mt { margin-top: 16px; }
.mb { margin-bottom: 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }

/* ---------- Layout ---------- */

.shell { display: flex; min-height: 100vh; }

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-w);
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 22px 16px 16px;
    z-index: 20;
    overflow-y: auto;
}

.brand { display: flex; flex-direction: column; gap: 6px; padding: 4px 10px 22px; color: inherit; }
.brand:hover { text-decoration: none; }
.brand-logo { display: flex; align-items: center; font-size: 26px; line-height: 1; color: var(--logo); }
.brand-logo .med { font-weight: 300; letter-spacing: -0.02em; }
.brand-logo .bar { width: 2px; height: 26px; background: var(--logo); margin: 0 3px; }
.brand-logo .crew { font-weight: 700; letter-spacing: 0.01em; }
.brand-sub {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--primary);
}

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-section {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted-2);
    padding: 16px 12px 6px;
}
.nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-pill);
    color: var(--muted);
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
}
.nav a:hover { background: var(--bg); color: var(--heading); text-decoration: none; }
.nav a.active { background: var(--primary-50); color: var(--primary); font-weight: 600; }
.nav a .ico { flex: 0 0 auto; }

.user-box { margin-top: auto; padding-top: 16px; }
.user-card {
    display: flex; align-items: center; gap: 10px;
    padding: 12px;
    border-radius: 14px;
    background: var(--bg);
}
.user-card .who { min-width: 0; flex: 1; }
.user-card .name { font-weight: 600; color: var(--heading); font-size: 13.5px; }
.user-card .sub { font-size: 12px; color: var(--muted); }
.user-actions { display: flex; gap: 4px; margin-top: 8px; }
.user-actions > * { flex: 1; }
.user-actions form { display: flex; margin: 0; }
.user-actions .btn { width: 100%; }

/* Theme-Umschalter: zeigt den aktuellen Modus */
.theme-toggle .tm { display: none; align-items: center; gap: 8px; }
html:not([data-theme-mode]) .theme-toggle .tm-system,
html[data-theme-mode="system"] .theme-toggle .tm-system,
html[data-theme-mode="light"] .theme-toggle .tm-light,
html[data-theme-mode="dark"] .theme-toggle .tm-dark { display: inline-flex; }

.main {
    flex: 1;
    margin-left: var(--sidebar-w);
    min-width: 0;
    min-height: 100vh;
    background-color: var(--bg);
    background-image: radial-gradient(var(--dots) 1px, transparent 1px);
    background-size: 22px 22px;
}
.content { max-width: 1320px; margin: 0 auto; padding: 32px 36px 64px; }
.content.narrow { max-width: 920px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.page-head .lead { color: var(--muted); margin: 6px 0 0; max-width: 720px; }
.page-head .actions { display: flex; gap: 10px; flex-wrap: wrap; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--primary); margin-bottom: 6px; display: block; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13.5px; font-weight: 500; margin-bottom: 10px; }
.back:hover { color: var(--primary); text-decoration: none; }

/* ---------- Cards ---------- */

.card {
    background: var(--surface);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    padding: 24px;
}
.card + .card, .card + .grid, .grid + .card, .grid + .grid, .alert + .card { margin-top: 20px; }
.grid > .card + .card { margin-top: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card-head p { margin: 2px 0 0; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush .card-head { padding: 20px 24px 0; }
.card-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border); flex-wrap: wrap; }

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }

.stat { display: flex; flex-direction: column; gap: 4px; }
.stat .label { font-size: 13px; color: var(--muted); font-weight: 500; display: flex; align-items: center; gap: 8px; }
.stat .value { font-size: 32px; font-weight: 700; color: var(--heading); line-height: 1.1; letter-spacing: -0.02em; }
.stat .sub { font-size: 12.5px; color: var(--muted-2); }
a.stat-link { color: inherit; display: block; }
a.stat-link:hover { text-decoration: none; }
a.stat-link:hover .card { box-shadow: 0 0 0 2px var(--primary-100), var(--shadow-card); }
.stat-icon {
    width: 34px; height: 34px; border-radius: 10px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--primary-50); color: var(--primary);
}
.stat-icon.accent { background: var(--accent-50); color: var(--accent-ink); }
.stat-icon.success { background: var(--success-50); color: var(--success); }
.stat-icon.warning { background: var(--warning-50); color: var(--warning); }
.stat-icon.danger { background: var(--danger-50); color: var(--danger); }

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: var(--radius-pill);
    border: 1px solid transparent;
    font: inherit;
    font-weight: 500;
    font-size: 14.5px;
    line-height: 1.2;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
    white-space: nowrap;
    text-decoration: none !important;
    background: transparent;
    color: var(--text);
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover:not(:disabled) { background: var(--primary-600); box-shadow: 0 6px 18px var(--focus-ring); }
.btn-outline { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover:not(:disabled) { background: var(--primary-50); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover:not(:disabled) { background: var(--bg); color: var(--heading); }
.btn-danger { background: transparent; color: var(--danger); border-color: var(--danger-border); }
.btn-danger:hover:not(:disabled) { background: var(--danger-50); }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-icon { padding: 8px; border-radius: 10px; }
.btn-icon.btn-sm { padding: 6px; }
.btn-block { width: 100%; }
.btn-ms { background: var(--surface); color: var(--heading); border-color: var(--border-strong); }
.btn-ms:hover:not(:disabled) { background: var(--bg); }

.spinner {
    width: 16px; height: 16px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 48px; color: var(--muted); }

/* ---------- Forms ---------- */

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label, .label { font-size: 13px; font-weight: 600; color: var(--heading); }
.field .hint { font-size: 12.5px; color: var(--muted); }
.field .error { font-size: 12.5px; color: var(--danger); }

.input, .select, .textarea {
    width: 100%;
    font: inherit;
    font-size: 14.5px;
    color: var(--text);
    background: var(--input-bg);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-input);
    padding: 10px 14px;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.input::placeholder, .textarea::placeholder { color: var(--muted-2); }
.input[readonly] { background: var(--bg); }
.textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--focus-ring);
}
.input.invalid, .textarea.invalid, .select.invalid { border-color: var(--danger); }
.select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23889ac0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 38px;
}
.input-icon { position: relative; }
.input-icon .ico { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted-2); pointer-events: none; }
.input-icon .input { padding-left: 38px; }
.input-suffix { position: relative; }
.input-suffix .input { padding-right: 34px; }
.input-suffix .sfx { position: absolute; right: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 14px; pointer-events: none; }

.form-row { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-row-3 { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-row-zip { display: grid; gap: 16px; grid-template-columns: 140px minmax(0, 1fr) 140px; }
.form-row, .form-row-3, .form-row-zip { margin-bottom: 16px; }
.form-row > .field, .form-row-3 > .field, .form-row-zip > .field { margin-bottom: 0; }

.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; user-select: none; }
.check input { width: 17px; height: 17px; accent-color: var(--primary); margin: 0; }

.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; font-size: 14px; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track {
    width: 38px; height: 22px; border-radius: 99px;
    background: var(--border-strong);
    position: relative;
    transition: background 0.15s;
    flex: 0 0 auto;
}
.switch .track::after {
    content: ""; position: absolute; top: 3px; left: 3px;
    width: 16px; height: 16px; border-radius: 50%;
    background: #fff; box-shadow: 0 1px 3px rgba(17, 50, 106, 0.3);
    transition: transform 0.15s;
}
.switch input:checked + .track { background: var(--primary); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 4px var(--focus-ring); }

/* ---------- Auswahl-Kacheln ---------- */

.choice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.choice-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choice {
    position: relative;
    display: flex; align-items: flex-start; gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--border-strong);
    border-radius: 14px;
    background: var(--surface);
    cursor: pointer;
    font: inherit; color: var(--text);
    text-align: left;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.choice:hover { border-color: var(--primary); }
.choice.selected { border-color: var(--primary); background: var(--primary-50); box-shadow: 0 0 0 3px var(--focus-ring); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice .ci { width: 36px; height: 36px; border-radius: 10px; background: var(--bg); color: var(--primary); display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.choice.selected .ci { background: var(--surface); }
.choice .ct { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.choice .ct strong { font-size: 14px; }
.choice .ct span { font-size: 12.5px; color: var(--muted); }
.choice .price { margin-left: auto; font-size: 13px; font-weight: 600; color: var(--primary); white-space: nowrap; }
.swatch { width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--border-strong); display: inline-block; }
.swatch.white { background: #ffffff; }
.swatch.black { background: #1d222b; }

/* ---------- Bestellformular ---------- */

.section-title { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.section-title .num {
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--primary-50); color: var(--primary);
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 13px; flex: 0 0 auto;
}
.section-title p { margin: 0; color: var(--muted); font-size: 13px; }

.summary { position: sticky; top: 24px; }
.summary-lines { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; font-size: 14px; }
.summary-lines .line { display: flex; justify-content: space-between; gap: 12px; }
.summary-lines .line span:last-child { white-space: nowrap; font-variant-numeric: tabular-nums; }
.summary-total { display: flex; justify-content: space-between; padding-top: 12px; border-top: 1px solid var(--border); font-weight: 700; color: var(--heading); font-size: 16px; }

.address-box { padding: 14px 16px; border-radius: 14px; background: var(--bg); border: 1px dashed var(--border-strong); font-size: 14px; }

/* ---------- Tabellen ---------- */

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
    text-align: left;
    font-size: 11.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted-2);
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.table td { padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr:hover td { background: var(--surface-2); }
.table .cell-main { font-weight: 600; color: var(--heading); }
.table .cell-sub { font-size: 12.5px; color: var(--muted); }
.table .actions-cell { text-align: right; white-space: nowrap; }
.card.flush .table th:first-child, .card.flush .table td:first-child { padding-left: 24px; }
.card.flush .table th:last-child, .card.flush .table td:last-child { padding-right: 24px; }

.dl { display: grid; grid-template-columns: minmax(90px, max-content) minmax(0, 1fr); gap: 10px 24px; margin: 0; font-size: 14px; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; word-break: break-word; color: var(--text); }

/* ---------- Badges ---------- */

.badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: 12px; font-weight: 600;
    white-space: nowrap;
    background: var(--neutral-50); color: var(--muted);
}
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.success { background: var(--success-50); color: var(--success); }
.badge.warning { background: var(--warning-50); color: var(--warning); }
.badge.danger { background: var(--danger-50); color: var(--danger); }
.badge.info { background: var(--info-50); color: var(--info); }
.badge.primary { background: var(--primary-50); color: var(--primary); }
.badge.accent { background: var(--accent-50); color: var(--accent-ink); }
.badge.neutral { background: var(--neutral-50); color: var(--muted); }

.chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 11px 4px 9px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
    background: var(--surface);
    font-size: 12.5px; font-weight: 500;
    color: var(--heading);
    white-space: nowrap;
}
.chip .ico { color: var(--primary); flex: 0 0 auto; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- Tabs / Segmente ---------- */

.tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface); border-radius: var(--radius-pill); box-shadow: var(--shadow-card); margin-bottom: 20px; flex-wrap: wrap; }
.tabs a, .tabs button { padding: 8px 20px; border-radius: var(--radius-pill); color: var(--muted); font: inherit; font-weight: 500; font-size: 14px; display: inline-flex; align-items: center; gap: 8px; border: none; background: transparent; cursor: pointer; }
.tabs a:hover, .tabs button:hover { color: var(--heading); text-decoration: none; }
.tabs a.active, .tabs button.active { background: var(--primary); color: var(--on-primary); }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 18px 24px; border-bottom: 1px solid var(--border); }
.toolbar .input, .toolbar .select { width: auto; padding-top: 8px; padding-bottom: 8px; font-size: 14px; }
.toolbar .input-icon { flex: 1 1 260px; max-width: 360px; }
.toolbar .input-icon .input { width: 100%; }

/* ---------- Status-Verlauf (Bestellung) ---------- */

.steps { display: flex; gap: 0; margin: 4px 0 4px; }
.step { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; position: relative; text-align: center; font-size: 13px; color: var(--muted); }
.step::before { content: ""; position: absolute; top: 15px; left: -50%; right: 50%; height: 2px; background: var(--border-strong); z-index: 0; }
.step:first-child::before { display: none; }
.step .bubble { width: 32px; height: 32px; border-radius: 50%; background: var(--surface); border: 2px solid var(--border-strong); display: inline-flex; align-items: center; justify-content: center; position: relative; z-index: 1; color: var(--muted-2); }
.step.done { color: var(--heading); font-weight: 600; }
.step.done .bubble { background: var(--success); border-color: var(--success); color: #fff; }
.step.done::before { background: var(--success); }
.step.current { color: var(--heading); font-weight: 600; }
.step.current .bubble { border-color: var(--primary); color: var(--primary); }
.step.current::before { background: var(--success); }

.tracking-box { display: flex; align-items: center; gap: 16px; padding: 18px 20px; border-radius: 16px; background: var(--bg); flex-wrap: wrap; }
.tracking-box .ico-wrap { width: 44px; height: 44px; border-radius: 12px; background: var(--primary-50); color: var(--primary); display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.tracking-box.off .ico-wrap { background: var(--neutral-50); color: var(--muted-2); }

/* ---------- Hinweise ---------- */

.alert {
    display: flex; gap: 12px; align-items: flex-start;
    padding: 14px 16px;
    border-radius: 14px;
    font-size: 14px;
    background: var(--info-50); color: var(--info-ink);
    margin-bottom: 16px;
}
.alert strong { color: inherit; }
.alert .ico { flex: 0 0 auto; margin-top: 1px; }
.alert.success { background: var(--success-50); color: var(--success-ink); }
.alert.warning { background: var(--warning-50); color: var(--warning-ink); }
.alert.danger { background: var(--danger-50); color: var(--danger-ink); }
.alert p:last-child { margin-bottom: 0; }
.alert .grow p { margin: 2px 0 0; }

.token-box { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-radius: 14px; background: var(--bg); border: 1px dashed var(--border-strong); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 16px; color: var(--heading); word-break: break-all; }

/* ---------- Notizen ---------- */

.notes { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.note { padding: 12px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); }
.note.internal { background: var(--warning-50); border-color: transparent; }
.note-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; margin-bottom: 4px; }
.note-head strong { color: var(--heading); }
.note-head .btn { margin-left: auto; }
.note-text { margin: 0; white-space: pre-wrap; word-break: break-word; font-size: 14px; }
.note-form { display: flex; flex-direction: column; gap: 10px; padding-top: 16px; border-top: 1px solid var(--border); }
.note-form .row { justify-content: space-between; }

/* ---------- Leerer Zustand ---------- */

.empty { text-align: center; padding: 48px 24px; color: var(--muted); }
.empty .ico-wrap {
    width: 56px; height: 56px; border-radius: 16px;
    background: var(--primary-50); color: var(--primary);
    display: inline-flex; align-items: center; justify-content: center;
    margin-bottom: 14px;
}
.empty h3 { margin-bottom: 6px; }
.empty p { max-width: 420px; margin: 0 auto 16px; }

/* ---------- Modal ---------- */

.modal-backdrop {
    position: fixed; inset: 0;
    background: var(--backdrop);
    backdrop-filter: blur(2px);
    display: flex; align-items: flex-start; justify-content: center;
    padding: 6vh 16px 16px;
    z-index: 100;
    overflow-y: auto;
    animation: fade 0.15s ease-out;
}
.modal {
    width: 100%;
    max-width: 640px;
    background: var(--surface);
    border-radius: 22px;
    box-shadow: var(--shadow-pop);
    border: 1px solid var(--border);
    animation: pop 0.18s ease-out;
}
.modal.wide { max-width: 860px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 22px 26px 6px; }
.modal-body { padding: 14px 26px 8px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 26px 22px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(0.985); } }

/* Auswahlliste (Odoo-Suche) */
.picklist {
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-input);
    max-height: 320px;
    overflow-y: auto;
    margin-top: 8px;
}
.picklist button {
    display: flex; align-items: center; gap: 12px;
    width: 100%;
    padding: 10px 14px;
    background: var(--surface);
    border: none;
    border-bottom: 1px solid var(--border);
    font: inherit; text-align: left; color: var(--text);
    cursor: pointer;
}
.picklist button:last-child { border-bottom: none; }
.picklist button:hover { background: var(--bg); }
.picklist button.selected { background: var(--primary-50); }
.picklist .sub { font-size: 12.5px; color: var(--muted); }
.picklist .empty-row { padding: 14px; color: var(--muted); font-size: 13.5px; }
.avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--primary-50); color: var(--primary);
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 13px;
    flex: 0 0 auto;
}
.avatar.lg { width: 56px; height: 56px; font-size: 20px; }

/* Regeln (Odoo-Positionen) */
.rule-list { display: flex; flex-direction: column; gap: 10px; }
.rule {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 16px;
    align-items: center;
    padding: 14px 18px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
}
.rule.disabled { opacity: 0.55; }
.rule-order { display: flex; flex-direction: column; align-items: center; gap: 0; color: var(--muted-2); }
.rule-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.rule-side { display: flex; align-items: center; gap: 6px; }
.cond-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }

/* ---------- Anmeldung ---------- */

.login-wrap {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    padding: 24px 16px;
    background-color: var(--bg);
    background-image: radial-gradient(var(--dots) 1px, transparent 1px);
    background-size: 22px 22px;
}
.login-card { width: 100%; max-width: 420px; padding: 32px; }
.login-card.wide { max-width: 560px; }
.login-card .brand { padding: 0 0 24px; align-items: center; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted-2); font-size: 12.5px; margin: 18px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.login-foot { text-align: center; margin-top: 18px; font-size: 13.5px; color: var(--muted); }

/* ---------- Toasts ---------- */

.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 200; }
.toast {
    display: flex; align-items: center; gap: 10px;
    min-width: 260px; max-width: 440px;
    padding: 12px 16px;
    border-radius: 14px;
    background: var(--toast-bg); color: #fff;
    box-shadow: var(--shadow-pop);
    font-size: 14px;
    animation: pop 0.18s ease-out;
    cursor: pointer;
}
.toast.success .ico { color: #6ee7c4; }
.toast.error { background: var(--toast-error-bg); }

/* ---------- Blazor ---------- */

#blazor-error-ui {
    background: var(--danger-50);
    color: var(--danger-ink);
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 0.75rem; top: 0.5rem; }
.blazor-error-boundary { background: var(--danger-50); padding: 1rem; color: var(--danger-ink); border-radius: 14px; }
.blazor-error-boundary::after { content: "Es ist ein Fehler aufgetreten."; }
.validation-message { color: var(--danger); font-size: 12.5px; }
.validation-errors { margin: 0 0 16px; padding: 12px 16px 12px 32px; border-radius: 14px; background: var(--danger-50); color: var(--danger-ink); font-size: 13.5px; }
.input.modified.invalid, .select.modified.invalid, .textarea.modified.invalid { border-color: var(--danger); }

/* ---------- Mobile Navigation (ohne JavaScript) ---------- */

.nav-toggle { position: absolute; opacity: 0; pointer-events: none; }
.menu-toggle, .nav-scrim { display: none; }

@media (max-width: 1100px) {
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-main { grid-template-columns: minmax(0, 1fr); }
    .summary { position: static; }
}

@media (max-width: 860px) {
    .sidebar { transform: translateX(-100%); transition: transform 0.2s; box-shadow: var(--shadow-pop); }
    .nav-toggle:checked ~ .sidebar { transform: none; }
    .nav-toggle:checked ~ .nav-scrim { display: block; position: fixed; inset: 0; background: var(--backdrop); z-index: 15; }
    .main { margin-left: 0; }
    .content { padding: 72px 16px 48px; }
    .menu-toggle {
        display: inline-flex; position: fixed; top: 14px; left: 14px; z-index: 30;
        background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 8px;
        color: var(--heading); cursor: pointer; box-shadow: var(--shadow-card);
    }
    .grid-2, .grid-3, .grid-4, .form-row, .form-row-3, .form-row-zip, .cond-grid { grid-template-columns: minmax(0, 1fr); }
    .choice-grid, .choice-grid.cols-2 { grid-template-columns: minmax(0, 1fr); }
    .rule { grid-template-columns: 1fr; }
    .rule-order { flex-direction: row; }
    .dl { grid-template-columns: 1fr; gap: 2px 0; }
    .dl dd { margin-bottom: 10px; }
    .hide-sm { display: none; }
    h1 { font-size: 24px; }
    .step { font-size: 12px; }
}
