:root {
    /* TN-SPARK Surgical Palette - 2026 Edition */
    --teal: #14b8a6;
    --teal-dark: #0f766e;
    --teal-light: #2dd4bf;
    --blue: #0ea5e9;
    --blue-dark: #0369a1;
    --blue-light: #38bdf8;
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-900: #0f172a;
    
    /* Gradients */
    --primary-gradient: linear-gradient(135deg, #14b8a6 0%, #0ea5e9 100%);
    --surface-gradient: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    
    /* Layout */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 32px;
    --radius-full: 9999px;
}

/* Global Smoothness */
html { scroll-behavior: smooth; }
body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

/* Section Label Standard */
.section-label {
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .15em;
    text-transform: uppercase;
    color: var(--teal);
    margin-bottom: .8rem;
    display: inline-block;
    background: rgba(20, 184, 166, 0.08);
    padding: 6px 16px;
    border-radius: var(--radius-full);
}

/* Glassmorphism Tokens */
.modern-glass-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(20, 184, 166, 0.1);
    border-radius: var(--radius-lg);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.modern-glass-card:hover {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(20, 184, 166, 0.25);
    transform: translateY(-8px);
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.08);
}

/* Hardened Dropdowns to prevent bleed-through */
.dropdown-menu {
    background: #ffffff !important;
    border: 1px solid rgba(0,0,0,0.08) !important;
    box-shadow: 0 15px 30px rgba(0,0,0,0.1) !important;
    z-index: 1060 !important; /* Above sidebars and fixed headers */
    padding: 8px !important;
    min-width: 180px !important;
    backdrop-filter: none !important; /* Disable glassmorphism for clarity in small menus */
}

.dropdown-item {
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--slate-600);
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background: var(--slate-50);
    color: var(--teal);
}

.dropdown-item.text-danger:hover {
    background: #fef2f2;
    color: #dc2626;
}

/* Gradients */
.portal-header-gradient {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%) !important; /* Dark Slate Gradient */
    color: white !important;
}

.portal-brand-gradient {
    background: linear-gradient(135deg, var(--teal) 0%, var(--blue) 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}


/* Typography Enhancements */
.display-4, .display-5 {
    letter-spacing: -0.04em;
    line-height: 1.1;
}

.text-teal { color: var(--teal) !important; }
.text-blue { color: var(--blue) !important; }
.bg-teal { background-color: var(--teal) !important; }
.bg-teal-soft { background-color: rgba(20, 184, 166, 0.08) !important; }
.bg-blue-soft { background-color: rgba(14, 165, 233, 0.08) !important; }

/* Shadow Tokens */
.shadow-2xl {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
}
.shadow-teal {
    box-shadow: 0 10px 30px -5px rgba(20, 184, 166, 0.4);
}

/* Button Styling */
.modern-primary-btn {
    font-weight: 700;
    letter-spacing: 0.1em;
    padding: 1rem 2.5rem;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    text-transform: uppercase;
    background: var(--teal);
    color: white;
    border: none;
}

.modern-primary-btn:hover {
    background: var(--teal-dark);
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(20, 184, 166, 0.25);
}

.modern-ghost-btn {
    font-weight: 700;
    letter-spacing: 0.1em;
    padding: 0.8rem 2rem;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: var(--slate-700);
    border: 1.5px solid var(--slate-200);
}

.modern-ghost-btn:hover {
    background: var(--slate-50);
    border-color: var(--teal);
    color: var(--teal);
    transform: translateY(-2px);
}

.shadow-premium {
    box-shadow: 0 10px 25px -5px rgba(20, 184, 166, 0.4);
}

/* Animation Utilities */
.transition-all { transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1); }
.hover-translate-y:hover { transform: translateY(-5px); }
.hover-opacity-90:hover { opacity: 0.9; }

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

.animate-fade-in {
    animation: fadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Micro Utilities */
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.opacity-75 { opacity: 0.75; }
.opacity-50 { opacity: 0.5; }
.opacity-10 { opacity: 0.1 !important; }
.opacity-5 { opacity: 0.05 !important; }
.letter-spacing-lg { letter-spacing: 0.1em; }
.z-3 { z-index: 3; }
.scale-102:hover { transform: scale(1.02); }
.py-120 { padding-top: 120px; padding-bottom: 120px; }
.py-80 { padding-top: 80px; padding-bottom: 80px; }

/* Dimension Shims for UI Accents */
.w-20 { width: 5rem !important; }
.w-40 { width: 10rem !important; }
.h-2 { height: 0.5rem !important; }
.h-10 { height: 2.5rem !important; }
.h-20 { height: 5rem !important; }
.h-40 { height: 10rem !important; }

/* Responsive Grid Adjustments */
@media (prefers-reduced-motion: no-preference) {
    .reveal-on-scroll {
        opacity: 0;
        transform: translateY(30px);
        transition: all 0.9s cubic-bezier(0.16, 1, 0.3, 1);
        will-change: transform, opacity;
    }

    .reveal-on-scroll.is-visible {
        opacity: 1;
        transform: translateY(0);
    }

    /* Floating Rhythm */
    .float-slow {
        animation: floatSlow 6s ease-in-out infinite;
    }

    /* Glow Oscillation */
    .pulse-teal {
        animation: pulseTeal 3s ease-in-out infinite;
    }

    @keyframes floatSlow {
        0%, 100% { transform: translateY(0); }
        50% { transform: translateY(-15px); }
    }

    @keyframes pulseTeal {
        0%, 100% { box-shadow: 0 10px 25px -5px rgba(20, 184, 166, 0.3); }
        50% { box-shadow: 0 15px 40px 5px rgba(20, 184, 166, 0.5); }
    }

    /* Sequential Load Helpers */
    .delay-1 { transition-delay: 0.1s; }
    .delay-2 { transition-delay: 0.2s; }
    .delay-3 { transition-delay: 0.3s; }
    .delay-4 { transition-delay: 0.4s; }
    .delay-5 { transition-delay: 0.5s; }
}

/* Administrative Layout Fixes & Enhancements */
body { 
    overflow-x: hidden; 
    background-color: #f1f5f9;
}

/* Sidebar logic moved to later section of file */

.main-content {
    margin-left: 260px;
    width: calc(100% - 260px);
    min-height: 100vh;
    background: #f1f5f9;
    overflow-x: hidden;
}

.sidebar .nav-link {
    color: #94a3b8; /* slate-400 */
    font-weight: 500;
    padding: 0.8rem 1.5rem;
    margin: 4px 12px;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.sidebar .nav-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.sidebar .nav-link.active {
    background: var(--teal) !important;
    color: white !important;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.sidebar-brand {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
}

.rounded-lg { border-radius: 16px !important; }

/* Dashboard Cards */
.modern-glass-card {
    background: #ffffff;
    border: 1px solid rgba(0,0,0,0.05);
}

.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
}
.status-badge-open { background: rgba(20, 184, 166, 0.1); color: var(--teal); }


/* Administrative Layout Fixes & Enhancements */
body { overflow-x: hidden; }

.modern-sidebar-glass {
    background: #0f172a !important; /* Professional Dark Sidebar */
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
    width: 260px !important;
    height: 100vh !important;
    z-index: 1050;
    position: fixed;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Prevent parent from scrolling, children will handle it */
}

/* Ensure sub-menu items are accessible */
.flex-grow-1.overflow-auto {
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.flex-grow-1.overflow-auto::-webkit-scrollbar {
    width: 4px;
}

.flex-grow-1.overflow-auto::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
}

.main-content {
    width: calc(100% - 260px);
    min-height: 100vh;
    transition: all 0.3s ease;
}

.nav-link {
    color: var(--slate-600);
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-link:hover {
    background: rgba(20, 184, 166, 0.05);
    color: var(--teal);
}

.nav-link.active {
    background: var(--teal);
    color: white !important;
    box-shadow: 0 4px 12px rgba(20, 184, 166, 0.15);
}

.text-slate-500 { color: var(--slate-600) !important; } /* Boosted contrast */
.text-slate-400 { color: var(--slate-500) !important; } /* Boosted contrast */

/* High-Fidelity Registry Standard (Portal 2026) */
.registry-thead {
    background: var(--slate-900) !important;
}
.registry-thead th {
    color: white !important;
    text-transform: uppercase;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.15em;
    padding: 1.25rem 1rem !important;
    border: none !important;
}

.registry-search-container {
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: 0 20px 40px -15px rgba(20, 184, 166, 0.2);
}

.action-tile {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    background: rgba(148, 163, 184, 0.1);
    color: var(--slate-600);
}

.action-tile:hover {
    transform: scale(1.15);
}

.action-tile-view { color: var(--teal); background: rgba(20, 184, 166, 0.1); }
.action-tile-edit { color: var(--blue); background: rgba(14, 165, 233, 0.1); }
.action-tile-delete { color: #ef4444; background: rgba(239, 68, 68, 0.1); }

.protocol-code {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 0.8rem;
    padding: 4px 8px;
    border-radius: 6px;
}

.registry-row:hover {
    background-color: var(--slate-50) !important;
}

