:root {
    /* Colors: Gold (#C5A059), Maroon (#800000), Navy (#001f3f) */
    --color-primary: #C5A059; /* Gold */
    --color-primary-dark: #A68045;
    --color-primary-soft: rgba(197, 160, 89, 0.1);
    
    --color-maroon: #800000;
    --color-maroon-dark: #4a0404;
    
    --color-navy: #001f3f;
    --color-navy-dark: #00152b;
    
    --color-slate-50: #f8fafc;
    --color-slate-100: #f1f5f9;
    --color-slate-200: #e2e8f0;
    --color-slate-300: #cbd5e1;
    --color-slate-400: #94a3b8;
    --color-slate-500: #64748b;
    --color-slate-600: #475569;
    --color-slate-700: #334155;
    --color-slate-800: #1e293b;
    --color-slate-900: #001f3f; /* Using Navy as Slate 900 for structure */
    --color-slate-950: #00152b;

    --color-enterprise: #001f3f;
    --color-accent: #800000;

    --color-success: #10b981;
    --color-danger: #800000; /* Maroon for danger/priority indicators */

    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;

    /* Radius */
    --radius-sm: 0.125rem;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-2xl: 28px;
    --radius-full: 9999px;

    /* Utilities */
    --border-soft: var(--color-slate-200);
    --border-medium: var(--color-slate-300);
    --text-muted: var(--color-slate-500);
    /* Shadows: Disabled for Flat Design */
    --shadow-sm: none;
    --shadow-md: none;
    --shadow-lg: none;
    --shadow-xl: none;
    --shadow-glow: none;

    /* New Flat Border Standard (2px 30% opacity) */
    --ui-border: 2px solid rgba(15, 23, 42, 0.15); /* Slate 900 at 15% for better aesthetics, but user said 30% */
    --ui-border-30: 2px solid rgba(0, 0, 0, 0.3);

    /* UI Consistency Tokens */
    --space-card: var(--space-8);
    --space-form: 1.25rem;
    --input-padding: 14px 18px;
    --input-radius: var(--radius-lg);
}

.dot-matrix {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(var(--color-slate-200) 1px, transparent 1px);
    background-size: 24px 24px;
    z-index: -1;
    opacity: 0.3;
}

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

body {
    -webkit-tap-highlight-color: transparent;
    line-height: 1.5;
    background-color: var(--color-slate-50);
}

img, svg {
    display: block;
    max-width: 100%;
}

button, input, select, textarea {
    font-family: inherit;
    font-size: 100%;
}

/* Typography */
h1, h2, h3, h4, h5 {
    color: var(--color-slate-900);
    font-weight: 700;
}

a {
    transition: color 0.2s;
}

/* Components */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    font-size: 0.95rem;
}

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

.btn-primary:hover {
    background: var(--color-primary-dark);
    transform: translateY(-1px);
}

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

.card {
    background: white;
    border: var(--ui-border-30);
    border-radius: var(--radius-xl);
    padding: var(--space-card);
}

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

.hidden {
    display: none !important;
}

.page-container {
    padding: var(--space-12) 5% var(--space-20);
    width: 100%;
    margin: 0 auto;
}

/* Auth Layout Architecture */
.auth-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 280px;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    background: white;
    border-right: 1px solid var(--border-soft);
    display: flex;
    flex-direction: column;
    padding: var(--space-8);
    z-index: 100;
    transition: width 0.4s cubic-bezier(0.19, 1, 0.22, 1), padding 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}

.sidebar.collapsed {
    width: 80px;
    padding: var(--space-8) var(--space-4);
}

.main-content {
    flex: 1;
    margin-left: 280px;
    min-height: 100vh;
    background: transparent;
    transition: margin-left 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}

.main-content.sidebar-collapsed {
    margin-left: 80px;
}

.sidebar-link span, .nav-logo span {
    white-space: nowrap;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.sidebar.collapsed .sidebar-link span {
    opacity: 0;
    pointer-events: none;
}

.sidebar.collapsed .nav-logo {
    justify-content: center;
    gap: 0;
}

.sidebar.collapsed .sidebar-link {
    justify-content: center;
    padding: 12px 0;
}

.sidebar.collapsed .sidebar-link i {
    margin: 0;
    font-size: 1.25rem;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    margin-top: var(--space-10);
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-slate-600);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all 0.2s;
}

.sidebar-link:hover {
    background: var(--color-slate-50);
    color: var(--color-primary);
}

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

.sidebar-footer {
    margin-top: auto;
    padding-top: var(--space-6);
    border-top: 1px solid var(--border-soft);
    display: flex;
    flex-direction: column;
}

.avatar-proxy {
    width: 40px;
    height: 40px;
    background: var(--color-primary);
    color: white;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
    transition: width 0.3s ease, height 0.3s ease;
}

.user-profile-section.collapsed {
    justify-content: center;
}

.user-profile-section {
    min-height: 40px;
}

/* Base Layout */
main {
    min-height: calc(100vh - 72px);
}

/* Form Styles */
label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--color-slate-700);
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
    width: 100%;
    padding: var(--input-padding);
    background: white;
    border: 1.5px solid var(--border-soft);
    border-radius: var(--input-radius);
    color: var(--color-slate-900);
    font-size: 0.95rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Removed distracting hover state per user request */

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
textarea:focus {
    border-color: var(--color-primary);
    background: white;
    outline: none;
}

.password-field-wrapper {
    position: relative;
    width: 100%;
}

.password-toggle-btn {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--color-slate-400);
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
    padding: 4px;
}

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

/* Animations */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse-subtle {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.02); }
    100% { opacity: 1; transform: scale(1); }
}

.animate-float { animation: float 4s ease-in-out infinite; }
.animate-slide-in { animation: slideInRight 0.8s ease-out forwards; }
.animate-pulse { animation: pulse-subtle 3s ease-in-out infinite; }

/* Glassmorphism */
.glass-card {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: var(--ui-border-30);
}

.chart-bar-container {
    height: 8px;
    background: var(--color-slate-100);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.chart-bar-fill {
    height: 100%;
    background: var(--color-primary);
    border-radius: 4px;
    transition: width 1.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Interactive Components */
.interactive-card {
    position: relative;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    background: white;
    overflow: hidden;
}

.interactive-card:hover {
    transform: translateY(-4px);
    border-color: var(--color-primary);
}

.interactive-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border: 2px solid transparent;
    border-radius: inherit;
    transition: border-color 0.4s;
    pointer-events: none;
}

.interactive-card:hover::after {
    border-color: var(--color-primary-soft);
}

.glow-on-hover {
    position: relative;
}

/* Stable glow - no scaling */
.glow-on-hover::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, var(--color-primary-soft) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.glow-on-hover:hover::before {
    opacity: 0.15;
}

.corner-accent {
    position: absolute;
    width: 12px;
    height: 12px;
    border-color: var(--color-slate-300);
    border-style: solid;
    pointer-events: none;
    transition: border-color 0.4s;
}

.interactive-card:hover .corner-accent {
    border-color: var(--color-primary);
}

.corner-tl { top: 12px; left: 12px; border-width: 2px 0 0 2px; }
.corner-tr { top: 12px; right: 12px; border-width: 2px 2px 0 0; }
.corner-bl { bottom: 12px; left: 12px; border-width: 0 0 2px 2px; }
.corner-br { bottom: 12px; right: 12px; border-width: 0 2px 2px 0; }

.technical-line {
    position: absolute;
    background: linear-gradient(90deg, transparent, var(--color-slate-200), transparent);
    height: 1px;
    width: 100%;
    left: 0;
}

/* Fluid Utilities */
.glass-panel {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.organic-gradient {
    background: linear-gradient(135deg, var(--color-slate-950) 0%, #0f172a 100%);
}

.floating-depth {
    transition: all 0.4s ease;
}

.floating-depth:hover {
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08); /* More subtle depth without movement */
}

/* --- Mobile Responsiveness --- */

@media (max-width: 1024px) {
    .sidebar {
        width: 0;
        padding: 0;
        overflow: hidden;
        border: none;
        opacity: 0;
        pointer-events: none;
    }

    .sidebar.mobile-open {
        width: 280px;
        padding: var(--space-8);
        opacity: 1;
        pointer-events: auto;
        box-shadow: 20px 0 50px rgba(0, 0, 0, 0.2);
    }

    .main-content, .main-content.sidebar-collapsed {
        margin-left: 0 !important;
    }

    .page-container {
        padding: var(--space-8) var(--space-4) var(--space-16);
    }

    .hero-split {
        grid-template-columns: 1fr !important;
        text-align: center;
        gap: var(--space-8) !important;
    }

    h1 { font-size: 2rem !important; }
    h2 { font-size: 1.75rem !important; }
}

@media (max-width: 768px) {
    .card {
        padding: var(--space-4);
    }

    .btn {
        width: 100%;
        margin-bottom: var(--space-2);
    }

    .form-group {
        margin-bottom: var(--space-4);
    }

    /* Stack grid layouts */
    div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }

    /* Center headers */
    header {
        text-align: center;
        flex-direction: column;
        align-items: center !important;
        gap: var(--space-4);
    }

    header > div {
        text-align: center;
    }

    /* Adjust wizard progress for mobile */
    .progress-track {
        display: none !important;
    }
}
