/*
 * Der Hausstil der evendia-Verwaltungen.
 *
 * Dieselben Groessen, Farben und Namen wie in evendia-showtimes und
 * bondruck - wer dort etwas aendert, sollte hier nachsehen. Dort steht
 * das Stylesheet im gulp-Build; hier liegt es als Datei, weil der
 * Lizenzmanager noch keinen Build hat.
 */

:root {
    /* Damit Kalender, Zahlenfelder und Bildlaufleisten des Browsers
       dunkel kommen statt weiss ins dunkle Formular zu leuchten. */
    color-scheme: dark;

    --bg-deep:     #0f1117;
    --bg-base:     #1a1d27;
    --bg-elevated: #1e2235;
    --bg-hover:    #242840;
    --surface:     rgba(255, 255, 255, 0.04);
    --glass-border: rgba(255, 255, 255, 0.08);
    --accent:      #ac243a;
    --accent-glow: rgba(172, 36, 58, 0.25);
    --accent-hover: #c4354e;
    --success:     #22c55e;
    --danger:      #ef4444;
    --warning:     #f59e0b;
    --text-primary: #f1f5f9;
    /* Beschriftungen und Hinweise: hell genug fuer 4,5:1 auf jeder
       Flaeche bis gehobener Schiefer, und doch eine Stufe unter subtle. */
    --text-muted:  #808ca0;
    --text-subtle: #94a3b8;
    /* Leiste und Kopf dunkler als die Seite, wie in evendia.net: Die
       Navigation tritt zurueck, der Inhalt liegt heller davor. */
    --bg-sidebar:  #0a0c16;
    --bg-topbar:   rgba(12, 14, 24, 0.95);
    --sidebar-text: rgba(255, 255, 255, 0.65);
    --sidebar-line: rgba(255, 255, 255, 0.06);
    --sidebar-w:   240px;
    --bottombar-h: 60px;
    --radius:      12px;
    --radius-sm:   8px;

    /* Die eingebauten Kurven sind zu weich: ease-out springt mit der
       eigenen Kurve sofort an, die Schublade folgt der von iOS. */
    --ease-out:    cubic-bezier(0.23, 1, 0.32, 1);
    --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
}

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

body {
    font-family: 'Inter', system-ui, sans-serif;
    background-color: var(--bg-deep);
    color: var(--text-primary);
    min-height: 100vh;
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-hover); text-decoration: none; }
a:hover { color: #e0607a; }

/* Wer mit der Tastatur arbeitet, sieht, wo er steht - im Rot des Hauses
   statt im Blau des Browsers. Felder bringen ihren eigenen Lichthof mit. */
:focus-visible { outline: 2px solid var(--accent-hover); outline-offset: 2px; }
::selection { background: rgba(196, 53, 78, 0.45); color: #fff; }

/* ── Sidebar ── */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--sidebar-line);
    display: flex;
    flex-direction: column;
    z-index: 100;
    overflow-y: auto;
    /* Rollen ja, Balken nein: Ein fester Rollbalken stand als heller
       Streifen zwischen Leiste und Inhalt. */
    scrollbar-width: none;
}
.sidebar::-webkit-scrollbar { display: none; }

.sidebar-brand {
    padding: 20px 20px 16px;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid var(--sidebar-line);
}
.sidebar-brand-img { height: 28px; max-width: 160px; object-fit: contain; display: block; margin-bottom: 4px; }
.sidebar-brand-sub { font-size: 11px; color: var(--text-muted); font-weight: 400; margin-top: 1px; }

.sidebar-nav {
    padding: 10px 10px 12px;
    flex: 1;
}

.sidebar-section-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 10px 10px 3px;
}
.sidebar-section-label:first-child { padding-top: 4px; }

.nav-item-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 13px;
    font-weight: 400;
    transition: background-color 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
    margin-bottom: 1px;
}
.nav-item-link i { font-size: 14px; flex-shrink: 0; }
.nav-item-link:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
/* Aktiv: weisse Schrift auf dem roten Schimmer, das Rot nur im Symbol -
   rote Schrift auf fast schwarzem Grund liest sich schlecht. */
.nav-item-link.active {
    background: var(--accent-glow);
    color: #fff;
    font-weight: 500;
}
.nav-item-link.active i { color: #e0566d; }
.nav-item-link.active:hover { background: rgba(172, 36, 58, 0.32); }

.sidebar-footer { padding: 12px 10px; border-top: 1px solid var(--sidebar-line); background: rgba(0, 0, 0, 0.2); }
/* Selten gebraucht: E-Mails und Einstellungen als Symbole neben Abmelden */
.sidebar-tools { display: flex; align-items: center; gap: 4px; }
.sidebar-tool {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 9px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid transparent;
}
.sidebar-tool i { font-size: 15px; }
.sidebar-tool:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.sidebar-tool.active { background: var(--accent-glow); color: #fff; }
/* Ein Lauf ist ausgeblieben - das Wort steht im title des Zahnrads */
.sidebar-tool { position: relative; }
.tool-punkt {
    position: absolute; top: 4px; right: 4px;
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--danger); box-shadow: 0 0 0 2px var(--bg-sidebar);
}
.sidebar-tool.is-logout { margin-left: auto; color: var(--danger); }
.sidebar-tool.is-logout:hover { background: rgba(239, 68, 68, 0.1); color: #fca5a5; }
.sidebar-user {
    padding: 0 10px 8px;
    font-size: 12px;
    color: var(--text-muted);
    overflow-wrap: anywhere;
}

/* ── Hauptbereich ── */
.main-content {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    background: var(--bg-topbar);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    padding: 14px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}
.topbar-title { font-size: 16px; font-weight: 600; color: var(--text-primary); }
.topbar-sub { font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.topbar-actions { display: flex; gap: 8px; align-items: center; }

.page-body { padding: 24px 28px; flex: 1; }

/* ── Karten ── */
.card-glass {
    background: var(--surface);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    backdrop-filter: blur(8px);
}
.card-glass .card-header {
    background: transparent;
    border-bottom: 1px solid var(--glass-border);
    padding: 14px 20px;
    font-weight: 600;
    font-size: 13.5px;
}
.card-glass .card-body { padding: 20px; }
.card-glass .card-footer {
    background: transparent;
    border-top: 1px solid var(--glass-border);
    padding: 12px 20px;
}

/* ── Tabellen ──
 *
 * Mit und ohne Klasse: Die Ansichten der Verwaltung sind noch gebackene
 * Ausgabe mit nackten <table>. Bis sie ersetzt sind, sehen sie hier
 * trotzdem nach etwas aus.
 */
.page-body table,
.table-dark-custom {
    width: 100%;
    border-collapse: collapse;
    color: var(--text-primary);
    font-size: 13.5px;
}
.page-body thead th,
.table-dark-custom thead th {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    text-align: left;
    border-bottom: 1px solid var(--glass-border);
    padding: 10px 16px;
    white-space: nowrap;
}
.page-body thead th a { color: var(--text-muted); }
.page-body tbody tr,
.table-dark-custom tbody tr { border-bottom: 1px solid var(--glass-border); transition: background 0.1s; }
.page-body tbody tr:hover,
.table-dark-custom tbody tr:hover { background: var(--surface); }
.page-body tbody td,
.table-dark-custom tbody td {
    padding: 12px 16px;
    vertical-align: middle;
    border-color: var(--glass-border);
}
.table-responsive { overflow-x: auto; }

/* ── Schalter ── */
.btn-accent,
.page-body button:not([class]),
.page-body input[type="submit"]:not([class]) {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    padding: 7px 16px;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.16s var(--ease-out);
    font-family: inherit;
}
.btn-accent:hover,
.page-body button:not([class]):hover,
.page-body input[type="submit"]:not([class]):hover {
    background: var(--accent-hover);
    color: #fff;
    box-shadow: 0 0 16px var(--accent-glow);
}

.btn-ghost,
.page-body a.button {
    background: transparent;
    color: var(--text-subtle);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    padding: 7px 14px;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.16s var(--ease-out);
    display: inline-block;
    text-decoration: none;
}
.btn-ghost:hover,
.page-body a.button:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.15);
}

.btn-danger-soft {
    background: rgba(239, 68, 68, 0.12);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-sm);
    font-size: 12px;
    padding: 5px 10px;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.16s var(--ease-out);
}
.btn-danger-soft:hover { background: rgba(239, 68, 68, 0.22); border-color: var(--danger); }

/* Ein Knopf, der gerade nichts tun kann, sieht auch so aus - und
   leuchtet beim Darueberfahren nicht auf. */
.btn-accent:disabled,
.btn-ghost:disabled,
.btn-danger-soft:disabled,
.btn-success-soft:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
}
.btn-accent:disabled:hover { background: var(--accent); }
.btn-ghost:disabled:hover { background: transparent; color: var(--text-subtle); border-color: var(--glass-border); }

.btn-success-soft {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-radius: var(--radius-sm);
    font-size: 12px;
    padding: 5px 10px;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.16s var(--ease-out);
}
.btn-success-soft:hover { background: rgba(34, 197, 94, 0.2); }

/* Ein Knopf gibt beim Druecken nach - sonst fehlt die Rueckmeldung,
   dass der Klick angekommen ist. Deaktivierte bleiben stehen. */
.btn-accent:active:not(:disabled),
.btn-ghost:active,
.btn-danger-soft:active:not(:disabled),
.btn-success-soft:active:not(:disabled),
.btn-login:active:not(:disabled),
.icon-btn:active,
.page-body button:not([class]):active:not(:disabled),
.page-body input[type="submit"]:not([class]):active:not(:disabled),
.page-body a.button:active { transform: scale(0.97); }

/* ── Formulare ── */
.form-control-dark,
.form-select-dark,
.page-body input[type="text"],
.page-body input[type="email"],
.page-body input[type="password"],
.page-body input[type="number"],
.page-body input[type="date"],
.page-body select,
.page-body textarea {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13.5px;
    padding: 9px 12px;
    width: 100%;
    transition: border-color 0.15s, box-shadow 0.15s;
    font-family: 'Inter', sans-serif;
}
.form-control-dark::placeholder { color: var(--text-muted); }
.form-control-dark:focus,
.form-select-dark:focus,
.page-body input:focus,
.page-body select:focus,
.page-body textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
    background: rgba(255, 255, 255, 0.07);
}
.form-select-dark option,
.page-body select option { background: var(--bg-base); }

.form-label-dark,
.page-body label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    display: block;
}

.page-body fieldset { border: 0; padding: 0; margin: 0 0 20px; }
.page-body legend { font-size: 15px; font-weight: 600; margin-bottom: 12px; padding: 0; }
.page-body .input { margin-bottom: 16px; }
.page-body h3, .page-body h4 { font-weight: 600; letter-spacing: -0.2px; }

textarea.form-control-dark { resize: vertical; min-height: 100px; }

/* Der Knopf im Dateifeld kommt sonst hellgrau aus dem Browser - mitten
   im dunklen Formular. Er bekommt die Form des Geisterknopfs. */
input[type="file"]::file-selector-button {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    font: 500 13px 'Inter', system-ui, sans-serif;
    padding: 5px 12px;
    margin-right: 10px;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s;
}
input[type="file"]::file-selector-button:hover { background: var(--bg-hover); border-color: rgba(255, 255, 255, 0.15); }

/* ── Abzeichen ── */
.badge-ok, .badge-flag {
    background: rgba(34, 197, 94, 0.12);
    color: #86efac;
    border: 1px solid rgba(34, 197, 94, 0.2);
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 99px;
    font-weight: 600;
}
.badge-warn, .badge-mandant {
    background: rgba(245, 158, 11, 0.1);
    color: #fcd34d;
    border: 1px solid rgba(245, 158, 11, 0.2);
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 99px;
    font-weight: 600;
}
.badge-off, .badge-source {
    background: rgba(172, 36, 58, 0.12);
    color: #f8a4af;
    border: 1px solid rgba(172, 36, 58, 0.25);
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 99px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* ── Meldungen ── */
.message, .flash-success, .flash-error, .flash-warning {
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-size: 13.5px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.message, .flash-success, .success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.25);
    color: #86efac;
}
.flash-error, .message.error, .error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #fca5a5;
}
.flash-warning, .message.warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.25);
    color: #fcd34d;
}
.error-message { color: #fca5a5; font-size: 12px; margin-top: 4px; }

/* ── Blaettern ── */
.paginator ul, .pagination-dark {
    display: flex;
    gap: 4px;
    margin-top: 16px;
    list-style: none;
    padding: 0;
    margin-left: 0;
}
.paginator a, .paginator .current,
.pagination-dark a, .pagination-dark span {
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-subtle);
    border: 1px solid var(--glass-border);
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.paginator a:hover, .pagination-dark a:hover { background: var(--bg-hover); color: var(--text-primary); }
.paginator .current, .pagination-dark .current {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* ── Kennzahlen ── */
.stat-card {
    background: var(--surface);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 18px 20px;
}
.stat-label { font-size: 11px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-value { font-size: 26px; font-weight: 700; margin-top: 4px; color: var(--text-primary); }

/* ── Anmeldung ── */
body.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.login-wrap { width: 100%; max-width: 380px; }
.login-logo { text-align: center; margin-bottom: 24px; }
.login-logo-img { height: 32px; max-width: 200px; object-fit: contain; }
.login-logo p { font-size: 12px; color: var(--text-muted); margin: 8px 0 0; }
.login-card {
    background: var(--surface);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 28px;
    backdrop-filter: blur(8px);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
}
.login-group { margin-bottom: 18px; }
.login-input-wrap { position: relative; }
.login-input-wrap .input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
    pointer-events: none;
}
.login-input-wrap .form-control-dark { padding-left: 36px; }
.btn-login {
    width: 100%;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    padding: 11px 16px;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.16s var(--ease-out);
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.btn-login:hover { background: var(--accent-hover); box-shadow: 0 0 16px var(--accent-glow); }
.login-note { font-size: 11px; color: var(--text-muted); text-align: center; margin-top: 18px; }
/* Der zweite Schritt: Code aus der Mail */
.login-hinweis { font-size: 13px; color: var(--text-subtle); margin: 0 0 18px; line-height: 1.5; }
.login-hinweis strong { color: var(--text-primary); font-weight: 500; }
.login-code { font-size: 18px; letter-spacing: 4px; font-variant-numeric: tabular-nums; }
.login-nebenbei { display: flex; justify-content: space-between; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.btn-link-leise {
    background: none; border: 0; padding: 0; font: inherit; font-size: 12px;
    color: var(--text-muted); cursor: pointer; text-decoration: none;
}
.btn-link-leise:hover, .btn-link-leise:focus-visible { color: var(--text-primary); text-decoration: underline; }

/* ── Bildlaufleiste ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.2); }

/* ══════════════════════════════════════════════════════════════════
   Bausteine der Verwaltung
   ══════════════════════════════════════════════════════════════════ */

/* ── Kennzahlen ──
 *
 * Vier Zahlen ueber der Liste. Keine Diagramme: Ein Wert ohne Verlauf
 * ist eine Zahl, kein Bild - und diese vier beantworten die Fragen, die
 * man beim Aufschlagen der Seite hat.
 */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}
.stat-card { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.stat-card .stat-icon {
    width: 36px; height: 36px;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
    /* Grau, solange die Zahl nichts verlangt. Rot ist das Signal fuer
       eine Handlung - leuchtete jede Kennzahl so, sagte es nichts mehr.
       Farbe bekommt das Symbol nur ueber is-good/is-warn/is-bad. */
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-subtle);
    flex-shrink: 0;
}
.stat-card.is-good .stat-icon { background: rgba(34, 197, 94, 0.12); color: #86efac; }
.stat-card.is-warn .stat-icon { background: rgba(245, 158, 11, 0.12); color: #fcd34d; }
.stat-card.is-bad .stat-icon  { background: rgba(239, 68, 68, 0.12); color: #fca5a5; }
.stat-card.is-warn .stat-value { color: #fcd34d; }
.stat-card.is-bad .stat-value  { color: #fca5a5; }
.stat-hint { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
/* Die Produkte als eine Karte: Name, Zahl, Balken */
.produkt-zeile { margin-bottom: 16px; }
.produkt-kopf { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.produkt-name { font-size: 13.5px; color: var(--text-primary); }
.produkt-zahl { font-size: 22px; font-weight: 700; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.produkt-balken { height: 6px; border-radius: 3px; background: var(--glass-border); overflow: hidden; margin-top: 6px; }
.produkt-balken > span { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
/* Auswertung: die Monatsrechnung */
.monatsrechnung { width: 100%; max-width: 620px; }
.monatsrechnung td.r { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.monatsrechnung td.einzug { padding-left: 24px; color: var(--text-subtle); }
.monatsrechnung tr.summe-zeile td { font-weight: 600; color: var(--text-primary); }
.monatsrechnung tr.summe-zeile:last-child td { border-top: 1px solid var(--glass-border); }
a.stat-link { display: block; color: inherit; text-decoration: none; }
a.stat-link:hover .stat-card, a.stat-link:focus-visible .stat-card { border-color: var(--accent-hover); }

/* ── Diagramm ── */
.chart-card { margin-bottom: 22px; }
.chart-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.chart-title { font-size: 13.5px; font-weight: 600; }
.chart-sub { font-size: 11.5px; color: var(--text-muted); }
.chart-box { position: relative; height: 180px; }
/* Die Umsatz-Diagramme der Auswertung tragen eine Legende und brauchen mehr Hoehe */
.statistik-box { height: 240px; margin-bottom: 8px; }
.statistik-raster { grid-template-columns: 1fr 1fr; }
@media (max-width: 1100px) { .statistik-raster { grid-template-columns: 1fr; } }
.chart-empty {
    height: 180px;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted);
    font-size: 13px;
}

/* ── Inhaltsraster ── */
.grid-2 { display: grid; grid-template-columns: 1.3fr 1fr; gap: 18px; align-items: start; }
.grid-2 > * { min-width: 0; }
@media (max-width: 1100px) { .grid-2 { grid-template-columns: 1fr; } }

/* ── Begriffslisten (Kunde, Laufzeit, Funktionen …) ── */
.dl-rows { margin: 0; }
.dl-row {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px solid var(--glass-border);
    font-size: 13.5px;
}
.dl-row:last-child { border-bottom: 0; }
.dl-row dt {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-top: 2px;
}
.dl-row dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 600px) { .dl-row { grid-template-columns: 1fr; gap: 2px; } }

/* ── Schluessel zum Abtippen ── */
.key-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #0a0c14;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    font-family: 'Fira Code', 'Cascadia Code', ui-monospace, monospace;
    font-size: 12.5px;
    letter-spacing: 0.5px;
    overflow-wrap: anywhere;
}
.key-box .key-text { flex: 1; min-width: 0; }
/* Verdeckt: Anfang und Ende genuegen, um ihn mit der Anlage abzugleichen */
.key-box .key-text.ist-verdeckt { color: var(--text-subtle); }
.key-box .key-punkte { letter-spacing: 2px; margin: 0 4px; color: var(--text-muted); }
/* Die Knoepfe sprechen Inter, nicht die Schrift des Schluessels */
.key-knoepfe {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
    font-family: 'Inter', system-ui, sans-serif;
    letter-spacing: 0;
}
@media (max-width: 600px) {
    .key-box { flex-wrap: wrap; }
    .key-knoepfe { width: 100%; }
    .key-knoepfe > * { flex: 1; text-align: center; }
}

.code-block {
    background: #0a0c14;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    font-family: 'Fira Code', 'Cascadia Code', ui-monospace, monospace;
    font-size: 12px;
    padding: 14px 16px;
    margin: 0;
    overflow-x: auto;
    color: #94a3b8;
    line-height: 1.7;
}

/* ── Zeitleiste (Protokoll) ── */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li {
    position: relative;
    padding: 0 0 16px 22px;
    border-left: 1px solid var(--glass-border);
    font-size: 13px;
}
.timeline li:last-child { padding-bottom: 0; border-left-color: transparent; }
.timeline li::before {
    content: '';
    position: absolute;
    left: -4.5px; top: 5px;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    border: 2px solid var(--bg-deep);
}
.timeline li.ev-abgeholt::before { background: var(--success); }
.timeline li.ev-geaendert::before { background: var(--accent); }
.timeline li.ev-abgewiesen::before { background: var(--danger); }
.timeline-when { font-size: 11px; color: var(--text-muted); }
.timeline-what { font-weight: 500; }
.timeline-detail { color: var(--text-subtle); }

/* ── Formulare ── */
.form-card { max-width: 720px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .wide { grid-column: 1 / -1; }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } }
.field-hint { font-size: 11.5px; color: var(--text-muted); margin-top: 5px; }
.form-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--glass-border);
}
.form-actions .spacer { flex: 1; }
.check-row { display: flex; align-items: center; gap: 8px; }
.check-row input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); }
.check-row label,
label.check-row {
    margin: 0;
    text-transform: none;
    font-size: 13.5px;
    font-weight: 400;
    color: var(--text-primary);
    letter-spacing: 0;
}

/* ── Tabellen: Zellen, die nur Zeichen tragen ── */
.cell-actions { text-align: right; white-space: nowrap; }
/* Der Eintrag selbst: Text, kein Link - geoeffnet wird ueber die Knoepfe
   rechts. Links in Tabellen sind Querverweise auf andere Eintraege. */
.cell-title { font-weight: 500; color: var(--text-primary); }
.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px; height: 30px;
    border-radius: var(--radius-sm);
    color: var(--text-subtle);
    border: 1px solid transparent;
    transition: background-color 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.16s var(--ease-out);
}
.icon-btn:hover { background: var(--bg-hover); color: var(--text-primary); border-color: var(--glass-border); }
/* Gesperrt, etwa der Papierkorb einer verschickten Rechnung - der Grund
   steht im Titel des Rahmens */
.icon-btn:disabled { background: transparent; opacity: 0.35; cursor: not-allowed; }
.icon-btn:disabled:hover { background: transparent; color: var(--text-subtle); border-color: transparent; }
.muted { color: var(--text-muted); }
.nowrap { white-space: nowrap; }

/* ── Leere Zustaende ── */
.empty-state { text-align: center; padding: 46px 20px; color: var(--text-muted); }
.empty-state i { font-size: 30px; display: block; margin-bottom: 10px; opacity: 0.5; }
.empty-state p { margin: 0 0 16px; font-size: 13.5px; }

/* Namen in Tabellen sind Links, sollen aber nicht wie Warnungen leuchten:
   ruhige Schrift, Akzent erst beim Zeigen. */
.page-body table a,
.table-dark-custom a {
    color: var(--text-primary);
    font-weight: 500;
}
.page-body table a:hover,
.table-dark-custom a:hover { color: var(--accent-hover); }
.dl-row a { color: var(--accent-hover); }
/* Ein Betrag, hinter dem die Einzelposten stehen (etwa die Umsaetze des
   Kontos): gepunktet unterstrichen, sonst sieht er aus wie jeder andere. */
.table-dark-custom a.betrag-link {
    border-bottom: 1px dotted var(--text-muted);
}
.table-dark-custom a.betrag-link:hover { border-bottom-color: var(--accent-hover); }

/* ── Laufzeit ändern ──
 *
 * Steht bei der Laufzeit, nicht in der Kopfzeile: Der Zeitraum gehört
 * neben das Datum, auf das er sich bezieht.
 */
.laufzeit {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--glass-border);
}
.laufzeit-titel {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}
.laufzeit-knoepfe { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.laufzeit-knoepfe button { font-size: 12.5px; padding: 6px 12px; }
.laufzeit-datum { display: flex; gap: 8px; align-items: center; }
.laufzeit-datum input[type="date"] { max-width: 190px; }
.laufzeit .field-hint { margin-bottom: 0; }

/* ── Häkchenlisten (Funktionen einer Lizenz) ── */
.check-list {
    display: grid;
    gap: 2px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 8px;
}
.check-list .check-row {
    padding: 7px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.12s;
}
.check-list .check-row:hover { background: var(--bg-hover); }
.check-list .check-row span { font-size: 13.5px; }
.check-list input[disabled] { cursor: default; }

/* ── Telefon ──
 *
 * Steht am Ende der Datei, damit es die Bausteine darueber auf dem
 * Telefon ueberstimmt. Unter 768px stehen die haeufigsten Ziele in der
 * Bottombar; die ganze Leiste kommt als Slideout ("Menue",
 * webroot/js/menue.js). Geschlossen ist sie mit visibility versteckt,
 * nicht nur verschoben: Sonst blieben ihre Links per Tab erreichbar,
 * obwohl man sie nicht sieht.
 */
.bottombar { display: none; }

/* Der Schleier hinter dem Slideout - nur auf dem Telefon und nur offen */
.leiste-schleier { display: none; }

@media (max-width: 768px) {
    /* Die Leiste als Slideout: links ausserhalb des Bildes, mit
       visibility statt display versteckt - so gleitet sie und ist
       geschlossen trotzdem nicht per Tab erreichbar. */
    .sidebar {
        width: min(280px, 85vw);
        z-index: 210;
        transform: translateX(-100%);
        visibility: hidden;
        transition: transform 0.18s var(--ease-drawer), visibility 0s linear 0.18s;
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
        overscroll-behavior: contain;
    }
    .leiste-offen .sidebar {
        transform: none;
        visibility: visible;
        transition: transform 0.26s var(--ease-drawer), visibility 0s;
        box-shadow: 8px 0 32px rgba(0, 0, 0, 0.5);
    }
    .leiste-schleier {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 200;
        background: rgba(0, 0, 0, 0.55);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.18s var(--ease-drawer);
    }
    .leiste-offen .leiste-schleier { opacity: 1; pointer-events: auto; transition-duration: 0.26s; }
    .leiste-offen { overflow: hidden; }
    /* Auf dem Telefon groessere Ziele fuer den Daumen */
    .sidebar .nav-item-link { padding-top: 10px; padding-bottom: 10px; }
    .main-content { margin-left: 0; }

    .topbar {
        padding: 12px 16px;
        padding-top: calc(12px + env(safe-area-inset-top));
        flex-wrap: wrap;
        gap: 10px;
    }
    .topbar > div:first-child { min-width: 0; }
    .topbar-actions { flex-wrap: wrap; }

    /* Unten Platz lassen, damit die Bottombar nichts zudeckt. */
    .page-body {
        padding: 16px;
        padding-bottom: calc(var(--bottombar-h) + 20px + env(safe-area-inset-bottom));
    }

    .bottombar {
        display: flex;
        position: fixed;
        left: 0; right: 0; bottom: 0;
        height: calc(var(--bottombar-h) + env(safe-area-inset-bottom));
        padding: 0 8px env(safe-area-inset-bottom);
        background: rgba(10, 12, 22, 0.94);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border-top: 1px solid var(--glass-border);
        z-index: 100;
    }
    .bottombar-link {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        color: var(--text-muted);
        font-size: 11px;
        font-weight: 500;
        text-decoration: none;
        -webkit-tap-highlight-color: transparent;
    }
    .bottombar-link i { font-size: 20px; line-height: 1; }
    .bottombar-link.active { color: var(--accent-hover); }
    .bottombar-link.active i { color: var(--accent); }
    .bottombar-link:hover { color: var(--text-primary); }
    .bottombar-link.is-logout:hover { color: #fca5a5; }
    button.bottombar-link { background: none; border: 0; padding: 0; font: inherit; font-size: 11px; font-weight: 500; }
    .leiste-offen button.bottombar-link[data-leiste-auf] { color: var(--accent-hover); }

    /* Was man auf dem Telefon nicht zum Entscheiden braucht, steht in
       der Detailansicht; die Tabelle bleibt so ohne Seitwaertsrollen lesbar. */
    .hide-mobile { display: none; }
    .page-body thead th,
    .table-dark-custom thead th { padding: 10px 12px; }
    .page-body tbody td,
    .table-dark-custom tbody td { padding: 10px 12px; }

    .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .stat-card { padding: 14px; }
    .stat-card .stat-icon { display: none; }
    .stat-value { font-size: 22px; }

    .card-glass .card-body { padding: 16px; }
    .form-actions { flex-wrap: wrap; }
    .laufzeit-datum { flex-wrap: wrap; }
    .laufzeit-datum input[type="date"] { max-width: none; }
}

/* ── Abrechnung ── */
/* Neutral fuer Entwurf und Altbeleg: kein Zustand, der etwas verlangt */
.badge-muted {
    background: rgba(148, 163, 184, 0.1);
    color: #cbd5e1;
    border: 1px solid rgba(148, 163, 184, 0.2);
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 99px;
    font-weight: 600;
}
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table-dark-custom th.num { text-align: right; }
.pos-text { font-size: 12px; color: var(--text-muted); white-space: pre-line; margin-top: 2px; }
.sum-row td { border-top: 1px solid var(--glass-border); }
.sum-row.is-total td { font-weight: 700; color: var(--text-primary); }
.filter-bar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }

/* Suche ueber einer Liste (element/suche.php) */
.list-search { display: flex; align-items: center; gap: 8px; position: relative; max-width: 460px; margin-bottom: 14px; }
.list-search > .bi-search { position: absolute; left: 12px; color: var(--text-muted); pointer-events: none; }
.list-search input[type="search"] { padding-left: 34px; }
.list-search-info { color: var(--text-subtle); font-size: 12px; white-space: nowrap; }
.filter-bar a {
    font-size: 12px;
    padding: 5px 12px;
    border-radius: 99px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    text-decoration: none;
}
.filter-bar a.active { border-color: #ac243a; color: var(--text-primary); background: rgba(172, 36, 58, 0.15); }
.address { white-space: pre-line; line-height: 1.5; }
.stack { display: grid; gap: 18px; align-content: start; }
/* Rasterzellen werden sonst nicht schmaler als ihr Inhalt - eine lange
   JSON-Zeile oder Tabelle schoebe die Seite auf dem Telefon seitwaerts. */
.stack > * { min-width: 0; }

/* Positionseditor: jede Zeile eine Karte - Nummer und Bezeichnung oben,
   Beschreibung darunter, Kategorie und Zahlen in einer Leiste */
.rechnung-form { max-width: 980px; }
.pos-editor { display: grid; gap: 10px; counter-reset: pos; }
.pos-zeile {
    display: grid;
    gap: 8px;
    padding: 12px 12px 12px 14px;
    background: var(--surface);
    border: 1px solid var(--glass-border);
    border-left: 3px solid transparent;
    border-radius: var(--radius-sm);
    transition: border-color 0.15s, background 0.15s;
}
.pos-zeile:focus-within { border-color: rgba(255, 255, 255, 0.14); border-left-color: var(--accent); background: rgba(255, 255, 255, 0.055); }
.pos-zeile.ist-rabatt { border-left-color: var(--warning); }
.pos-zeile.ist-neu { animation: pos-neu 0.9s ease-out; }
@keyframes pos-neu { from { background: var(--accent-glow); } to { background: var(--surface); } }
@media (prefers-reduced-motion: reduce) { .pos-zeile.ist-neu { animation: none; } }
@media (prefers-reduced-motion: reduce) { .sidebar, .leiste-schleier { transition: none !important; } }
.pos-kopf { display: grid; grid-template-columns: 26px 1fr 34px; gap: 10px; align-items: center; }
.pos-nr {
    width: 26px; height: 26px; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--bg-hover); color: var(--text-subtle);
    font-size: 12px; font-weight: 600;
}
/* Die Nummer ist zugleich der Griff: beim Darueberfahren wird sie zum
   Greifsymbol, gezogen wird die ganze Karte */
.pos-griff {
    width: 26px; height: 26px; padding: 0; border: 0; background: none;
    position: relative; cursor: grab; touch-action: none; border-radius: 50%;
}
.pos-griff .bi {
    position: absolute; inset: 0; display: grid; place-items: center;
    opacity: 0; color: var(--text); font-size: 15px; transition: opacity 0.12s;
}
.pos-griff .pos-nr { transition: opacity 0.12s; }
.pos-griff:hover .bi, .pos-griff:focus-visible .bi, .pos-zeile.ist-gezogen .pos-griff .bi { opacity: 1; }
.pos-griff:hover .pos-nr, .pos-griff:focus-visible .pos-nr, .pos-zeile.ist-gezogen .pos-griff .pos-nr { opacity: 0; }
.pos-griff:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pos-editor.wird-sortiert, .pos-editor.wird-sortiert * { cursor: grabbing; user-select: none; }
.pos-zeile.ist-gezogen {
    position: relative; z-index: 2;
    border-color: var(--accent); border-left-color: var(--accent);
    background: var(--bg-hover);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
}
.pos-zeile input.pos-titel[type="text"] { font-weight: 600; font-size: 14.5px; }
/* textarea.form-control-dark bringt 100px Mindesthoehe mit - hier waechst
   die Beschreibung mit ihrem Text, darum klein anfangen */
.pos-zeile textarea.pos-beschreibung {
    width: auto; margin: 0 44px 0 36px;
    min-height: 38px; resize: none; overflow: hidden;
    font-size: 13px; color: var(--text-subtle);
}
.pos-leiste {
    margin-left: 36px;
    display: grid;
    grid-template-columns: minmax(160px, 1fr) 80px 120px 120px 140px;
    gap: 10px;
    align-items: end;
}
.pos-zeile:not(:has(.pos-feld-takt)) .pos-leiste { grid-template-columns: minmax(160px, 1fr) 80px 130px 140px; }
/* Rechnung aus einem Vertrag: Monate zwischen Menge und Preis - nur
   angezeigt (gesperrt), sie folgen dem Leistungszeitraum */
.pos-zeile:has(.pos-feld-monate) .pos-leiste { grid-template-columns: minmax(160px, 1fr) 80px 70px 130px 140px; }
.pos-feld-monate .form-control-dark:disabled { opacity: 0.6; cursor: not-allowed; }
.pos-feld { display: grid; gap: 4px; margin: 0; }
.pos-feld > span, .pos-summe > span { font-size: 10.5px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); }
.pos-feld .num { text-align: right; }
.pos-tag { position: relative; display: block; }
.pos-tag .bi { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 12px; pointer-events: none; }
.pos-zeile .pos-tag input.form-control-dark { padding-left: 30px; font-size: 13px; }
.pos-summe { display: grid; gap: 4px; text-align: right; }
.pos-summe strong { font-size: 15px; line-height: 38px; white-space: nowrap; }
@media (max-width: 760px) {
    .pos-zeile textarea.pos-beschreibung { margin: 0; }
    .pos-leiste { margin-left: 0; }
    .pos-leiste, .pos-zeile:not(:has(.pos-feld-takt)) .pos-leiste,
    .pos-zeile:has(.pos-feld-monate) .pos-leiste { grid-template-columns: 1fr 1fr; }
    .pos-feld-kategorie { grid-column: 1 / -1; }
}

.pos-fuss { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 14px; margin-top: 14px; }
.pos-aktionen { display: flex; flex-wrap: wrap; gap: 8px; }
.pos-gesamt {
    min-width: 240px;
    padding: 10px 14px;
    background: var(--bg-elevated);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
}
.pos-gesamt-zeile { display: flex; justify-content: space-between; gap: 18px; align-items: baseline; }
.pos-gesamt-zeile span { color: var(--text-subtle); font-size: 13px; }
.pos-gesamt-zeile strong { font-size: 17px; }
.pos-gesamt-zeile + .pos-gesamt-zeile { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--glass-border); }

/* Vorlagen-Fenster: Bootstrap-Modal im Hausstil */
.vorlagen-fenster .modal-content { background: var(--bg-base); border: 1px solid var(--glass-border); border-radius: var(--radius); color: var(--text-primary); }
.vorlagen-fenster .modal-header, .vorlagen-fenster .modal-footer { border-color: var(--glass-border); }
.vorlagen-fenster .modal-title { font-size: 16px; font-weight: 600; margin: 0; }
.vorlagen-fenster .modal-title .bi { color: var(--accent-hover); margin-right: 6px; }
.vorlagen-filter { padding: 14px 16px 6px; display: grid; gap: 10px; border-bottom: 1px solid var(--glass-border); }
.vorlagen-filter .filter-bar { margin-bottom: 8px; }
.vorlagen-liste { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.vorlage-karte {
    display: grid; gap: 6px; text-align: left;
    padding: 12px 14px;
    background: var(--surface);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.vorlage-karte:hover, .vorlage-karte:focus-visible { border-color: var(--accent); background: var(--bg-hover); outline: none; }
.vorlage-karte:active { transform: scale(0.97); }
.vorlage-kopf { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.vorlage-titel { font-weight: 600; font-size: 14px; }
.vorlage-preis { font-weight: 600; white-space: nowrap; text-align: right; }
.vorlage-preis small { display: block; font-weight: 400; font-size: 11px; color: var(--text-muted); }
.vorlage-text {
    font-size: 12.5px; color: var(--text-subtle); white-space: pre-line;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.vorlage-fuss { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 2px; font-size: 12px; }
.vorlage-hinzu { color: var(--accent-hover); margin-left: auto; }
.vorlage-ok { display: none; color: var(--success); margin-left: auto; }
.vorlage-karte.ist-gewaehlt { border-color: rgba(34, 197, 94, 0.5); }
.vorlage-karte.ist-gewaehlt .vorlage-hinzu { display: none; }
.vorlage-karte.ist-gewaehlt .vorlage-ok { display: inline; }
.vorlagen-leer { margin: 20px 0; text-align: center; }
.vorlagen-fenster .modal-footer { justify-content: space-between; }
.vorlagen-verwalten { font-size: 13px; margin-right: auto; }
.vorlagen-zaehler { font-size: 12.5px; }

/* Zahlung eintragen: drei Felder und der Knopf in einer Reihe */
.zahlung-form { display: grid; grid-template-columns: 120px 150px 1fr auto; gap: 10px; align-items: end; }
.zahlung-form .input { margin: 0; }
@media (max-width: 760px) { .zahlung-form { grid-template-columns: 1fr 1fr; } }

/* Inaktive Artikel: in der Liste, aber zurueckgenommen */
tr.is-muted td { opacity: 0.55; }

/* Auswertung: Anteil als Balken neben der Zahl, Zuordnen in einer Zeile */
.anteil-balken { height: 8px; border-radius: 4px; background: rgba(255, 255, 255, 0.05); overflow: hidden; }
.anteil-balken span { display: block; height: 100%; background: #c4354e; border-radius: 4px; }
.zuordnen-form { display: flex; gap: 6px; align-items: center; }
.zuordnen-form .form-control-dark { min-width: 160px; padding-top: 4px; padding-bottom: 4px; }
.umbenennen-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; }
.umbenennen-form .input { margin: 0; }
@media (max-width: 760px) { .umbenennen-form { grid-template-columns: 1fr; } }

/* Mail-Protokoll: der Text, wie er rausging - Zeilenumbrueche bleiben */
.mail-text {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: inherit;
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--text);
}

/* Artikel je Kategorie: gleiche Spaltenbreiten in allen Karten, damit die
   Preise untereinander stehen */
.artikel-tabelle { table-layout: fixed; }
.artikel-tabelle th:nth-child(2) { width: 150px; }
.artikel-tabelle th:nth-child(3) { width: 110px; }
.artikel-tabelle th:nth-child(4) { width: 96px; }
@media (max-width: 760px) { .artikel-tabelle { table-layout: auto; } }

/* Rabattzeile im Positionseditor: gelb gerandet wie ein negativer Betrag,
   statt Menge und Preis: Hoehe, Art und worauf */
.pos-zeile.ist-rabatt-zeile { border-left-color: var(--warning); background: rgba(245, 158, 11, 0.05); }
.pos-zeile.ist-rabatt-zeile .pos-summe strong { color: var(--warning); }
.pos-leiste.pos-leiste-rabatt,
.pos-zeile:not(:has(.pos-feld-takt)) .pos-leiste.pos-leiste-rabatt { grid-template-columns: 170px minmax(160px, 1fr) 140px; }
.pos-zeile:has(.pos-feld-takt) .pos-leiste.pos-leiste-rabatt { grid-template-columns: 170px minmax(160px, 1fr) 120px 140px; }
.rabatt-wert { display: grid; grid-template-columns: 1fr 64px; gap: 6px; }
.rabatt-auf { display: flex; flex-wrap: wrap; gap: 6px; min-height: 38px; align-items: center; }
.rabatt-chip {
    min-width: 34px; height: 30px; padding: 0 10px;
    border: 1px solid var(--glass-border); border-radius: 999px;
    background: transparent; color: var(--text-subtle);
    font-size: 12.5px; font-weight: 600; cursor: pointer;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.rabatt-chip:hover { border-color: rgba(255, 255, 255, 0.25); color: var(--text); }
.rabatt-chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.rabatt-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 760px) {
    .pos-leiste.pos-leiste-rabatt,
    .pos-zeile:not(:has(.pos-feld-takt)) .pos-leiste.pos-leiste-rabatt,
    .pos-zeile:has(.pos-feld-takt) .pos-leiste.pos-leiste-rabatt { grid-template-columns: 1fr 1fr; }
    .pos-feld-auf { grid-column: 1 / -1; }
}

/* Rueckfrage (element/frage_fenster.php) - wie in evendia.net
   (EvConfirmDialog, .modal-delete): schmale Karte, mittig, Symbol im
   Kreis in der Farbe der Folgen, Abbrechen und Knopf unten in der Mitte */
.frage-fenster .modal-dialog { max-width: 400px; margin: 10vh auto; }
.frage-fenster .modal-content {
    background: var(--bg-elevated);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.75);
    overflow: hidden;
    text-align: center;
    color: var(--text-primary);
}
.frage-fenster .modal-header {
    position: relative;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 36px 28px 22px;
    border-bottom: 0;
}
.frage-fenster .btn-close { position: absolute; top: 14px; right: 16px; margin: 0; font-size: 12px; }
.frage-fenster .modal-title { font-size: 17px; font-weight: 700; margin: 0; line-height: 1.3; color: #fff; }
.frage-text { margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--text-subtle); white-space: pre-line; }
.frage-symbol {
    width: 60px; height: 60px; border-radius: 50%;
    display: grid; place-items: center; flex-shrink: 0;
    font-size: 24px;
}
.frage-symbol.ist-gefahr { background: rgba(172, 36, 58, 0.14); border: 1px solid rgba(172, 36, 58, 0.35); color: #e05070; }
.frage-symbol.ist-hinweis { background: rgba(230, 168, 23, 0.12); border: 1px solid rgba(230, 168, 23, 0.35); color: #f0b429; }
.frage-symbol.ist-frage { background: rgba(59, 130, 246, 0.12); border: 1px solid rgba(59, 130, 246, 0.3); color: #60a5fa; }
.frage-fenster .modal-footer {
    justify-content: center;
    gap: 10px;
    padding: 16px 24px;
    background: rgba(0, 0, 0, 0.18);
    border-top: 1px solid var(--glass-border);
}
.frage-fenster .modal-footer > * { margin: 0; }
.btn-danger-soft.is-solid { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-danger-soft.is-solid:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

/* Zwei Felder fuer eine Einstellung (Versand am Vertrag): das gewaehlte
   hervorgehoben, das andere ein Link, der vor dem Umschalten fragt */
.umschalter {
    display: inline-flex;
    padding: 3px;
    gap: 3px;
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    background: var(--surface);
}
.umschalter-feld {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12.5px; font-weight: 500;
    color: var(--text-subtle);
    white-space: nowrap;
}
.umschalter a.umschalter-feld { color: var(--text-subtle); }
.umschalter a.umschalter-feld:hover { color: var(--text-primary); background: var(--bg-hover); }
.umschalter-feld.active { background: var(--accent); color: #fff; }

/* ── Buchhaltung ── */
/* Eine Kennzahl, die zu ihrer Seite fuehrt (In der Kasse -> Abgleich) */
a.stat-card { color: inherit; text-decoration: none; }
a.stat-card:hover { border-color: rgba(172, 36, 58, 0.45); }
/* Kontoauszug: der Steuersatz unter dem Ziel eines Ausgangs */
.auszug-satz { margin-top: 6px; max-width: 140px; }
.hinweis-box {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px 16px;
    margin-bottom: 18px;
    border-radius: 12px;
    border: 1px solid rgba(245, 158, 11, 0.25);
    background: rgba(245, 158, 11, 0.06);
    color: var(--text-subtle);
    font-size: 13.5px;
}
.hinweis-box .bi { color: #fcd34d; margin-top: 2px; }
.cell-sub { font-size: 12.5px; color: var(--text-muted); }
.text-warn { color: #fcd34d; }
.verteilung-tabelle .verteilung-feld { width: 92px; margin-left: auto; text-align: right; padding: 4px 8px; }
.verteilung-tabelle .verteilung-feld::placeholder { color: var(--text-muted); opacity: 0.7; }
.verteilung-fuss { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.verteilung-fuss .field-hint { margin: 0; flex: 1 1 320px; }
.buchhaltung-tabelle tr.ist-vorschau td { opacity: 0.5; }
.abschluss-raster { gap: 0; }
.abschluss-raster > table + table { border-left: 1px solid var(--glass-border); }
.abschluss-ergebnis {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    border-top: 1px solid var(--glass-border);
    font-size: 15px;
}
.abschluss-ergebnis strong { font-size: 18px; font-variant-numeric: tabular-nums; }
@media (max-width: 768px) {
    .abschluss-raster > table + table { border-left: 0; border-top: 1px solid var(--glass-border); }
}


/* ── Finanzamt: Zeitraum-Wahl rechts im Kartenkopf ── */
.card-glass .card-header-flex { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.zeitraum-wahl { margin-left: auto; display: flex; gap: 8px; align-items: center; font-weight: 400; }
.zeitraum-wahl .form-select-dark { width: auto; padding-top: 4px; padding-bottom: 4px; }

/* ── Ausgaben: Suche und Kategorie nebeneinander ── */
.ausgaben-suche { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-start; }
.ausgaben-suche .list-search { flex: 1 1 280px; }
.kategorie-wahl { display: flex; gap: 8px; margin-bottom: 14px; }
.kategorie-wahl .form-select-dark { width: auto; }
.table-dark-custom tr.ist-abweichend td:first-child { box-shadow: inset 3px 0 0 var(--warning); }

/* ── Jahresabschluss: Konten zum Aufklappen ── */
.konten-liste { display: flex; flex-direction: column; gap: 8px; }
.konto { border: 1px solid var(--glass-border); border-radius: var(--radius-sm); }
.konto summary {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    cursor: pointer;
    list-style: none;
}
.konto summary::-webkit-details-marker { display: none; }
.konto summary::before { content: "\F285"; font-family: "bootstrap-icons"; font-size: 11px; color: var(--text-muted); transition: transform 0.15s; }
.konto[open] summary::before { transform: rotate(90deg); }
.konto summary strong { margin-left: auto; font-variant-numeric: tabular-nums; }
.konto[open] summary { border-bottom: 1px solid var(--glass-border); }
/* Umsatz zuweisen: die Summe gegen den Betrag, die Schalter daneben */
.zuweisen-rest { margin-bottom: 18px; }
.zuweisen-rest > summary {
    cursor: pointer;
    color: var(--text-muted);
    font-size: 13px;
    padding: 10px 4px;
    margin-bottom: 8px;
}
.zuweisen-rest > summary:hover { color: var(--text-primary); }
.zuweisen-fuss { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
/* Umsaetze ohne Zuordnung: deutlicher als ein Hinweis - rot statt gelb */
.hinweis-box.ist-dringend { border-color: rgba(239, 68, 68, 0.45); background: rgba(239, 68, 68, 0.08); }
.hinweis-box.ist-dringend .bi { color: #fca5a5; }
.hinweis-box.ist-dringend strong { color: #fecaca; }
/* Ein Vorschlag beim Zuweisen: nie angehakt, aber nicht zu uebersehen */
.hinweis-box.ist-vorschlag {
    align-items: center;
    flex-wrap: wrap;
    border: 2px solid var(--warning);
    background: rgba(245, 158, 11, 0.14);
    font-size: 14.5px;
}
.hinweis-box.ist-vorschlag strong { color: #fde68a; }
.hinweis-box.ist-vorschlag.ist-uebernommen { border-color: rgba(245, 158, 11, 0.4); background: rgba(245, 158, 11, 0.06); }
.table-dark-custom tr.ist-vorschlag td { background: rgba(245, 158, 11, 0.13); }
.table-dark-custom tr.ist-vorschlag td:first-child { box-shadow: inset 4px 0 0 var(--warning); }
.table-dark-custom tr.ist-vorschlag input[type="checkbox"] { outline: 2px solid var(--warning); outline-offset: 2px; }
.badge-vorschlag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 6px;
    background: var(--warning);
    color: #1a1a1a;
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.badge-vorschlag .bi { color: inherit; }
/* Zaehler an einem Punkt der Leiste */
.nav-zaehler {
    margin-left: auto;
    min-width: 20px;
    padding: 1px 7px;
    border-radius: 99px;
    background: var(--danger);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
/* Bald faellig, noch nicht zu spaet: gelb, dunkle Schrift fuer den Kontrast */
.nav-zaehler.is-warn { background: var(--warning); color: #1a1205; }
/* Nur da, noch nichts zu spaet: zurueckhaltend, damit Rot etwas bedeutet */
.nav-zaehler.is-neutral { background: rgba(255, 255, 255, 0.12); color: var(--text-primary); }

/* Prognose: der Tag zum Eintippen neben den festen Tagen */
.prognose-tag { display: flex; gap: 6px; align-items: center; margin-left: auto; }
.prognose-tag input { width: auto; padding: 4px 10px; height: auto; }
@media (max-width: 768px) {
    .prognose-tag { margin-left: 0; width: 100%; }
    .prognose-tag input { flex: 1; }
}

/* ── Planung beim Kunden (layout/planung.php, Planung/index.php) ──
   Eine Seite ohne Leiste: Kopf mit Logo, eine Spalte Karten. Die Raeume
   sind Karten wie die Positionen, die Ansichten Kacheln zum Anhaken -
   auf dem Telefon untereinander. */
.planung-seite { min-height: 100vh; display: flex; flex-direction: column; }
.planung-seite [hidden] { display: none !important; }
.planung-kopf {
    display: flex; align-items: center; gap: 14px;
    padding: 16px 24px;
    border-bottom: 1px solid var(--glass-border);
    background: var(--bg-base);
    color: var(--text-subtle); font-size: 13.5px;
}
.planung-logo { height: 26px; }
.planung-inhalt { width: 100%; max-width: 940px; margin: 0 auto; padding: 24px 16px 40px; flex: 1; display: grid; gap: 18px; align-content: start; }
.planung-fuss { text-align: center; padding: 18px 16px 28px; font-size: 12px; color: var(--text-muted); }
.planung-fuss a { color: var(--text-subtle); }
.planung-titel { font-size: 20px; font-weight: 600; margin: 0 0 10px; }
.planung-karte .card-header .bi { color: var(--accent-hover); margin-right: 6px; }
.planung-formular { display: grid; gap: 18px; }
/* Rasterzellen werden sonst nicht schmaler als ihr Inhalt - die lange
   Ansichten-Leiste schob die Karten ueber die Spalte hinaus */
.planung-inhalt,
.planung-formular { grid-template-columns: minmax(0, 1fr); }
/* Speichern immer in Sicht - unten fest ueber die ganze Breite, auch
   waehrend man ueber die Fotos weiter unten scrollt */
.planung-aktionen {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    padding: 12px 0 calc(12px + env(safe-area-inset-bottom));
    background: rgba(15, 17, 23, 0.92);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--glass-border);
}
.planung-seite:has(.planung-aktionen) { padding-bottom: 72px; }
/* Dieselbe Spalte wie .planung-inhalt - die Knoepfe enden buendig mit den Karten */
.planung-aktionen-innen {
    max-width: 940px; margin: 0 auto; padding: 0 16px;
    display: flex; gap: 10px; justify-content: flex-end; align-items: center; flex-wrap: wrap;
}
/* Wie weit der Fragebogen ist - links in der Leiste, die Knoepfe rechts */
.planung-fortschritt { display: flex; align-items: center; gap: 10px; margin-right: auto; min-width: 0; flex: 1 1 0; }
.fortschritt-balken { width: 160px; height: 6px; border-radius: 3px; background: var(--glass-border); overflow: hidden; }
/* Gestaucht statt in der Breite veraendert - transform rechnet kein Layout neu */
.fortschritt-balken > span { display: block; width: 100%; height: 100%; background: var(--accent-hover); transform: scaleX(0); transform-origin: left; transition: transform 0.2s var(--ease-out); }
.planung-fortschritt.ist-fertig .fortschritt-balken > span { background: var(--success); }
.fortschritt-text { font-size: 12px; color: var(--text-subtle); white-space: nowrap; }
/* Die naechste offene Angabe - ein Klick springt hin */
.fortschritt-offen {
    min-width: 0; display: inline-flex; align-items: center; gap: 6px;
    background: none; border: 0; padding: 4px 0; color: var(--accent-hover); font-size: 12px; cursor: pointer;
}
.fortschritt-offen > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fortschritt-offen:hover > span, .fortschritt-offen:focus-visible > span { text-decoration: underline; }
.ist-gesucht { animation: gesucht 1.6s ease-out; border-radius: 8px; }
@keyframes gesucht { 0%, 40% { box-shadow: 0 0 0 2px var(--accent-hover); } 100% { box-shadow: 0 0 0 2px transparent; } }
@media (prefers-reduced-motion: reduce) { .ist-gesucht { animation: none; outline: 2px solid var(--accent-hover); } }
@media (prefers-reduced-motion: reduce) { .fortschritt-balken > span { transition: none; } }

.raum-knoepfe { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.raum-liste { display: grid; gap: 12px; }
.raum-karte {
    display: grid; gap: 12px;
    padding: 14px;
    background: var(--surface);
    border: 1px solid var(--glass-border);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius-sm);
}
.raum-karte.ist-neu { animation: pos-neu 0.9s ease-out; }
@media (prefers-reduced-motion: reduce) { .raum-karte.ist-neu { animation: none; } }
.raum-kopf { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; color: var(--text-subtle); }
.raum-kopf .icon-btn { margin-left: auto; }
.raum-feld { display: grid; gap: 4px; font-size: 12px; color: var(--text-subtle); max-width: 420px; }

/* Die Leiste mit den Ansichten - bleibt beim Scrollen durch die Bereiche
   oben stehen, damit man nicht zum Ziehen zurueck muss */
.ansicht-leiste {
    position: sticky; top: 0; z-index: 5;
    padding: 10px 20px 12px;
    background: rgba(26, 29, 39, 0.94);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--glass-border);
}
.ansicht-leiste-hinweis { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--text-subtle); margin-bottom: 8px; }
.ansicht-reihe { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.ansicht-kachel {
    flex: 0 0 auto;
    display: grid; justify-items: center; align-content: start; gap: 5px;
    min-width: 104px; padding: 6px 8px;
    background: var(--surface);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font: inherit; font-size: 11px; line-height: 1.25; text-align: center;
    cursor: grab;
    transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.ansicht-kachel:hover { border-color: rgba(255, 255, 255, 0.2); }
@media (hover: hover) and (pointer: fine) { .ansicht-kachel:hover { transform: translateY(-1px); } }
.ansicht-kachel:active { cursor: grabbing; }
.ansicht-kachel:focus-visible { outline: 2px solid var(--accent-hover); outline-offset: 2px; }
.ansicht-kachel[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-glow); }
.ansicht-kachel small { color: var(--text-muted); font-size: 10px; }
.ansicht-bilder { display: flex; gap: 5px; align-items: flex-end; height: 51px; }
.ansicht-bilder img { display: block; height: 100%; border-radius: 3px; background: #000; object-fit: cover; box-shadow: 0 0 0 2px #0b0d12; }
.ansicht-bilder img.ist-quer { aspect-ratio: 16 / 9; }
.ansicht-bilder img.ist-hoch { aspect-ratio: 9 / 16; }

/* Die Wand eines Bereichs mit ihren Fernsehern */
.wand {
    display: flex; flex-wrap: wrap; align-items: flex-end; gap: 22px 18px;
    min-height: 120px; padding: 18px 14px 10px;
    border-radius: var(--radius-sm);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
    border: 1px dashed var(--glass-border);
}
.wand-leiste { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; font-size: 13px; }

/* Quer | Hoch - am Fernseher und an der Video-Wall */
.format-wahl { display: inline-flex; border: 1px solid var(--glass-border); border-radius: 7px; overflow: hidden; }
.format-wahl button {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 8px;
    background: transparent; border: 0; color: var(--text-muted);
    font: inherit; font-size: 11.5px; cursor: pointer;
}
.format-wahl button + button { border-left: 1px solid var(--glass-border); }
.format-wahl button[aria-pressed="true"] { background: var(--accent-glow); color: var(--text-primary); }
.format-wahl button:disabled { opacity: 0.35; cursor: not-allowed; }
.format-wahl button:focus-visible { outline: 2px solid var(--accent-hover); outline-offset: -2px; }
.tv-zeile { display: flex; align-items: center; gap: 6px; }

/* Die Video-Wall: ein Raster ohne Luecken, das Bild ueber alle Monitore */
.wand-regler { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; }
.wand-zahl input { width: 76px; }
.wand-mal { padding-bottom: 9px; color: var(--text-muted); }
.wand-regler .format-wahl button { padding: 7px 12px; font-size: 13px; }
.wand-werbung.ist-an { border-color: var(--accent); color: var(--text-primary); background: var(--accent-glow); }
.wand.ist-videowand { flex-direction: column; align-items: center; gap: 8px; outline: none; }
.videowand {
    position: relative;
    display: grid;
    background: #05060a center / cover no-repeat;
    border: 6px solid #15171e;
    border-radius: 6px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.10), 0 10px 24px rgba(0, 0, 0, 0.45);
}
.videowand-feld { box-shadow: inset 0 0 0 1.5px #15171e; }
.videowand .tv-leer { display: none; }
.videowand.ist-leer .tv-leer { display: flex; }
.ansicht-zieht .videowand,
.ansicht-gewaehlt .videowand { box-shadow: 0 0 0 2px rgba(196, 53, 78, 0.55), 0 10px 24px rgba(0, 0, 0, 0.45); cursor: copy; }
.ist-videowand.ist-ziel .videowand,
.ansicht-gewaehlt .ist-videowand:hover .videowand,
.ist-videowand:focus-visible .videowand { box-shadow: 0 0 0 3px var(--accent-hover), 0 0 22px var(--accent-glow); }

.tv { display: grid; justify-items: center; gap: 6px; outline: none; }
.tv-schirm {
    position: relative; overflow: hidden;
    background: #05060a;
    border: 6px solid #15171e;
    border-radius: 6px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.10), 0 10px 24px rgba(0, 0, 0, 0.45);
    transition: width 0.25s ease, height 0.25s ease, box-shadow 0.15s;
}
.tv.ist-quer .tv-schirm { width: 232px; height: 131px; }
.tv.ist-hoch .tv-schirm { width: 98px; height: 174px; }
/* Der Fuss - nur bei Querformat, hochkant haengt er an der Wand */
.tv.ist-quer::after { content: ""; order: 1; width: 54px; height: 5px; margin-top: -6px; border-radius: 0 0 4px 4px; background: #15171e; }
.tv-fuss { order: 2; }
.tv-schirm img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tv.ist-leer .tv-schirm img { display: none; }
.tv-leer {
    position: absolute; inset: 0;
    display: none; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    padding: 6px; text-align: center;
    font-size: 11px; color: var(--text-muted);
}
.tv-leer .bi { font-size: 18px; opacity: 0.6; }
.tv.ist-leer .tv-leer { display: flex; }
.tv-werbung {
    position: absolute; left: 0; right: 0; bottom: 0;
    padding: 3px 6px;
    background: rgba(172, 36, 58, 0.92);
    color: #fff; font-size: 10px; font-weight: 600; letter-spacing: 0.3px; text-align: center;
}
.tv-fuss { display: grid; justify-items: center; gap: 4px; }
.tv-name { max-width: 232px; font-size: 11.5px; color: var(--text-subtle); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-name.ist-hinweis { color: #fcd34d; }
.tv-knoepfe { display: inline-flex; gap: 2px; }
.tv-knopf {
    width: 26px; height: 26px; padding: 0;
    display: inline-grid; place-items: center;
    background: transparent; border: 1px solid transparent; border-radius: 6px;
    color: var(--text-muted); font-size: 13px; cursor: pointer;
}
.tv-knopf:hover { background: var(--bg-hover); color: var(--text-primary); }
.tv-knopf:disabled { opacity: 0.3; cursor: not-allowed; background: transparent; }
.tv-knopf.ist-an { color: var(--accent-hover); }
.tv-knopf:focus-visible { outline: 2px solid var(--accent-hover); }

/* Beim Ziehen und mit gewaehlter Ansicht zeigen die Fernseher, dass sie Ziel sind */
.ansicht-zieht .tv-schirm,
.ansicht-gewaehlt .tv-schirm { box-shadow: 0 0 0 2px rgba(196, 53, 78, 0.55), 0 10px 24px rgba(0, 0, 0, 0.45); cursor: copy; }
.tv.ist-ziel .tv-schirm,
.ansicht-gewaehlt .tv:hover .tv-schirm,
.tv:focus-visible .tv-schirm { box-shadow: 0 0 0 3px var(--accent-hover), 0 0 22px var(--accent-glow); }
.tv.ist-gesetzt .tv-schirm { animation: tv-an 0.45s ease-out; }
@keyframes tv-an { from { filter: brightness(2.2); } to { filter: none; } }
@media (prefers-reduced-motion: reduce) {
    .tv-schirm { transition: none; }
    .tv.ist-gesetzt .tv-schirm { animation: none; }
}

textarea.form-control-dark.raum-notiz { min-height: 38px; }
.raum-leer { padding: 28px 16px; }

.frage-liste { display: grid; gap: 18px; }
.frage { display: grid; gap: 8px; }
.frage-text { font-size: 13.5px; font-weight: 500; }
.frage-optional { color: var(--text-muted); font-weight: 400; font-size: 12px; }
/* Auswahl als Kacheln statt Knoepfchen: Die ganze Flaeche nimmt den
   Finger an, gewaehlt leuchtet sie wie eine gewaehlte Ansicht. Das echte
   Feld bleibt darunter - Tastatur, Formular und Skript sehen es wie vorher. */
.frage-wahl { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 8px; }
.wahl-kachel {
    position: relative;
    display: flex; align-items: center; gap: 11px;
    min-height: 48px; padding: 10px 14px;
    border: 1px solid var(--glass-border); border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.025);
    font-size: 13.5px; line-height: 1.35; color: var(--text-subtle);
    cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent;
    transition: border-color 0.16s, background-color 0.16s, color 0.16s, transform 0.16s var(--ease-out);
}
.wahl-kachel input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.wahl-kachel:hover { border-color: rgba(255, 255, 255, 0.18); background: rgba(255, 255, 255, 0.05); color: var(--text-primary); }
.wahl-kachel:active { transform: scale(0.97); }
.wahl-kachel:has(input:checked) { border-color: var(--accent); background: var(--accent-glow); color: #fff; }
.wahl-kachel:has(input:focus-visible) { outline: 2px solid var(--accent-hover); outline-offset: 2px; }
/* Der Punkt: rund fuer eine Wahl, eckig zum Ankreuzen */
.wahl-punkt {
    position: relative; flex-shrink: 0;
    width: 18px; height: 18px; border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.28);
    transition: border-color 0.16s, background-color 0.16s;
}
.wahl-punkt::after {
    content: ""; position: absolute; inset: 0; margin: auto;
    width: 8px; height: 8px; border-radius: 50%; background: #fff;
    transform: scale(0); transition: transform 0.22s var(--ease-out);
}
.wahl-kachel:has(input:checked) .wahl-punkt { border-color: var(--accent-hover); background: var(--accent); }
.wahl-kachel:has(input:checked) .wahl-punkt::after { transform: scale(1); }
.ist-mehrfach .wahl-punkt { border-radius: 6px; }
.ist-mehrfach .wahl-punkt::after {
    width: 5px; height: 9px; border-radius: 0; background: none;
    border: solid #fff; border-width: 0 2px 2px 0;
    transform: translateY(-1px) rotate(45deg) scale(0);
}
.ist-mehrfach:has(input:checked) .wahl-punkt::after { transform: translateY(-1px) rotate(45deg) scale(1); }

/* ── Schritte ── oben die Leiste, je Schritt eine Marke mit Symbol; ist
   ein Schritt erledigt, steht ein Haken darin. Die Linie dazwischen fuellt
   sich mit. Ohne Skript bleibt die Leiste weg und alles steht untereinander. */
.schritte ol { list-style: none; margin: 0; padding: 0; display: flex; }
.schritte li { flex: 1 1 0; min-width: 0; position: relative; }
.schritte li + li::before {
    content: ""; position: absolute; top: 19px; right: calc(50% + 24px); left: calc(-50% + 24px);
    height: 2px; background: var(--glass-border);
    transition: background-color 0.3s;
}
.schritte li.ist-fertig + li::before,
.schritte li.ist-fertig + li[hidden] + li::before { background: rgba(34, 197, 94, 0.45); }
.schritte button {
    width: 100%; display: flex; flex-direction: column; align-items: center; gap: 7px;
    padding: 0 4px; border: 0; background: none;
    color: var(--text-muted); font: inherit; font-size: 12px; cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.schritt-marke {
    position: relative; display: grid; place-items: center;
    width: 40px; height: 40px; border-radius: 50%;
    border: 1px solid var(--glass-border); background: var(--surface);
    font-size: 16px; color: var(--text-subtle);
    transition: border-color 0.2s, background-color 0.2s, color 0.2s, transform 0.16s var(--ease-out);
}
.schritt-marke .bi { grid-area: 1 / 1; transition: opacity 0.2s, transform 0.3s var(--ease-out); }
.schritt-marke .bi-check-lg { opacity: 0; transform: scale(0.4); }
.schritte button:hover .schritt-marke { border-color: rgba(255, 255, 255, 0.2); color: var(--text-primary); }
.schritte button:active .schritt-marke { transform: scale(0.94); }
.schritte button:focus-visible { outline: none; }
.schritte button:focus-visible .schritt-marke { outline: 2px solid var(--accent-hover); outline-offset: 2px; }
.schritt-titel { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: color 0.2s; }
.schritte .ist-fertig .schritt-marke { border-color: rgba(34, 197, 94, 0.35); background: rgba(34, 197, 94, 0.12); color: var(--success); }
.schritte .ist-fertig .schritt-marke .bi:first-child { opacity: 0; transform: scale(0.4); }
.schritte .ist-fertig .schritt-marke .bi-check-lg { opacity: 1; transform: none; }
.schritte .ist-fertig .schritt-titel { color: var(--text-subtle); }
/* Der aktuelle Schritt traegt das Signallicht - auch wenn er schon erledigt ist */
.schritte [aria-current="step"] .schritt-marke {
    border-color: var(--accent); background: var(--accent-glow); color: #fff;
    box-shadow: 0 0 0 4px rgba(172, 36, 58, 0.12);
}
.schritte [aria-current="step"] .schritt-titel { color: var(--text-primary); font-weight: 600; }
.schritte .ist-frisch .schritt-marke { animation: schritt-erledigt 0.5s var(--ease-out); }
@keyframes schritt-erledigt { 0% { transform: scale(1); } 40% { transform: scale(1.14); } 100% { transform: scale(1); } }

.nicht-im-schritt { display: none !important; }
/* Der neue Schritt kommt von unten herein - kurz, damit Weiter flott bleibt */
.ist-eingeblendet { animation: schritt-herein 0.32s var(--ease-out); }
@keyframes schritt-herein { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
    .ist-eingeblendet, .schritte .ist-frisch .schritt-marke { animation: none; }
    .wahl-punkt::after, .schritt-marke .bi { transition: none; }
}
.frage-zahl { max-width: 140px; }
.frage-liste .frage-hinweis { display: flex; margin: -8px 0 0; font-size: 13px; }

.datei-einleitung { margin: 0 0 16px; font-size: 13.5px; color: var(--text-subtle); max-width: 70ch; }
.datei-formular { display: grid; gap: 14px; justify-items: start; }
.datei-formular > .datei-zone { justify-self: stretch; }
/* Das Thema als Chips: einmal antippen, dann gilt es fuer die naechsten Dateien */
.datei-themen { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.datei-themen-titel { width: 100%; margin-bottom: 2px; font-size: 13.5px; font-weight: 500; }
.themen-chip { position: relative; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.themen-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.themen-chip span {
    display: inline-flex; align-items: center; min-height: 34px; padding: 6px 14px;
    border: 1px solid var(--glass-border); border-radius: 99px;
    background: rgba(255, 255, 255, 0.025);
    font-size: 13px; color: var(--text-subtle);
    transition: border-color 0.16s, background-color 0.16s, color 0.16s, transform 0.16s var(--ease-out);
}
.themen-chip:hover span { border-color: rgba(255, 255, 255, 0.18); color: var(--text-primary); }
.themen-chip:active span { transform: scale(0.96); }
.themen-chip input:checked + span { border-color: var(--accent); background: var(--accent-glow); color: #fff; }
.themen-chip input:focus-visible + span { outline: 2px solid var(--accent-hover); outline-offset: 2px; }
/* Die Flaeche zum Auswaehlen und Hineinziehen - das Feld selbst liegt unsichtbar darunter */
.datei-zone {
    position: relative;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    min-height: 150px; padding: 22px 16px;
    border: 1.5px dashed rgba(255, 255, 255, 0.16);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-muted); font-size: 12.5px; text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
}
.datei-zone-symbol {
    display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 8px;
    border-radius: 50%; background: var(--accent-glow);
    font-size: 24px; color: #fff;
    transition: transform 0.3s var(--ease-out);
}
.datei-zone strong { color: var(--text-primary); font-size: 14px; font-weight: 600; }
.datei-zone:hover,
.datei-zone.ist-ziel { border-color: var(--accent); background: rgba(172, 36, 58, 0.08); }
/* Beim Hineinziehen hebt sich die Wolke der Datei entgegen */
.datei-zone:hover .datei-zone-symbol { transform: translateY(-2px); }
.datei-zone.ist-ziel .datei-zone-symbol { transform: translateY(-4px) scale(1.08); }
@media (prefers-reduced-motion: reduce) { .datei-zone-symbol, .themen-chip span { transition: none; } }
.datei-zone:focus-within { outline: 2px solid var(--accent-hover); outline-offset: 2px; }
.datei-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.datei-liste { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 6px; }
.datei-liste li {
    display: flex; align-items: center; gap: 12px; font-size: 13px;
    padding: 8px 8px 8px 10px;
    border: 1px solid var(--glass-border); border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.025);
}
.datei-liste li > .bi {
    display: grid; place-items: center; flex: 0 0 34px; height: 34px;
    border-radius: 6px; background: rgba(255, 255, 255, 0.05);
    font-size: 16px; color: var(--text-subtle);
}
.datei-liste li.ist-fehler { border-color: rgba(239, 68, 68, 0.25); background: rgba(239, 68, 68, 0.06); }
/* Das Foto selbst statt des Symbols - so sieht der Kunde, ob es das richtige war */
.datei-liste li > .datei-bild {
    flex: 0 0 34px; width: 34px; height: 34px;
    border-radius: 6px; object-fit: cover; background: rgba(255, 255, 255, 0.05);
}

/* Foto-Knopf am Bereich: die Zahl daneben, waehrend des Hochladens pulsiert er */
.raum-foto-zahl { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.raum-foto-zahl:empty { display: none; }
[data-raum-foto].ist-laedt { animation: foto-laedt 1.2s ease-in-out infinite; }
[data-raum-foto].ist-fehler { border-color: rgba(239, 68, 68, 0.4); color: #fca5a5; }
@keyframes foto-laedt { 50% { opacity: 0.55; } }
@media (prefers-reduced-motion: reduce) { [data-raum-foto].ist-laedt { animation: none; opacity: 0.7; } }

/* Gespeichert im Hintergrund - leise neben dem Fortschritt */
.gespeichert-hinweis { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.gespeichert-hinweis:empty { display: none; }
.gespeichert-hinweis.ist-fehler { color: #fca5a5; white-space: normal; }

/* Der Ueberblick vor dem Einreichen */
.planung-ueberblick { display: grid; gap: 14px; }
.planung-ueberblick-titel { margin: 8px 0 0; font-size: 16px; font-weight: 600; }
.planung-ueberblick-inhalt { display: grid; gap: 18px; }
.offen-box { margin: 0; }
.offen-liste { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 2px; }
.offen-liste .btn-link-leise { padding: 0; font-size: 13px; color: var(--text-primary); text-align: left; }
.datei-liste .datei-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.datei-liste .muted { font-size: 12px; }
.datei-liste:empty { display: none; }
.datei-balken { flex: 0 0 120px; height: 4px; border-radius: 2px; background: var(--glass-border); overflow: hidden; }
.datei-balken > span { display: block; width: 100%; height: 100%; background: var(--accent-hover); transform: scaleX(0); transform-origin: left; transition: transform 0.2s var(--ease-out); }
@media (prefers-reduced-motion: reduce) { .datei-balken > span { transition: none; } }
.datei-liste li.ist-fehler .muted { color: #fca5a5; }
.datei-liste li.ist-neu { animation: pos-neu 0.9s ease-out; }
@media (prefers-reduced-motion: reduce) { .datei-liste li.ist-neu { animation: none; } }

/* Was eingetragen ist (element/planung_ansicht.php) - beim Kunden und hier */
.planung-raeume { display: grid; gap: 10px; }
.planung-raum { padding: 12px 14px; border: 1px solid var(--glass-border); border-left: 3px solid var(--accent); border-radius: var(--radius-sm); font-size: 13px; }
.planung-raum-kopf { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-weight: 600; }
.planung-raum-kopf .muted { font-weight: 400; font-size: 12px; }
.planung-raum .wand { margin-top: 10px; min-height: 0; border-style: solid; }
.planung-raum .tv.ist-quer .tv-schirm { width: 176px; height: 99px; border-width: 5px; }
.planung-raum .tv.ist-hoch .tv-schirm { width: 74px; height: 132px; border-width: 5px; }
.planung-raum .videowand { border-width: 5px; }
.planung-raum p { margin: 6px 0 0; color: var(--text-subtle); white-space: pre-line; }
.planung-link { display: flex; gap: 8px; }
.planung-link input { flex: 1; font-family: ui-monospace, monospace; font-size: 12px; }

@media (max-width: 700px) {
    .ansicht-leiste { padding: 8px 12px 10px; }
    .ansicht-leiste-hinweis { display: none; }
    .wand { justify-content: center; padding: 14px 8px 8px; }
    .tv.ist-quer .tv-schirm { width: 200px; height: 113px; }
    .tv.ist-hoch .tv-schirm { width: 84px; height: 150px; }
    .datei-formular { grid-template-columns: 1fr; }
    .planung-aktionen-innen > .btn-ghost,
    .planung-aktionen-innen > .btn-accent { flex: 1; justify-content: center; }
    /* Drei Knoepfe nebeneinander: Zurueck und Speichern nur als Symbol */
    .planung-aktionen-innen > .btn-ghost { flex: 0 0 auto; }
    .planung-aktionen .nur-breit { display: none; }
    /* Auf dem Telefon nur die Marken, der Titel allein beim aktuellen Schritt */
    .schritt-marke { width: 36px; height: 36px; font-size: 15px; }
    .schritte li + li::before { top: 17px; right: calc(50% + 22px); left: calc(-50% + 22px); }
    .schritt-titel { visibility: hidden; }
    .schritte [aria-current="step"] .schritt-titel { visibility: visible; overflow: visible; }
    .schritte li:has([aria-current="step"]) { flex-grow: 1.6; }
    .planung-fortschritt { flex-basis: 100%; }
    .fortschritt-balken { flex: 1; }
    .planung-kopf { padding: 12px 16px; }
}
.ansicht-auswahl-hinweis { margin-bottom: 16px; }

/* ---------- Standort: Notizen, Fotos und Videos, Schluesselbund ---------- */
.mono { font-family: ui-monospace, 'Fira Code', monospace; font-size: 12.5px; }
textarea.mono { font-size: 12.5px; }

.notiz-liste { list-style: none; margin: 0; padding: 0; }
.notiz-liste li { padding: 12px 18px; border-top: 1px solid var(--glass-border); }
.notiz-liste li:first-child { border-top: 0; }
.notiz-liste .notiz-text { white-space: pre-wrap; font-size: 13.5px; line-height: 1.5; }
.notiz-liste .notiz-kopf { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.notiz-liste .notiz-kopf form,
.notiz-liste .notiz-kopf .icon-btn { margin-left: auto; }
.notiz-form { padding: 14px 18px; border-top: 1px solid var(--glass-border); display: grid; gap: 8px; }
.notiz-form .form-actions { margin: 0; }

.medien-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; padding: 16px 18px; }
.medium { position: relative; border: 1px solid var(--glass-border); border-radius: 10px; overflow: hidden; background: rgba(255,255,255,0.02); }
.medium a.medium-bild { display: block; aspect-ratio: 4 / 3; background: #0b0d12; }
.medium img, .medium video { width: 100%; height: 100%; object-fit: cover; display: block; }
.medium .medium-symbol { display: flex; align-items: center; justify-content: center; height: 100%; font-size: 34px; color: var(--text-muted); }
.medium .medium-text { padding: 8px 10px; font-size: 12px; }
.medium .medium-text .cell-sub { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.medium .medium-loeschen { position: absolute; top: 6px; right: 6px; background: rgba(11,13,18,0.75); }
.medien-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 14px 18px; border-top: 1px solid var(--glass-border); }
.medien-form input[type="text"] { flex: 1; min-width: 180px; }

.schluesselbund .geheim { display: inline-block; min-width: 76px; margin-right: 4px; user-select: all; }
.schluesselbund .geheim-notiz pre { margin: 0; white-space: pre-wrap; color: var(--text-subtle); }

/* Reduzierte Bewegung heisst: Farbwechsel bleiben, Bewegung faellt weg */
@media (prefers-reduced-motion: reduce) {
    .btn-accent:active, .btn-ghost:active, .btn-danger-soft:active, .btn-success-soft:active,
    .btn-login:active, .icon-btn:active, .page-body button:active, .page-body input[type="submit"]:active,
    .page-body a.button:active, .vorlage-karte:active, .ansicht-kachel:hover { transform: none; }
}

/* Hintergrundaufgaben (Einstellungen) - je Lauf Name, Zustand mit Wort, zuletzt */
.laeufe-karte { margin-top: 18px; }
.lauf + .lauf { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--glass-border); }
.lauf-kopf { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 10px; margin-bottom: 4px; }
.lauf-text {
    margin: 10px 0 0; padding: 10px 12px; max-height: 180px; overflow: auto;
    border-radius: var(--radius-sm); background: #0a0c14;
    font-family: ui-monospace, 'Fira Code', monospace; font-size: 12px; color: var(--text-subtle);
    white-space: pre-wrap;
}
.dashboard-stoerung { margin-bottom: 18px; }

