:root {
    /* Core Palette - Light & Clean (Default) */
    --bg-deep: #f8fafc;
    --bg-body: #ffffff;
    --bg-card: #ffffff;
    --bg-glass: #ffffff;

    /* Accents - Professional & Muted */
    --primary: #0284c7;
    --primary-glow: rgba(2, 132, 199, 0.1);
    --secondary: #7c3aed;
    --secondary-glow: rgba(124, 58, 237, 0.1);
    --accent: #e11d48;

    /* Status Colors */
    --success: #059669;
    --warning: #d97706;
    --danger: #dc2626;
    --info: #2563eb;

    /* Typography */
    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'Outfit', sans-serif;

    /* Text Colors */
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-dim: #94a3b8;

    /* Borders */
    --border-color: #e2e8f0;
    --glass-border: rgba(148, 163, 184, 0.15);
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius: 0.5rem;

    /* Shadows */
    --shadow-card: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
    --glow-text: none;

    /* Premium Additions */
    --bg-rich: #f1f5f9;
    --glass-panel: rgba(255, 255, 255, 0.7);
    --glass-shimmer: rgba(255, 255, 255, 0.5);
}

[data-theme="dark"] {
    /* Core Palette - Dark Space Theme */
    --bg-deep: #050510;
    --bg-body: #0a0b1e;
    --bg-card: rgba(20, 20, 40, 0.6);
    --bg-glass: rgba(255, 255, 255, 0.03);

    /* Neon Accents */
    --primary: #00f2ff;
    --primary-glow: rgba(0, 242, 255, 0.4);
    --secondary: #bd00ff;
    --secondary-glow: rgba(189, 0, 255, 0.4);
    --accent: #ff0055;

    /* Status Colors */
    --success: #00ff9d;
    --warning: #ffb800;
    --danger: #ff2a2a;
    --info: #0088ff;

    /* Text Colors */
    --text-main: #ffffff;
    --text-muted: #94a3b8;
    --text-dim: #64748b;

    /* Glassmorphism */
    --glass-border: rgba(255, 255, 255, 0.08);
    --border-color: rgba(255, 255, 255, 0.08);

    /* Shadows & Glows */
    --shadow-card: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 20px 40px -5px rgba(0, 0, 0, 0.4);
    --glow-text: 0 0 10px rgba(255, 255, 255, 0.1);

    /* Premium Additions */
    --bg-rich: #020617;
    --glass-panel: rgba(15, 23, 42, 0.6);
    --glass-shimmer: rgba(255, 255, 255, 0.05);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--text-dim);
    border-radius: 4px;
    opacity: 0.5;
}

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

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

body {
    font-family: var(--font-body);
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

[data-theme="dark"] body {
    background: radial-gradient(circle at 60% -20%, #1a1b3a 0%, var(--bg-deep) 100%);
}

/* 2. Typography Defaults */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-main);
}

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

/* Premium Utilities */
.glass-panel {
    background: var(--glass-panel);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
}

.premium-shadow {
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.03), 0 2px 8px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .premium-shadow {
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.05), 0 4px 20px rgba(0, 0, 0, 0.4);
}

.hover-lift {
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hover-lift:hover {
    transform: translateY(-2px);
}

.input-premium {
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: all 0.2s;
}

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

/* 
   Mobile Input Zoom Fix 
   Forces 16px font size on inputs on mobile devices to prevent iOS from zooming in
   when an input is focused.
*/
@media screen and (max-width: 768px) {

    input[type="text"],
    input[type="password"],
    input[type="email"],
    input[type="number"],
    input[type="date"],
    select,
    textarea {
        font-size: 16px !important;
    }
}

/* Row Animation for Table */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.item-row {
    opacity: 0;
    will-change: transform;
    animation: slideIn 0.5s ease forwards;
}

/* Stagger delays */
tr:nth-child(1) {
    animation-delay: 0.03s;
}

tr:nth-child(2) {
    animation-delay: 0.06s;
}

tr:nth-child(3) {
    animation-delay: 0.09s;
}

tr:nth-child(4) {
    animation-delay: 0.12s;
}

tr:nth-child(5) {
    animation-delay: 0.15s;
}

tr:nth-child(6) {
    animation-delay: 0.18s;
}

tr:nth-child(7) {
    animation-delay: 0.21s;
}

tr:nth-child(8) {
    animation-delay: 0.24s;
}

tr:nth-child(9) {
    animation-delay: 0.27s;
}

tr:nth-child(10) {
    animation-delay: 0.3s;
}

tr:nth-child(11) {
    animation-delay: 0.33s;
}

tr:nth-child(12) {
    animation-delay: 0.36s;
}

tr:nth-child(13) {
    animation-delay: 0.39s;
}

tr:nth-child(14) {
    animation-delay: 0.42s;
}

tr:nth-child(15) {
    animation-delay: 0.45s;
}

tr:nth-child(16) {
    animation-delay: 0.48s;
}

tr:nth-child(17) {
    animation-delay: 0.51s;
}

tr:nth-child(18) {
    animation-delay: 0.54s;
}

tr:nth-child(19) {
    animation-delay: 0.57s;
}

tr:nth-child(20) {
    animation-delay: 0.6s;
}

tr:nth-child(21) {
    animation-delay: 0.63s;
}

tr:nth-child(22) {
    animation-delay: 0.66s;
}

tr:nth-child(23) {
    animation-delay: 0.69s;
}

tr:nth-child(24) {
    animation-delay: 0.72s;
}

tr:nth-child(25) {
    animation-delay: 0.75s;
}

tr:nth-child(26) {
    animation-delay: 0.78s;
}

tr:nth-child(27) {
    animation-delay: 0.81s;
}

tr:nth-child(28) {
    animation-delay: 0.84s;
}

tr:nth-child(29) {
    animation-delay: 0.87s;
}

tr:nth-child(30) {
    animation-delay: 0.9s;
}

/* Leaflet Map Overrides */
.leaflet-popup-content-wrapper {
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    overflow: hidden;
}

.leaflet-popup-content {
    margin: 0 !important;
    width: 240px !important;
}

.leaflet-popup-tip {
    background: var(--bg-card) !important;
    border: 1px solid var(--glass-border);
}

.premium-map-popup .leaflet-popup-content-wrapper {
    background: transparent;
    border-radius: 0.75rem;
    /* rounded-xl */
}