/**
 * SIMON CABDIS X — UNIFIED DESIGN SYSTEM
 * Philosophies: 70% Premium Minimalism | 20% Material Design 3 | 10% Bento UI
 * Dinas Pendidikan Provinsi Sumatera Utara — Cabang Dinas Wilayah X
 */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
    /* 1. Core Brand Colors (Gov Blue & Royal Elegance) */
    --color-brand-50: #eff6ff;
    --color-brand-100: #dbeafe;
    --color-brand-200: #bfdbfe;
    --color-brand-300: #93c5fd;
    --color-brand-400: #60a5fa;
    --color-brand-500: #3b82f6;
    --color-brand-600: #2563eb;
    --color-brand-700: #1d4ed8;
    --color-brand-800: #1e40af;
    --color-brand-900: #1e3a8a;
    --color-brand-950: #0f172a;

    /* 2. Neutral Surfaces (Clean, Luminous, Premium Canvas) */
    --bg-app: #f8fafc;
    --bg-surface: #ffffff;
    --bg-surface-elevated: #ffffff;
    --bg-surface-subtle: #f1f5f9;
    --border-subtle: #e2e8f0;
    --border-strong: #cbd5e1;
    --border-focus: #2563eb;

    /* 3. Text Colors (Strict High-Contrast Typography Hierarchy) */
    --text-primary: #0f172a;    /* 900 */
    --text-secondary: #334155;  /* 700 */
    --text-muted: #64748b;      /* 500 */
    --text-subtle: #94a3b8;     /* 400 */
    --text-inverse: #ffffff;

    /* 4. Semantic Status Colors */
    --status-success-bg: #ecfdf5;
    --status-success-border: #a7f3d0;
    --status-success-text: #065f46;
    --status-success-badge: #059669;

    --status-warning-bg: #fffbeb;
    --status-warning-border: #fde68a;
    --status-warning-text: #92400e;
    --status-warning-badge: #d97706;

    --status-danger-bg: #fff1f2;
    --status-danger-border: #fecdd3;
    --status-danger-text: #9f1239;
    --status-danger-badge: #e11d48;

    --status-info-bg: #f0f9ff;
    --status-info-border: #bae6fd;
    --status-info-text: #075985;
    --status-info-badge: #0284c7;

    --status-neutral-bg: #f8fafc;
    --status-neutral-border: #e2e8f0;
    --status-neutral-text: #475569;

    /* 5. Material Design 3 Shadows & Radii */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 24px;
    --radius-full: 9999px;

    --shadow-xs: 0 1px 2px 0 rgba(15, 23, 42, 0.04);
    --shadow-sm: 0 1px 3px 0 rgba(15, 23, 42, 0.06), 0 1px 2px -1px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 4px 12px -2px rgba(15, 23, 42, 0.06), 0 2px 6px -2px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 12px 28px -4px rgba(15, 23, 42, 0.08), 0 4px 12px -2px rgba(15, 23, 42, 0.03);
    --shadow-xl: 0 20px 40px -8px rgba(15, 23, 42, 0.12), 0 8px 16px -4px rgba(15, 23, 42, 0.04);
    --shadow-ambient: 0 0 0 1px rgba(15, 23, 42, 0.06), 0 2px 10px rgba(15, 23, 42, 0.03);

    /* 6. Transitions & Motion */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 200ms cubic-bezier(0.2, 0, 0, 1);
}

html.dark {
    /* 1. Dark Mode Neutral Surfaces */
    --bg-app: #090d16;
    --bg-surface: #0f172a;
    --bg-surface-elevated: #1e293b;
    --bg-surface-subtle: #1e293b;
    --border-subtle: #1e293b;
    --border-strong: #334155;
    --border-focus: #3b82f6;

    /* 2. Dark Mode Typography Hierarchy */
    --text-primary: #f8fafc;
    --text-secondary: #e2e8f0;
    --text-muted: #94a3b8;
    --text-subtle: #64748b;
    --text-inverse: #0f172a;

    /* 3. Dark Mode Semantic Badges */
    --status-success-bg: rgba(16, 185, 129, 0.15);
    --status-success-border: rgba(16, 185, 129, 0.3);
    --status-success-text: #34d399;

    --status-warning-bg: rgba(245, 158, 11, 0.15);
    --status-warning-border: rgba(245, 158, 11, 0.3);
    --status-warning-text: #fbbf24;

    --status-danger-bg: rgba(239, 68, 68, 0.15);
    --status-danger-border: rgba(239, 68, 68, 0.3);
    --status-danger-text: #f87171;

    --status-info-bg: rgba(59, 130, 246, 0.15);
    --status-info-border: rgba(59, 130, 246, 0.3);
    --status-info-text: #60a5fa;

    --status-neutral-bg: #1e293b;
    --status-neutral-border: #334155;
    --status-neutral-text: #cbd5e1;
}

/* Base resets & typography */
html {
    font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    letter-spacing: -0.011em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    background-color: var(--bg-app);
    color: var(--text-primary);
    min-height: 100vh;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ==========================================================================
   BENTO UI ARCHITECTURE (10% Focus on Key Stats, Summaries & Modular Grids)
   ========================================================================== */

.bento-container {
    display: grid;
    gap: 1.25rem;
}

.bento-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-xs);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
}

.bento-card:hover {
    border-color: #cbd5e1;
    box-shadow: var(--shadow-md);
}

.bento-card-interactive {
    cursor: pointer;
}
.bento-card-interactive:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Premium Dark Bento Hero */
.bento-hero {
    background: radial-gradient(120% 120% at 90% 10%, rgba(37, 99, 235, 0.16) 0%, rgba(15, 23, 42, 0) 60%),
                radial-gradient(100% 100% at 10% 90%, rgba(14, 165, 233, 0.12) 0%, rgba(15, 23, 42, 0) 50%),
                linear-gradient(145deg, #0f172a 0%, #1e293b 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    box-shadow: 0 16px 36px -8px rgba(15, 23, 42, 0.25);
}

.bento-hero .text-secondary {
    color: #94a3b8;
}

/* Bento Stat Tile */
.bento-stat-tile {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1.25rem;
    border-radius: var(--radius-lg);
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-xs);
    transition: all var(--transition-normal);
}

.bento-stat-tile:hover {
    border-color: #93c5fd;
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.bento-stat-value {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 800;
    font-size: 1.875rem;
    line-height: 2.25rem;
    letter-spacing: -0.03em;
    color: var(--text-primary);
}

.bento-stat-label {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

/* ==========================================================================
   MATERIAL DESIGN 3 (M3) INTERACTION TOKENS & COMPONENTS (20%)
   ========================================================================== */

/* M3 Elevated Surface Cards */
.m3-surface {
    background: var(--bg-surface);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-sm);
}

/* M3 Buttons */
.m3-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 0.625rem 1.125rem;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    outline: none;
    user-select: none;
    white-space: nowrap;
}

.m3-btn:focus-visible {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.35);
}

.m3-btn:active {
    transform: scale(0.98);
}

.m3-btn-primary {
    background-color: var(--color-brand-800);
    color: #ffffff;
    border: 1px solid transparent;
    box-shadow: 0 2px 6px rgba(30, 64, 175, 0.2);
}
.m3-btn-primary:hover {
    background-color: var(--color-brand-700);
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.3);
}

.m3-btn-secondary {
    background-color: #ffffff;
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-xs);
}
.m3-btn-secondary:hover {
    background-color: #f8fafc;
    border-color: #cbd5e1;
    color: var(--text-primary);
}

.m3-btn-tonal {
    background-color: var(--color-brand-50);
    color: var(--color-brand-800);
    border: 1px solid var(--color-brand-100);
}
.m3-btn-tonal:hover {
    background-color: var(--color-brand-100);
    color: var(--color-brand-900);
}

.m3-btn-danger {
    background-color: #e11d48;
    color: #ffffff;
    border: 1px solid transparent;
}
.m3-btn-danger:hover {
    background-color: #be123c;
}

/* M3 Form Inputs */
.m3-input, .m3-select, .m3-textarea {
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 0.8125rem;
    line-height: 1.25rem;
    color: var(--text-primary);
    background-color: #ffffff;
    border: 1.5px solid var(--border-subtle);
    border-radius: var(--radius-md);
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast);
}

.m3-input:focus, .m3-select:focus, .m3-textarea:focus {
    border-color: var(--color-brand-600);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
    background-color: #ffffff;
}

.m3-input::placeholder, .m3-textarea::placeholder {
    color: var(--text-subtle);
}

/* M3 Status Pills / Chips */
.m3-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-full);
    font-size: 0.6875rem;
    font-weight: 700;
    line-height: 1rem;
    letter-spacing: 0.02em;
    border: 1px solid transparent;
}

.m3-chip-success {
    background-color: var(--status-success-bg);
    color: var(--status-success-text);
    border-color: var(--status-success-border);
}
.m3-chip-warning {
    background-color: var(--status-warning-bg);
    color: var(--status-warning-text);
    border-color: var(--status-warning-border);
}
.m3-chip-danger {
    background-color: var(--status-danger-bg);
    color: var(--status-danger-text);
    border-color: var(--status-danger-border);
}
.m3-chip-info {
    background-color: var(--status-info-bg);
    color: var(--status-info-text);
    border-color: var(--status-info-border);
}
.m3-chip-neutral {
    background-color: var(--status-neutral-bg);
    color: var(--status-neutral-text);
    border-color: var(--status-neutral-border);
}

/* Dot indicator inside chips */
.m3-chip .dot {
    width: 0.4375rem;
    height: 0.4375rem;
    border-radius: 9999px;
    flex-shrink: 0;
}
.m3-chip-success .dot { background-color: var(--status-success-badge); }
.m3-chip-warning .dot { background-color: var(--status-warning-badge); }
.m3-chip-danger .dot { background-color: var(--status-danger-badge); }
.m3-chip-info .dot { background-color: var(--status-info-badge); }

/* ==========================================================================
   THEME-ADAPTIVE SIDEBAR (LIGHT & DARK VERSIONS)
   ========================================================================== */

/* 1. Base / Light Mode Sidebar (Slightly Darker Slate Tint for Glare-Free, High-Contrast UX) */
.sidebar-refined {
    background-color: #e9eef5 !important;
    border-right: 1px solid #cbd5e1 !important;
    box-shadow: 3px 0 12px 0 rgba(15, 23, 42, 0.04) !important;
    transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

/* Sidebar Brand Header Area */
.sidebar-brand-area {
    background-color: rgba(255, 255, 255, 0.45);
    border-bottom: 1px solid #cbd5e1;
}

/* Elevated Profile Card in Sidebar */
.sidebar-profile-card {
    background-color: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

/* Quick Filter Search Box */
.sidebar-search-input {
    background-color: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
}
.sidebar-search-input:focus {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
}

.nav-section-title {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #475569 !important;
    padding: 0.85rem 0.75rem 0.35rem;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.525rem 0.75rem;
    margin: 0.125rem 0;
    border-radius: 0.625rem;
    color: #334155;
    font-size: 0.775rem;
    font-weight: 600;
    transition: all var(--transition-fast);
    position: relative;
    border: 1px solid transparent;
}

.sidebar-nav-item svg {
    color: #64748b;
    transition: color var(--transition-fast);
}

.sidebar-nav-item:hover {
    color: #0f172a;
    background-color: #dbe4ef;
}

.sidebar-nav-item:hover svg {
    color: #1d4ed8;
}

/* Active State: Elevated White Card Pill with High Legibility & Tactile Feel */
.sidebar-nav-item.is-active {
    color: #1d4ed8 !important;
    font-weight: 700 !important;
    background-color: #ffffff !important;
    border: 1px solid #bfdbfe !important;
    box-shadow: 0 2px 6px -1px rgba(37, 99, 235, 0.14), 0 1px 3px rgba(15, 23, 42, 0.06) !important;
}

.sidebar-nav-item.is-active svg {
    color: #2563eb !important;
}

.sidebar-nav-item.is-active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 20%;
    bottom: 20%;
    width: 3.5px;
    border-radius: 0 4px 4px 0;
    background: #2563eb;
    box-shadow: 0 0 6px rgba(37, 99, 235, 0.5);
}

/* Sidebar Footer Action */
.sidebar-footer-area {
    background-color: rgba(255, 255, 255, 0.45);
    border-top: 1px solid #cbd5e1;
}

/* 2. Dark Mode Sidebar Overrides (html.dark) */
html.dark .sidebar-refined {
    background-color: #090d16 !important;
    border-right: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: none !important;
}

html.dark .sidebar-brand-area {
    background-color: transparent !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

html.dark .sidebar-profile-card {
    background-color: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    box-shadow: none !important;
}

html.dark .sidebar-search-input {
    background-color: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: #f1f5f9 !important;
}
html.dark .sidebar-search-input:focus {
    background-color: rgba(255, 255, 255, 0.09) !important;
    border-color: #3b82f6 !important;
}

html.dark .nav-section-title {
    color: #64748b !important;
}

html.dark .sidebar-nav-item {
    color: #94a3b8 !important;
}

html.dark .sidebar-nav-item svg {
    color: #64748b !important;
}

html.dark .sidebar-nav-item:hover {
    color: #ffffff !important;
    background-color: rgba(255, 255, 255, 0.07) !important;
}

html.dark .sidebar-nav-item:hover svg {
    color: #60a5fa !important;
}

html.dark .sidebar-nav-item.is-active {
    color: #ffffff !important;
    font-weight: 600 !important;
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.28) 0%, rgba(37, 99, 235, 0.1) 100%) !important;
    border: 1px solid rgba(59, 130, 246, 0.35) !important;
    box-shadow: inset 0 0 12px rgba(59, 130, 246, 0.15) !important;
}

html.dark .sidebar-nav-item.is-active svg {
    color: #3b82f6 !important;
}

html.dark .sidebar-nav-item.is-active::before {
    background: #3b82f6 !important;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.6) !important;
}

html.dark .sidebar-footer-area {
    background-color: rgba(0, 0, 0, 0.2) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
}

/* Glass Top Header */
.topbar-glass {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}

/* Minimalist Clean DataTable System */
div.dt-container {
    color: var(--text-primary);
    font-size: 0.8125rem;
}

div.dt-container div.dt-layout-row {
    padding: 0.875rem 1.125rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.875rem;
    font-size: 0.8125rem;
    background: #ffffff;
}

div.dt-container div.dt-layout-row:first-child {
    border-bottom: 1px solid var(--border-subtle);
    background: #f8fafc;
    border-top-left-radius: var(--radius-xl);
    border-top-right-radius: var(--radius-xl);
}

div.dt-container div.dt-layout-row:last-child {
    border-top: 1px solid var(--border-subtle);
    background: #f8fafc;
    border-bottom-left-radius: var(--radius-xl);
    border-bottom-right-radius: var(--radius-xl);
}

div.dt-container div.dt-search input {
    border: 1.5px solid var(--border-subtle) !important;
    border-radius: var(--radius-md) !important;
    padding: 0.45rem 0.85rem !important;
    font-size: 0.8125rem !important;
    outline: none;
    background: #ffffff !important;
    color: var(--text-primary) !important;
    transition: all var(--transition-fast);
}

div.dt-container div.dt-search input:focus {
    border-color: var(--color-brand-600) !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12) !important;
}

div.dt-container table.dataTable {
    border-collapse: separate !important;
    border-spacing: 0;
    width: 100% !important;
}

div.dt-container table.dataTable thead th {
    background: #f8fafc !important;
    color: var(--text-muted) !important;
    border-bottom: 1.5px solid var(--border-subtle) !important;
    border-top: none !important;
    padding: 0.875rem 1rem !important;
    font-size: 0.6875rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
}

div.dt-container table.dataTable tbody td {
    border-bottom: 1px solid #f1f5f9 !important;
    color: var(--text-primary) !important;
    font-size: 0.8125rem !important;
    padding: 0.875rem 1rem !important;
    vertical-align: middle;
}

div.dt-container table.dataTable tbody tr:hover {
    background: #f8fafc !important;
}

div.dt-container .dt-paging .dt-paging-button {
    min-width: 2.25rem;
    height: 2.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md) !important;
    font-size: 0.8125rem !important;
    margin: 0 0.15rem !important;
    border: 1px solid var(--border-subtle) !important;
    background: #ffffff !important;
    color: var(--text-secondary) !important;
    font-weight: 600 !important;
    transition: all var(--transition-fast);
}

div.dt-container .dt-paging .dt-paging-button.current {
    background: var(--color-brand-800) !important;
    color: #ffffff !important;
    border-color: var(--color-brand-800) !important;
    box-shadow: 0 2px 6px rgba(30, 64, 175, 0.25) !important;
}

div.dt-container .dt-paging .dt-paging-button:hover:not(.current) {
    background: #f1f5f9 !important;
    color: var(--text-primary) !important;
    border-color: #cbd5e1 !important;
}

/* Pulse animation utility */
@keyframes subtle-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.96); }
}
.animate-subtle-pulse {
    animation: subtle-pulse 2s infinite ease-in-out;
}

/* ==========================================================================
   COMPREHENSIVE DATATABLES STYLING (LIGHT & DARK THEMES)
   Completely resolves unreadable dropdown options, dark clashing selects,
   and unstyled pagination buttons across all tables in the app.
   ========================================================================== */

/* 1. LIGHT THEME DATATABLES (Active when NOT in dark mode) */
html:not(.dark) div.dt-container select.dt-input,
html:not(.dark) .dt-length select,
html:not(.dark) select.dt-input {
    background-color: #ffffff !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e") !important;
    background-position: right 0.65rem center !important;
    background-repeat: no-repeat !important;
    background-size: 1.25em 1.25em !important;
    color: #0f172a !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 0.625rem !important;
    padding: 0.4rem 2.25rem 0.4rem 0.85rem !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    color-scheme: light !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    cursor: pointer !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
}

html:not(.dark) div.dt-container select.dt-input:focus,
html:not(.dark) .dt-length select:focus {
    border-color: #2563eb !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
}

/* Explicit Light Mode Options styling: Fixes Windows Dark Mode browser option darkening */
html:not(.dark) div.dt-container select.dt-input option,
html:not(.dark) .dt-length select option,
html:not(.dark) select.dt-input option {
    background-color: #ffffff !important;
    color: #0f172a !important;
    padding: 8px 12px !important;
    font-size: 0.8125rem !important;
    font-weight: 500 !important;
}

html:not(.dark) div.dt-container input.dt-input,
html:not(.dark) .dt-search input {
    background-color: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 0.625rem !important;
    padding: 0.45rem 0.85rem !important;
    font-size: 0.75rem !important;
    color-scheme: light !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
}

html:not(.dark) div.dt-container input.dt-input:focus,
html:not(.dark) .dt-search input:focus {
    border-color: #2563eb !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
}

html:not(.dark) div.dt-container .dt-paging .dt-paging-button {
    background-color: #ffffff !important;
    color: #334155 !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 0.5rem !important;
    padding: 0.35rem 0.7rem !important;
    margin: 0 2px !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.04) !important;
    transition: all 0.15s ease !important;
    cursor: pointer !important;
}

html:not(.dark) div.dt-container .dt-paging .dt-paging-button:hover:not(.disabled) {
    background-color: #f1f5f9 !important;
    color: #0f172a !important;
    border-color: #cbd5e1 !important;
}

html:not(.dark) div.dt-container .dt-paging .dt-paging-button.current {
    background-color: #2563eb !important;
    color: #ffffff !important;
    border-color: #2563eb !important;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.25) !important;
}

html:not(.dark) div.dt-container .dt-paging .dt-paging-button.disabled {
    opacity: 0.4 !important;
    background-color: #f8fafc !important;
    color: #94a3b8 !important;
    border-color: #e2e8f0 !important;
    cursor: not-allowed !important;
}

html:not(.dark) div.dt-container .dt-info,
html:not(.dark) div.dt-container .dt-length label,
html:not(.dark) div.dt-container .dt-search label {
    color: #64748b !important;
    font-size: 0.75rem !important;
    font-weight: 500 !important;
}

html:not(.dark) table.dataTable,
html:not(.dark) div.dt-container table.dataTable {
    background-color: #ffffff !important;
    color: #0f172a !important;
    border-color: #e2e8f0 !important;
}

html:not(.dark) table.dataTable thead th,
html:not(.dark) div.dt-container table.dataTable thead th {
    background-color: #f8fafc !important;
    color: #475569 !important;
    border-bottom: 1.5px solid #e2e8f0 !important;
    border-top: none !important;
    font-size: 0.7rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
}

html:not(.dark) table.dataTable tbody td,
html:not(.dark) div.dt-container table.dataTable tbody td {
    background-color: #ffffff !important;
    color: #0f172a !important;
    border-bottom: 1px solid #f1f5f9 !important;
    box-shadow: none !important;
}

html:not(.dark) table.dataTable tbody tr:hover td,
html:not(.dark) div.dt-container table.dataTable tbody tr:hover td {
    background-color: #f8fafc !important;
}

/* 2. DARK THEME DATATABLES (Active when html.dark is present) */
html.dark div.dt-container select.dt-input,
html.dark .dt-length select,
html.dark select.dt-input {
    background-color: #1e293b !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%2394a3b8' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e") !important;
    background-position: right 0.65rem center !important;
    background-repeat: no-repeat !important;
    background-size: 1.25em 1.25em !important;
    color: #f8fafc !important;
    border: 1px solid #334155 !important;
    border-radius: 0.625rem !important;
    padding: 0.4rem 2.25rem 0.4rem 0.85rem !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    color-scheme: dark !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    cursor: pointer !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.3) !important;
}

html.dark div.dt-container select.dt-input:focus,
html.dark .dt-length select:focus {
    border-color: #3b82f6 !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25) !important;
}

/* Explicit Dark Mode Options styling */
html.dark div.dt-container select.dt-input option,
html.dark .dt-length select option,
html.dark select.dt-input option {
    background-color: #1e293b !important;
    color: #f8fafc !important;
    padding: 8px 12px !important;
    font-size: 0.8125rem !important;
    font-weight: 500 !important;
}

html.dark div.dt-container input.dt-input,
html.dark .dt-search input {
    background-color: #1e293b !important;
    color: #f8fafc !important;
    border: 1px solid #334155 !important;
    border-radius: 0.625rem !important;
    padding: 0.45rem 0.85rem !important;
    font-size: 0.75rem !important;
    color-scheme: dark !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.3) !important;
}

html.dark div.dt-container input.dt-input:focus,
html.dark .dt-search input:focus {
    border-color: #3b82f6 !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25) !important;
}

html.dark div.dt-container .dt-paging .dt-paging-button {
    background-color: #1e293b !important;
    color: #cbd5e1 !important;
    border: 1px solid #334155 !important;
    border-radius: 0.5rem !important;
    padding: 0.35rem 0.7rem !important;
    margin: 0 2px !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    transition: all 0.15s ease !important;
    cursor: pointer !important;
}

html.dark div.dt-container .dt-paging .dt-paging-button:hover:not(.disabled) {
    background-color: #334155 !important;
    color: #ffffff !important;
    border-color: #475569 !important;
}

html.dark div.dt-container .dt-paging .dt-paging-button.current {
    background-color: #3b82f6 !important;
    color: #ffffff !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3) !important;
}

html.dark div.dt-container .dt-paging .dt-paging-button.disabled {
    opacity: 0.35 !important;
    background-color: #0f172a !important;
    color: #64748b !important;
    border-color: #1e293b !important;
    cursor: not-allowed !important;
}

html.dark div.dt-container .dt-info,
html.dark div.dt-container .dt-length label,
html.dark div.dt-container .dt-search label {
    color: #94a3b8 !important;
    font-size: 0.75rem !important;
    font-weight: 500 !important;
}

html.dark table.dataTable,
html.dark div.dt-container table.dataTable {
    background-color: #0f172a !important;
    color: #f1f5f9 !important;
    border-color: #1e293b !important;
}

html.dark table.dataTable thead th,
html.dark div.dt-container table.dataTable thead th {
    background-color: #1e293b !important;
    color: #cbd5e1 !important;
    border-bottom: 1.5px solid #334155 !important;
    border-top: none !important;
    font-size: 0.7rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
}

html.dark table.dataTable tbody td,
html.dark div.dt-container table.dataTable tbody td {
    background-color: #0f172a !important;
    color: #f1f5f9 !important;
    border-bottom: 1px solid #1e293b !important;
    box-shadow: none !important;
}

html.dark table.dataTable tbody tr:hover td,
html.dark div.dt-container table.dataTable tbody tr:hover td {
    background-color: rgba(30, 41, 59, 0.8) !important;
}

/* ==========================================================================
   GLOBAL DARK MODE UI OVERRIDES (html.dark)
   Canvas, Cards, Headers, Dropdowns, and Form Elements
   ========================================================================== */

html.dark body {
    background-color: #090d16 !important;
    color: #f8fafc !important;
}

html.dark .app-shell {
    background: radial-gradient(circle at 95% -10%, rgba(37, 99, 235, 0.12), transparent 32rem), #090d16 !important;
}

html.dark .topbar-glass {
    background: rgba(9, 13, 22, 0.9) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

html.dark .bento-card,
html.dark .bento-stat-tile {
    background: #0f172a !important;
    border-color: #1e293b !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.4) !important;
}

html.dark .bento-card:hover,
html.dark .bento-stat-tile:hover {
    border-color: #334155 !important;
}

html.dark .bg-white {
    background-color: #0f172a !important;
}

html.dark .bg-slate-50 {
    background-color: #090d16 !important;
}

html.dark .bg-slate-100 {
    background-color: #1e293b !important;
}

html.dark .border-slate-200 {
    border-color: #1e293b !important;
}

html.dark .border-slate-100 {
    border-color: #1e293b !important;
}

html.dark .divide-slate-100 > :not([hidden]) ~ :not([hidden]),
html.dark .divide-slate-200 > :not([hidden]) ~ :not([hidden]) {
    border-color: #1e293b !important;
}

html.dark .text-slate-900 {
    color: #f8fafc !important;
}

html.dark .text-slate-800 {
    color: #f1f5f9 !important;
}

html.dark .text-slate-700 {
    color: #cbd5e1 !important;
}

html.dark .text-slate-600 {
    color: #94a3b8 !important;
}

html.dark .text-slate-500 {
    color: #64748b !important;
}

html.dark #notif-dropdown {
    background-color: #0f172a !important;
    border-color: #1e293b !important;
}

html.dark #notif-dropdown .bg-white {
    background-color: #0f172a !important;
}

html.dark #notif-dropdown .text-slate-900 {
    color: #f8fafc !important;
}

/* Form controls in Dark Mode */
html.dark input[type="text"]:not(#sidebar-module-filter),
html.dark input[type="date"],
html.dark input[type="time"],
html.dark input[type="email"],
html.dark input[type="password"],
html.dark input[type="number"],
html.dark input[type="search"]:not(.dt-input),
html.dark select:not(.dt-input),
html.dark textarea {
    background-color: #1e293b !important;
    color: #f8fafc !important;
    border-color: #334155 !important;
}

html.dark select:not(.dt-input) option {
    background-color: #1e293b !important;
    color: #f8fafc !important;
}

/* Bottom Nav in Dark Mode */
html.dark nav.md\:hidden {
    background-color: rgba(9, 13, 22, 0.95) !important;
    border-color: #1e293b !important;
}

/* Gauge progress stroke animation */
.gauge-ring-circle {
    transition: stroke-dashoffset 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
}

