/* NexoTaller Brand DNA Theme Tokens */
@import url('/nexotaller_erp/lib/fonts/fonts.css');

:root {
    /* Browser Native Form Controls */
    color-scheme: light;
    
    /* Brand DNA Base Variables - Light Mode (Clinical/Administrative by default) */
    
    /* Global Backgrounds - Daylight Circuit (Premium Light) */
    --md-sys-color-background: #F0F1F5; 
    --md-sys-color-on-background: #1E293B; /* Slate 800 */
    --theme-body-image: radial-gradient(circle at 10% 10%, rgba(160, 32, 240, 0.06), transparent 40%), 
                        radial-gradient(circle at 90% 90%, rgba(14, 165, 233, 0.04), transparent 40%),
                        radial-gradient(circle at 50% 100%, rgba(160, 32, 240, 0.03), transparent 50%);
    
    /* Surfaces / Cards - Luxury Glassmorphism */
    --md-sys-color-surface: rgba(250, 250, 252, 0.85);
    --md-sys-color-on-surface: #1E293B;
    --md-sys-color-surface-variant: rgba(235, 237, 242, 0.85);
    --md-sys-color-on-surface-variant: #475569;
    
    /* Sidebar Specific (Daylight) */
    --sidebar-bg: var(--md-sys-color-surface);
    --sidebar-text: #475569;
    --sidebar-icon: #8B949E;
    --sidebar-active-bg: rgba(160, 32, 240, 0.08);
    --sidebar-active-text: #C040FF;
    --sidebar-header: #94A3B8;
    --sucursal-bg: rgba(250, 250, 252, 0.6);
    --sucursal-text: #334155;
    --sucursal-border: rgba(250, 250, 252, 0.5);
    
    /* Outlines & Borders */
    --md-sys-color-outline: rgba(180, 188, 200, 0.55);
    --md-sys-color-outline-variant: rgba(210, 214, 224, 0.5);

    /* Surface Containers (Standard MD3 - Augmented with Translucency) */
    --md-sys-color-surface-container-lowest: #FAFAFC;
    --md-sys-color-surface-container-low: rgba(240, 241, 245, 0.7);
    --md-sys-color-surface-container: rgba(232, 234, 240, 0.75);
    --md-sys-color-surface-container-high: rgba(218, 221, 230, 0.85);
    --md-sys-color-surface-container-highest: #B8BFC9;

    /* Semantic Primary: Azul Mecánico (Estructura) */
    --md-sys-color-primary: #0078D4;
    --md-sys-color-on-primary: #FFFFFF;
    --md-sys-color-primary-container: #E0F2FE;
    --md-sys-color-on-primary-container: #004D8C;

    /* Semantic AI/Premium: Nexo Violeta (Cerebro) */
    --md-sys-color-ai: #A020F0;
    --md-sys-color-on-ai: #FFFFFF;
    --md-sys-color-ai-container: #F3E8FF;
    --md-sys-color-on-ai-container: #581C87;
    --md-sys-color-ai-glow: 0 0 12px rgba(160, 32, 240, 0.15); /* Subtle violet glow even in light */
    --accent-violet: var(--md-sys-color-ai);
    --accent-violet-hover: #C040FF;

    /* Focus / Highlight: Nexo Violeta */
    --md-sys-color-focus: #A020F0; /* Violet as focus — brand cohesion */

    /* Status Colors */
    --md-sys-color-error: #FF3D71; /* Danger */
    --md-sys-color-on-error: #FFFFFF;
    --md-sys-color-error-container: #FFE1E8;
    --md-sys-color-on-error-container: #8C002A;

    --md-sys-color-warning: #FFAB00; /* Warning */
    --md-sys-color-success: #00C853; /* Success */

    /* Typography */
    --md-sys-typescale-display-large-font: 'Sora', sans-serif;
    --md-sys-typescale-headline-large-font: 'Sora', sans-serif;
    --md-sys-typescale-title-large-font: 'Sora', sans-serif;
    --md-sys-typescale-body-large-font: 'Inter', sans-serif;
    --md-sys-typescale-body-medium-font: 'Inter', sans-serif;

    /* Standardized Font Shorthand Tokens */
    --nx-font-heading: 'Sora', sans-serif;
    --nx-font-body: 'Inter', sans-serif;
    --nx-font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* Brand Violet Accent Tokens */
    --nx-brand-violet: #A020F0;
    --nx-brand-violet-subtle: rgba(160, 32, 240, 0.06);
    --nx-brand-violet-border: rgba(160, 32, 240, 0.12);
    --nx-brand-violet-glow: rgba(160, 32, 240, 0.15);

    /* Standardized Header Tokens */
    --nx-header-height: 64px;
    --nx-header-bg: var(--md-sys-color-surface);
    --nx-header-border: var(--md-sys-color-outline-variant);

    /* Layout */
    --sidebar-width: 256px;

    /* Shapes */
    --md-sys-shape-corner-extra-small: 4px;
    --md-sys-shape-corner-small: 8px;
    --md-sys-shape-corner-medium: 12px;
    --md-sys-shape-corner-large: 16px;
    --md-sys-shape-corner-extra-large: 28px;
    --md-sys-shape-corner-full: 100px;

    /* Elevation (Soft Drop Shadows for Light Mode) */
    --md-sys-elevation-1: 0 4px 12px rgba(0, 0, 0, 0.05);
    --md-sys-elevation-2: 0 8px 24px rgba(0, 0, 0, 0.08);
    --md-sys-elevation-3: 0 16px 32px rgba(0, 0, 0, 0.12);

    /* == CIRCUIT TOKENS (Global & Modals) == */
    --theme-body-bg: var(--md-sys-color-background);
    /* body-image already defined above — do NOT override to none */
    --theme-modal-bg: linear-gradient(145deg, rgba(250, 250, 252, 0.97), rgba(232, 234, 240, 0.95));
    --theme-modal-header: linear-gradient(135deg, rgba(250, 250, 252, 0.95), rgba(243, 232, 255, 0.3));
    --theme-modal-footer: linear-gradient(135deg, rgba(250, 250, 252, 0.95), rgba(243, 232, 255, 0.25));
    --theme-modal-border: var(--nx-brand-violet-border);
    --theme-input-bg: rgba(232, 234, 240, 0.6);
    --theme-label-color: var(--md-sys-color-on-surface-variant);
    --theme-section-icon: var(--md-sys-color-ai); /* Violet section icons */
    --theme-close-btn-bg: rgba(160, 32, 240, 0.08);
    --theme-close-btn-hover: rgba(160, 32, 240, 0.18);
    --theme-close-btn-color: var(--md-sys-color-ai);
    --theme-field-focus-shadow: 0 0 0 3px rgba(160, 32, 240, 0.12), 0 0 16px rgba(160, 32, 240, 0.06);

    /* NexoTaller Legacy Aliases for Compatibility */
    --nx-carbon-slate: #ECEEF2;
    --nx-titanium-armor: #FAFAFC;
    --nx-text-white: #1A1D21;
    --nx-text-muted: #4A5568;
    --nx-hyper-green: #00C853;

    /* == PREMIUM GLASSMORPHISM TOKENS (DAYLIGHT EXPLICIT) == */
    --premium-blur: blur(24px);
    --premium-glass-bg: rgba(245, 246, 250, 0.75);
    --premium-glass-border: 1px solid rgba(255, 255, 255, 0.4);
    --premium-glass-shadow: 0 10px 15px -3px rgba(15, 23, 42, 0.05), 0 4px 6px -2px rgba(15, 23, 42, 0.03);
    --search-input-bg: rgba(240, 241, 245, 0.6);
    --hub-button-bg: rgba(250, 250, 252, 0.8);
    --hub-button-border: 1px solid rgba(250, 250, 252, 0.5);
    --hub-icon-color: #8B949E;
    --premium-accent-gradient: linear-gradient(135deg, #A020F0 0%, #C040FF 100%);
    --premium-text-gradient: linear-gradient(135deg, #C040FF 0%, #4F46E5 100%);

    /* Building Icon Pill */
    --nx-building-pill-bg: rgba(160, 32, 240, 0.08);
    --nx-building-pill-border: rgba(160, 32, 240, 0.2);
}

/* Dark Mode Overrides (High-Tech / Taller) */
/* Can be triggered by OS preference OR attribute data-theme="dark" on <html> or <body> */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark;
        /* Global Backgrounds */
        --md-sys-color-background: #0f172a; /* Azul oscuro profundo (Slate 900) */
        --md-sys-color-on-background: #F8FAFC; /* Slate 50 */
        
        /* Surfaces / Cards */
        --md-sys-color-surface: #1e293b; /* Slate 800 */
        --md-sys-color-on-surface: #F8FAFC;
        --md-sys-color-surface-variant: #0f172a; 
        --md-sys-color-on-surface-variant: #94A3B8; /* Slate 400 */
        
        /* Outlines & Borders */
        --md-sys-color-outline: #334155; /* Slate 700 */
        --md-sys-color-outline-variant: rgba(255, 255, 255, 0.08);

        /* Surface Containers (Standard MD3 Dark) */
        --md-sys-color-surface-container-lowest: #020617; /* Slate 950 */
        --md-sys-color-surface-container-low: #0f172a;
        --md-sys-color-surface-container: #1e293b;
        --md-sys-color-surface-container-high: #334155;
        --md-sys-color-surface-container-highest: #475569;

        /* Semantic Primary: Azul Mecánico (Estructura) */
        --md-sys-color-primary: #0078D4; 
        --md-sys-color-on-primary: #FFFFFF;
        --md-sys-color-primary-container: #004D8C;
        --md-sys-color-on-primary-container: #E0F2FE;

        /* Semantic AI/Premium: Nexo Violeta (Cerebro) */
        --md-sys-color-ai: #A020F0; /* Logo color, vibrant in both modes */
        --md-sys-color-on-ai: #FFFFFF;
        --md-sys-color-ai-container: #4c1d95; /* Deep Violet */
        --accent-violet: var(--md-sys-color-ai);
        --accent-violet-hover: #C040FF;
        --sucursal-bg: #111827;
        --sucursal-text: #E5E7EB;
        --sucursal-border: #374151;
        --search-input-bg: rgba(255, 255, 255, 0.05);
        --search-input-border: rgba(255, 255, 255, 0.1);

        /* Focus / Highlight: Nexo Violeta */
        --md-sys-color-focus: #A020F0; /* Violet focus — brand identity */

        /* Elevation (Flat with light borders for Dark Mode) */
        --md-sys-elevation-1: none;
        --md-sys-elevation-2: 0 10px 30px rgba(0, 0, 0, 0.3);
        --md-sys-elevation-3: 0 16px 40px rgba(0, 0, 0, 0.5);

        /* == MIDNIGHT CIRCUIT TOKENS (Global & Modals) == */
        --theme-body-bg: #0f172a; /* Slate 900 */
        --theme-body-image: radial-gradient(circle at 15% 50%, rgba(59, 130, 246, 0.08), transparent 25%), radial-gradient(circle at 85% 30%, rgba(160, 32, 240, 0.08), transparent 25%);
        --theme-modal-bg: linear-gradient(145deg, #1e293b, #0f172a);
        --theme-modal-header: rgba(160, 32, 240, 0.04);
        --theme-modal-footer: rgba(0, 0, 0, 0.25);
        --theme-modal-border: rgba(160, 32, 240, 0.15);
        --theme-input-bg: rgba(0, 0, 0, 0.3);
        --theme-label-color: #94a3b8;
        --theme-section-icon: #C084FC; /* Lighter violet for dark mode */
        --theme-close-btn-bg: rgba(160, 32, 240, 0.1);
        --theme-close-btn-hover: rgba(160, 32, 240, 0.25);
        --theme-close-btn-color: #C084FC;
        --theme-field-focus-shadow: 0 0 0 3px rgba(160, 32, 240, 0.2), 0 0 20px rgba(160, 32, 240, 0.1);

        /* NexoTaller Legacy Aliases for Compatibility */
        --nx-carbon-slate: #0F172A;
        --nx-titanium-armor: #1E293B;
        --nx-text-white: #F8FAFC;
        --nx-text-muted: #94A3B8;
        --nx-diagnostic-purple: #06B6D4; /* Legacy name — actually Cyan. Used in ~12 dark-mode rules. */
        --nx-hyper-green: #00E676;
        --premium-glass-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);

        /* Sidebar Specific (Dark) */
        --sidebar-bg: #0f172a; /* Mismo azul que el fondo general (Slate 900) */
        --sidebar-text: #94A3B8;
        --sidebar-icon: #8B949E;
        --sidebar-active-bg: rgba(160, 32, 240, 0.15);
        --sidebar-active-text: #FFFFFF;
        --sidebar-header: #475569;
        --hub-button-bg: rgba(255, 255, 255, 0.05);
        --hub-button-border: 1px solid rgba(255, 255, 255, 0.1);
        --hub-icon-color: #E2E8F0;

        /* Building Icon Pill */
        --nx-building-pill-bg: rgba(192, 64, 255, 0.15);
        --nx-building-pill-border: rgba(192, 64, 255, 0.25);
    }
}

/* Explicit declarative classes for theme switching */
:root[data-theme="dark"] {
    color-scheme: dark;
    --md-sys-color-background: #0f172a;
    --md-sys-color-on-background: #F8FAFC;
    --md-sys-color-surface: #1e293b;
    --md-sys-color-on-surface: #F8FAFC;
    --md-sys-color-surface-variant: #0f172a;
    --md-sys-color-on-surface-variant: #94A3B8;
    --md-sys-color-outline: #334155;
    --md-sys-color-outline-variant: rgba(255, 255, 255, 0.08);
    
    /* Surface Containers (Standard MD3 Dark) */
    --md-sys-color-surface-container-lowest: #020617;
    --md-sys-color-surface-container-low: #0f172a;
    --md-sys-color-surface-container: #1e293b;
    --md-sys-color-surface-container-high: #334155;
    --md-sys-color-surface-container-highest: #475569;
    --md-sys-color-primary: #0078D4;
    --md-sys-color-on-primary: #FFFFFF;
    --md-sys-color-primary-container: #004D8C;
    --md-sys-color-on-primary-container: #E0F2FE;
    --md-sys-color-ai: #A020F0;
    --md-sys-color-on-ai: #FFFFFF;
    --md-sys-color-ai-container: #581C87;
    --md-sys-color-on-ai-container: #F3E8FF;
    --md-sys-color-ai-glow: 0 0 15px rgba(160, 32, 240, 0.4);
    --accent-violet: var(--md-sys-color-ai);
    --accent-violet-hover: #C040FF;
    --sucursal-bg: #111827;
    --sucursal-text: #E5E7EB;
    --sucursal-border: #374151;
    --search-input-bg: rgba(255, 255, 255, 0.05);
    --search-input-border: rgba(255, 255, 255, 0.1);
    --md-sys-color-focus: #A020F0; /* Violet focus */
    --md-sys-elevation-1: none;
    --md-sys-elevation-2: 0 10px 30px rgba(0, 0, 0, 0.3);
    --md-sys-elevation-3: 0 16px 40px rgba(0, 0, 0, 0.5);

    /* == MIDNIGHT CIRCUIT TOKENS (Global & Modals) == */
    --theme-body-bg: #0f172a;
    --theme-body-image: radial-gradient(circle at 15% 50%, rgba(59, 130, 246, 0.08), transparent 25%), radial-gradient(circle at 85% 30%, rgba(160, 32, 240, 0.08), transparent 25%);
    --theme-modal-bg: linear-gradient(145deg, #1e293b, #0f172a);
    --theme-modal-header: rgba(160, 32, 240, 0.04);
    --theme-modal-footer: rgba(0, 0, 0, 0.25);
    --theme-modal-border: rgba(160, 32, 240, 0.15);
    --theme-input-bg: rgba(0, 0, 0, 0.3);
    --theme-label-color: #94a3b8;
    --theme-section-icon: #C084FC;
    --theme-close-btn-bg: rgba(160, 32, 240, 0.1);
    --theme-close-btn-hover: rgba(160, 32, 240, 0.25);
    --theme-close-btn-color: #C084FC;
    --theme-field-focus-shadow: 0 0 0 3px rgba(160, 32, 240, 0.2), 0 0 20px rgba(160, 32, 240, 0.1);

    /* NexoTaller Legacy Aliases for Compatibility */
    --nx-carbon-slate: #0F172A;
    --nx-titanium-armor: #1E293B;
    --nx-text-white: #F8FAFC;
    --nx-text-muted: #94A3B8;
    --nx-hyper-green: #00E676;

    /* == PREMIUM GLASSMORPHISM TOKENS (DARK EXPLICIT) == */
    --premium-glass-bg: rgba(15, 23, 42, 0.65);
    --premium-glass-border: 1px solid rgba(255, 255, 255, 0.1);
    --premium-glass-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);

    /* Sidebar Specific (Dark Explicit) */
    --sidebar-bg: #0f172a;
    --sidebar-text: #94A3B8;
    --sidebar-icon: #8B949E;
    --sidebar-active-bg: rgba(160, 32, 240, 0.15);
    --sidebar-active-text: #FFFFFF;
    --sidebar-header: #475569;
    --hub-button-bg: rgba(255, 255, 255, 0.05);
    --hub-button-border: 1px solid rgba(255, 255, 255, 0.1);
    --hub-icon-color: #E2E8F0;

    /* Building Icon Pill */
    --nx-building-pill-bg: rgba(192, 64, 255, 0.15);
    --nx-building-pill-border: rgba(192, 64, 255, 0.25);
}

/* ============================================
   NX-THEME GLOBAL OVERRIDES (MERGED)
   ============================================ */

/* Body default */
body.nx-theme {
    background-color: var(--md-sys-color-background) !important;
    background-image: var(--theme-body-image) !important;
    color: var(--md-sys-color-on-background);
    font-family: var(--nx-font-body, 'Inter', sans-serif);
}

/* Sidebar Header Aesthetic */
.nx-sidebar-header {
    background: transparent;
}

[data-theme="dark"] .nx-sidebar-header {
    background: transparent;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .nx-sidebar-header {
        background: transparent;
    }
}

/* ============================================
   GEMSTONE NAVIGATION — Pill Icon System
   UX/UI Pro Max: Modern Dark Cinema + Micro-interactions
   ============================================ */

/* Nav Pill — Gradient Icon Container */
.nx-nav-pill {
    width: 28px !important;
    height: 28px !important;
    max-width: 28px !important;
    min-width: 28px !important;
    flex: 0 0 28px !important;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.45;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.nx-nav-pill i {
    color: #fff;
    font-size: 12px;
    line-height: 1;
}

/* Nav Item Base */
.nx-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 14px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none;
    position: relative;
    margin: 1px 4px;
}

/* Hover State — Organic gradient fill + pill lift */
.nx-nav-item:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.08) 100%);
}

.nx-nav-item:hover .nx-nav-pill {
    opacity: 0.8;
    transform: translateY(-1px) scale(1.02);
}

.nx-nav-item:hover .nx-nav-label {
    color: var(--sidebar-active-text) !important;
}

/* Active Press — Cinema tactile feel */
.nx-nav-item:active {
    transform: scale(0.97);
}

/* Active State — Current page: organic glow instead of flat rectangle */
.nx-nav-item.nx-active {
    background: linear-gradient(135deg, rgba(160, 32, 240, 0.08) 0%, rgba(160, 32, 240, 0.14) 50%, rgba(160, 32, 240, 0.06) 100%);
    box-shadow: inset 0 0 20px rgba(160, 32, 240, 0.04), 0 1px 3px rgba(0, 0, 0, 0.1);
}

.nx-nav-item.nx-active .nx-nav-pill {
    opacity: 1;
    transform: scale(1.08);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25), 0 0 8px rgba(160, 32, 240, 0.15);
}

.nx-nav-item.nx-active .nx-nav-label {
    color: var(--sidebar-active-text) !important;
    font-weight: 700;
}

/* Active indicator bar — organic glow */
.nx-nav-item.nx-active::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    border-radius: 3px 0 0 3px;
    background: var(--nx-active-gradient, var(--accent-violet));
    box-shadow: -2px 0 8px rgba(160, 32, 240, 0.3);
}

/* Nav Label */
.nx-nav-label {
    font-size: 13px;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    transition: color 0.25s ease;
}

/* Section Header with Gradient Dot — Premium spacing */
.nx-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 16px 0;
    margin-bottom: 10px;
}

.nx-section-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 6px currentColor;
}

.nx-section-title {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--sidebar-header);
}

/* ---- Dark Mode Sidebar Refinements ---- */
:root[data-theme="dark"] .nx-nav-item:hover {
    background: linear-gradient(135deg, rgba(148, 163, 184, 0.06) 0%, rgba(148, 163, 184, 0.10) 100%);
}

:root[data-theme="dark"] .nx-nav-item.nx-active {
    background: linear-gradient(135deg, rgba(160, 32, 240, 0.06) 0%, rgba(160, 32, 240, 0.14) 50%, rgba(139, 148, 158, 0.06) 100%);
    border: 1px solid rgba(160, 32, 240, 0.08);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .nx-nav-item:hover {
        background: linear-gradient(135deg, rgba(148, 163, 184, 0.06) 0%, rgba(148, 163, 184, 0.10) 100%);
    }
    :root:not([data-theme="light"]) .nx-nav-item.nx-active {
        background: linear-gradient(135deg, rgba(160, 32, 240, 0.06) 0%, rgba(160, 32, 240, 0.14) 50%, rgba(139, 148, 158, 0.06) 100%);
        border: 1px solid rgba(160, 32, 240, 0.08);
    }
}

/* Light Mode sidebar refinements — cleaner, softer */
:root:not([data-theme="dark"]) .nx-nav-item:hover {
    background: linear-gradient(135deg, rgba(160, 32, 240, 0.03) 0%, rgba(160, 32, 240, 0.06) 100%);
}

:root:not([data-theme="dark"]) .nx-nav-item.nx-active {
    background: linear-gradient(135deg, rgba(160, 32, 240, 0.06) 0%, rgba(160, 32, 240, 0.10) 100%);
    box-shadow: inset 0 0 16px rgba(160, 32, 240, 0.03), 0 1px 2px rgba(0, 0, 0, 0.04);
}

/* Nav Group — Breathing room + subtle divider between sections */
.nx-nav-group {
    padding-bottom: 12px;
    position: relative;
    background: transparent !important;
}

.nx-nav-group:first-child {
    padding-top: 6px;
}

.nx-nav-group + .nx-nav-group {
    padding-top: 4px;
}

.nx-nav-group + .nx-nav-group::before {
    content: '';
    display: block;
    height: 1px;
    margin: 0 20px 12px;
    background: linear-gradient(90deg, transparent 0%, var(--md-sys-color-outline-variant) 30%, var(--md-sys-color-outline-variant) 70%, transparent 100%);
}

:root[data-theme="dark"] .nx-nav-group + .nx-nav-group::before {
    background: linear-gradient(90deg, transparent 0%, rgba(148, 163, 184, 0.08) 30%, rgba(148, 163, 184, 0.08) 70%, transparent 100%);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .nx-nav-group + .nx-nav-group::before {
        background: linear-gradient(90deg, transparent 0%, rgba(148, 163, 184, 0.08) 30%, rgba(148, 163, 184, 0.08) 70%, transparent 100%);
    }
}

/* Reduced Motion — Accessibility */
@media (prefers-reduced-motion: reduce) {
    .nx-nav-pill,
    .nx-nav-item,
    .nx-nav-label {
        transition: none !important;
    }
    .nx-nav-item:active {
        transform: none;
    }
    .nx-nav-item:hover .nx-nav-pill {
        transform: none;
    }
    .nx-nav-item.nx-active .nx-nav-pill {
        transform: none;
    }
}

/* Hardcoded Tailwind overrides to respect Theme */
body.nx-theme .bg-white {
    background: var(--md-sys-color-surface) !important;
    border-color: var(--md-sys-color-outline-variant) !important;
}

body.nx-theme .text-gray-900,
body.nx-theme .text-gray-800,
body.nx-theme .text-slate-800,
body.nx-theme .text-slate-900 {
    color: var(--md-sys-color-on-surface) !important;
}

body.nx-theme .text-gray-600,
body.nx-theme .text-slate-600 {
    color: var(--md-sys-color-on-surface-variant) !important;
}

body.nx-theme .border-gray-200,
body.nx-theme .border-slate-200 {
    border-color: var(--md-sys-color-outline-variant) !important;
}

/* Native Form Controls - Theme-Aware Date Inputs */
.nx-date-input {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    color-scheme: light;
    background-color: var(--md-sys-color-surface-container);
    color: var(--md-sys-color-on-surface);
    border: 1px solid var(--md-sys-color-outline-variant);
    -webkit-text-fill-color: var(--md-sys-color-on-surface);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.nx-date-input:focus {
    border-color: #A020F0;
    box-shadow: 0 0 0 2px rgba(160, 32, 240, 0.25);
}

:root[data-theme="dark"] .nx-date-input {
    color-scheme: dark;
    background-color: #1e293b !important;
    color: #F8FAFC !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    -webkit-text-fill-color: #F8FAFC;
}

:root[data-theme="dark"] .nx-date-input::-webkit-calendar-picker-indicator {
    filter: invert(1) brightness(0.8);
    cursor: pointer;
}

:root[data-theme="dark"] .nx-date-input::-webkit-datetime-edit-fields-wrapper {
    color: #F8FAFC;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .nx-date-input {
        color-scheme: dark;
        background-color: #1e293b !important;
        color: #F8FAFC !important;
        border-color: rgba(255, 255, 255, 0.12) !important;
        -webkit-text-fill-color: #F8FAFC;
    }
    
    :root:not([data-theme="light"]) .nx-date-input::-webkit-calendar-picker-indicator {
        filter: invert(1) brightness(0.8);
        cursor: pointer;
    }
    
    :root:not([data-theme="light"]) .nx-date-input::-webkit-datetime-edit-fields-wrapper {
        color: #F8FAFC;
    }
}

/* Navigation Rail Styles */
.nav-rail-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 28px;
    /* Circular/Pill */
    color: var(--md-sys-color-on-surface-variant);
    text-decoration: none;
    transition: background-color 0.2s, color 0.2s;
}

.nav-rail-item:hover {
    background-color: rgba(0, 0, 0, 0.08);
    color: var(--md-sys-color-on-surface);
}

.nav-rail-item.active {
    background-color: var(--md-sys-color-secondary-container);
    color: var(--md-sys-color-on-secondary-container);
}

.nav-rail-item .material-icons {
    font-size: 28px;
}

.nav-rail-item .label {
    font-size: 10px;
    font-weight: 500;
    margin-top: 4px;
    display: none;
    /* Hide label by default for cleaner look, show on hover if desired */
}

/* Show label on hover or if we want a wider rail later */
/* .nav-rail-item:hover .label { display: block; } */

body {
    font-family: var(--md-sys-typescale-body-large-font);
    background-color: var(--md-sys-color-background);
    color: var(--md-sys-color-on-background);
    margin: 0;
    padding: 0;
}

/* ============================================
   NX-MODAL STANDARDIZED SYSTEM
   ============================================ */
.nx-modal-overlay {
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nx-modal-overlay:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
}

.nx-modal-container {
    background: var(--theme-modal-bg);
    color: var(--md-sys-color-on-surface);
    border-radius: 28px;
    box-shadow: var(--md-sys-elevation-3);
    border: 1px solid var(--theme-modal-border);
    width: 100%;
    max-width: var(--nx-modal-max-w, 600px);
    position: relative;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.95);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nx-modal-overlay:not(.hidden) .nx-modal-container {
    transform: scale(1);
    opacity: 1;
}

.nx-modal-header {
    background: var(--theme-modal-header);
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--theme-modal-border);
}

.nx-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex-grow: 1;
    background: var(--theme-modal-bg);
}

.nx-modal-footer {
    padding: 16px 24px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: var(--theme-modal-footer);
    border-top: 1px solid var(--theme-modal-border);
}

/* Glass Input Pattern */
.nx-glass-field {
    background: var(--theme-input-bg);
    border: 1px solid var(--theme-modal-border);
    border-radius: 12px;
    padding: 10px 14px;
    color: var(--md-sys-color-on-surface);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    font-size: 0.875rem;
}

.nx-glass-field:focus {
    border-color: var(--md-sys-color-focus);
    box-shadow: var(--theme-field-focus-shadow);
    outline: none;
}

.nx-glass-field::placeholder {
    color: var(--theme-label-color);
    opacity: 0.6;
}

/* ============================================
   GLOBAL SELECT & OPTION BRAND DNA THEMING
   ============================================ */
select,
input,
button {
    accent-color: var(--accent-violet, #A020F0) !important;
}

select option {
    background-color: var(--md-sys-color-surface-container-lowest, #FFFFFF);
    color: var(--md-sys-color-on-surface, #1E293B);
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 500;
}

[data-theme="dark"] select option {
    background-color: #161B22;
    color: #E1E5E9;
}

select option:checked,
select option:hover,
select option:focus {
    background-color: var(--accent-violet, #A020F0) !important;
    color: #FFFFFF !important;
}

/* Close Button — Violet Ghost */
.nx-modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--theme-close-btn-bg);
    color: var(--theme-close-btn-color);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 14px;
    flex-shrink: 0;
}

.nx-modal-close:hover {
    background: var(--theme-close-btn-hover);
    border-color: var(--theme-close-btn-color);
    box-shadow: var(--md-sys-color-ai-glow);
    transform: rotate(90deg);
}

/* Section Title Icons — Violet Brand */
.nx-modal-section-title i,
.nx-modal-section-title .material-icons {
    color: var(--theme-section-icon);
    font-size: 1rem;
}

/* Header Icon Badge — Gradient */
.nx-modal-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, #3B82F6, var(--md-sys-color-ai));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1.125rem;
    box-shadow: 0 4px 12px rgba(160, 32, 240, 0.25);
    flex-shrink: 0;
}

/* Responsive (Bottom Sheet for Mobile) */
@media (max-width: 768px) {
    .nx-modal-overlay {
        align-items: flex-end;
        padding: 0;
    }
    .nx-modal-container {
        border-radius: 28px 28px 0 0;
        max-width: 100% !important;
        max-height: 92vh;
        transform: translateY(100%);
    }
    .nx-modal-overlay:not(.hidden) .nx-modal-container {
        transform: translateY(0);
    }
}
/* --- FullCalendar Light Mode Overrides (Explicit) --- */
.fc-theme-standard .fc-scrollgrid,
.fc-theme-standard td,
.fc-theme-standard th {
    border-color: var(--md-sys-color-outline-variant) !important;
}

.fc-day-today {
    background: var(--md-sys-color-primary-container) !important;
}

.fc-daygrid-day:hover,
.fc-timegrid-slot:hover {
    background: var(--md-sys-color-surface-container-low) !important;
}

.fc-col-header-cell {
    background: var(--md-sys-color-surface-container-high) !important;
    border-bottom: 0px solid var(--md-sys-color-primary) !important;
}

.fc-col-header-cell-cushion {
    color: var(--md-sys-color-on-surface) !important;
    text-shadow: none !important;
}

/* Section Titles & Subtitles - Standardized Contrast */
.nx-section-title {
    color: var(--md-sys-color-on-background) !important;
    font-family: var(--md-sys-typescale-headline-large-font) !important;
    letter-spacing: -0.02em !important;
}

.nx-section-subtitle {
    color: var(--md-sys-color-on-surface-variant) !important;
    font-size: 0.825rem !important;
    font-weight: 500 !important;
    opacity: 0.9;
}


/* ====================================================================
   NX_PLAN — Subscription Feature Gating Styles
   ==================================================================== */

/* Locked sidebar/nav items */
.nx-locked {
    opacity: 0.35 !important;
    pointer-events: none;
    position: relative;
    filter: grayscale(0.6);
    transition: opacity 0.3s ease, filter 0.3s ease;
}

/* Allow click interception (pointer-events restored for the overlay handler) */
.nx-locked[data-feature] {
    pointer-events: auto;
    cursor: not-allowed;
}

/* Lock icon badge */
.nx-locked::after {
    content: '\f023'; /* fa-lock */
    font-family: 'Font Awesome 6 Free', 'Font Awesome 5 Free', 'FontAwesome';
    font-weight: 900;
    font-size: 0.6rem;
    position: absolute;
    top: 4px;
    right: 8px;
    color: var(--md-sys-color-on-surface-variant, #8a8f9e);
    opacity: 0.7;
    background: rgba(0,0,0,0.3);
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Hover state for locked items — slight reveal + tooltip */
.nx-locked:hover {
    opacity: 0.55 !important;
    filter: grayscale(0.3);
}

/* Upgrade modal fade animation */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
