/* Hidden attribute must always win */
[hidden] { display: none !important; }

/* ============================================================
   TGI Abrechnung — Enterprise Dashboard mit Charakter
   Inspiriert von Linear, Notion, Figma
   Kein generisches Bootstrap/Tailwind — einzigartig & unverwechselbar
   ============================================================ */

/* --- Google Font Import --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* --- Custom Properties — Das Herzstück des Designs --- */
:root {
    /* Core Palette */
    --indigo: #6366f1;
    --indigo-light: #818cf8;
    --indigo-dark: #4f46e5;
    --indigo-950: #1e1b4b;
    --indigo-bg: rgba(99, 102, 241, 0.06);
    --indigo-bg-hover: rgba(99, 102, 241, 0.1);

    --amber: #f59e0b;
    --amber-light: #fbbf24;
    --amber-dark: #d97706;
    --amber-bg: rgba(245, 158, 11, 0.06);
    --amber-bg-solid: #fffbeb;

    --emerald: #10b981;
    --emerald-light: #34d399;
    --emerald-dark: #059669;
    --emerald-bg: rgba(16, 185, 129, 0.06);
    --emerald-bg-solid: #ecfdf5;

    --rose: #f43f5e;
    --rose-light: #fb7185;
    --rose-dark: #e11d48;
    --rose-bg: rgba(244, 63, 94, 0.06);

    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-900: #0f172a;
    --slate-950: #020617;

    /* Semantic tokens */
    --color-primary: var(--indigo);
    --color-primary-hover: var(--indigo-dark);
    --color-primary-light: var(--indigo-bg);
    --color-danger: var(--rose);
    --color-danger-hover: var(--rose-dark);
    --color-success: var(--emerald);
    --color-success-light: var(--emerald-bg-solid);
    --color-warning: var(--amber);
    --color-warning-light: var(--amber-bg-solid);
    --color-text: var(--slate-800);
    --color-text-light: var(--slate-500);
    --color-text-muted: var(--slate-400);
    --color-bg: var(--slate-50);
    --color-surface: #ffffff;
    --color-border: var(--slate-200);
    --color-border-light: var(--slate-100);
    --color-sbc: var(--indigo);
    --color-sbc-bg: var(--indigo-bg);
    --color-netto-bg: var(--emerald-bg-solid);

    /* Navbar */
    --nav-bg: var(--slate-900);
    --nav-text: var(--slate-300);
    --nav-text-active: #ffffff;
    --nav-accent: var(--indigo);
    --nav-height: 56px;

    /* Shadows — layered for depth */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 8px -2px rgba(0, 0, 0, 0.06), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 12px 24px -4px rgba(0, 0, 0, 0.08), 0 4px 8px -4px rgba(0, 0, 0, 0.03);
    --shadow-xl: 0 24px 48px -8px rgba(0, 0, 0, 0.12), 0 8px 16px -8px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 32px 64px -12px rgba(0, 0, 0, 0.18);
    --shadow-indigo: 0 4px 14px -2px rgba(99, 102, 241, 0.25);
    --shadow-hover: 0 8px 24px -4px rgba(0, 0, 0, 0.1), 0 4px 8px -4px rgba(0, 0, 0, 0.04);

    /* Radii */
    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius: 8px;
    --radius-md: 10px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-2xl: 20px;
    --radius-full: 9999px;

    /* Transitions */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --duration-fast: 120ms;
    --duration-base: 200ms;
    --duration-slow: 300ms;
    --duration-modal: 400ms;

    /* Typography */
    --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'SF Mono', SFMono-Regular, ui-monospace, 'Cascadia Code', 'Fira Code', Menlo, Consolas, monospace;

    /* Section border colors */
    --section-stammdaten: var(--indigo);
    --section-buchhaltung: var(--amber);
    --section-positionen: var(--emerald);
    --section-teilnehmer: var(--slate-500);

    /* Z-indices */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-navbar: 500;
    --z-modal: 1000;
    --z-toast: 9999;
}


/* ============================================================
   RESET / BASE
   ============================================================ */

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

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--color-text);
    background: var(--color-bg);
    min-height: 100vh;
    font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
}

/* Tabular nums for all number inputs */
input[type="number"],
.text-right,
.gesamt-netto,
.gesamt-brutto,
.sbc-netto,
tfoot td,
tfoot th {
    font-variant-numeric: tabular-nums;
    font-feature-settings: 'tnum';
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.25;
    color: var(--color-text);
    letter-spacing: -0.02em;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.125rem; font-weight: 600; }
h4 { font-size: 0.9375rem; font-weight: 600; }

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--duration-fast) var(--ease-in-out);
}

a:hover {
    color: var(--color-primary-hover);
}

a:focus-visible {
    outline: 2px solid var(--indigo);
    outline-offset: 2px;
    border-radius: var(--radius-xs);
}

code {
    font-family: var(--font-mono);
    font-size: 0.8125em;
    background: var(--slate-100);
    padding: 0.2em 0.45em;
    border-radius: var(--radius-xs);
    color: var(--indigo-dark);
}

::selection {
    background: var(--indigo);
    color: white;
}


/* ============================================================
   ACCESSIBILITY
   ============================================================ */

.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--indigo);
    color: white;
    padding: 0.5rem 1rem;
    z-index: 10000;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 0 0 var(--radius) 0;
    transition: top var(--duration-base) var(--ease-out);
}

.skip-link:focus {
    top: 0;
    outline: none;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}


/* ============================================================
   SCREENS
   ============================================================ */

.screen {
    min-height: 100vh;
}


/* ============================================================
   LOGIN SCREEN — Zentriert, dramatisch, unvergesslich
   ============================================================ */

#login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(99, 102, 241, 0.15), transparent),
        radial-gradient(ellipse 60% 40% at 80% 100%, rgba(16, 185, 129, 0.08), transparent),
        var(--slate-50);
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

/* Subtle animated background pattern */
#login-screen::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 25% 25%, rgba(99, 102, 241, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(245, 158, 11, 0.03) 0%, transparent 50%);
    animation: loginBgPulse 8s ease-in-out infinite alternate;
}

@keyframes loginBgPulse {
    0% { opacity: 0.5; transform: scale(1); }
    100% { opacity: 1; transform: scale(1.05); }
}

.login-card {
    position: relative;
    background: var(--color-surface);
    padding: 2.75rem 2.5rem;
    border-radius: var(--radius-2xl);
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.03),
        var(--shadow-xl);
    width: 100%;
    max-width: 420px;
    animation: loginSlideUp var(--duration-modal) var(--ease-out) both;
}

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

.login-card h1 {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    text-align: center;
    margin-bottom: 0.25rem;
    background: linear-gradient(135deg, var(--indigo), var(--indigo-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-card .login-subtitle {
    text-align: center;
    color: var(--color-text-light);
    font-size: 0.9375rem;
    margin-bottom: 2rem;
}

.login-card h3 {
    margin-bottom: 0.75rem;
    font-size: 1.0625rem;
}

.login-card p {
    color: var(--color-text-light);
    margin-bottom: 1rem;
    font-size: 0.875rem;
    line-height: 1.6;
}


/* ============================================================
   NAVBAR — Dunkle, charaktervolle Navigation
   ============================================================ */

.navbar {
    display: flex;
    align-items: center;
    height: var(--nav-height);
    padding: 0 1.5rem;
    background: linear-gradient(180deg, var(--slate-900) 0%, #0d1323 100%);
    color: var(--nav-text);
    position: sticky;
    top: 0;
    z-index: var(--z-navbar);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06);
    gap: 0;
}

.nav-brand {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--nav-text-active);
    letter-spacing: -0.02em;
    white-space: nowrap;
    margin-right: 2.5rem;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    position: relative;
}

/* Farbiger Akzent-Dot vor dem Brand */
.nav-brand::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--indigo);
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.6);
    flex-shrink: 0;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex: 1;
}

.nav-link {
    color: var(--nav-text);
    font-size: 0.8125rem;
    font-weight: 500;
    padding: 0.375rem 0.875rem;
    border-radius: var(--radius-full);
    transition: all var(--duration-base) var(--ease-out);
    text-decoration: none;
    white-space: nowrap;
    position: relative;
}

.nav-link:hover {
    color: var(--nav-text-active);
    background: rgba(255, 255, 255, 0.06);
    text-decoration: none;
}

.nav-link.active {
    color: white;
    background: var(--indigo);
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.3);
    font-weight: 600;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-left: auto;
    white-space: nowrap;
}

.nav-user #user-name {
    color: var(--slate-300);
    font-size: 0.8125rem;
    font-weight: 500;
}

.nav-user .badge {
    font-size: 0.6875rem;
    padding: 0.15rem 0.5rem;
    background: rgba(99, 102, 241, 0.15);
    color: var(--indigo-light);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

/* SBC visibility */
.sbc-only {
    display: none;
}

body.rolle-sbc .sbc-only {
    display: revert;
}

/* SBC highlight */
.sbc-highlight {
    background: var(--indigo-bg) !important;
}


/* ============================================================
   CONTAINER — Hauptinhalt
   ============================================================ */

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem 2rem 3rem;
}


/* ============================================================
   PAGE HEADER
   ============================================================ */

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.75rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.page-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--slate-900);
    position: relative;
}

/* Dezenter Indigo-Unterstrich unter der Seitenüberschrift */
.page-header h2::after {
    content: '';
    display: block;
    width: 32px;
    height: 3px;
    background: var(--indigo);
    border-radius: 2px;
    margin-top: 0.375rem;
}


/* ============================================================
   BUTTONS — Ausdrucksvoll, nicht generisch
   ============================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    font-family: var(--font-sans);
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.4;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface);
    color: var(--color-text);
    cursor: pointer;
    transition:
        background var(--duration-fast) var(--ease-in-out),
        border-color var(--duration-fast) var(--ease-in-out),
        box-shadow var(--duration-fast) var(--ease-in-out),
        transform var(--duration-fast) var(--ease-in-out);
    white-space: nowrap;
    text-decoration: none;
    user-select: none;
    -webkit-user-select: none;
}

.btn:hover {
    background: var(--slate-50);
    border-color: var(--slate-300);
    box-shadow: var(--shadow-xs);
    text-decoration: none;
}

.btn:active {
    transform: scale(0.97);
}

.btn:focus-visible {
    outline: 2px solid var(--indigo);
    outline-offset: 2px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--indigo), var(--indigo-dark));
    color: white;
    border: 1px solid var(--indigo-dark);
    box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--indigo-dark), #4338ca);
    border-color: #4338ca;
    box-shadow: var(--shadow-indigo);
    color: white;
}

.btn-danger {
    background: var(--color-surface);
    color: var(--rose);
    border-color: rgba(244, 63, 94, 0.3);
}

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

.btn-outline {
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text-light);
}

.btn-outline:hover {
    background: var(--slate-50);
    border-color: var(--slate-300);
    color: var(--color-text);
}

.btn-sm {
    padding: 0.3125rem 0.75rem;
    font-size: 0.75rem;
    border-radius: var(--radius-sm);
}

.btn-full {
    width: 100%;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    border-radius: var(--radius-md);
}

/* Navbar-Buttons: spezieller Style */
.navbar .btn {
    border-color: rgba(255, 255, 255, 0.12);
    color: var(--slate-300);
    background: transparent;
    font-size: 0.75rem;
    padding: 0.25rem 0.625rem;
}

.navbar .btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    color: white;
}


/* ============================================================
   FORMS — Material Design inspiriert, aber eigen
   ============================================================ */

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.form-group label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-light);
}

.form-group-full {
    grid-column: 1 / -1;
}

.form-group-inline {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
}

.form-group-inline label {
    text-transform: none;
    font-size: 0.8125rem;
    white-space: nowrap;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.25rem 1.5rem;
}

/* Inputs — Minimalistisch mit Bottom-Border */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="tel"],
input[type="url"],
select,
textarea {
    font-family: var(--font-sans);
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--color-text);
    padding: 0.5rem 0;
    background: transparent;
    border: none;
    border-bottom: 2px solid var(--slate-200);
    border-radius: 0;
    transition:
        border-color var(--duration-base) var(--ease-out),
        box-shadow var(--duration-base) var(--ease-out),
        background var(--duration-base) var(--ease-out);
    width: 100%;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
select:focus,
textarea:focus {
    border-bottom-color: var(--indigo);
    box-shadow: 0 2px 0 0 var(--indigo);
}

input[type="text"]::placeholder,
input[type="email"]::placeholder,
input[type="password"]::placeholder,
input[type="number"]::placeholder,
textarea::placeholder {
    color: var(--color-text-muted);
    font-weight: 400;
}

/* Textarea — leichter Hintergrund */
textarea {
    padding: 0.625rem 0.75rem;
    background: var(--slate-50);
    border: 1px solid var(--slate-200);
    border-radius: var(--radius);
    resize: vertical;
    min-height: 60px;
}

textarea:focus {
    background: var(--color-surface);
    border-color: var(--indigo);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.08);
}

/* Select — Custom Arrow */
select {
    padding-right: 2rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M6 8L1.5 3.5h9z' fill='%2364748b'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.25rem center;
    cursor: pointer;
}

select:focus {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M6 8L1.5 3.5h9z' fill='%236366f1'/%3E%3C/svg%3E");
}

/* Date inputs — Fix native styling */
input[type="date"] {
    padding-right: 0.25rem;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.5;
    transition: opacity var(--duration-fast);
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

/* Custom Checkboxen */
input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid var(--slate-300);
    border-radius: var(--radius-xs);
    cursor: pointer;
    display: inline-grid;
    place-content: center;
    transition: all var(--duration-fast) var(--ease-in-out);
    vertical-align: middle;
    margin-right: 0.375rem;
    flex-shrink: 0;
}

input[type="checkbox"]::before {
    content: '';
    width: 10px;
    height: 10px;
    clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
    transform: scale(0);
    transition: transform var(--duration-fast) var(--ease-spring);
    background: white;
}

input[type="checkbox"]:checked {
    background: var(--indigo);
    border-color: var(--indigo);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}

input[type="checkbox"]:checked::before {
    transform: scale(1);
}

input[type="checkbox"]:focus-visible {
    outline: 2px solid var(--indigo);
    outline-offset: 2px;
}

/* Checkbox-Zeile */
.checkbox-row {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.checkbox-row label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--color-text);
    font-weight: 500;
}

/* Form Actions */
.form-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
    flex-wrap: wrap;
}


/* ============================================================
   CARDS / SECTIONS — Farbcodierte Bordüre, kein generisches Card-Design
   ============================================================ */

.card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    margin-bottom: 1.25rem;
    border: 1px solid var(--slate-200);
    overflow: hidden;
    transition: box-shadow var(--duration-base) var(--ease-out);
    position: relative;
}

/* Farbcodierte linke Bordüre */
.card:nth-of-type(1) {
    border-left: 3px solid var(--section-stammdaten);
}

.card:nth-of-type(2) {
    border-left: 3px solid var(--section-buchhaltung);
}

.card:nth-of-type(3) {
    border-left: 3px solid var(--section-positionen);
}

.card:nth-of-type(4) {
    border-left: 3px solid var(--section-teilnehmer);
}

.card:hover {
    box-shadow: var(--shadow-sm);
}


/* ============================================================
   SECTION HEADER — Clean, mit farbigem Dot
   ============================================================ */

.section-header {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.875rem 1.25rem;
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--color-text);
    cursor: pointer;
    user-select: none;
    transition: background var(--duration-fast) var(--ease-in-out);
    border-bottom: 1px solid transparent;
}

.section-header:hover {
    background: var(--slate-50);
}

/* Farbiger Dot vor dem Titel */
.card:nth-of-type(1) .section-header::after {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--section-stammdaten);
    order: -1;
    flex-shrink: 0;
}

.card:nth-of-type(2) .section-header::after {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--section-buchhaltung);
    order: -1;
    flex-shrink: 0;
}

.card:nth-of-type(3) .section-header::after {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--section-positionen);
    order: -1;
    flex-shrink: 0;
}

.card:nth-of-type(4) .section-header::after {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--section-teilnehmer);
    order: -1;
    flex-shrink: 0;
}

/* Section-Header Labels: passende Farben */
.card:nth-of-type(1) .section-body label {
    color: var(--indigo-dark);
}

.card:nth-of-type(2) .section-body label {
    color: var(--amber-dark);
}

.card:nth-of-type(3) .section-body label {
    color: var(--emerald-dark);
}

.card:nth-of-type(4) .section-body label {
    color: var(--slate-600);
}

.collapse-arrow {
    font-size: 0.7em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25em;
    height: 1.25em;
    transition: transform var(--duration-base) var(--ease-out);
    color: var(--color-text-muted);
}

.section-body {
    padding: 0.5rem 1.25rem 1.25rem;
}

/* Smooth collapse transition */
.section-body[hidden] {
    display: none;
}


/* ============================================================
   FILTER BAR
   ============================================================ */

.filter-bar {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.filter-bar .form-group-inline label {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
    font-weight: 600;
}

.filter-bar select,
.filter-bar input[type="number"] {
    padding: 0.4375rem 0.625rem;
    background: var(--slate-50);
    border: 1px solid var(--slate-200);
    border-bottom: 2px solid var(--slate-200);
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
}

.filter-bar select:focus,
.filter-bar input[type="number"]:focus {
    border-color: var(--indigo);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.08);
    background: var(--color-surface);
}

.filter-bar select {
    padding-right: 2rem;
}


/* ============================================================
   DATA TABLE — Elegant, Spreadsheet-artig
   ============================================================ */

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.8125rem;
}

.data-table thead th {
    padding: 0.625rem 0.75rem;
    text-align: left;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
    background: var(--slate-50);
    border-bottom: 2px solid var(--slate-200);
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 1;
}

.data-table thead th.text-right {
    text-align: right;
}

.data-table tbody td {
    padding: 0.625rem 0.75rem;
    border-bottom: 1px solid var(--slate-100);
    vertical-align: middle;
    transition: background var(--duration-fast) var(--ease-in-out);
}

/* Abwechselnde Zeilen */
.data-table tbody tr:nth-child(even) td {
    background: var(--slate-50);
}

.data-table tbody tr:hover td {
    background: var(--indigo-bg-hover);
}

.data-table td.text-right,
.data-table th.text-right {
    text-align: right;
}

.data-table td.text-center,
.data-table th.text-center {
    text-align: center;
}

.data-table td.actions {
    white-space: nowrap;
    display: flex;
    gap: 0.375rem;
    align-items: center;
}

/* Tfoot — farbiger Hintergrund-Block */
.data-table tfoot td {
    padding: 0.75rem;
    font-weight: 600;
    background: linear-gradient(135deg, var(--slate-50), var(--indigo-bg));
    border-top: 2px solid var(--slate-200);
    border-bottom: none;
}


/* ============================================================
   POSITIONSTABELLE — Kompakt, Spreadsheet-Feeling
   ============================================================ */

.positions-table {
    font-size: 0.8125rem;
}

.positions-table thead th {
    font-size: 0.625rem;
    padding: 0.5rem 0.5rem;
}

.positions-table tbody td {
    padding: 0.25rem 0.125rem;
}

.positions-table .pos-row td {
    border-bottom: 1px solid var(--slate-100);
}

.positions-table .pos-row:nth-child(even) td {
    background: rgba(248, 250, 252, 0.5);
}

.positions-table .pos-row:hover td {
    background: rgba(99, 102, 241, 0.04);
}

/* Position inputs — unsichtbare Borders, flat */
.positions-table input {
    border: none !important;
    border-bottom: none !important;
    background: transparent !important;
    font-family: var(--font-sans);
    font-size: 0.8125rem;
    padding: 0.375rem 0.375rem;
    width: 100%;
    border-radius: var(--radius-xs);
    transition: all var(--duration-fast) var(--ease-in-out);
    box-shadow: none !important;
}

.positions-table input:hover {
    background: rgba(99, 102, 241, 0.04) !important;
}

.positions-table input:focus {
    background: rgba(99, 102, 241, 0.06) !important;
    outline: 2px solid var(--indigo);
    outline-offset: -1px;
}

.input-full {
    width: 100%;
}

.input-right {
    text-align: right;
}

/* Netto-Spalte — grüner Akzent */
.positions-table .gesamt-netto {
    color: var(--emerald-dark);
    font-weight: 600;
    background: rgba(16, 185, 129, 0.04);
}

/* Brutto-Spalte — leicht grau */
.positions-table .gesamt-brutto {
    color: var(--slate-600);
    background: var(--slate-50);
}

/* SBC-Spalten — Indigo-Akzent */
.positions-table .sbc-only {
    background: rgba(99, 102, 241, 0.03);
}

.positions-table .sbc-netto {
    color: var(--indigo);
    font-weight: 600;
}

/* Summenzeile */
.positions-table tfoot td {
    padding: 0.625rem 0.5rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.04), rgba(16, 185, 129, 0.04));
    border-top: 2px solid var(--slate-200);
    font-size: 0.8125rem;
}

.positions-table #total-netto {
    color: var(--emerald-dark);
}

.positions-table #total-sbc-netto {
    color: var(--indigo);
}


/* ============================================================
   TEILNEHMER TABELLE
   ============================================================ */

.teilnehmer-table {
    font-size: 0.8125rem;
}


/* ============================================================
   EVENT-LISTE — Elegante Zeilen mit Hover-Effekt
   ============================================================ */

#event-table-container .data-table tbody tr {
    cursor: pointer;
    transition:
        background var(--duration-fast) var(--ease-in-out),
        transform var(--duration-fast) var(--ease-out),
        box-shadow var(--duration-fast) var(--ease-out);
}

#event-table-container .data-table tbody tr:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

#event-table-container .data-table tbody tr:hover td {
    background: var(--indigo-bg);
}

/* VA-Nummer: Badge-style, Monospace */
#event-table-container .data-table tbody td:first-child {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--indigo);
    letter-spacing: 0.02em;
}

/* Unternehmen: Bold */
#event-table-container .data-table tbody td:nth-child(2) {
    font-weight: 600;
    color: var(--slate-800);
}

/* Datum: grau */
#event-table-container .data-table tbody td:nth-child(3) {
    color: var(--color-text-light);
    font-size: 0.8125rem;
}

/* Betrag: monospace, grün */
#event-table-container .data-table tbody td.text-right {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

/* Netto Betrag grün wenn positiv */
#event-table-container .data-table tbody td:nth-child(5) {
    color: var(--emerald-dark);
    font-weight: 600;
}


/* ============================================================
   STATUS PILLS / BADGES
   ============================================================ */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.1875rem 0.625rem;
    font-size: 0.6875rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    letter-spacing: 0.02em;
    white-space: nowrap;
    line-height: 1.4;
    background: var(--slate-100);
    color: var(--slate-600);
    border: 1px solid transparent;
}

/* Entwurf: Amber, Outline-Stil */
.badge-draft {
    background: transparent;
    color: var(--amber-dark);
    border: 1.5px solid var(--amber);
}

/* Abgeschlossen: Emerald, Filled */
.badge-done {
    background: var(--emerald);
    color: white;
    border-color: var(--emerald);
    box-shadow: 0 1px 3px rgba(16, 185, 129, 0.25);
}

/* Exportiert: Indigo, Filled */
.badge-exported {
    background: var(--indigo);
    color: white;
    border-color: var(--indigo);
    box-shadow: 0 1px 3px rgba(99, 102, 241, 0.25);
}


/* ============================================================
   MESSAGES
   ============================================================ */

.error-msg {
    background: var(--rose-bg);
    color: var(--rose-dark);
    border: 1px solid rgba(244, 63, 94, 0.2);
    border-left: 3px solid var(--rose);
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    font-size: 0.8125rem;
    font-weight: 500;
    margin-top: 0.75rem;
}

.success-msg {
    background: var(--emerald-bg-solid);
    color: var(--emerald-dark);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-left: 3px solid var(--emerald);
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    font-size: 0.8125rem;
    font-weight: 500;
    margin-top: 0.75rem;
}

.hint {
    color: var(--color-text-muted);
    font-size: 0.8125rem;
    line-height: 1.5;
    margin-top: 0.5rem;
}


/* ============================================================
   LOADING & EMPTY STATES
   ============================================================ */

.loading {
    color: var(--color-text-muted);
    font-style: italic;
    font-size: 0.875rem;
    padding: 2rem 1rem;
    text-align: center;
    position: relative;
}

.loading::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--slate-200);
    border-top-color: var(--indigo);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: 0.5rem;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.empty-state {
    color: var(--color-text-muted);
    text-align: center;
    padding: 3rem 2rem;
    font-size: 0.9375rem;
}


/* ============================================================
   TOAST — Slide-in von rechts
   ============================================================ */

.toast {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    left: auto;
    transform: translateX(120%);
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-md);
    color: white;
    font-size: 0.8125rem;
    font-weight: 600;
    z-index: var(--z-toast);
    opacity: 0;
    transition:
        opacity var(--duration-slow) var(--ease-out),
        transform var(--duration-slow) var(--ease-out);
    pointer-events: none;
    max-width: 380px;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(8px);
}

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

.toast-success {
    background: linear-gradient(135deg, var(--emerald), var(--emerald-dark));
}

.toast-error {
    background: linear-gradient(135deg, var(--rose), var(--rose-dark));
}

.toast-info {
    background: linear-gradient(135deg, var(--indigo), var(--indigo-dark));
}


/* ============================================================
   MODAL — Standard (für Benutzerverwaltung etc.)
   ============================================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: overlayFadeIn var(--duration-base) var(--ease-out);
}

.modal-overlay[hidden] {
    display: none;
}

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

.modal-overlay .modal {
    position: relative;
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    padding: 1.75rem;
    min-width: 380px;
    max-width: 540px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-2xl);
    animation: modalSlideUp var(--duration-modal) var(--ease-out) both;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--color-border);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.0625rem;
    font-weight: 700;
}

.modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--slate-100);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--slate-500);
    transition: all var(--duration-fast) var(--ease-in-out);
    line-height: 1;
}

.modal-close:hover {
    background: var(--slate-200);
    color: var(--slate-800);
}


/* ============================================================
   EVENT MODAL — Großes Overlay/Pop-Up für das Event-Formular
   ============================================================ */

.event-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    padding: 2.5vh 0;
    overflow-y: auto;
    animation: overlayFadeIn var(--duration-base) var(--ease-out);
}

.event-modal-overlay[hidden] {
    display: none;
}

.event-modal {
    position: relative;
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    padding: 2rem 2.5rem;
    width: 100%;
    max-width: 1100px;
    max-height: 90vh;
    overflow-y: auto;
    margin: auto;
    box-shadow: var(--shadow-2xl);
    animation: eventModalSlideUp var(--duration-modal) var(--ease-out) both;
}

@keyframes eventModalSlideUp {
    from {
        opacity: 0;
        transform: translateY(32px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Schließen-Button im Event-Modal — oben rechts, sticky */
.event-modal > .modal-close {
    position: sticky;
    top: 0;
    float: right;
    z-index: 10;
    width: 36px;
    height: 36px;
    font-size: 1.375rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
}


/* ============================================================
   BACKUP CODES (2FA Setup)
   ============================================================ */

.backup-codes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.5rem;
    margin: 1rem 0;
}

.backup-code {
    display: block;
    text-align: center;
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 0.5rem;
    background: var(--slate-50);
    border: 1px dashed var(--slate-300);
    border-radius: var(--radius);
    color: var(--indigo);
    letter-spacing: 0.05em;
}

.qr-code {
    display: block;
    max-width: 200px;
    margin: 1rem auto;
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
}


/* ============================================================
   INLINE ROW
   ============================================================ */

.inline-row {
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
    flex-wrap: wrap;
}


/* ============================================================
   SUB-HEADING (in Buchhaltung)
   ============================================================ */

.sub-heading {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--slate-600);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding-bottom: 0.5rem;
    margin: 1.5rem 0 0.75rem;
    border-bottom: 1px solid var(--color-border);
}


/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Desktop: volle Breite, 2-Spalten Grid */
@media (min-width: 1024px) {
    .form-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Tablet */
@media (max-width: 1023px) and (min-width: 641px) {
    .container {
        padding: 1.5rem;
    }

    .form-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem 1.25rem;
    }

    .data-table {
        font-size: 0.75rem;
    }

    .positions-table thead th {
        font-size: 0.5625rem;
    }
}

/* Mobile */
@media (max-width: 640px) {
    .container {
        padding: 1rem;
    }

    .navbar {
        flex-wrap: wrap;
        height: auto;
        padding: 0.625rem 1rem;
        gap: 0.5rem;
    }

    .nav-brand {
        margin-right: auto;
        font-size: 0.9375rem;
    }

    .nav-links {
        order: 3;
        width: 100%;
        overflow-x: auto;
        padding-bottom: 0.25rem;
        gap: 0.125rem;
        -ms-overflow-style: none;
        scrollbar-width: none;
    }

    .nav-links::-webkit-scrollbar {
        display: none;
    }

    .nav-user {
        order: 2;
        gap: 0.375rem;
    }

    .nav-user #user-name {
        display: none;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        margin-bottom: 1.25rem;
    }

    .page-header h2 {
        font-size: 1.25rem;
    }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        padding: 1rem;
    }

    .filter-bar .form-group-inline {
        flex-direction: column;
        align-items: stretch;
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .card {
        border-radius: var(--radius);
    }

    .section-header {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }

    .section-body {
        padding: 0.5rem 1rem 1rem;
    }

    /* Scrollbare Tabellen */
    .table-responsive {
        margin: 0 -1rem;
        padding: 0 0;
    }

    .data-table thead th,
    .data-table tbody td {
        padding: 0.5rem 0.5rem;
    }

    .data-table td.actions {
        flex-direction: column;
        gap: 0.25rem;
    }

    .form-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .form-actions .btn {
        width: 100%;
    }

    /* Event Modal mobile */
    .event-modal {
        padding: 1.25rem;
        border-radius: var(--radius-lg);
        max-height: 95vh;
    }

    .event-modal-overlay {
        padding: 1vh 0;
    }

    .toast {
        right: 0.75rem;
        bottom: 0.75rem;
        max-width: calc(100vw - 1.5rem);
    }

    .login-card {
        padding: 2rem 1.5rem;
        border-radius: var(--radius-xl);
    }

    .modal-overlay .modal {
        min-width: 0;
        width: calc(100% - 2rem);
        margin: 1rem;
        padding: 1.25rem;
    }
}


/* ============================================================
   PRINT STYLES
   ============================================================ */

@media print {
    body {
        background: white;
        color: black;
        font-size: 10pt;
    }

    .navbar,
    .filter-bar,
    .form-actions,
    .btn,
    .btn-primary,
    .btn-danger,
    .btn-sm,
    .toast,
    .skip-link,
    .modal-overlay,
    .event-modal-overlay,
    #logout-btn {
        display: none !important;
    }

    .container {
        max-width: none;
        padding: 0;
    }

    .card {
        border: 1px solid #ccc;
        page-break-inside: avoid;
        box-shadow: none;
    }

    .section-body {
        display: block !important;
    }

    .section-body[hidden] {
        display: block !important;
    }

    .data-table {
        font-size: 9pt;
    }

    .data-table thead th {
        background: #f0f0f0 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .badge {
        border: 1px solid #999;
        color: black;
    }

    a {
        color: inherit;
        text-decoration: none;
    }

    input, select, textarea {
        border: 1px solid #ccc !important;
        padding: 2px 4px !important;
    }
}


/* ============================================================
   FORCED COLORS — Windows High Contrast Mode
   ============================================================ */

@media (forced-colors: active) {
    .btn {
        border: 1px solid ButtonText;
    }

    .btn-primary {
        background: Highlight;
        color: HighlightText;
        border-color: Highlight;
    }

    .badge {
        border: 1px solid;
    }

    input[type="checkbox"] {
        border: 2px solid ButtonText;
    }

    input[type="checkbox"]:checked {
        background: Highlight;
        border-color: Highlight;
    }

    .section-header {
        border-bottom: 1px solid;
    }

    .card {
        border: 1px solid;
    }

    .toast {
        border: 1px solid;
    }

    .modal-overlay,
    .event-modal-overlay {
        background: Canvas;
    }

    .modal-overlay .modal,
    .event-modal {
        border: 2px solid;
    }
}


/* ============================================================
   SCROLLBAR CUSTOMIZATION (Webkit)
   ============================================================ */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

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

::-webkit-scrollbar-thumb:hover {
    background: var(--slate-400);
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--slate-300) transparent;
}


/* ============================================================
   MICRO ANIMATIONS & TRANSITIONS
   ============================================================ */

/* Focus ring global */
*:focus-visible {
    outline: 2px solid var(--indigo);
    outline-offset: 2px;
}

/* Smooth all interactive elements */
button,
a,
input,
select,
textarea,
.card,
.badge,
.nav-link {
    transition-property: background-color, border-color, color, box-shadow, opacity, transform;
    transition-duration: var(--duration-base);
    transition-timing-function: var(--ease-in-out);
}

/* Card scale on hover */
#event-table-container .table-responsive {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}


/* ============================================================
   ADDITIONAL UTILITY / REFINEMENT
   ============================================================ */

/* Buchhaltung section h4 (inline subsections) */
.card:nth-of-type(2) h4 {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--amber-dark);
    padding-bottom: 0.5rem;
    margin: 1.5rem 0 0.75rem;
    border-bottom: 1px solid rgba(245, 158, 11, 0.2);
}

/* Login card form spacing */
.login-card .form-group {
    margin-bottom: 1.25rem;
}

.login-card .btn-full {
    margin-top: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
    background: linear-gradient(135deg, var(--indigo), #4f46e5, #4338ca);
    border: none;
    box-shadow: var(--shadow-indigo);
}

.login-card .btn-full:hover {
    box-shadow: 0 6px 20px -2px rgba(99, 102, 241, 0.4);
    transform: translateY(-1px);
}

.login-card .btn-full:active {
    transform: translateY(0) scale(0.98);
}

/* Login form inputs — leicht anders als im Hauptformular */
.login-card input[type="text"],
.login-card input[type="password"] {
    padding: 0.625rem 0.75rem;
    background: var(--slate-50);
    border: 1px solid var(--slate-200);
    border-bottom: 2px solid var(--slate-300);
    border-radius: var(--radius);
}

.login-card input[type="text"]:focus,
.login-card input[type="password"]:focus {
    border-color: var(--indigo);
    background: var(--color-surface);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* SBC Overview styling */
#sbc-table-container .data-table tbody td.text-right {
    font-family: var(--font-mono);
    color: var(--indigo);
    font-weight: 600;
}

#sbc-table-container .data-table tbody td:first-child a {
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--indigo);
}

#sbc-table-container .data-table tfoot td {
    background: linear-gradient(135deg, var(--indigo-bg), rgba(99, 102, 241, 0.08));
}

/* Benutzerverwaltung Actions */
#users-table-container .data-table td.actions {
    gap: 0.25rem;
}

/* SBC Monatsübersicht: Rechnungsnummer input */
#sbc-rg-nummer {
    padding: 0.4375rem 0.625rem;
    background: var(--slate-50);
    border: 1px solid var(--slate-200);
    border-bottom: 2px solid var(--slate-200);
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    width: 200px;
}

#sbc-rg-nummer:focus {
    border-color: var(--indigo);
    background: var(--color-surface);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.08);
}


/* ============================================================
   SUBTLE AMBIENT EFFECTS
   ============================================================ */

/* Dezenter Gradient-Streifen unter der Navbar */
.navbar::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        var(--indigo) 20%,
        var(--emerald) 50%,
        var(--amber) 80%,
        transparent
    );
    opacity: 0.4;
}

/* App-Screen Hintergrund mit subtiler Textur */
#app-screen {
    background:
        radial-gradient(ellipse 80% 30% at 50% 0%, rgba(99, 102, 241, 0.03), transparent 70%),
        var(--color-bg);
    min-height: 100vh;
}


/* ============================================================
   REDUCED MOTION — Barrierefreiheit
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .login-card {
        animation: none;
    }

    .modal-overlay .modal,
    .event-modal {
        animation: none;
    }

    .toast {
        transition: opacity 0.01ms;
    }
}


/* ============================================================
   DARK MODE HINT (Optional, prepared)
   Uncomment to enable auto dark mode support
   ============================================================ */
/*
@media (prefers-color-scheme: dark) {
    :root {
        --color-bg: #0f172a;
        --color-surface: #1e293b;
        --color-text: #e2e8f0;
        --color-text-light: #94a3b8;
        --color-text-muted: #64748b;
        --color-border: #334155;
        --color-border-light: #1e293b;
    }
}
*/

/* ── Tab Navigation ────────────────────── */
.popup-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--color-border, #e2e8f0);
    margin: -1.5rem -1.5rem 1.5rem -1.5rem;
    padding: 0 1.5rem;
    background: #f8fafc;
    border-radius: var(--radius, 8px) var(--radius, 8px) 0 0;
    overflow-x: auto;
    position: sticky;
    top: 0;
    z-index: 10;
}

.popup-tab {
    padding: 0.875rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #64748b;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: all 150ms ease;
}

.popup-tab:hover {
    color: #1e293b;
    background: rgba(0,0,0,0.03);
}

.popup-tab.active {
    color: #6366f1;
    border-bottom-color: #6366f1;
    font-weight: 600;
}

.tab-panel {
    padding: 0.5rem 0;
}

.tab-panel[hidden] {
    display: none !important;
}

/* ── Popup Header ────────────────────── */
.popup-event-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
}

.popup-event-header .status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.popup-event-header .status-dot.entwurf { background: #f59e0b; }
.popup-event-header .status-dot.abgeschlossen { background: #10b981; }
.popup-event-header .status-dot.exportiert { background: #6366f1; }

.popup-event-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    flex: 1;
}

.popup-event-header .status-pill {
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-weight: 500;
}

.popup-event-header .status-pill.entwurf { background: #fef3c7; color: #92400e; }
.popup-event-header .status-pill.abgeschlossen { background: #d1fae5; color: #065f46; }
.popup-event-header .status-pill.exportiert { background: #e0e7ff; color: #3730a3; }


/* ── Phase Tracker ────────────────────── */
.phase-tracker {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0.75rem 0;
}

.phase-steps {
    display: flex;
    align-items: center;
    gap: 0;
    flex: 1;
}

.phase-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
    transition: all 150ms ease;
    position: relative;
    z-index: 1;
}

.phase-step:hover .phase-circle {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.phase-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid #cbd5e1;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: #94a3b8;
    transition: all 200ms ease;
}

.phase-step.done .phase-circle {
    background: #6366f1;
    border-color: #6366f1;
    color: #fff;
}

.phase-step.done .phase-circle::after {
    content: "\2713";
    font-size: 1rem;
}

.phase-step.done .phase-circle {
    font-size: 0;
}

.phase-step.cancelled .phase-circle {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #dc2626;
    opacity: 0.6;
}

.phase-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: #94a3b8;
    white-space: nowrap;
}

.phase-step.done .phase-label {
    color: #6366f1;
    font-weight: 600;
}

.phase-step.cancelled .phase-label {
    text-decoration: line-through;
    color: #dc2626;
    opacity: 0.6;
}

.phase-line {
    flex: 1;
    height: 2px;
    background: #e2e8f0;
    min-width: 2rem;
    margin-bottom: 1.2rem;
    transition: background 200ms ease;
}

.phase-line.done {
    background: #6366f1;
}

.btn-storno {
    padding: 0.4rem 1rem;
    border: 2px solid #fca5a5;
    border-radius: 999px;
    background: #fff;
    color: #dc2626;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 150ms ease;
    white-space: nowrap;
}

.btn-storno:hover {
    background: #fef2f2;
}

.btn-storno.active {
    background: #dc2626;
    border-color: #dc2626;
    color: #fff;
}

.popup-event-header .status-dot.anfrage { background: #f59e0b; }
.popup-event-header .status-dot.buchung { background: #6366f1; }
.popup-event-header .status-dot.beendet { background: #10b981; }
.popup-event-header .status-dot.storno { background: #dc2626; }


/* ── Workflow Checklist ────────────────── */
.workflow-checklist {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.5rem;
    padding: 0.75rem 0 0.25rem;
    border-top: 1px solid #f1f5f9;
    margin-top: 0.5rem;
}

.checklist-item label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: #475569;
    cursor: pointer;
    padding: 0.2rem 0;
    transition: color 150ms;
}

.checklist-item label:hover {
    color: #1e293b;
}

.checklist-item input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: #6366f1;
    cursor: pointer;
}

.checklist-item input[type="checkbox"]:checked + span,
.checklist-item input:checked ~ * {
    color: #6366f1;
}

.checklist-storno label {
    color: #dc2626;
}

.checklist-storno input[type="checkbox"] {
    accent-color: #dc2626;
}
