/* ============================================================================
   CIBLU PATTERNWEB - CSS STYLES
   Based on Ciblu Corporate Identity
   ============================================================================ */

/* ============================================================================
   ACCESSIBILITY UTILITIES (WCAG 2.1 AA)
   ============================================================================ */

/* Screen reader only — visually hidden but accessible to assistive technology */
.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;
}

/* Skip navigation link — hidden until focused via Tab */
.skip-nav {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    padding: 0.75rem 1.5rem;
    background: var(--color-primary);
    color: #fff;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    font-weight: 600;
    text-decoration: none;
    transition: top 0.2s ease;
}

.skip-nav:focus {
    top: 0;
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

:root {
    /* Ciblu Brand Colors (Official CI) */
    --ciblu-primary: #5F0912;           /* Burgundy - Primary Brand Color */
    --ciblu-primary-700: #4A070E;       /* Darker shade */
    --ciblu-primary-800: #3A050B;       /* Darkest shade */
    --ciblu-secondary: #BA0C2F;         /* Red - Secondary/Accent */
    --ciblu-black: #000000;
    --ciblu-primary-rgb: 95, 9, 18;          /* RGB of --ciblu-primary for rgba() usage */

    /* Bootstrap overrides */
    --bs-primary: var(--ciblu-primary);
    --bs-primary-rgb: 95, 9, 18;

    /* Semantic Colors */
    --color-primary: var(--ciblu-primary);
    --color-primary-hover: var(--ciblu-primary-700);
    --color-primary-active: var(--ciblu-primary-800);
    --color-accent: var(--ciblu-secondary);

    /* Light Palette */
    --background-light: #F6F7F9;
    --surface-light: #FFFFFF;
    --surface-alt-light: #F0F2F5;
    --text-primary-light: #0B0D12;
    --text-secondary-light: #5C6472;
    --border-light: #E2E6ED;
    --danger-light: #B00020;
    --success-light: #2E7D32;

    /* Dark Palette */
    --background-dark: #0F1115;
    --surface-dark: #171A20;
    --surface-alt-dark: #1D212A;
    --text-primary-dark: #F2F4F8;
    --text-secondary-dark: #B5BBC7;
    --border-dark: #2A2F3A;
    --danger-dark: #FF6B6B;
    --success-dark: #81C784;
}

/* Default: Light Theme */
body {
    --background: var(--background-light);
    --surface: var(--surface-light);
    --surface-alt: var(--surface-alt-light);
    --text-primary: var(--text-primary-light);
    --text-secondary: var(--text-secondary-light);
    --border: var(--border-light);
    --danger: var(--danger-light);
    --success: var(--success-light);

    /* Theme-aware grays */
    --gray-100: #F0F2F5;
    --gray-200: #E2E6ED;
    --gray-300: #C8CDD6;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;

    /* Brand text color (adapts for readability on themed backgrounds) */
    --ciblu-primary-text: var(--ciblu-primary);
    --ciblu-primary-text-rgb: var(--ciblu-primary-rgb);
    --ciblu-primary-text-hover: var(--ciblu-primary-700);

    /* Bootstrap link overrides (theme-aware) */
    --bs-link-color: var(--ciblu-primary-text);
    --bs-link-hover-color: var(--ciblu-primary-text-hover);

    /* Semantic color tokens */
    --warning: #F59E0B;
    --warning-text: #D97706;
    --info: #3b82f6;
    --info-text: #2563EB;
    --danger-hover: #9a0018;

    /* RGB triplets for rgba() usage */
    --danger-rgb: 176, 0, 32;
    --success-rgb: 46, 125, 50;
    --warning-rgb: 245, 158, 11;
    --info-rgb: 59, 130, 246;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    /* Modal overlay */
    --overlay: rgba(0, 0, 0, 0.5);
}

/* Dark Theme - Explicit selection via body.theme-dark */
body.theme-dark {
    --background: var(--background-dark);
    --surface: var(--surface-dark);
    --surface-alt: var(--surface-alt-dark);
    --text-primary: var(--text-primary-dark);
    --text-secondary: var(--text-secondary-dark);
    --border: var(--border-dark);
    --danger: var(--danger-dark);
    --success: var(--success-dark);

    /* Theme-aware grays (inverted for dark backgrounds) */
    --gray-100: #1D212A;
    --gray-200: #2A2F3A;
    --gray-300: #3A4050;
    --gray-500: #8B95A5;
    --gray-600: #9CA3AF;
    --gray-700: #B5BBC7;

    /* Brand text color (lighter tint for dark backgrounds) */
    --ciblu-primary-text: #E8A0A8;
    --ciblu-primary-text-rgb: 232, 160, 168;
    --ciblu-primary-text-hover: #F0BFC5;

    /* Semantic color tokens (lighter for dark backgrounds) */
    --warning: #FBBF24;
    --warning-text: #FBBF24;
    --info: #60A5FA;
    --info-text: #60A5FA;
    --danger-hover: #FF8A8A;

    /* RGB triplets (adapted for dark mode) */
    --danger-rgb: 255, 107, 107;
    --success-rgb: 129, 199, 132;
    --warning-rgb: 251, 191, 36;
    --info-rgb: 96, 165, 250;

    /* Stronger shadows on dark backgrounds */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.2);

    /* Darker overlay for dark mode */
    --overlay: rgba(0, 0, 0, 0.7);
}

/* Dark Theme - OS preference when no explicit theme is set */
@media (prefers-color-scheme: dark) {
    body:not(.theme-light):not(.theme-dark) {
        --background: var(--background-dark);
        --surface: var(--surface-dark);
        --surface-alt: var(--surface-alt-dark);
        --text-primary: var(--text-primary-dark);
        --text-secondary: var(--text-secondary-dark);
        --border: var(--border-dark);
        --danger: var(--danger-dark);
        --success: var(--success-dark);

        /* Theme-aware grays (inverted for dark backgrounds) */
        --gray-100: #1D212A;
        --gray-200: #2A2F3A;
        --gray-300: #3A4050;
        --gray-500: #8B95A5;
        --gray-600: #9CA3AF;
        --gray-700: #B5BBC7;

        /* Brand text color (lighter tint for dark backgrounds) */
        --ciblu-primary-text: #E8A0A8;
        --ciblu-primary-text-rgb: 232, 160, 168;
        --ciblu-primary-text-hover: #F0BFC5;

        /* Semantic color tokens (lighter for dark backgrounds) */
        --warning: #FBBF24;
        --warning-text: #FBBF24;
        --info: #60A5FA;
        --info-text: #60A5FA;
        --danger-hover: #FF8A8A;

        /* RGB triplets (adapted for dark mode) */
        --danger-rgb: 255, 107, 107;
        --success-rgb: 129, 199, 132;
        --warning-rgb: 251, 191, 36;
        --info-rgb: 96, 165, 250;

        /* Stronger shadows on dark backgrounds */
        --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
        --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
        --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
        --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.2);

        /* Darker overlay for dark mode */
        --overlay: rgba(0, 0, 0, 0.7);
    }
}

/* Base Styles */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    overflow-y: auto;
    scrollbar-gutter: stable;
}

html, body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    line-height: 1.5;
}

/* Links */
a, .btn-link {
    color: var(--ciblu-primary-text);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover, .btn-link:hover {
    color: var(--ciblu-primary-text-hover);
}

/* ============================================================================
   SITE HEADER - Ciblu Branded Header
   ============================================================================ */

.site-header {
    background: linear-gradient(135deg, var(--ciblu-primary) 0%, var(--ciblu-primary-800) 100%);
    color: white;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-lg);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

/* Logo & Brand */
.header-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: white;
    text-decoration: none;
}

.header-brand:hover {
    color: white;
    text-decoration: none;
}

.header-logo {
    height: 44px;
    display: flex;
    align-items: center;
}

.header-logo img {
    height: 100%;
    width: auto;
    filter: brightness(0) invert(1); /* Make logo white */
}

.header-brand-divider {
    width: 1px;
    height: 32px;
    background-color: rgba(255, 255, 255, 0.3);
}

.header-brand-product {
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    opacity: 0.95;
}

/* Main Navigation */
.header-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
    font-size: 0.9375rem;
    transition: all 0.2s ease;
}

.header-nav-link:hover {
    background-color: rgba(255, 255, 255, 0.15);
    color: white;
    text-decoration: none;
}

.header-nav-link.active {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
}

.header-nav-link .nav-icon {
    font-size: 1.125rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* User Menu */
.header-user {
    position: relative;
}

.user-avatar-wrapper {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.375rem 0.875rem 0.375rem 0.375rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: rgba(255, 255, 255, 0.1);
}

.user-avatar-wrapper:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background-color: white;
    color: var(--ciblu-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9375rem;
    font-weight: 700;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.user-name {
    font-size: 0.9375rem;
    font-weight: 500;
    color: white;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dropdown-arrow {
    font-size: 0.75rem;
    opacity: 0.8;
    transition: transform 0.2s ease;
}

/* User Dropdown Menu */
.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 280px;
    background-color: var(--surface);
    border-radius: 12px;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border);
    overflow: hidden;
    z-index: 200;
    animation: dropdownFadeIn 0.2s ease;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-header {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 1.125rem;
    background-color: var(--surface-alt);
}

.dropdown-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background-color: var(--ciblu-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
}

.dropdown-user-info {
    flex: 1;
    min-width: 0;
}

.dropdown-user-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.125rem;
}

.dropdown-user-email {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dropdown-divider {
    height: 1px;
    background-color: var(--border);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 1.125rem;
    color: var(--text-primary);
    font-size: 0.9375rem;
    cursor: pointer;
    transition: background-color 0.15s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.dropdown-item:hover {
    background-color: var(--surface-alt);
    text-decoration: none;
    color: var(--text-primary);
}

.dropdown-item-danger {
    color: var(--danger);
}

.dropdown-item-danger:hover {
    background-color: rgba(var(--danger-rgb), 0.08);
    color: var(--danger);
}

.dropdown-section-title {
    padding: 0.5rem 1.125rem 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dropdown-icon {
    font-size: 1.125rem;
    width: 24px;
    text-align: center;
}

.dropdown-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99;
}

/* ============================================================================
   SITE CONTENT
   ============================================================================ */

.main-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.site-content {
    flex: 1;
    padding: 2rem 0;
}

.content-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ============================================================================
   AUTH LAYOUT - Login, Register, ForgotPassword, etc.
   ============================================================================ */

.auth-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: var(--background);
}

.auth-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.auth-container {
    width: 100%;
    max-width: 400px;
}

.auth-container:has(.legal-content) {
    max-width: 720px;
}

/* ============================================================================
   LEGAL PAGES - Impressum, Datenschutz
   D6: Own CSS class instead of .card — legal texts need wider layout (720px vs 400px)
   D7: 720px max-width for optimal reading width (~65-80 chars/line at 16px)
   D8: Global CSS (not scoped) — consistent with other layout classes
   D9: Semantic styling via .legal-content scope — keeps Razor files clean
   ============================================================================ */

.legal-content {
    width: 100%;
    max-width: 720px;
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 2rem 2.5rem;
    box-shadow: var(--shadow-sm);
}

.legal-content h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.5rem;
    letter-spacing: -0.01em;
}

.legal-content h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 2rem 0 0.75rem;
}

.legal-content h3 {
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 1.5rem 0 0.5rem;
}

.legal-content p {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin: 0 0 0.75rem;
}

.legal-content ul {
    padding-left: 1.5rem;
    margin: 0 0 0.75rem;
}

.legal-content ul li {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 0.25rem;
}

.legal-content a {
    color: var(--ciblu-primary-text);
    text-decoration: underline;
}

.legal-content a:hover {
    color: var(--ciblu-primary-text-hover);
}

.legal-content address {
    font-style: normal;
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin: 0 0 0.75rem;
}

.legal-content strong {
    color: var(--text-primary);
    font-weight: 600;
}

.legal-content .legal-subtitle {
    font-size: 1.0625rem;
    color: var(--text-secondary);
    margin: 0 0 1.5rem;
}

.legal-content .legal-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.9375rem;
}

.legal-content .legal-table th,
.legal-content .legal-table td {
    border: 1px solid var(--border);
    padding: 0.625rem 0.75rem;
    text-align: left;
    color: var(--text-primary);
}

.legal-content .legal-table th {
    background-color: var(--surface-secondary);
    font-weight: 600;
}

.legal-content .legal-table code {
    background-color: var(--surface-secondary);
    padding: 0.125rem 0.375rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
}

@media (max-width: 768px) {
    .legal-content {
        padding: 1.5rem 1.25rem;
    }

    .legal-content .legal-table {
        font-size: 0.8125rem;
    }

    .legal-content .legal-table th,
    .legal-content .legal-table td {
        padding: 0.5rem;
    }
}

/* ============================================================================
   SITE FOOTER
   ============================================================================ */

.site-footer {
    background-color: var(--surface);
    border-top: 1px solid var(--border);
    padding: 1.5rem 0;
    margin-top: auto;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.footer-container a {
    color: var(--text-secondary);
}

.footer-container a:hover {
    color: var(--ciblu-primary-text);
}

.footer-separator {
    opacity: 0.5;
}

/* ============================================================================
   PDF CARD & LAYOUT - Optimiert fuer DIN A4 Portrait-PDFs
   iframe regelt seine Hoehe selbst via calc(100vh - 280px).
   Card ist nur ein visueller Container ohne eigene Hoehensteuerung.
   Getestet: Chrome 120+, Edge 120+, Firefox 121+
   ============================================================================ */

.pdf-card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

/* Schmaler Layout-Container fuer PDF-zentrierte Seiten (DIN A4 Portrait).
   Beschraenkt die Breite damit das A4-PDF mehr vertikalen Platz bekommt. */
.pdf-page-layout {
    max-width: 800px;
    margin: 0 auto;
}

/* ============================================================================
   BUTTONS - Ciblu Branded
   ============================================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.btn-primary {
    background-color: var(--ciblu-primary);
    border-color: var(--ciblu-primary);
    color: white;
}

.btn-primary:hover, .btn-primary:focus {
    background-color: var(--ciblu-primary-700);
    border-color: var(--ciblu-primary-700);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:active, .btn-primary.active {
    background-color: var(--ciblu-primary-800);
    border-color: var(--ciblu-primary-800);
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-select:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.25);
}

.btn-secondary {
    background-color: var(--surface);
    border-color: var(--border);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background-color: var(--surface-alt);
    border-color: var(--gray-300);
    color: var(--text-primary);
}

.btn-outline-primary {
    background-color: transparent;
    border-color: var(--ciblu-primary-text);
    color: var(--ciblu-primary-text);
}

.btn-outline-primary:hover {
    background-color: var(--ciblu-primary);
    color: white;
}

.btn-text {
    background: transparent;
    border: none;
    color: var(--ciblu-primary-text);
    padding: 0.5rem 1rem;
}

.btn-text:hover {
    color: var(--ciblu-primary-text-hover);
    text-decoration: underline;
}

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
}

.btn-sm {
    padding: 0.375rem 0.875rem;
    font-size: 0.8125rem;
}

/* ============================================================================
   CARDS & SURFACES
   ============================================================================ */

.card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.card-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* ============================================================================
   SEARCH INPUT
   ============================================================================ */

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-wrapper .search-icon {
    position: absolute;
    left: 1rem;
    color: var(--text-secondary);
    pointer-events: none;
}

.search-input-wrapper .search-input {
    padding-left: 2.75rem;
}

.results-count {
    font-size: 0.875rem;
}

/* ============================================================================
   FORMS
   ============================================================================ */

.form-control {
    width: 100%;
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
    background-color: var(--surface);
    border-color: var(--ciblu-primary);
    box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.15);
    outline: none;
}

.form-control::placeholder {
    color: var(--text-secondary);
}

.form-select {
    width: 100%;
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    color: var(--text-primary);
    padding: 0.75rem 2.25rem 0.75rem 1rem;
    font-size: 0.9375rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-select:focus {
    background-color: var(--surface);
    border-color: var(--ciblu-primary);
    box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.15);
    outline: none;
}

/* Dark mode form control overrides - explicit high-specificity selectors
   to defeat Bootstrap 5.3 hardcoded light colors (WCAG AA 4.5:1 contrast) */
body.theme-dark .form-control,
body.theme-dark .form-select {
    background-color: var(--surface-dark);
    border-color: var(--border-dark);
    color: var(--text-primary-dark);
    color-scheme: dark;
}

body.theme-dark .form-control:focus,
body.theme-dark .form-select:focus {
    background-color: var(--surface-dark);
    border-color: var(--ciblu-primary);
    box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.15);
    color: var(--text-primary-dark);
}

body.theme-dark .form-control::placeholder {
    color: var(--text-secondary-dark);
}

body.theme-dark .form-control:-webkit-autofill,
body.theme-dark .form-control:-webkit-autofill:hover,
body.theme-dark .form-control:-webkit-autofill:focus,
body.theme-dark .form-select:-webkit-autofill {
    -webkit-text-fill-color: var(--text-primary-dark);
    -webkit-box-shadow: 0 0 0px 1000px var(--surface-dark) inset;
    border-color: var(--border-dark);
    transition: background-color 5000s ease-in-out 0s;
}

body.theme-dark .form-control:disabled,
body.theme-dark .form-control[readonly],
body.theme-dark .form-select:disabled {
    background-color: var(--surface-alt-dark);
    color: var(--text-secondary-dark);
    opacity: 0.65;
}

/* OS dark preference: same overrides for System mode with dark OS preference */
@media (prefers-color-scheme: dark) {
    body:not(.theme-light):not(.theme-dark) .form-control,
    body:not(.theme-light):not(.theme-dark) .form-select {
        background-color: var(--surface-dark);
        border-color: var(--border-dark);
        color: var(--text-primary-dark);
        color-scheme: dark;
    }

    body:not(.theme-light):not(.theme-dark) .form-control:focus,
    body:not(.theme-light):not(.theme-dark) .form-select:focus {
        background-color: var(--surface-dark);
        border-color: var(--ciblu-primary);
        box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.15);
        color: var(--text-primary-dark);
    }

    body:not(.theme-light):not(.theme-dark) .form-control::placeholder {
        color: var(--text-secondary-dark);
    }

    body:not(.theme-light):not(.theme-dark) .form-control:-webkit-autofill,
    body:not(.theme-light):not(.theme-dark) .form-control:-webkit-autofill:hover,
    body:not(.theme-light):not(.theme-dark) .form-control:-webkit-autofill:focus,
    body:not(.theme-light):not(.theme-dark) .form-select:-webkit-autofill {
        -webkit-text-fill-color: var(--text-primary-dark);
        -webkit-box-shadow: 0 0 0px 1000px var(--surface-dark) inset;
        border-color: var(--border-dark);
        transition: background-color 5000s ease-in-out 0s;
    }

    body:not(.theme-light):not(.theme-dark) .form-control:disabled,
    body:not(.theme-light):not(.theme-dark) .form-control[readonly],
    body:not(.theme-light):not(.theme-dark) .form-select:disabled {
        background-color: var(--surface-alt-dark);
        color: var(--text-secondary-dark);
        opacity: 0.65;
    }
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

/* ============================================================================
   BADGES - Ciblu Styled
   ============================================================================ */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-primary, .ciblu-badge {
    background-color: var(--ciblu-primary);
    color: white;
}

.badge-soft, .ciblu-badge-soft {
    background: rgba(var(--ciblu-primary-text-rgb), 0.10);
    color: var(--ciblu-primary-text);
    border: 1px solid rgba(var(--ciblu-primary-text-rgb), 0.20);
}

.badge-success {
    background-color: rgba(var(--success-rgb), 0.15);
    color: var(--success);
}

.badge-warning {
    background-color: rgba(var(--warning-rgb), 0.15);
    color: var(--warning-text);
}

.badge-info {
    background-color: rgba(var(--info-rgb), 0.15);
    color: var(--info-text);
}

.badge-danger {
    background-color: rgba(var(--danger-rgb), 0.15);
    color: var(--danger);
}

/* ============================================================================
   PAGE LAYOUT
   ============================================================================ */

.page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
}

.page-content {
    padding: 1rem 0 2rem;
}

/* ============================================================================
   LIST ITEMS
   ============================================================================ */

.tournament-list {
    display: flex;
    flex-direction: column;
}

.tournament-list .list-item:last-child {
    margin-bottom: 0;
}

.list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.list-item:hover {
    border-color: var(--ciblu-primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.list-item-content {
    flex: 1;
    min-width: 0;
}

.list-item-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.list-item-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.list-item-action {
    color: var(--text-secondary);
    font-size: 1.25rem;
    margin-left: 1rem;
}

/* Compact list item variant - for dense lists (100+ items) */
.list-item-compact {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.875rem;
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    margin-bottom: 0.375rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.list-item-compact:hover {
    border-color: var(--ciblu-primary);
    background-color: var(--background);
}

.list-item-compact .list-item-content {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.list-item-compact .list-item-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-item-compact .list-item-subtitle {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.list-item-compact .badge {
    font-size: 0.6875rem;
    padding: 0.125rem 0.5rem;
}

.list-item-compact .list-item-arrow {
    opacity: 0.4;
}

.list-item-compact:hover .list-item-arrow {
    opacity: 1;
}

.list-item-compact .btn-clear-pattern {
    padding: 0.25rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.list-item-compact .btn-clear-pattern:hover {
    color: var(--danger);
    background-color: rgba(var(--danger-rgb), 0.1);
}

.list-item-compact .btn-icon-action {
    padding: 0.25rem;
    border: none;
    background: transparent;
    color: var(--ciblu-primary-text);
    cursor: pointer;
    border-radius: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.list-item-compact .btn-icon-action:hover {
    background-color: rgba(var(--ciblu-primary-text-rgb), 0.1);
}

/* List group active (e.g., Arena selection) */
.list-group-item.active,
.list-group-item.active:focus,
.list-group-item.active:hover {
    background-color: var(--ciblu-primary) !important;
    border-color: var(--ciblu-primary) !important;
    color: #fff !important;
}

.list-group-item-action:hover,
.list-group-item-action:focus {
    background-color: rgba(var(--bs-primary-rgb), 0.06);
}

/* ============================================================================
   AVATAR
   ============================================================================ */

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--ciblu-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid var(--border);
    transition: border-color 0.2s ease;
}

.avatar:hover {
    border-color: var(--ciblu-primary);
}

.avatar-sm {
    width: 32px;
    height: 32px;
    font-size: 0.75rem;
}

.avatar-lg {
    width: 56px;
    height: 56px;
    font-size: 1.25rem;
}

/* ============================================================================
   EMPTY STATE - Enhanced Ciblu Styled
   ============================================================================ */

.empty-state, .ciblu-empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: rgba(var(--bs-primary-rgb), 0.04);
    border: 1px solid rgba(var(--bs-primary-rgb), 0.10);
    border-radius: 0.75rem;
}

.empty-state-container {
    text-align: center;
    padding: 3rem 2rem 4rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 1rem;
    max-width: 480px;
    margin: 0 auto;
}

.empty-state-container .empty-state-icon {
    color: var(--ciblu-primary-text);
    opacity: 0.6;
    margin-bottom: 1.5rem;
}

.empty-state-container .empty-state-title {
    font-size: 1.375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.75rem;
}

.empty-state-container .empty-state-text {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0 0 1.25rem;
}

.empty-state-email {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background-color: var(--surface-alt);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.empty-state-email svg {
    color: var(--text-secondary);
}

.empty-state-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    color: var(--text-secondary);
    font-size: 0.8125rem;
}

.empty-state-divider::before,
.empty-state-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background-color: var(--border);
}

.empty-state-hint {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin: 0.75rem 0 0;
}

/* Button spinner for loading states */
.btn-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 0.5rem;
}

.btn-secondary .btn-spinner {
    border-color: var(--border);
    border-top-color: var(--text-primary);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    opacity: 0.6;
}

.empty-state-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.empty-state-text {
    font-size: 1rem;
    color: var(--text-secondary);
    max-width: 400px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ============================================================================
   HERO
   ============================================================================ */

.hero-text {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
}

.body-text {
    font-size: 1.0625rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ============================================================================
   FILTER CHIPS
   ============================================================================ */

.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-sort-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.chip {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    background-color: var(--surface);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s ease;
}

.chip:hover {
    background-color: var(--surface-alt);
    border-color: var(--gray-300);
}

.chip.active {
    background-color: var(--ciblu-primary);
    color: white;
    border-color: var(--ciblu-primary);
}

/* ============================================================================
   COMPETITION GROUP (Date > Location > Pruefungen)
   ============================================================================ */

.competition-group {
    margin-bottom: 1.5rem;
}

.competition-group-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.5rem;
}

.competition-location-group {
    margin-bottom: 0.75rem;
    margin-left: 0.25rem;
}

.competition-location-title {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
    padding-left: 0.25rem;
}

/* ============================================================================
   PATTERN CARD
   ============================================================================ */

.pattern-card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pattern-card:hover {
    border-color: var(--ciblu-primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.pattern-card.selected {
    border-color: var(--ciblu-primary);
    border-width: 2px;
    background-color: rgba(var(--bs-primary-rgb), 0.04);
}

.pattern-thumbnail, .ciblu-thumb-wrap {
    width: 100%;
    aspect-ratio: 4/3;
    background-color: var(--surface-alt);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
    font-size: 2rem;
}

/* ============================================================================
   PROGRESS INDICATOR
   ============================================================================ */

.progress-bar {
    height: 8px;
    background-color: var(--surface-alt);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background-color: var(--ciblu-primary);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-bar-fill.complete {
    background-color: var(--success);
}

.progress-bar-fill.error {
    background-color: var(--danger);
}

.progress-bar-fill.warning {
    background-color: var(--warning);
}

/* ============================================================================
   IMPORT LOG
   ============================================================================ */

.import-log {
    max-height: 400px;
    overflow-y: auto;
    background-color: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 0.75rem;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.75rem;
    line-height: 1.6;
}

.import-log-entry {
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--text-secondary);
    padding: 1px 4px;
    border-radius: 2px;
}

.import-log-entry.log-new {
    color: var(--success);
}

.import-log-entry.log-updated {
    color: var(--info-text);
}

.import-log-entry.log-warning {
    color: var(--warning-text);
}

.import-log-entry.log-error {
    color: var(--danger);
    font-weight: 600;
}

/* ============================================================================
   MODAL / POPUP
   ============================================================================ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--overlay);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: var(--surface);
    border-radius: 0.75rem;
    padding: 1.5rem;
    max-width: 500px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: modalSlideIn 0.3s ease;
}

.modal-content-lg {
    max-width: 600px;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: var(--text-primary);
}

/* ============================================================================
   ALERTS - Ciblu Styled
   ============================================================================ */

.ciblu-alert {
    background: rgba(var(--bs-primary-rgb), 0.06);
    border: 1px solid rgba(var(--bs-primary-rgb), 0.12);
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    color: var(--text-primary);
}

/* ============================================================================
   CIBLU LINKS
   ============================================================================ */

.ciblu-link {
    color: var(--ciblu-primary-text);
}

.ciblu-link:hover {
    color: var(--ciblu-secondary);
    text-decoration: underline;
}

.ciblu-icon-inline {
    margin-left: 0.35rem;
    opacity: 0.85;
}

/* ============================================================================
   UTILITIES
   ============================================================================ */

.text-primary { color: var(--ciblu-primary-text) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }

.bg-primary { background-color: var(--ciblu-primary) !important; }
.bg-surface { background-color: var(--surface) !important; }
.bg-surface-alt { background-color: var(--surface-alt) !important; }

.border-primary { border-color: var(--ciblu-primary) !important; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 2rem; }

.p-3 { padding: 1rem; }
.p-4 { padding: 1.5rem; }

.d-flex { display: flex; }
.flex-column { flex-direction: column; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.justify-content-center { justify-content: center; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }
.gap-4 { gap: 1.5rem; }

.w-100 { width: 100%; }
.text-center { text-align: center; }

/* ============================================================================
   SVG ICONS
   ============================================================================ */

.icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    vertical-align: middle;
}

.icon svg {
    display: block;
}

/* Back/Forward link styling */
.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    color: var(--ciblu-primary-text);
    font-weight: 500;
    font-size: 0.9375rem;
    text-decoration: none;
    padding: 0.5rem 0;
    transition: all 0.2s ease;
}

.btn-back:hover {
    color: var(--ciblu-primary-text);
    text-decoration: none;
    opacity: 0.8;
}

.btn-back svg {
    transition: transform 0.2s ease;
}

.btn-back:hover svg {
    transform: translateX(-2px);
}

/* Forward arrow in list items */
.list-item-arrow {
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.list-item:hover .list-item-arrow {
    color: var(--ciblu-primary-text);
    transform: translateX(2px);
}

/* Dropdown arrow */
.dropdown-chevron {
    display: flex;
    align-items: center;
    opacity: 0.8;
    transition: transform 0.2s ease;
}

/* ============================================================================
   LOADING SPINNER
   ============================================================================ */

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--ciblu-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem;
}

/* ============================================================================
   PATTERN GRID
   ============================================================================ */

.pattern-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.25rem;
}

@media (max-width: 576px) {
    .pattern-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
}

/* ============================================================================
   PATTERN LIST (compact)
   ============================================================================ */

.pattern-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background-color: var(--border);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    overflow: hidden;
}

.pattern-list-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background-color: var(--surface);
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.pattern-list-item:hover {
    background-color: var(--surface-alt);
}

.pattern-list-item.selected {
    background-color: rgba(var(--bs-primary-rgb), 0.06);
    border-left: 3px solid var(--ciblu-primary);
    padding-left: calc(1rem - 3px);
}

.pattern-list-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background-color: rgba(var(--ciblu-primary-text-rgb), 0.08);
    color: var(--ciblu-primary-text);
    white-space: nowrap;
    flex-shrink: 0;
}

.pattern-list-content {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.pattern-list-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pattern-list-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
    flex-shrink: 0;
}

.pattern-list-arrow {
    color: var(--text-secondary);
    flex-shrink: 0;
}

/* ============================================================================
   PATTERN DETAIL (PDF preview)
   ============================================================================ */

.pattern-pdf-frame {
    width: 100%;
    height: 60vh;
    min-height: 400px;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    background-color: var(--surface-alt);
}

.modal-content .pattern-pdf-frame {
    height: 50vh;
}

/* ============================================================================
   ACCOUNT PAGE STYLES
   ============================================================================ */

.account-card {
    background: linear-gradient(135deg, var(--ciblu-primary) 0%, var(--ciblu-primary-800) 100%);
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 1.5rem;
    color: white;
}

.account-profile {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.account-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.2);
    border: 3px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
}

.account-info {
    flex: 1;
}

.account-name {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.account-email {
    font-size: 0.9375rem;
    opacity: 0.85;
    margin-bottom: 0.5rem;
}

.account-status {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    opacity: 0.9;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--success);
}

.card-header-simple {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.card-header-simple .card-title {
    margin: 0;
}

.card-header-simple svg {
    flex-shrink: 0;
}

/* Theme Options */
.theme-options {
    display: flex;
    gap: 0.75rem;
}

.theme-option {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 0.75rem;
    border-radius: 0.75rem;
    border: 2px solid var(--border);
    background-color: var(--surface);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    font-weight: 500;
}

.theme-option:hover {
    border-color: var(--gray-300);
    background-color: var(--surface-alt);
}

.theme-option.active {
    border-color: var(--ciblu-primary-text);
    background-color: rgba(var(--ciblu-primary-text-rgb), 0.06);
    color: var(--ciblu-primary-text);
}

/* About Info */
.about-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.about-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
}

.about-row:not(:last-child) {
    border-bottom: 1px solid var(--border);
}

.about-label {
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

.about-value {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.9375rem;
}

/* Logout Button */
.btn-logout {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.25rem;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 0.9375rem;
    background-color: var(--surface);
    border: 1px solid var(--border);
    color: var(--danger);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-logout:hover {
    background-color: rgba(var(--danger-rgb), 0.08);
    border-color: var(--danger);
}

/* ============================================================================
   RESPONSIVE ADJUSTMENTS
   ============================================================================ */

@media (max-width: 768px) {
    .header-container {
        padding: 0 1rem;
        height: 60px;
    }

    .header-logo {
        height: 36px;
    }

    .header-brand-divider,
    .header-brand-product {
        display: none;
    }

    .header-nav-link span:not(.nav-icon) {
        display: none;
    }

    .header-nav-link {
        padding: 0.5rem 0.75rem;
    }

    .header-nav-link .nav-icon {
        margin: 0;
    }

    .user-name {
        display: none;
    }

    .user-avatar-wrapper {
        padding: 0.25rem;
        background: transparent;
    }

    .content-container {
        padding: 0 1rem;
    }

    .page-header h1 {
        font-size: 1.375rem;
    }

    .site-content {
        padding: 1.5rem 0;
    }
}

@media (max-width: 480px) {
    .header-nav {
        gap: 0.25rem;
    }

    .header-nav-link {
        padding: 0.5rem;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}

/* ============================================================================
   AUTOCOMPLETE / TYPEAHEAD
   ============================================================================ */

.autocomplete-wrapper {
    position: relative;
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1050;
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 0.75rem 0.75rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.autocomplete-item {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: none;
    background: transparent;
    cursor: pointer;
    text-align: left;
    transition: background-color 0.1s ease;
    color: var(--text-primary);
}

.autocomplete-item:hover {
    background-color: var(--surface-alt);
}

.autocomplete-item-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.3;
}

.autocomplete-item-email {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.3;
}

.autocomplete-hint {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    background-color: var(--surface-alt);
    text-align: center;
    border-top: 1px solid var(--border);
}

/* Dark mode overrides */
body.theme-dark .autocomplete-dropdown {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* ============================================================================
   RICHTER VERWALTUNG
   ============================================================================ */

.richter-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.richter-list .list-item {
    margin-bottom: 0;
}

.avatar-small {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--ciblu-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8125rem;
    font-weight: 600;
    flex-shrink: 0;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    background: transparent;
    border-radius: 0.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-icon:hover {
    background-color: var(--surface-alt);
    color: var(--text-primary);
}

.btn-icon-danger:hover {
    background-color: rgba(var(--danger-rgb), 0.1);
    color: var(--danger);
}

/* Action buttons with icon + label */
.btn-action {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    border: none;
    background: transparent;
    border-radius: 0.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.8125rem;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.btn-action:hover {
    background-color: var(--surface-alt);
    color: var(--text-primary);
}

.btn-action:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-action-danger {
    color: var(--danger);
}

.btn-action-danger:hover {
    background-color: rgba(var(--danger-rgb), 0.1);
    color: var(--danger);
}

.spinner-small {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.rotate-90 {
    transform: rotate(90deg);
}

.flex-grow-1 {
    flex-grow: 1;
}

/* Badge secondary variant */
.badge-secondary {
    background-color: var(--surface-alt);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

/* List item lock icon */
.list-item-lock {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ciblu-primary-text);
    opacity: 0.8;
}

/* Full width button */
.w-100 {
    width: 100%;
}

/* ============================================================================
   ADMIN STYLES
   ============================================================================ */

/* Modal variants */
.modal-sm {
    max-width: 400px;
}

.modal-body {
    margin-bottom: 1rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

/* Badge variants for admin */
.badge-inactive {
    background-color: var(--gray-200);
    color: var(--gray-600);
}

.badge-ewu {
    background-color: var(--info);
    color: white;
}

/* Toast message */
.toast-message {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    color: white;
    font-weight: 500;
    z-index: 1100;
    animation: toastSlideIn 0.3s ease;
}

.toast-message.success {
    background-color: var(--success);
}

.toast-message.error {
    background-color: var(--danger);
}

.toast-message.warning {
    background-color: var(--warning);
    color: var(--text);
}

.toast-message.info {
    background-color: var(--info);
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Button danger variant */
.btn-danger {
    background-color: var(--danger);
    border-color: var(--danger);
    color: white;
}

.btn-danger:hover {
    background-color: var(--danger-hover);
    border-color: var(--danger-hover);
}

/* Text color utilities */
.text-danger {
    color: var(--danger) !important;
}

.text-secondary {
    color: var(--text-secondary) !important;
}

/* ============================================================================
   ADMIN DASHBOARD
   ============================================================================ */

/* Stat-Kacheln (Kennzahlen-Leiste) */
.admin-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.admin-stat-card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.25rem 1.5rem;
    text-align: center;
}

.admin-stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--ciblu-primary-text);
    line-height: 1.2;
}

.admin-stat-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-top: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Admin Tiles (Kompakte Kacheln für Verwaltungsbereiche) */
.admin-tile-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.admin-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.5rem 1rem;
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    text-decoration: none;
    color: inherit;
    text-align: center;
    transition: all 0.2s ease;
}

.admin-tile:hover {
    border-color: var(--ciblu-primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.admin-tile-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
    background: rgba(var(--ciblu-primary-text-rgb), 0.08);
    color: var(--ciblu-primary-text);
}

.admin-tile-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
}

.admin-tile-stats {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.admin-tile-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--ciblu-primary-text);
}

.admin-tile-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.375rem;
}

@media (max-width: 768px) {
    .admin-tile-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .admin-tile-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .admin-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Admin Loading Spinner */
.admin-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 3rem 1rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.admin-spinner {
    width: 2.5rem;
    height: 2.5rem;
    border: 3px solid rgba(var(--bs-primary-rgb), 0.15);
    border-top-color: var(--ciblu-primary);
    border-radius: 50%;
    animation: admin-spin 0.8s linear infinite;
}

@keyframes admin-spin {
    to { transform: rotate(360deg); }
}

/* Admin Delete Options */
.admin-delete-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.5rem;
}

.admin-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.9375rem;
    color: var(--text-primary);
}

.admin-checkbox-label input[type="checkbox"] {
    width: 1.125rem;
    height: 1.125rem;
    accent-color: var(--ciblu-primary);
    cursor: pointer;
}

/* Endpoint Checkboxes (API Client Admin) */
.endpoint-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9375rem;
    color: var(--text-primary);
}

.checkbox-label input[type="checkbox"] {
    width: 1.125rem;
    height: 1.125rem;
    accent-color: var(--ciblu-primary);
    cursor: pointer;
}

.checkbox-label code {
    font-size: 0.875rem;
    background: var(--bg-hover);
    padding: 0.125rem 0.5rem;
    border-radius: var(--radius-sm);
}

.endpoint-badge {
    display: inline-block;
    font-size: 0.8125rem;
    background: var(--bg-hover);
    padding: 0.125rem 0.5rem;
    border-radius: var(--radius-sm);
    margin-right: 0.25rem;
}

/* ============================================================
   Admin Configuration Page
   ============================================================ */

/* Environment Toggle */
.config-env-toggle {
    display: flex;
    gap: 0.5rem;
    padding: 1rem 1.25rem 0;
}

.config-env-btn {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md, 0.5rem);
    background: var(--surface);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.config-env-btn:hover {
    background: var(--surface-alt);
    color: var(--text-primary);
}

.config-env-btn.active {
    background: var(--ciblu-primary);
    color: white;
    border-color: var(--ciblu-primary);
}

/* Horizontal Tab Navigation */
.config-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border);
    padding: 0.75rem 1.25rem 0;
    overflow-x: auto;
}

.config-tab {
    padding: 0.625rem 1.25rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.config-tab:hover {
    color: var(--text-primary);
    background: rgba(var(--ciblu-primary-rgb), 0.04);
}

.config-tab.active {
    color: var(--ciblu-primary);
    border-bottom-color: var(--ciblu-primary);
}

/* Configuration Info Banner (Logging tab hint) */
.config-info-banner {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    padding: 0.75rem 1.25rem;
    margin: 0 1.25rem 0;
    background: rgba(var(--ciblu-primary-rgb), 0.06);
    border: 1px solid rgba(var(--ciblu-primary-rgb), 0.15);
    border-radius: 0.5rem;
    font-size: 0.813rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.config-info-banner svg {
    flex-shrink: 0;
    margin-top: 0.125rem;
    color: var(--ciblu-primary);
}

/* Configuration Form */
.config-form {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.config-field {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.config-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.config-description {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--text-secondary);
}

.config-input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.config-input,
.config-select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md, 0.5rem);
    background: var(--surface);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-family: inherit;
    transition: border-color 0.15s ease;
}

.config-input:focus,
.config-select:focus {
    outline: none;
    border-color: var(--ciblu-primary);
    box-shadow: 0 0 0 2px rgba(var(--ciblu-primary-rgb), 0.15);
}

/* Hint text for range-constrained fields */
.config-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Secret Field Eye Toggle */
.config-secret-group .config-input {
    padding-right: 2.5rem;
}

.config-eye-toggle {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    padding: 0.25rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm, 0.25rem);
    transition: color 0.15s ease;
}

.config-eye-toggle:hover {
    color: var(--ciblu-primary);
}

/* Meta info (updated by/at) */
.config-meta {
    display: flex;
    gap: 0.5rem;
    font-size: 0.6875rem;
    color: var(--text-secondary);
}

.config-updated-by::after {
    content: "\00B7";
    margin-left: 0.5rem;
}

/* Action bar */
.config-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
    margin-top: 0.5rem;
}

/* Small spinner variant */
.admin-spinner-sm {
    width: 1rem;
    height: 1rem;
    border-width: 2px;
}

/* Responsive */
@media (max-width: 640px) {
    .config-tabs {
        padding: 0.5rem 0.75rem 0;
    }

    .config-tab {
        padding: 0.5rem 0.75rem;
        font-size: 0.8125rem;
    }

    .config-form {
        padding: 1rem 0.75rem;
    }

    .config-env-toggle {
        padding: 0.75rem 0.75rem 0;
    }
}

/* ============================================
   Changelog (Admin)
   ============================================ */
.changelog-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.changelog-section {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.25rem 1.5rem;
}

.changelog-month {
    font-size: 1rem;
    font-weight: 700;
    color: var(--ciblu-primary);
    margin: 0 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.changelog-entry {
    display: flex;
    gap: 1rem;
    padding: 0.625rem 0;
    border-bottom: 1px solid var(--border-light, rgba(128, 128, 128, 0.1));
}

.changelog-entry:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.changelog-date {
    flex-shrink: 0;
    min-width: 10rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.changelog-text {
    font-size: 0.875rem;
    color: var(--text-primary);
    line-height: 1.5;
}

@media (max-width: 640px) {
    .changelog-entry {
        flex-direction: column;
        gap: 0.25rem;
    }

    .changelog-date {
        min-width: auto;
    }

    .changelog-section {
        padding: 1rem;
    }
}

/* ============================================
   API Client Detail
   ============================================ */
.api-key-card {
    border-color: var(--warning, #f59e0b);
}

.api-key-warning {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    background-color: rgba(245, 158, 11, 0.1);
    border-radius: 0.5rem;
    color: var(--warning, #f59e0b);
    font-size: 0.875rem;
}

.api-key-display {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background-color: var(--bg-secondary, rgba(128, 128, 128, 0.05));
    border-radius: 0.5rem;
    border: 1px solid var(--border);
}

.api-key-value {
    flex: 1;
    font-family: 'Courier New', monospace;
    font-size: 0.8125rem;
    word-break: break-all;
    color: var(--text-primary);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.info-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.info-value {
    font-size: 0.875rem;
    color: var(--text-primary);
}

.list-item-clickable {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.list-item-clickable:hover {
    background-color: var(--bg-hover, rgba(128, 128, 128, 0.05));
}

.list-item-arrow {
    display: flex;
    align-items: center;
    color: var(--text-secondary);
    flex-shrink: 0;
}

/* ========================================================================
   Log Viewer Styles
   ======================================================================== */

/* Statistics Info Box */
.log-statistics-box {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 0.875rem 1.25rem;
    margin-bottom: 1rem;
}

.log-stat-item {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    min-width: 120px;
}

.log-stat-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.log-stat-value {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* Filter Bar */
.log-filter-bar {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.log-filter-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.log-filter-section-label {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.log-filter-divider {
    height: 1px;
    background-color: var(--border);
    margin: 0.75rem 0;
}

.log-filter-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.log-filter-row:last-child {
    margin-bottom: 0;
}

.log-filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 140px;
}

.log-filter-group label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.log-filter-search {
    flex: 1;
    min-width: 200px;
}

.form-control-sm {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
}

/* Level Chips */
.log-level-chip.active.log-level-verbose {
    background-color: var(--gray-500);
    border-color: var(--gray-500);
    color: white;
}

.log-level-chip.active.log-level-debug {
    background-color: var(--gray-600);
    border-color: var(--gray-600);
    color: white;
}

.log-level-chip.active.log-level-information {
    background-color: var(--info);
    border-color: var(--info);
    color: white;
}

.log-level-chip.active.log-level-warning {
    background-color: var(--warning);
    border-color: var(--warning);
    color: #000;
}

.log-level-chip.active.log-level-error {
    background-color: var(--danger);
    border-color: var(--danger);
    color: white;
}

.log-level-chip.active.log-level-fatal {
    background-color: #7b1fa2;
    border-color: #7b1fa2;
    color: white;
}

/* Results Header */
.log-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
}

.log-refresh-indicator {
    display: inline-flex;
    align-items: center;
}

.admin-spinner-sm {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

/* Log Table */
.log-table-container {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    margin-bottom: 1rem;
}

.log-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}

.log-table thead {
    background-color: var(--surface-alt);
    border-bottom: 2px solid var(--border);
}

.log-table th {
    padding: 0.625rem 0.75rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    white-space: nowrap;
}

.log-table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

.log-row {
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.log-row:hover {
    background-color: var(--surface-alt);
}

.log-row-error {
    border-left: 3px solid var(--danger);
}

.log-row-fatal {
    border-left: 3px solid #7b1fa2;
    background-color: rgba(123, 31, 162, 0.04);
}

.log-row-warning {
    border-left: 3px solid var(--warning);
}

.log-row-has-exception {
    font-weight: 500;
}

/* Table Columns */
.log-col-time {
    width: 130px;
    white-space: nowrap;
}

.log-col-level {
    width: 90px;
}

.log-col-app {
    width: 50px;
}

.log-col-message {
    min-width: 200px;
}

.log-col-source {
    width: 120px;
}

.log-col-user {
    width: 100px;
}

.log-timestamp {
    font-family: monospace;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.log-app-tag {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.log-message-text {
    word-break: break-word;
    line-height: 1.4;
}

.log-exception-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: var(--danger);
    color: white;
    font-size: 0.6875rem;
    font-weight: 700;
    margin-left: 0.375rem;
    vertical-align: middle;
}

.log-source-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
}

/* Log Level Badges */
.log-badge-verbose {
    background-color: var(--gray-200);
    color: var(--gray-600);
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.6875rem;
    font-weight: 600;
}

.log-badge-debug {
    background-color: var(--gray-200);
    color: var(--gray-700);
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.6875rem;
    font-weight: 600;
}

.log-badge-information {
    background-color: rgba(var(--info-rgb, 33, 150, 243), 0.15);
    color: var(--info);
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.6875rem;
    font-weight: 600;
}

.log-badge-warning {
    background-color: rgba(var(--warning-rgb, 255, 193, 7), 0.2);
    color: #856404;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.6875rem;
    font-weight: 600;
}

.log-badge-error {
    background-color: rgba(var(--danger-rgb, 220, 53, 69), 0.15);
    color: var(--danger);
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.6875rem;
    font-weight: 600;
    cursor: pointer;
}

.log-badge-fatal {
    background-color: rgba(123, 31, 162, 0.15);
    color: #7b1fa2;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.6875rem;
    font-weight: 600;
    cursor: pointer;
}

.log-badge-error:hover,
.log-badge-fatal:hover,
.log-badge-warning:hover,
.log-badge-information:hover,
.log-badge-debug:hover,
.log-badge-verbose:hover {
    opacity: 0.8;
    transform: scale(1.05);
}

/* Pagination */
.log-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 0;
}

.log-page-numbers {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.log-page-ellipsis {
    padding: 0 0.5rem;
    color: var(--text-secondary);
}

/* Auto-Refresh Button Active State */
.btn-outline-active {
    background-color: var(--ciblu-primary);
    color: white;
    border-color: var(--ciblu-primary);
}

/* Detail Modal */
.modal-content-lg {
    max-width: 800px;
}

.log-detail-modal {
    max-height: 90vh;
}

.log-detail-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.log-detail-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.log-detail-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.log-detail-value {
    font-size: 0.875rem;
    color: var(--text-primary);
    word-break: break-word;
}

.log-detail-section {
    margin-bottom: 1rem;
}

.log-detail-pre {
    background-color: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    font-family: monospace;
    font-size: 0.8125rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 300px;
    overflow-y: auto;
    margin-top: 0.375rem;
}

.log-detail-exception {
    color: var(--danger);
}

.log-detail-properties {
    color: var(--text-secondary);
}

/* Dark mode for log-badge-warning */
body.theme-dark .log-badge-warning {
    color: var(--warning);
}

/* Bug Story Copy Button */
.btn-bug-story {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    border-color: var(--warning);
    color: var(--warning);
}

.btn-bug-story:hover:not(:disabled) {
    background-color: var(--warning);
    color: #000;
    border-color: var(--warning);
}

.btn-bug-story-copied {
    background-color: var(--success);
    color: white;
    border-color: var(--success);
    cursor: default;
}

.btn-bug-story-copied:hover {
    background-color: var(--success);
    color: white;
    border-color: var(--success);
}

/* Responsive */
@media (max-width: 768px) {
    .log-filter-row {
        flex-direction: column;
    }

    .log-filter-group {
        min-width: 100%;
    }

    .log-detail-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .log-col-source,
    .log-col-user,
    .log-col-app {
        display: none;
    }
}

@media (max-width: 480px) {
    .log-detail-grid {
        grid-template-columns: 1fr;
    }

    .log-pagination {
        flex-wrap: wrap;
    }
}


