.modal.is-open { animation: modalIn 180ms ease-out both; }
.modal.is-closing { animation: modalOut 160ms ease-in both; }

@keyframes modalIn {
  from { transform: scale(0.98); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
@keyframes modalOut {
  from { transform: scale(1); opacity: 1; }
  to   { transform: scale(0.985); opacity: 0; }
}

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

/* Modal variant accents */
.modal--danger { border-left: 4px solid var(--accent-danger); }
.modal--success { border-left: 4px solid var(--accent-success); }
.modal--warning { border-left: 4px solid var(--accent-warning); }
.modal--info { border-left: 4px solid var(--accent-primary); }

/* Header icon indicator */
.modal-header { gap: 0.75rem; }
.modal-icon {
  display: none; /* Removed per design standards */
  width: 18px;
  height: 18px;
  border-radius: 50%;
  flex-shrink: 0;
}
.modal-icon--danger { background: var(--accent-danger); }
.modal-icon--success { background: var(--accent-success); }
.modal-icon--warning { background: var(--accent-warning); }
.modal-icon--info { background: var(--accent-primary); }
/**
 * Draco Staff Development (DSD)
 * Main Stylesheet
 * Professional Dark Theme
 */

/* ============================================
   CSS VARIABLES & THEME SYSTEM
   ============================================ */

/* Dark Theme (Default) - Elegant Dark Palette */
:root,
[data-theme="dark"] {
    /* Background Colors - Deep, Rich Blacks */
    --bg-primary: #0a0a0a;
    --bg-secondary: #141414;
    --bg-tertiary: #1f1f1f;
    --bg-card: #141414;
    --bg-card-grey: #141414;
    --bg-login: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 50%, #242424 100%);
    --bg-input: #1a1a1a;
    
    /* Accent Colors - Subdued Professional Tones */
    --accent-primary: #2c3e50;
    --accent-secondary: #34495e;
    --accent-success: #6b8e7f;
    --accent-warning: #b8885f;
    --accent-danger: #a14854;
    --accent-info: #4d5f73;
    
    /* Text Colors - High Contrast for Readability */
    --text-primary: #f5f5f5;
    --text-secondary: #d1d1d1;
    --text-muted: #a0a0a0;
    --text-inverse: #1a1a1a;
    --text-input: #f5f5f5;
    
    /* Border Colors - Subtle, Elegant */
    --border-color: #2a2a2a;
    --border-hover: #3a3a3a;
    
    /* Shadows - Deep, Refined */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.6);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.7);
    
    /* Button Gradients - Sophisticated Blue */
    --gradient-button: linear-gradient(135deg, #5b9bd5 0%, #4a7fb8 100%);
    --gradient-button-hover: linear-gradient(135deg, #6aaae5 0%, #5a8fc8 100%);
    --gradient-success: linear-gradient(135deg, #6b8e7f 0%, #5a7d6e 100%);
    --gradient-success-hover: linear-gradient(135deg, #7a9786 0%, #6b8e7f 100%);
    --gradient-danger: linear-gradient(135deg, #a14854 0%, #8b3d47 100%);
    --gradient-danger-hover: linear-gradient(135deg, #b15560 0%, #a14854 100%);
    --gradient-secondary: linear-gradient(135deg, #94a3b8 0%, #64748b 100%);
    --gradient-secondary-hover: linear-gradient(135deg, #cbd5e1 0%, #94a3b8 100%);
    --gradient-warning: linear-gradient(135deg, #b8885f 0%, #a67854 100%);
    --gradient-warning-hover: linear-gradient(135deg, #c4956b 0%, #b8885f 100%);
    --gradient-primary: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    
    /* Logo & Branding */
    --logo-url: url('/assets/images/draco_w.png');
    --logo-bg: transparent;

    /* Modal header gradient (dark slate) */
    --modal-header-gradient: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
}

/* Light Theme - Elegant Light Palette */
[data-theme="light"] {
    /* Background Colors */
    --bg-primary: #fafafa;
    --bg-secondary: #f5f5f5;
    --bg-tertiary: #efefef;
    --bg-card: #ffffff;
    --bg-card-grey: #ffffff;
    --bg-login: linear-gradient(135deg, #fafafa 0%, #f0f0f0 50%, #e8e8e8 100%);
    --bg-input: #ffffff;
    
    /* Accent Colors - Sophisticated Blue */
    --accent-primary: #4a7fb8;
    --accent-secondary: #3d6a9a;
    --accent-success: #059669;
    --accent-warning: #5a7a8f;
    --accent-danger: #8b0000;
    --accent-info: #3d6a9a;
    
    /* Text Colors */
    --text-primary: #1a1a1a;
    --text-secondary: #4a4a4a;
    --text-muted: #6a6a6a;
    --text-inverse: #f5f5f5;
    --text-input: #1a1a1a;
    
    /* Border Colors */
    --border-color: #e0e0e0;
    --border-hover: #d0d0d0;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
    
    /* Button Gradients - Sophisticated Blue */
    --gradient-button: linear-gradient(135deg, #4a7fb8 0%, #3d6a9a 100%);
    --gradient-button-hover: linear-gradient(135deg, #5a8fc8 0%, #4d7aaa 100%);
    --gradient-success: linear-gradient(135deg, #5a7d6e 0%, #4d6c5f 100%);
    --gradient-success-hover: linear-gradient(135deg, #6b8e7f 0%, #5a7d6e 100%);
    --gradient-danger: linear-gradient(135deg, #8b3d47 0%, #7a3541 100%);
    --gradient-danger-hover: linear-gradient(135deg, #a14854 0%, #8b3d47 100%);
    --gradient-secondary: linear-gradient(135deg, #e5e7eb 0%, #cbd5e1 100%);
    --gradient-secondary-hover: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    --gradient-warning: linear-gradient(135deg, #a67854 0%, #957049 100%);
    --gradient-warning-hover: linear-gradient(135deg, #b8885f 0%, #a67854 100%);
    --gradient-primary: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    
    /* Logo & Branding */
    --logo-url: url('/assets/images/draco_b.png');
    --logo-bg: transparent;

    /* Modal header gradient (dark slate) */
    --modal-header-gradient: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
}

/* ============================================
   GLOBAL RESET & BASE STYLES
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 16px;
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
}

/* Standard Page Header (global) */
.page-header {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    border: none;
    box-shadow: 0 4px 12px rgba(44, 62, 80, 0.25);
    color: white;
}
.page-header h1,
.page-header h2,
.page-header h3,
.page-header h4,
.page-header h5,
.page-header h6 {
    margin: 0;
    color: white;
    font-size: 2rem;
    font-weight: 700;
}
.page-header p,
.page-header span,
.page-header div {
    margin: 0.5rem 0 0 0;
    color: rgba(255, 255, 255, 0.95);
}
.page-header svg,
.page-header i,
.page-header .icon {
    color: white;
    fill: white;
}
.page-header a {
    color: white;
    text-decoration: underline;
}
.page-header small,
.page-header .subtext,
.page-header .muted {
    color: rgba(255, 255, 255, 0.75);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--accent-secondary);
}

/* ============================================
   LOGIN PAGE STYLES - SMOOTH GRADIENT ANIMATION
   ============================================ */

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #000000 0%, #0a0e27 30%, #191970 100%);
    background-size: 200% 200%;
    animation: gradientShift 20s ease infinite;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

[data-theme="light"] .login-container {
    background: linear-gradient(135deg, #000000 0%, #0a0e27 30%, #191970 100%);
    background-size: 200% 200%;
    animation: gradientShift 20s ease infinite;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Colorful gradient orb 1 - Cyan/Teal with enhanced glow */
.login-container::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    top: -300px;
    right: -300px;
    background: radial-gradient(circle, rgba(0, 230, 255, 0.4) 0%, rgba(0, 180, 220, 0.25) 30%, rgba(0, 150, 200, 0.15) 50%, transparent 75%);
    border-radius: 50%;
    animation: floatOrb1 20s ease-in-out infinite, pulseGlow1 8s ease-in-out infinite;
    pointer-events: none;
    filter: blur(60px);
    box-shadow: 0 0 100px rgba(0, 200, 255, 0.3);
}

[data-theme="light"] .login-container::before {
    background: radial-gradient(circle, rgba(0, 230, 255, 0.4) 0%, rgba(0, 180, 220, 0.25) 30%, rgba(0, 150, 200, 0.15) 50%, transparent 75%);
}

@keyframes floatOrb1 {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(-120px, 120px) scale(1.15);
    }
    66% {
        transform: translate(60px, -60px) scale(0.95);
    }
}

@keyframes pulseGlow1 {
    0%, 100% {
        opacity: 0.7;
        filter: blur(60px);
    }
    50% {
        opacity: 1;
        filter: blur(80px);
    }
}

/* Colorful gradient orb 2 - Purple/Violet with enhanced glow */
.login-container::after {
    content: '';
    position: absolute;
    width: 700px;
    height: 700px;
    bottom: -350px;
    left: -350px;
    background: radial-gradient(circle, rgba(160, 80, 255, 0.4) 0%, rgba(120, 50, 200, 0.28) 30%, rgba(90, 20, 160, 0.18) 50%, transparent 75%);
    border-radius: 50%;
    animation: floatOrb2 25s ease-in-out infinite, pulseGlow2 10s ease-in-out infinite;
    pointer-events: none;
    filter: blur(70px);
    box-shadow: 0 0 120px rgba(138, 43, 226, 0.35);
}

[data-theme="light"] .login-container::after {
    background: radial-gradient(circle, rgba(160, 80, 255, 0.4) 0%, rgba(120, 50, 200, 0.28) 30%, rgba(90, 20, 160, 0.18) 50%, transparent 75%);
}

@keyframes floatOrb2 {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    50% {
        transform: translate(120px, -120px) scale(1.2);
    }
}

@keyframes pulseGlow2 {
    0%, 100% {
        opacity: 0.65;
        filter: blur(70px);
    }
    50% {
        opacity: 0.95;
        filter: blur(90px);
    }
}

/* Floating gradient orbs - base style */
.floating-shape {
    position: absolute;
    pointer-events: none;
    opacity: 0.6;
    z-index: 0;
    border-radius: 50%;
    filter: blur(50px);
}

[data-theme="light"] .floating-shape {
    opacity: 0.5;
}

.shape-1 {
    width: 500px;
    height: 500px;
    top: 8%;
    right: 3%;
    background: radial-gradient(circle, rgba(0, 255, 220, 0.35) 0%, rgba(0, 230, 180, 0.22) 30%, rgba(0, 200, 150, 0.12) 50%, transparent 75%);
    animation: floatBlob1 18s ease-in-out infinite, pulsateBlob1 7s ease-in-out infinite;
    box-shadow: 0 0 80px rgba(0, 255, 200, 0.25);
}

[data-theme="light"] .shape-1 {
    background: radial-gradient(circle, rgba(0, 255, 220, 0.35) 0%, rgba(0, 230, 180, 0.22) 30%, rgba(0, 200, 150, 0.12) 50%, transparent 75%);
}

@keyframes floatBlob1 {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(-70px, 90px) scale(1.12);
    }
    66% {
        transform: translate(50px, -50px) scale(0.92);
    }
}

@keyframes pulsateBlob1 {
    0%, 100% {
        opacity: 0.6;
        filter: blur(50px);
    }
    50% {
        opacity: 0.85;
        filter: blur(65px);
    }
}

.shape-2 {
    width: 550px;
    height: 550px;
    bottom: 12%;
    left: 5%;
    background: radial-gradient(circle, rgba(255, 100, 220, 0.32) 0%, rgba(240, 70, 180, 0.2) 30%, rgba(200, 50, 150, 0.12) 50%, transparent 75%);
    animation: floatBlob2 22s ease-in-out infinite, pulsateBlob2 9s ease-in-out infinite;
    box-shadow: 0 0 90px rgba(255, 100, 200, 0.28);
}

[data-theme="light"] .shape-2 {
    background: radial-gradient(circle, rgba(255, 100, 220, 0.32) 0%, rgba(240, 70, 180, 0.2) 30%, rgba(200, 50, 150, 0.12) 50%, transparent 75%);
}

@keyframes floatBlob2 {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    50% {
        transform: translate(80px, -70px) scale(1.15);
    }
}

@keyframes pulsateBlob2 {
    0%, 100% {
        opacity: 0.6;
        filter: blur(50px);
    }
    50% {
        opacity: 0.88;
        filter: blur(68px);
    }
}

.shape-3 {
    width: 480px;
    height: 480px;
    top: 42%;
    left: 50%;
    margin-left: -240px;
    background: radial-gradient(circle, rgba(120, 180, 255, 0.35) 0%, rgba(80, 140, 230, 0.22) 30%, rgba(50, 100, 200, 0.13) 50%, transparent 75%);
    animation: floatBlob3 20s ease-in-out infinite, pulsateBlob3 11s ease-in-out infinite;
    box-shadow: 0 0 85px rgba(100, 150, 255, 0.3);
}

[data-theme="light"] .shape-3 {
    background: radial-gradient(circle, rgba(120, 180, 255, 0.35) 0%, rgba(80, 140, 230, 0.22) 30%, rgba(50, 100, 200, 0.13) 50%, transparent 75%);
}

@keyframes floatBlob3 {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(-60px, 70px) scale(1.1);
    }
    66% {
        transform: translate(55px, -55px) scale(0.94);
    }
}

@keyframes pulsateBlob3 {
    0%, 100% {
        opacity: 0.55;
        filter: blur(50px);
    }
    50% {
        opacity: 0.8;
        filter: blur(70px);
    }
}

.login-box {
    background: var(--bg-card-grey);
    border-radius: 20px;
    padding: 3rem 2.5rem;
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 450px;
    border: 1px solid var(--border-color);
    transition: background 0.3s ease;
    position: relative;
    z-index: 1;
}

.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.login-logo {
    width: 120px;
    height: 120px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-header h1 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.login-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* ============================================
   FORM STYLES
   ============================================ */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-input);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

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

/* Global styling for all select option elements - ensures readability in dark mode */
select option {
    background: var(--bg-card) !important;
    color: var(--text-primary) !important;
}

/* Dark theme specific - force proper contrast in dropdown lists */
[data-theme="dark"] select option {
    background-color: #1a1a1a !important;
    color: #f5f5f5 !important;
}

/* Light theme specific - ensure proper contrast */
[data-theme="light"] select option {
    background-color: #ffffff !important;
    color: #1a1a1a !important;
}

/* Polished input field wrappers (global) */
.field {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 10px 12px;
    box-shadow: var(--shadow-sm);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.field:hover { background: var(--bg-tertiary); }
.field:focus-within {
    border-color: #5B9BD5;
    box-shadow: 0 0 0 3px rgba(91,155,213,0.25);
}
.field-icon { color: var(--text-muted); display: inline-flex; align-items: center; margin-right: 8px; }
.field-icon svg { width: 18px; height: 18px; }
.field-input {
    border: 0;
    background: transparent;
    outline: none;
    width: 100%;
    height: 42px;
    font-size: 1rem;
    color: var(--text-primary);
}
.field-input::placeholder { color: var(--text-muted); }

/* Polished select containers (global) */
.select-wrap {
    background: var(--bg-card);
    border:1px solid var(--border-color);
    border-radius:10px;
    box-shadow: var(--shadow-sm);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.select-wrap:hover { background: var(--bg-tertiary); }
.select-wrap:focus-within { border-color:#5B9BD5; box-shadow: 0 0 0 3px rgba(91,155,213,0.25); }
.pretty-select { width:100%; border:0; background:transparent; outline:none; padding:6px; border-radius:10px; min-height: 180px; color: var(--text-primary); }
.pretty-select option { padding: 8px 10px; border-radius:6px; color: var(--text-primary) !important; background: var(--bg-card) !important; }
.pretty-select option:hover { background: rgba(91,155,213,0.12) !important; }
.pretty-select option:checked { background: rgba(91,155,213,0.2) !important; font-weight: 600; }

/* Dark theme overrides for multi-select dropdowns */
[data-theme="dark"] .pretty-select option {
    background-color: #1a1a1a !important;
    color: #f5f5f5 !important;
}

/* Input with Icon */
.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 1rem;
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    pointer-events: none;
    z-index: 1;
}

.input-with-icon input {
    padding-left: 3rem !important;
}

/* Password Input with Toggle */
.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.password-input-wrapper input {
    padding-right: 3rem;
}

.password-toggle {
    position: absolute;
    right: 0.75rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--text-muted);
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.password-toggle svg {
    width: 20px;
    height: 20px;
}

/* Remember Me Checkbox */
.remember-me-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.remember-me-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--accent-primary);
}

.remember-me-label:hover {
    color: var(--text-primary);
}

/* Form Validation Styles */
input.valid {
    border-color: var(--accent-success) !important;
}

input.invalid {
    border-color: var(--accent-danger) !important;
}

.field-error {
    color: var(--accent-danger);
    font-size: 0.85rem;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.field-error::before {
    content: '⚠';
    font-size: 1rem;
}

/* Password Strength Indicator */
.password-strength {
    margin-top: 0.75rem;
}

.strength-bar {
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.strength-fill {
    height: 100%;
    transition: width 0.3s ease, background-color 0.3s ease;
    border-radius: 2px;
}

.strength-fill.weak {
    background: var(--accent-danger);
}

.strength-fill.medium {
    background: var(--accent-warning);
}

.strength-fill.strong {
    background: var(--accent-success);
}

.strength-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* reCAPTCHA Styling */
.g-recaptcha {
    display: flex;
    justify-content: center;
    margin: 0 auto;
}

/* Audit Dashboard Styles */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    background: var(--bg-tertiary);
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
}

.data-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.data-table tr:hover {
    background: var(--bg-secondary);
}

.table-responsive {
    overflow-x: auto;
}

.action-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.action-login {
    background: var(--accent-success);
    color: white;
}

.action-failed_login {
    background: var(--accent-danger);
    color: white;
}

.action-logout {
    background: var(--accent-info);
    color: white;
}

.action-account_locked {
    background: var(--accent-warning);
    color: white;
}

.stats-grid .stat-card {
    text-align: center;
    padding: 1.5rem;
}

/* Sessions Management Styles */
.sessions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.session-card {
    padding: 1.5rem;
}

.session-card.current-session {
    border: 2px solid var(--accent-success);
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
}

.session-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.session-device {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.device-icon {
    font-size: 2rem;
}

.session-device h3 {
    margin: 0 0 0.25rem 0;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.session-detail {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.session-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
}

.info-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

.info-value {
    font-size: 0.9rem;
    color: var(--text-primary);
    text-align: right;
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

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

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.security-tips ul {
    line-height: 1.8;
}

.security-tips ul li {
    margin-bottom: 0.5rem;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.5;
}

.btn-primary {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
    color: #ffffff;
    border: 1px solid rgba(100, 116, 139, 0.4);
    box-shadow: 0 2px 8px rgba(100, 116, 139, 0.15), 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #475569 0%, #334155 100%);
    box-shadow: 0 4px 12px rgba(100, 116, 139, 0.2), 0 2px 4px rgba(0, 0, 0, 0.12);
    transform: translateY(-1px);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(100, 116, 139, 0.15);
}

.btn-secondary {
    background: #f8f9fa;
    color: #475569;
    border: 1px solid #cbd5e1;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-secondary:hover:not(:disabled) {
    background: #e9ecef;
    border-color: #94a3b8;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.btn-secondary:active:not(:disabled) {
    background: #dee2e6;
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-success { background: var(--gradient-success); color: #ffffff; box-shadow: var(--shadow-md); }
.btn-success:hover { background: var(--gradient-success-hover); transform: translateY(-2px); box-shadow: var(--shadow-lg); }

.btn-danger { background: var(--gradient-danger); color: #ffffff; box-shadow: var(--shadow-md); }
.btn-danger:hover { background: var(--gradient-danger-hover); transform: translateY(-2px); box-shadow: var(--shadow-lg); }

.btn-warning { background: var(--gradient-warning); color: #ffffff; box-shadow: var(--shadow-md); }
.btn-warning:hover { background: var(--gradient-warning-hover); transform: translateY(-2px); box-shadow: var(--shadow-lg); }

.btn-full {
    width: 100%;
}

/* Icon Buttons for Tables */
.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-icon svg {
    width: 16px;
    height: 16px;
    stroke-width: 2;
}

.btn-icon-primary {
    color: #5B9BD5;
    border-color: #5B9BD5;
}

.btn-icon-primary:hover {
    background: #5B9BD5;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(91, 155, 213, 0.3);
}

.btn-icon-success {
    color: #22C55E;
    border-color: #22C55E;
}

.btn-icon-success:hover {
    background: #22C55E;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(34, 197, 94, 0.3);
}

.btn-icon-warning {
    color: #F59E0B;
    border-color: #F59E0B;
}

.btn-icon-warning:hover {
    background: #F59E0B;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(245, 158, 11, 0.3);
}

.btn-icon-danger {
    color: #EF4444;
    border-color: #EF4444;
}

.btn-icon-danger:hover {
    background: #EF4444;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(239, 68, 68, 0.3);
}

/* Button Loading State */
.btn {
    position: relative;
    transition: all 0.3s ease;
}

.btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.btn-spinner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 0.5rem;
}

.btn-spinner svg {
    width: 18px;
    height: 18px;
    animation: spin 1s linear infinite;
}

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

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

.btn-danger { background: var(--gradient-danger); color: #ffffff; box-shadow: var(--shadow-md); }
.btn-danger:hover { background: var(--gradient-danger-hover); transform: translateY(-2px); box-shadow: var(--shadow-lg); }

/* Additional semantic buttons */
.btn-success { background: var(--gradient-success); color: #ffffff; box-shadow: var(--shadow-md); }
.btn-success:hover { background: var(--gradient-success-hover); transform: translateY(-2px); box-shadow: var(--shadow-lg); }

/* ============================================
   MODALS & DIALOGS (GLOBAL)
   ============================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(3px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.modal {
    width: 100%;
    max-width: 640px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    transform: scale(0.98);
    opacity: 0;
}

/* Modal size modifiers */
.modal--sm { max-width: 420px; }
.modal--md { max-width: 640px; }
.modal--lg { max-width: 820px; }
.modal--xlarge { max-width: 1230px; }

.modal-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, #0a1929 0%, #1a2332 50%, #2d3748 100%);
    display: flex;
    align-items: center;
    justify-content: flex-start; /* Left-justify the title */
}

.modal-title {
    font-weight: 700;
    font-size: 1.125rem;
    color: #ffffff;
    margin-right: auto; /* Push close button to the right */
}

.modal-body { padding: 1rem 1.25rem; }
.modal-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

/* Ensure all modal footer buttons have consistent height */
.modal-footer .btn {
    padding: 0.625rem 1.25rem;
    min-height: 38px;
}

.modal-header .btn-icon {
    width: 32px;
    height: 32px;
    border: 1px solid rgba(255,255,255,0.25);
    background: transparent;
    color: #ffffff;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.modal-header .btn-icon:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(0,0,0,0.12);
    background: rgba(255,255,255,0.1);
}

.modal-header .btn-icon:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

/* ============================================
   ALERTS & MESSAGES
   ============================================ */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    border-left: 4px solid;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--accent-success);
    color: var(--accent-success);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--accent-danger);
    color: var(--accent-danger);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: var(--accent-warning);
    color: var(--accent-warning);
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

/* ============================================
   TOASTS (GLOBAL)
   ============================================ */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 11000;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--accent-primary);
    border-radius: 10px;
    box-shadow: var(--shadow-md);
    padding: 0.75rem 1rem;
    min-width: 260px;
    pointer-events: auto;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast .toast-icon { font-weight: 700; }
.toast .toast-title { font-weight: 700; }
.toast .toast-message { color: var(--text-secondary); }

.toast.success { border-left-color: #22C55E; }
.toast.error { border-left-color: #EF4444; }
.toast.info { border-left-color: var(--accent-primary); }

.toast .toast-close {
    margin-left: auto;
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 1rem;
}

.toast.removing { opacity: 0; transform: translateY(-4px); }

/* ============================================
   DASHBOARD LAYOUT
   ============================================ */
.dashboard-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: linear-gradient(180deg, #f8f9fa 0%, #e9ecef 100%);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.08);
    border-right: 1px solid rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .sidebar {
    background: linear-gradient(180deg, #f8f9fa 0%, #e9ecef 100%);
    border-right: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.08);
}

.sidebar-header {
    padding: 2rem 1.5rem 1.5rem 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, rgba(91, 155, 213, 0.08) 0%, rgba(91, 155, 213, 0.03) 100%);
}

[data-theme="light"] .sidebar-header {
    background: linear-gradient(135deg, rgba(91, 155, 213, 0.08) 0%, rgba(91, 155, 213, 0.03) 100%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sidebar-logo-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-logo-text h3 {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0;
    color: #2c3e50;
    line-height: 1;
    letter-spacing: -0.5px;
}

[data-theme="dark"] .sidebar-logo-text h3 {
    color: #ffffff;
}

.sidebar-logo-text p {
    font-size: 0.825rem;
    color: #5a6c7d;
    margin: 0.25rem 0 0 0;
    line-height: 1;
    opacity: 0.9;
}

[data-theme="dark"] .sidebar-logo-text p {
    color: rgba(255, 255, 255, 0.7);
}

.sidebar-nav {
    padding: 0.75rem 0 1.5rem 0;
}

/* Smooth scrollbar for sidebar */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(91, 155, 213, 0.4);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(91, 155, 213, 0.6);
}

/* Navigation Sections */
.nav-section {
    padding: 0 0 0.75rem;
}

.nav-section:first-child {
    padding-top: 0.5rem;
}

.nav-section-header {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: rgba(44, 62, 80, 0.55);
    padding: 1rem 1.5rem 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
    user-select: none;
}

[data-theme="light"] .nav-section-header {
    color: rgba(44, 62, 80, 0.55);
}

.nav-section-header svg {
    opacity: 0.6;
}

.nav-section-divider {
    height: 1px;
    background: rgba(44, 62, 80, 0.12);
    margin: 1rem 1.5rem;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}

[data-theme="light"] .nav-section-divider {
    background: rgba(44, 62, 80, 0.12);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}

.nav-item {
    padding: 0.8rem 1.5rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.85rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border-left: 3px solid transparent;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    position: relative;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: linear-gradient(90deg, rgba(91, 155, 213, 0.15) 0%, transparent 100%);
    transition: width 0.25s ease;
    pointer-events: none;
}

.nav-item:hover {
    background: rgba(91, 155, 213, 0.08);
    color: var(--text-primary);
    border-left-color: rgba(91, 155, 213, 0.4);
    transform: translateX(2px);
}

.nav-item:hover::before {
    width: 100%;
}

[data-theme="light"] .nav-item:hover {
    background: rgba(91, 155, 213, 0.06);
}

.nav-item.active {
    background: rgba(91, 155, 213, 0.18);
    color: var(--accent-primary);
    border-left: 3px solid var(--accent-primary);
    font-weight: 600;
    box-shadow: inset 0 0 16px rgba(91, 155, 213, 0.12);
}

.nav-item.active::before {
    width: 100%;
    background: linear-gradient(90deg, rgba(91, 155, 213, 0.2) 0%, transparent 100%);
}

[data-theme="dark"] .nav-item.active {
    background: rgba(91, 155, 213, 0.22);
    color: #ffffff;
}

[data-theme="light"] .nav-item.active {
    background: rgba(91, 155, 213, 0.14);
    color: #2563eb;
}

.nav-item-icon {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.25s ease;
}

.nav-item:hover .nav-item-icon {
    transform: scale(1.1);
}

.nav-item.active .nav-item-icon {
    transform: scale(1.05);
}

.nav-item-icon svg {
    width: 20px;
    height: 20px;
    display: block;
    transition: stroke-width 0.2s ease;
}

.nav-item.active .nav-item-icon svg {
    stroke-width: 2.5;
}

/* Submenu Styles */
.nav-item-submenu {
    position: relative;
}

.nav-item-with-submenu {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.submenu-arrow {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-left: auto;
    opacity: 0.7;
}

.submenu-arrow svg {
    width: 16px;
    height: 16px;
}

.nav-item-with-submenu:hover .submenu-arrow {
    opacity: 1;
}

.nav-item-with-submenu.submenu-open .submenu-arrow {
    transform: rotate(180deg);
    opacity: 1;
}

.nav-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
    background: rgba(0, 0, 0, 0.25);
    opacity: 0;
    border-left: 2px solid rgba(91, 155, 213, 0.2);
    margin-left: 1.5rem;
}

[data-theme="light"] .nav-submenu {
    background: rgba(0, 0, 0, 0.02);
    border-left-color: rgba(91, 155, 213, 0.15);
}

.nav-submenu.open {
    max-height: 800px;
    opacity: 1;
}

.nav-submenu-item {
    padding: 0.7rem 1.5rem 0.7rem 2.5rem;
    color: var(--text-secondary);
    display: block;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.875rem;
    border-left: 3px solid transparent;
    text-decoration: none;
    position: relative;
    font-weight: 450;
}

.nav-submenu-item::before {
    content: '•';
    position: absolute;
    left: 1.5rem;
    color: rgba(91, 155, 213, 0.4);
    font-size: 1.2rem;
    line-height: 1;
    transition: all 0.2s ease;
}

.nav-submenu-item:hover {
    background: rgba(91, 155, 213, 0.1);
    color: var(--text-primary);
    border-left-color: rgba(91, 155, 213, 0.5);
    padding-left: 2.7rem;
}

.nav-submenu-item:hover::before {
    color: var(--accent-primary);
    transform: scale(1.3);
}

.nav-submenu-item.active {
    background: rgba(91, 155, 213, 0.15);
    color: var(--accent-primary);
    border-left-color: var(--accent-primary);
    font-weight: 600;
}

.nav-submenu-item.active::before {
    content: '▸';
    color: var(--accent-primary);
    transform: scale(1.2);
}

[data-theme="light"] .nav-submenu-item.active {
    background: rgba(91, 155, 213, 0.12);
    color: #2563eb;
}

/* Submenu Groups (for organizing submenu items) */
.nav-submenu-group {
    margin: 0.75rem 0;
    padding: 0.5rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .nav-submenu-group {
    border-color: rgba(0, 0, 0, 0.06);
    background: rgba(91, 155, 213, 0.03);
}

.nav-submenu-group-title {
    padding: 0.5rem 1.5rem 0.5rem 2.5rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    opacity: 0.75;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    user-select: none;
}

.nav-submenu-group-title::before {
    content: '';
    width: 3px;
    height: 3px;
    background: rgba(91, 155, 213, 0.5);
    border-radius: 50%;
}

.nav-submenu-group .nav-submenu-item {
    padding-left: 3rem;
}

.nav-submenu-group .nav-submenu-item::before {
    left: 2rem;
}

.main-content {
    flex: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-content > main {
    flex: 1;
}

.content {
    flex: 1;
}

/* ============================================
   HEADER
   ============================================ */
.header {
    background: linear-gradient(90deg, #f8f9fa 0%, #e9ecef 50%, #f8f9fa 100%);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .header {
    background: linear-gradient(90deg, #f8f9fa 0%, #e9ecef 50%, #f8f9fa 100%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.header-title h1 {
    margin: 0;
    font-size: 1.5rem;
}

.header-company-logo,
.header-draco-logo {
    display: flex;
    align-items: center;
    border: 1px solid;
    /* Styling now comes from database for company logo */
    /* Default Draco logo styling below */
}

.header-company-logo {
    margin-left: -30px;
}

.header-draco-logo {
    background: linear-gradient(135deg, rgba(91, 155, 213, 0.15) 0%, rgba(74, 127, 184, 0.05) 100%);
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    border-color: rgba(91, 155, 213, 0.2);
}

/* Theme-aware Draco logo display */
[data-theme="dark"] .draco-logo-dark {
    display: block !important;
}

[data-theme="dark"] .draco-logo-light {
    display: none !important;
}

[data-theme="light"] .draco-logo-dark {
    display: none !important;
}

[data-theme="light"] .draco-logo-light {
    display: block !important;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.user-info {
    text-align: left;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.user-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    display: block;
    line-height: 1.4;
}

.user-role {
    font-size: 0.8125rem;
    color: var(--text-muted);
    display: block;
    line-height: 1.4;
}

.user-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: white;
}

/* ============================================
   CONTENT AREA
   ============================================ */
.content {
    padding: 2rem;
}

.content-header {
    margin-bottom: 2rem;
}

.content-header h2 {
    margin-bottom: 0.5rem;
}

.breadcrumb {
    display: flex;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ============================================
   CARDS & STATS
   ============================================ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 1.5rem;
}

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

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-icon svg {
    width: 24px;
    height: 24px;
    display: block;
}

.stat-icon.primary {
    background: rgba(91, 155, 213, 0.15);
    color: var(--accent-primary);
}

.stat-icon.success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-success);
}

.stat-icon.warning {
    background: rgba(107, 143, 163, 0.15);
    color: var(--accent-warning);
}

.stat-icon.danger {
    background: rgba(139, 0, 0, 0.15);
    color: var(--accent-danger);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ============================================
   TABLES
   ============================================ */
.table-container {
    overflow-x: auto;
}

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

thead {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
}

thead * {
    color: white;
}

thead svg,
thead i,
thead .icon {
    color: white;
    fill: white;
}

thead small,
thead .subtext,
thead .muted {
    color: rgba(255, 255, 255, 0.75);
}

th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: white;
    border-bottom: 2px solid rgba(44, 62, 80, 0.5);
    text-transform: uppercase;
    font-size: 0.8125rem;
    letter-spacing: 0.05em;
}

th svg,
th i,
th .icon {
    color: white;
    fill: white;
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}

tbody tr:hover {
    background: var(--bg-tertiary);
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    background: linear-gradient(90deg, #f8f9fa 0%, #e9ecef 50%, #f8f9fa 100%);
    padding: 1rem 2rem;
    text-align: center;
    color: var(--text-secondary);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    margin-left: -130px;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .footer {
    background: linear-gradient(90deg, #f8f9fa 0%, #e9ecef 50%, #f8f9fa 100%);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
}

/* Theme-aware footer logo display */
.footer-logo {
    display: none;
}

[data-theme="dark"] .footer-logo.draco-logo-dark {
    display: block;
}

[data-theme="light"] .footer-logo.draco-logo-light {
    display: block;
}

/* ============================================
   THEME TOGGLE BUTTON
   ============================================ */
.theme-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    padding: 0;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    background: var(--bg-card);
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.theme-toggle-icon {
    font-size: 1.25rem;
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle-icon svg {
    width: 20px;
    height: 20px;
    display: block;
}

.theme-toggle:hover .theme-toggle-icon {
    transform: rotate(20deg);
}

.theme-toggle-text {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    z-index: 1000;
}

/* Tooltip arrow */
.theme-toggle-text::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-bottom-color: var(--bg-tertiary);
}

.theme-toggle:hover .theme-toggle-text {
    opacity: 1;
    transform: translateX(-50%) translateY(12px);
}

/* Small Theme Toggle (for login page) */
.theme-toggle-small {
    width: 40px;
    height: 40px;
    opacity: 0.7;
}

.theme-toggle-small:hover {
    opacity: 1;
}

.theme-toggle-small .theme-toggle-icon {
    font-size: 1.1rem;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.stat-card-link:hover {
    text-decoration: none;
}

/* ============================================
   VIEW TOGGLE (Grid/Table Switch)
   ============================================ */

/* Container for view toggle */
.view-toggle-container {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1.5rem;
}

/* View toggle component - modern pill design */
.view-toggle {
    display: inline-flex;
    gap: 0;
    background: var(--bg-card);
    padding: 0.375rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.02);
    position: relative;
    overflow: hidden;
}

/* View toggle button */
.view-toggle-btn {
    padding: 0.625rem 1.25rem;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 0.625rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 600;
    position: relative;
    z-index: 1;
    white-space: nowrap;
}

/* View toggle button icon */
.view-toggle-btn svg {
    width: 18px;
    height: 18px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Active state - beautiful gradient */
.view-toggle-btn.active {
    background: linear-gradient(135deg, #5b9bd5 0%, #4a7fb8 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(91, 155, 213, 0.3), 
                0 2px 4px rgba(91, 155, 213, 0.2),
                inset 0 -2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

/* Active state icon */
.view-toggle-btn.active svg {
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

/* Hover state for inactive buttons */
.view-toggle-btn:hover:not(.active) {
    background: linear-gradient(135deg, rgba(91, 155, 213, 0.12) 0%, rgba(91, 155, 213, 0.08) 100%);
    color: #5b9bd5;
    transform: translateY(-0.5px);
}

/* Focus state for accessibility */
.view-toggle-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(91, 155, 213, 0.2);
}

.view-toggle-btn.active:focus {
    box-shadow: 0 4px 12px rgba(91, 155, 213, 0.3), 
                0 2px 4px rgba(91, 155, 213, 0.2),
                inset 0 -2px 8px rgba(0, 0, 0, 0.1),
                0 0 0 3px rgba(91, 155, 213, 0.25);
}

/* Active indicator animation */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.view-toggle-btn.active {
    animation: slideIn 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Responsive - Icon only on smaller screens */
@media (max-width: 640px) {
    .view-toggle-btn {
        padding: 0.625rem 0.75rem;
        gap: 0;
    }
    
    .view-toggle-btn span:not(.view-toggle-icon) {
        display: none;
    }
    
    .view-toggle-btn svg {
        width: 20px;
        height: 20px;
    }
}

/* Dark theme adjustments */
[data-theme="dark"] .view-toggle {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .view-toggle-btn:hover:not(.active) {
    background: linear-gradient(135deg, rgba(91, 155, 213, 0.15) 0%, rgba(91, 155, 213, 0.1) 100%);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: static;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   CUSTOM DIALOGS (DRACO BRANDED)
   ============================================ */

.draco-dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.draco-dialog-overlay.show {
    opacity: 1;
}

.draco-dialog {
    background: var(--bg-secondary);
    border-radius: 12px;
    box-shadow: var(--shadow-xl);
    min-width: 400px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

/* Dialog Size Variants */
.draco-dialog-small {
    max-width: 400px;
}

.draco-dialog-large {
    max-width: 900px;
}

.draco-dialog-xlarge {
    max-width: 1200px;
    width: 95%;
}

.draco-dialog-overlay.show .draco-dialog {
    transform: scale(1);
}

.draco-dialog-header {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%) !important;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    position: relative;
    flex-shrink: 0;
    border-radius: 12px 12px 0 0;
    min-height: 56px;
}

/* Title in header (for modal dialogs with close button) */
.draco-dialog-header .draco-dialog-title {
    color: #ffffff !important;
    margin: 0;
    padding: 0;
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.2;
}

.draco-dialog-header .btn-icon {
    width: 32px;
    height: 32px;
    border: 1px solid rgba(255,255,255,0.25);
    background: transparent;
    color: #ffffff;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.draco-dialog-header .btn-icon:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(0,0,0,0.12);
    background: rgba(255,255,255,0.1);
}

.draco-dialog-header .btn-icon:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.draco-dialog-logo {
    width: 60px;
    height: 60px;
    margin: 0 auto 1rem;
    display: block;
}

.draco-dialog-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.draco-dialog-icon svg {
    width: 40px;
    height: 40px;
}

.draco-dialog-icon.info {
    background: rgba(91, 155, 213, 0.15);
    color: var(--accent-primary);
}

.draco-dialog-icon.warning {
    background: rgba(107, 143, 163, 0.15);
    color: var(--accent-warning);
}

.draco-dialog-icon.danger {
    background: rgba(139, 0, 0, 0.15);
    color: var(--accent-danger);
}

.draco-dialog-icon.success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-success);
}

.draco-dialog-body {
    padding: 1.5rem 2rem;
    text-align: center;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

/* Title in body (for alert/confirm dialogs) */
.draco-dialog-body .draco-dialog-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 1rem;
    color: var(--text-primary) !important;
}

.draco-dialog-message {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

.draco-dialog-footer {
    padding: 1.5rem 2rem;
    background: var(--bg-tertiary);
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 0 0 12px 12px;
}

.draco-dialog-footer .btn {
    min-width: 120px;
}

/* Loading Dialog */
.draco-dialog-loading {
    padding: 3rem;
    text-align: center;
}

.draco-loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--bg-tertiary);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

/* ============================================
   TABS COMPONENT
   ============================================ */

.tabs-container {
    background: var(--bg-secondary);
    border-radius: 12px;
    overflow: hidden;
}

.tabs-header {
    display: flex;
    align-items: flex-end;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
    padding-top: 0.5rem;
}

.tab-button {
    padding: 1rem 2rem;
    background: transparent;
    border: 1px solid transparent;
    border-bottom: 3px solid transparent;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 60px;
    margin: 0 2px;
}

.tab-button:hover {
    color: var(--text-secondary);
    background: rgba(91, 155, 213, 0.05);
    border-color: var(--border-color);
    border-bottom-color: transparent;
}

.tab-button.active {
    color: var(--accent-primary);
    border-color: var(--border-color);
    border-bottom-color: var(--accent-primary);
    background: var(--bg-primary);
}

.tab-button svg {
    width: 20px;
    height: 20px;
}

.tab-content {
    display: none;
    padding: 2rem;
}

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

/* ============================================
   PROGRESS BAR
   ============================================ */

.progress-bar-container {
    background: var(--bg-tertiary);
    border-radius: 8px;
    height: 30px;
    overflow: hidden;
    position: relative;
    margin: 1rem 0;
}

.progress-bar {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    height: 100%;
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
}

/* ============================================
   BADGES
   ============================================ */

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge.primary {
    background: rgba(91, 155, 213, 0.15);
    color: var(--accent-primary);
}

.badge.secondary {
    background: rgba(107, 143, 163, 0.15);
    color: var(--text-secondary);
}

.badge.success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-success);
}

.badge.warning {
    background: #b8885f;
    color: #1a1a1a;
    font-weight: 700;
}

.badge.danger {
    background: #a14854;
    color: white;
    font-weight: 700;
}

/* ============================================
   TABLE IMPROVEMENTS
   ============================================ */

.table tbody tr:hover {
    background: var(--bg-tertiary);
}

.table-container {
    overflow-x: auto;
    border-radius: 8px;
}

.btn-sm {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
}

/* Dark headers for tables */
.employee-table th,
.table thead th {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: #ffffff;
    font-weight: 600;
}

/* ============================================
   USER PROFILE DROPDOWN
   ============================================ */

.user-profile-dropdown {
    position: relative;
}

.user-profile-trigger {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

.user-profile-trigger:hover {
    background-color: var(--bg-hover);
}

.dropdown-chevron {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.user-profile-dropdown.active .dropdown-chevron {
    transform: rotate(180deg);
}

.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    min-width: 320px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
    overflow: hidden;
}

.user-profile-dropdown.active .user-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--bg-secondary);
}

.user-avatar-large {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), #4a7fb8);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    font-weight: 600;
    flex-shrink: 0;
}

.user-dropdown-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.user-dropdown-email {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.user-dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.5rem 0;
}

.user-dropdown-section {
    padding: 0.5rem 0;
}

.user-dropdown-section-title {
    padding: 0.5rem 1.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: background-color 0.2s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-size: 0.9375rem;
}

.user-dropdown-item:hover {
    background-color: var(--bg-hover);
}

.user-dropdown-item svg {
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.user-dropdown-item-danger {
    color: #a14854;
    font-weight: 600;
}

[data-theme="dark"] .user-dropdown-item-danger {
    color: #fca5a5;
}

.user-dropdown-item-danger svg {
    color: #a14854;
}

[data-theme="dark"] .user-dropdown-item-danger svg {
    color: #fca5a5;
}

.user-dropdown-item-danger:hover {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(220, 38, 38, 0.15));
    color: #a14854;
    border-left: 3px solid #a14854;
    padding-left: calc(1.25rem - 3px);
}

[data-theme="dark"] .user-dropdown-item-danger:hover {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.25), rgba(220, 38, 38, 0.25));
    color: #fca5a5;
    border-left-color: #fca5a5;
}

/* Theme icons in dropdown */
.theme-icon-light,
.theme-icon-dark {
    display: none;
}

[data-theme="light"] .theme-icon-light {
    display: block;
}

[data-theme="dark"] .theme-icon-dark {
    display: block;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .user-dropdown-menu {
        min-width: 280px;
        right: -0.5rem;
    }
    
    .user-info {
        display: none;
    }
}

/* Logout Button Styling */
.logout-button {
    background: rgba(239, 68, 68, 0.15) !important;
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: 8px;
    color: #a14854 !important;
    transition: all 0.2s ease;
    position: relative;
    margin-right: 8px;
    width: calc(100% - 8px);
}

/* Dark mode specific */
[data-theme="dark"] .logout-button {
    background: rgba(239, 68, 68, 0.2) !important;
    border-color: rgba(239, 68, 68, 0.5);
    color: #fca5a5 !important;
}

.logout-button:hover {
    background: linear-gradient(135deg, #a14854, #8b3d47) !important;
    color: white !important;
    border-color: #a14854;
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

[data-theme="dark"] .logout-button:hover {
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.4);
}

.logout-button .nav-item-icon {
    color: inherit;
}

/* ============================================
   SORTABLE TABLES
   ============================================ */

table[data-sortable] thead th.sortable {
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
}

table[data-sortable] thead th.sortable:hover {
    background: rgba(91, 155, 213, 0.15);
    color: #ffffff;
}

table[data-sortable] thead th.sortable:active {
    opacity: 0.8;
}

.sort-indicator {
    display: inline-block;
    margin-left: 0.25rem;
    vertical-align: middle;
    transition: all 0.2s ease;
}

.sort-indicator svg {
    transition: transform 0.2s ease;
}

/* ============================================
   ENHANCED DESIGN SYSTEM v0.14.0
   Modern UI Enhancements & Animations
   ============================================ */

/* ===== TAB SYSTEM WITH FILE-TAB STYLE ===== */

.tabs-container {
    margin-bottom: 0;
}

.tabs {
    display: flex;
    gap: 0.25rem;
    margin-bottom: -1px;
    position: relative;
    z-index: 1;
}

.tab {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    color: var(--text-secondary);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    position: relative;
}

.tab:hover:not(.active) {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.tab.active {
    background: var(--bg-card);
    color: var(--accent-primary);
    border-color: var(--border-color);
    border-bottom: 1px solid var(--bg-card);
    z-index: 2;
    box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.05);
}

/* Accent bar at top of active tab */
.tab.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-primary) 0%, #4a8ac4 100%);
    border-radius: 8px 8px 0 0;
}

.tab svg {
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.tab:hover svg {
    transform: scale(1.1);
}

.tab.active svg {
    transform: scale(1.05);
}

/* ===== TAB CONTENT WITH ANIMATIONS ===== */

.tab-content {
    display: none;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.tab-content.active {
    display: block;
    animation: fadeInUp 0.3s ease forwards;
}

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

/* ===== ENHANCED SECTIONS ===== */

.tab-content .settings-section,
.content-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid transparent;
    border-image: linear-gradient(90deg, var(--border-color) 0%, transparent 100%) 1;
}

.tab-content .settings-section:last-child,
.content-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

/* Enhanced section headers */
.tab-content .settings-section h3,
.content-section h3 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 1.5rem 0;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid transparent;
    border-image: linear-gradient(90deg, var(--accent-primary) 0%, transparent 50%) 1;
}

.tab-content .settings-section h3 svg,
.content-section h3 svg {
    width: 24px;
    height: 24px;
    padding: 6px;
    background: linear-gradient(135deg, rgba(91, 155, 213, 0.15) 0%, rgba(74, 127, 184, 0.05) 100%);
    border-radius: 8px;
    color: var(--accent-primary);
    transition: all 0.2s ease;
}

.tab-content .settings-section h3:hover svg,
.content-section h3:hover svg {
    transform: rotate(-5deg) scale(1.05);
    background: linear-gradient(135deg, rgba(91, 155, 213, 0.25) 0%, rgba(74, 127, 184, 0.15) 100%);
}

/* ===== ENHANCED FORM ELEMENTS ===== */

.tab-content .form-control,
.enhanced-form .form-control {
    transition: all 0.2s ease;
}

.tab-content .form-control:focus,
.enhanced-form .form-control:focus {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(91, 155, 213, 0.15);
    border-color: var(--accent-primary);
}

.tab-content .form-control:hover:not(:focus),
.enhanced-form .form-control:hover:not(:focus) {
    border-color: rgba(91, 155, 213, 0.4);
}

/* Form labels with better visual hierarchy */
.tab-content label,
.enhanced-form label {
    font-weight: 600;
    color: var(--text-primary);
    transition: color 0.2s ease;
}

.tab-content .form-group:focus-within label,
.enhanced-form .form-group:focus-within label {
    color: var(--accent-primary);
}

/* ===== ENHANCED CARDS ===== */

.enhanced-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.enhanced-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--accent-primary) 0%, #4a8ac4 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.enhanced-card:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 4px 16px rgba(91, 155, 213, 0.2);
    transform: translateY(-2px);
}

.enhanced-card:hover::before {
    opacity: 1;
}

/* ===== ENHANCED BUTTONS ===== */

.btn-enhanced {
    transition: all 0.2s ease;
}

.btn-enhanced:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(91, 155, 213, 0.4);
}

.btn-enhanced:active {
    transform: translateY(-1px);
}

/* ===== STATUS BADGES WITH PULSE ===== */

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
}

.status-badge.active,
.status-badge.success {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.15) 0%, rgba(34, 197, 94, 0.05) 100%);
    color: #6b8e7f;
    border: 1px solid #6b8e7f;
    animation: pulse 2s ease-in-out infinite;
}

.status-badge.inactive,
.status-badge.neutral {
    background: linear-gradient(135deg, rgba(148, 163, 184, 0.15) 0%, rgba(148, 163, 184, 0.05) 100%);
    color: #94a3b8;
    border: 1px solid #94a3b8;
}

.status-badge.warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(245, 158, 11, 0.05) 100%);
    color: #b8885f;
    border: 1px solid #b8885f;
}

.status-badge.danger {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(239, 68, 68, 0.05) 100%);
    color: #a14854;
    border: 1px solid #a14854;
}

.status-badge.badge-blue {
    background: linear-gradient(135deg, rgba(91, 155, 213, 0.15) 0%, rgba(91, 155, 213, 0.05) 100%);
    color: #5b9bd5;
    border: 1px solid #5b9bd5;
}

.status-badge.badge-success {
    background: linear-gradient(135deg, rgba(22, 160, 133, 0.15) 0%, rgba(22, 160, 133, 0.05) 100%);
    color: #16a085;
    border: 1px solid #16a085;
}

.status-badge.badge-danger {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(239, 68, 68, 0.05) 100%);
    color: #a14854;
    border: 1px solid #a14854;
}

.status-badge.badge-secondary {
    background: linear-gradient(135deg, rgba(148, 163, 184, 0.15) 0%, rgba(148, 163, 184, 0.05) 100%);
    color: #94a3b8;
    border: 1px solid #94a3b8;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(34, 197, 94, 0);
    }
}

/* ===== DETAIL SECTIONS WITH ACCENT ===== */

.detail-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    border-left: 3px solid var(--accent-primary);
    transition: all 0.2s ease;
}

.enhanced-card:hover .detail-section {
    background: var(--bg-card);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* ===== STANDARDIZED STATS CARDS ===== */
/* Universal stats card component with icon left, value right, label below */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    border-radius: 12px !important;
    padding: 0.625rem 0.875rem !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: var(--shadow-sm) !important;
    transition: all 0.3s ease !important;
    display: flex !important;
    flex-direction: column !important;
    background: var(--bg-card) !important;
    position: relative !important;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Header with icon in top left, value centered */
.stat-card .stat-header {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    margin-bottom: 0.375rem !important;
    flex-direction: column !important;
    min-height: 2.5rem !important;
    padding-top: 0.5rem !important;
}

/* Icon styling - positioned in top left corner */
.stat-card .stat-icon {
    position: absolute !important;
    top: 0.625rem !important;
    left: 0.875rem !important;
    width: 28px !important;
    height: 28px !important;
    border-radius: 6px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
}

.stat-card .stat-icon svg {
    width: 16px !important;
    height: 16px !important;
}

/* Value styling */
.stat-card .stat-value {
    font-size: 1.375rem !important;
    font-weight: 700 !important;
    color: var(--text-primary) !important;
    line-height: 1 !important;
}

/* Label styling */
.stat-card .stat-label {
    font-size: 0.8125rem !important;
    color: var(--text-secondary) !important;
    font-weight: 500 !important;
    text-align: center !important;
}

/* Color variants for stat cards */
.stat-card.blue {
    background: linear-gradient(135deg, rgba(91, 155, 213, 0.08) 0%, rgba(74, 127, 184, 0.03) 100%) !important;
    border-color: rgba(91, 155, 213, 0.2) !important;
}

.stat-card.blue .stat-icon {
    background: linear-gradient(135deg, rgba(91, 155, 213, 0.15) 0%, rgba(74, 127, 184, 0.08) 100%) !important;
    color: #5b9bd5 !important;
}

.stat-card.blue .stat-icon svg {
    stroke: #5b9bd5 !important;
}

.stat-card.green {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.08) 0%, rgba(22, 163, 74, 0.03) 100%) !important;
    border-color: rgba(34, 197, 94, 0.2) !important;
}

.stat-card.green .stat-icon {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.15) 0%, rgba(22, 163, 74, 0.08) 100%) !important;
    color: #16a34a !important;
}

.stat-card.green .stat-icon svg {
    stroke: #16a34a !important;
}

.stat-card.purple {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.08) 0%, rgba(147, 51, 234, 0.03) 100%) !important;
    border-color: rgba(168, 85, 247, 0.2) !important;
}

.stat-card.purple .stat-icon {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.15) 0%, rgba(147, 51, 234, 0.08) 100%) !important;
    color: #a855f7 !important;
}

.stat-card.purple .stat-icon svg {
    stroke: #a855f7 !important;
}

.stat-card.amber {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, rgba(217, 119, 6, 0.03) 100%) !important;
    border-color: rgba(245, 158, 11, 0.2) !important;
}

.stat-card.amber .stat-icon {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(217, 119, 6, 0.08) 100%) !important;
    color: #b8885f !important;
}

.stat-card.amber .stat-icon svg {
    stroke: #b8885f !important;
}

.stat-card.red {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.08) 0%, rgba(220, 38, 38, 0.03) 100%) !important;
    border-color: rgba(239, 68, 68, 0.2) !important;
}

.stat-card.red .stat-icon {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(220, 38, 38, 0.08) 100%) !important;
    color: #a14854 !important;
}

.stat-card.red .stat-icon svg {
    stroke: #a14854 !important;
}

/* Clickable stat cards */
.stat-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    cursor: pointer;
}

.stat-card-link:hover {
    text-decoration: none;
}

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

@media (max-width: 768px) {
    .tabs {
        flex-direction: column;
        gap: 0;
        margin-bottom: 0;
    }
    
    .tab {
        justify-content: flex-start;
        border-radius: 8px;
        border-bottom: 1px solid var(--border-color);
    }
    
    .tab.active {
        border-bottom: 1px solid var(--border-color);
    }
    
    .tab-content {
        border-radius: 12px;
        margin-top: 0.5rem;
    }
}
