/* =================================================================
   GastroPilot v5 – Design System
   ----------------------------------------------------------------
   Aufbau:
     1. CSS-Variablen (Farben, Spacing, Typo)
     2. Reset & Basis
     3. Typografie
     4. Buttons
     5. Forms / Inputs
     6. Karten / Widgets
     7. Tabellen
     8. Layout (Header, Sidebar, Main, Footer)
     9. Login-Overlay
    10. Modal-System
    11. Toast-Notifications
    12. Modul-Views
    13. Utilities
    14. Animationen
    15. Responsive (Mobile)
   ================================================================= */


/* ================= 1. CSS-VARIABLEN ============================ */
:root {
    /* Farbschema */
    --primary: #2C3E50;
    --primary-dark: #1A252F;
    --primary-light: #34495E;
    --accent: #E67E22;
    --accent-dark: #D35400;
    --accent-light: #F39C12;
    --success: #27AE60;
    --warning: #F39C12;
    --danger: #C0392B;
    --danger-dark: #A93226;
    --bg-light: #ECF0F1;
    --bg-white: #FFFFFF;
    --bg-muted: #F8F9FA;
    --text-dark: #2C3E50;
    --text-muted: #7F8C8D;
    --text-light: #BDC3C7;
    --border: #BDC3C7;
    --border-light: #E5E8EA;

    /* Typografie */
    --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'SF Mono', Menlo, 'Roboto Mono', Consolas, monospace;

    /* Spacing */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;
    --space-7: 48px;
    --space-8: 64px;

    /* Layout */
    --sidebar-w: 240px;
    --header-h: 64px;
    --footer-h: 48px;
    --content-padding: 32px;

    /* Radien */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-full: 9999px;

    /* Schatten */
    --shadow-sm: 0 1px 2px rgba(44, 62, 80, 0.06);
    --shadow-md: 0 4px 12px rgba(44, 62, 80, 0.08);
    --shadow-lg: 0 12px 32px rgba(44, 62, 80, 0.12);
    --shadow-xl: 0 24px 48px rgba(44, 62, 80, 0.18);

    /* Übergänge */
    --transition: 200ms ease;
    --transition-fast: 120ms ease;

    /* Z-Index Skala */
    --z-header: 100;
    --z-sidebar: 90;
    --z-modal: 1000;
    --z-toast: 1100;
    --z-login: 9999;
}


/* ================= 2. RESET & BASIS ============================ */
*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
}

body {
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-dark);
    background: var(--bg-light);
    -webkit-font-smoothing: antialiased;
    font-variant-numeric: tabular-nums;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition-fast);
}
a:hover {
    color: var(--accent-dark);
}

hr {
    border: 0;
    border-top: 1px solid var(--border-light);
    margin: var(--space-4) 0;
}

[hidden] {
    display: none !important;
}


/* ================= 3. TYPOGRAFIE =============================== */
h1, h2, h3, h4, h5, h6 {
    margin: 0 0 var(--space-3) 0;
    font-weight: 600;
    line-height: 1.25;
    color: var(--text-dark);
}
h1 { font-size: 28px; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
h4 { font-size: 16px; }

p {
    margin: 0 0 var(--space-3) 0;
}

code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    background: var(--bg-muted);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
}

.text-muted { color: var(--text-muted); }
.text-mono { font-family: var(--font-mono); }
.text-right { text-align: right; }
.text-center { text-align: center; }


/* ================= 4. BUTTONS ================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: 8px 16px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-dark);
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast),
                border-color var(--transition-fast), box-shadow var(--transition-fast),
                transform var(--transition-fast);
    user-select: none;
    white-space: nowrap;
}
.btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
.btn:disabled,
.btn[aria-disabled="true"] {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn-primary:active { transform: translateY(1px); }

.btn-secondary {
    background: var(--bg-white);
    color: var(--primary);
    border-color: var(--primary);
}
.btn-secondary:hover { background: var(--primary); color: #fff; }

.btn-danger {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
}
.btn-danger:hover { background: var(--danger-dark); border-color: var(--danger-dark); }

.btn-success {
    background: var(--success);
    color: #fff;
    border-color: var(--success);
}
.btn-success:hover { filter: brightness(0.92); }

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
}
.btn-ghost:hover {
    background: var(--bg-muted);
    color: var(--text-dark);
}

.btn-block { width: 100%; }
.btn-small { padding: 4px 10px; font-size: 12px; }
.btn-large { padding: 12px 24px; font-size: 16px; }

/* Loading-State: Spinner ersetzt Text */
.btn.is-loading {
    color: transparent !important;
    position: relative;
    pointer-events: none;
}
.btn.is-loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-top: -8px;
    margin-left: -8px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 600ms linear infinite;
    color: #fff;
}


/* ================= 5. FORMS / INPUTS =========================== */
.form-group {
    margin-bottom: var(--space-4);
}

.form-label {
    display: block;
    margin-bottom: var(--space-2);
    font-weight: 500;
    font-size: 13px;
    color: var(--text-dark);
}

.form-input,
.form-select,
.form-textarea {
    display: block;
    width: 100%;
    padding: 8px 12px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-dark);
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(230, 126, 34, 0.15);
}
.form-input.is-error,
.form-select.is-error,
.form-textarea.is-error {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.12);
}

.form-input--small { padding: 4px 8px; font-size: 12px; }
.form-input--large { padding: 12px 16px; font-size: 16px; }

.form-error {
    margin-top: var(--space-2);
    color: var(--danger);
    font-size: 12px;
}

.form-hint {
    margin-top: var(--space-2);
    color: var(--text-muted);
    font-size: 12px;
}


/* ================= 6. KARTEN / WIDGETS ========================= */
.card {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: var(--space-5);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--border-light);
}
.card-header h3 { margin: 0; }

.card-placeholder {
    color: var(--text-muted);
    text-align: center;
    border: 2px dashed var(--border-light);
    box-shadow: none;
    background: var(--bg-muted);
}


/* ================= 7. TABELLEN ================================ */
.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    background: var(--bg-white);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.table thead th {
    position: sticky;
    top: 0;
    background: var(--bg-muted);
    color: var(--text-muted);
    font-weight: 600;
    text-align: left;
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border-light);
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.04em;
}

.table th.sortable {
    cursor: pointer;
    user-select: none;
}
.table th.sortable::after {
    content: " ⇅";
    color: var(--text-light);
    font-size: 10px;
}
.table th.sortable.sort-asc::after  { content: " ↑"; color: var(--text-dark); }
.table th.sortable.sort-desc::after { content: " ↓"; color: var(--text-dark); }

.table tbody td {
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}
.table tbody tr:nth-child(even) { background: var(--bg-muted); }
.table tbody tr:hover { background: rgba(230, 126, 34, 0.06); }

/* alpha.136 — Zahl-Spalten: rechts-bündig (Header UND Werte), monospace für tabellarische Ziffern,
   width:1% + white-space:nowrap zwingt Spalte auf minimal benötigte Breite damit Werte nicht
   "verloren in der Mitte" wirken. Restliche Breite geht an Text-Spalten (z.B. Gericht-Name). */
.table .col-num,
.table thead th.col-num,
.table tbody td.col-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-family: var(--font-mono);
    white-space: nowrap;
    width: 1%;
}


/* ================= 8. LAYOUT (Shell) =========================== */
.app-shell {
    display: grid;
    grid-template-areas:
        "header header"
        "sidebar main"
        "footer footer";
    grid-template-rows: var(--header-h) 1fr var(--footer-h);
    grid-template-columns: var(--sidebar-w) 1fr;
    min-height: 100vh;
}

/* --- Header --- */
.app-header {
    grid-area: header;
    position: sticky;
    top: 0;
    z-index: var(--z-header);
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 0 var(--space-5);
    background: var(--primary);
    color: #fff;
    box-shadow: var(--shadow-md);
}
.header-left, .header-right {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}
.header-right { justify-content: flex-end; }
.header-center { text-align: center; }

.header-logo { font-size: 24px; }
.header-brand { display: flex; flex-direction: column; line-height: 1.1; }
.header-title { font-weight: 700; font-size: 16px; }
.header-version { font-size: 11px; opacity: 0.65; font-family: var(--font-mono); }
.header-betrieb { font-weight: 500; font-size: 14px; opacity: 0.9; }

/* app.221 — Betriebs-Umschalter als klar tippbare Pille (damit sofort sichtbar ist, in welchem Betrieb man ist). */
.betrieb-switcher-btn {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    padding: 5px 12px;
    font-size: inherit;
    color: inherit;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    max-width: 100%;
    transition: background 0.15s;
}
.betrieb-switcher-btn:hover, .betrieb-switcher-btn:active { background: rgba(255, 255, 255, 0.24); }
.betrieb-switcher-btn .bs-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.drive-status {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-full);
    font-size: 12px;
    cursor: pointer;
    transition: background var(--transition-fast);
}
.drive-status:hover { background: rgba(255, 255, 255, 0.16); }

.drive-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}
.drive-status-dot--on  { background: var(--success); box-shadow: 0 0 6px var(--success); }
.drive-status-dot--off { background: var(--danger); }

.user-menu-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    font-size: 16px;
    transition: background var(--transition-fast);
}
.user-menu-btn:hover { background: rgba(255, 255, 255, 0.16); }


/* --- Sidebar --- */
.app-sidebar {
    grid-area: sidebar;
    position: sticky;
    top: var(--header-h);
    align-self: start;
    z-index: var(--z-sidebar);
    height: calc(100vh - var(--header-h) - var(--footer-h));
    background: var(--bg-white);
    border-right: 1px solid var(--border-light);
    padding: var(--space-4) 0;
    overflow-y: auto;
}

.sidebar-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: 10px var(--space-5);
    color: var(--text-dark);
    font-size: 14px;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: background var(--transition-fast), color var(--transition-fast),
                border-color var(--transition-fast);
}
.sidebar-link:hover {
    background: var(--bg-muted);
    color: var(--accent-dark);
}
.sidebar-link.active {
    background: rgba(230, 126, 34, 0.10);
    color: var(--accent-dark);
    border-left-color: var(--accent);
}
.sidebar-link--disabled {
    color: var(--text-light);
    cursor: not-allowed;
    pointer-events: none;
}

.sidebar-icon { font-size: 18px; width: 22px; text-align: center; }
.sidebar-label { flex: 1; }

.sidebar-badge {
    font-size: 10px;
    padding: 2px 6px;
    background: var(--bg-light);
    color: var(--text-muted);
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sidebar-divider {
    margin: var(--space-3) var(--space-5);
    border-top: 1px solid var(--border-light);
}

/* alpha.209 — Back-Navigation Bar (sichtbar wenn vom Dashboard zu Sub-Modul) */
.back-nav-bar {
    background: linear-gradient(90deg, var(--bg-muted, #F8F9FA) 0%, transparent 60%);
    border-bottom: 1px solid var(--border-light);
    padding: 8px var(--space-5);
    margin: calc(-1 * var(--space-5)) calc(-1 * var(--space-5)) var(--space-4);
    position: sticky;
    top: 0;
    z-index: 5;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    background-color: rgba(255, 255, 255, 0.85);
}
.back-nav-bar[hidden] { display: none; }
.back-nav-bar .btn {
    color: var(--accent, #E67E22);
    font-weight: 600;
    padding: 4px 10px;
    font-size: 13px;
}
.back-nav-bar .btn:hover {
    background: var(--bg-muted, #F8F9FA);
    color: var(--accent-dark, #D35400);
}

/* alpha.207 — Sidebar-Gruppen-Header */
.sidebar-group-header {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: var(--space-3) var(--space-5) 4px;
    margin-top: var(--space-2);
    border-top: 1px solid var(--border-light);
    user-select: none;
}
.sidebar-group-header:first-of-type {
    margin-top: 0;
    border-top: none;
    padding-top: 0;
}
.sidebar-nav > .sidebar-list {
    margin-bottom: 2px;
}


/* --- Main --- */
.app-main {
    grid-area: main;
    padding: var(--content-padding);
    overflow-y: auto;
    min-width: 0;
}


/* --- Footer --- */
.app-footer {
    grid-area: footer;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 0 var(--space-5);
    background: var(--bg-white);
    border-top: 1px solid var(--border-light);
    font-size: 12px;
    color: var(--text-muted);
}
.footer-center { text-align: center; }
.footer-right { text-align: right; display: flex; gap: var(--space-4); justify-content: flex-end; }
.footer-link { color: var(--text-muted); }
.footer-link:hover { color: var(--accent); }


/* ================= 9. LOGIN-OVERLAY ============================ */
.login-overlay {
    position: fixed;
    inset: 0;
    z-index: var(--z-login);
    display: grid;
    place-items: center;
    padding: var(--space-5);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
}

.login-card {
    width: 100%;
    max-width: 400px;
    padding: var(--space-7) var(--space-6);
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    text-align: center;
}

.login-logo {
    font-size: 56px;
    margin-bottom: var(--space-3);
}

.login-title {
    margin: 0 0 var(--space-2) 0;
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
}

.login-subtitle {
    margin: 0 0 var(--space-6) 0;
    color: var(--text-muted);
    font-size: 14px;
}

.login-form { text-align: left; }

.login-footer-text {
    margin: var(--space-6) 0 0 0;
    color: var(--text-light);
    font-size: 11px;
    font-family: var(--font-mono);
}

/* Shake-Animation bei falschem Passwort */
.login-card.is-shaking {
    animation: shake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}


/* ================= 10. MODAL-SYSTEM ============================ */
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    display: grid;
    place-items: center;
    padding: var(--space-5);
    background: rgba(44, 62, 80, 0.55);
    backdrop-filter: blur(2px);
    animation: fadeIn var(--transition);
}

.modal {
    width: 100%;
    min-width: 0;   /* app.515 — Grid-Kind: sonst wird der Dialog so breit wie sein breitester Inhalt (Handy: über den Rand) */
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: modalIn var(--transition);
}
.modal--small  { max-width: 400px; }
.modal--medium { max-width: 640px; }
.modal--large  { max-width: 960px; }

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--border-light);
}
.modal-title { margin: 0; font-size: 18px; overflow-wrap: anywhere; min-width: 0; }   /* app.515 — lange Dateinamen umbrechen */

.modal-close {
    background: transparent;
    border: 0;
    font-size: 18px;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    padding: var(--space-2);
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast), color var(--transition-fast);
}
.modal-close:hover { background: var(--bg-muted); color: var(--text-dark); }

.modal-body {
    padding: var(--space-5);
    overflow-y: auto;
    overflow-x: auto;   /* app.515 — breite Tabellen scrollen im Dialog statt ihn zu sprengen */
    min-width: 0;
    flex: 1 1 auto;
}

.modal-footer {
    display: flex;
    flex-wrap: wrap;   /* app.515 — auf dem Handy brechen lange Knöpfe um statt links abgeschnitten zu werden */
    justify-content: flex-end;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    border-top: 1px solid var(--border-light);
    background: var(--bg-muted);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
}
.modal-footer:empty { display: none; }


/* ================= 11. TOAST-NOTIFICATIONS ===================== */
.toast-container {
    position: fixed;
    top: calc(var(--header-h) + var(--space-4));
    right: var(--space-5);
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    pointer-events: none;
    max-width: calc(100% - 2 * var(--space-5));
}

.toast {
    pointer-events: auto;
    min-width: 280px;
    max-width: 420px;
    padding: var(--space-3) var(--space-4);
    background: var(--bg-white);
    border-left: 4px solid var(--text-muted);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    animation: slideInRight var(--transition);
    font-size: 13px;
}
.toast.is-dismissing { animation: slideOutRight var(--transition) forwards; }

.toast-icon { font-size: 18px; line-height: 1; }
.toast-message { flex: 1; color: var(--text-dark); }
.toast-close {
    background: transparent;
    border: 0;
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    padding: 2px;
}
.toast-close:hover { color: var(--text-dark); }

.toast--success { border-left-color: var(--success); }
.toast--error   { border-left-color: var(--danger); }
.toast--warning { border-left-color: var(--warning); }
.toast--info    { border-left-color: var(--primary); }


/* ================= 12. MODUL-VIEWS ============================= */
.module-view { display: none; }
.module-view--active { display: block; }
/* app.523 — „Nur ansehen": Bereich ohne Schreib-Recht (main.js _rechteSchutzMarkieren) */
.module-view[data-nur-lesen]::before { content: "🔒 Nur ansehen — Ändern ist für dich nicht freigeschaltet (Recht: " attr(data-nur-lesen) ")."; display: block; margin: 0 0 12px; padding: 8px 12px; border-radius: 8px; background: #FFF8E1; border-left: 4px solid var(--warning, #F5A623); font-size: 13px; color: var(--text-dark, #333); }

.module-header {
    margin-bottom: var(--space-5);
}
.module-title { margin: 0; }

/* Welcome */
.welcome-hero {
    text-align: center;
    padding: var(--space-7) var(--space-5);
    margin-bottom: var(--space-6);
}
.welcome-icon { font-size: 56px; margin-bottom: var(--space-3); }
.welcome-title { font-size: 28px; margin-bottom: var(--space-3); }
.welcome-text { color: var(--text-muted); max-width: 520px; margin: 0 auto; font-size: 15px; }

.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: var(--space-4);
}
.module-card {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    padding: var(--space-5);
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition);
    cursor: pointer;
}
.module-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.module-card-icon { font-size: 32px; margin-bottom: var(--space-2); }
.module-card-title { margin: 0 0 var(--space-2) 0; font-size: 16px; }
.module-card-text { color: var(--text-muted); font-size: 13px; margin-bottom: var(--space-3); }
.module-card-status {
    display: inline-block;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    background: var(--bg-light);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.status-pending { background: #FEF3E2; color: var(--accent-dark); }


/* ================= 12b. MODUL: SPEISEKARTEN ==================== */

/* Header mit Titel + Action-Buttons */
.sk-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-3);
    margin-bottom: var(--space-5);
}
.sk-actions {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
}

/* Listen-Zeile als Speisekarten-Eintrag */
.sk-row { cursor: pointer; }
.sk-row:hover { background: rgba(230, 126, 34, 0.06); }

/* Empty-State */
.sk-empty {
    text-align: center;
    padding: var(--space-7) var(--space-5);
}
.sk-empty-icon {
    font-size: 56px;
    opacity: 0.4;
    margin-bottom: var(--space-3);
}
.sk-empty h3 {
    margin-bottom: var(--space-2);
    color: var(--text-dark);
}
.sk-empty p {
    color: var(--text-muted);
    margin: 0;
}

/* Source-Badge in Tabelle */
.sk-source-badge {
    display: inline-block;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    background: var(--bg-muted);
    color: var(--text-muted);
    white-space: nowrap;
}

/* Detail-Header: Back-Btn + Titel + Source nebeneinander */
.sk-detail-title {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex-wrap: wrap;
}
.sk-detail-title .module-title { margin: 0; }

.sk-karte-desc {
    margin-top: -8px;
    margin-bottom: var(--space-3);
}
.sk-karte-meta {
    font-size: 12px;
    margin-bottom: var(--space-4);
}

/* Kategorie-Überschrift in der Detail-Ansicht */
.sk-cat-title {
    margin: var(--space-5) 0 var(--space-2);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent-dark);
    font-weight: 600;
}
.sk-cat-title:first-child { margin-top: 0; }

.sk-gericht-table {
    margin-bottom: var(--space-4);
}

.sk-gericht-name {
    font-weight: 500;
    color: var(--text-dark);
}
.sk-gericht-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
    line-height: 1.4;
}

/* Grid für 2-spaltige Form-Reihen (Kategorie + Preis nebeneinander) */
.sk-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3);
}

/* PDF-Import Status-Box */
.sk-status {
    padding: var(--space-3);
    background: var(--bg-muted);
    border-radius: var(--radius-sm);
    margin-top: var(--space-3);
    font-size: 13px;
    color: var(--text-muted);
    border-left: 3px solid var(--accent);
}
.sk-status--error {
    border-left-color: var(--danger);
    color: var(--danger);
    background: rgba(192, 57, 43, 0.05);
}


/* ================= 12c. MODUL: RECHNUNGEN ====================== */

/* Summary-Bar oberhalb der Liste */
.rg-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--space-3);
    margin-bottom: var(--space-5);
}
.rg-summary-item {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    padding: var(--space-3) var(--space-4);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.rg-summary-item--accent {
    background: var(--primary);
    color: #fff;
}
.rg-summary-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}
.rg-summary-item--accent .rg-summary-label { color: rgba(255,255,255,0.7); }
.rg-summary-value {
    font-size: 18px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* Meta-Grid in der Detail-Ansicht (Datum, Nr., Σ Netto, Σ USt, Σ Brutto) */
.rg-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}
.rg-meta-item {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    padding: var(--space-3) var(--space-4);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.rg-meta-item--accent {
    background: var(--accent);
    color: #fff;
}
.rg-meta-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}
.rg-meta-item--accent .rg-meta-label { color: rgba(255,255,255,0.85); }
.rg-meta-value {
    font-size: 16px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* Typ-Badges in der Listen-/Detailansicht */
.rg-typ-rechnung    { background: #E8F5E9; color: #1B5E20; }
.rg-typ-preisliste  { background: #FFF3E0; color: #E65100; }
.rg-typ-lieferschein { background: #E3F2FD; color: #0D47A1; }
.rg-typ-gutschrift  { background: #E0F2F1; color: #00695C; }

.rg-summary-sub {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 400;
}


/* ================= 12d. MODUL: REZEPTE ========================= */

.rz-row { cursor: pointer; }
.rz-row:hover { background: rgba(230, 126, 34, 0.06); }

/* Ampel-Punkte für die Liste */
.rz-ampel-green   { color: var(--success); font-size: 18px; }
.rz-ampel-yellow  { color: var(--warning); font-size: 18px; }
.rz-ampel-red     { color: var(--danger);  font-size: 18px; }
.rz-ampel-gray    { color: var(--text-light); font-size: 18px; }

/* Ampel-Karte (Detail-View, Meta-Grid) */
.rz-ampel-card {
    color: #fff;
}
.rz-ampel-card-green  { background: var(--success); }
.rz-ampel-card-yellow { background: var(--warning); }
.rz-ampel-card-red    { background: var(--danger);  }
.rz-ampel-card-gray   { background: var(--text-muted); }
.rz-ampel-card .rg-meta-label { color: rgba(255,255,255,0.85); }
.rz-ampel-card .rz-ampel-dot { margin-left: var(--space-2); font-size: 14px; }

/* alpha.127 — WE-Karte klickbar (öffnet Marge-Analyse-Modal) */
.rz-we-card { transition: transform 0.12s ease, box-shadow 0.12s ease; }
.rz-we-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.18);
    filter: brightness(1.05);
}
.rz-we-card:active { transform: translateY(0); }

.rz-status-empty {
    font-size: 11px;
    color: var(--text-muted);
    font-style: italic;
}
.rz-status-partial {
    font-size: 11px;
    color: var(--warning);
    font-weight: 500;
}

.rz-lieferant {
    font-size: 11px;
    color: var(--text-muted);
}

/* Quellen-Badges (Lieferant / KI / Demo / manuell) */
.rz-quelle {
    display: inline-block;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background: var(--bg-muted);
    color: var(--text-muted);
    font-weight: 500;
}
.rz-q-pdf    { background: #E8F5E9; color: #1B5E20; }
.rz-q-ai     { background: #FFF3E0; color: #E65100; }
.rz-q-demo   { background: #F3E5F5; color: #6A1B9A; }
.rz-q-manual { background: #E3F2FD; color: #0D47A1; }
.rz-q-est    { background: var(--bg-muted); color: var(--text-muted); }

/* Preis-Override-Bereich im Zutat-Modal */
.rz-priceoverride {
    margin-top: var(--space-3);
    padding-top: var(--space-3);
    border-top: 1px dashed var(--border-light);
}

/* Zutat-Label-System: Bezeichnung oben groß, Artikel-Mapping klein darunter */
.rz-zutat-label {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 14px;
    margin-bottom: 2px;
}
.rz-zutat-artikel {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
    padding-left: var(--space-1);
}

/* app.525 — Mischung in der Zutat-Zeile (Cocktailsauce = Ketchup 40 % · Mayo 50 % · Kren 10 %) */
.rz-zutat-zelle { min-width: 0; flex: 1 1 auto; }
.rz-misch-oeffnen { color: var(--primary); white-space: nowrap; }
.rz-misch-info, .rz-misch-tipp {
    font-size: 12px;
    line-height: 1.45;
    margin-top: 3px;
    padding-left: var(--space-1);
    white-space: normal;
}
.rz-misch-info { color: var(--text-dark); }
.rz-misch-tipp { color: var(--text-muted); }
.rz-misch-editor {
    margin-top: var(--space-2);
    padding: var(--space-3);
    border: 1px solid var(--border-light);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius-md);
    background: var(--bg-muted);
    width: 100%;                                        /* füllt die Spalte „Zutat" … */
    min-width: min(300px, calc(100vw - 48px));          /* … die mindestens Platz für Artikel + % bekommt (Handy: nie breiter als der Schirm) */
    max-width: 520px;
    box-sizing: border-box;
    white-space: normal;
    font-size: 13px;
}
.rz-misch-kopf { font-size: 14px; margin-bottom: 2px; }
.rz-misch-erkl { font-size: 12px; color: var(--text-muted); margin-bottom: var(--space-2); }
.rz-misch-zeile { display: flex; align-items: center; gap: 6px; margin: 6px 0; }
.rz-misch-zeile .rz-misch-art { flex: 1 1 0; min-width: 0; width: 0; }   /* schrumpft mit (sonst drückt die Feldbreite die Tabelle am Handy auseinander) */
.rz-misch-zeile .rz-misch-anteil { flex: 0 0 64px; width: 64px; text-align: right; }
.rz-misch-pz { color: var(--text-muted); font-size: 12px; }
.rz-misch-vorschau { font-size: 12px; line-height: 1.55; margin: var(--space-2) 0; }
.rz-misch-warn-text { color: var(--accent-dark, #E65100); }
.rz-misch-knoepfe { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 768px) {
    /* Handy: „ZUTAT" über dem Inhalt statt daneben — Artikel, Mischung und Editor bekommen die ganze Kartenbreite */
    .table tbody td[data-label="Zutat"]:has(> .rz-zutat-zelle) { flex-direction: column; align-items: stretch; gap: 2px; }
    .rz-misch-editor { min-width: 0; max-width: none; }
}

/* Inline-Dropdown für schnelles Artikel-Umverlinken in der Zutaten-Tabelle */
.rz-inline-edit {
    display: inline-block;
    max-width: 360px;
    min-width: 200px;
}
.rz-inline-input {
    border: 1px dashed var(--border-light);
    background: transparent;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-size: inherit;
    font-family: inherit;
    color: inherit;
    width: 100%;
    transition: border-color var(--transition-fast), background var(--transition-fast);
}
.rz-inline-input:hover {
    border-color: var(--accent);
    background: rgba(230, 126, 34, 0.04);
}
.rz-inline-input:focus {
    outline: none;
    border-color: var(--accent);
    border-style: solid;
    background: var(--bg-white);
    box-shadow: 0 0 0 2px rgba(230, 126, 34, 0.12);
}


/* ================= 12e. MODUL: KALKULATION ===================== */

.kalk-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--space-3);
    margin-bottom: var(--space-5);
}
.kalk-card {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    padding: var(--space-3) var(--space-4);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 2px;
    border-left: 4px solid var(--border-light);
}
.kalk-card-green  { border-left-color: var(--success); }
.kalk-card-yellow { border-left-color: var(--warning); }
.kalk-card-red    { border-left-color: var(--danger);  }
.kalk-card-gray   { border-left-color: var(--text-light); }
.kalk-card-warn   { border-left-color: var(--accent); }

/* Klickbare Filter-Cards (Dashboard) */
.kalk-card.kalk-filter {
    transition: transform 0.1s, box-shadow 0.15s, border-left-width 0.15s;
}
.kalk-card.kalk-filter:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md, 0 4px 12px rgba(0,0,0,0.08));
}
.kalk-card.kalk-filter.is-active {
    border-left-width: 8px;
    box-shadow: var(--shadow-md, 0 4px 12px rgba(0,0,0,0.12));
}

/* === Dashboard-Layout (alpha.64) === */
.kalk-dash-header-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: var(--space-3);
    align-items: stretch;
    margin-bottom: var(--space-3);
}
.kalk-dash-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--space-2);
}

/* Gesamtampel rechts oben */
.kalk-gesamtampel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3);
    background: #1A1F2E;
    color: #fff;
    border-radius: var(--radius-md);
    min-width: 180px;
}
.kalk-gesamtampel-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    opacity: 0.75;
}
.kalk-gesamtampel-lights {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.kalk-gesamtampel-light {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #2A2F3E;
    border: 2px solid #1A1F2E;
}
.kalk-gesamtampel-light.is-on.green  { background: #34C759; box-shadow: 0 0 16px rgba(52, 199, 89, 0.7); }
.kalk-gesamtampel-light.is-on.yellow { background: #FFCC00; box-shadow: 0 0 16px rgba(255, 204, 0, 0.7); }
.kalk-gesamtampel-light.is-on.red    { background: #FF3B30; box-shadow: 0 0 16px rgba(255, 59, 48, 0.7); }
.kalk-gesamtampel-status {
    font-size: 12px;
    text-align: center;
    opacity: 0.85;
}

/* 2-Spalten-Grid für Bewertung + Balken / Top + Schlechte */
.kalk-dash-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
}
@media (max-width: 900px) {
    .kalk-dash-2col { grid-template-columns: 1fr; }
}
.kalk-dash-panel {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    padding: var(--space-3) var(--space-4);
    box-shadow: var(--shadow-sm);
}
.kalk-dash-panel-title {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 var(--space-3) 0;
    color: var(--text);
}

/* WES-Balken-Diagramm */
.kalk-bars {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}
.kalk-bar-row {
    display: grid;
    grid-template-columns: 100px 1fr 56px;
    gap: var(--space-2);
    align-items: center;
    font-size: 12px;
}
.kalk-bar-name {
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.kalk-bar-track {
    height: 14px;
    background: var(--bg-muted);
    border-radius: var(--radius-sm);
    position: relative;
    overflow: hidden;
}
.kalk-bar-fill {
    height: 100%;
    border-radius: var(--radius-sm);
    transition: width 0.3s;
}
.kalk-bar-fill.green  { background: var(--success); }
.kalk-bar-fill.yellow { background: var(--warning); }
.kalk-bar-fill.red    { background: var(--danger); }
.kalk-bar-fill.gray   { background: var(--text-light); }
.kalk-bar-val {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}
.kalk-bar-scale {
    display: grid;
    grid-template-columns: 100px 1fr 56px;
    gap: var(--space-2);
    margin-top: var(--space-2);
    font-size: 10px;
    color: var(--text-muted);
}
.kalk-bar-scale-ticks {
    display: flex;
    justify-content: space-between;
    padding: 0 2px;
}
.kalk-bar-legend {
    display: flex;
    gap: var(--space-3);
    margin-top: var(--space-3);
    font-size: 11px;
    flex-wrap: wrap;
}
.kalk-bar-legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
}
.kalk-bar-legend-dot {
    width: 10px; height: 10px; border-radius: 2px;
}

/* Top/Bottom-Listen kompakter */
.kalk-rank-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.kalk-rank-item {
    display: grid;
    grid-template-columns: 24px 1fr auto;
    gap: var(--space-2);
    padding: var(--space-2) 0;
    border-bottom: 1px solid var(--border-light);
    align-items: center;
    font-size: 13px;
}
.kalk-rank-item:last-child { border-bottom: none; }
.kalk-rank-num {
    font-weight: 700;
    color: var(--text-muted);
    text-align: center;
}
.kalk-rank-name {
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.kalk-rank-sub {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 1px;
}
.kalk-rank-val {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    white-space: nowrap;
}
.kalk-rank-val.good  { color: var(--success); }
.kalk-rank-val.bad   { color: var(--danger); }

.kalk-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}
.kalk-value {
    font-size: 22px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.kalk-hint {
    margin-top: var(--space-5);
    padding: var(--space-3) var(--space-4);
    background: var(--bg-muted);
    border-radius: var(--radius-md);
    font-size: 13px;
    color: var(--text-muted);
    border-left: 3px solid var(--accent);
}

.kalk-demo-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    flex-wrap: wrap;
    padding: var(--space-4) var(--space-5);
    background: linear-gradient(135deg, #FFF3E0 0%, #FFE0B2 100%);
    border: 1px solid var(--accent);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-5);
}
.kalk-demo-text {
    flex: 1 1 280px;
    color: var(--text-dark);
    font-size: 14px;
    line-height: 1.5;
}
.kalk-demo-text strong { color: var(--accent-dark); }

/* Bulk-Fortschritts-Balken */
.bulk-progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-muted);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin: var(--space-3) 0;
}
.bulk-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent) 0%, var(--accent-light) 100%);
    transition: width 0.3s ease;
}

/* alpha.138 — Slide-in für Log-Einträge (Rechnungen-Bulk) */
@keyframes gp-log-slide-in {
    from { opacity: 0; transform: translateX(-12px); }
    to   { opacity: 1; transform: translateX(0); }
}


/* ================= DROP-ZONE (Drag & Drop für PDFs) ============ */

.dropzone {
    display: block;
    padding: var(--space-7) var(--space-5);
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-muted);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
    user-select: none;
}
.dropzone:hover {
    border-color: var(--accent);
    background: rgba(230, 126, 34, 0.05);
}
.dropzone--over {
    border-color: var(--accent);
    border-style: solid;
    background: rgba(230, 126, 34, 0.15);
    transform: scale(1.01);
    box-shadow: 0 4px 16px rgba(230, 126, 34, 0.18);
}
.dropzone-icon {
    font-size: 40px;
    opacity: 0.6;
    margin-bottom: var(--space-2);
    pointer-events: none;
}
.dropzone--over .dropzone-icon {
    opacity: 1;
    transform: scale(1.1);
    transition: transform var(--transition);
}
.dropzone-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: var(--space-1);
    pointer-events: none;
}
.dropzone-sub {
    font-size: 13px;
    color: var(--text-muted);
    pointer-events: none;
}

/* Datei-Liste nach Drop / Auswahl */
.dropzone-list {
    margin-top: var(--space-3);
    padding: var(--space-3);
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
}
.dropzone-list-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: var(--space-2);
    font-size: 13px;
}
.dropzone-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 180px;
    overflow-y: auto;
}
.dropzone-list li {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) 0;
    font-size: 13px;
    border-bottom: 1px solid var(--border-light);
}
.dropzone-list li:last-child { border-bottom: 0; }
.dropzone-list-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* app.517 (Gegenprüfung) — Fieldsets sind im Browser mindestens so breit wie ihr breitester Inhalt (min-width: min-content).
   Im Tab Betrieb ragte der Saison-Block am Handy dadurch über den Rand. So bleiben sie in ihrer Spalte und der Inhalt bricht um. */
#moduleBetrieb fieldset { min-width: 0; }

/* app.516 — Upload-Seite: ein Feld für alles (Knopf + Ablegen). Ablegen geht auf der ganzen Seite (modules/upload.js). */
.up-auto {
    padding: var(--space-4);
    border: 2px solid #2196F3;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #E3F2FD, #BBDEFB);
    margin-bottom: var(--space-4);
    transition: box-shadow var(--transition);
}
.up-auto-kopf { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.up-auto-titel { margin: 0 0 4px; font-size: 17px; color: #0D47A1; }
.up-drop {
    margin-top: var(--space-3);
    display: flex; align-items: center; justify-content: center; gap: 12px;
    min-height: 92px; padding: 14px 16px;
    border: 2px dashed #64B5F6;
    border-radius: var(--radius-md);
    background: #F5FAFF;
    color: #0D47A1;
    font-size: 14px; text-align: left;
    cursor: pointer; user-select: none;
    transition: background var(--transition), border-color var(--transition);
}
.up-drop:hover, .up-drop:focus-visible { background: #FFFFFF; border-color: #1E88E5; outline: none; }
.up-drop-icon { font-size: 28px; pointer-events: none; }
.up-drop-sub { display: block; font-size: 12px; color: #5C6B7A; margin-top: 2px; }
.up-auto.up-ziehen { box-shadow: 0 0 0 4px rgba(33, 150, 243, 0.3); }
.up-auto.up-ziehen .up-drop { background: #FFFFFF; border-color: #1565C0; border-style: solid; }
/* Handy: Ziehen gibt es dort nicht, der Knopf darüber reicht */
@media (hover: none) and (max-width: 768px) { .up-drop { display: none; } }
.up-gezielt { margin: 0 0 var(--space-4); }
.up-gezielt > summary { cursor: pointer; font-size: 13px; font-weight: 600; color: #2C3E50; padding: 8px 2px; }
.up-gezielt > summary .text-muted { font-weight: 400; }
.up-gezielt[open] > summary { margin-bottom: var(--space-3); }

/* app.519 — Angebote & Rechnungen: das zweispaltige Formular ragte am Handy über den Rand (Datum, Beschreibung) */
.ar-grid > * { min-width: 0; }
@media (max-width: 560px) { .ar-grid { grid-template-columns: 1fr !important; } .ar-grid > * { grid-column: auto !important; } }

/* app.518 — der Cloud-Knopf unten rechts (z 1200) lag über den Knöpfen offener Dialoge (z. B. „Übernehmen") */
body:has(#modalBackdrop:not([hidden])) #gp-sync-btn { display: none !important; }

/* app.518 — Bericht übernehmen (modules/kalkulation.js _openReportPreviewModal): oben die Summen, darunter nur,
   was eine Entscheidung braucht. Erkannte Gerichte eingeklappt, %-Feld nur beim Aufteilen. */
.bp-kopfzeile { font-size: 13px; color: #5C6B7A; margin: 0 0 var(--space-3); overflow-wrap: anywhere; }
.bp-zr { margin-bottom: var(--space-4); }
.bp-zr-kacheln { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }
.bp-kachel { background: #F4F6F8; border-radius: var(--radius-md); padding: 10px 12px; min-width: 0; }
.bp-kachel span { display: block; font-size: 12px; color: #5C6B7A; }
.bp-kachel strong { display: block; font-size: 19px; font-weight: 700; color: #2C3E50; overflow-wrap: anywhere; }
.bp-zr-status { font-size: 13px; margin-top: 10px; padding: 8px 10px; border-radius: var(--radius-sm); }
.bp-zr-status--ok { background: #E8F5E9; color: #1B5E20; }
.bp-zr-status--warn { background: #FFF3E0; color: #B45309; }
.bp-zr-status--info { background: #F4F6F8; color: #2C3E50; }
.bp-zr-abgleich { font-size: 12px; color: #5C6B7A; margin-top: 6px; }
.bp-zr-felder { margin-top: 8px; }
.bp-zr-felder > summary { cursor: pointer; font-size: 13px; color: #1E6FB8; padding: 4px 0; }
.bp-zr-eingabe { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.bp-zr-eingabe label { font-size: 12px; display: flex; flex-direction: column; gap: 2px; flex: 1 1 140px; min-width: 0; }
.bp-gruppe { margin-bottom: var(--space-3); }
.bp-gruppe-kopf { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; font-size: 14px; color: #B45309; }
.bp-gruppe-links { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; }
.bp-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; margin-bottom: 8px;
          border: 1px solid #E3E7EB; border-radius: var(--radius-md); background: #FFFFFF; }
.bp-row--offen { border-color: #F5C77E; background: #FFFBF3; }
.bp-row--ok { border-color: #A5D6A7; background: #F6FBF6; }
.bp-row--weg { opacity: 0.55; }
.bp-row-cb { flex: 0 0 auto; display: flex; align-items: center; }
.bp-row-name { flex: 1 1 170px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.bp-row-name strong { overflow-wrap: anywhere; }
.bp-row-sub { font-size: 12px; color: #5C6B7A; }
.bp-row-ziel { flex: 1 1 220px; min-width: 0; }
.bp-row-aktionen { display: flex; gap: 6px; flex-wrap: wrap; }
.bp-slot { display: flex; gap: 6px; align-items: center; margin-bottom: 4px; }
.bp-slot .bp-match { flex: 1 1 auto; min-width: 0; font-size: 13px; padding: 5px 8px; }
.bp-slot .bp-anteil { display: none; width: 64px; font-size: 13px; padding: 5px 6px; }
.bp-split-on .bp-slot .bp-anteil { display: inline-block; }
.bp-chip { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 99px; white-space: nowrap; }
.bp-chip--neu { background: #FDECEA; color: #B42318; }
.bp-chip--tipp { background: #FFF3E0; color: #B45309; }
.bp-chip--ok { background: #E8F5E9; color: #1B5E20; }
.bp-erkannt > summary { cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid #E3E7EB;
                        border-radius: var(--radius-md); font-size: 14px; color: #1B5E20; list-style: none; }
.bp-erkannt > summary::-webkit-details-marker { display: none; }
.bp-erkannt-auf { margin-left: auto; font-size: 12px; color: #5C6B7A; }
.bp-erkannt[open] > summary { margin-bottom: 8px; }
.bp-erkannt[open] .bp-erkannt-auf { visibility: hidden; }
.dropzone-list-remove {
    background: transparent;
    border: 0;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    line-height: 1;
}
.dropzone-list-remove:hover {
    background: rgba(192, 57, 43, 0.1);
    color: var(--danger);
}


/* ================= 12f. MODUL: STATISTIK ======================= */

/* Bar-Chart-Zelle in Tabellen (CSS-only) */
.st-bar-cell {
    width: 30%;
    min-width: 100px;
    vertical-align: middle;
}
.st-bar {
    height: 8px;
    background: var(--primary-light);
    border-radius: var(--radius-full);
    min-width: 4px;
    transition: width 200ms ease;
}
.st-bar--accent {
    background: var(--accent);
}

/* Trend-Pfeile (Preis-Trends) */
.st-trend-up {
    color: var(--danger);   /* steigende Preise = schlecht für Gastro */
}
.st-trend-down {
    color: var(--success);  /* fallende Preise = gut */
}


/* ================= TEST-MODUS-HINT (Bulk-KI) =================== */
.kalk-test-hint {
    margin-top: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: #E8F5E9;
    border-radius: var(--radius-md);
    border-left: 3px solid var(--success);
    color: var(--text-dark);
    font-size: 13px;
}
.kalk-test-hint strong { color: #1B5E20; }


/* ================= 12g. MODUL: ARTIKEL ========================= */

.art-toolbar {
    display: flex;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
    flex-wrap: wrap;
    align-items: center;
}
.art-toolbar #art-suche {
    flex: 1 1 280px;
    min-width: 200px;
}
.art-toolbar #art-quelle-filter,
.art-toolbar #art-sort {
    flex: 0 0 auto;
    width: auto;
    min-width: 180px;
}

/* Lieferant-Tiles: quadratische Kästchen oberhalb der Toolbar */
.art-lieferant-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}
.art-lieferant-tile {
    aspect-ratio: 1 / 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: var(--space-2);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-md);
    background: var(--bg-white);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, transform 0.1s;
    user-select: none;
}
.art-lieferant-tile:hover {
    border-color: var(--primary);
    background: #F5FAFF;
}
.art-lieferant-tile.is-active {
    border-color: var(--primary);
    background: var(--primary);
    color: var(--bg-white);
}
.art-lieferant-tile .tile-name {
    font-weight: 600;
    font-size: 13px;
    line-height: 1.2;
    word-break: break-word;
    max-width: 100%;
}
.art-lieferant-tile .tile-count {
    font-size: 11px;
    opacity: 0.75;
    margin-top: var(--space-1);
}
.art-lieferant-tile.is-active .tile-count {
    opacity: 0.95;
}

/* alpha.141 — Drag & Drop für Lieferanten-Merge */
.art-lieferant-tile.is-draggable {
    cursor: grab;
}
.art-lieferant-tile.is-draggable:active {
    cursor: grabbing;
}
.art-lieferant-tile.is-dragging {
    opacity: 0.4;
    transform: scale(0.97);
    cursor: grabbing;
}
.art-lieferant-tile.is-drop-target {
    border-color: var(--success, #2e7d32) !important;
    border-style: dashed !important;
    border-width: 3px !important;
    background: linear-gradient(135deg, rgba(76,175,80,0.18), rgba(76,175,80,0.08)) !important;
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(76,175,80,0.25);
}
.art-lieferant-tile.is-drop-target::after {
    content: "🔀 hier zusammenführen";
    position: absolute;
    bottom: -22px; left: 50%;
    transform: translateX(-50%);
    background: var(--success, #2e7d32);
    color: white;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.art-lieferant-tile { position: relative; }

/* Tag-Style für Aliase */
.art-tag {
    display: inline-block;
    padding: 2px 8px;
    margin: 2px 4px 2px 0;
    background: #E3F2FD;
    color: #0D47A1;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}
.art-tag--removable {
    padding-right: 4px;
}
.art-tag-remove {
    background: transparent;
    border: 0;
    color: #0D47A1;
    cursor: pointer;
    font-size: 11px;
    padding: 0 4px;
    margin-left: 2px;
    border-radius: 50%;
}
.art-tag-remove:hover {
    background: rgba(13, 71, 161, 0.15);
}

.art-tags-input {
    min-height: 36px;
    padding: var(--space-2);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: var(--bg-muted);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px;
}


/* ================= 13. UTILITIES =============================== */
.is-hidden { display: none !important; }
.is-flex { display: flex; }
.is-grid { display: grid; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }


/* ================= 14. ANIMATIONEN ============================= */
@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

@keyframes shake {
    10%, 90% { transform: translateX(-2px); }
    20%, 80% { transform: translateX(4px); }
    30%, 50%, 70% { transform: translateX(-8px); }
    40%, 60% { transform: translateX(8px); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(8px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes slideInRight {
    from { transform: translateX(110%); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}

@keyframes slideOutRight {
    from { transform: translateX(0); opacity: 1; }
    to   { transform: translateX(110%); opacity: 0; }
}


/* ================= 15. RESPONSIVE (Mobile) ===================== */
@media (max-width: 768px) {
    :root {
        --content-padding: 16px;
    }

    /* Header kompakt */
    .app-header {
        grid-template-columns: auto 1fr auto;
        padding: 0 var(--space-3);
    }
    /* app.221 — Betriebs-Umschalter am Handy PROMINENT ganz oben zeigen (statt ausblenden).
       Marken-Text + Status-Labels weichen, damit der Betriebs-Name Platz hat (Punkte bleiben). */
    .header-center { display: block; min-width: 0; }
    .header-brand { display: none; }
    .header-version { display: none; }
    .header-betrieb { font-size: 15px; }
    .betrieb-switcher-btn { padding: 7px 14px; font-weight: 700; max-width: 100%; }
    .betrieb-switcher-btn .bs-name { max-width: 46vw; }
    .header-right .drive-status-label { display: none; }

    /* Sidebar wird zur Bottom-Navigation */
    .app-shell {
        grid-template-areas:
            "header"
            "main"
            "sidebar";
        grid-template-rows: var(--header-h) 1fr auto;
        grid-template-columns: 1fr;
    }

    .app-sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        height: auto;
        border-right: 0;
        border-top: 1px solid var(--border-light);
        padding: var(--space-2) 0;
        z-index: var(--z-header);
        box-shadow: 0 -4px 12px rgba(44, 62, 80, 0.08);
    }
    .sidebar-nav { display: flex; justify-content: space-around; }
    .sidebar-list {
        display: flex;
        flex: 1;
        justify-content: space-around;
    }
    .sidebar-link {
        flex-direction: column;
        gap: 2px;
        padding: var(--space-2);
        border-left: 0;
        border-top: 3px solid transparent;
        font-size: 10px;
        text-align: center;
    }
    .sidebar-link.active {
        border-left-color: transparent;
        border-top-color: var(--accent);
    }
    .sidebar-label { font-size: 10px; }
    .sidebar-divider { display: none; }
    /* alpha.207 — Gruppen-Header auf Mobile ausblenden (Bottom-Navi-Layout) */
    .sidebar-group-header { display: none; }
    .sidebar-nav > .sidebar-list { margin-bottom: 0; }
    .sidebar-badge { display: none; }

    .app-main { padding-bottom: calc(var(--content-padding) + 80px); }
    .app-footer { display: none; }

    /* Tabellen werden zu Karten */
    .table thead { display: none; }
    .table tbody, .table tr, .table td { display: block; width: 100%; }
    .table tbody tr {
        margin-bottom: var(--space-3);
        background: var(--bg-white) !important;
        border-radius: var(--radius-md);
        padding: var(--space-3);
        box-shadow: var(--shadow-sm);
    }
    .table tbody td {
        border: 0;
        padding: var(--space-1) 0;
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: var(--space-3);
    }
    /* Nur Zellen mit data-label bekommen das "Label: "-Prefix */
    .table tbody td[data-label]::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-muted);
        margin-right: var(--space-2);
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: 0.04em;
    }
    /* Action-Cell (ohne data-label, rechtsbündig): Buttons rechts ausrichten */
    .table tbody td:not([data-label]) {
        justify-content: flex-end;
        padding-top: var(--space-2);
        border-top: 1px solid var(--border-light);
        margin-top: var(--space-2);
    }

    /* Modals nehmen mehr Platz */
    .modal { max-height: 95vh; }
    /* app.518 — die untere Tab-Leiste (z 1300) lag über jedem Dialog (z 1000); am iPhone mit Home-Balken
       verdeckte sie die Knöpfe „Abbrechen/Übernehmen". Solange ein Dialog offen ist, braucht man sie nicht. */
    body:has(#modalBackdrop:not([hidden])) .mobile-tabs { display: none; }

    /* Speisekarten-Modul: 2-Spalten-Form-Reihen einspaltig */
    .sk-form-grid { grid-template-columns: 1fr; gap: 0; }
    .sk-header { flex-direction: column; align-items: stretch; }
    .sk-actions { justify-content: stretch; }
    .sk-actions .btn { flex: 1; }

    /* Toasts schmaler */
    .toast-container { right: var(--space-3); left: var(--space-3); }
    .toast { min-width: 0; }
}

/* ===================================================================
   alpha.276 — PHONE-APP-ENTWURF: Bottom-Tab-Leiste + „Mehr"-Schublade
   Nur am Handy (≤768px). Desktop bleibt unverändert. Nutzt dieselbe App
   (= gekoppelt): die Tabs rufen activateModule(), „Mehr" zeigt die volle
   Sidebar als Slide-up.
   =================================================================== */
.mobile-tabs { display: none; }

@media (max-width: 768px) {
    .mobile-tabs {
        display: flex;
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 1300;
        background: var(--bg-white, #fff);
        border-top: 1px solid var(--border-light, #eee);
        box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
        padding: 4px 0 calc(4px + env(safe-area-inset-bottom, 0px));
    }
    .mobile-tab {
        flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
        background: none; border: 0; cursor: pointer; padding: 6px 2px;
        font-size: 10px; font-weight: 600; color: var(--text-muted, #888);
    }
    .mobile-tab .mt-ic { font-size: 22px; line-height: 1; }
    .mobile-tab.active { color: var(--primary, #2196F3); }
    .mobile-tab:active { transform: scale(0.94); }

    /* Die vorhandene Sidebar wird zur „Mehr"-Schublade (Slide-up von unten) */
    .app-sidebar {
        position: fixed; left: 0; right: 0; bottom: 0; top: auto;
        height: 76vh; max-height: 76vh; overflow-y: auto;
        transform: translateY(110%); transition: transform 0.28s ease;
        z-index: 1400; border-top: 0; border-radius: 18px 18px 0 0;
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.25); padding-bottom: 90px;
    }
    body.mobile-menu-open .app-sidebar { transform: translateY(0); }
    body.mobile-menu-open::after {
        content: ""; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.45); z-index: 1350;
    }
    /* Sidebar im Overlay = saubere vertikale Liste mit Gruppen */
    .app-sidebar .sidebar-nav,
    .app-sidebar .sidebar-list { display: block; }
    .app-sidebar .sidebar-link {
        flex-direction: row; justify-content: flex-start; gap: 12px;
        font-size: 15px; padding: 13px 20px; text-align: left;
        border-top: 0; border-left: 3px solid transparent;
    }
    .app-sidebar .sidebar-link.active { border-left-color: var(--accent); border-top-color: transparent; }
    .app-sidebar .sidebar-label { font-size: 15px; }
    .app-sidebar .sidebar-group-header { display: block; padding: 12px 20px 4px; }

    /* Platz für die Tab-Leiste unter dem Inhalt; Footer am Handy weg */
    .app-main { padding-bottom: 74px; }
    .app-footer { display: none; }
}

/* =====================================================================
   app.365 (15.10.2026) — iPhone: kein Auto-Zoom beim Tippen
   Safari auf iOS zoomt die GANZE Seite hinein, sobald ein Eingabefeld mit
   Schrift < 16 px den Fokus bekommt — und bleibt so („alles etwas zu groß",
   Dominic). Deshalb am Handy alle Felder auf 16 px; Darstellung sonst gleich.
   ===================================================================== */
html { -webkit-text-size-adjust: 100%; }
html, body { touch-action: manipulation; }   /* app.375 — kein Doppeltipp-Zoom am Handy (Tippen bleibt sofort) */
@media (max-width: 768px) {
    input, select, textarea, .form-input { font-size: 16px !important; }
}

/* =====================================================================
   app.366 (15.10.2026) — iPhone als installierte App: Kopfzeile NICHT unter der Statusleiste
   (apple-mobile-web-app-status-bar-style=black-translucent + viewport-fit=cover lassen die Seite
   bis unter Uhrzeit/Akku laufen — Dominics Screenshot). Kopf bekommt oben den sicheren Abstand,
   die Layout-Zeile wächst mit.
   ===================================================================== */
@supports (padding-top: env(safe-area-inset-top)) {
    :root { --header-h: calc(64px + env(safe-area-inset-top, 0px)); }
    .app-header { padding-top: env(safe-area-inset-top, 0px); }
}

/* app.367 (15.10.2026) — Kassa/Küche/Bar als installierte App am iPhone: Kopfzeile unter der Statusleiste */
@supports (padding-top: env(safe-area-inset-top)) {
    body .ka-top, body .ku-top { padding-top: calc(8px + env(safe-area-inset-top, 0px)); }
}
/* app.367 — Kasse am Handy: Ansichts-/Werkzeug-Chips und Tisch-Leiste stapelten sich 6–8 Reihen hoch, das Menü lag
   erst weit unten („passt nicht in den Bildschirm", Dominic). Jetzt EINE Reihe, seitlich wischbar — wie Tabs. */
@media (max-width: 680px) {
    .kasse-chips { flex-wrap: nowrap !important; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: 2px; }
    .kasse-chips::-webkit-scrollbar { display: none; }
    .kasse-chips > * { flex: 0 0 auto; white-space: nowrap; }
}
/* app.370 — Kassa/Küche/Bar-Kopfzeile am Handy: Links („⚙ Verwaltung") wurden rechts abgeschnitten → umbrechen statt kappen */
@media (max-width: 680px) {
    body .ka-top, body .ku-top { flex-wrap: wrap; row-gap: 6px; }
    body .ka-right, body .ku-right { flex-wrap: wrap; gap: 8px 10px; }
}


/* =====================================================================
   app.474 — Dashboard neu geordnet: ein Zeitraum, vier Kennzahlen, Handlungsbedarf, drei Reiter
   ===================================================================== */
.dash-head { flex-wrap: wrap; gap: 10px; align-items: center; }
.dash-zeit { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dash-seg-wrap { display: inline-flex; gap: 2px; background: var(--bg-muted, #F0F1F3); border-radius: 8px; padding: 2px; }
.dash-seg { border: 0; background: transparent; color: var(--text-muted); border-radius: 6px; padding: 4px 12px; font-size: 12px; font-weight: 600; cursor: pointer; }
.dash-seg.is-on { background: var(--accent); color: #fff; }
.dash-stepper { display: inline-flex; align-items: center; gap: 6px; }
.dash-zeit-label { min-width: 132px; text-align: center; font-size: 14px; }
.dash-step { border: 1px solid var(--border-light); background: var(--bg-white); color: var(--text-dark); border-radius: 6px; width: 30px; height: 30px; font-size: 16px; cursor: pointer; }
.dash-step:disabled { color: #ccc; cursor: default; }
.dash-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: var(--space-3); margin-bottom: var(--space-3); }
.dash-kpi { position: relative; background: var(--bg-white); border: 1px solid var(--border-light); border-left: 4px solid var(--kpi-color, var(--border-light)); border-radius: 12px; padding: 12px 14px; min-height: 86px; }
.dash-kpi.is-link { cursor: pointer; transition: box-shadow .15s, transform .15s; }
.dash-kpi.is-link:hover { box-shadow: 0 4px 12px rgba(44, 62, 80, .08); transform: translateY(-1px); }
.dash-kpi-head { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.dash-kpi-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.dash-kpi-value { font-size: 22px; font-weight: 700; line-height: 1.15; margin-top: 4px; font-variant-numeric: tabular-nums; }
.dash-kpi-sub { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.dash-badge { display: inline-block; font-size: 10px; font-weight: 600; color: var(--text-muted); background: var(--bg-muted); border-radius: 8px; padding: 1px 6px; vertical-align: middle; }
.dash-info { border: 0; background: transparent; color: var(--text-muted); cursor: pointer; font-size: 15px; line-height: 1; padding: 0 2px; }
.dash-info:hover { color: var(--accent); }
.dash-todo { background: var(--bg-white); border: 1px solid var(--border-light); border-left: 4px solid var(--warning); border-radius: 12px; padding: 10px 14px; margin-bottom: var(--space-3); }
.dash-todo.is-ok { border-left-color: var(--success); color: var(--success); font-size: 13px; }
.dash-todo-title { font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.dash-todo-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 7px 4px; border-bottom: 1px solid var(--border-light); cursor: pointer; font-size: 13px; }
.dash-todo-row:last-child { border-bottom: 0; }
.dash-todo-row:hover { background: var(--bg-muted); }
.dash-todo-go { font-size: 11px; color: var(--accent); font-weight: 600; white-space: nowrap; }
.dash-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: var(--space-3) 0; border-bottom: 2px solid var(--border-light); padding-bottom: var(--space-2); }
.dash-tab { border: 1px solid var(--border-light); background: var(--bg-white); border-radius: 999px; padding: 7px 14px; font-size: 13px; font-weight: 600; color: var(--text-dark); cursor: pointer; }
.dash-tab.is-on { background: var(--primary); color: #fff; border-color: var(--primary); }
.dash-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: var(--space-3); }
.dash-sek { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: var(--space-3); margin-top: var(--space-3); }
.dash-details { margin-top: var(--space-3); background: var(--bg-muted); border: 1px solid var(--border-light); border-radius: 12px; padding: var(--space-2) var(--space-3); }
.dash-details summary { cursor: pointer; font-weight: 600; font-size: 14px; padding: 4px 2px; }
@media (max-width: 600px) {
    .dash-kpis { grid-template-columns: 1fr 1fr; gap: 8px; }
    .dash-kpi { padding: 10px 12px; min-height: 78px; }
    .dash-kpi-value { font-size: 19px; }
    .dash-zeit-label { min-width: 110px; font-size: 13px; }
    .dash-tab { padding: 6px 10px; font-size: 12px; }
}


/* =====================================================================
   app.475 — Einstellungen: eine Struktur, zwei Eingänge (Reiter, Kasse-Gruppe mit Unterreitern, Einmal-Karten)
   ===================================================================== */
.es-tabs { margin-top: var(--space-2); }
.ks-tabs { margin: var(--space-2) 0 var(--space-3); }
.ks-tabs .dash-tab { font-size: 12px; padding: 5px 11px; }
.es-intro { font-size: 13px; margin: 0 0 var(--space-3); }
.es-intro-box { font-size: 13px; line-height: 1.5; background: var(--bg-muted); border-left: 4px solid var(--primary); border-radius: 8px; padding: 10px 14px; margin-bottom: var(--space-4); }
.es-2col { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); align-items: start; }
@media (max-width: 900px) { .es-2col { grid-template-columns: 1fr; } }
.es-einmal { margin-bottom: var(--space-4); }
.es-einmal > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; background: var(--bg-white); border: 1px solid var(--border-light); border-radius: 12px; }
.es-einmal > summary::-webkit-details-marker { display: none; }
.es-einmal > summary::before { content: "▸"; color: var(--text-muted); font-size: 13px; }
.es-einmal[open] > summary::before { content: "▾"; }
.es-einmal[open] > summary { border-radius: 12px 12px 0 0; border-bottom: 0; }
.es-einmal > .card { border-radius: 0 0 12px 12px; margin-bottom: 0 !important; }
.es-einmal > summary .sk-cat-title { font-size: 15px; }
.es-status { font-size: 11px; font-weight: 600; color: var(--text-muted); background: var(--bg-muted); border-radius: 8px; padding: 2px 8px; white-space: nowrap; }
.ks-status { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: var(--space-2); }
.ks-chip { border: 1px solid var(--border-light); background: var(--bg-white); color: var(--text-dark); border-radius: 999px; padding: 4px 10px; font-size: 12px; cursor: pointer; }
.ks-chip.is-ok { border-color: var(--success); color: var(--success); }
.ks-chip.is-warn { border-color: var(--warning); color: #9a6b00; }

/* ===================================================================
   app.481 — Dienstplan aufgeräumt: Kopf mit vier Knöpfen + „Mehr“, frühere
   Wochen zusammengeklappt, Vorschlag-Fenster als Tageskarten.
   =================================================================== */
.dp-aktionen .btn { white-space: nowrap; }
.dp-hinweis { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; margin-bottom: var(--space-3); font-size: 13px; }
.dp-badge { display: inline-block; font-size: 11px; font-weight: 700; border-radius: 10px; padding: 2px 8px; vertical-align: middle; }
.dp-badge--entwurf { background: #2980B9; color: #fff; }
.dp-badge--offen { background: rgba(39, 174, 96, 0.15); color: var(--success, #27AE60); }
.dp-badge--zu { background: rgba(127, 140, 141, 0.18); color: var(--text-muted, #7F8C8D); }
.dp-badge--teil { background: rgba(230, 126, 34, 0.15); color: var(--accent, #E67E22); font-weight: 600; }
.dp-frueher { padding: 0; overflow: hidden; }
.dp-frueher-kopf { width: 100%; text-align: left; border: 0; background: none; font: inherit; font-weight: 700; font-size: 14px; padding: 12px 14px; cursor: pointer; color: inherit; }
.dp-frueher-tabelle { font-size: 13px; }
.dp-frueher-tabelle tbody tr:hover { background: rgba(230, 126, 34, 0.06); }
.dp-details summary { cursor: pointer; font-weight: 600; margin-top: 6px; }
.dp-wp-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.dp-wp-legende { font-size: 12px; margin: 0 0 10px; }
.dp-wp-tage { display: grid; grid-template-columns: 1fr; gap: 8px; }
.dp-wp-tag { border: 1px solid var(--border-light, #e5e5e5); border-radius: 10px; padding: 10px 12px; background: var(--bg-white, #fff); }
.dp-wp-tag--zu { opacity: 0.6; }
.dp-wp-kopf { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.dp-wp-datum { font-size: 14px; min-width: 88px; }
.dp-wp-wetter { font-size: 13px; white-space: nowrap; }
.dp-wp-status { font-size: 13px; }
.dp-wp-aktionen { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; }
.dp-wp-body { display: grid; grid-template-columns: minmax(220px, 1.4fr) minmax(170px, 1fr) minmax(220px, 1.2fr); gap: 10px 18px; margin-top: 10px; }
.dp-wp-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted, #888); margin-bottom: 5px; font-weight: 600; }
.dp-wp-label .dp-badge { text-transform: none; letter-spacing: 0; margin-left: 4px; }
.dp-steps { display: flex; flex-wrap: wrap; gap: 6px 12px; }
.dp-step { display: inline-flex; align-items: center; gap: 3px; font-size: 13px; }
.dp-step input.wp-bes { width: 40px; text-align: center; padding: 3px 2px; font-size: 13px; -moz-appearance: textfield; }
.dp-step input.wp-bes::-webkit-outer-spin-button, .dp-step input.wp-bes::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.dp-step-btn { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--border-light, #ddd); background: var(--bg-white, #fff); cursor: pointer; font-size: 15px; line-height: 1; color: inherit; }
.dp-step-label { margin-left: 3px; white-space: nowrap; }
.dp-step--knapp input.wp-bes { border-color: var(--accent, #E67E22); }
.dp-zeitzeile { display: flex; align-items: center; gap: 4px; margin-top: 4px; flex-wrap: wrap; }
.dp-zeitzeile input[type=time] { width: 92px; padding: 3px 4px; font-size: 13px; }
.dp-zeitlabel { font-size: 12px; color: var(--text-muted, #888); min-width: 46px; }
.dp-quelle { font-size: 11px; margin-top: 3px; }
.dp-mehr { display: flex; flex-direction: column; gap: 6px; }
.dp-mehr-btn { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; text-align: left; border: 1px solid var(--border-light, #e5e5e5); background: var(--bg-white, #fff); border-radius: 10px; padding: 10px 12px; cursor: pointer; font: inherit; color: inherit; }
.dp-mehr-btn:hover { background: rgba(230, 126, 34, 0.06); }
.dp-mehr-btn small { font-size: 11px; }
@media (max-width: 680px) {
    .dp-wp-body { grid-template-columns: 1fr; }
    .dp-wp-aktionen { margin-left: 0; width: 100%; }
    .dp-hinweis { flex-direction: column; align-items: stretch; }
}

/* =====================================================================
   app.490 — Seitenleiste wie am iPhone: Dock oben, klappbare Gruppen mit Pfeil, „Alle Bereiche anzeigen"
   ===================================================================== */
.sidebar-group-header { cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sidebar-group-header:hover { color: var(--text); }
.sidebar-group-header .sg-chev { font-size: 15px; line-height: 1; color: var(--text-muted); transition: transform .2s ease; transform: rotate(90deg); }
.sidebar-group-header.sidebar-group--zu .sg-chev { transform: rotate(0deg); }
.sidebar-nav > .sidebar-list:first-of-type { padding-bottom: 6px; margin-bottom: 6px; border-bottom: 1px solid var(--border-light); }   /* Dock */
.sidebar-alle { display: block; width: calc(100% - 2 * var(--space-5)); margin: 10px var(--space-5) 6px; padding: 8px 10px; border: 1px dashed var(--border-light); border-radius: 10px; background: none; font: inherit; font-size: 12px; font-weight: 600; color: var(--text-muted); cursor: pointer; }
.sidebar-alle:hover { color: var(--text); border-color: var(--text-muted); }
@media (max-width: 768px) {
    .app-sidebar .sidebar-group-header { display: flex; }
    .app-sidebar .sidebar-alle { margin: 10px 20px 6px; width: calc(100% - 40px); font-size: 14px; padding: 12px; }
    .mobile-tab span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    /* Kopf am Handy: der Betriebsname braucht den Platz — die Suche steht unten in der Leiste, Logo und „wechseln" weichen */
    .app-header .header-logo, #gpSucheBtn, .betrieb-switcher-btn .bs-wechseln { display: none; }
}

/* =====================================================================
   app.491 — Bausteine aus js/ui_kit.js: Symbole, Lade-Platzhalter, leerer Zustand, Rückgängig, „Was ist das?"
   ===================================================================== */
.gp-ic { display: inline-block; vertical-align: -0.2em; flex: 0 0 auto; }
.gp-skel { padding: var(--space-4); }
.gp-skel-zeile { height: 14px; border-radius: 7px; margin: 10px 0; background: linear-gradient(90deg, var(--bg-muted) 25%, var(--border-light) 37%, var(--bg-muted) 63%); background-size: 400% 100%; animation: gp-skel 1.4s ease infinite; }
.gp-skel-zeile:first-child { margin-top: 0; }
.gp-skel-zeile:last-child { margin-bottom: 0; }
@keyframes gp-skel { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
@media (prefers-reduced-motion: reduce) { .gp-skel-zeile { animation: none; } }
.gp-leer { text-align: center; padding: var(--space-6) var(--space-4); }
.gp-leer-ic { color: var(--text-muted); line-height: 0; margin-bottom: var(--space-3); }
.gp-leer-titel { margin: 0 0 6px; font-size: 17px; }
.gp-leer-text { margin: 0 auto var(--space-4); max-width: 420px; font-size: 14px; color: var(--text-muted); }
#gp-undo { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 9400; width: min(460px, calc(100vw - 24px)); pointer-events: none; }
.gp-undo-box { pointer-events: auto; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: #1F2933; color: #fff; font-size: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); animation: gp-undo-rein .18s ease; }
.gp-undo-text { flex: 1; min-width: 0; }
.gp-undo-knopf { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 5px; border: 0; background: none; color: #F5B971; font: inherit; font-weight: 700; cursor: pointer; padding: 4px 2px; }
@keyframes gp-undo-rein { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (max-width: 768px) { #gp-undo { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); } }
.gp-was { border: 0; background: none; padding: 0 2px; margin-left: 6px; color: var(--accent); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.gp-was:hover { text-decoration: underline; }
#gp-was { position: fixed; inset: 0; z-index: 9600; background: rgba(0, 0, 0, .45); display: flex; align-items: center; justify-content: center; padding: 16px; }
.gp-was-karte { width: 100%; max-width: 400px; background: var(--bg-white); color: var(--text-dark); border-radius: 16px; padding: 18px; box-shadow: 0 18px 50px rgba(0, 0, 0, .35); }
.gp-was-kopf { display: flex; align-items: center; gap: 8px; color: var(--accent); }
.gp-was-kopf strong { color: var(--text-dark); font-size: 16px; }
.gp-was-karte p { margin: 10px 0 14px; font-size: 14px; line-height: 1.45; }
.gp-was-karte .btn { width: 100%; }

/* =====================================================================
   app.491 — Einstellungen wie am iPhone: Liste, Zeilen mit Titel + Satz + Regler, Schalter, Segmente
   ===================================================================== */
.es-liste.es-tabs { display: block; padding: 0; margin: var(--space-2) 0 var(--space-4); background: var(--bg-white); border: 1px solid var(--border-light); border-radius: 14px; overflow: hidden; }
.es-liste .es-zeile { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 0; border-top: 1px solid var(--border-light); border-radius: 0; background: none; color: var(--text-dark); text-align: left; }
.es-liste .es-zeile:first-child { border-top: 0; }
.es-liste .es-zeile.is-on { background: var(--bg-muted); color: var(--text-dark); border-color: var(--border-light); }
.es-zi { flex: 0 0 22px; color: var(--accent); line-height: 0; }
.es-zt { flex: 1; min-width: 0; }
.es-ztitel { display: block; font-size: 15px; font-weight: 600; }
.es-zerkl { display: block; font-size: 12px; font-weight: 400; line-height: 1.3; color: var(--text-muted); white-space: normal; }
.es-zp { color: var(--text-muted); line-height: 0; }
.es-zurueck { display: none; align-items: center; gap: 4px; border: 0; background: none; padding: 6px 0; margin-bottom: var(--space-2); color: var(--accent); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; }
@media (min-width: 900px) {
    #moduleEinstellungen.es-raster { display: grid; grid-template-columns: 280px minmax(0, 1fr); column-gap: var(--space-5); align-items: start; }
    #moduleEinstellungen.es-raster > .module-header { grid-column: 1 / -1; }
    #moduleEinstellungen.es-raster > .es-tabs { grid-column: 1; grid-row: 2 / span 12; position: sticky; top: var(--space-3); }
    #moduleEinstellungen.es-raster > .es-panel, #moduleEinstellungen.es-raster > :not(.module-header):not(.es-tabs):not(.es-zurueck) { grid-column: 2; }
    #moduleEinstellungen.es-raster > .es-panel { margin-top: var(--space-2); }
}
@media (max-width: 899px) {
    #moduleEinstellungen.es-raster:not(.es-detail) > .es-panel { display: none !important; }
    #moduleEinstellungen.es-raster.es-detail > .es-tabs { display: none; }
    #moduleEinstellungen.es-raster.es-detail > .es-zurueck { display: inline-flex; }
}
.ios-zeile { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-top: 1px solid var(--border-light); }
.ios-zeile:first-child, h4 + .ios-zeile { border-top: 0; }
.ios-text { flex: 1; min-width: 0; }
.ios-titel { font-size: 14px; font-weight: 600; color: var(--text-dark); }
.ios-erkl { font-size: 12px; line-height: 1.35; color: var(--text-muted); margin-top: 2px; }
.ios-ctl { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; font-size: 13px; white-space: nowrap; color: var(--text-dark); }
@media (max-width: 520px) { .ios-zeile:has(.ios-ctl input[type="number"], .ios-ctl select, .ios-seg) { flex-wrap: wrap; } .ios-zeile:has(.ios-ctl input[type="number"], .ios-ctl select, .ios-seg) .ios-text { flex-basis: 100%; } }
.ios-switch { -webkit-appearance: none; appearance: none; position: relative; flex: 0 0 auto; width: 46px; height: 28px; margin: 0; border-radius: 14px; background: var(--border); cursor: pointer; transition: background .2s ease; }
.ios-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .2s ease; }
.ios-switch:checked { background: var(--success); }
.ios-switch:checked::after { transform: translateX(18px); }
.ios-switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ios-seg { display: inline-flex; padding: 2px; border-radius: 10px; background: var(--bg-muted); border: 1px solid var(--border-light); }
.ios-seg button { border: 0; background: none; padding: 6px 12px; border-radius: 8px; font: inherit; font-size: 13px; font-weight: 600; color: var(--text-dark); cursor: pointer; }
.ios-seg button.is-on { background: var(--bg-white); box-shadow: 0 1px 3px rgba(0, 0, 0, .15); }

/* =====================================================================
   app.491 — Symbole in Leiste/Kopf, Schnellstart
   ===================================================================== */
.sidebar-icon svg { display: block; margin: 0 auto; color: var(--text-muted); }
.sidebar-link.active .sidebar-icon svg { color: var(--accent); }
.mobile-tab .mt-ic svg { display: block; }
.mobile-tab .mt-ic { line-height: 0; }
.sg-text { display: inline-flex; align-items: center; gap: 6px; }
.kn-ic .gp-ic { display: block; }
#gpSucheBtn .gp-ic, #gpHilfeBtn .gp-ic { color: #fff; }
#gp-start { position: fixed; inset: 0; z-index: 9700; background: var(--bg-light); display: flex; align-items: center; justify-content: center; padding: 16px; overflow-y: auto; }
.gps-karte { position: relative; display: flex; flex-direction: column; width: 100%; max-width: 480px; min-height: min(620px, calc(100vh - 32px)); background: var(--bg-white); color: var(--text-dark); border-radius: 20px; padding: 22px; box-shadow: var(--shadow-lg); }
.gps-fortschritt { height: 4px; border-radius: 2px; background: var(--border-light); overflow: hidden; margin-bottom: 14px; }
.gps-fortschritt span { display: block; height: 100%; background: var(--accent); transition: width .25s ease; }
.gps-zurueck { align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; padding: 2px 0; margin-bottom: 8px; color: var(--accent); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.gps-inhalt { flex: 1; }
.gps-inhalt h2 { margin: 6px 0 8px; font-size: 26px; line-height: 1.15; letter-spacing: -0.4px; }
.gps-ic { color: var(--accent); margin: 18px 0 6px; line-height: 0; }
.gps-ic.gps-ok { color: var(--success); }
.gps-text { margin: 0 0 16px; font-size: 15px; line-height: 1.45; color: var(--text-muted); }
.gps-hinweis { margin: 14px 0 0; font-size: 12px; line-height: 1.4; color: var(--text-muted); }
.gps-gross { font-size: 18px !important; padding: 13px 14px; width: 100%; }
.gps-fuss { display: flex; flex-direction: column; gap: 8px; align-items: stretch; margin-top: 18px; }
.gps-weiter { padding: 14px; font-size: 16px; font-weight: 700; border-radius: 13px; width: 100%; }
.gps-link { display: inline-flex; align-items: center; justify-content: center; gap: 4px; border: 0; background: none; padding: 7px; color: var(--accent); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.gps-leise { color: var(--text-muted); font-weight: 500; }
.gps-fehler { margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; background: rgba(192, 57, 43, .1); color: var(--danger); font-size: 14px; }
.gps-tage { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 16px; }
.gps-tag { height: 46px; border: 1px solid var(--border-light); border-radius: 12px; background: var(--bg-muted); color: var(--text-muted); font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; }
.gps-tag.an { background: var(--accent); border-color: var(--accent); color: #fff; }
.gps-zeit { display: flex; gap: 10px; }
.gps-zeit label { flex: 1; font-size: 13px; font-weight: 600; }
.gps-zeit input { width: 100%; margin-top: 4px; }
.gps-reihe { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; }
.gps-lbl { font-size: 15px; font-weight: 600; }
.gps-stepper { display: inline-flex; align-items: center; gap: 12px; }
.gps-stepper button { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--border-light); background: var(--bg-muted); color: var(--text-dark); font-size: 21px; line-height: 1; cursor: pointer; }
.gps-zahl { min-width: 34px; text-align: center; font-size: 21px; font-weight: 800; }
.gps-plan { display: grid; gap: 6px; margin-top: 14px; }
.gps-plan span { display: flex; align-items: center; justify-content: center; aspect-ratio: 1.5; border: 1px solid var(--border-light); border-radius: 8px; background: var(--bg-muted); font-size: 12px; font-weight: 700; color: var(--text-muted); }
.gps-zeilen { display: flex; flex-direction: column; gap: 8px; }
.gps-zeile { display: grid; grid-template-columns: minmax(0, 1fr) 68px 112px; gap: 6px; }
.gps-zeile .form-input { width: 100%; min-width: 0; padding: 10px; }
.gps-links { display: flex; justify-content: space-between; gap: 8px; margin-top: 6px; }
/* app.498 — Betriebsdaten im Schnellstart + kurze Tour am Schluss */
.gps-feld { margin-top: 10px; }
.gps-feld label { display: block; margin-bottom: 4px; font-size: 13px; font-weight: 600; }
.gps-feld .form-input, .gps-feld .form-select { width: 100%; min-width: 0; }
.gps-plzort { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 10px; }
.gps-zwei { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 420px) { .gps-zwei { grid-template-columns: 1fr; } }
.gps-tour { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; text-align: left; }
.gps-tour li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.4; color: var(--text-dark); }
.gps-tour-ic { flex: 0 0 auto; margin-top: 2px; line-height: 0; color: var(--accent); }

/* =====================================================================
   app.492 — Farben wie am iPhone: farbige Kacheln in Listen, farbige Symbole in Leisten (js/ui_kit.js: kachel, farbe)
   ===================================================================== */
.gp-kachel { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; color: #fff; vertical-align: middle; box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .10); }
.gp-kachel .gp-ic { display: block; vertical-align: 0; }
.sidebar-icon { width: 26px; }
.sidebar-icon .gp-kachel { margin: 0 auto; }
.sidebar-link.active .sidebar-icon .gp-kachel { box-shadow: 0 0 0 2px var(--bg-white), 0 0 0 3.5px var(--accent); }
.es-zi { flex-basis: 30px; }
.gp-leer-ic .gp-kachel { margin: 0 auto; }
.gs-ic .gp-kachel { margin-right: 2px; }
.mobile-tab .mt-ic { padding: 3px 11px; border-radius: 12px; transition: background-color .15s ease; }
.mobile-tab.active .mt-ic { background: color-mix(in srgb, var(--gp-f, var(--accent, #E67E22)) 16%, transparent); }
.mobile-tab.active { color: var(--gp-f, var(--accent, #E67E22)); }
.kasse-chip--active .kn-ic .gp-ic { color: inherit !important; }

/* =====================================================================
   app.492 — Verträge (modules/vertraege.js): Annahme-Bildschirm, Vertragstexte im Modal
   ===================================================================== */
#gp-vertrag { position: fixed; inset: 0; z-index: 9650; background: var(--bg-light); display: flex; align-items: flex-start; justify-content: center; padding: 16px; overflow-y: auto; }
.gpv-karte { width: 100%; max-width: 660px; margin: auto; background: var(--bg-white); color: var(--text-dark); border-radius: 20px; padding: 22px; box-shadow: var(--shadow-lg); }
.gpv-kopf { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.gpv-kopf h2 { margin: 0 0 4px; font-size: 24px; line-height: 1.15; }
.gpv-sub { margin: 0; color: var(--text-muted); font-size: 14px; }
.gpv-hinweis { border: 1px solid var(--warning); background: var(--warning-bg, #fff8e1); border-radius: 10px; padding: 10px 12px; font-size: 12.5px; line-height: 1.45; margin: 0 0 12px; }
.gpv-doc { border: 1px solid var(--border-light); border-radius: 12px; margin-bottom: 10px; background: var(--bg-white); }
.gpv-doc summary { cursor: pointer; padding: 12px 14px; font-weight: 600; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 8px; align-items: center; list-style: none; }
.gpv-doc summary::-webkit-details-marker { display: none; }
.gpv-doc summary small { color: var(--text-muted); font-weight: 500; }
.gpv-scroll { max-height: 42vh; overflow-y: auto; padding: 0 14px 12px; border-top: 1px solid var(--border-light); }
.gpv-text { font-size: 13.5px; line-height: 1.55; }
.gpv-text h3 { margin: 14px 0 4px; font-size: 14.5px; }
.gpv-text h4 { margin: 18px 0 6px; font-size: 14px; }
.gpv-text p { margin: 4px 0; }
.gpv-text ul { margin: 4px 0; padding-left: 18px; }
.gpv-text li { margin: 3px 0; }
.gpv-meta { color: var(--text-muted); font-size: 12px; margin: 10px 0 6px !important; }
.gpv-klein { font-size: 12px; color: var(--text-muted); }
.gpv-fehlt { color: var(--danger); font-weight: 600; }
.gpv-parteien, .gpv-tab { width: 100%; border-collapse: collapse; font-size: 12.5px; margin: 6px 0 8px; }
.gpv-parteien th, .gpv-tab th { text-align: left; font-weight: 600; color: var(--text-muted); padding: 4px 6px; border-bottom: 1px solid var(--border-light); }
.gpv-parteien td, .gpv-tab td { vertical-align: top; padding: 6px; border-bottom: 1px solid var(--border-light); }
.gpv-check { display: flex; gap: 10px; align-items: flex-start; padding: 10px 2px; font-size: 14px; line-height: 1.4; cursor: pointer; }
.gpv-check input { width: 20px; height: 20px; margin: 1px 0 0; flex: 0 0 auto; }
.gpv-fehler { margin: 8px 0; padding: 10px 12px; border-radius: 10px; background: var(--danger-bg, rgba(192, 57, 43, .1)); color: var(--danger); font-size: 14px; }
.gpv-weiter { width: 100%; padding: 14px; font-size: 16px; font-weight: 700; border-radius: 13px; margin-top: 6px; }
.gpv-fuss { margin: 12px 0 0; text-align: center; font-size: 12.5px; color: var(--text-muted); }
.gpv-link { border: 0; background: none; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; padding: 0; }
.gpv-stand { display: flex; align-items: center; gap: 8px; margin: 4px 0; font-size: 13px; color: var(--text-dark); }
@media (max-width: 520px) { .gpv-karte { padding: 16px; border-radius: 16px; } .gpv-scroll { max-height: 36vh; } .gpv-parteien tr, .gpv-parteien th, .gpv-parteien td { display: block; } .gpv-parteien th:last-child { margin-top: 6px; } }
.gp-em { display: inline-block; line-height: 0; vertical-align: -0.18em; }
.gp-em .gp-ic { width: 1.1em; height: 1.1em; vertical-align: 0; }
.btn-primary .gp-em .gp-ic, .btn-success .gp-em .gp-ic, .btn-danger .gp-em .gp-ic, .btn-warning .gp-em .gp-ic, .dash-tab.is-on .gp-em .gp-ic, .kasse-chip--active .gp-em .gp-ic, .h-schritt .gp-em .gp-ic { color: inherit !important; }
/* app.492 — Emojis wie am Anfang: Einstellungen-Liste zeigt das Emoji des Bereichs */
.es-zi.es-emoji { font-size: 20px; line-height: 1; color: inherit; text-align: center; }

/* app.505 — „Falsch erkannt?" im Eingangskorb und im Beleg-Dialog: zugeklappt nur ein kleiner Hinweis,
   die Typ-Wahl erscheint erst nach dem Antippen (Dominic: das Feld „Speisekarte" auf jeder Zeile störte). */
.eg-umtyp { font-size: 12px; flex-shrink: 0; }
.eg-umtyp > summary { cursor: pointer; color: var(--text-muted); list-style: none; text-decoration: underline dotted; white-space: nowrap; }
.eg-umtyp > summary::-webkit-details-marker { display: none; }
.eg-umtyp[open] > summary { color: var(--text-dark); }
.eg-umtyp-wahl { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; justify-content: flex-end; margin-top: 4px; }

/* app.520 — Eingangskorb am Handy: Knöpfe in eine eigene Zeile, damit Dateiname und Fehlertext Platz haben */
@media (max-width: 560px) {
    .eg-karte { flex-wrap: wrap; }
    .eg-karte .eg-karte-text { flex: 1 1 calc(100% - 40px); }
    .eg-karte .eg-karte-knoepfe { width: 100%; }
}

/* app.527 (QA-Bericht N11) — am Handy lag die Cloud-Pille („⚠️ Nicht in der Cloud“) über Inhalten: dort nur noch als kleines
   Symbol (Tippen zeigt weiter alles), und unter dem Inhalt ist so viel Platz, dass nichts dahinter verschwindet. */
@media (max-width: 768px) {
    #gp-sync-btn { white-space: nowrap; padding: 9px 12px !important; font-size: 14px !important; opacity: .94; }
    .app-main { padding-bottom: 150px !important; }
}

/* =====================================================================
   app.528 (Artikel-Fenster GU) — Artikel bearbeiten wie am iPhone: Kopf mit kurzem Namen, Preis-Kacheln, die Packung als EIN Satz
   mit Feldern, Hinweis-Zeile (gelb mit Ein-Tipp-Korrektur / grün „Passt zum Namen"), Umschalter, Seltenes als Zeilen mit „›".
   Nur Variablen der App — der Dunkelmodus (css/dunkel.css) kommt darüber mit. Tippflächen ≥ 44 px, Handy einspaltig.
   ===================================================================== */
.art-ios { display: flex; flex-direction: column; gap: 14px; }
.art-ios [hidden] { display: none !important; }
.art-ios-kopf { min-width: 0; }
.art-ios-titel { font-size: 22px; font-weight: 700; line-height: 1.2; letter-spacing: -0.2px; color: var(--text-dark); overflow-wrap: anywhere; }
.art-ios-unter { margin-top: 3px; font-size: 13px; line-height: 1.35; color: var(--text-muted); overflow-wrap: anywhere; }
.art-ios-kacheln { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.art-ios-kachel { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 10px 12px; border-radius: 12px; background: var(--bg-muted); border: 1px solid var(--border-light); }
.art-ios-kachel-l { font-size: 12px; color: var(--text-muted); }
.art-ios-kachel-w { font-size: 19px; font-weight: 700; color: var(--text-dark); white-space: nowrap; font-variant-numeric: tabular-nums; }
.art-ios-kachel--leer .art-ios-kachel-w { font-size: 15px; font-weight: 600; color: var(--text-muted); }
.art-ios-fuss { font-size: 12px; line-height: 1.4; color: var(--text-muted); margin: 0; }
.art-ios-fuss:empty { display: none; }
.art-ios-fuss p { margin: 0; }
.art-ios-karte { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: 14px; background: var(--bg-white); border: 1px solid var(--border-light); }
.art-ios-satz { font-size: 16px; line-height: 1.5; color: var(--text-dark); }
.art-ios-satz > span, .art-ios-satz > select, .art-ios-satz span > span { vertical-align: middle; }
.art-ios-feld.form-input, .art-ios-feld.form-select { display: inline-block; width: auto; max-width: 100%; min-height: 44px; margin: 3px 2px; padding: 8px 10px; font-size: 16px; vertical-align: middle; border-radius: 10px; }
.art-ios-zahl.form-input { width: 5.2em; text-align: right; }
.art-ios-ki-zeile, .art-ios-knopfzeile { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.art-ios-link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 2px; border: 0; background: none; color: var(--accent); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.art-ios-link:hover { text-decoration: underline; }
.art-ios-link:disabled { opacity: .55; cursor: default; }
.art-ios-link.is-loading { opacity: .55; pointer-events: none; }
.art-ios-link-inline { color: var(--accent); text-decoration: underline; }
.art-ios-knopf.btn { min-height: 44px; padding: 8px 14px; font-size: 14px; border-radius: 10px; white-space: normal; text-align: center; }   /* lange Knopftexte brechen am Handy um */
.art-ios-hinweis { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 12px; border-radius: 12px; font-size: 14px; line-height: 1.4; color: var(--text-dark); background: var(--bg-muted); border: 1px solid var(--border-light); }
.art-ios-hinweis-text { flex: 1 1 200px; min-width: 0; }
.art-ios-hinweis--warn { background: var(--warning-bg, #FFF8E1); border-color: var(--warning); }
.art-ios-hinweis--ok { background: var(--success-bg, rgba(39, 174, 96, .10)); border-color: var(--success); }
.art-ios-hinweis--leise { color: var(--text-muted); }
.art-ios-frage { padding: 10px 12px; border-radius: 12px; background: var(--warning-bg, #FFF8E1); border: 1px solid var(--warning); font-size: 14px; color: var(--text-dark); }
.art-ios-frage p { margin: 0 0 6px; }
.art-ios-reihe { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; min-height: 44px; }
.art-ios-label { font-size: 15px; font-weight: 600; color: var(--text-dark); }
.art-ios-erkl { font-size: 12px; line-height: 1.4; color: var(--text-muted); margin: -2px 0 2px; }
.art-ios-seg.ios-seg { flex-wrap: nowrap; background: var(--bg-light); }   /* app.528 Fix FENSTER (G2-22): Spur hebt sich von der Karte ab */
.art-ios-seg.ios-seg button { min-height: 44px; padding: 8px 14px; font-size: 14px; white-space: nowrap; }   /* G2-21: 44 px überall */
.art-ios-seg.ios-seg button:not(.is-on) { color: var(--text-muted); font-weight: 500; }   /* G2-22: gewählte Seite klar erkennbar */
.art-ios-seg.ios-seg button.is-on { color: var(--text-dark); font-weight: 600; }
.art-ios-seg.ios-seg button:disabled { opacity: .45; cursor: default; }
.art-ios-schalter .art-ios-reihe + .art-ios-erkl + .art-ios-reihe, .art-ios-schalter .art-ios-erkl + .art-ios-reihe { border-top: 1px solid var(--border-light); padding-top: 8px; }
.art-ios-liste { border: 1px solid var(--border-light); border-radius: 14px; background: var(--bg-white); overflow: hidden; }
.art-ios-zeile { border-top: 1px solid var(--border-light); }
.art-ios-liste > .art-ios-zeile:first-child { border-top: 0; }
.art-ios-zeile > summary { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 14px; cursor: pointer; list-style: none; color: var(--text-dark); }
.art-ios-zeile > summary::-webkit-details-marker { display: none; }
.art-ios-zeile > summary::after { content: "›"; flex: 0 0 auto; font-size: 22px; line-height: 1; color: var(--text-muted); transition: transform var(--transition-fast); }
.art-ios-zeile[open] > summary::after { transform: rotate(90deg); }
.art-ios-zeile > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.art-ios-zt { flex: 1 1 auto; font-size: 15px; font-weight: 600; }
.art-ios-zw { flex: 0 1 auto; min-width: 0; max-width: 55%; font-size: 14px; color: var(--text-muted); text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.art-ios-zw--offen { color: var(--accent); }
.art-ios-zinhalt { display: flex; flex-direction: column; gap: 8px; padding: 2px 14px 14px; }
.art-ios-flabel { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; color: var(--text-dark); }
.art-ios-flabel .art-ios-feld.form-input { width: 100%; margin: 0; }
.art-ios-drei { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.art-ios-namezeile, .art-ios-preiszeile { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.art-ios-namezeile .form-input { flex: 1 1 200px; min-width: 0; min-height: 44px; }
.art-ios-preiszeile .art-ios-feld { margin: 0; }
.art-ios-check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 14px; cursor: pointer; }
.art-ios-check input { width: 20px; height: 20px; flex: 0 0 auto; }
.art-ios-allergene { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 0 12px; }
.art-ios-allergen { display: flex; align-items: center; gap: 8px; min-height: 36px; font-size: 13px; cursor: pointer; }
.art-ios-allergen input { width: 18px; height: 18px; flex: 0 0 auto; }
.art-ios .art-tag { white-space: normal; overflow-wrap: anywhere; font-size: 13px; padding: 4px 4px 4px 10px; }   /* weitere Namen: lange Namen umbrechen */
.art-ios .art-tag-remove { min-width: 32px; min-height: 32px; font-size: 14px; }
@media (max-width: 520px) {
    .art-ios-allergen { min-height: 44px; }
    .art-ios-seg.ios-seg button { min-height: 44px; }
    body:has(#modalBody > .art-ios) .modal-backdrop { padding: 10px; }   /* Bearbeiten + Neu anlegen: mehr Platz am Handy */
    .modal-body:has(> .art-ios) { padding: 14px; }
    .art-ios-kacheln { grid-template-columns: 1fr; gap: 0; border: 1px solid var(--border-light); border-radius: 12px; overflow: hidden; }
    .art-ios-kachel { flex-direction: row; align-items: center; justify-content: space-between; border: 0; border-radius: 0; border-top: 1px solid var(--border-light); min-height: 44px; }
    .art-ios-kachel:first-child { border-top: 0; }
    .art-ios-kachel-l { font-size: 14px; }
    .art-ios-reihe .art-ios-seg.ios-seg { width: 100%; }
    .art-ios-reihe .art-ios-seg.ios-seg button { flex: 1 1 0; }
    .art-ios-reihe > select.art-ios-feld { width: 100%; margin: 0; }
    .art-ios-zw { max-width: 48%; }
}
/* app.528 Fix FENSTER (G2-21) — Tippflächen 44 px: Eingabefelder in beiden Artikel-Fenstern überall; auf Touch-Geräten jeder Breite (auch iPad)
   zusätzlich Allergen-Zeilen, ✕ bei weiteren Namen, ✏️/🗑 im Preisverlauf und 🗑 bei den Zutaten des Mini-Rezepts */
.art-ios .form-input, .art-ios .form-select { min-height: 44px; }
#art-manuell-preis.art-ios-zahl, #art-neu-preis.art-ios-zahl { width: 7em; }   /* G2-8: Platzhalter „z. B. 4,50“ ganz lesbar */
@media (pointer: coarse) {
    .art-ios-allergen { min-height: 44px; }
    .art-ios .art-tag-remove { min-width: 44px; min-height: 44px; margin: -6px -4px -6px 0; }
    #art-preis-historie-table .btn-small, .art-ios .vp-z-del { min-width: 44px; min-height: 44px; }
}
/* app.528 Fix FENSTER (L-2) — Lieferanten-Kachel „gewählt" im Dunkelmodus: --primary ist dort hell (für Schrift), als Fläche unlesbar.
   Hell bleibt alles wie bisher (--primary-bg und --text gibt es nur im Dunkelmodus → Rückfallwerte = bisherige Farben). */
.art-lieferant-tile.is-active { background: var(--primary-bg, var(--primary)); color: var(--text, var(--bg-white)); border-color: var(--primary); }
