/**
 * Fleet Crew - Main Stylesheet (Consolidated)
 * =============================================
 * All core, component, and global page styles merged into a single file.
 * Page-specific CSS is loaded separately via header.php.
 * 
 * Sections:
 * 1. Theme - CSS variables, reset, base typography
 * 2. Layout - Grid, flexbox, containers, spacing
 * 3. Utilities - Helper classes, colors, effects
 * 4. Navigation - Header, nav, dropdowns, menus
 * 5. Components - Buttons, cards, forms, tables, badges
 * 6. Modals - Overlays, dialogs, toasts
 * 7. Header/Footer globals - Cookie banner, nav colors, footer
 * 8. Page-Specific Overrides (from old main.css)
 */

/* ============================================
   SECTION 1: Theme (core/theme.css)
   ============================================ */
/**
 * Fleet Crew - Theme Variables & Base Styles
 * Modern dark UI with Roboto typography
 */

/* ============================
   CSS Custom Properties (Theme)
   ============================ */
:root {
    /* Primary Colors */
    --color-primary: #d32f2f;
    --color-primary-light: #ff6659;
    --color-primary-dark: #9a0007;
    --color-primary-glow: rgba(211, 47, 47, 0.6);
    
    /* Nav/Header */
    --nav-bg: linear-gradient(180deg, #0d0d10 0%, #07070a 100%);
    --dropdown-bg: #111117;
    --nav-active-bg: rgba(239, 68, 68, 0.10);
    --nav-active-color: #ef4444;
    --card-hover-border: rgba(255, 255, 255, 0.16);
    --card-hover-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);

    /* Secondary Colors */
    --color-secondary: #2196f3;
    --color-secondary-light: #6ec6ff;
    --color-secondary-dark: #0069c0;
    
    /* Accent Colors */
    --color-accent: #ff9800;
    --color-accent-gold: #ffd700;
    --color-accent-purple: #ce93d8;
    --color-accent-cyan: #00e5ff;
    
    /* Status Colors */
    --color-success: #4caf50;
    --color-success-light: #80e27e;
    --color-warning: #ff9800;
    --color-error: #f44336;
    --color-info: #2196f3;
    
    /* Background Colors */
    --bg-base: #0a0a0a;
    --bg-surface: #1a1a1a;
    --bg-elevated: #252525;
    --bg-card: rgba(26, 26, 26, 0.95);
    --bg-overlay: rgba(0, 0, 0, 0.85);
    --bg-glass: rgba(30, 30, 30, 0.85);
    --bg-input: rgba(0, 0, 0, 0.5);
    
    /* Gray Scale */
    --gray-50: #fafafa;
    --gray-100: #f5f5f5;
    --gray-200: #eeeeee;
    --gray-300: #e0e0e0;
    --gray-400: #bdbdbd;
    --gray-500: #9e9e9e;
    --gray-600: #757575;
    --gray-700: #616161;
    --gray-800: #424242;
    --gray-900: #212121;
    
    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --text-muted: #757575;
    --text-disabled: #4a4a4a;
    
    /* Border Colors */
    --border-color: rgba(255, 255, 255, 0.1);
    --border-light: rgba(255, 255, 255, 0.15);
    --border-dark: rgba(0, 0, 0, 0.3);
    --border-accent: var(--color-primary);
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 20px var(--color-primary-glow);
    --shadow-glow-sm: 0 0 10px var(--color-primary-glow);
    
    /* Glass Effect */
    --glass-blur: blur(12px);
    --glass-bg: rgba(30, 30, 30, 0.75);
    
    /* Spacing Scale */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    --space-3xl: 64px;
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-2xl: 24px;
    --radius-full: 9999px;
    
    /* Typography */
    --font-primary: 'Roboto', sans-serif;
    --font-body: 'Rajdhani', sans-serif;
    --font-mono: 'Roboto', monospace;
    
    --font-size-xs: 0.7rem;
    --font-size-sm: 0.8rem;
    --font-size-base: 0.9rem;
    --font-size-md: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 2rem;
    --font-size-4xl: 2.5rem;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 350ms ease;
    
    /* Z-Index Scale */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
    --z-loader: 9999;
    
    /* Legacy Variables for Compatibility */
    --accent-color: var(--color-primary);
    --accent-red: var(--color-primary);
    --accent-glow: var(--color-primary);
    --input-bg: var(--bg-input);
}

/* ============================
   Theme Variations
   ============================ */

/* Tactical Blü */
.theme-blü {
    --color-primary: #1976d2;
    --color-primary-light: #63a4ff;
    --color-primary-dark: #004ba0;
    --color-primary-glow: rgba(25, 118, 210, 0.6);
    --accent-color: #1976d2;
    --accent-glow: #1976d2;
    --accent-red: #1976d2;
    --accent-red-glow: rgba(25, 118, 210, 0.6);
    --color-error: #1976d2;
    --border-accent: #1976d2;
    --nav-bg: linear-gradient(135deg, #0a1628 0%, #0d2952 50%, #0a1628 100%);
    --dropdown-bg: #0d1826;
}
.theme-blü .btn-primary {
    background: linear-gradient(135deg, #004ba0 0%, #1976d2 100%);
    border-color: #42a5f5;
}
.theme-blü .btn-primary:hover {
    background: linear-gradient(135deg, #1976d2 0%, #63a4ff 100%);
    box-shadow: 0 0 15px rgba(25, 118, 210, 0.5);
}
.theme-blü .btn-danger {
    background: linear-gradient(135deg, #0d47a1 0%, #1565c0 100%);
    border-color: #42a5f5;
}
.theme-blü .highlight,
.theme-blü .changelog-version {
    color: #42a5f5;
}

/* Industrial (Dark Orange) */
.theme-dark-orange {
    --color-primary: #ff5722;
    --color-primary-light: #ff8a50;
    --color-primary-dark: #c41c00;
    --color-primary-glow: rgba(255, 87, 34, 0.6);
    --accent-color: #ff5722;
    --accent-glow: #ff5722;
    --accent-red: #ff5722;
    --accent-red-glow: rgba(255, 87, 34, 0.6);
    --color-error: #ff5722;
    --border-accent: #ff5722;
    --nav-bg: linear-gradient(135deg, #1a0a00 0%, #2d1500 50%, #1a0a00 100%);
    --dropdown-bg: #1c1008;
}
.theme-dark-orange .btn-primary {
    background: linear-gradient(135deg, #c41c00 0%, #ff5722 100%);
    border-color: #ff8a50;
}
.theme-dark-orange .btn-primary:hover {
    background: linear-gradient(135deg, #ff5722 0%, #ff8a50 100%);
    box-shadow: 0 0 15px rgba(255, 87, 34, 0.5);
}
.theme-dark-orange .btn-danger {
    background: linear-gradient(135deg, #bf360c 0%, #e65100 100%);
    border-color: #ff9800;
}
.theme-dark-orange .highlight,
.theme-dark-orange .changelog-version {
    color: #ff8a50;
}

/* Winter (Christmas Green) */
.theme-christmas {
    --color-primary: #2e7d32;
    --color-primary-light: #60ad5e;
    --color-primary-dark: #005005;
    --color-primary-glow: rgba(46, 125, 50, 0.6);
    --color-secondary: #c62828;
    --accent-color: #2e7d32;
    --accent-glow: #2e7d32;
    --accent-red: #2e7d32;
    --accent-red-glow: rgba(46, 125, 50, 0.6);
    --color-error: #c62828;
    --border-accent: #2e7d32;
    --nav-bg: linear-gradient(135deg, #061208 0%, #0c2610 50%, #061208 100%);
    --dropdown-bg: #0c1a0e;
}
.theme-christmas .btn-primary {
    background: linear-gradient(135deg, #1b5e20 0%, #2e7d32 100%);
    border-color: #66bb6a;
}
.theme-christmas .btn-primary:hover {
    background: linear-gradient(135deg, #2e7d32 0%, #60ad5e 100%);
    box-shadow: 0 0 15px rgba(46, 125, 50, 0.5);
}
.theme-christmas .btn-danger {
    background: linear-gradient(135deg, #b71c1c 0%, #c62828 100%);
    border-color: #ef5350;
}
.theme-christmas .highlight,
.theme-christmas .changelog-version {
    color: #66bb6a;
}

/* FC-Gray */
.theme-gray {
    --color-primary: #78909c;
    --color-primary-light: #a7c0cd;
    --color-primary-dark: #4b636e;
    --color-primary-glow: rgba(120, 144, 156, 0.6);
    --accent-color: #78909c;
    --accent-glow: #78909c;
    --accent-red: #78909c;
    --accent-red-glow: rgba(120, 144, 156, 0.6);
    --color-error: #78909c;
    --border-accent: #78909c;
    --nav-bg: linear-gradient(135deg, #0d1215 0%, #1a2a30 50%, #0d1215 100%);
    --dropdown-bg: #111c22;
}
.theme-gray .btn-primary {
    background: linear-gradient(135deg, #4b636e 0%, #78909c 100%);
    border-color: #a7c0cd;
}
.theme-gray .btn-primary:hover {
    background: linear-gradient(135deg, #78909c 0%, #a7c0cd 100%);
    box-shadow: 0 0 15px rgba(120, 144, 156, 0.5);
}
.theme-gray .btn-danger {
    background: linear-gradient(135deg, #546e7a 0%, #78909c 100%);
    border-color: #90a4ä;
}
.theme-gray .highlight,
.theme-gray .changelog-version {
    color: #a7c0cd;
}

/* ☀️ White Mode - Full Light Theme */
.theme-white {
    --bg-base: #f5f5f5;
    --bg-surface: #ffffff;
    --bg-elevated: #fafafa;
    --bg-card: rgba(255, 255, 255, 0.98);
    --bg-overlay: rgba(255, 255, 255, 0.92);
    --bg-glass: rgba(255, 255, 255, 0.9);
    --bg-input: rgba(240, 240, 240, 0.9);
    --glass-bg: rgba(255, 255, 255, 0.85);
    
    --text-primary: #212121;
    --text-secondary: #616161;
    --text-muted: #9e9e9e;
    --text-disabled: #bdbdbd;
    
    --border-color: rgba(0, 0, 0, 0.12);
    --border-light: rgba(0, 0, 0, 0.08);
    --border-dark: rgba(0, 0, 0, 0.2);
    
    --gray-50: #212121;
    --gray-100: #333333;
    --gray-200: #424242;
    --gray-300: #555555;
    --gray-400: #757575;
    --gray-500: #9e9e9e;
    --gray-600: #bdbdbd;
    --gray-700: #e0e0e0;
    --gray-800: #eeeeee;
    --gray-900: #f5f5f5;
    
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.12);
    
    --color-primary: #1565c0;
    --color-primary-light: #5e92f3;
    --color-primary-dark: #003c8f;
    --color-primary-glow: rgba(21, 101, 192, 0.3);
    --accent-color: #1565c0;
    --accent-glow: #1565c0;
    --accent-red: #1565c0;
    --accent-red-glow: rgba(21, 101, 192, 0.3);
    --border-accent: #1565c0;
    
    --input-bg: rgba(240, 240, 240, 0.9);
    --dropdown-bg: #ffffff;
}
/* White mode - all text and backgrounds */
.theme-white,
.theme-white body {
    background-color: #f5f5f5 !important;
    color: #212121 !important;
}
.theme-white header {
    background: rgba(255, 255, 255, 0.95) !important;
    border-bottom-color: rgba(0, 0, 0, 0.1) !important;
    backdrop-filter: blur(12px);
}
.theme-white nav > ul > li > a,
.theme-white nav > ul > li > .dropdown-trigger {
    color: #616161 !important;
}
.theme-white nav > ul > li > a:hover,
.theme-white nav > ul > li > .dropdown-trigger:hover {
    color: #212121 !important;
}
.theme-white nav > ul > li > a.active,
.theme-white nav > ul > li > .dropdown-trigger.active {
    color: #1565c0 !important;
    border-bottom-color: #1565c0 !important;
}
.theme-white .dropdown-menu {
    background: #ffffff !important;
    border-color: rgba(0, 0, 0, 0.12) !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12) !important;
}
.theme-white .dropdown-menu a,
.theme-white .dropdown-menu button {
    color: #616161 !important;
}
.theme-white .dropdown-menu a:hover,
.theme-white .dropdown-menu button:hover {
    background: rgba(0, 0, 0, 0.04) !important;
    color: #212121 !important;
}
.theme-white .card,
.theme-white .login-card,
.theme-white .modal-card,
.theme-white .panel {
    background: #ffffff !important;
    border-color: rgba(0, 0, 0, 0.1) !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08) !important;
    color: #212121 !important;
}
.theme-white .btn {
    background: #f5f5f5 !important;
    border-color: rgba(0, 0, 0, 0.15) !important;
    color: #212121 !important;
}
.theme-white .btn:hover {
    background: #e0e0e0 !important;
}
.theme-white .btn-primary {
    background: linear-gradient(135deg, #003c8f 0%, #1565c0 100%) !important;
    border-color: #1976d2 !important;
    color: #ffffff !important;
}
.theme-white .btn-primary:hover {
    background: linear-gradient(135deg, #1565c0 0%, #5e92f3 100%) !important;
    color: #ffffff !important;
}
.theme-white .btn-success {
    background: linear-gradient(135deg, #2e7d32 0%, #4caf50 100%) !important;
    border-color: #4caf50 !important;
    color: #ffffff !important;
}
.theme-white .btn-danger {
    background: linear-gradient(135deg, #c62828 0%, #e53935 100%) !important;
    border-color: #e53935 !important;
    color: #ffffff !important;
}
.theme-white .btn-ghost {
    background: transparent !important;
    border-color: rgba(0, 0, 0, 0.15) !important;
    color: #616161 !important;
}
.theme-white .btn-ghost:hover {
    background: rgba(0, 0, 0, 0.04) !important;
    color: #212121 !important;
}
.theme-white input,
.theme-white textarea,
.theme-white select {
    background: #f8f8f8 !important;
    border-color: rgba(0, 0, 0, 0.15) !important;
    color: #212121 !important;
}
.theme-white input::placeholder,
.theme-white textarea::placeholder {
    color: #9e9e9e !important;
}
.theme-white input:focus,
.theme-white textarea:focus,
.theme-white select:focus {
    border-color: #1565c0 !important;
    box-shadow: 0 0 0 2px rgba(21, 101, 192, 0.15) !important;
}
.theme-white h1, .theme-white h2, .theme-white h3,
.theme-white h4, .theme-white h5, .theme-white h6 {
    color: #212121 !important;
}
.theme-white label {
    color: #424242 !important;
}
.theme-white .highlight,
.theme-white .changelog-version {
    color: #1565c0 !important;
}
.theme-white p {
    color: #616161 !important;
}
.theme-white a {
    color: #1565c0;
}
.theme-white a:hover {
    color: #003c8f;
}
.theme-white .modal-overlay {
    background: rgba(0, 0, 0, 0.4) !important;
}
.theme-white table th {
    background: #f0f0f0 !important;
    color: #424242 !important;
    border-color: rgba(0, 0, 0, 0.1) !important;
}
.theme-white table td {
    border-color: rgba(0, 0, 0, 0.06) !important;
    color: #424242 !important;
}
.theme-white table tr:hover td {
    background: rgba(0, 0, 0, 0.02) !important;
}
.theme-white ::-webkit-scrollbar-track {
    background: #f0f0f0;
}
.theme-white ::-webkit-scrollbar-thumb {
    background: #ccc;
}
.theme-white ::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}
.theme-white ::selection {
    background: #1565c0;
    color: white;
}

/* White mode - Override ALL inline dark backgrounds on generic elements */
.theme-white [style*="background:#0"],
.theme-white [style*="background:#1"],
.theme-white [style*="background:#2"],
.theme-white [style*="background:#3"],
.theme-white [style*="background: #0"],
.theme-white [style*="background: #1"],
.theme-white [style*="background: #2"],
.theme-white [style*="background: #3"],
.theme-white [style*="background:#000"],
.theme-white [style*="background-color:#0"],
.theme-white [style*="background-color:#1"],
.theme-white [style*="background-color:#2"],
.theme-white [style*="background-color:#3"] {
    background: #ffffff !important;
    border-color: rgba(0, 0, 0, 0.12) !important;
}
/* White mode - Override inline color:white / color:#fff on text */
.theme-white [style*="color:white"],
.theme-white [style*="color: white"],
.theme-white [style*="color:#fff"],
.theme-white [style*="color: #fff"],
.theme-white [style*="color:#ccc"],
.theme-white [style*="color: #ccc"],
.theme-white [style*="color:#ddd"],
.theme-white [style*="color: #ddd"],
.theme-white [style*="color:#e0e0e0"] {
    color: #212121 !important;
}
/* White mode - Override rgba(0,0,0,...) dark backgrounds */
.theme-white [style*="background:rgba(0"],
.theme-white [style*="background: rgba(0"],
.theme-white [style*="background:rgba(40"],
.theme-white [style*="background: rgba(40"] {
    background: rgba(240, 240, 240, 0.95) !important;
}
/* White mode - Override inline border-color on dark borders */
.theme-white [style*="border-color:#3"],
.theme-white [style*="border-color:#4"],
.theme-white [style*="border-color:#5"],
.theme-white [style*="border:1px solid #3"],
.theme-white [style*="border:1px solid #4"],
.theme-white [style*="border:1px solid #5"],
.theme-white [style*="border:2px solid #3"],
.theme-white [style*="border:2px solid #5"],
.theme-white [style*="border: 1px solid #3"],
.theme-white [style*="border: 1px solid #4"],
.theme-white [style*="border: 1px solid #5"] {
    border-color: rgba(0, 0, 0, 0.12) !important;
}
/* White mode - keep colored accent borders visible */
.theme-white [style*="border-color:#c62828"],
.theme-white [style*="border-color:#f44336"],
.theme-white [style*="border-color:#ff4444"],
.theme-white [style*="border-color:#4CAF50"],
.theme-white [style*="border-color:#9c27b0"],
.theme-white [style*="border:1px solid #c62828"],
.theme-white [style*="border:1px solid #f44336"],
.theme-white [style*="border:1px solid #4CAF50"],
.theme-white [style*="border:1px solid #9c27b0"],
.theme-white [style*="border:2px solid #f44336"],
.theme-white [style*="border:1px solid var(--accent-red)"] {
    background: #ffffff !important;
}
/* White mode - dark background containers in modals / forms */
.theme-white .modal-content,
.theme-white .modal-body,
.theme-white .modal-header,
.theme-white .modal-footer {
    background: #ffffff !important;
    color: #212121 !important;
    border-color: rgba(0, 0, 0, 0.1) !important;
}
/* White mode - generic badges and status labels keep contrasting text */
.theme-white .badge,
.theme-white .status-badge,
.theme-white .role-badge {
    color: white !important;
}
/* White mode - ensure colored buttons keep white text */
.theme-white .btn-primary,
.theme-white .btn-danger,
.theme-white .btn-success,
.theme-white .btn-dash,
.theme-white .btn-dash-red,
.theme-white .btn-dash-green,
.theme-white [style*="background:red"],
.theme-white [style*="background: red"],
.theme-white [style*="background:#c62828"],
.theme-white [style*="background:#d32f2f"],
.theme-white [style*="background:#4CAF50"],
.theme-white [style*="background:#1976d2"],
.theme-white [style*="background:linear-gradient"] {
    color: white !important;
}
/* White mode - tooltips / overlays need to stay visible */
.theme-white .tooltip,
.theme-white .popover {
    background: #ffffff !important;
    color: #212121 !important;
    border: 1px solid rgba(0, 0, 0, 0.12) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12) !important;
}
/* White mode - security lock override */
.theme-white .security-lock-overlay {
    background: rgba(255, 255, 255, 0.98) !important;
}
/* White mode - FAB menu */
.theme-white .fab-menu,
.theme-white .fab-container {
    background: #ffffff !important;
    border-color: rgba(0, 0, 0, 0.12) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1) !important;
}
/* White mode - sidebar, aside */
.theme-white aside,
.theme-white .sidebar {
    background: #ffffff !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
}
/* White mode - user rows / table rows (from main.css) */
.theme-white .user-row {
    background: #ffffff !important;
}
.theme-white .user-row:hover {
    background: #f5f5f5 !important;
}
.theme-white .user-row:nth-child(even) {
    background: #fafafa !important;
}
.theme-white .header-row-top th,
.theme-white .header-row-bottom th {
    background: #f0f0f0 !important;
    color: #424242 !important;
}
.theme-white .group-result {
    color: #212121 !important;
}
.theme-white .personal-name-cell {
    color: #212121 !important;
}
/* White mode - activity table number inputs */
.theme-white #activity-table input[type="number"] {
    background: #f8f8f8 !important;
    color: #212121 !important;
    border-color: rgba(0, 0, 0, 0.15) !important;
}
.theme-white #activity-table input[type="number"]:focus {
    background: #ffffff !important;
    border-color: #1565c0 !important;
}
/* White mode - intro overlay light version */
.theme-white .intro-overlay,
.theme-white #intro-overlay {
    background: rgba(255, 255, 255, 0.97) !important;
    color: #212121 !important;
}
/* White mode - bar container / progress */
.theme-white .bar-container,
.theme-white .progress-bar-bg {
    background: #e0e0e0 !important;
}
/* White mode - lightbox stays dark (intended) */
.theme-white .lightbox-overlay {
    background: rgba(0, 0, 0, 0.85) !important;
    color: white !important;
}
/* White mode - floating action button */
.theme-white .fab-btn {
    background: #1565c0 !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(21, 101, 192, 0.3) !important;
}
/* White mode - revision/case detail containers */
.theme-white .case-detail-section,
.theme-white .revision-card,
.theme-white .case-card {
    background: #ffffff !important;
    border-color: rgba(0, 0, 0, 0.1) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06) !important;
}
/* White mode - collapsible sections */
.theme-white details summary {
    background: #f5f5f5 !important;
    color: #212121 !important;
    border-color: rgba(0, 0, 0, 0.1) !important;
}
.theme-white details[open] summary {
    background: #eeeeee !important;
}

/* ============================
   White Mode - View-specific class overrides
   (Override hardcoded dark CSS in <style> blocks)
   ============================ */

/* --- Admin panel --- */
.theme-white .user-count-badge strong { color: #212121 !important; }
.theme-white .rank-badge { background: #f0f0f0 !important; border-color: rgba(0,0,0,0.12) !important; color: #616161 !important; }
.theme-white .badge-default { background: #e0e0e0 !important; border-color: rgba(0,0,0,0.1) !important; color: #424242 !important; }
.theme-white .locked-badge { color: #bdbdbd !important; }
.theme-white .empty-state { color: #9e9e9e !important; }
.theme-white .user-name { color: #212121 !important; }
.theme-white .user-id { color: #9e9e9e !important; }
.theme-white .slider { background-color: #ccc !important; }
.theme-white .search-results-list { background: #ffffff !important; border-color: rgba(0,0,0,0.12) !important; }
.theme-white .search-result-item { border-bottom-color: rgba(0,0,0,0.08) !important; color: #424242 !important; }
.theme-white .search-result-item:hover { background: #f5f5f5 !important; color: #212121 !important; }

/* --- Profile --- */
.theme-white .profile-avatar { background: #f0f0f0 !important; }
.theme-white .stat-card { border-color: rgba(0,0,0,0.1) !important; background: #ffffff !important; }
.theme-white .stat-value { color: #212121 !important; }
.theme-white .stat-label { color: #616161 !important; }
.theme-white .ribbon-section { background: rgba(0,0,0,0.03) !important; border-color: rgba(0,0,0,0.1) !important; }
.theme-white .ribbon-slot { border-color: rgba(0,0,0,0.12) !important; }
.theme-white .ribbon-detail-header { border-color: rgba(0,0,0,0.1) !important; }
.theme-white .ribbon-detail-title { color: #212121 !important; }
.theme-white .ribbon-fallback { border-color: rgba(0,0,0,0.2) !important; color: #9e9e9e !important; background: rgba(0,0,0,0.03) !important; }
.theme-white .ribbon-name { color: #424242 !important; }
.theme-white .ribbon-date { color: #9e9e9e !important; }

/* --- Departments --- */
.theme-white .dept-card { border-color: rgba(0,0,0,0.1) !important; background: #ffffff !important; }
.theme-white .dept-section h4 { color: #757575 !important; border-bottom-color: rgba(0,0,0,0.08) !important; }
.theme-white .role-label { color: #757575 !important; }
.theme-white .role-user { color: #212121 !important; }
.theme-white .edit-dept-btn { color: #9e9e9e !important; }
.theme-white .edit-dept-btn:hover { background: #f0f0f0 !important; color: #212121 !important; }

/* --- Troop Management --- */
.theme-white .troop-tab:hover { color: #212121 !important; }
.theme-white .troop-tab.active { color: #1565c0 !important; }
.theme-white .troop-stat-value { color: #212121 !important; }
.theme-white .troop-table-title { color: #212121 !important; }
.theme-white .unit-badge { color: white !important; } /* keep white on colored badge */
.theme-white .unit-name { color: #424242 !important; }
.theme-white .archive-header:hover { background: #f5f5f5 !important; }
.theme-white .archive-content { background: rgba(0,0,0,0.02) !important; }
.theme-white .cw-group { border-left-color: rgba(0,0,0,0.12) !important; }
.theme-white .day-group { border-left-color: rgba(0,0,0,0.15) !important; }
.theme-white select option { background-color: #ffffff !important; color: #212121 !important; }

/* --- Timeclock --- */
.theme-white .timeclock-card h3 { color: #212121 !important; }
.theme-white .status-text { color: #757575 !important; }
.theme-white .timeclock-table-header { color: #212121 !important; }
.theme-white .date-divider { background: #f0f0f0 !important; color: #1565c0 !important; border-bottom-color: rgba(0,0,0,0.08) !important; }
.theme-white .status-ended { color: #9e9e9e !important; }
.theme-white .history-toggle-btn:hover { background: #f5f5f5 !important; color: #212121 !important; }
.theme-white .tc-day-header { background: #f5f5f5 !important; border-color: rgba(0,0,0,0.08) !important; }
.theme-white .tc-day-header:hover { background: #eeeeee !important; border-color: rgba(0,0,0,0.12) !important; }
.theme-white .tc-day-count { color: #9e9e9e !important; }

/* --- Internal Revision --- */
.theme-white .custom-context-menu { background: #ffffff !important; border-color: #1565c0 !important; box-shadow: 0 4px 20px rgba(0,0,0,0.12) !important; }
.theme-white .ctx-header { color: #9e9e9e !important; border-bottom-color: rgba(0,0,0,0.08) !important; }
.theme-white .ctx-item { color: #424242 !important; }
.theme-white .ctx-item:hover { color: #212121 !important; background: #f5f5f5 !important; }
.theme-white .divider { background: rgba(0,0,0,0.08) !important; }
.theme-white .form-section-title { color: #757575 !important; border-bottom-color: rgba(0,0,0,0.08) !important; }
.theme-white .btn-small-add { background: #f0f0f0 !important; border-color: rgba(0,0,0,0.15) !important; color: #757575 !important; }
.theme-white .btn-small-add:hover { background: #e0e0e0 !important; color: #212121 !important; border-color: rgba(0,0,0,0.2) !important; }

/* --- Revision archive/active/details --- */
.theme-white .rev-archive-tree { background: #ffffff !important; border-color: rgba(0,0,0,0.1) !important; }
.theme-white .rev-tree-summary-month { color: #424242 !important; }
.theme-white .rev-tree-summary-kw { color: #757575 !important; }
.theme-white .rev-tree-item { background: #fafafa !important; border-color: rgba(0,0,0,0.1) !important; color: #212121 !important; }
.theme-white .rev-tree-item:hover { background: #f0f0f0 !important; border-color: rgba(0,0,0,0.15) !important; }
.theme-white .rev-details-title { color: #212121 !important; }
.theme-white .rev-dropzone { border-color: rgba(0,0,0,0.2) !important; color: #757575 !important; }
.theme-white .rev-dropzone:hover { color: #212121 !important; }
.theme-white .rev-meta-info { color: #9e9e9e !important; }
.theme-white .rev-ctx-item { color: #424242 !important; }
.theme-white .rev-ctx-item:hover { color: #212121 !important; background: #f5f5f5 !important; }

/* --- Points table --- */
.theme-white .row-abgemeldet { background: rgba(0,0,0,0.04) !important; }

/* --- Complaints / bugs btn --- */
.theme-white .btn-tiny { color: #616161 !important; }
.theme-white .btn-tiny:hover { color: #212121 !important; }

/* ============================
   CSS Reset & Base
   ============================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-primary);
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-base);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Rajdhani NUR für Fließtext / Beschreibungen */
p, textarea, input, select, option {
    font-family: var(--font-body);
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-surface);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-700);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-600);
}

/* Selection */
::selection {
    background: var(--color-primary);
    color: white;
}

/* Focus Outline */
:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* ============================
   Typography
   ============================ */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-primary);
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
}

h1 { font-size: var(--font-size-4xl); }
h2 { font-size: var(--font-size-3xl); }
h3 { font-size: var(--font-size-2xl); }
h4 { font-size: var(--font-size-xl); }
h5 { font-size: var(--font-size-lg); }
h6 { font-size: var(--font-size-md); }

p {
    margin-bottom: var(--space-md);
    color: var(--text-secondary);
}

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

a:hover {
    color: var(--color-primary-light);
    text-decoration: underline;
}

strong, b {
    font-weight: 700;
}

small {
    font-size: var(--font-size-sm);
}

/* ============================
   Lists
   ============================ */
ul, ol {
    list-style: none;
}

/* ============================
   Images & Media
   ============================ */
img, video {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ============================
   Tables Base
   ============================ */
table {
    border-collapse: collapse;
    width: 100%;
}

/* ============================
   Form Elements Base
   ============================ */
input, textarea, select, button {
    font-family: inherit;
    font-size: inherit;
}

button {
    cursor: pointer;
    border: none;
    background: none;
}

/* Prevent body scroll when modal is open */
html.modal-open,
body.modal-open {
    overflow: hidden;
}

/* ============================================
   SECTION 2: Layout (core/layout.css)
   ============================================ */
/**
 * Fleet Crew - Layout Styles
 * Containers, grids, flex layouts, and page structure
 */

/* ============================
   Container System
   ============================ */
.container {
    width: 100%;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--space-md);
    padding-right: var(--space-md);
}

.container-sm { max-width: 640px; }
.container-md { max-width: 768px; }
.container-lg { max-width: 1024px; }
.container-xl { max-width: 1280px; }
.container-fluid { max-width: 100%; }

/* ============================
   Main Content Area
   ============================ */
main {
    padding: var(--space-lg) var(--space-md);
    min-height: calc(100vh - 200px);
}

main.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* ============================
   Grid System
   ============================ */
.grid {
    display: grid;
    gap: var(--space-lg);
}

.grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid-cols-5 { grid-template-columns: repeat(5, 1fr); }
.grid-cols-6 { grid-template-columns: repeat(6, 1fr); }

/* Auto-fit responsive grids */
.grid-auto-fit {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid-auto-fill {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* Grid span utilities */
.col-span-1 { grid-column: span 1; }
.col-span-2 { grid-column: span 2; }
.col-span-3 { grid-column: span 3; }
.col-span-full { grid-column: 1 / -1; }

/* Gap variations */
.gap-0 { gap: 0; }
.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }

/* ============================
   Flexbox System
   ============================ */
.flex {
    display: flex;
}

.inline-flex {
    display: inline-flex;
}

/* Flex Direction */
.flex-row { flex-direction: row; }
.flex-col { flex-direction: column; }
.flex-row-reverse { flex-direction: row-reverse; }
.flex-col-reverse { flex-direction: column-reverse; }

/* Flex Wrap */
.flex-wrap { flex-wrap: wrap; }
.flex-nowrap { flex-wrap: nowrap; }

/* Justify Content */
.justify-start { justify-content: flex-start; }
.justify-end { justify-content: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-around { justify-content: space-around; }
.justify-evenly { justify-content: space-evenly; }

/* Align Items */
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.items-center { align-items: center; }
.items-baseline { align-items: baseline; }
.items-stretch { align-items: stretch; }

/* Align Self */
.self-start { align-self: flex-start; }
.self-end { align-self: flex-end; }
.self-center { align-self: center; }
.self-stretch { align-self: stretch; }

/* Flex Grow/Shrink */
.flex-1 { flex: 1 1 0%; }
.flex-auto { flex: 1 1 auto; }
.flex-initial { flex: 0 1 auto; }
.flex-none { flex: none; }
.grow { flex-grow: 1; }
.grow-0 { flex-grow: 0; }
.shrink { flex-shrink: 1; }
.shrink-0 { flex-shrink: 0; }

/* ============================
   Spacing Utilities
   ============================ */
/* Margin */
.m-0 { margin: 0; }
.m-xs { margin: var(--space-xs); }
.m-sm { margin: var(--space-sm); }
.m-md { margin: var(--space-md); }
.m-lg { margin: var(--space-lg); }
.m-xl { margin: var(--space-xl); }
.m-auto { margin: auto; }

.mt-0 { margin-top: 0; }
.mt-xs { margin-top: var(--space-xs); }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }

.mb-0 { margin-bottom: 0; }
.mb-xs { margin-bottom: var(--space-xs); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

.ml-0 { margin-left: 0; }
.ml-xs { margin-left: var(--space-xs); }
.ml-sm { margin-left: var(--space-sm); }
.ml-md { margin-left: var(--space-md); }
.ml-lg { margin-left: var(--space-lg); }
.ml-auto { margin-left: auto; }

.mr-0 { margin-right: 0; }
.mr-xs { margin-right: var(--space-xs); }
.mr-sm { margin-right: var(--space-sm); }
.mr-md { margin-right: var(--space-md); }
.mr-lg { margin-right: var(--space-lg); }
.mr-auto { margin-right: auto; }

.mx-auto { margin-left: auto; margin-right: auto; }
.my-auto { margin-top: auto; margin-bottom: auto; }

/* Padding */
.p-0 { padding: 0; }
.p-xs { padding: var(--space-xs); }
.p-sm { padding: var(--space-sm); }
.p-md { padding: var(--space-md); }
.p-lg { padding: var(--space-lg); }
.p-xl { padding: var(--space-xl); }
.p-2xl { padding: var(--space-2xl); }

.pt-0 { padding-top: 0; }
.pt-sm { padding-top: var(--space-sm); }
.pt-md { padding-top: var(--space-md); }
.pt-lg { padding-top: var(--space-lg); }

.pb-0 { padding-bottom: 0; }
.pb-sm { padding-bottom: var(--space-sm); }
.pb-md { padding-bottom: var(--space-md); }
.pb-lg { padding-bottom: var(--space-lg); }

.pl-0 { padding-left: 0; }
.pl-sm { padding-left: var(--space-sm); }
.pl-md { padding-left: var(--space-md); }
.pl-lg { padding-left: var(--space-lg); }

.pr-0 { padding-right: 0; }
.pr-sm { padding-right: var(--space-sm); }
.pr-md { padding-right: var(--space-md); }
.pr-lg { padding-right: var(--space-lg); }

.px-sm { padding-left: var(--space-sm); padding-right: var(--space-sm); }
.px-md { padding-left: var(--space-md); padding-right: var(--space-md); }

/* Space between children */
.space-y-1 > * + * { margin-top: 0.25rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-x-1 > * + * { margin-left: 0.25rem; }
.space-x-2 > * + * { margin-left: 0.5rem; }
.space-x-3 > * + * { margin-left: 0.75rem; }
.space-x-4 > * + * { margin-left: 1rem; }
.px-lg { padding-left: var(--space-lg); padding-right: var(--space-lg); }

.py-sm { padding-top: var(--space-sm); padding-bottom: var(--space-sm); }
.py-md { padding-top: var(--space-md); padding-bottom: var(--space-md); }
.py-lg { padding-top: var(--space-lg); padding-bottom: var(--space-lg); }

/* ============================
   Width & Height
   ============================ */
.w-full { width: 100%; }
.w-auto { width: auto; }
.w-screen { width: 100vw; }
.w-fit { width: fit-content; }

.min-w-0 { min-width: 0; }
.min-w-full { min-width: 100%; }

.max-w-xs { max-width: 320px; }
.max-w-sm { max-width: 384px; }
.max-w-md { max-width: 448px; }
.max-w-lg { max-width: 512px; }
.max-w-xl { max-width: 576px; }
.max-w-2xl { max-width: 672px; }
.max-w-3xl { max-width: 768px; }
.max-w-4xl { max-width: 896px; }
.max-w-5xl { max-width: 1024px; }
.max-w-6xl { max-width: 1152px; }
.max-w-7xl { max-width: 1280px; }
.max-w-full { max-width: 100%; }
.max-w-none { max-width: none; }

.h-full { height: 100%; }
.h-auto { height: auto; }
.h-screen { height: 100vh; }
.h-fit { height: fit-content; }
.h-52 { height: 13rem; }
.h-64 { height: 16rem; }

.min-h-0 { min-height: 0; }
.min-h-full { min-height: 100%; }
.min-h-screen { min-height: 100vh; }

/* ============================
   Display
   ============================ */
.block { display: block; }
.inline-block { display: inline-block; }
.inline { display: inline; }
.hidden { display: none; }
.contents { display: contents; }

/* ============================
   Position
   ============================ */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }
.static { position: static; }

.inset-0 {
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
}

.top-0 { top: 0; }
.right-0 { right: 0; }
.bottom-0 { bottom: 0; }
.left-0 { left: 0; }

/* ============================
   Overflow
   ============================ */
.overflow-auto { overflow: auto; }
.overflow-hidden { overflow: hidden; }
.overflow-visible { overflow: visible; }
.overflow-scroll { overflow: scroll; }
.overflow-x-auto { overflow-x: auto; }
.overflow-y-auto { overflow-y: auto; }
.overflow-x-hidden { overflow-x: hidden; }
.overflow-y-hidden { overflow-y: hidden; }

/* ============================
   Z-Index
   ============================ */
.z-0 { z-index: 0; }
.z-10 { z-index: 10; }
.z-20 { z-index: 20; }
.z-30 { z-index: 30; }
.z-40 { z-index: 40; }
.z-50 { z-index: 50; }
.z-auto { z-index: auto; }

/* ============================
   Visibility
   ============================ */
.visible { visibility: visible; }
.invisible { visibility: hidden; }

/* ============================
   Responsive Breakpoints
   ============================ */
@media (min-width: 640px) {
    .sm\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
    .sm\:flex-row { flex-direction: row; }
    .sm\:block { display: block; }
    .sm\:hidden { display: none; }
}

@media (min-width: 768px) {
    .md\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
    .md\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
    .md\:flex-row { flex-direction: row; }
    .md\:block { display: block; }
    .md\:hidden { display: none; }
    .md\:text-left { text-align: left; }
    .md\:text-center { text-align: center; }
    .md\:text-3xl { font-size: var(--font-size-3xl); }
    .md\:p-lg { padding: var(--space-lg); }
    .md\:mb-0 { margin-bottom: 0; }
}

@media (min-width: 1024px) {
    .lg\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
    .lg\:grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
    .lg\:col-span-2 { grid-column: span 2; }
    .lg\:flex-row { flex-direction: row; }
    .lg\:block { display: block; }
    .lg\:hidden { display: none; }
}

@media (min-width: 1280px) {
    .xl\:grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
    .xl\:grid-cols-5 { grid-template-columns: repeat(5, 1fr); }
}

/* ============================
   Section Layouts
   ============================ */
.section {
    padding: var(--space-2xl) 0;
}

.section-header {
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--border-color);
}

.section-title {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ============================
   Two-Column Layout
   ============================ */
.layout-sidebar {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: var(--space-xl);
}

.layout-sidebar-right {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: var(--space-xl);
}

@media (max-width: 1024px) {
    .layout-sidebar,
    .layout-sidebar-right {
        grid-template-columns: 1fr;
    }
}

/* ============================
   Center Content
   ============================ */
.center {
    display: flex;
    justify-content: center;
    align-items: center;
}

.center-absolute {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* ============================
   Spacer Elements
   ============================ */
.spacer-sm { height: var(--space-sm); }
.spacer-md { height: var(--space-md); }
.spacer-lg { height: var(--space-lg); }
.spacer-xl { height: var(--space-xl); }
.spacer-2xl { height: var(--space-2xl); }

/* Compatibility with old h-X classes */
.h-12 { height: 48px; }

/* ============================
   Small screen (mobile-first safe)
   ============================ */
@media (max-width: 480px) {
    main {
        padding: var(--space-md) var(--space-sm);
    }
    .container {
        padding-left: var(--space-sm);
        padding-right: var(--space-sm);
    }
    .grid-cols-2,
    .grid-cols-3,
    .grid-cols-4 {
        grid-template-columns: 1fr;
    }
    .sm-stack { flex-direction: column !important; }
    .sm-w-full { width: 100% !important; }
}

/* ============================
   2K / QHD  (1920px+)
   ============================ */
@media (min-width: 1920px) {
    html { font-size: 17px; }

    .container,
    main.container {
        max-width: 1760px;
    }

    nav {
        max-width: 1760px;
    }

    main {
        padding: var(--space-xl) var(--space-lg);
    }

    .grid-auto-fit {
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    }
    .grid-auto-fill {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    }
}

/* ============================
   4K / UHD  (2560px+)
   ============================ */
@media (min-width: 2560px) {
    html { font-size: 18px; }

    .container,
    main.container {
        max-width: 2200px;
    }

    nav {
        max-width: 2200px;
    }

    main {
        padding: var(--space-2xl) var(--space-xl);
    }

    .grid-auto-fit {
        grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    }
    .grid-auto-fill {
        grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    }
}

/* ============================================
   SECTION 3: Utilities (core/utilities.css)
   ============================================ */
/**
 * Fleet Crew - Utility Classes
 * Typography, colors, effects, and helper classes
 */

/* ============================
   Typography Utilities
   ============================ */
/* Font Sizes */
.text-xs { font-size: var(--font-size-xs); }
.text-sm { font-size: var(--font-size-sm); }
.text-base { font-size: var(--font-size-base); }
.text-md { font-size: var(--font-size-md); }
.text-lg { font-size: var(--font-size-lg); }
.text-xl { font-size: var(--font-size-xl); }
.text-2xl { font-size: var(--font-size-2xl); }
.text-3xl { font-size: var(--font-size-3xl); }
.text-4xl { font-size: var(--font-size-4xl); }

/* Font Weights */
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

/* Text Alignment */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-justify { text-align: justify; }

/* Text Transform */
.uppercase { text-transform: uppercase; }
.lowercase { text-transform: lowercase; }
.capitalize { text-transform: capitalize; }
.normal-case { text-transform: none; }

/* Letter Spacing */
.tracking-tight { letter-spacing: -0.025em; }
.tracking-normal { letter-spacing: 0; }
.tracking-wide { letter-spacing: 0.025em; }
.tracking-wider { letter-spacing: 0.05em; }
.tracking-widest { letter-spacing: 0.1em; }

/* Line Height */
.leading-none { line-height: 1; }
.leading-tight { line-height: 1.25; }
.leading-normal { line-height: 1.5; }
.leading-relaxed { line-height: 1.75; }
.leading-loose { line-height: 2; }

/* Text Style */
.italic { font-style: italic; }
.not-italic { font-style: normal; }
.underline { text-decoration: underline; }
.no-underline { text-decoration: none; }
.line-through { text-decoration: line-through; }

/* Text Overflow */
.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.text-wrap { white-space: normal; }
.text-nowrap { white-space: nowrap; }
.break-words { word-wrap: break-word; }
.break-all { word-break: break-all; }

/* Font Family */
.font-primary { font-family: var(--font-primary); }
.font-mono { font-family: var(--font-mono); }

/* ============================
   Color Utilities
   ============================ */
/* Text Colors */
.text-white { color: var(--text-primary); }
.text-gray { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--color-primary); }
.text-secondary { color: var(--color-secondary); }
.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }
.text-error, .text-danger { color: var(--color-error); }
.text-info { color: var(--color-info); }
.text-accent { color: var(--color-accent); }
.text-gold { color: var(--color-accent-gold); }
.text-purple { color: var(--color-accent-purple); }
.text-cyan { color: var(--color-accent-cyan); }

/* Specific grays for legacy compatibility */
.text-gray-300 { color: #e0e0e0; }
.text-gray-400 { color: #bdbdbd; }
.text-gray-500 { color: #9e9e9e; }
.text-gray-600 { color: #757575; }

/* Background Colors */
.bg-transparent { background-color: transparent; }
.bg-base { background-color: var(--bg-base); }
.bg-surface { background-color: var(--bg-surface); }
.bg-elevated { background-color: var(--bg-elevated); }
.bg-primary { background-color: var(--color-primary); }
.bg-secondary { background-color: var(--color-secondary); }
.bg-success { background-color: var(--color-success); }
.bg-warning { background-color: var(--color-warning); }
.bg-error, .bg-danger { background-color: var(--color-error); }
.bg-info { background-color: var(--color-info); }

/* Legacy gray backgrounds */
.bg-gray-800 { background-color: #424242; }
.bg-gray-900 { background-color: #212121; }

/* Semi-transparent backgrounds */
.bg-black-50 { background-color: rgba(0, 0, 0, 0.5); }
.bg-black-75 { background-color: rgba(0, 0, 0, 0.75); }
.bg-white-5 { background-color: rgba(255, 255, 255, 0.05); }
.bg-white-10 { background-color: rgba(255, 255, 255, 0.1); }

/* Gradient Backgrounds */
.bg-gradient-primary {
    background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 100%);
}

.bg-gradient-secondary {
    background: linear-gradient(135deg, var(--color-secondary-dark) 0%, var(--color-secondary) 100%);
}

.bg-gradient-dark {
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
}

/* ============================
   Border Utilities
   ============================ */
.border { border: 1px solid var(--border-color); }
.border-0 { border: none; }
.border-t { border-top: 1px solid var(--border-color); }
.border-r { border-right: 1px solid var(--border-color); }
.border-b { border-bottom: 1px solid var(--border-color); }
.border-l { border-left: 1px solid var(--border-color); }

.border-2 { border-width: 2px; }
.border-4 { border-width: 4px; }

/* Border Colors */
.border-primary { border-color: var(--color-primary); }
.border-secondary { border-color: var(--color-secondary); }
.border-success { border-color: var(--color-success); }
.border-warning { border-color: var(--color-warning); }
.border-error { border-color: var(--color-error); }
.border-gray-600 { border-color: #757575; }
.border-gray-700 { border-color: #616161; }
.border-gray-800 { border-color: #424242; }

/* Border Radius */
.rounded-none { border-radius: 0; }
.rounded-sm { border-radius: var(--radius-sm); }
.rounded { border-radius: var(--radius-md); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-2xl { border-radius: var(--radius-2xl); }
.rounded-full { border-radius: var(--radius-full); }

/* ============================
   Shadow Utilities
   ============================ */
.shadow-none { box-shadow: none; }
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow { box-shadow: var(--shadow-md); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: var(--shadow-xl); }
.shadow-2xl { box-shadow: var(--shadow-xl); }
.shadow-glow { box-shadow: var(--shadow-glow); }

/* ============================
   Effects & Filters
   ============================ */
.opacity-0 { opacity: 0; }
.opacity-25 { opacity: 0.25; }
.opacity-50 { opacity: 0.5; }
.opacity-75 { opacity: 0.75; }
.opacity-100 { opacity: 1; }

.blur-sm { filter: blur(4px); }
.blur { filter: blur(8px); }
.blur-lg { filter: blur(16px); }
.blur-none { filter: none; }

.backdrop-blur { backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.backdrop-blur-lg { backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }

/* Glass Effect */
.glass {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Glow Effects */
.glow-primary { box-shadow: 0 0 20px var(--color-primary-glow); }
.glow-success { box-shadow: 0 0 20px rgba(76, 175, 80, 0.4); }
.glow-warning { box-shadow: 0 0 20px rgba(255, 152, 0, 0.4); }
.glow-error { box-shadow: 0 0 20px rgba(244, 67, 54, 0.4); }

/* Text Shadow */
.text-shadow { text-shadow: 0 0 10px rgba(0, 0, 0, 0.5); }
.text-shadow-glow { text-shadow: 0 0 10px var(--color-primary-glow); }

/* ============================
   Transition Utilities
   ============================ */
.transition { transition: all var(--transition-base); }
.transition-fast { transition: all var(--transition-fast); }
.transition-slow { transition: all var(--transition-slow); }
.transition-none { transition: none; }

/* ============================
   Transform Utilities
   ============================ */
.rotate-45 { transform: rotate(45deg); }
.rotate-90 { transform: rotate(90deg); }
.rotate-180 { transform: rotate(180deg); }
.-rotate-45 { transform: rotate(-45deg); }
.-rotate-90 { transform: rotate(-90deg); }

.scale-95 { transform: scale(0.95); }
.scale-100 { transform: scale(1); }
.scale-105 { transform: scale(1.05); }
.scale-110 { transform: scale(1.10); }

.translate-y-0 { transform: translateY(0); }
.-translate-y-1 { transform: translateY(-4px); }
.-translate-y-2 { transform: translateY(-8px); }

/* ============================
   Cursor Utilities
   ============================ */
.cursor-auto { cursor: auto; }
.cursor-default { cursor: default; }
.cursor-pointer { cursor: pointer; }
.cursor-wait { cursor: wait; }
.cursor-text { cursor: text; }
.cursor-move { cursor: move; }
.cursor-not-allowed { cursor: not-allowed; }
.cursor-grab { cursor: grab; }

/* ============================
   User Select
   ============================ */
.select-none { user-select: none; }
.select-text { user-select: text; }
.select-all { user-select: all; }

/* ============================
   Pointer Events
   ============================ */
.pointer-events-none { pointer-events: none; }
.pointer-events-auto { pointer-events: auto; }

/* ============================
   Aspect Ratio
   ============================ */
.aspect-square { aspect-ratio: 1 / 1; }
.aspect-video { aspect-ratio: 16 / 9; }
.aspect-4-3 { aspect-ratio: 4 / 3; }

/* ============================
   Scroll Behavior
   ============================ */
.scroll-smooth { scroll-behavior: smooth; }
.scroll-auto { scroll-behavior: auto; }

/* ============================
   Screen Reader Only
   ============================ */
.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;
}

/* ============================
   Print Utilities
   ============================ */
@media print {
    .print-hidden { display: none !important; }
    .print-only { display: block !important; }
}

/* ============================
   Animation Utilities
   ============================ */
.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.animate-spin {
    animation: spin 1s linear infinite;
}

.animate-bounce {
    animation: bounce 1s infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(-25%);
        animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
    }
    50% {
        transform: translateY(0);
        animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
    }
}

.animate-fade-in {
    animation: fadeIn 0.3s ease-out;
}

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

/* ============================
   Hover State Utilities
   ============================ */
.hover\:opacity-75:hover { opacity: 0.75; }
.hover\:opacity-100:hover { opacity: 1; }
.hover\:scale-105:hover { transform: scale(1.05); }
.hover\:shadow-lg:hover { box-shadow: var(--shadow-lg); }
.hover\:shadow-glow:hover { box-shadow: var(--shadow-glow); }
.hover\:bg-elevated:hover { background: var(--bg-elevated); }
.hover\:text-white:hover { color: var(--text-primary); }
.hover\:border-primary:hover { border-color: var(--color-primary); }

/* ============================
   Focus State Utilities
   ============================ */
.focus\:ring:focus {
    outline: none;
    box-shadow: 0 0 0 3px var(--color-primary-glow);
}

.focus\:border-primary:focus {
    border-color: var(--color-primary);
}

/* ============================
   Group Hover (requires .group parent)
   ============================ */
.group:hover .group-hover\:visible { visibility: visible; }
.group:hover .group-hover\:opacity-100 { opacity: 1; }
.group:hover .group-hover\:translate-y-0 { transform: translateY(0); }

/* ============================================
   SECTION 4: Navigation (components/navigation.css)
   ============================================ */
/**
 * Fleet Crew - Navigation Styles
 * Header, navigation bar, dropdowns, and menus
 */

/* ============================
   Header
   ============================ */
header {
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    background: var(--nav-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 1px 28px rgba(0, 0, 0, 0.55);
    margin-bottom: 32px;
    padding: 6px 0;
}

header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(239, 68, 68, 0.22) 50%, transparent 100%);
    pointer-events: none;
}

@media (max-width: 600px) {
    header {
        margin-bottom: 20px;
    }
}

/* ============================
   Navigation
   ============================ */
/* Nav Logo */
.nav-logo-item {
    flex-shrink: 0;
    margin-right: 8px;
}
.nav-logo-link {
    display: flex;
    align-items: center;
    padding: 6px 8px !important;
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: opacity 0.2s ease;
}
.nav-logo-link::after { display: none !important; }
.nav-logo-link:hover { opacity: 0.8; }
.nav-logo {
    height: 30px;
    width: auto;
    display: block;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

nav {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

nav > ul {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}

nav > ul > li {
    position: relative;
}

nav > ul > li > a,
nav > ul > li > .dropdown-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 14px 13px;
    font-family: var(--font-primary);
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    transition: color 0.2s ease, background 0.2s ease;
    border-radius: var(--radius-sm);
    cursor: pointer;
    white-space: nowrap;
    position: relative;
}

/* Animated underline via ::after */
nav > ul > li > a::after,
nav > ul > li > .dropdown-trigger::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 60%;
    height: 2px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 1px;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

nav > ul > li > a:hover::after,
nav > ul > li > .dropdown-trigger:hover::after {
    transform: translateX(-50%) scaleX(1);
}

nav > ul > li > a:hover,
nav > ul > li > .dropdown-trigger:hover {
    color: #ffffff;
    text-decoration: none;
}

nav > ul > li > a.active,
nav > ul > li > .dropdown-trigger.active {
    color: var(--nav-active-color, #ef4444);
    background: var(--nav-active-bg, rgba(239, 68, 68, 0.10));
}

nav > ul > li > a.active::after,
nav > ul > li > .dropdown-trigger.active::after {
    transform: translateX(-50%) scaleX(1);
    background: rgba(239, 68, 68, 0.55);
}

nav > ul > li > a.active .nav-icon,
nav > ul > li > .dropdown-trigger.active .nav-icon {
    opacity: 1;
    color: #ef4444;
}

/* Nav icon styling */
nav .nav-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}
nav > ul > li > a:hover .nav-icon,
nav > ul > li > .dropdown-trigger:hover .nav-icon {
    opacity: 1;
}

/* Push profile area to the far right */
nav > ul > li.nav-profile-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
}

/* ============================
   Nav Action Buttons (Search, Bell)
   ============================ */
.nav-action-item {
    display: flex;
    align-items: center;
    list-style: none;
}
.nav-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    flex-shrink: 0;
    text-decoration: none;
}
.nav-action-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.25);
}
/* Override nav > ul > li > a defaults that break the circle shape */
nav > ul > li > a.nav-action-btn {
    padding: 0;
    width: 32px;
    height: 32px;
    letter-spacing: 0;
}
nav > ul > li > a.nav-action-btn::after {
    display: none !important;
}

/* Bell badge */
.nav-bell-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    font-family: var(--font-secondary);
    line-height: 1;
    animation: pulseBadge 2s infinite;
}

/* ============================
   Nav Profile Trigger (Avatar + Name)
   ============================ */
.nav-profile-trigger {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    padding: 6px 12px 6px 6px !important;
    border-radius: 24px !important;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    transition: all 0.2s ease;
    cursor: pointer;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.85);
    font-family: var(--font-primary);
    font-size: var(--font-size-sm);
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    position: relative;
    margin-left: 4px;
}
.nav-profile-trigger:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.25);
    color: #fff;
}
.nav-profile-trigger::after { display: none !important; }

.nav-profile-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.2);
}
.nav-profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.nav-profile-avatar svg {
    color: rgba(255, 255, 255, 0.5);
}

.nav-profile-name {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

.nav-profile-dropdown {
    right: 0;
    left: auto;
}

/* ============================
   Notification Dropdown
   ============================ */
.nav-notif-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 340px;
    background: linear-gradient(135deg, #1a2332, #1e3a5f);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
    z-index: var(--z-dropdown);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
    overflow: hidden;
}
.nav-notif-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.nav-notif-header {
    padding: 14px 16px;
    font-family: var(--font-primary);
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.nav-notif-list {
    max-height: 320px;
    overflow-y: auto;
}
.nav-notif-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.15s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.nav-notif-item:hover {
    background: rgba(255, 255, 255, 0.06);
}
.nav-notif-item.unread {
    background: rgba(59, 130, 246, 0.08);
    border-left: 3px solid #3b82f6;
}
.nav-notif-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2px;
}
.nav-notif-text {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.3;
}
.nav-notif-time {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.3);
    margin-top: 4px;
}
.nav-notif-empty {
    padding: 24px 16px;
    text-align: center;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.85rem;
}
.nav-notif-footer {
    display: block;
    padding: 12px 16px;
    text-align: center;
    font-size: 0.8rem;
    color: #60a5fa;
    text-decoration: none;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    transition: background 0.15s ease;
}
.nav-notif-footer:hover {
    background: rgba(255, 255, 255, 0.06);
}

/* ============================
   User Search Overlay
   ============================ */
.nav-search-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 10001;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 8vh;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}
.nav-search-overlay.open {
    opacity: 1;
    visibility: visible;
}
.nav-search-modal {
    width: 100%;
    max-width: 780px;
    background: linear-gradient(135deg, #1a2332, #1e3a5f);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    overflow: hidden;
    transform: translateY(-20px);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.nav-search-overlay.open .nav-search-modal {
    transform: translateY(0);
}
.nav-search-input-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.5);
}
.nav-search-input-wrap input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    font-size: 1rem;
    font-family: var(--font-secondary);
    color: #fff;
}
.nav-search-input-wrap input::placeholder {
    color: rgba(255, 255, 255, 0.35);
}
.nav-search-kbd {
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.4);
    font-family: var(--font-secondary);
}
.nav-search-body {
    display: flex;
    min-height: 200px;
    max-height: 65vh;
}
.nav-search-results {
    width: 260px;
    min-width: 260px;
    overflow-y: auto;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}
.nav-search-hint {
    padding: 24px 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.85rem;
}
.nav-search-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.85);
    cursor: pointer;
    transition: background 0.15s ease;
}
.nav-search-item:hover {
    background: rgba(255, 255, 255, 0.06);
}
.nav-search-item.active {
    background: rgba(255, 255, 255, 0.1);
    border-left: 3px solid var(--primary);
}
.nav-search-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.15);
}
.nav-search-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.nav-search-avatar svg {
    color: rgba(255, 255, 255, 0.4);
}
.nav-search-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.nav-search-name {
    font-weight: 600;
    font-size: 0.82rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.nav-search-rank {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.4);
}

/* --- Profile Preview Panel --- */
.nav-search-preview {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}
.nav-search-preview-empty,
.nav-search-preview-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 160px;
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.85rem;
    gap: 8px;
}
.spinner-sm {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.preview-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}
.preview-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.preview-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.preview-avatar svg {
    color: rgba(255, 255, 255, 0.3);
}
.preview-identity {
    min-width: 0;
}
.preview-name {
    font-weight: 700;
    font-size: 1.05rem;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.preview-rank {
    font-size: 0.82rem;
    color: var(--primary-light, #5ba3e6);
    margin-top: 2px;
}
.preview-stats {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
}
.preview-stat {
    flex: 1;
    text-align: center;
    padding: 10px 6px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
}
.preview-stat-value {
    display: block;
    font-weight: 700;
    font-size: 1.1rem;
    color: #fff;
}
.preview-stat-label {
    display: block;
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}
.preview-section {
    margin-bottom: 14px;
}
.preview-section-title {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 8px;
    font-weight: 600;
}
.preview-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.preview-tag {
    padding: 3px 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
}
.preview-ribbons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.preview-ribbon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: help;
    transition: border-color 0.15s ease;
}
.preview-ribbon:hover {
    border-color: var(--primary);
}
.preview-ribbon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.preview-ribbon-placeholder {
    font-size: 1.2rem;
}
.preview-none {
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.8rem;
    font-style: italic;
}
.preview-meta {
    display: flex;
    gap: 16px;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.3);
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    margin-top: 14px;
}
.preview-profile-link {
    display: block;
    margin-top: 16px;
    text-align: center;
    padding: 10px 16px;
    background: var(--primary);
    color: #fff;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background 0.15s ease;
}
.preview-profile-link:hover {
    background: var(--primary-dark, #2563eb);
}

@media (max-width: 640px) {
    .nav-search-body {
        flex-direction: column;
    }
    .nav-search-results {
        width: 100%;
        min-width: 100%;
        max-height: 200px;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }
    .nav-search-preview {
        max-height: 45vh;
    }
}

/* ============================
   Dropdown Menu
   ============================ */
.dropdown-item {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 240px;
    background: var(--dropdown-bg, #1c0e0e);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6), 0 2px 8px rgba(0,0,0,0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all var(--transition-fast);
    z-index: var(--z-dropdown);
    overflow: hidden;
    padding: 8px 0;
}

.dropdown-item.open .dropdown-menu,
.dropdown-item:focus-within .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li {
    list-style: none;
}

.dropdown-menu a,
.dropdown-menu button {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 18px;
    font-family: var(--font-primary);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.3px;
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    text-align: left;
    white-space: nowrap;
}

.dropdown-menu a .nav-icon,
.dropdown-menu button .nav-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    opacity: 0.65;
    transition: opacity 0.15s ease;
}

.dropdown-menu a:hover,
.dropdown-menu button:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #ffffff;
}

.dropdown-menu a:hover .nav-icon,
.dropdown-menu button:hover .nav-icon {
    opacity: 1;
}

.dropdown-menu .divider {
    height: 1px;
    background: rgba(255,255,255,0.07);
    margin: 6px 0;
}

/* Remove legacy color overrides inside dropdowns */
.dropdown-menu a.nav-color-gold,
.dropdown-menu a.nav-color-green,
.dropdown-menu a.nav-color-purple,
.dropdown-menu a.nav-color-pink,
.dropdown-menu a.nav-color-blue,
.dropdown-menu a.nav-color-mv {
    color: rgba(255,255,255,0.75);
}

/* Rainbow text for birthday calendar */
.rainbow-text {
    background: linear-gradient(90deg, #ff0000, #ff8800, #ffff00, #00ff00, #0088ff, #8800ff, #ff0000);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: rainbow-sweep 3s linear infinite;
}

.rainbow-chevron-active {
    animation: rainbow-sweep 3s linear infinite;
}

@keyframes rainbow-sweep {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

/* Right-aligned dropdown (for profile menu) */
.dropdown-item:last-child .dropdown-menu,
.dropdown-right .dropdown-menu {
    left: auto;
    right: 0;
}

/* ============================
   Header Badge (Notification)
   ============================ */
.header-badge {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    background: var(--color-error);
    color: white;
    border-radius: var(--radius-full);
    min-width: 18px;
    height: 18px;
    font-size: 11px;
    font-weight: 700;
    margin-left: 5px;
    padding: 0 4px;
    font-family: var(--font-primary);
    animation: pulseBadge 2s infinite;
    vertical-align: middle;
    position: relative;
    top: -1px;
}

@keyframes pulseBadge {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(244, 67, 54, 0.7);
    }
    70% {
        transform: scale(1.1);
        box-shadow: 0 0 0 5px rgba(244, 67, 54, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(244, 67, 54, 0);
    }
}

/* ============================
   Mobile Navigation
   ============================ */

/* Standalone logo link (mobile header bar) */
.nav-logo-standalone {
    display: none;
}

/* Desktop logo inside ul – hide on mobile */
.nav-logo-desktop {
    display: list-item;
}

/* Hamburger Button – hidden on desktop */
.nav-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 42px;
    height: 42px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-md);
    cursor: pointer;
    z-index: 1001;
    transition: background 0.2s ease;
    flex-shrink: 0;
}
.nav-hamburger:hover {
    background: rgba(255, 255, 255, 0.12);
}
.nav-hamburger-bar {
    display: block;
    width: 22px;
    height: 2px;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}
.nav-hamburger.is-active .nav-hamburger-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.nav-hamburger.is-active .nav-hamburger-bar:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.nav-hamburger.is-active .nav-hamburger-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 768px) {
    .nav-logo-standalone {
        display: flex;
        align-items: center;
        padding: 4px 8px;
        border-radius: var(--radius-sm);
        transition: opacity 0.2s ease;
        flex-shrink: 0;
        text-decoration: none;
    }
    .nav-logo-standalone::after { display: none !important; }
    .nav-logo-standalone:hover { opacity: 0.8; }

    .nav-logo-desktop {
        display: none !important;
    }

    .nav-hamburger {
        display: flex;
    }

    nav {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        position: relative;
        padding: 0 var(--space-md);
    }

    nav > ul {
        display: none;
        position: fixed;
        top: calc(var(--header-height, 60px) + 8px);
        left: 0;
        right: 0;
        max-height: calc(100vh - 70px);
        overflow-y: auto;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        background: var(--dropdown-bg, #1c0e0e);
        border-top: 2px solid rgba(255, 255, 255, 0.08);
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
        z-index: 1000;
        padding: var(--space-sm) 0;
        animation: navSlideDown 0.25s ease-out;
    }

    nav > ul.nav-menu-open {
        display: flex;
    }

    @keyframes navSlideDown {
        from { opacity: 0; transform: translateY(-10px); }
        to   { opacity: 1; transform: translateY(0); }
    }

    body.nav-mobile-open {
        overflow: hidden;
    }

    nav > ul > li {
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    nav > ul > li:last-child {
        border-bottom: none;
        margin-left: 0;
    }

    nav > ul > li > a,
    nav > ul > li > .dropdown-trigger {
        padding: 14px 20px;
        justify-content: space-between;
        width: 100%;
    }

    nav > ul > li.nav-profile-right {
        margin-left: 0;
        padding: 12px 20px;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        flex-wrap: wrap;
        gap: 10px;
    }

    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        border-radius: 0;
        background: rgba(0, 0, 0, 0.2);
        display: none;
        min-width: auto;
    }
    
    .dropdown-item.open .dropdown-menu {
        display: block;
    }
    
    .dropdown-menu a,
    .dropdown-menu button {
        padding-left: 36px;
    }

    .nav-profile-name {
        max-width: 120px;
    }
}

/* ============================
   Sidebar Navigation
   ============================ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    background: var(--bg-surface);
    border-right: 1px solid var(--border-color);
    padding: var(--space-lg);
    overflow-y: auto;
    z-index: var(--z-fixed);
}

.sidebar-header {
    padding-bottom: var(--space-lg);
    margin-bottom: var(--space-lg);
    border-bottom: 1px solid var(--border-color);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.sidebar-link.active {
    background: var(--color-primary-glow);
    color: var(--text-primary);
}

/* ============================
   Breadcrumbs
   ============================ */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) 0;
    font-size: var(--font-size-sm);
}

.breadcrumb-item {
    color: var(--text-muted);
}

.breadcrumb-item a {
    color: var(--text-secondary);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    color: var(--text-primary);
}

.breadcrumb-separator {
    color: var(--text-muted);
}

.breadcrumb-item.active {
    color: var(--text-primary);
}

/* ============================
   Tabs Navigation
   ============================ */
.tabs {
    display: flex;
    gap: var(--space-xs);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0;
    margin-bottom: var(--space-lg);
    overflow-x: auto;
}

.tab {
    padding: 12px 20px;
    font-family: var(--font-primary);
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-secondary);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.tab:hover {
    color: var(--text-primary);
}

.tab.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ============================
   Pagination
   ============================ */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    padding: var(--space-lg) 0;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.page-link:hover {
    background: var(--gray-700);
    color: var(--text-primary);
}

.page-link.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
}

.page-link:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================
   SECTION 5: Components (components/components.css)
   ============================================ */
/**
 * Fleet Crew - Component Styles
 * Buttons, cards, panels, forms, tables, badges, and UI elements
 */

/* ============================
   Cards & Panels
   ============================ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow-lg);
    backdrop-filter: var(--glass-blur);
    transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.card:hover {
    border-color: var(--card-hover-border, rgba(255, 255, 255, 0.15));
    box-shadow: var(--card-hover-shadow, 0 16px 40px rgba(0, 0, 0, 0.55));
    transform: translateY(-2px);
}

.card-elevated {
    background: var(--bg-elevated);
    box-shadow: var(--shadow-xl);
}

.card-glass {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.card-glow {
    box-shadow: var(--shadow-glow), var(--shadow-lg);
}

.card-header {
    padding-bottom: var(--space-md);
    margin-bottom: var(--space-md);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-left: calc(-1 * var(--space-lg));
    margin-right: calc(-1 * var(--space-lg));
    margin-top: calc(-1 * var(--space-lg));
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    background: linear-gradient(90deg, var(--bg-elevated) 0%, var(--bg-surface) 100%);
}

.card-header h3,
.card-header h4 {
    margin: 0;
    font-size: var(--font-size-lg);
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
}

.card-header-icon {
    width: 18px;
    height: 18px;
    opacity: 0.7;
    flex-shrink: 0;
}

.card-body {
    padding: var(--space-md) 0;
}

.card-footer {
    padding-top: var(--space-md);
    margin-top: var(--space-md);
    border-top: 1px solid var(--border-color);
}

/* Panel - Alternative card style */
.panel {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.panel-header {
    background: linear-gradient(135deg, var(--bg-elevated) 0%, var(--bg-surface) 100%);
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.panel-body {
    padding: var(--space-lg);
}

/* ============================
   Buttons
   ============================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 12px 20px;
    font-family: var(--font-primary);
    font-size: var(--font-size-base);
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    color: var(--text-primary);
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
    white-space: nowrap;
}

.btn:hover {
    background: var(--gray-700);
    border-color: var(--gray-600);
    transform: translateY(-1px);
    text-decoration: none;
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Button Sizes */
.btn-sm {
    padding: 8px 14px;
    font-size: var(--font-size-sm);
}

.btn-lg {
    padding: 16px 28px;
    font-size: var(--font-size-lg);
}

.btn-xl {
    padding: 20px 36px;
    font-size: var(--font-size-xl);
}

.btn-tiny {
    padding: 4px 10px;
    font-size: var(--font-size-xs);
    border-radius: var(--radius-sm);
}

/* Button Full Width */
.btn-block {
    display: flex;
    width: 100%;
}

/* Button Variants */
.btn-primary {
    background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 100%);
    border-color: var(--color-primary);
    color: white;
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.18), transparent);
    transition: left 0.45s ease;
    pointer-events: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
    box-shadow: var(--shadow-glow-sm);
}

.btn-primary:hover::before {
    left: 160%;
}

.btn-secondary {
    background: linear-gradient(135deg, var(--color-secondary-dark) 0%, var(--color-secondary) 100%);
    border-color: var(--color-secondary);
    color: white;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, var(--color-secondary) 0%, var(--color-secondary-light) 100%);
    box-shadow: 0 0 15px rgba(33, 150, 243, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #2e7d32 0%, var(--color-success) 100%);
    border-color: var(--color-success);
    color: white;
}

.btn-success:hover {
    background: linear-gradient(135deg, var(--color-success) 0%, var(--color-success-light) 100%);
    box-shadow: 0 0 15px rgba(76, 175, 80, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #b71c1c 0%, var(--color-error) 100%);
    border-color: var(--color-error);
    color: white;
}

.btn-danger:hover {
    background: linear-gradient(135deg, var(--color-error) 0%, #ff7961 100%);
    box-shadow: 0 0 15px rgba(244, 67, 54, 0.4);
}

.btn-warning {
    background: linear-gradient(135deg, #e65100 0%, var(--color-warning) 100%);
    border-color: var(--color-warning);
    color: white;
}

.btn-ghost {
    background: transparent;
    border-color: var(--border-light);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--color-primary);
    color: var(--color-primary);
}

.btn-outline:hover {
    background: var(--color-primary);
    color: white;
}

/* Dashboard Action Buttons (Legacy Support) */
.dash-btn-section-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    text-transform: uppercase;
    padding: 10px 0 6px;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 8px;
    margin-top: 4px;
}

.dash-btn-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 4px;
}

.dash-btn-grid .btn-dash {
    margin-bottom: 0;
}

.btn-dash {
    width: 100%;
    padding: 12px 14px;
    margin-bottom: var(--space-sm);
    background: linear-gradient(135deg, #1a237e 0%, #283593 100%);
    border: 1px solid #3949ab;
    border-radius: var(--radius-md);
    color: white;
    font-weight: 700;
    transition: all var(--transition-base);
    justify-content: flex-start;
    gap: 10px;
    text-align: left;
}

.btn-dash svg {
    flex-shrink: 0;
    opacity: 0.85;
    width: 18px;
    height: 18px;
}

.btn-dash:hover {
    background: linear-gradient(135deg, #283593 0%, #3949ab 100%);
    box-shadow: 0 0 20px rgba(63, 81, 181, 0.4);
    transform: translateY(-2px);
}

.btn-dash-red {
    background: linear-gradient(135deg, #7f0000 0%, #b71c1c 100%);
    border-color: #c62828;
}

.btn-dash-red:hover {
    background: linear-gradient(135deg, #b71c1c 0%, #c62828 100%);
    box-shadow: 0 0 20px rgba(183, 28, 28, 0.5);
}

.btn-dash-green {
    background: rgba(76, 175, 80, 0.18);
    border-color: rgba(76, 175, 80, 0.55);
}

.btn-dash-green:hover {
    background: rgba(76, 175, 80, 0.3);
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.4);
}

/* Theme-specific dashboard buttons */
.theme-blü .btn-dash {
    background: linear-gradient(135deg, #0d47a1 0%, #1565c0 100%);
    border-color: #42a5f5;
}
.theme-blü .btn-dash:hover {
    background: linear-gradient(135deg, #1565c0 0%, #1976d2 100%);
    box-shadow: 0 0 20px rgba(25, 118, 210, 0.5);
}
.theme-blü .btn-dash-red {
    background: linear-gradient(135deg, #003c8f 0%, #0d47a1 100%);
    border-color: #1976d2;
}
.theme-blü .btn-dash-red:hover {
    background: linear-gradient(135deg, #0d47a1 0%, #1565c0 100%);
    box-shadow: 0 0 20px rgba(21, 101, 192, 0.5);
}

.theme-dark-orange .btn-dash {
    background: linear-gradient(135deg, #bf360c 0%, #e65100 100%);
    border-color: #ff9800;
}
.theme-dark-orange .btn-dash:hover {
    background: linear-gradient(135deg, #e65100 0%, #ff6d00 100%);
    box-shadow: 0 0 20px rgba(255, 87, 34, 0.5);
}
.theme-dark-orange .btn-dash-red {
    background: linear-gradient(135deg, #8d2400 0%, #bf360c 100%);
    border-color: #e65100;
}
.theme-dark-orange .btn-dash-red:hover {
    background: linear-gradient(135deg, #bf360c 0%, #e65100 100%);
    box-shadow: 0 0 20px rgba(230, 81, 0, 0.5);
}

.theme-christmas .btn-dash {
    background: linear-gradient(135deg, #1b5e20 0%, #2e7d32 100%);
    border-color: #66bb6a;
}
.theme-christmas .btn-dash:hover {
    background: linear-gradient(135deg, #2e7d32 0%, #388e3c 100%);
    box-shadow: 0 0 20px rgba(46, 125, 50, 0.5);
}
.theme-christmas .btn-dash-red {
    background: linear-gradient(135deg, #7f0000 0%, #b71c1c 100%);
    border-color: #c62828;
}
.theme-christmas .btn-dash-red:hover {
    background: linear-gradient(135deg, #b71c1c 0%, #c62828 100%);
    box-shadow: 0 0 20px rgba(183, 28, 28, 0.5);
}

.theme-gray .btn-dash {
    background: linear-gradient(135deg, #37474f 0%, #546e7a 100%);
    border-color: #78909c;
}
.theme-gray .btn-dash:hover {
    background: linear-gradient(135deg, #546e7a 0%, #607d8b 100%);
    box-shadow: 0 0 20px rgba(120, 144, 156, 0.5);
}
.theme-gray .btn-dash-red {
    background: linear-gradient(135deg, #263238 0%, #37474f 100%);
    border-color: #546e7a;
}
.theme-gray .btn-dash-red:hover {
    background: linear-gradient(135deg, #37474f 0%, #455a64 100%);
    box-shadow: 0 0 20px rgba(84, 110, 122, 0.5);
}

.theme-white .btn-dash {
    background: linear-gradient(135deg, #1565c0 0%, #1976d2 100%) !important;
    border-color: #42a5f5 !important;
    color: white !important;
}
.theme-white .btn-dash:hover {
    background: linear-gradient(135deg, #1976d2 0%, #2196f3 100%) !important;
    box-shadow: 0 0 15px rgba(33, 150, 243, 0.3) !important;
}
.theme-white .btn-dash-red {
    background: linear-gradient(135deg, #c62828 0%, #e53935 100%) !important;
    border-color: #ef5350 !important;
}
.theme-white .btn-dash-red:hover {
    background: linear-gradient(135deg, #e53935 0%, #ef5350 100%) !important;
    box-shadow: 0 0 15px rgba(229, 57, 53, 0.3) !important;
}
.theme-white .btn-dash-green {
    background: linear-gradient(135deg, #2e7d32 0%, #43a047 100%) !important;
    border-color: #66bb6a !important;
    color: white !important;
}
.theme-white .btn-dash-green:hover {
    background: linear-gradient(135deg, #43a047 0%, #4caf50 100%) !important;
    box-shadow: 0 0 15px rgba(76, 175, 80, 0.3) !important;
}
.theme-white .card {
    background: #ffffff !important;
    border-color: rgba(0, 0, 0, 0.1) !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06) !important;
}

/* ============================
   Form Elements
   ============================ */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-label {
    display: block;
    margin-bottom: var(--space-sm);
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 12px 16px;
    font-family: var(--font-primary);
    font-size: var(--font-size-base);
    color: var(--text-primary);
    background: var(--bg-input);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-glow);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--text-muted);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='white' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 48px;
}

.form-checkbox,
.form-radio {
    width: 18px;
    height: 18px;
    margin-right: var(--space-sm);
    accent-color: var(--color-primary);
    cursor: pointer;
}

.form-inline {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.form-hint {
    margin-top: var(--space-xs);
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

.form-error {
    color: var(--color-error);
}

/* Search Input */
.search-input {
    padding-left: 44px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23757575' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 16px center;
}

/* ============================
   Tables
   ============================ */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-size-sm);
}

.table th,
.table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background: var(--bg-elevated);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
}

.table tbody tr {
    transition: background var(--transition-fast);
}

.table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table-striped tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

.table-compact th,
.table-compact td {
    padding: 10px 12px;
}

/* ============================
   Badges & Tags
   ============================ */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    font-size: var(--font-size-xs);
    font-weight: 700;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-primary {
    background: var(--color-primary);
    color: white;
}

.badge-secondary {
    background: var(--color-secondary);
    color: white;
}

.badge-success {
    background: var(--color-success);
    color: white;
}

.badge-warning {
    background: var(--color-warning);
    color: black;
}

.badge-danger {
    background: var(--color-error);
    color: white;
}

.badge-info {
    background: var(--color-info);
    color: white;
}

.badge-outline {
    background: transparent;
    border: 1px solid currentColor;
}

.badge-glow {
    animation: badgePulse 2s infinite;
}

@keyframes badgePulse {
    0% { box-shadow: 0 0 0 0 var(--color-primary-glow); }
    70% { box-shadow: 0 0 0 8px transparent; }
    100% { box-shadow: 0 0 0 0 transparent; }
}

/* Count Badge (for notifications) */
.count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    font-size: 11px;
    font-weight: 700;
    color: white;
    background: var(--color-error);
    border-radius: var(--radius-full);
}

/* ============================
   Alerts & Messages
   ============================ */
.alert {
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    margin-bottom: var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.alert-success {
    background: rgba(76, 175, 80, 0.15);
    border-color: var(--color-success);
    color: #c8e6c9;
}

.alert-error,
.alert-danger {
    background: rgba(244, 67, 54, 0.15);
    border-color: var(--color-error);
    color: #ffcdd2;
}

.alert-warning {
    background: rgba(255, 152, 0, 0.15);
    border-color: var(--color-warning);
    color: #ffe0b2;
}

.alert-info {
    background: rgba(33, 150, 243, 0.15);
    border-color: var(--color-info);
    color: #bbdefb;
}

/* ============================
   Dividers
   ============================ */
.divider {
    height: 1px;
    background: var(--border-color);
    margin: var(--space-md) 0;
    border: none;
}

.divider-thick {
    height: 2px;
}

.divider-glow {
    background: linear-gradient(90deg, transparent, var(--color-primary), transparent);
}

/* ============================
   Avatars
   ============================ */
.avatar {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    object-fit: cover;
    border: 2px solid var(--border-light);
}

.avatar-sm { width: 32px; height: 32px; }
.avatar-lg { width: 64px; height: 64px; }
.avatar-xl { width: 96px; height: 96px; }

.avatar-group {
    display: flex;
}

.avatar-group .avatar {
    margin-left: -12px;
    border: 2px solid var(--bg-surface);
}

.avatar-group .avatar:first-child {
    margin-left: 0;
}

/* ============================
   Profile Frames (Profilrahmen)
   ============================ */
.ua-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}
.ua-wrap::before {
    content: '';
    display: none;
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    z-index: 0;
}
.ua-wrap > img, .ua-wrap > div { position: relative; z-index: 1; }

/* Bronze Frame */
.pf-bronze::before  { display: block; inset: -3px; background: linear-gradient(135deg, #8b5e2a, #cd7f32, #e8a854, #cd7f32, #8b5e2a); }
/* Silver Frame */
.pf-silver::before  { display: block; inset: -3px; background: linear-gradient(135deg, #73777a, #a8a8a8, #e0e0e0, #a8a8a8, #73777a); box-shadow: 0 0 6px rgba(192,192,192,0.3); }
/* Gold Frame */
.pf-gold::before    { display: block; inset: -4px; background: linear-gradient(135deg, #8b6914, #c5960c, #ffd700, #fff18f, #ffd700, #c5960c); box-shadow: 0 0 10px rgba(255,215,0,0.4); }
/* Purple Heart Frame */
.pf-purple-heart::before { display: block; inset: -4px; background: linear-gradient(135deg, #4a148c, #7b1fa2, #ce93d8, #e1bee7, #ce93d8, #7b1fa2); box-shadow: 0 0 12px rgba(156,39,176,0.5); }
/* Veteran I Frame */
.pf-veteran1::before { display: block; inset: -4px; background: linear-gradient(135deg, #7f0000, #b71c1c, #ff5252, #ff8a80, #ff5252, #b71c1c); box-shadow: 0 0 14px rgba(255,23,68,0.5); animation: pf-pulse-red 2.5s ease-in-out infinite; }
@keyframes pf-pulse-red { 0%,100% { box-shadow: 0 0 10px rgba(255,23,68,0.4); } 50% { box-shadow: 0 0 20px rgba(255,23,68,0.7); } }
/* Keeper Frames */
.pf-keeper-sec::before { display: block; inset: -4px; background: linear-gradient(135deg, #0d47a1, #1565c0, #42a5f5, #90caf9, #42a5f5, #1565c0); box-shadow: 0 0 14px rgba(66,165,245,0.5); animation: pf-pulse-blue 3s ease-in-out infinite; }
@keyframes pf-pulse-blue { 0%,100% { box-shadow: 0 0 10px rgba(66,165,245,0.4); } 50% { box-shadow: 0 0 22px rgba(66,165,245,0.7); } }
.pf-keeper-life::before { display: block; inset: -4px; background: linear-gradient(135deg, #1b5e20, #2e7d32, #66bb6a, #a5d6a7, #66bb6a, #2e7d32); box-shadow: 0 0 14px rgba(102,187,106,0.5); animation: pf-pulse-green 3s ease-in-out infinite; }
@keyframes pf-pulse-green { 0%,100% { box-shadow: 0 0 10px rgba(102,187,106,0.4); } 50% { box-shadow: 0 0 22px rgba(102,187,106,0.7); } }
.pf-keeper-tech::before { display: block; inset: -4px; background: linear-gradient(135deg, #bf360c, #e65100, #ff9800, #ffcc02, #ff9800, #e65100); box-shadow: 0 0 14px rgba(255,152,0,0.5); animation: pf-pulse-orange 3s ease-in-out infinite; }
@keyframes pf-pulse-orange { 0%,100% { box-shadow: 0 0 10px rgba(255,152,0,0.4); } 50% { box-shadow: 0 0 22px rgba(255,152,0,0.7); } }
/* High Expert Frame */
.pf-legendary-op::before { display: block; inset: -5px; background: conic-gradient(#f44336, #ff9800, #ffd700, #4caf50, #2196f3, #9c27b0, #f44336); box-shadow: 0 0 16px rgba(255,215,0,0.4); animation: pf-spin 3s linear infinite; }
/* Platin Frame */
.pf-platin::before  { display: block; inset: -5px; background: linear-gradient(135deg, #78909c, #b0bec5, #eceff1, #ffffff, #eceff1, #b0bec5, #78909c); box-shadow: 0 0 16px rgba(200,220,240,0.5); animation: pf-pulse-platin 3s ease-in-out infinite; }
@keyframes pf-pulse-platin { 0%,100% { box-shadow: 0 0 12px rgba(200,220,240,0.4); } 50% { box-shadow: 0 0 24px rgba(200,220,240,0.7); } }
/* Platin Honor Frame */
.pf-platin-honor::before { display: block; inset: -6px; background: conic-gradient(#eceff1, #ffd700, #eceff1, #ffd700, #eceff1, #ffd700, #eceff1); box-shadow: 0 0 20px rgba(255,215,0,0.6); animation: pf-spin 3s linear infinite; }

@keyframes pf-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ============================
   Name Styles (Namenfarben)
   ============================ */
.pn-silver { color: #c0c0c0 !important; }
.pn-gold { color: #ffd700 !important; text-shadow: 0 0 6px rgba(255,215,0,0.3); }
.pn-purple-heart { color: #ce93d8 !important; text-shadow: 0 0 6px rgba(206,147,216,0.3); }
.pn-veteran { color: #ff5252 !important; text-shadow: 0 0 6px rgba(255,82,82,0.3); font-weight: 700 !important; }
.pn-legendary { background: linear-gradient(90deg, #f44336, #ff9800, #ffd700, #4caf50, #2196f3); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; font-weight: 700 !important; }
.pn-platin { color: #eceff1 !important; text-shadow: 0 0 8px rgba(236,239,241,0.4); font-weight: 700 !important; }
.pn-platin-honor { background: linear-gradient(90deg, #ffd700, #eceff1, #ffd700); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; font-weight: 700 !important; animation: pn-shimmer 3s ease infinite; background-size: 200% auto; }

@keyframes pn-shimmer {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}

/* ============================
   Progress Bar
   ============================ */
.progress {
    height: 8px;
    background: var(--bg-elevated);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary-dark), var(--color-primary));
    border-radius: var(--radius-full);
    transition: width var(--transition-slow);
}

.progress-success .progress-bar {
    background: linear-gradient(90deg, #2e7d32, var(--color-success));
}

/* ============================
   Skeleton Loading
   ============================ */
.skeleton {
    background: linear-gradient(90deg, var(--bg-elevated) 25%, var(--bg-surface) 50%, var(--bg-elevated) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-md);
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================
   Tooltips
   ============================ */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 12px;
    background: var(--bg-elevated);
    color: var(--text-primary);
    font-size: var(--font-size-sm);
    border-radius: var(--radius-sm);
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
    pointer-events: none;
    z-index: var(--z-tooltip);
}

[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
    bottom: calc(100% + 8px);
}

/* ============================
   Ribbon Display (Custom)
   ============================ */
.ribbon-container {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
}

.ribbon-item {
    width: 40px;
    height: 12px;
    border-radius: 2px;
    box-shadow: var(--shadow-sm);
}

/* ============================
   Status Indicators
   ============================ */
.status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: var(--radius-full);
    margin-right: var(--space-xs);
}

.status-online { background: var(--color-success); box-shadow: 0 0 8px var(--color-success); }
.status-offline { background: var(--gray-600); }
.status-busy { background: var(--color-error); box-shadow: 0 0 8px var(--color-error); }
.status-away { background: var(--color-warning); box-shadow: 0 0 8px var(--color-warning); }

/* ============================================
   SECTION 6: Modals (components/modals.css)
   ============================================ */
/**
 * Fleet Crew - Modal & Overlay Styles
 * Modals, dialogs, lightboxes, and overlay components
 */

/* ============================
   Modal Overlay (Backdrop)
   ============================ */
.modal-overlay,
.header-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-overlay);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    z-index: var(--z-modal-backdrop);
    display: none;
    justify-content: center;
    align-items: center;
    padding: var(--space-md);
    overflow-y: auto;
}

.modal-overlay.active,
.modal-overlay[style*="display: flex"],
.header-modal-overlay[style*="display: flex"] {
    display: flex;
}

/* ============================
   Modal Card (Dialog Box)
   ============================ */
.modal-card,
.header-modal-card {
    position: relative;
    background: var(--bg-base);
    border: 1px solid var(--color-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-glow), var(--shadow-xl);
    width: 100%;
    max-width: 500px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    overflow-x: hidden;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Modal Sizes */
.modal-sm { max-width: 400px; }
.modal-md { max-width: 500px; }
.modal-lg { max-width: 700px; }
.modal-xl { max-width: 900px; }
.modal-full { max-width: calc(100vw - 32px); max-height: calc(100vh - 32px); }

/* ============================
   Modal Structure
   ============================ */
.modal-header {
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-family: var(--font-primary);
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: rgba(244, 67, 54, 0.2);
    border-color: var(--color-error);
    color: var(--color-error);
}

.modal-body {
    padding: var(--space-lg);
}

.modal-footer {
    padding: var(--space-lg);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm);
}

/* Simplified modal (no header/footer) */
.modal-simple {
    padding: var(--space-xl);
    text-align: center;
}

/* ============================
   Modal Variants
   ============================ */
/* Warning Modal */
.modal-warning {
    border-color: var(--color-warning);
    box-shadow: 0 0 30px rgba(255, 152, 0, 0.3), var(--shadow-xl);
}

.modal-warning .modal-header {
    background: rgba(255, 152, 0, 0.1);
}

/* Danger Modal */
.modal-danger {
    border-color: var(--color-error);
    box-shadow: 0 0 30px rgba(244, 67, 54, 0.3), var(--shadow-xl);
}

.modal-danger .modal-header {
    background: rgba(244, 67, 54, 0.1);
}

/* Success Modal */
.modal-success {
    border-color: var(--color-success);
    box-shadow: 0 0 30px rgba(76, 175, 80, 0.3), var(--shadow-xl);
}

.modal-success .modal-header {
    background: rgba(76, 175, 80, 0.1);
}

/* Info Modal */
.modal-info {
    border-color: var(--color-secondary);
    box-shadow: 0 0 30px rgba(33, 150, 243, 0.3), var(--shadow-xl);
}

.modal-info .modal-header {
    background: rgba(33, 150, 243, 0.1);
}

/* ============================
   Confirmation Dialog
   ============================ */
.confirm-dialog {
    max-width: 400px;
    text-align: center;
    padding: var(--space-xl);
}

.confirm-icon {
    font-size: 48px;
    margin-bottom: var(--space-md);
}

.confirm-title {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.confirm-message {
    color: var(--text-secondary);
    margin-bottom: var(--space-xl);
}

.confirm-actions {
    display: flex;
    gap: var(--space-sm);
    justify-content: center;
}

/* ============================
   Lightbox (Image Viewer)
   ============================ */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: var(--z-modal);
    display: none;
    justify-content: center;
    align-items: center;
}

.lightbox.active {
    display: flex;
}

.lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: var(--radius-full);
    color: white;
    font-size: 24px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ============================
   Toast Notifications
   ============================ */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: var(--z-tooltip);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.toast {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    animation: toastSlideIn 0.3s ease-out;
    min-width: 280px;
    max-width: 400px;
}

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

.toast-success { border-left: 4px solid var(--color-success); }
.toast-error { border-left: 4px solid var(--color-error); }
.toast-warning { border-left: 4px solid var(--color-warning); }
.toast-info { border-left: 4px solid var(--color-info); }

.toast-icon {
    font-size: 20px;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 700;
    color: var(--text-primary);
    font-size: var(--font-size-sm);
}

.toast-message {
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
}

/* ============================
   Popover
   ============================ */
.popover {
    position: absolute;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: var(--space-md);
    z-index: var(--z-popover);
    min-width: 200px;
    max-width: 320px;
}

.popover-arrow {
    position: absolute;
    width: 12px;
    height: 12px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    transform: rotate(45deg);
}

.popover-top .popover-arrow {
    bottom: -7px;
    left: 50%;
    margin-left: -6px;
    border-top: none;
    border-left: none;
}

.popover-bottom .popover-arrow {
    top: -7px;
    left: 50%;
    margin-left: -6px;
    border-bottom: none;
    border-right: none;
}

/* ============================
   Loading Overlay
   ============================ */
#page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-overlay);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    z-index: var(--z-loader);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
    opacity: 1;
    visibility: visible;
}

#page-loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Spinner */
.spinner {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(255, 255, 255, 0.1);
    border-top: 5px solid var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    box-shadow: 0 0 15px var(--color-primary-glow);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Pulse Loader */
.pulse-loader {
    width: 60px;
    height: 60px;
    background: var(--color-primary);
    border-radius: 50%;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    50% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ============================
   Takeover & Presence Modals
   ============================ */
@keyframes panicPulse {
    0% {
        box-shadow: 0 0 0 red;
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 30px red;
        transform: scale(1.02);
    }
    100% {
        box-shadow: 0 0 0 red;
        transform: scale(1);
    }
}

/* ============================
   Drawer (Slide Panel)
   ============================ */
.drawer-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-overlay);
    z-index: var(--z-modal-backdrop);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.drawer-overlay.active {
    opacity: 1;
    visibility: visible;
}

.drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 400px;
    max-width: 100%;
    height: 100vh;
    background: var(--bg-surface);
    border-left: 1px solid var(--border-color);
    z-index: var(--z-modal);
    transform: translateX(100%);
    transition: transform var(--transition-base);
    overflow-y: auto;
}

.drawer.active {
    transform: translateX(0);
}

.drawer-left {
    right: auto;
    left: 0;
    border-left: none;
    border-right: 1px solid var(--border-color);
    transform: translateX(-100%);
}

.drawer-left.active {
    transform: translateX(0);
}

.drawer-header {
    position: sticky;
    top: 0;
    background: var(--bg-surface);
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1;
}

.drawer-body {
    padding: var(--space-lg);
}

/* ============================================
   SECTION 7: Header/Footer Globals (pages/header.css)
   ============================================ */
/**
 * Fleet Crew - Global Header/Footer/Cookie/Nav Styles
 * =====================================================
 * Styles for elements rendered by layouts/header.php and layouts/footer.php
 * - body::before background overlay
 * - Cookie consent banner
 * - Navigation color classes
 * - Dropdown chevron
 * - Footer
 * - Page loader / spinner
 * - Header modals (password change, takeover, presence)
 * - Animations
 */

/* ============================
   Aurebesh Font Face
   ============================ */
@font-face {
    font-family: 'Aurebesh';
    src: url('/assets/fonts/Aurebesh.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

.font-aurebesh { font-family: 'Aurebesh', monospace !important; }

/* ============================
   Body Background Overlay
   ============================ */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.45;
    filter: blur(2px) brightness(0.85) saturate(0.9);
    pointer-events: none;
}

/* ============================
   Page Loader & Spinner
   ============================ */
#page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    transition: opacity 0.4s ease;
}

#page-loader.hidden {
    opacity: 0;
    pointer-events: none;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(211, 47, 47, 0.2);
    border-top-color: #d32f2f;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ============================
   Cookie Consent Banner
   ============================ */
.cookie-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.cookie-overlay--hidden {
    display: none;
}

.cookie-card {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 16px;
    padding: 40px;
    max-width: 480px;
    width: 90%;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.cookie-card__accent {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #d32f2f, #ff6659, #d32f2f);
}

.cookie-card__icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.cookie-card__title {
    font-family: 'Roboto', sans-serif;
    font-weight: 700;
    font-size: 1.4rem;
    color: #fff;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 15px;
}

.cookie-card__text {
    color: #999;
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 10px;
}

.cookie-card__text--small {
    font-size: 0.8rem;
    color: #777;
}

.cookie-card__actions {
    display: flex;
    gap: 12px;
    margin-top: 25px;
    justify-content: center;
}

.cookie-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-family: 'Roboto', sans-serif;
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.cookie-btn--accept {
    background: linear-gradient(135deg, #d32f2f, #b71c1c);
    color: #fff;
    box-shadow: 0 4px 15px rgba(211, 47, 47, 0.3);
}

.cookie-btn--accept:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(211, 47, 47, 0.5);
}

.cookie-btn--decline {
    background: transparent;
    color: #666;
    border: 1px solid #333;
}

.cookie-btn--decline:hover {
    color: #fff;
    border-color: #666;
}

.cookie-btn--retry {
    background: linear-gradient(135deg, #d32f2f, #b71c1c);
    color: #fff;
    margin-top: 20px;
    box-shadow: 0 4px 15px rgba(211, 47, 47, 0.3);
}

.cookie-btn--retry:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(211, 47, 47, 0.5);
}

.cookie-declined {
    display: none;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 16px;
    padding: 40px;
    max-width: 480px;
    width: 90%;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.cookie-declined__accent {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #f44336, #ff9800, #f44336);
}

.cookie-declined__title {
    font-family: 'Roboto', sans-serif;
    font-weight: 700;
    font-size: 1.4rem;
    color: #f44336;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 15px;
}

/* ============================
   Navigation Color Classes
   ============================ */
.nav-color-mv {
    color: #64b5f6 !important;
}

.nav-color-gold {
    color: #ffd700 !important;
}

.nav-color-green {
    color: #81c784 !important;
}

.nav-color-purple {
    color: #ce93d8 !important;
}

.nav-color-pink {
    color: #f48fb1 !important;
}

.nav-color-blue {
    color: #64b5f6 !important;
}

.nav-color-danger {
    color: #ef5350 !important;
}

.nav-color-accent {
    color: #ff9800 !important;
}

.nav-active-highlight {
    color: #4CAF50 !important;
    font-weight: bold;
    text-shadow: 0 0 5px rgba(76, 175, 80, 0.5);
}

/* ============================
   Mailbox Badge in Nav
   ============================ */
.nav-mailbox-badge {
    background: #ff9800 !important;
    color: #000 !important;
    font-weight: bold;
    animation: pulseBadge 2s infinite;
}

.nav-mailbox-active {
    color: #ff9800 !important;
    font-weight: bold;
}

.nav-unread-count {
    color: #ff9800;
    font-weight: bold;
    font-size: 0.85em;
}

/* ============================
   Dropdown Chevron
   ============================ */
.dropdown-chevron {
    display: inline-block;
    vertical-align: middle;
    margin-left: 4px;
    transition: transform 0.3s ease;
}

.dropdown-item:hover .dropdown-chevron,
.dropdown-trigger.active + .dropdown-menu ~ .dropdown-chevron {
    transform: rotate(180deg);
}

/* ============================
   Logout Button
   ============================ */
.logout-form {
    padding: 0;
    margin: 0;
}

.logout-btn {
    width: 100%;
    text-align: left;
    padding: 8px 15px !important;
    color: #ef5350 !important;
    font-family: 'Roboto', sans-serif;
    font-size: 0.75rem;
    letter-spacing: 1px;
    border: none !important;
    background: transparent !important;
    cursor: pointer;
    transition: all 0.2s;
}

.logout-btn:hover {
    background: rgba(244, 67, 54, 0.1) !important;
    color: #f44336 !important;
}

/* ============================
   Header Modal (Password, etc.)
   ============================ */
.header-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.header-modal-overlay.visible {
    display: flex;
}

.header-modal-card {
    max-width: 480px;
    width: 90%;
}

/* ============================
   Takeover & Presence Modals
   ============================ */
.takeover-modal {
    z-index: 10001;
}

.takeover-card {
    border-color: #ff9800 !important;
    box-shadow: 0 0 30px rgba(255, 152, 0, 0.3);
}

.takeover-pulse {
    animation: panicPulse 1.5s infinite;
}

@keyframes panicPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.presence-modal {
    z-index: 10002;
}

.presence-card {
    border-color: #2196f3 !important;
    box-shadow: 0 0 30px rgba(33, 150, 243, 0.3);
}

/* ============================
   Footer
   ============================ */
.site-footer {
    text-align: center;
    padding: 28px 20px 22px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 48px;
    font-size: 0.8rem;
    position: relative;
}

.site-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(239, 68, 68, 0.35), transparent);
}

.site-footer__copy {
    color: rgba(255, 255, 255, 0.22);
    letter-spacing: 1px;
}

.site-footer__links {
    margin-top: 8px;
}

.site-footer__link {
    color: rgba(255, 255, 255, 0.18);
    text-decoration: none;
    font-size: 0.75rem;
    letter-spacing: 1px;
    transition: color 0.2s;
}

.site-footer__link:hover {
    color: rgba(255, 255, 255, 0.5);
}

/* ============================
   Permission Denied Block
   ============================ */
.permission-denied {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    flex-direction: column;
}

.permission-denied__title {
    font-family: 'Roboto', sans-serif;
    font-weight: 700;
    font-size: 1.6rem;
    color: #666;
    letter-spacing: 4px;
    text-transform: uppercase;
}

/* ============================
   White Theme Overrides
   ============================ */
.theme-white .cookie-card,
.theme-white .cookie-declined {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.12);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.theme-white .cookie-card__title,
.theme-white .cookie-declined__title {
    color: #1565c0;
}

.theme-white .cookie-card__text {
    color: #616161;
}

.theme-white .cookie-card__text--small {
    color: #9e9e9e;
}

.theme-white .cookie-btn--accept,
.theme-white .cookie-btn--retry {
    background: linear-gradient(135deg, #1565c0, #0d47a1);
    box-shadow: 0 4px 15px rgba(21, 101, 192, 0.3);
}

.theme-white .cookie-btn--decline {
    border-color: rgba(0, 0, 0, 0.12);
    color: #9e9e9e;
}

.theme-white .site-footer {
    border-top-color: rgba(0, 0, 0, 0.08);
}

.theme-white .site-footer__copy {
    color: #9e9e9e;
}

.theme-white .site-footer__link {
    color: #bdbdbd;
}

.theme-white .site-footer__link:hover {
    color: #616161;
}

.theme-white .nav-color-mv { color: #1976d2 !important; }
.theme-white .nav-color-gold { color: #f9a825 !important; }
.theme-white .nav-color-green { color: #388e3c !important; }
.theme-white .nav-color-purple { color: #8e24aa !important; }
.theme-white .nav-color-pink { color: #d81b60 !important; }
.theme-white .nav-color-blue { color: #1976d2 !important; }
.theme-white .nav-color-danger { color: #e53935 !important; }
.theme-white .nav-color-accent { color: #f57c00 !important; }

.theme-white .nav-active-highlight {
    color: #2e7d32 !important;
    text-shadow: none;
}

.theme-white .logout-btn {
    color: #e53935 !important;
}

.theme-white .logout-btn:hover {
    background: rgba(229, 57, 53, 0.08) !important;
}

.theme-white .header-modal-overlay {
    background: rgba(0, 0, 0, 0.5);
}

.theme-white #page-loader {
    background: rgba(255, 255, 255, 0.9);
}

.theme-white .spinner {
    border-color: rgba(21, 101, 192, 0.2);
    border-top-color: #1565c0;
}

/* ============================================
   SECTION 8: Page-Specific Overrides
   ============================================ */
   Page-Specific Overrides
   ============================ */

/* Login Page - Full screen centered layout */
.page-login {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-md);
}

.login-card {
    width: 100%;
    max-width: 500px;
    padding: var(--space-2xl);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    backdrop-filter: var(--glass-blur);
    position: relative;
    z-index: 10;
}

.login-header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.login-title {
    font-size: var(--font-size-4xl);
    color: var(--text-primary);
    text-shadow: 0 0 20px var(--color-primary-glow);
    margin: 0;
}

.login-subtitle {
    color: var(--text-secondary);
    margin-top: var(--space-xs);
    letter-spacing: 2px;
}

/* Dashboard Sections */
.dashboard-section {
    margin-bottom: var(--space-2xl);
}

.dashboard-welcome {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.dashboard-welcome h1 {
    font-size: var(--font-size-4xl);
    margin-bottom: var(--space-sm);
}

.dashboard-welcome .highlight {
    color: var(--color-primary);
}

/* Changelog & Announcements */
.changelog-item,
.announcement-item {
    border-left: 3px solid var(--color-primary);
    padding-left: var(--space-md);
    margin-bottom: var(--space-lg);
}

.changelog-version {
    color: var(--color-primary);
    font-weight: 700;
}

.changelog-date {
    color: var(--text-muted);
    font-size: var(--font-size-sm);
}

/* Message Labels */
.msg-label-om {
    display: inline-block;
    padding: 2px 8px;
    background: rgba(255, 215, 0, 0.2);
    border: 1px solid var(--color-accent-gold);
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    color: var(--color-accent-gold);
}

.msg-label-platoon {
    display: inline-block;
    padding: 2px 8px;
    background: rgba(211, 47, 47, 0.2);
    border: 1px solid var(--color-primary);
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    color: var(--color-primary);
}

/* Ticker (Login Page) */
.login-ticker {
    position: fixed;
    bottom: 20px;
    width: 100%;
    text-align: center;
    z-index: 50;
}

.ticker-prefix {
    color: var(--color-error);
    font-weight: 700;
    margin-bottom: var(--space-xs);
}

.ticker-text {
    color: var(--text-primary);
    text-shadow: 0 0 5px black;
}

/* Timeclock Page */
.timeclock-grid {
    display: grid;
    gap: var(--space-md);
}

.timeclock-slot {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    text-align: center;
    transition: all var(--transition-base);
}

.timeclock-slot:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-glow-sm);
}

.timeclock-slot.active {
    border-color: var(--color-success);
    box-shadow: 0 0 15px rgba(76, 175, 80, 0.3);
}

/* ============================
   Profile Page Layout (Image 2 Design)
   ============================ */
.profile-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}
.profile-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--primary, #3b82f6);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 8px 18px;
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 20px;
    background: rgba(59, 130, 246, 0.06);
    transition: all 0.2s ease;
    margin-bottom: 20px;
}
.profile-back-link:hover {
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.5);
}
.profile-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
    align-items: start;
}
.profile-main {
    min-width: 0;
}

/* Sub-Tabs */
.profile-subtabs {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
}
.profile-subtab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: 2px solid transparent;
    border-radius: 10px 10px 0 0;
    color: rgba(255, 255, 255, 0.4);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
}
.profile-subtab:hover {
    color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.05);
}
.profile-subtab.active {
    background: rgba(255, 255, 255, 0.06);
    border-bottom-color: var(--primary, #3b82f6);
    color: #fff;
}
.profile-subtab svg {
    opacity: 0.6;
}
.profile-subtab.active svg {
    opacity: 1;
}

/* Tab Content */
.profile-tab-content {
    min-height: 300px;
}

/* Cards */
.profile-card {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
}
.profile-card-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 20px 0;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.profile-card-title svg {
    color: var(--primary, #3b82f6);
}

/* Empty State */
.profile-empty-state {
    text-align: center;
    padding: 50px 20px;
}
.profile-empty-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
    opacity: 0.3;
}
.profile-empty-title {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 8px;
    font-weight: 600;
}
.profile-empty-text {
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.85rem;
    margin: 0;
}

/* Sidebar */
.profile-sidebar {
    position: sticky;
    top: 80px;
}
.sidebar-user-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    margin-bottom: 20px;
}
.sidebar-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}
.sidebar-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.sidebar-avatar-initial {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 1.2rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.5);
}
.sidebar-user-info {
    min-width: 0;
}
.sidebar-username {
    font-weight: 700;
    font-size: 0.9rem;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-rank {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 2px;
}
.sidebar-section-title {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.35);
    text-transform: uppercase;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.sidebar-stat-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.sidebar-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.5);
}
.sidebar-stat-row:last-child {
    border-bottom: none;
}
.sidebar-stat-val {
    font-weight: 700;
    color: #fff;
    font-size: 0.85rem;
}
.sidebar-stat-val.accent {
    color: var(--primary, #3b82f6);
}

/* Anträge List */
.antraege-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.antrag-item {
    padding: 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    transition: border-color 0.15s ease;
}
.antrag-item:hover {
    border-color: rgba(255, 255, 255, 0.12);
}
.antrag-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.antrag-type {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
}
.antrag-status {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 12px;
    letter-spacing: 0.5px;
}
.antrag-status.pending {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}
.antrag-status.approved {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}
.antrag-status.rejected {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}
.antrag-status.progress {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}
.antrag-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: #fff;
    margin-bottom: 4px;
}
.antrag-desc {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 8px;
}
.antrag-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.antrag-date {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.25);
}
.antrag-comment {
    font-size: 0.72rem;
    color: var(--primary, #3b82f6);
    cursor: help;
}

/* Mobile Responsive */
@media (max-width: 900px) {
    .profile-layout {
        grid-template-columns: 1fr;
    }
    .profile-sidebar {
        position: static;
        order: -1;
    }
}

.ribbon-bar {
    width: 60px;
    height: 18px;
    border-radius: 2px;
    box-shadow: var(--shadow-sm);
}

/* Statistics Charts */
.chart-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--space-lg);
}

/* Points Table */
.points-table {
    width: 100%;
}

.points-table th,
.points-table td {
    padding: var(--space-md);
    border-bottom: 1px solid var(--border-color);
}

.points-cell-positive {
    color: var(--color-success);
}

.points-cell-negative {
    color: var(--color-error);
}

/* Admin Panel */
.admin-user-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    transition: all var(--transition-base);
}

.admin-user-card:hover {
    border-color: var(--color-primary);
}

/* Troop Management */
.troop-slot {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    text-align: center;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: all var(--transition-base);
}

.troop-slot.occupied {
    border-color: var(--color-success);
    background: rgba(76, 175, 80, 0.1);
}

.troop-slot.empty {
    border-style: dashed;
    color: var(--text-muted);
}

/* Revision/Case System */
.case-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.case-header {
    background: linear-gradient(135deg, var(--bg-elevated) 0%, var(--bg-surface) 100%);
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border-color);
}

.case-status {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: 700;
    text-transform: uppercase;
}

.case-status-open {
    background: rgba(255, 152, 0, 0.2);
    color: var(--color-warning);
    border: 1px solid var(--color-warning);
}

.case-status-closed {
    background: rgba(76, 175, 80, 0.2);
    color: var(--color-success);
    border: 1px solid var(--color-success);
}

/* Responsive Adjustments */
@media (max-width: 600px) {
    .dashboard-welcome h1 {
        font-size: var(--font-size-2xl);
    }
    
    .login-title {
        font-size: var(--font-size-2xl);
    }
    
}

/* ============================
   Points / Activity Matrix Table
   ============================ */
.matrix-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.matrix-sidebar {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    max-height: 70vh;
    overflow-y: auto;
}

.matrix-main {
    min-width: 0;
}

.archive-link {
    display: block;
    padding: 10px 12px;
    margin-bottom: 5px;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-size: 0.85rem;
    transition: all 0.2s;
    text-decoration: none;
}

.archive-link:hover {
    background: var(--bg-elevated);
    color: var(--text-white);
}

.archive-link.active {
    background: rgba(211, 47, 47, 0.15);
    color: var(--color-primary);
    border-left: 3px solid var(--color-primary);
}

.archive-item-wrapper.arch-hidden {
    opacity: 0.5;
}

.archive-item-wrapper.arch-test .archive-link {
    color: #9c27b0;
    font-style: italic;
}

/* Activity Table Styles */
#activity-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

#activity-table th,
#activity-table td {
    padding: 8px 6px;
    text-align: center;
    border: 1px solid #333;
    white-space: nowrap;
}

#activity-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-row-top th {
    background: #1a1a1a;
    color: var(--text-white);
    font-family: 'Roboto', sans-serif;
    font-weight: 700;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 10px 6px;
}

.header-row-bottom th {
    background: #111;
    color: var(--text-muted);
    font-size: 0.65rem;
    padding: 6px 4px;
}

.border-right {
    border-right: 2px solid #444 !important;
}

/* Group Colors */
.group-fb { background: rgba(103, 58, 183, 0.15); color: #b39ddb; }
.group-tr { background: rgba(0, 150, 136, 0.15); color: #80cbc4; }
.group-to { background: rgba(255, 193, 7, 0.15); color: #ffe082; }
.group-no { background: rgba(33, 150, 243, 0.15); color: #90caf9; }
.group-om { background: rgba(76, 175, 80, 0.15); color: #a5d6a7; }
.group-extra { background: rgba(156, 39, 176, 0.15); color: #ce93d8; }
.group-result { background: rgba(255, 255, 255, 0.05); color: white; }

/* User Row */
.user-row {
    background: #0a0a0a;
    transition: background 0.2s;
}

.user-row:hover {
    background: #151515;
}

.user-row:nth-child(even) {
    background: #0d0d0d;
}

.user-row:nth-child(even):hover {
    background: #151515;
}

/* Cell Styles */
.col-tiny { width: 40px; }
.col-rank { width: 50px;  font-size: 0.7rem; color: var(--text-muted); }
.col-name { width: 120px; text-align: left !important; }
.personal-rank-cell { color: var(--color-primary); font-weight: bold; }
.personal-name-cell { color: white !important; }

/* Input Styles in Table */
#activity-table input[type="number"],
#activity-table input.num-calc {
    width: 45px;
    padding: 4px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 4px;
    color: white;
    text-align: center;
    font-size: 0.8rem;
    -moz-appearance: textfield;
    appearance: textfield;
}

#activity-table input[type="number"]::-webkit-outer-spin-button,
#activity-table input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

#activity-table input[type="number"]:focus {
    outline: none;
    border-color: var(--color-primary);
    background: #222;
}

#activity-table input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--color-primary);
}

/* Result Cells */
.result-sum {
    font-weight: bold;
    font-size: 1rem !important;
    color: var(--color-success) !important;
}

.duty-val {
    font-size: 0.8rem;
}

/* Action Buttons */
.btn-action-green {
    background: rgba(76, 175, 80, 0.2);
    border: 1px solid #4caf50;
    color: #81c784;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: 15px;
}

.btn-action-green:hover {
    background: rgba(76, 175, 80, 0.35);
}

.btn-action-blü {
    background: rgba(33, 150, 243, 0.2);
    border: 1px solid #2196f3;
    color: #64b5f6;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: 15px;
}

.btn-action-blü:hover {
    background: rgba(33, 150, 243, 0.35);
}

/* ============================
   Points Legend Box
   ============================ */
.legend-container {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--space-lg);
    margin-top: 30px;
}

.legend-header {
    color: var(--color-primary);
    font-size: 1.2rem;
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--border-color);
}

.legend-table {
    width: 100%;
    border-collapse: collapse;
}

.legend-table th {
    background: var(--bg-elevated);
    color: var(--text-white);
    padding: 12px 15px;
    text-align: left;
    font-family: 'Roboto', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    border-bottom: 2px solid var(--border-color);
}

.legend-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #222;
    color: var(--text-gray);
    vertical-align: top;
}

.legend-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.legend-table .pts {
    
    font-weight: bold;
    color: var(--color-success);
    font-size: 1.3rem;
}

/* ============================
   Points – New Design System (pts-*)
   ============================ */

/* Hero */
.pts-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, rgba(26,26,35,0.95) 0%, rgba(18,18,26,0.98) 100%);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    padding: 28px 34px;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}
.pts-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 80% 50%, color-mix(in srgb, var(--color-primary) 5%, transparent) 0%, transparent 60%);
    pointer-events: none;
}
.pts-hero-left { display: flex; flex-direction: column; gap: 6px; }
.pts-hero-eyebrow { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.pts-hero-title {
    font-family: var(--font-primary, 'Rajdhani', sans-serif);
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-white, #fff);
    letter-spacing: 1px;
    margin: 0;
    line-height: 1.15;
}
.pts-hero-sub {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted, #888);
    font-size: 0.78rem;
    letter-spacing: 0.5px;
}
.pts-hero-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-end;
    flex-shrink: 0;
}

/* Status Badges */
.pts-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.6rem;
    padding: 3px 10px;
    border-radius: 20px;
    letter-spacing: 1.5px;
    font-weight: 700;
    text-transform: uppercase;
}
.pts-badge--live    { background: rgba(76,175,80,0.15);  color: #81c784; border: 1px solid rgba(76,175,80,0.35); }
.pts-badge--archive { background: rgba(33,150,243,0.15); color: #64b5f6; border: 1px solid rgba(33,150,243,0.35); }
.pts-badge--hidden  { background: rgba(255,152,0,0.15);  color: #ffb74d; border: 1px solid rgba(255,152,0,0.35); }
.pts-badge--test    { background: rgba(156,39,176,0.15); color: #ce93d8; border: 1px solid rgba(156,39,176,0.35); }

.pts-live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #4caf50;
    animation: pts-pulse 1.5s ease-in-out infinite;
    display: inline-block;
}
@keyframes pts-pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(76,175,80,0.45); }
    50%       { opacity: 0.8; box-shadow: 0 0 0 6px rgba(76,175,80,0); }
}

/* Hero Action Buttons */
.pts-btn-add,
.pts-btn-week {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 20px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    border: 1px solid transparent;
}
.pts-btn-add {
    background: rgba(76,175,80,0.18);
    border-color: rgba(76,175,80,0.5);
    color: #81c784;
}
.pts-btn-add:hover {
    background: rgba(76,175,80,0.3);
    color: #a5d6a7;
    box-shadow: 0 0 14px rgba(76,175,80,0.2);
}
.pts-btn-week {
    background: rgba(33,150,243,0.15);
    border-color: rgba(33,150,243,0.45);
    color: #64b5f6;
}
.pts-btn-week:hover {
    background: rgba(33,150,243,0.28);
    color: #90caf9;
    box-shadow: 0 0 14px rgba(33,150,243,0.2);
}

/* History Bar */
.pts-history-bar {
    background: rgba(0,0,0,0.22);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 10px;
    padding: 16px 20px;
    margin-top: 22px;
}
.pts-history-label {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--text-muted, #777);
    font-size: 0.6rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 14px;
}
.pts-history-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.pts-chip {
    display: inline-flex;
    flex-direction: column;
    padding: 7px 14px;
    border-radius: 20px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.09);
    color: var(--text-muted, #888);
    font-size: 0.75rem;
    text-decoration: none;
    transition: background 0.18s, color 0.18s, border-color 0.18s;
    line-height: 1.3;
}
.pts-chip:hover {
    background: rgba(255,255,255,0.09);
    color: #fff;
    border-color: rgba(255,255,255,0.18);
    text-decoration: none;
}
.pts-chip--active {
    background: rgba(211,47,47,0.15);
    border-color: rgba(211,47,47,0.45);
    color: var(--color-primary, #d32f2f);
}
.pts-chip--hidden { opacity: 0.55; font-style: italic; }
.pts-chip--test   { border-style: dashed; }
.pts-chip--toggle {
    background: transparent;
    border-color: rgba(255,255,255,0.1);
    color: var(--text-muted, #777);
    font-size: 0.68rem;
    cursor: pointer;
}
.pts-chip--toggle:hover {
    background: rgba(255,255,255,0.06);
    color: #aaa;
}
.pts-chip-sub {
    color: #555;
    font-size: 0.6rem;
    margin-top: 2px;
}

/* Legend Cards */
.pts-legend {
    background: var(--bg-surface, rgba(255,255,255,0.03));
    border: 1px solid var(--border-color, rgba(255,255,255,0.08));
    border-radius: 12px;
    padding: 24px;
    margin-top: 30px;
}
.pts-legend-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.pts-legend-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-primary, 'Rajdhani', sans-serif);
    color: var(--text-white, #fff);
    font-size: 0.95rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}
.pts-legend-edit-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-muted, #888);
    padding: 5px 14px;
    border-radius: 6px;
    font-size: 0.72rem;
    cursor: pointer;
    transition: all 0.2s;
}
.pts-legend-edit-btn:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}
/* Legend – compact grouped list */
.pts-lv-table {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.pts-lv-group {
    display: flex;
    align-items: flex-start;
    gap: 0;
    border-radius: 8px;
    overflow: hidden;
}
.pts-lv-badge {
    flex-shrink: 0;
    width: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-primary, 'Rajdhani', sans-serif);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--ga, #aaa);
    background: rgba(255,255,255,0.03);
    border-right: 2px solid var(--ga, #555);
    align-self: stretch;
    min-height: 100%;
}
.pts-lv-rows {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.pts-lv-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    background: rgba(255,255,255,0.02);
    transition: background 0.15s;
    flex-wrap: wrap;
}
.pts-lv-row:hover { background: rgba(255,255,255,0.05); }
.pts-lv-row--hl {
    background: rgba(255,196,0,0.05);
    border-left: 2px solid rgba(255,196,0,0.3);
}
.pts-lv-row--hl:hover { background: rgba(255,196,0,0.09); }
.pts-lv-cat {
    flex-shrink: 0;
    min-width: 170px;
    max-width: 220px;
    color: #e0e0e0;
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
}
.pts-lv-star { color: #ffd54f; font-size: 0.7rem; }
.pts-lv-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    flex: 1;
}
.pts-lv-desc {
    flex: 1;
    color: var(--text-muted, #888);
    font-size: 0.72rem;
    line-height: 1.4;
}
.pts-desc-tag {
    display: inline-block;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.09);
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 0.63rem;
    color: var(--text-muted, #888);
    line-height: 1.6;
    white-space: nowrap;
}
.pts-tag-hidden { display: none; }
.pts-tag-more {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 4px;
    color: #888;
    padding: 2px 8px;
    font-size: 0.6rem;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.pts-tag-more:hover { background: rgba(255,255,255,0.12); color: #ccc; }

/* pts-* responsive */
@media (max-width: 768px) {
    .pts-hero {
        flex-direction: column;
        align-items: flex-start;
        gap: 18px;
        padding: 20px;
    }
    .pts-hero-actions {
        align-items: stretch;
        width: 100%;
    }
    .pts-btn-add, .pts-btn-week {
        justify-content: center;
    }
    .pts-hero-title { font-size: 1.5rem; }
}

/* Responsive Matrix */
@media (max-width: 1200px) {
    .matrix-layout {
        grid-template-columns: 1fr;
    }
    
    .matrix-sidebar {
        max-height: 200px;
        display: flex;
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .matrix-sidebar h4 {
        width: 100%;
    }
    
    .archive-link {
        flex: 0 0 auto;
        padding: 6px 10px;
        font-size: 0.75rem;
    }
}

@media (max-width: 768px) {
    #activity-table {
        font-size: 0.7rem;
    }
    
    #activity-table input[type="number"] {
        width: 35px;
        padding: 2px;
    }
    
    .header-row-top th,
    .header-row-bottom th {
        padding: 4px 2px;
        font-size: 0.6rem;
    }
}

/* ============================
   FAB Design Menu
   ============================ */
.design-fab-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
}

.design-fab-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary), #6a1b1b);
    border: 2px solid var(--color-primary);
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(211, 47, 47, 0.4);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.design-fab-btn:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 6px 30px rgba(211, 47, 47, 0.6);
}

.design-menu {
    position: absolute;
    bottom: 70px;
    right: 0;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 8px 0;
    min-width: 200px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px) scale(0.95);
    transition: all 0.2s ease;
}

.design-menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.design-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 15px;
    background: transparent;
    border: none;
    color: var(--text-gray);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.design-option:hover {
    background: var(--bg-elevated);
    color: var(--text-white);
}

.design-option .dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
}

/* White mode - design menu */
.theme-white .design-fab-btn {
    box-shadow: 0 4px 20px rgba(21, 101, 192, 0.3) !important;
}
.theme-white .design-fab-btn:hover {
    box-shadow: 0 6px 30px rgba(21, 101, 192, 0.4) !important;
}
.theme-white .design-menu {
    background: #ffffff !important;
    border-color: rgba(0, 0, 0, 0.12) !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12) !important;
}
.theme-white .design-option {
    color: #616161 !important;
}
.theme-white .design-option:hover {
    background: #f5f5f5 !important;
    color: #212121 !important;
}
.theme-white .design-option .dot {
    border-color: rgba(0, 0, 0, 0.2) !important;
}

/* ============================
   Dashboard Layout Improvements
   ============================ */
.dashboard-grid-main {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--space-xl);
    align-items: start;
}

@media (max-width: 1100px) {
    .dashboard-grid-main {
        grid-template-columns: 1fr;
    }
}

/* Hero Banner */
.dash-hero {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    padding: 0;
    margin-bottom: var(--space-xl);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 0;
    box-shadow: var(--shadow-lg);
    backdrop-filter: var(--glass-blur);
}
.dash-hero-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: var(--space-md) var(--space-lg);
    background: linear-gradient(90deg, var(--bg-elevated) 0%, var(--bg-surface) 100%);
    border-bottom: 1px solid var(--border-color);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.dash-hero-body {
    padding: var(--space-md) var(--space-lg);
}
.dash-hero-title {
    font-family: var(--font-primary);
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 4px;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.dash-hero-title span {
    color: var(--color-primary-light);
}
.dash-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
}
.dash-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-md);
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    font-size: 0.78rem;
    color: var(--text-secondary);
}
.dash-hero-badge svg {
    width: 13px; height: 13px; opacity: 0.7;
}
.dash-hero-badge.online {
    background: rgba(76,175,80,0.15);
    border-color: rgba(76,175,80,0.35);
    color: #81c784;
}
.dash-hero-emblem {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--bg-elevated);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    overflow: hidden;
}
@media (max-width: 600px) {
    .dash-hero-inner { flex-direction: column; text-align: center; }
    .dash-hero-body { text-align: center; }
    .dash-hero-emblem { display: none; }
    .dash-hero-title { font-size: var(--font-size-lg); }
}

/* White mode – hero inherits card tokens, no overrides needed */

/* Action Tiles Grid */
.dash-tiles-section {
    margin-bottom: var(--space-xl);
}
.dash-tiles-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 10px;
    padding-left: 2px;
}
.dash-tiles-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}
@media (max-width: 900px) { .dash-tiles-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 450px) { .dash-tiles-grid { grid-template-columns: repeat(2, 1fr); } }

.dash-tile {
    position: relative;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 18px 14px 16px;
    cursor: pointer;
    transition: all 0.22s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
    overflow: hidden;
    user-select: none;
}
.dash-tile::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: var(--tile-accent, var(--color-primary));
    opacity: 0;
    transition: opacity 0.2s;
}
.dash-tile:hover {
    transform: translateY(-3px);
    border-color: var(--tile-accent, var(--color-primary));
    box-shadow: 0 8px 28px rgba(0,0,0,0.3), 0 0 0 1px var(--tile-accent, var(--color-primary));
    background: var(--bg-surface);
}
.dash-tile:hover::before { opacity: 1; }
.dash-tile:active { transform: translateY(-1px); }

.dash-tile-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--tile-accent, var(--color-primary)) 15%, transparent);
    border-color: color-mix(in srgb, var(--tile-accent, var(--color-primary)) 30%, transparent);
    flex-shrink: 0;
}
.dash-tile-icon svg {
    width: 22px;
    height: 22px;
    color: var(--tile-accent, var(--color-primary));
    stroke: var(--tile-accent, var(--color-primary));
}
.dash-tile-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
}
.dash-tile-sub {
    font-size: 0.7rem;
    color: var(--text-muted);
    line-height: 1.3;
    margin-top: -4px;
}
.dash-tile-badge {
    position: absolute;
    top: 8px; right: 8px;
    background: #e53935;
    color: white;
    border-radius: 10px;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 6px;
    min-width: 18px;
    text-align: center;
}

/* Content columns */
.dash-content-col { display: flex; flex-direction: column; gap: var(--space-lg); }
.dash-sidebar-col { display: flex; flex-direction: column; gap: var(--space-lg); }

/* ============================
   Revision Dashboard Improvements  
   ============================ */
.rev-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-top: 0;
}

/* ── Stat Cards ── */
.rev-stat-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 12px;
    padding: 20px 22px;
    position: relative;
    overflow: hidden;
    transition: all 0.2s cubic-bezier(0.4,0,0.2,1);
    cursor: default;
}

.rev-stat-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.rev-stat-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255,255,255,0.12);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

/* coloured left accent per card type */
.rev-stat-card--aurek  { border-left: 3px solid rgba(239,68,68,0.5); }
.rev-stat-card--cresh  { border-left: 3px solid rgba(251,191,36,0.5); }
.rev-stat-card--nirn   { border-left: 3px solid rgba(34,197,94,0.5); }
.rev-stat-card--archive{ border-left: 3px solid rgba(107,114,128,0.5); }

.rev-stat-card--aurek:hover  { border-left-color: rgba(239,68,68,0.85); box-shadow: 0 8px 24px rgba(239,68,68,0.08); }
.rev-stat-card--cresh:hover  { border-left-color: rgba(251,191,36,0.85); box-shadow: 0 8px 24px rgba(251,191,36,0.08); }
.rev-stat-card--nirn:hover   { border-left-color: rgba(34,197,94,0.85); box-shadow: 0 8px 24px rgba(34,197,94,0.08); }
.rev-stat-card--archive:hover{ border-left-color: rgba(107,114,128,0.85); }

.rev-stat-card-icon {
    width: 38px;
    height: 38px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}
.rev-stat-card--aurek  .rev-stat-card-icon { background: rgba(239,68,68,0.1);  color: #ef4444; }
.rev-stat-card--cresh  .rev-stat-card-icon { background: rgba(251,191,36,0.1); color: #fbbf24; }
.rev-stat-card--nirn   .rev-stat-card-icon { background: rgba(34,197,94,0.1);  color: #22c55e; }
.rev-stat-card--archive .rev-stat-card-icon{ background: rgba(107,114,128,0.1);color: #6b7280; }

.rev-stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    line-height: 1;
    margin-bottom: 6px;
    font-family: var(--font-primary, 'Rajdhani', sans-serif);
}

.rev-stat-label {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* progress bar at bottom */
.rev-stat-bar {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 2px;
    background: rgba(255,255,255,0.05);
}
.rev-stat-bar::after {
    content: '';
    position: absolute;
    top: 0; left: 0;
    height: 100%;
    width: var(--bar-pct, 0%);
    background: var(--bar-color, #ef4444);
    transition: width 0.8s cubic-bezier(0.4,0,0.2,1);
    border-radius: 0 2px 2px 0;
    opacity: 0.6;
}

/* ── Search bar ── */
.rev-search-bar {
    position: relative;
    margin-top: 20px;
    margin-bottom: 0;
}
.rev-search-icon {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255,255,255,0.25);
    pointer-events: none;
    display: flex;
}
.rev-search-input {
    width: 100%;
    box-sizing: border-box;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 9px;
    padding: 10px 14px 10px 38px;
    color: #fff;
    font-size: 0.875rem;
    font-family: var(--font-primary, 'Rajdhani', sans-serif);
    outline: none;
    transition: all 0.18s ease;
}
.rev-search-input::placeholder { color: rgba(255,255,255,0.2); }
.rev-search-input:focus {
    border-color: rgba(239,68,68,0.35);
    background: rgba(239,68,68,0.04);
    box-shadow: 0 0 0 3px rgba(239,68,68,0.07);
}

/* ── Recent list ── */
.rev-recent-list {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    margin-top: 16px;
    overflow: hidden;
}

.rev-recent-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    font-family: var(--font-primary, 'Rajdhani', sans-serif);
    font-size: 0.72rem;
    font-weight: 700;
    color: rgba(255,255,255,0.4);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    background: rgba(0,0,0,0.15);
}

.rev-recent-header-icon {
    display: flex;
    align-items: center;
    color: rgba(239,68,68,0.6);
}

.rev-recent-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    transition: background 0.15s ease;
    gap: 12px;
}

.rev-recent-item:hover {
    background: rgba(255,255,255,0.03);
}

.rev-recent-item:last-child {
    border-bottom: none;
}

.rev-recent-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: rgba(255,255,255,0.2);
    font-size: 0.85rem;
    text-align: center;
    gap: 6px;
}

.rev-recent-link {
    text-decoration: none;
    flex: 1;
    min-width: 0;
}

.rev-recent-code {
    font-family: var(--font-primary, 'Rajdhani', monospace);
    font-size: 0.72rem;
    color: rgba(239,68,68,0.8);
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.rev-recent-title {
    color: rgba(255,255,255,0.9);
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
}

.rev-recent-meta {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.72rem;
    color: rgba(255,255,255,0.28);
}

.rev-recent-aside {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.rev-recent-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
}

.rev-recent-date {
    font-size: 0.68rem;
    color: rgba(255,255,255,0.22);
    letter-spacing: 0.3px;
}

/* ── Avatars ── */
.rev-recent-avatars {
    display: flex;
    align-items: center;
}
.rev-avatar {
    width: 24px;
    height: 24px;
    min-width: 24px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid rgba(0,0,0,0.5);
    margin-left: -5px;
    flex-shrink: 0;
    transition: transform 0.15s ease;
}
.rev-recent-avatars:hover .rev-avatar {
    margin-left: -2px;
}
.rev-avatar--placeholder {
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.55rem;
    color: white;
    font-weight: 700;
}
.rev-avatar--more {
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.55rem;
    color: rgba(255,255,255,0.5);
}

/* ── Phase badges ── */
.rev-phase-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-family: var(--font-primary, 'Rajdhani', sans-serif);
}
.rev-phase--aurek  { background: rgba(239,68,68,0.12);  color: #ef4444;  border-color: rgba(239,68,68,0.25);  }
.rev-phase--cresh  { background: rgba(251,191,36,0.12); color: #fbbf24;  border-color: rgba(251,191,36,0.25); }
.rev-phase--nirn   { background: rgba(34,197,94,0.12);  color: #22c55e;  border-color: rgba(34,197,94,0.25);  }
.rev-phase--default{ background: rgba(107,114,128,0.12);color: #9ca3af; border-color: rgba(107,114,128,0.25);}

/* ── Join button ── */
.rev-join-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.5);
    padding: 4px 9px;
    border-radius: 5px;
    font-size: 0.7rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.18s ease;
    white-space: nowrap;
    font-family: var(--font-primary, 'Rajdhani', sans-serif);
}
.rev-join-btn:hover {
    background: rgba(239,68,68,0.12);
    border-color: rgba(239,68,68,0.3);
    color: #ef4444;
}

/* ── Responsive ── */
@media (max-width: 900px) {
    .rev-dashboard-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 500px) {
    .rev-dashboard-grid { grid-template-columns: 1fr; }
    .rev-recent-aside { display: none; }
}

/* ============================
   White Mode Overrides for main.css
   ============================ */
.theme-white #activity-table th,
.theme-white #activity-table td {
    border-color: rgba(0, 0, 0, 0.1) !important;
}
.theme-white .header-row-top th {
    background: #e8eaf6 !important;
    color: #37474f !important;
}
.theme-white .header-row-bottom th {
    background: #f0f0f0 !important;
    color: #757575 !important;
}
.theme-white .border-right {
    border-right-color: rgba(0, 0, 0, 0.15) !important;
}
.theme-white .group-fb { background: rgba(103, 58, 183, 0.08) !important; color: #7b1fa2 !important; }
.theme-white .group-tr { background: rgba(0, 150, 136, 0.08) !important; color: #00897b !important; }
.theme-white .group-to { background: rgba(255, 193, 7, 0.08) !important; color: #f9a825 !important; }
.theme-white .group-no { background: rgba(33, 150, 243, 0.08) !important; color: #1976d2 !important; }
.theme-white .group-om { background: rgba(76, 175, 80, 0.08) !important; color: #388e3c !important; }
.theme-white .group-extra { background: rgba(156, 39, 176, 0.08) !important; color: #8e24aa !important; }
.theme-white .group-result { background: rgba(0, 0, 0, 0.03) !important; color: #212121 !important; }
.theme-white .user-row {
    background: #ffffff !important;
}
.theme-white .user-row:hover {
    background: #f5f5f5 !important;
}
.theme-white .user-row:nth-child(even) {
    background: #fafafa !important;
}
.theme-white .user-row:nth-child(even):hover {
    background: #f0f0f0 !important;
}
.theme-white .col-rank { color: #757575 !important; }
.theme-white .personal-rank-cell { color: #1565c0 !important; }
.theme-white .personal-name-cell { color: #212121 !important; }
.theme-white #activity-table input[type="number"],
.theme-white #activity-table input.num-calc {
    background: #f8f8f8 !important;
    border-color: rgba(0, 0, 0, 0.15) !important;
    color: #212121 !important;
}
.theme-white #activity-table input[type="number"]:focus {
    background: #ffffff !important;
    border-color: #1565c0 !important;
}
.theme-white .rev-recent-item {
    border-bottom-color: rgba(0, 0, 0, 0.08) !important;
}
.theme-white .rev-recent-header {
    color: #212121 !important;
}}

/* ============================
   Global Scroll & Fade Animations
   ============================ */
@keyframes fcFadeUp {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}

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

@keyframes fcSlideInLeft {
    from { opacity: 0; transform: translateX(-18px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* Scroll-reveal: hidden state set by JS, revealed via .fc-visible */
.fc-animate {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.fc-animate.fc-visible {
    opacity: 1;
    transform: none;
}

/* Staggered delay helpers */
.fc-delay-1 { transition-delay: 60ms; }
.fc-delay-2 { transition-delay: 120ms; }
.fc-delay-3 { transition-delay: 180ms; }
.fc-delay-4 { transition-delay: 240ms; }
.fc-delay-5 { transition-delay: 300ms; }

/* Utility: one-shot fade-up on load for page sections */
.fc-fade-up {
    animation: fcFadeUp 0.45s cubic-bezier(0.4, 0, 0.2, 1) both;
}
