/* ==========================================================================
   AMCALC Design-Tokens v2 — "Präzisionswerk" (Terminal Luxe, Final Cut)
   ==========================================================================
   PR1 der Design-Modernisierung. Referenz: Design-Prototyp (Artifact).
   ALLE Legacy-Variablennamen bleiben erhalten — nur die Werte ändern sich,
   dadurch ziehen alle Legacy-Views automatisch mit. Neue Tokens sind additiv.
   Governance: Bei Konflikt zwischen Premium-Optik und Scan-Geschwindigkeit
   gewinnt immer die Tabelle. Nur transform/opacity animieren.
   Keine Dauer-Animationen. Schatten nur auf Overlays.
   ========================================================================== */

/* -- Self-hosted Fonts (DSGVO: kein Google-CDN) --------------------------- */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/assets/fonts/inter-400.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('/assets/fonts/inter-500.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('/assets/fonts/inter-600.woff2') format('woff2');
}
@font-face {
    font-family: 'JetBrains Mono';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/assets/fonts/jetbrains-mono-400.woff2') format('woff2');
}
@font-face {
    font-family: 'JetBrains Mono';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('/assets/fonts/jetbrains-mono-500.woff2') format('woff2');
}

:root {
    /* -- Flächen: Zinc-Achse, echtes Neutral-Schwarz statt Blaustich ------- */
    --bg-dark: #09090B;                 /* vorher #0b0e11 */
    --bg-elevated: #0F0F12;             /* NEU: Topbar, Sticky-Header, Toolbars */
    --bg-card: #101013;                 /* vorher #14181d */
    --bg-card-hover: #16161A;
    --bg-input: #0C0C0F;                /* solide statt Alpha-Weiß — rendert schärfer */
    --bg-table-row: #101013;
    --bg-table-row-alt: #101013;        /* Zebra abgeschafft — Hairlines statt Flächen */
    --table-row-separator: #18181C;     /* NEU */
    --overlay: rgba(9, 9, 11, 0.65);    /* NEU: Modal-Backdrop */

    /* -- Marke & Semantik (Logo: Grün = Interaktion/Gewinn, Gold = Marke/Geld) */
    --accent-primary: #2DD4A0;
    --accent-primary-hover: #3DE3AF;
    --accent-primary-pressed: #25B98B;
    --accent-primary-ink: #052E22;      /* NEU: Text AUF Smaragd-Flächen */
    --accent-primary-tint: rgba(45, 212, 160, 0.10);
    --accent-secondary: var(--accent-primary);   /* Legacy-Aliase */
    --accent-cyan: var(--accent-primary);
    --accent-magenta: var(--accent-primary);
    --accent-purple: var(--accent-primary);
    --accent-green: #4ADE80;
    --accent-red: #F87171;
    --accent-yellow: #FFC933;           /* Logo-Gold */
    --accent-info: #7DD3FC;             /* NEU */
    --accent-gold: #FFC933;             /* NEU: Marken-Gold */
    --accent-gold-text: #FFC933;
    --brand-lime: #52E85A;              /* NEU: Logo-Grün, nur Brand-Momente */
    --grad-swoosh: linear-gradient(90deg, var(--brand-lime), var(--accent-gold));
    /* Text-Varianten (im Dark identisch, im Light abgedunkelt fuer AA) */
    --accent-primary-text: var(--accent-primary);
    --accent-green-text: var(--accent-green);
    --accent-red-text: var(--accent-red);
    --accent-yellow-text: var(--accent-yellow);
    --accent-info-text: var(--accent-info);
    --tint-success: rgba(74, 222, 128, 0.10);
    --tint-danger: rgba(248, 113, 113, 0.10);
    --tint-warning: rgba(255, 201, 51, 0.10);
    --tint-info: rgba(125, 211, 252, 0.10);
    --tint-gold: rgba(255, 201, 51, 0.10);

    /* -- Text: 16:1 / 8:1 / 4.6:1 auf bg-dark — 8h-tauglich ---------------- */
    --text-primary: #EDEDEF;
    --text-secondary: #A1A1AA;
    --text-muted: #70707B;

    /* -- Rahmen: Elevation ist ein Border-Konzept, kein Schatten-Konzept --- */
    --border-color: #1F1F23;            /* solide statt Alpha-Weiß */
    --border-strong: #2E2E33;           /* NEU */
    --border-hover: rgba(45, 212, 160, 0.35);
    --focus-ring: rgba(45, 212, 160, 0.35);      /* NEU */
    --card-inner-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.03); /* NEU */

    /* -- Schatten: NUR auf Overlays (Modal, Dropdown, Toast) --------------- */
    --shadow-overlay: 0 16px 48px rgba(0, 0, 0, 0.5);   /* NEU */
    --shadow-sm: none;                  /* Karten sind flach — Hairline statt Schatten */
    --shadow-md: none;
    --shadow-lg: var(--shadow-overlay);
    --glow-primary: none;               /* Legacy-Glow-Aliase entschärft */
    --glow-secondary: none;
    --glow-cyan: none;
    --glow-magenta: none;
    --glow-purple: none;

    /* -- Charts (validierte Palette, s. Design-Doku) ----------------------- */
    --chart-line: #1CA87E;
    --chart-compare: #B5870A;
    --chart-grid: rgba(255, 255, 255, 0.06);

    /* -- Typografie --------------------------------------------------------- */
    --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', 'Cascadia Mono', Consolas, monospace;
    --fs-micro: 0.6875rem;
    --fs-meta: 0.75rem;
    --fs-table: 0.8125rem;
    --fs-body: 0.875rem;
    --fs-card-title: 1rem;
    --fs-page-title: 1.25rem;
    --fs-stat: 1.75rem;
    --fs-hero: 2.25rem;
    --base-font: clamp(0.75rem, 0.5vw + 0.5rem, 0.9rem);   /* Legacy */

    /* -- Spacing (8px-Grid mit 4px-Subraster) ------------------------------- */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;
    --space-7: 48px;
    --space-8: 64px;
    --base-padding: clamp(6px, 0.5vw, 12px);   /* Legacy */
    --base-margin: clamp(8px, 0.6vw, 14px);
    --base-gap: clamp(6px, 0.4vw, 10px);

    /* -- Radius (klein & technisch) ----------------------------------------- */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-xl: 10px;
    --base-radius: 6px;                 /* Legacy */

    /* -- Shell (fuer PR2) --------------------------------------------------- */
    --topbar-h: 56px;
    --sidebar-w: 232px;
    --sidebar-w-rail: 68px;
    --topbar-bg: rgba(9, 9, 11, 0.82);
    --row-h: 38px;

    /* -- Motion (fuer PR3) -------------------------------------------------- */
    --t-press: 80ms;
    --t-fast: 120ms;
    --t-overlay: 160ms;
    --t-enter: 200ms;
    --t-draw: 600ms;
    --t-count: 700ms;
    --ease-out: cubic-bezier(0.165, 0.84, 0.44, 1);
    --ease-io: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-pop: cubic-bezier(0.32, 0.72, 0, 1);
}

/* ==========================================================================
   Light Theme — gleichwertiger Buerger.
   Regel: #2DD4A0 ist im Light NIE Textfarbe, nur Flaeche/Linie.
   Legacy-Aliase (--accent-cyan etc.) werden hier auf die dunkle Text-
   Variante gemappt, weil Legacy-Views sie als Textfarbe verwenden.
   ========================================================================== */
[data-theme="light"] {
    --bg-dark: #FAFAFA;
    --bg-elevated: #FFFFFF;
    --bg-card: #FFFFFF;
    --bg-card-hover: #F4F4F5;
    --bg-input: #FFFFFF;
    --bg-table-row: #FFFFFF;
    --bg-table-row-alt: #FFFFFF;
    --table-row-separator: #EFEFF1;
    --overlay: rgba(24, 24, 27, 0.45);

    --accent-secondary: #0B7A5C;
    --accent-cyan: #0B7A5C;
    --accent-magenta: #0B7A5C;
    --accent-purple: #0B7A5C;
    --accent-green: #15803D;
    --accent-red: #DC2626;
    --accent-yellow: #B45309;
    --accent-primary-text: #0B7A5C;
    --accent-green-text: #15803D;
    --accent-red-text: #DC2626;
    --accent-yellow-text: #B45309;
    --accent-info-text: #0369A1;
    --accent-gold-text: #A16207;
    --brand-lime: #2FB53C;
    --tint-success: rgba(21, 128, 61, 0.08);
    --tint-danger: rgba(220, 38, 38, 0.08);
    --tint-warning: rgba(180, 83, 9, 0.08);
    --tint-info: rgba(3, 105, 161, 0.08);
    --tint-gold: rgba(161, 98, 7, 0.08);

    --text-primary: #18181B;
    --text-secondary: #52525B;
    --text-muted: #6E6E77;

    --border-color: #E4E4E7;
    --border-strong: #D4D4D8;
    --card-inner-highlight: none;

    --chart-line: #0B7A5C;
    --chart-compare: #A16207;
    --chart-grid: #ECECEE;

    --topbar-bg: rgba(250, 250, 250, 0.85);
    --shadow-overlay: 0 16px 48px rgba(24, 24, 27, 0.18);
    --shadow-lg: var(--shadow-overlay);
    --shadow-sm: 0 1px 2px rgba(24, 24, 27, 0.05);
}

/* Motion-Governance im Code: Reduced Motion nullt die Dauer-Tokens */
@media (prefers-reduced-motion: reduce) {
    :root {
        --t-press: 0.01ms; --t-fast: 0.01ms; --t-overlay: 0.01ms;
        --t-enter: 0.01ms; --t-draw: 0.01ms; --t-count: 0.01ms;
    }
}
html[data-motion="reduced"] {
    --t-press: 0.01ms; --t-fast: 0.01ms; --t-overlay: 0.01ms;
    --t-enter: 0.01ms; --t-draw: 0.01ms; --t-count: 0.01ms;
}

/* Zahlen-Utility: tabellarische Mono-Ziffern (Beträge, IDs) */
.num {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums slashed-zero;
}

/* Light Theme spezifische Anpassungen */
[data-theme="light"] .navbar {
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] th {
    background: #f1f5f9;
    color: #475569;
}

[data-theme="light"] .btn {
    color: #ffffff;
}

[data-theme="light"] .modal {
    background-color: rgba(0, 0, 0, 0.5);
}

[data-theme="light"] .modal-content-form {
    background: #ffffff;
}

[data-theme="light"] .modal-header {
    background: var(--bg-card-hover);
}

[data-theme="light"] ::-webkit-scrollbar-track {
    background: #f0f0f2;
}

[data-theme="light"] ::-webkit-scrollbar-thumb {
    background: #d1d5db;
}

[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
    background: #cbd5e1;
}

/* ==========================================================================
   1. Globale Stile & Typografie
   ========================================================================== */

html {
    margin: 0;
    padding: 0;
    font-size: var(--base-font);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    margin: 0;
    padding: 0;
    color: var(--text-primary);
    overflow-y: scroll;
    min-height: 100vh;
    font-size: 1rem;
    line-height: 1.5;
}

h1, h2, h3 {
    color: var(--text-primary);
    margin: var(--base-margin) 0;
    font-weight: 700;
}

h1 { font-size: 1.5rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.1rem; }

a {
    color: var(--accent-cyan);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--accent-magenta);
}

/* ==========================================================================
   2. Navigation - Dunkel & Modern
   ========================================================================== */

.navbar {
    width: 100%;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 0 var(--base-padding);
    padding-top: env(safe-area-inset-top, 0px);
    box-sizing: border-box;
    position: sticky;
    top: 0;
    z-index: 100; /* Z-Index Hierarchie: Navbar */
}

.nav-container {
    max-width: 100%;
    margin: 0;
    display: flex;
    align-items: center;
    height: clamp(36px, 3.5vw, 48px);
    gap: var(--base-gap);
}

.navbar-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
}

.navbar a.navbar-brand:hover {
    background: transparent;
    opacity: 0.85;
}

.navbar-brand img {
    height: clamp(28px, 3vw, 42px);
    width: auto;
    filter: brightness(1.1);
    transition: transform 0.2s ease;
}

.navbar-brand:hover img {
    transform: scale(1.03);
}

.nav-menu {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-grow: 1;
    margin-left: var(--base-gap);
    overflow: visible;
}

.navbar ul.nav-left,
.navbar ul.nav-right {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: nowrap;
}

.navbar a {
    display: block;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 6px 10px;
    border-radius: var(--base-radius);
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    font-weight: 500;
    font-size: 0.9rem;
    white-space: nowrap;
}

.navbar a:hover {
    background: rgba(45, 212, 160, 0.1);
    color: var(--accent-cyan);
}

.navbar a.active {
    background: rgba(45, 212, 160, 0.1);
    border: 1px solid var(--accent-cyan);
    color: var(--accent-cyan);
    font-weight: 600;
}

.navbar a.active:hover {
    background: rgba(45, 212, 160, 0.15);
}

.navbar a.nav-logout {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.navbar a.nav-logout:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--accent-red);
    border-color: var(--accent-red);
}

/* Dropdown-Menü */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-toggle {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

.dropdown-arrow {
    font-size: 0.6rem;
    transition: transform 0.2s;
    color: var(--text-muted);
}

.nav-dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
    color: var(--accent-cyan);
}

.nav-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--base-radius);
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    z-index: 200; /* Z-Index Hierarchie: Dropdowns */
    visibility: hidden;
    opacity: 0;
    display: flex;
    flex-direction: column;
    padding: 6px 0;
    padding-top: 10px;
    margin-top: 4px;
    transition: opacity 0.15s ease, visibility 0s linear 0.3s;
}

/* Unsichtbare Brücke zwischen Toggle und Menü */
.nav-dropdown-menu::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 0;
    right: 0;
    height: 12px;
    background: transparent;
}

.nav-dropdown:hover .nav-dropdown-menu {
    visibility: visible;
    opacity: 1;
    transition: opacity 0.15s ease, visibility 0s linear 0s;
}

.nav-dropdown-menu li {
    display: block;
    width: 100%;
}

.nav-dropdown-menu a {
    display: block;
    padding: 8px 16px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    border-radius: 0;
    white-space: nowrap;
}

.nav-dropdown-menu a:hover {
    background: rgba(45, 212, 160, 0.1);
    color: var(--accent-cyan);
}

.nav-dropdown-menu a.active {
    background: rgba(45, 212, 160, 0.1);
    border-left: 2px solid var(--accent-cyan);
    color: var(--accent-cyan);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 6px 0;
    padding: 0;
}

/* ==========================================================================
   3. Layout & Container
   ========================================================================== */

.container {
    width: 100%;
    max-width: 100%;
    margin: var(--base-margin) auto;
    padding: var(--base-padding);
    background: var(--bg-card);
    box-sizing: border-box;
    border-radius: var(--base-radius);
    border: 1px solid var(--border-color);
}

.product-list {
    background: var(--bg-table-row);
    border: 1px solid var(--border-color);
    padding: var(--base-padding);
    margin-top: var(--base-margin);
    border-radius: var(--base-radius);
    overflow-x: auto;
}

.product-list h2 {
    margin-top: 0;
    font-size: 1.1rem;
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: var(--base-margin);
}

/* ==========================================================================
   4. Formulare & Buttons
   ========================================================================== */

form {
    display: flex;
    flex-direction: column;
    gap: var(--base-gap);
    margin-bottom: var(--base-margin);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea {
    padding: 8px 12px;
    font-size: 1rem;
    font-family: 'JetBrains Mono', monospace;
    border-radius: var(--base-radius);
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-primary);
    transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent-cyan);
    background: rgba(45, 212, 160, 0.03);
    box-shadow: 0 0 0 3px rgba(45, 212, 160, 0.1);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-muted);
}

/* Quick Action Button */
.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--base-radius);
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
    text-align: center;
    font-size: 0.85rem;
    cursor: pointer;
}

.quick-action-btn:hover {
    background: rgba(45, 212, 160, 0.1);
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
    transform: translateY(-2px);
}

.quick-action-icon {
    font-size: 1.4rem;
    margin-bottom: 4px;
}

/* Checkbox */
.checkbox-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

input[type="checkbox"] {
    width: 15px;
    height: 15px;
    min-width: 15px;
    min-height: 15px;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    flex-shrink: 0;
    cursor: pointer;
    position: relative;
    appearance: none;
    -webkit-appearance: none;
    background: var(--bg-input);
    border: 1.5px solid rgba(255, 255, 255, 0.22);
    border-radius: 4px;
    vertical-align: middle;
    transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

input[type="checkbox"]:hover {
    border-color: var(--accent-primary);
    background: rgba(45, 212, 160, 0.08);
}

input[type="checkbox"]:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(45, 212, 160, 0.25);
}

input[type="checkbox"]:checked {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    top: 44%;
    left: 50%;
    width: 4px;
    height: 8px;
    border: solid #08231a;
    border-width: 0 2px 2px 0;
    transform: translate(-50%, -50%) rotate(45deg);
}

input[type="checkbox"]:indeterminate {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

input[type="checkbox"]:indeterminate::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 7px;
    height: 2px;
    background: #08231a;
    transform: translate(-50%, -50%);
}

.checkbox-container label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

/* Buttons */
.btn {
    background: var(--accent-primary);
    color: #08231a;
    padding: 8px 16px;
    border: none;
    border-radius: var(--base-radius);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
    background: #3ddfae;
    box-shadow: var(--shadow-sm);
    color: #08231a;
}

.btn-danger {
    background: var(--accent-red);
    color: #2a0f0f;
}

.btn-danger:hover {
    box-shadow: var(--shadow-sm);
    color: #2a0f0f;
}

.btn-secondary {
    background: var(--bg-input);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(45, 212, 160, 0.1);
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

.btn-small, .btn-sm {
    padding: 4px 10px;
    font-size: 0.8rem;
}

.button-primary {
    background: var(--accent-primary);
    color: #08231a;
    border: none;
    padding: 8px 16px;
    border-radius: var(--base-radius);
    cursor: pointer;
    font-weight: 600;
}

.button-secondary {
    background: var(--bg-input);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: var(--base-radius);
    cursor: pointer;
}

/* ==========================================================================
   5. Tabellen - Dunkel
   ========================================================================== */

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: var(--base-margin);
    font-size: 0.9rem;
    font-variant-numeric: tabular-nums;
}

th {
    background: var(--bg-card-hover);
    color: var(--text-secondary);
    padding: 10px 12px;
    font-size: 0.8rem;
    text-align: left;
    vertical-align: middle;
    font-weight: 600;
    border: none;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

td {
    padding: 8px 12px;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
    vertical-align: middle;
    background: var(--bg-table-row);
    color: var(--text-primary);
}

tr:nth-child(even) td {
    background: var(--bg-table-row-alt);
}

tr:hover td {
    background: rgba(45, 212, 160, 0.05);
}

td {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 250px;
}

/* ==========================================================================
   6. Modal - Dunkel
   ========================================================================== */

.modal {
    display: none;
    position: fixed;
    z-index: 1000; /* Z-Index Hierarchie: Modal (höchste) */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.85);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.modal-content {
    margin: 30px auto;
    display: block;
    width: 95%;
    max-width: 1400px;
}

.modal-content-form {
    background: var(--bg-card);
    margin: 5% auto;
    width: 90%;
    max-width: 500px;
    border-radius: var(--base-radius);
    border: 1px solid var(--border-color);
    padding: 0;
    overflow: hidden;
}

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card-hover);
}

.modal-header h2 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
}

.modal-body label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.modal-body input {
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 12px;
}

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: var(--base-gap);
}

.close-button {
    position: absolute;
    top: 10px;
    right: 15px;
    color: var(--text-secondary);
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
    /* Touch target minimum 44px */
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-button:hover {
    color: var(--accent-cyan);
}

/* ==========================================================================
   7. Benachrichtigungen & Status
   ========================================================================== */

.error, .success, .warning {
    font-weight: 500;
    margin-top: var(--base-margin);
    padding: 12px 16px;
    border-radius: var(--base-radius);
    border-left: 3px solid;
    font-size: 0.9rem;
}

.error {
    color: #f87171;
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--accent-red);
}

.success {
    color: #34d399;
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--accent-green);
}

.warning {
    color: var(--accent-yellow-text);
    background: rgba(245, 158, 11, 0.1);
    border-color: var(--accent-yellow);
}

.message {
    padding: 12px 16px;
    margin: var(--base-margin) 0;
    border-radius: var(--base-radius);
    font-weight: 500;
    font-size: 0.9rem;
}

/* Table Actions */
.table-actions {
    display: flex;
    gap: var(--base-gap);
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: var(--base-margin);
}

.table-actions button {
    background: var(--bg-input);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 8px 14px;
    border-radius: var(--base-radius);
    cursor: pointer;
    font-size: 0.85rem;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.table-actions button:hover {
    background: rgba(45, 212, 160, 0.1);
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

.table-actions button#deleteButton,
#deleteSelectedBtn {
    background: var(--accent-red);
    color: #2a0f0f;
    border: none;
}

.table-actions button#deleteButton:hover,
#deleteSelectedBtn:hover {
    box-shadow: var(--shadow-sm);
}

.table-actions button:disabled {
    background: var(--bg-input);
    color: var(--text-muted);
    cursor: not-allowed;
    opacity: 0.5;
    border-color: var(--border-color);
}

/* ==========================================================================
   8. Scrollbar
   ========================================================================== */

/* Webkit Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-cyan);
}

/* Firefox Scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) var(--bg-dark);
}

/* ==========================================================================
   9. Upload & Spezifische Komponenten
   ========================================================================== */

.upload-form,
.upload-container {
    background: var(--bg-input);
    padding: var(--base-padding);
    border: 1px dashed var(--border-color);
    border-radius: var(--base-radius);
    text-align: center;
    transition: border-color 0.2s, background-color 0.2s;
}

.upload-form:hover,
.upload-container:hover {
    border-color: var(--accent-cyan);
    background: rgba(45, 212, 160, 0.03);
}

.upload-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--base-gap);
}

.upload-form-inline {
    display: flex;
    align-items: center;
    gap: var(--base-gap);
}

.upload-form-inline label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Transaction Table */
.transaction-list {
    margin-top: var(--base-margin);
}

.table-wrapper {
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--base-radius);
}

.transaction-table {
    width: 100%;
    border-collapse: collapse;
    /* min-width removed for mobile responsiveness */
}

.transaction-table th,
.transaction-table td {
    padding: 8px 12px;
    border: none;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
    font-size: 0.85rem;
    white-space: nowrap;
}

.transaction-table th {
    background: var(--bg-card-hover);
    color: var(--text-secondary);
    font-weight: 600;
}

.transaction-table td {
    background: var(--bg-table-row);
    color: var(--text-primary);
}

.transaction-table tbody tr:nth-child(even) td {
    background: var(--bg-table-row-alt);
}

.transaction-table tbody tr:hover td {
    background: rgba(45, 212, 160, 0.05);
}

.transaction-table .asin-cell {
    font-family: 'JetBrains Mono', monospace;
    color: var(--accent-cyan);
    font-weight: 600;
    background: rgba(45, 212, 160, 0.1);
    padding: 4px 8px;
    border-radius: var(--base-radius);
}

.transaction-table .profit-cell {
    font-weight: 600;
    text-align: right;
    padding: 4px 8px;
    border-radius: var(--base-radius);
}

.profit-cell.profit-positive {
    color: var(--accent-green);
    background: rgba(16, 185, 129, 0.1);
}

.profit-cell.profit-negative {
    color: var(--accent-red);
    background: rgba(239, 68, 68, 0.1);
}

/* ==========================================================================
   10. Account Seite
   ========================================================================== */

.account-container {
    max-width: 100%;
    margin: var(--base-margin) auto;
    padding: var(--base-padding);
    background: var(--bg-card);
    border-radius: var(--base-radius);
}

.page-header {
    background: var(--bg-card);
    padding: var(--base-padding);
    border-radius: var(--base-radius);
    margin-bottom: var(--base-margin);
    border: 1px solid var(--border-color);
}

.page-header h1 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.3rem;
    font-weight: 700;
}

.account-section {
    padding: var(--base-padding) 0;
    border-bottom: 1px solid var(--border-color);
}

.account-section:last-child {
    border-bottom: none;
}

.account-section h2 {
    margin: 0 0 var(--base-margin) 0;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
}

.form-group {
    margin: var(--base-margin) 0;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--base-radius);
    font-size: 1rem;
    box-sizing: border-box;
    background: var(--bg-input);
    color: var(--text-primary);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 3px rgba(45, 212, 160, 0.1);
}

.api-key-item {
    background: var(--bg-input);
    padding: var(--base-padding);
    margin: var(--base-margin) 0;
    border-radius: var(--base-radius);
    border: 1px solid var(--border-color);
    transition: border-color 0.2s;
}

.api-key-item:hover {
    border-color: var(--accent-cyan);
}

.api-key-item h4 {
    margin: 0 0 var(--base-margin) 0;
    color: var(--text-primary);
    font-size: 1rem;
}

.api-key-actions {
    margin-top: var(--base-margin);
    display: flex;
    gap: var(--base-gap);
    flex-wrap: wrap;
}

.user-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--base-gap);
}

.user-info-item {
    background: var(--bg-input);
    padding: var(--base-padding);
    border-radius: var(--base-radius);
    border: 1px solid var(--border-color);
    transition: border-color 0.2s;
}

.user-info-item:hover {
    border-color: var(--accent-cyan);
}

.user-info-item strong {
    color: var(--text-secondary);
    display: block;
    margin-bottom: 4px;
    font-size: 0.8rem;
}

.key-value {
    font-family: 'JetBrains Mono', monospace;
    background: rgba(45, 212, 160, 0.1);
    padding: 4px 8px;
    border-radius: var(--base-radius);
    display: inline-block;
    margin-right: 6px;
    word-break: break-all;
    font-size: 0.85rem;
    color: var(--accent-cyan);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--base-gap);
}

.stat-card {
    background: var(--bg-input);
    padding: var(--base-padding);
    border-radius: var(--base-radius);
    text-align: center;
    border: 1px solid var(--border-color);
    transition: border-color 0.2s, transform 0.2s;
}

.stat-card:hover {
    border-color: var(--accent-cyan);
    transform: translateY(-2px);
}

.stat-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--accent-cyan);
    margin-bottom: 4px;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
}

/* ==========================================================================
   11. Modern Table
   ========================================================================== */

.modern-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: var(--base-margin);
    background: var(--bg-table-row);
}

.modern-table th {
    background: var(--bg-card-hover);
    color: var(--text-secondary);
    font-weight: 600;
    padding: 10px 12px;
    text-align: left;
    font-size: 0.8rem;
}

.modern-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.85rem;
    vertical-align: middle;
    color: var(--text-primary);
    background: var(--bg-table-row);
}

.modern-table tbody tr:nth-child(even) td {
    background: var(--bg-table-row-alt);
}

.modern-table tbody tr:hover td {
    background: rgba(45, 212, 160, 0.05);
}

.price-cell {
    font-weight: 600;
    text-align: right;
    font-family: 'JetBrains Mono', monospace;
    color: var(--accent-cyan);
}

.table-container {
    background: var(--bg-card);
    border-radius: var(--base-radius);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

/* ==========================================================================
   12. Responsive
   ========================================================================== */

@media (max-width: 1400px) {
    :root {
        --base-font: clamp(0.7rem, 0.6vw + 0.45rem, 0.9rem);
    }
}

@media (max-width: 1024px) {
    .nav-menu {
        overflow-x: auto;
    }

    .navbar ul {
        gap: 2px;
    }

    .navbar a {
        padding: 5px 8px;
        font-size: 0.85rem;
    }
}

@media (max-width: 768px) {
    :root {
        --base-font: 0.8rem;
        --base-padding: 8px;
        --base-margin: 10px;
    }

    .nav-container {
        flex-wrap: wrap;
        height: auto;
        padding: 6px 0;
    }

    .nav-menu {
        width: 100%;
        margin-left: 0;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .user-info {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   13. Keepa Graph
   ========================================================================== */

.keepa-graph-thumbnail {
    cursor: zoom-in;
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: var(--base-radius);
    border: 1px solid var(--border-color);
}

.keepa-graph-thumbnail:hover {
    opacity: 0.9;
    border-color: var(--accent-cyan);
}

/* Status */
.status-pending {
    font-style: italic;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.main-actions {
    display: flex;
    gap: var(--base-gap);
}

.skipped-list {
    margin: var(--base-margin) 0;
    padding: var(--base-padding);
    columns: 4;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    background: var(--bg-input);
    border-radius: var(--base-radius);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

/* ==========================================================================
   14. Mobile Navigation - Hamburger Menu
   ========================================================================== */

/* Hamburger Button */
.mobile-nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 44px;
    order: -1; /* Hamburger vor Logo auf Mobile */
    height: 44px;
    padding: 10px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 150;
    position: relative;
}

.hamburger-line {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
    margin: 2px 0;
}

.mobile-nav-toggle.active .hamburger-line:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.mobile-nav-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-nav-toggle.active .hamburger-line:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* Mobile Nav Backdrop */
.mobile-nav-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    z-index: 900; /* Z-Index Hierarchie: Mobile-Nav-Backdrop */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.mobile-nav-backdrop.visible {
    display: block;
    opacity: 1;
    pointer-events: auto;
}

/* ==========================================================================
   15. Bottom Navigation
   ========================================================================== */

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(60px + env(safe-area-inset-bottom, 0px));
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    display: none;
    justify-content: space-around;
    align-items: flex-start;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    padding-top: 8px;
    z-index: 50; /* Z-Index Hierarchie: Bottom-Nav */
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.65rem;
    font-weight: 500;
    min-width: 0;
    width: 100%;
    padding: 6px 2px;
    overflow: hidden;
    text-align: center;
    box-sizing: border-box;
    transition: color 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.bottom-nav-item span {
    display: block;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bottom-nav-item svg {
    width: 22px;
    height: 22px;
    margin-bottom: 3px;
    stroke-width: 1.5;
}

.bottom-nav-item.active {
    color: var(--accent-primary);
}

.bottom-nav-item:active {
    transform: scale(0.95);
}

/* ==========================================================================
   16. Mobile Responsive - 900px Breakpoint
   ========================================================================== */

@media (max-width: 900px) {
    /* CSS Variables for Touch */
    :root {
        --touch-target: 44px;
        --mobile-padding: 12px;
    }

    /* Prevent horizontal scroll - use max-width instead of overflow-x: hidden */
    html {
        max-width: 100vw;
    }

    body {
        max-width: 100%;
        overflow-x: clip; /* Modern alternative that allows sticky positioning */
    }

    /* Remove container border on mobile - eliminates left/right gray line */
    body .container {
        border: none;
        border-radius: 0;
        margin: 0;
        margin-left: 0;
        margin-right: 0;
        padding-left: var(--mobile-padding);
        padding-right: var(--mobile-padding);
        width: 100%;
        max-width: 100%;
        box-shadow: none;
        outline: none;
    }

    /* Prevent any overflow causing visible scrollbar/border */
    html, body {
        overflow-x: hidden;
        width: 100%;
        max-width: 100vw;
        margin: 0;
        padding: 0;
        border: none;
    }

    /* Remove ALL borders/lines from navbar area on mobile */
    body .navbar {
        border: none;
        margin: 0;
        box-shadow: none;
        outline: none;
    }

    .navbar::before {
        /* Cover the entire area above navbar with same background color */
        content: '';
        display: block;
        position: absolute;
        top: -100vh;
        left: -10px;
        right: -10px;
        height: 100vh;
        background: var(--bg-card);
        z-index: -1;
    }

    .navbar::after {
        display: none;
    }

    body .nav-container {
        border: none;
        outline: none;
        margin: 0;
    }

    body .mobile-nav-toggle {
        border: none;
        outline: none;
    }

    /* Remove borders from inner containers on mobile */
    body .product-list,
    body .table-container,
    body .table-wrapper,
    body .account-container,
    body .page-header {
        border-left: none;
        border-right: none;
        border-radius: 0;
        margin-left: 0;
        margin-right: 0;
    }

    /* Show hamburger and bottom nav */
    .mobile-nav-toggle {
        display: flex;
    }

    /* Backdrop nur sichtbar wenn .visible Klasse aktiv */
    .mobile-nav-backdrop {
        display: none;
        pointer-events: none;
    }

    .mobile-nav-backdrop.visible {
        display: block;
        pointer-events: auto;
    }

    .bottom-nav {
        display: grid;
    }

    /* Container padding for bottom nav with safe-area */
    .container {
        padding-bottom: calc(70px + env(safe-area-inset-bottom, 0px));
    }

    /* Safe-area padding for main containers */
    .dashboard-container,
    .refunds-container,
    .orders-container,
    .account-container {
        padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
    }

    /* Full-width page overrides - neutralisiere Container-Padding */
    body .container:has(.wareneingang-container),
    body .container:has(.dashboard-container),
    body .container.fullwidth-page {
        padding: 0;
        margin: 0;
        width: 100%;
        max-width: 100%;
        border: none;
        border-radius: 0;
        background: transparent;
        box-sizing: border-box;
        left: 0;
        right: 0;
    }

    /* Wareneingang spezifisch - zentriert */
    body .wareneingang-container {
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding-left: 0;
        padding-right: 0;
    }

    /* Slide-in Navigation */
    .nav-menu {
        position: fixed;
        top: 0;
        left: -280px;
        width: 280px;
        height: 100vh;
        background: var(--bg-card);
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        padding: 60px 0 20px 0;
        overflow-y: auto;
        z-index: 800;
        transition: left 0.3s ease, visibility 0.3s ease;
        border-right: 1px solid var(--border-color);
        box-shadow: none;
        visibility: hidden;
    }

    .nav-menu.mobile-open {
        left: 0;
        visibility: visible;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
    }

    .navbar ul.nav-left,
    .navbar ul.nav-right {
        flex-direction: column;
        width: 100%;
        gap: 0;
    }

    .navbar ul.nav-left {
        border-bottom: 1px solid var(--border-color);
        padding-bottom: 10px;
        margin-bottom: 10px;
    }

    .navbar a {
        min-height: var(--touch-target);
        padding: 14px 20px;
        font-size: 0.95rem;
        display: flex;
        align-items: center;
        border-radius: 0;
    }

    .navbar a.active {
        border-left: 3px solid var(--accent-cyan);
        border-radius: 0;
    }

    /* Mobile Dropdown Accordion */
    .nav-dropdown {
        width: 100%;
    }

    .nav-dropdown-toggle {
        width: 100%;
        justify-content: space-between;
    }

    .dropdown-arrow {
        transition: transform 0.3s ease;
    }

    .nav-dropdown.mobile-expanded .dropdown-arrow {
        transform: rotate(180deg);
    }

    .nav-dropdown-menu {
        position: static;
        visibility: hidden;
        opacity: 0;
        max-height: 0;
        overflow: hidden;
        box-shadow: none;
        border: none;
        background: rgba(0, 0, 0, 0.2);
        margin: 0;
        padding: 0;
        transition: max-height 0.3s ease, opacity 0.3s ease, visibility 0s linear 0.3s;
    }

    .nav-dropdown.mobile-expanded .nav-dropdown-menu {
        visibility: visible;
        opacity: 1;
        max-height: 600px;
        padding: 6px 0;
        transition: max-height 0.3s ease, opacity 0.3s ease, visibility 0s linear 0s;
    }

    .nav-dropdown:hover .nav-dropdown-menu {
        visibility: hidden;
        opacity: 0;
        max-height: 0;
    }

    .nav-dropdown.mobile-expanded:hover .nav-dropdown-menu {
        visibility: visible;
        opacity: 1;
        max-height: 600px;
    }

    .nav-dropdown-menu a {
        padding-left: 32px;
        min-height: 40px;
    }

    /* Touch-optimized buttons */
    .btn {
        min-height: var(--touch-target);
        padding: 12px 20px;
    }

    /* Touch-optimized inputs */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="date"],
    select,
    textarea {
        min-height: var(--touch-target);
        font-size: 16px; /* Prevent iOS zoom */
    }

    /* Etwas groessere Checkboxen auf schmalen Screens */
    input[type="checkbox"] {
        width: 17px;
        height: 17px;
        min-width: 17px;
        min-height: 17px;
    }

    /* Stats Grid */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* User Info Grid */
    .user-info {
        grid-template-columns: 1fr;
    }

    /* Quick Actions */
    .quick-actions {
        grid-template-columns: 1fr;
    }

    /* Dashboard Grid */
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    /* Skipped List */
    .skipped-list {
        columns: 2;
    }
}

/* ==========================================================================
   17. Mobile Responsive - 768px Breakpoint (Tablet)
   ========================================================================== */

@media (max-width: 768px) {
    /* Container - inherits border: none from 900px breakpoint */
    .container {
        padding: var(--mobile-padding);
    }

    /* Table Card View */
    .table-scroll,
    .table-scroll-small {
        overflow-x: visible;
    }

    /* Stats */
    .stats-container {
        grid-template-columns: 1fr 1fr;
    }

    /* Stat Card */
    .stat-card {
        padding: 1rem;
    }

    .stat-value {
        font-size: 1.3rem;
    }

    /* Dashboard Welcome */
    .dashboard-welcome {
        padding: 1rem;
    }

    .welcome-title {
        font-size: 1.4rem;
    }

    /* Sidebar layouts become stacked */
    .wareneingang-container {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }

    .wareneingang-sidebar {
        width: 100%;
        min-width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        max-height: none;
        padding: 12px;
    }

    .wareneingang-main {
        height: auto;
        min-height: 60vh;
    }

    .main-grid {
        grid-template-columns: 1fr;
        overflow-y: visible;
        height: auto;
    }

    /* Form layouts */
    .form-row,
    .api-key-actions,
    .btn-group {
        flex-direction: column;
        width: 100%;
    }

    .btn-group .btn {
        width: 100%;
    }

    /* Search box */
    .search-box {
        flex-direction: column;
        align-items: stretch;
    }

    .search-input {
        min-width: 100%;
    }

    /* Modals become fullscreen sheets */
    .settings-modal-content {
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        margin: 0;
    }

    .modal-content-form {
        width: 100%;
        max-width: 100%;
        margin: 0;
        border-radius: 0;
        min-height: 100vh;
    }

    /* Touch-friendly close button */
    .settings-modal-close {
        width: 44px;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* ==========================================================================
   18. Mobile Responsive - 480px Breakpoint (Small Phone)
   ========================================================================== */

@media (max-width: 480px) {
    :root {
        --base-font: 0.85rem;
        --base-padding: 10px;
    }

    /* Single column stats */
    .stats-container,
    .stats-grid {
        grid-template-columns: 1fr;
    }

    /* Table actions stack */
    .table-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .table-actions button {
        width: 100%;
    }

    /* Webhook form stack */
    .webhook-form {
        flex-direction: column;
    }

    .webhook-input {
        min-width: 100%;
    }

    /* Refunds header stack */
    .refunds-header {
        flex-direction: column;
        align-items: stretch;
    }

    .refunds-header .btn-group {
        width: 100%;
    }

    /* Skipped list single column */
    .skipped-list {
        columns: 1;
    }

    /* Bottom nav - improved readability */
    .bottom-nav-item {
        font-size: 0.6rem;
        min-width: 0;
        padding: 5px 2px;
    }

    .bottom-nav-item span {
        font-size: 0.6rem;
    }

    .bottom-nav-item svg {
        width: 19px;
        height: 19px;
    }
}

/* ==========================================================================
   18b. Mobile Responsive - 375px Breakpoint (iPhone SE/X)
   ========================================================================== */

@media (max-width: 375px) {
    :root {
        --base-font: 0.8rem;
        --base-padding: 8px;
        --base-margin: 8px;
    }

    /* Compact stats */
    .stat-card {
        padding: 0.75rem;
    }

    .stat-value {
        font-size: 1.1rem;
    }

    .stat-label {
        font-size: 0.6rem;
    }

    /* Compact welcome */
    .welcome-title {
        font-size: 1rem;
    }

    .welcome-subtitle {
        font-size: 0.75rem;
    }

    /* Compact buttons */
    .btn {
        padding: 10px 14px;
        font-size: 0.8rem;
    }

    .btn-sm, .btn-small {
        padding: 6px 10px;
        font-size: 0.7rem;
    }

    /* Bottom nav extra compact */
    .bottom-nav-item {
        font-size: 0.56rem;
        min-width: 0;
        padding: 4px 1px;
    }

    .bottom-nav-item span {
        font-size: 0.56rem;
    }

    .bottom-nav-item svg {
        width: 18px;
        height: 18px;
    }

    /* Compact modal */
    .modal-content-form {
        padding: 0;
    }

    .modal-header {
        padding: 12px 16px;
    }

    .modal-body {
        padding: 16px;
    }

    .modal-footer {
        padding: 12px 16px;
    }

    /* Compact cards */
    .dashboard-card {
        padding: 0.75rem;
    }

    .card-header {
        padding-bottom: 0.5rem;
        margin-bottom: 0.75rem;
    }

    .card-title {
        font-size: 0.85rem;
    }

    /* Compact order items */
    .order-item {
        padding: 0.5rem;
    }

    .order-item-image,
    .order-item-image-placeholder {
        width: 40px;
        height: 40px;
    }

    /* Search box compact */
    .search-box {
        padding: 0.75rem;
    }

    .search-input {
        padding: 0.6rem 0.75rem;
        font-size: 0.85rem;
    }
}

/* ==========================================================================
   19. Touch Device Optimizations
   ========================================================================== */

@media (hover: none) and (pointer: coarse) {
    /* Remove hover effects that don't work on touch */
    .btn:hover {
        transform: none;
        box-shadow: none;
    }

    .btn:active {
        transform: scale(0.95);
        opacity: 0.8;
    }

    .stat-card:hover {
        transform: none;
        box-shadow: none;
    }

    .stat-card:active {
        transform: scale(0.98);
        opacity: 0.9;
    }

    .quick-action-btn:hover {
        transform: none;
    }

    .quick-action-btn:active {
        transform: scale(0.95);
        opacity: 0.8;
    }

    /* Touch feedback for links and interactive elements */
    .navbar a:active,
    .card-action:active,
    .bottom-nav-item:active {
        opacity: 0.7;
    }

    /* Visible tap highlight instead of transparent */
    .navbar a,
    .btn,
    .quick-action-btn,
    .bottom-nav-item,
    .order-item,
    select {
        -webkit-tap-highlight-color: rgba(45, 212, 160, 0.2);
    }

    /* Ensure minimum touch target sizes */
    .navbar a {
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    /* Close button touch target */
    .close-button,
    .modal-close,
    .settings-modal-close {
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Checkbox auf Touch-Geraeten: kompakt, aber gut tippbar */
    input[type="checkbox"] {
        width: 20px;
        height: 20px;
        min-width: 20px;
        min-height: 20px;
        margin: 0;
    }

    /* Dropdown touch improvements */
    .nav-dropdown-toggle {
        min-height: 44px;
    }

    /* Table row touch feedback */
    .refunds-table tbody tr:active td,
    .orders-table tbody tr:active td,
    .transaction-table tbody tr:active td,
    .modern-table tbody tr:active td {
        background: rgba(45, 212, 160, 0.1);
    }
}

/* ==========================================================================
   20. Table Card View (Mobile)
   ========================================================================== */

@media (max-width: 768px) {
    /* Hide table headers on mobile */
    .refunds-table thead,
    .orders-table thead,
    .transaction-table thead,
    .modern-table thead {
        display: none;
    }

    /* Transform table rows into cards */
    .refunds-table tbody,
    .orders-table tbody,
    .transaction-table tbody,
    .modern-table tbody {
        display: block;
    }

    .refunds-table tbody tr,
    .orders-table tbody tr,
    .transaction-table tbody tr,
    .modern-table tbody tr {
        display: block;
        background: var(--bg-card);
        border: 1px solid var(--border-color);
        border-radius: 8px;
        margin-bottom: 12px;
        padding: 12px;
        position: relative;
    }

    .refunds-table tbody tr:hover,
    .orders-table tbody tr:hover,
    .transaction-table tbody tr:hover,
    .modern-table tbody tr:hover {
        border-color: var(--accent-cyan);
    }

    .refunds-table td,
    .orders-table td,
    .transaction-table td,
    .modern-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 0;
        border-bottom: 1px solid var(--border-color);
        background: transparent;
        white-space: normal;
        max-width: none;
    }

    .refunds-table td:last-child,
    .orders-table td:last-child,
    .transaction-table td:last-child,
    .modern-table td:last-child {
        border-bottom: none;
    }

    /* Data labels */
    .refunds-table td::before,
    .orders-table td::before,
    .transaction-table td::before,
    .modern-table td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 0.75rem;
        color: var(--text-secondary);
        flex-shrink: 0;
        margin-right: 12px;
    }

    /* Hide label for checkbox and image cells */
    .refunds-table td[data-label=""]::before,
    .orders-table td[data-label=""]::before,
    .transaction-table td[data-label=""]::before,
    .modern-table td[data-label=""]::before {
        display: none;
    }

    /* Image cell styling */
    .refunds-table td:first-child,
    .refunds-table td:nth-child(2),
    .orders-table td:first-child,
    .orders-table td:nth-child(2) {
        justify-content: center;
    }

    /* Checkbox in card - positioned top-right */
    .refunds-table td:first-child,
    .orders-table td:first-child {
        position: absolute;
        top: 8px;
        right: 8px;
        border: none;
        padding: 0;
    }

    .refunds-table td:first-child::before,
    .orders-table td:first-child::before {
        display: none;
    }

    /* Product image prominent */
    .refund-image,
    .order-image {
        width: 70px;
        height: 70px;
    }

    /* Amount styling */
    .refund-amount {
        font-size: 1.1rem;
    }

    /* Price styling for orders */
    .orders-table td[data-label="Preis"] {
        font-weight: 600;
        color: var(--accent-green);
        font-size: 1rem;
    }

    /* Empty state in cards */
    .empty-state {
        display: block;
        text-align: center;
        padding: 2rem;
    }

    .empty-state::before {
        display: none;
    }
}

/* ==========================================================================
   21. Scanner Mobile Optimization
   ========================================================================== */

@media (max-width: 768px) {
    .scanner-section {
        min-height: 350px;
    }

    .scanner-preview,
    #qr-reader,
    #returns-qr-reader {
        min-height: 280px !important;
        border-radius: 12px;
    }

    .scanner-controls-sidebar {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .scanner-btn {
        flex: 1;
        min-width: 120px;
        min-height: 44px;
        font-size: 0.85rem;
    }

    .scan-history {
        max-height: 200px;
    }

    .scanner-status {
        font-size: 0.75rem;
        padding: 6px 10px;
    }

    /* Scanner result overlay */
    .scanner-result-overlay {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        background: rgba(0, 0, 0, 0.9);
        padding: 24px;
        border-radius: 16px;
        text-align: center;
        z-index: 1000;
        min-width: 280px;
    }
}

/* ==========================================================================
   22. PWA Install Banner (optional)
   ========================================================================== */

.pwa-install-banner {
    display: none;
    position: fixed;
    bottom: 70px;
    left: 12px;
    right: 12px;
    background: var(--accent-primary);
    color: #08231a;
    padding: 12px 16px;
    border-radius: 12px;
    z-index: 999;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.pwa-install-banner.visible {
    display: flex;
}

.pwa-install-banner-text {
    font-weight: 600;
    font-size: 0.9rem;
}

.pwa-install-banner-btn {
    background: var(--bg-dark);
    color: var(--accent-cyan);
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.pwa-install-banner-close {
    background: transparent;
    border: none;
    color: var(--bg-dark);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px;
}

/* ==========================================================================
   23. Utility Classes
   ========================================================================== */

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.px-1 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-2 { padding-left: 1rem; padding-right: 1rem; }
.py-1 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-2 { padding-top: 1rem; padding-bottom: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.color-primary { color: var(--text-primary); }
.color-secondary { color: var(--text-secondary); }
.color-muted { color: var(--text-muted); }
.color-accent { color: var(--accent-cyan); }
.color-success { color: var(--accent-green); }
.color-danger { color: var(--accent-red); }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-mono { font-family: 'JetBrains Mono', monospace; }
.w-full { width: 100%; }
.hidden { display: none; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ==========================================================================
   24. Toast Notification System
   ========================================================================== */

.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 10001;
    display: flex;
    flex-direction: column-reverse;
    gap: 0.5rem;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    border-radius: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    pointer-events: auto;
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    max-width: 360px;
    position: relative;
    overflow: hidden;
}

.toast.visible {
    transform: translateX(0);
    opacity: 1;
}

.toast.success {
    border-left: 3px solid var(--accent-green);
}

.toast.error {
    border-left: 3px solid var(--accent-red);
}

.toast.warning {
    border-left: 3px solid var(--accent-yellow);
}

.toast.info {
    border-left: 3px solid var(--accent-cyan);
}

.toast-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    background: var(--accent-cyan);
    transition: width linear;
}

.toast.success .toast-progress { background: var(--accent-green); }
.toast.error .toast-progress { background: var(--accent-red); }
.toast.warning .toast-progress { background: var(--accent-yellow); }

/* ==========================================================================
   25. Focus Styles (Accessibility)
   ========================================================================== */

button:focus-visible,
.btn:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--accent-cyan);
    outline-offset: 2px;
}

/* Remove default outline for mouse users */
:focus:not(:focus-visible) {
    outline: none;
}

/* ==========================================================================
   26. Tooltip for Truncated Text
   ========================================================================== */

.has-tooltip {
    position: relative;
}

.has-tooltip .tooltip-text {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 6px 10px;
    font-size: 0.8rem;
    white-space: nowrap;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    z-index: 999;
    box-shadow: var(--shadow-md);
    pointer-events: none;
    transition: opacity 0.2s, visibility 0.2s;
}

.has-tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* ==========================================================================
   27. Skeleton Loader
   ========================================================================== */

.skeleton {
    background: linear-gradient(90deg, var(--bg-input) 25%, var(--bg-card-hover) 50%, var(--bg-input) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-md);
}

.skeleton-text {
    height: 0.9rem;
    margin-bottom: 0.5rem;
    border-radius: var(--radius-sm);
}

.skeleton-text:last-child {
    width: 60%;
}

.skeleton-row {
    display: flex;
    gap: var(--base-gap);
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.skeleton-cell {
    height: 1rem;
    flex: 1;
    border-radius: var(--radius-sm);
}

.skeleton-card {
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: 0.75rem;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
}

@keyframes skeleton-shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* ==========================================================================
   28. Empty State Component
   ========================================================================== */

.empty-state-component {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.6;
}

.empty-state-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.empty-state-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

.empty-state-cta {
    display: inline-block;
}

/* ==========================================================================
   29. Field-Level Validation
   ========================================================================== */

.form-group.has-error input,
.form-group.has-error select,
.form-group.has-error textarea {
    border-color: var(--accent-red);
    box-shadow: 0 0 0 3px rgba(255, 49, 49, 0.1);
}

.form-group.has-success input,
.form-group.has-success select,
.form-group.has-success textarea {
    border-color: var(--accent-green);
}

.form-error-message {
    color: var(--accent-red);
    font-size: 0.75rem;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.form-error-message::before {
    content: '\26A0';
    font-size: 0.8rem;
}

/* ==========================================================================
   30. Skip-to-Content Link
   ========================================================================== */

.skip-to-content {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent-cyan);
    color: var(--bg-dark);
    padding: 0.75rem 1.5rem;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    font-weight: 600;
    font-size: 0.875rem;
    z-index: 9999;
    transition: top 0.2s;
    text-decoration: none;
}

.skip-to-content:focus {
    top: 0;
}

/* ==========================================================================
   31. Touch Target Enhancement
   ========================================================================== */

/* Checkbox-Groesse kommt aus dem Basis-Stil (Sektion Formulare);
   Touch-Geraete bekommen ihre Anpassung im (pointer: coarse)-Block */

/* ==========================================================================
   32. Pagination Component
   ========================================================================== */

.pagination {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
    text-decoration: none;
    user-select: none;
}

.pagination-btn:hover:not(.active):not(:disabled) {
    background: var(--bg-input);
    border-color: var(--accent-cyan);
}

.pagination-btn.active {
    background: var(--accent-cyan);
    border-color: var(--accent-cyan);
    color: var(--bg-dark);
    font-weight: 600;
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.pagination-info {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-left: 0.75rem;
}

.pagination-per-page {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.pagination-per-page select {
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.85rem;
}

@media (max-width: 768px) {
    .pagination {
        justify-content: center;
    }
    .pagination-info {
        width: 100%;
        text-align: center;
        margin-left: 0;
        margin-top: 0.5rem;
    }
}

/* ==========================================================================
   33. Sortable Table Headers
   ========================================================================== */

.sortable-th {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 1.5rem;
}

.sortable-th:hover {
    color: var(--accent-cyan);
}

.sortable-th .sort-icon {
    position: absolute;
    right: 0.25rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.7rem;
    opacity: 0.3;
    transition: opacity 0.2s;
}

.sortable-th:hover .sort-icon {
    opacity: 0.6;
}

.sortable-th.sort-asc .sort-icon,
.sortable-th.sort-desc .sort-icon {
    opacity: 1;
    color: var(--accent-cyan);
}

/* ==========================================================================
   34. Breadcrumbs
   ========================================================================== */

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    flex-wrap: wrap;
}

.breadcrumbs a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumbs a:hover {
    color: var(--accent-cyan);
}

.breadcrumbs .breadcrumb-separator {
    color: var(--text-muted);
    font-size: 0.7rem;
}

.breadcrumbs .breadcrumb-current {
    color: var(--text-primary);
    font-weight: 500;
}

@media (max-width: 768px) {
    .breadcrumbs {
        font-size: 0.8rem;
        padding: 0.25rem 0.75rem;
    }
}

/* ==========================================================================
   PR2 — Shell "Präzisionswerk": Sidebar + Topbar + Lichtfaden + Ops-Konsole
   Namespaces: .app-shell / .sbar-* (Sidebar) / .tbar-* (Topbar) / .cmdk-* (Palette)
   ========================================================================== */

/* Cross-Document View Transitions ENTFERNT: sie frieren die alte Seite ein, bis die
   neue vollständig gerendert ist — bei 1-2-MB-Tabellenseiten wird genau das als
   brutales Ruckeln wahrgenommen. Seitenwechsel-Kontinuität liefert der Lichtfaden. */

.app-shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
body.sb-rail .app-shell { grid-template-columns: var(--sidebar-w-rail) 1fr; }
.shell-main { min-width: 0; display: flex; flex-direction: column; }

/* ── Sidebar ── */
.sbar {
    position: sticky; top: 0; height: 100vh; overflow-y: auto; overflow-x: hidden;
    background: var(--bg-elevated); border-right: 1px solid var(--border-color);
    display: flex; flex-direction: column; padding: 12px 10px; gap: 2px; z-index: 60;
}
.sbar-brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 20px; position: relative; }
.sbar-brand::after {
    content: ""; position: absolute; left: 10px; right: 10px; bottom: 9px; height: 2px;
    background: var(--grad-swoosh); border-radius: 2px;
}
.sbar-mark {
    width: 26px; height: 26px; border-radius: 6px; flex: none;
    background: var(--grad-swoosh); color: var(--accent-primary-ink);
    display: grid; place-items: center; font-weight: 700; font-size: 0.8125rem;
}
.sbar-name { font-weight: 600; font-size: 0.9375rem; letter-spacing: -0.02em; white-space: nowrap; }
.wordmark, .tbar-crumb .wordmark { color: var(--accent-primary-text); }
.wordmark em, .tbar-crumb .wordmark em { font-style: normal; color: var(--accent-gold-text); }
.sbar-sect {
    font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--text-muted); padding: 18px 10px 6px; white-space: nowrap;
}
.sbar-item {
    display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px;
    border-radius: 6px; color: var(--text-secondary); text-decoration: none;
    white-space: nowrap; font-size: 0.8125rem; background: none; border: 0; cursor: pointer;
    width: 100%; text-align: left; font-family: inherit;
    transition: color var(--t-fast) var(--ease-io), background var(--t-fast) var(--ease-io);
}
.sbar-item:hover { color: var(--text-primary); background: var(--bg-card-hover); }
.sbar-item.active { color: var(--text-primary); background: var(--bg-card-hover); }
.sbar-item svg.sic { transition: transform 180ms var(--ease-pop); }
.sbar-item:hover svg.sic { transform: translateX(2px); }
svg.sic {
    width: 16px; height: 16px; stroke: currentColor; stroke-width: 1.75; fill: none;
    stroke-linecap: round; stroke-linejoin: round; flex: none;
}
/* Icons zeichnen sich beim Laden (Stroke-Draw, gestaffelt via --ni) */
html[data-intro] .sbar-item svg.sic { stroke-dasharray: 100; animation: sbarDraw 550ms var(--ease-out) both; animation-delay: calc(var(--ni, 0) * 35ms); }
@keyframes sbarDraw { from { stroke-dashoffset: 100; } to { stroke-dashoffset: 0; } }
/* Lichtfaden: EIN Indikator, gleitet beim Seitenwechsel zur neuen Position */
.sbar-ind {
    position: absolute; left: 4px; width: 2px; height: 20px;
    background: var(--accent-primary); border-radius: 2px; z-index: 1;
}
.sbar-ind.glide { transition: top var(--t-enter) var(--ease-out); }
.sbar { position: sticky; }
.sbar-foot { margin-top: auto; border-top: 1px solid var(--border-color); padding-top: 8px; display: flex; flex-direction: column; gap: 2px; }
.sbar-version { padding: 10px 10px 2px; color: var(--text-muted); font-size: 0.625rem; letter-spacing: 0.04em; white-space: nowrap; }
.sbar-count {
    margin-left: auto; font-family: var(--font-mono); font-size: 0.6875rem;
    color: var(--text-muted); border: 1px solid var(--border-color); border-radius: 4px;
    padding: 0 5px; line-height: 16px;
}
/* Dev-Bereich: aufklappbar */
.sbar-dev summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 6px; }
.sbar-dev summary::-webkit-details-marker { display: none; }
.sbar-dev summary::after { content: "▸"; font-size: 0.625rem; }
.sbar-dev[open] summary::after { content: "▾"; }
.sbar-sub {
    display: block; padding: 5px 10px 5px 36px; border-radius: 6px; font-size: 0.75rem;
    color: var(--text-muted); text-decoration: none; white-space: nowrap;
}
.sbar-sub:hover { color: var(--text-primary); background: var(--bg-card-hover); }
.sbar-sub.active { color: var(--accent-primary-text); }
/* Rail-Modus */
body.sb-rail .sbar-label, body.sb-rail .sbar-sect, body.sb-rail .sbar-name,
body.sb-rail .sbar-count, body.sb-rail .sbar-version, body.sb-rail .sbar-dev { display: none; }
body.sb-rail .sbar-item { justify-content: center; padding: 0; }
body.sb-rail .sbar-brand { justify-content: center; padding-left: 0; padding-right: 0; }
body.sb-rail .sbar-brand::after { left: 14px; right: 14px; }

/* ── Topbar ── */
.tbar {
    position: sticky; top: 0; z-index: 50; height: var(--topbar-h);
    display: flex; align-items: center; gap: 14px; padding: 0 20px;
    background: var(--bg-elevated); /* solide statt Blur — Blur repaintet beim Scrollen großer Tabellen */
    border-bottom: 1px solid var(--border-color);
}
.tbar-crumb { display: flex; align-items: center; gap: 8px; color: var(--text-secondary); white-space: nowrap; font-size: 0.8125rem; }
.tbar-crumb .sep { color: var(--text-muted); }
.tbar-crumb strong { font-weight: 600; }
.tbar-search {
    flex: 1; max-width: 480px; height: 32px; margin: 0 auto;
    display: flex; align-items: center; gap: 8px; padding: 0 10px;
    background: var(--bg-input); border: 1px solid var(--border-color); border-radius: 6px;
    color: var(--text-muted); font-size: 0.8125rem; font-family: inherit; cursor: pointer;
    transition: border-color var(--t-fast) var(--ease-io);
}
.tbar-search:hover { border-color: var(--border-strong); }
.tbar-kbd { margin-left: auto; display: flex; gap: 4px; }
.tbar-kbd kbd, .cmdk kbd {
    font-family: var(--font-mono); font-size: 0.6875rem; color: var(--text-secondary);
    background: var(--bg-card); border: 1px solid var(--border-color); border-bottom-width: 2px;
    border-radius: 4px; padding: 1px 5px;
}
/* Tages-Ticker: der Herzschlag des Geschaefts — Geld = Gold */
.tbar-ticker {
    display: flex; align-items: baseline; gap: 8px; height: 30px; padding: 0 11px;
    border: 1px solid var(--border-color); border-radius: 6px; background: var(--bg-card);
    font-size: 0.75rem; white-space: nowrap; position: relative; overflow: hidden;
    margin-left: auto; align-self: center;
}
.tbar-ticker .lbl { color: var(--text-muted); align-self: center; }
.tbar-ticker .val {
    font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-weight: 500;
    color: var(--accent-gold-text); min-width: 74px; text-align: right; align-self: center;
}
.tbar-ticker .val.neg { color: var(--accent-red-text); }
.tbar-ticker::after { content: ""; position: absolute; inset: 0; background: var(--tint-gold); opacity: 0; pointer-events: none; }
.tbar-ticker.pulse::after { animation: tickerPulse 800ms var(--ease-out); }
@keyframes tickerPulse { 0% { opacity: 0; } 30% { opacity: 1; } 100% { opacity: 0; } }
@media (max-width: 900px) { .tbar-ticker .lbl { display: none; } }
.tbar-right { display: flex; align-items: center; gap: 6px; margin-left: 0; position: relative; }
.tbar-btn {
    width: 32px; height: 32px; border-radius: 6px; display: grid; place-items: center;
    color: var(--text-secondary); background: none; border: 0; cursor: pointer; position: relative;
    transition: color var(--t-fast) var(--ease-io), background var(--t-fast) var(--ease-io);
}
.tbar-btn:hover { color: var(--text-primary); background: var(--bg-card-hover); }
.tbar-btn svg.sic { transition: transform var(--t-fast) var(--ease-pop); }
.tbar-btn:hover svg.sic { transform: scale(1.12); }
.tbar-burger { display: none; }
/* Bestehende hdr-Tool-Buttons in der neuen Topbar */
.tbar-right .hdr-tool-btn {
    width: 32px; height: 32px; border-radius: 6px; display: grid; place-items: center;
    color: var(--text-secondary); background: none; border: 0; cursor: pointer; position: relative;
}
.tbar-right .hdr-tool-btn:hover { color: var(--text-primary); background: var(--bg-card-hover); }
.tbar-right .hdr-tool-btn svg { width: 17px; height: 17px; }

/* ── Content-Bereich: volle Breite gemäß Design ── */
.shell-main > .container, .shell-main > main.container {
    max-width: none; width: 100%; margin: 0; padding: 26px 30px 110px;
}

/* ── Klick-Ping "Weißes Kreuz" + Präzisions-Pfeil (Design-Cursor) ── */
@media (hover: hover) and (pointer: fine) {
    body {
        cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 22 22"><path d="M3 1.5l15 8.5-6.5 1.8L8.7 18.5z" fill="%23EDEDEF" stroke="%2309090B" stroke-width="1.2"/></svg>') 3 1, auto;
    }
    html[data-theme="light"] body {
        cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 22 22"><path d="M3 1.5l15 8.5-6.5 1.8L8.7 18.5z" fill="%2318181B" stroke="%23FFFFFF" stroke-width="1.2"/></svg>') 3 1, auto;
    }
    body a, body button, body [role="button"], body summary, body label,
    body input[type="checkbox"], body input[type="radio"], body select, body th[onclick] {
        cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 22 22"><path d="M3 1.5l15 8.5-6.5 1.8L8.7 18.5z" fill="%23FFC933" stroke="%2309090B" stroke-width="1.2"/></svg>') 3 1, pointer;
    }
    body input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]), body textarea { cursor: text; }
}

/* ── Ops-Konsole (Strg+K) V1: Seiten-Navigation ── */
.cmdk { position: fixed; inset: 0; z-index: 3000; display: none; }
.cmdk.open { display: block; }
.cmdk-backdrop { position: absolute; inset: 0; background: var(--overlay); }
.cmdk-panel {
    position: relative; width: min(560px, 92vw); margin: 12vh auto 0;
    background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 10px;
    box-shadow: var(--shadow-overlay); overflow: hidden;
    animation: cmdkIn var(--t-overlay) var(--ease-pop);
}
@keyframes cmdkIn { from { opacity: 0; transform: scale(0.98) translateY(-4px); } }
.cmdk-input { display: flex; align-items: center; gap: 10px; padding: 4px 14px; border-bottom: 1px solid var(--border-color); }
.cmdk-input input {
    flex: 1; height: 40px; background: none; border: 0; color: var(--text-primary);
    font: inherit; font-size: 0.875rem; outline: none;
}
.cmdk-list { max-height: 320px; overflow-y: auto; padding: 6px; }
.cmdk-item {
    display: flex; align-items: center; gap: 10px; width: 100%; height: 36px; padding: 0 10px;
    border-radius: 6px; color: var(--text-secondary); background: none; border: 0;
    font: inherit; font-size: 0.8125rem; cursor: pointer; text-align: left; text-decoration: none;
}
.cmdk-item[aria-selected="true"], .cmdk-item:hover { background: var(--bg-card-hover); color: var(--text-primary); }
.cmdk-item[aria-selected="true"] svg.sic { color: var(--accent-primary-text); }
.cmdk-empty { padding: 20px; text-align: center; color: var(--text-muted); font-family: var(--font-mono); font-size: 0.8125rem; }

/* ── Mobile: Sidebar wird Off-Canvas-Drawer, Bottom-Nav bleibt ── */
.shell-backdrop { display: none; position: fixed; inset: 0; background: var(--overlay); z-index: 55; }
@media (max-width: 900px) {
    .app-shell, body.sb-rail .app-shell { grid-template-columns: 1fr; }
    .sbar {
        position: fixed; left: 0; top: 0; bottom: 0; width: var(--sidebar-w);
        transform: translateX(-105%); transition: transform var(--t-enter) var(--ease-io);
    }
    body.sb-open .sbar { transform: translateX(0); }
    body.sb-open .shell-backdrop { display: block; }
    body.sb-rail .sbar-label, body.sb-rail .sbar-sect, body.sb-rail .sbar-name,
    body.sb-rail .sbar-count, body.sb-rail .sbar-version, body.sb-rail .sbar-dev { display: revert; }
    body.sb-rail .sbar-item { justify-content: flex-start; padding: 0 10px; }
    .tbar { height: 48px; padding: 0 12px; gap: 8px; }
    .tbar-burger { display: grid; }
    .tbar-crumb { display: none; }
    .tbar-search span:not(.tbar-kbd) { overflow: hidden; text-overflow: ellipsis; }
    .tbar-kbd { display: none; }
    .shell-main > .container, .shell-main > main.container { padding: 16px 12px 110px; }
}


/* ==========================================================================
   Präzisionswerk Komponenten (PR4+) — wiederverwendbar für alle Views
   ========================================================================== */
.pw-pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.pw-pagehead .ph-title { display: flex; align-items: center; gap: 12px; }
.pw-pagehead h1 { margin: 0 0 4px; font-size: 1.375rem; font-weight: 600; letter-spacing: -0.02em; color: var(--text-primary); }
.pw-pagehead p { margin: 0; color: var(--text-secondary); font-size: 0.8125rem; }
.ph-icon { flex: none; display: grid; place-items: center; color: var(--text-primary); }
.ph-icon svg { width: 23px; height: 23px; stroke: currentColor; stroke-width: 1.75; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.pw-chips { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Titel-Icon Dashboard: Kacheln bauen sich auf */
.pi-dash rect { transform-box: fill-box; transform-origin: center; animation: piPop 300ms var(--ease-pop) both; }
.pi-dash rect:nth-child(2) { animation-delay: 70ms; }
.pi-dash rect:nth-child(3) { animation-delay: 140ms; }
.pi-dash rect:nth-child(4) { animation-delay: 210ms; }
@keyframes piPop { from { transform: scale(0); } }
/* Auswertung: erst zeichnet die Achse, dann wachsen die Balken */
.pi-chart .bc-axis { stroke-dasharray: 60; animation: piAxis 400ms var(--ease-out) both; }
@keyframes piAxis { from { stroke-dashoffset: 60; } to { stroke-dashoffset: 0; } }
.pi-chart .bc { transform-box: fill-box; transform-origin: center bottom; animation: piBarGrow 340ms var(--ease-pop) both; }
.pi-chart .b1 { animation-delay: 220ms; }
.pi-chart .b2 { animation-delay: 320ms; }
.pi-chart .b3 { animation-delay: 420ms; }
@keyframes piBarGrow { from { transform: scaleY(0); } }

/* Karten */
.pw-panel {
    background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 8px;
    box-shadow: var(--card-inner-highlight); position: relative;
    transition: border-color var(--t-fast) var(--ease-io), transform var(--t-fast) var(--ease-io);
}
.pw-panel:hover { border-color: var(--border-strong); }
.pw-tick::before, .pw-tick::after {
    content: ""; position: absolute; width: 9px; height: 9px; pointer-events: none;
    background:
        linear-gradient(var(--border-strong), var(--border-strong)) center/9px 1px no-repeat,
        linear-gradient(var(--border-strong), var(--border-strong)) center/1px 9px no-repeat;
    transition: opacity var(--t-fast) var(--ease-io);
}
.pw-tick::before { top: -5px; left: -5px; }
.pw-tick::after { bottom: -5px; right: -5px; }
.pw-tick:hover::before, .pw-tick:hover::after {
    background:
        linear-gradient(var(--accent-gold-text), var(--accent-gold-text)) center/9px 1px no-repeat,
        linear-gradient(var(--accent-gold-text), var(--accent-gold-text)) center/1px 9px no-repeat;
}

/* Stat-Cards */
.pw-stats { display: grid; grid-template-columns: 1.35fr repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
@media (max-width: 1080px) { .pw-stats { grid-template-columns: 1fr 1fr; } .pw-stat.hero { grid-column: 1 / -1; } }
.pw-stat { padding: 20px 22px 16px; display: flex; flex-direction: column; gap: 5px; }
.pw-stat:hover { transform: translateY(-1px); }
.pw-stat .lbl { font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }
.pw-stat .val {
    font-family: var(--font-mono); font-variant-numeric: tabular-nums slashed-zero;
    font-size: 1.75rem; font-weight: 500; line-height: 1.15; letter-spacing: -0.01em;
    white-space: nowrap; color: var(--text-primary);
}
.pw-stat.hero .val { font-size: 2.25rem; }
.pw-stat .val .cents, .cents { font-size: 0.7em; color: var(--text-secondary); }
.pw-stat.hero {
    background:
        radial-gradient(560px 200px at 88% -30%, rgba(255, 201, 51, 0.09), transparent 60%),
        radial-gradient(420px 180px at 2% -20%, rgba(82, 232, 90, 0.07), transparent 60%),
        var(--bg-card);
}
[data-theme="light"] .pw-stat.hero {
    background:
        radial-gradient(560px 200px at 88% -30%, rgba(202, 138, 4, 0.10), transparent 60%),
        radial-gradient(420px 180px at 2% -20%, rgba(47, 181, 60, 0.08), transparent 60%),
        var(--bg-card);
}
.pw-stat .delta { display: flex; gap: 8px; align-items: baseline; font-size: 0.75rem; }
html[data-intro] .pw-stat .delta { animation: pwEnter 240ms var(--ease-out) 450ms both; }
.pw-stat .delta b { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-weight: 500; }
.pw-stat .delta .up { color: var(--accent-green-text); }
.pw-stat .delta .down { color: var(--accent-red-text); }
.pw-stat .delta span { color: var(--text-muted); }
.pw-stat .spark { margin-top: auto; padding-top: 10px; }

/* Chart-Panels */
.pw-charts-row { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-bottom: 16px; }
@media (max-width: 1100px) { .pw-charts-row { grid-template-columns: 1fr; } }
.pw-chartpanel { padding: 20px 22px; }
.chart-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.chart-head h2 { margin: 0; font-size: 1rem; font-weight: 600; color: var(--text-primary); }
.chart-head .sub { color: var(--text-muted); font-size: 0.75rem; }
.pw-legend { display: flex; gap: 14px; margin-left: auto; font-size: 0.75rem; color: var(--text-secondary); }
.pw-legend i { display: inline-block; width: 14px; height: 0; border-top: 2px solid var(--chart-line); vertical-align: middle; margin-right: 6px; }
.pw-legend .cmp i { border-top-style: dashed; border-top-color: var(--chart-compare); }
.chart-wrap, [data-line-chart] { position: relative; }
[data-line-chart] svg { display: block; width: 100%; height: auto; }
.chart-tip {
    position: absolute; pointer-events: none; opacity: 0; z-index: 5;
    background: var(--bg-elevated); border: 1px solid var(--border-strong); border-radius: 6px;
    box-shadow: var(--shadow-overlay); padding: 7px 10px; font-size: 0.75rem; white-space: nowrap;
    transition: opacity var(--t-fast) var(--ease-io); color: var(--text-primary);
}
.chart-tip b { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-weight: 500; }
.chart-tip .row { display: flex; gap: 10px; justify-content: space-between; }
.chart-tip .d { color: var(--text-muted); }
[data-bar-chart] svg { display: block; width: 100%; height: auto; }

/* Badges & Kanal-Kürzel */
.pw-badge {
    display: inline-flex; align-items: center; gap: 6px; height: 20px; padding: 0 8px;
    border-radius: 4px; font-size: 0.6875rem; font-weight: 500; white-space: nowrap;
}
.pw-badge i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.pw-badge.ok   { color: var(--accent-green-text);  background: var(--tint-success); border: 1px solid color-mix(in srgb, var(--accent-green-text) 25%, transparent); }
.pw-badge.warn { color: var(--accent-yellow-text); background: var(--tint-warning); border: 1px solid color-mix(in srgb, var(--accent-yellow-text) 25%, transparent); }
.pw-badge.bad  { color: var(--accent-red-text);    background: var(--tint-danger);  border: 1px solid color-mix(in srgb, var(--accent-red-text) 25%, transparent); }
.pw-badge.info { color: var(--accent-info-text);   background: var(--tint-info);    border: 1px solid color-mix(in srgb, var(--accent-info-text) 25%, transparent); }
.pw-badge.neutral { color: var(--text-secondary); border: 1px solid var(--border-strong); }
.pw-chan {
    display: inline-block; font-family: var(--font-mono); font-size: 0.6875rem; line-height: 17px;
    border: 1px solid var(--border-strong); border-radius: 4px; padding: 0 5px; color: var(--text-secondary);
}

/* Tabellen: Governance — Scan-Geschwindigkeit gewinnt immer */
.pw-tablepanel { overflow: hidden; }
/* flex-direction/margin explizit: die globale form-Regel (Sektion 4) setzt column + margin-bottom
   und würde eine als <form> gerenderte Toolbar sonst zur zentrierten Spalte stapeln */
.pw-toolbar { display: flex; flex-direction: row; align-items: center; gap: 12px; padding: 14px 18px; margin-bottom: 0; border-bottom: 1px solid var(--border-color); flex-wrap: wrap; }
.pw-toolbar h2 { margin: 0; font-size: 1rem; font-weight: 600; color: var(--text-primary); }
.pw-toolbar .grow { flex: 1; }
.pw-toolbar .card-action { margin-left: auto; }
.pw-scroll { overflow-x: auto; position: relative; }
.pw-table { width: 100%; border-collapse: collapse; }
.pw-table thead th {
    font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 500;
    color: var(--text-muted); text-align: left; padding: 10px 12px;
    background: var(--bg-elevated); border-bottom: 1px solid var(--border-strong); white-space: nowrap;
}
.pw-table tbody td {
    padding: 8px 12px; border-bottom: 1px solid var(--table-row-separator);
    white-space: nowrap; font-size: 0.8125rem; color: var(--text-primary);
    transition: background var(--t-fast) var(--ease-io);
}
.pw-table th.r, .pw-table td.r { text-align: right; }
.pw-table tbody tr:hover td { background: var(--bg-card-hover); }
.pw-table tbody tr:hover td:first-child { box-shadow: inset 2px 0 0 var(--accent-primary); }
.pw-table td.profit { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-weight: 500; }
.pw-table td.profit.pos { color: var(--accent-green-text); }
.pw-table td.profit.neg { color: var(--accent-red-text); }
.pw-table tr.loss td:first-child, .pw-table tr.loss:hover td:first-child { box-shadow: inset 2px 0 0 var(--accent-red-text); }
.pw-table tfoot td {
    padding: 10px 12px; border-top: 3px double var(--border-strong);
    font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-weight: 500;
    white-space: nowrap; color: var(--text-primary);
}
.pw-foot { padding: 11px 18px; color: var(--text-muted); font-size: 0.75rem; border-top: 1px solid var(--border-color); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cell-sub { color: var(--text-muted); font-size: 0.6875rem; margin-top: 1px; }
td .id, .pw-id { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-secondary); }

/* Listen-Zeilen (Top-Produkte etc.) */
.pw-listrow { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--table-row-separator); }
.pw-listrow:last-child { border-bottom: none; }
.pw-listrow .rank {
    width: 22px; height: 22px; border-radius: 6px; flex: none; display: grid; place-items: center;
    font-family: var(--font-mono); font-size: 0.6875rem; font-weight: 600;
    background: var(--accent-primary-tint); color: var(--accent-primary-text);
}
.pw-listrow .body { flex: 1; min-width: 0; }
.pw-listrow .body .t { font-size: 0.8125rem; font-weight: 500; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pw-listrow .val { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-weight: 500; color: var(--accent-green-text); }

/* Schnellzugriff-Chips */
.pw-quick { display: flex; gap: 8px; flex-wrap: wrap; }
.pw-quick a {
    display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 13px;
    border: 1px solid var(--border-color); border-radius: 6px; color: var(--text-primary);
    text-decoration: none; font-size: 0.8125rem;
    transition: border-color var(--t-fast) var(--ease-io), background var(--t-fast) var(--ease-io);
}
.pw-quick a:hover { background: var(--bg-card-hover); border-color: var(--border-strong); }

/* Hinweis-Panel (API-Warnung) */
.pw-alert {
    border: 1px solid color-mix(in srgb, var(--accent-yellow-text) 30%, transparent);
    background: var(--tint-warning); border-radius: 8px; padding: 12px 16px; margin-bottom: 16px;
    display: flex; gap: 12px; align-items: flex-start; font-size: 0.8125rem;
}
.pw-alert .t { font-weight: 600; color: var(--accent-yellow-text); }
.pw-alert .m { color: var(--text-secondary); margin-top: 2px; }
.pw-alert a { color: var(--accent-primary-text); }


/* ── pw-Formulare & Buttons ── */
.pw-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    height: 32px; padding: 0 13px; border-radius: 6px; font-size: 0.8125rem; font-weight: 500;
    border: 1px solid transparent; white-space: nowrap; cursor: pointer; text-decoration: none;
    font-family: inherit;
    transition: background var(--t-fast) var(--ease-io), border-color var(--t-fast) var(--ease-io),
        transform var(--t-press) var(--ease-io), color var(--t-fast) var(--ease-io);
}
.pw-btn:active { transform: scale(0.98); }
.pw-btn.primary { background: var(--accent-primary); color: var(--accent-primary-ink); box-shadow: inset 0 1px 0 rgba(255,255,255,0.25); }
.pw-btn.primary:hover { background: var(--accent-primary-hover); color: var(--accent-primary-ink); }
.pw-btn.sec { border-color: var(--border-color); color: var(--text-primary); background: transparent; }
.pw-btn.sec:hover { background: var(--bg-card-hover); border-color: var(--border-strong); }
.pw-btn.ghost { color: var(--text-secondary); background: transparent; }
.pw-btn.ghost:hover { color: var(--text-primary); background: var(--bg-card-hover); }
.pw-input, .pw-select {
    height: 32px; padding: 0 10px; background: var(--bg-input); color: var(--text-primary);
    border: 1px solid var(--border-color); border-radius: 6px; font: inherit; font-size: 0.8125rem;
    min-width: 0; transition: border-color var(--t-fast) var(--ease-io), box-shadow var(--t-fast) var(--ease-io);
}
.pw-input::placeholder { color: var(--text-muted); }
.pw-input:focus, .pw-select:focus { outline: none; border-color: var(--accent-primary); box-shadow: 0 0 0 3px var(--focus-ring); }
.pw-field { display: flex; flex-direction: column; gap: 4px; }
.pw-field > label { color: var(--text-muted); font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.05em; }

/* Leerzustand: rahmenloses Icon + Titel + Text + optionale Aktion */
.pw-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 56px 20px 60px; text-align: center; }
.pw-empty > svg { width: 34px; height: 34px; color: var(--text-muted); margin-bottom: 8px; }
.pw-empty .t { color: var(--text-primary); font-weight: 600; font-size: 0.9375rem; }
.pw-empty .m { color: var(--text-muted); font-size: 0.8125rem; max-width: 52ch; line-height: 1.5; }
.pw-empty .m a { color: var(--accent-primary-text); }
.pw-empty .act { margin-top: 14px; }

/* ── Akkordeon-Zeilen (Bestellpositionen etc.) ── */
tr.pw-acc { cursor: pointer; }
.pw-acc-arrow { display: inline-block; color: var(--text-muted); font-size: 0.625rem; margin-right: 8px; transition: transform 150ms var(--ease-io); }
tr.pw-acc.expanded .pw-acc-arrow { transform: rotate(90deg); }
tr.pw-acc-detail { display: none; }
tr.pw-acc-detail.open { display: table-row; }
tr.pw-acc-detail > td { background: var(--bg-elevated) !important; padding: 12px 16px 14px; white-space: normal; }
tr.pw-acc-detail.open > td > * { animation: pwEnter 200ms var(--ease-out) both; }
.pw-subtable { width: 100%; border-collapse: collapse; font-size: 0.75rem; }
.pw-subtable th {
    font-size: 0.625rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted);
    text-align: left; padding: 4px 8px; border-bottom: 1px solid var(--border-strong); font-weight: 500;
    background: none;
}
.pw-subtable td { padding: 5px 8px; border-bottom: 1px solid var(--table-row-separator); background: none; color: var(--text-primary); }
.pw-subtable td.r, .pw-subtable th.r { text-align: right; }

/* ── Pagination ── */
.pw-pages { display: flex; gap: 6px; justify-content: center; align-items: center; margin: 16px 0 6px; flex-wrap: wrap; }
.pw-pages a, .pw-pages span {
    min-width: 32px; height: 32px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--border-color); border-radius: 6px; color: var(--text-secondary);
    text-decoration: none; font-size: 0.8125rem; font-family: var(--font-mono);
}
.pw-pages a:hover { color: var(--text-primary); border-color: var(--border-strong); background: var(--bg-card-hover); }
.pw-pages span.current { color: var(--accent-primary-text); border-color: var(--accent-primary); background: var(--accent-primary-tint); }

/* ── Titel-Icon Bestellungen: Wagen rollt an, Räder ploppen ── */
.pi-cart .c-roll { transform-box: view-box; transform-origin: center; animation: piCartIn 550ms var(--ease-out) both; }
.pi-cart .cw { transform-box: fill-box; transform-origin: center; animation: piPop 220ms var(--ease-pop) both; }
.pi-cart .cw.w1 { animation-delay: 360ms; }
.pi-cart .cw.w2 { animation-delay: 440ms; }
@keyframes piCartIn { 0% { transform: translateX(-9px) rotate(-4deg); opacity: 0; } 55% { transform: translateX(1px) rotate(2deg); opacity: 1; } 100% { transform: none; } }
/* Labels: Drucker gibt ein Blatt aus */
.pi-print .pp-paper { opacity: 0; animation: piPaperOut 550ms var(--ease-out) 250ms both; }
@keyframes piPaperOut { 0% { transform: translateY(-6px); opacity: 0; } 40% { opacity: 1; } 100% { transform: none; opacity: 1; } }
/* Wareneingang: Brief fällt in die Box */
.pi-in .wi-letter { animation: piDrop 520ms var(--ease-io) 150ms both; }
@keyframes piDrop { 0% { transform: translateY(0); opacity: 0; } 25% { opacity: 1; } 70% { transform: translateY(7.5px); opacity: 1; } 100% { transform: translateY(9.5px); opacity: 0; } }


/* ══ Performance: Riesen-Tabellen lazy rendern (PR7) ══════════════════════════
   content-visibility überspringt Layout/Paint für Offscreen-Zeilen — eine
   2-MB-Tabelle kostet damit beim Laden nur noch die sichtbaren ~25 Zeilen. */
.tb-table tbody tr,
.products-table tbody tr,
.lbl-table tbody tr,
.orders-table tbody tr,
.returns-table tbody tr,
.dropship-table tbody tr {
    content-visibility: auto;
    contain-intrinsic-size: auto 40px;
}


/* ══ CURSOR-FINALE (muss letzte Regel-Schicht bleiben!) ═══════════════════════
   Legacy-Views setzen hundertfach klassenbasiert `cursor: pointer` und schlagen
   damit die Element-Selektoren des Präzisions-Pfeils. Diese !important-Schicht
   am Datei-Ende gewinnt jede Spezifitätsschlacht — Gold auf allem Klickbaren. */
@media (hover: hover) and (pointer: fine) {
    html body { cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 22 22"><path d="M3 1.5l15 8.5-6.5 1.8L8.7 18.5z" fill="%23EDEDEF" stroke="%2309090B" stroke-width="1.2"/></svg>') 3 1, auto !important; }
    html[data-theme="light"] body { cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 22 22"><path d="M3 1.5l15 8.5-6.5 1.8L8.7 18.5z" fill="%2318181B" stroke="%23FFFFFF" stroke-width="1.2"/></svg>') 3 1, auto !important; }
    html body :is(a, button, select, summary, label,
        [role="button"], [role="tab"], [onclick], [data-hdr-action],
        input[type="checkbox"], input[type="radio"], input[type="submit"], input[type="button"], input[type="date"],
        [class*="btn"], [class*="tab"], [class*="-link"], [class*="action"], [class*="toggle"],
        [class*="clickable"], [class*="expand"], .sbar-item, .cmdk-item, .pw-acc, .order-row, .sortable),
    html body :is(a, button, summary, label, [onclick], [class*="btn"], [class*="tab"]) * {
        cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 22 22"><path d="M3 1.5l15 8.5-6.5 1.8L8.7 18.5z" fill="%23FFC933" stroke="%2309090B" stroke-width="1.2"/></svg>') 3 1, pointer !important;
    }
    html body :is(input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="date"]), textarea) {
        cursor: text !important;
    }
    html body :is(button:disabled, [disabled]) { cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 22 22"><path d="M3 1.5l15 8.5-6.5 1.8L8.7 18.5z" fill="%23EDEDEF" stroke="%2309090B" stroke-width="1.2"/></svg>') 3 1, not-allowed !important; }
}
