/* APP-2.2.0-013: einheitliches Auditoriu-Dark-Theme ohne schwarze Inhaltsflächen */
html.dark {
    --ink: #e7ebf3;
    --muted: #a9b4c8;
    --line: #34425e;
    --soft: #0a0f19;
    --paper: #1d2539;
    --surface: #1d2539;
    --primary: #2b62dc;
    --primary-light: #1f4fc1;
    --info: #7da2ff;
    --ok: #62c98d;
    --warn: #f7b955;
    --danger: #ff8d86;
    --control-bg: #202a40;
    --control-text: #e7ebf3;
    --control-placeholder: #a9b4c8;
    --control-border: #52627f;
    --control-border-hover: #7183a4;
    --control-focus: #93b4ff;
    --control-focus-ring: rgba(147, 180, 255, .28);
    --form-divider: #34425e;
    color-scheme: dark;
}

html.dark,
html.dark body,
html.dark .has-app-shell,
html.dark .main-content {
    background: #0a0f19 !important;
    color: #e7ebf3 !important;
}

html.dark .topbar {
    background: #151b2a !important;
    border-bottom: 1px solid #34425e !important;
    box-shadow: none !important;
}

html.dark .topbar__logo,
html.dark .topbar__nav a,
html.dark .topbar__icon,
html.dark .topbar__user,
html.dark .topbar__username {
    color: #e7ebf3 !important;
}

html.dark .topbar__nav a:hover,
html.dark .topbar__nav a.active,
html.dark .topbar__icon:hover,
html.dark .topbar__user:hover {
    background: #202a40 !important;
    color: #ffffff !important;
}

html.dark .card,
html.dark .stat-card,
html.dark .data-card,
html.dark .filter-bar,
html.dark .form-card,
html.dark .info-card,
html.dark .ticket-message,
html.dark .login-card,
html.dark .empty-state,
html.dark .main-content > details,
html.dark .main-content section.card,
html.dark .main-content article.card {
    background: #1d2539 !important;
    border-color: #34425e !important;
    color: #e7ebf3 !important;
    box-shadow: none !important;
}

html.dark .card:hover,
html.dark .stat-card:hover,
html.dark .data-card:hover {
    transform: none !important;
    box-shadow: none !important;
}

html.dark .card-header,
html.dark .detail-header,
html.dark .page-header,
html.dark details > summary,
html.dark .form-disclosure > summary,
html.dark .task-disclosure > summary {
    color: #f1f5f9 !important;
}

html.dark details[open] > summary,
html.dark .form-disclosure[open] > summary,
html.dark .task-disclosure[open] > summary {
    border-bottom-color: #34425e !important;
}

html.dark h1,
html.dark h2,
html.dark h3,
html.dark h4,
html.dark .form-label,
html.dark label,
html.dark legend,
html.dark .detail-meta-value,
html.dark .stat-card__value {
    color: #e7ebf3 !important;
}

html.dark p,
html.dark small,
html.dark .form-hint,
html.dark .detail-meta-label,
html.dark .stat-card__label,
html.dark .page-header p,
html.dark .card-header p,
html.dark .breadcrumbs,
html.dark .empty-state__text {
    color: #a9b4c8 !important;
}

/* Alle Eingaben erhalten dieselbe klare Fläche wie im Benutzerformular. */
html.dark .main-content input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
html.dark .main-content select,
html.dark .main-content textarea,
html.dark .main-content .form-input,
html.dark .main-content .form-select,
html.dark .main-content .form-textarea,
html.dark .structured-form input:not([type="checkbox"]):not([type="radio"]),
html.dark .structured-form select,
html.dark .structured-form textarea,
html.dark .task-form-grid input:not([type="checkbox"]):not([type="radio"]),
html.dark .task-form-grid select,
html.dark .task-form-grid textarea {
    background: #202a40 !important;
    color: #e7ebf3 !important;
    border: 1px solid #52627f !important;
    border-radius: 10px !important;
    box-shadow: none !important;
    color-scheme: dark;
}

html.dark .main-content input::placeholder,
html.dark .main-content textarea::placeholder,
html.dark .structured-form input::placeholder,
html.dark .structured-form textarea::placeholder {
    color: #a9b4c8 !important;
    opacity: 1 !important;
}

html.dark .main-content input:not([type="checkbox"]):not([type="radio"]):hover,
html.dark .main-content select:hover,
html.dark .main-content textarea:hover {
    border-color: #7183a4 !important;
}

html.dark .main-content input:not([type="checkbox"]):not([type="radio"]):focus,
html.dark .main-content input:not([type="checkbox"]):not([type="radio"]):focus-visible,
html.dark .main-content select:focus,
html.dark .main-content select:focus-visible,
html.dark .main-content textarea:focus,
html.dark .main-content textarea:focus-visible {
    outline: none !important;
    border-color: #93b4ff !important;
    box-shadow: 0 0 0 3px rgba(147, 180, 255, .28) !important;
}

html.dark .main-content select option {
    background: #202a40 !important;
    color: #e7ebf3 !important;
}

html.dark .username-input-prefix,
html.dark .password-toggle {
    color: #cbd5e1 !important;
}

html.dark .form-check,
html.dark .check,
html.dark .checkbox-label {
    color: #e7ebf3 !important;
}

/* Buttons wie im gewünschten Benutzerformular. */
html.dark .btn--primary,
html.dark .btn--primary:visited,
html.dark button.btn--primary,
html.dark button[type="submit"].btn--primary {
    background: #2b62dc !important;
    border-color: #2b62dc !important;
    color: #ffffff !important;
    border-radius: 10px !important;
    box-shadow: none !important;
}

html.dark .btn--primary:hover,
html.dark .btn--primary:focus-visible,
html.dark button.btn--primary:hover,
html.dark button.btn--primary:focus-visible {
    background: #1f4fc1 !important;
    border-color: #1f4fc1 !important;
    color: #ffffff !important;
}

html.dark .btn--secondary,
html.dark .btn--ghost,
html.dark .btn--secondary:visited,
html.dark .btn--ghost:visited {
    background: #151b2a !important;
    border-color: #7183a4 !important;
    color: #f1f5f9 !important;
}

html.dark .btn--secondary:hover,
html.dark .btn--ghost:hover,
html.dark .btn--secondary:focus-visible,
html.dark .btn--ghost:focus-visible {
    background: #202a40 !important;
    border-color: #93b4ff !important;
    color: #ffffff !important;
}

/* Tabellen bleiben Navy statt beinahe schwarz. */
html.dark .table-responsive,
html.dark .tablewrap {
    background: #1d2539 !important;
    border-color: #34425e !important;
}

html.dark .table-responsive thead,
html.dark .table-responsive th,
html.dark table thead,
html.dark table th {
    background: #202a40 !important;
    color: #cbd5e1 !important;
    border-color: #34425e !important;
}

html.dark .table-responsive td,
html.dark table td {
    background: #1d2539 !important;
    color: #e7ebf3 !important;
    border-color: #34425e !important;
}

html.dark .table-responsive tbody tr:hover td,
html.dark table tbody tr:hover td {
    background: #202a40 !important;
}

html.dark .table-resize-hint,
html.dark .table-resize-hint button {
    color: #ffffff !important;
}

html.dark .dropdown__menu {
    background: #1d2539 !important;
    border-color: #34425e !important;
}

html.dark .dropdown__item {
    color: #e7ebf3 !important;
}

html.dark .dropdown__item:hover {
    background: #202a40 !important;
}

html.dark .badge,
html.dark .license-chip {
    background: #202a40 !important;
    border-color: #52627f !important;
}

html.dark .sticky-form-actions {
    background: rgba(29, 37, 57, .96) !important;
    border-color: #34425e !important;
    box-shadow: 0 12px 30px rgba(3, 7, 18, .28) !important;
}

html.dark .environment-banner {
    border-color: #34425e !important;
}

html.dark .login-page {
    background: #0a0f19 !important;
}

@media (max-width: 800px) {
    html.dark .main-content {
        padding: 1rem !important;
    }
}
