/**
 * Sidebar Layout Styles
 * CSS cho layout với sidebar navigation (resizable)
 * Sử dụng: <link rel="stylesheet" href="public/css/sidebar-layout.css">
 */

/* ===== CSS Custom Properties ===== */
:root {
    --sidebar-width: 18rem; /* Khớp với MIN_WIDTH 288px trong JS */
    --sidebar-collapsed-width: 5rem;
    --sidebar-min-width: 18rem;
    --sidebar-max-width: 28rem;
    --system-footer-height: 2rem;
    --system-footer-mobile-height: 3.5rem;
    /* Easing curve mượt mà — decelerate khi dừng */
    --sidebar-ease: cubic-bezier(0.25, 0.8, 0.25, 1);
    --sidebar-duration: 0.28s;
    --sidebar-label-duration: 0.22s;
    --sidebar-transition: var(--sidebar-duration) var(--sidebar-ease);
}

/* ===== App Theme Tokens ===== */
html[data-theme="light"] {
    --theme-page-background: #f3f4f6;
    --theme-surface: #ffffff;
    --theme-surface-muted: #f9fafb;
    --theme-surface-strong: #f3f4f6;
    --theme-border: #e5e7eb;
    --theme-border-strong: #d1d5db;
    --theme-text: #111827;
    --theme-text-soft: #374151;
    --theme-text-muted: #6b7280;
    --theme-text-faint: #9ca3af;
    --theme-footer-bg: #1f2937;
    --theme-footer-text: #ffffff;
    --theme-input-bg: #ffffff;
    --theme-shadow: 0 20px 45px rgba(15, 23, 42, 0.12);
    --theme-accent-blue: #2563eb;
    --theme-accent-blue-rgb: 37, 99, 235;
    --theme-accent-indigo: #4f46e5;
    --theme-accent-indigo-rgb: 79, 70, 229;
    --theme-accent: var(--theme-accent-indigo);
    --theme-accent-rgb: var(--theme-accent-indigo-rgb);
    --theme-accent-soft: rgba(var(--theme-accent-indigo-rgb), 0.14);
    --theme-solid-indigo: #4f46e5;
    --theme-solid-indigo-hover: #4338ca;
    --theme-button-text: #ffffff;
    --theme-accent-teal: #0f766e;
    --theme-accent-teal-rgb: 15, 118, 110;
    --theme-accent-green: #16834a;
    --theme-accent-green-rgb: 22, 131, 74;
    --theme-accent-amber: #9a5b08;
    --theme-accent-amber-rgb: 154, 91, 8;
    --theme-accent-orange: #a84a0f;
    --theme-accent-orange-rgb: 168, 74, 15;
    --theme-accent-rose: #b8326b;
    --theme-accent-rose-rgb: 184, 50, 107;
    --theme-accent-red: #c2413d;
    --theme-accent-red-rgb: 194, 65, 61;
    --theme-accent-cyan: #06769a;
    --theme-accent-cyan-rgb: 6, 118, 154;
}

html[data-theme="dark"] {
    --theme-page-background: #09090b;
    --theme-surface: #18181b;
    --theme-surface-muted: #27272a;
    --theme-surface-hover: #27272a;
    --theme-surface-active: #3f3f46;
    --theme-surface-selected: #1e3a8a;
    --theme-surface-disabled: #18181b;
    --theme-surface-strong: #27272a;
    --theme-border: rgba(255, 255, 255, 0.08);
    --theme-border-strong: rgba(255, 255, 255, 0.15);
    --theme-text: #f9fafb;
    --theme-text-soft: #e5e7eb;
    --theme-text-muted: #9ca3af;
    --theme-text-faint: #6b7280;
    --theme-footer-bg: #09090b;
    --theme-footer-text: #f9fafb;
    --theme-input-bg: #18181b;
    --theme-accent: #818cf8;
    --theme-accent-rgb: var(--theme-accent-indigo-rgb);
    --theme-accent-soft: rgba(129, 140, 248, 0.15);
    --theme-focus-glow: 0 0 0 1px rgba(129, 140, 248, 0.3), 0 14px 32px rgba(0, 0, 0, 0.4);
    --theme-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -1px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);

    --theme-accent-blue: #9ec8ff;
    --theme-accent-blue-rgb: 158, 200, 255;
    --theme-accent-indigo: #c4b5fd;
    --theme-accent-indigo-rgb: 196, 181, 253;
    --theme-accent-teal: #7ddbd2;
    --theme-accent-teal-rgb: 125, 219, 210;
    --theme-accent-green: #97e5aa;
    --theme-accent-green-rgb: 151, 229, 170;
    --theme-accent-amber: #edc37d;
    --theme-accent-amber-rgb: 237, 195, 125;
    --theme-accent-orange: #eda96f;
    --theme-accent-orange-rgb: 237, 169, 111;
    --theme-accent-rose: #eea7c0;
    --theme-accent-rose-rgb: 238, 167, 192;
    --theme-accent-red: #ec9d95;
    --theme-accent-red-rgb: 236, 157, 149;
    --theme-accent-cyan: #8ad7e8;
    --theme-accent-cyan-rgb: 138, 215, 232;
    --theme-text-on-accent-muted: #edf2fb;

    --theme-gradient-blue-from: #386da7;
    --theme-gradient-blue-to: #4f8ac5;
    --theme-gradient-indigo-from: #595ba1;
    --theme-gradient-indigo-via: #715faf;
    --theme-gradient-indigo-to: #875fa8;
    --theme-gradient-teal-from: #2c8794;
    --theme-gradient-teal-to: #36a593;
    --theme-gradient-green-from: #438f64;
    --theme-gradient-green-to: #55aa76;
    --theme-gradient-amber-from: #9b6b37;
    --theme-gradient-amber-to: #bd7149;
    --theme-gradient-rose-from: #884a6d;
    --theme-gradient-rose-to: #ad5874;

    --theme-solid-blue: #4076ad;
    --theme-solid-blue-hover: #4c86c2;
    --theme-solid-indigo: #6359a0;
    --theme-solid-indigo-hover: #7466b8;
    --theme-button-text: #f8fafc;
    --theme-solid-teal: #347f83;
    --theme-solid-teal-hover: #3d9396;
    --theme-solid-green: #43855b;
    --theme-solid-green-hover: #509b6b;
    --theme-solid-amber: #986b3b;
    --theme-solid-amber-hover: #ae7a44;
    --theme-solid-rose: #894860;
    --theme-solid-rose-hover: #9d526e;

    --theme-sidebar-active-from: #545a9a;
    --theme-sidebar-active-to: #765fa3;
    --theme-sidebar-active-shadow: 0 14px 28px rgba(0, 0, 0, 0.22), inset 0 0 0 1px rgba(237, 242, 251, 0.16);
}

html[data-theme="glass"] {
    --theme-page-background: #f0f4f8 radial-gradient(circle at 15% 50%, rgba(138, 180, 248, 0.6) 0, transparent 50%), radial-gradient(circle at 85% 30%, rgba(252, 163, 219, 0.6) 0, transparent 50%), radial-gradient(circle at 50% 80%, rgba(138, 224, 185, 0.6) 0, transparent 50%), radial-gradient(circle at 50% 10%, rgba(216, 180, 254, 0.6) 0, transparent 50%);
    --theme-surface: rgba(255, 255, 255, 0.15);
    --theme-surface-muted: rgba(255, 255, 255, 0.08);
    --theme-surface-hover: rgba(255, 255, 255, 0.25);
    --theme-surface-active: rgba(255, 255, 255, 0.35);
    --theme-surface-selected: rgba(255, 255, 255, 0.40);
    --theme-surface-disabled: rgba(255, 255, 255, 0.05);
    --theme-surface-strong: rgba(255, 255, 255, 0.30);
    --theme-border: rgba(255, 255, 255, 0.2);
    --theme-border-strong: rgba(255, 255, 255, 0.4);
    --theme-text: #0b1220;
    --theme-text-soft: #1f2f45;
    --theme-text-muted: #405169;
    --theme-text-faint: #556274;
    --theme-footer-bg: rgba(255, 255, 255, 0.35);
    --theme-footer-text: #27364a;
    --theme-input-bg: rgba(255, 255, 255, 0.40);
    --theme-accent: #4f46e5;
    --theme-accent-rgb: var(--theme-accent-indigo-rgb);
    --theme-accent-soft: rgba(79, 70, 229, 0.14);
    --theme-focus-glow: 0 0 0 1px rgba(79, 70, 229, 0.26), 0 16px 42px rgba(79, 70, 229, 0.14);
    --theme-shadow: var(--theme-glass-shadow);

    --theme-accent-blue: #2563eb;
    --theme-accent-blue-rgb: 37, 99, 235;
    --theme-accent-indigo: #4f46e5;
    --theme-accent-indigo-rgb: 79, 70, 229;
    --theme-accent-teal: #0f766e;
    --theme-accent-teal-rgb: 15, 118, 110;
    --theme-accent-green: #16834a;
    --theme-accent-green-rgb: 22, 131, 74;
    --theme-accent-amber: #9a5b08;
    --theme-accent-amber-rgb: 154, 91, 8;
    --theme-accent-orange: #a84a0f;
    --theme-accent-orange-rgb: 168, 74, 15;
    --theme-accent-rose: #b8326b;
    --theme-accent-rose-rgb: 184, 50, 107;
    --theme-accent-red: #c2413d;
    --theme-accent-red-rgb: 194, 65, 61;
    --theme-accent-cyan: #06769a;
    --theme-accent-cyan-rgb: 6, 118, 154;
    --theme-text-on-accent-muted: #f8fafc;

    --theme-gradient-blue-from: rgba(37, 99, 235, 0.72);
    --theme-gradient-blue-to: rgba(14, 165, 233, 0.54);
    --theme-gradient-indigo-from: rgba(79, 70, 229, 0.64);
    --theme-gradient-indigo-via: rgba(124, 58, 237, 0.48);
    --theme-gradient-indigo-to: rgba(6, 118, 154, 0.42);
    --theme-gradient-teal-from: rgba(6, 118, 154, 0.58);
    --theme-gradient-teal-to: rgba(15, 118, 110, 0.48);
    --theme-gradient-green-from: rgba(22, 131, 74, 0.52);
    --theme-gradient-green-to: rgba(15, 118, 110, 0.42);
    --theme-gradient-amber-from: rgba(154, 91, 8, 0.50);
    --theme-gradient-amber-to: rgba(168, 74, 15, 0.42);
    --theme-gradient-rose-from: rgba(184, 50, 107, 0.52);
    --theme-gradient-rose-to: rgba(194, 65, 61, 0.40);

    --theme-solid-blue: rgba(37, 99, 235, 0.72);
    --theme-solid-blue-hover: rgba(37, 99, 235, 0.82);
    --theme-solid-indigo: rgba(79, 70, 229, 0.70);
    --theme-solid-indigo-hover: rgba(79, 70, 229, 0.82);
    --theme-button-text: #ffffff;
    --theme-solid-teal: rgba(15, 118, 110, 0.68);
    --theme-solid-teal-hover: rgba(15, 118, 110, 0.78);
    --theme-solid-green: rgba(22, 131, 74, 0.68);
    --theme-solid-green-hover: rgba(22, 131, 74, 0.78);
    --theme-solid-amber: rgba(154, 91, 8, 0.68);
    --theme-solid-amber-hover: rgba(154, 91, 8, 0.78);
    --theme-solid-rose: rgba(184, 50, 107, 0.68);
    --theme-solid-rose-hover: rgba(184, 50, 107, 0.78);

    --theme-sidebar-active-from: rgba(255, 255, 255, 0.74);
    --theme-sidebar-active-to: rgba(229, 238, 255, 0.54);
    --theme-sidebar-active-shadow: var(--theme-glass-shadow-selected);

    --theme-glass-bg: rgba(255, 255, 255, 0.15);
    --theme-glass-bg-muted: rgba(255, 255, 255, 0.08);
    --theme-glass-bg-elevated: rgba(255, 255, 255, 0.30);
    --theme-glass-bg-active: rgba(255, 255, 255, 0.40);
    --theme-glass-tint: rgba(255, 255, 255, 0.05);
    --theme-glass-tint-warm: rgba(255, 255, 255, 0.02);
    --theme-glass-border: rgba(255, 255, 255, 0.25);
    --theme-glass-border-strong: rgba(255, 255, 255, 0.45);
    --theme-glass-edge-highlight: inset 1px 1px 0 rgba(255, 255, 255, 0.7), inset -1px -1px 0 rgba(255, 255, 255, 0.1);
    --theme-glass-inner-highlight: inset 0 -1px 0 rgba(15, 23, 42, 0.02), inset 0 0 0 1px rgba(255, 255, 255, 0.15);
    --theme-glass-highlight: var(--theme-glass-edge-highlight), var(--theme-glass-inner-highlight);
    --theme-glass-reflection: linear-gradient(115deg, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0.05) 25%, rgba(255, 255, 255, 0) 50%, rgba(255, 255, 255, 0.05) 75%, rgba(255, 255, 255, 0.15) 100%);
    --theme-glass-material:
        var(--theme-glass-reflection),
        linear-gradient(145deg, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0.05) 100%);
    --theme-glass-material-muted:
        linear-gradient(145deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.05));
    --theme-glass-material-elevated:
        var(--theme-glass-reflection),
        linear-gradient(145deg, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0.2) 100%);
    --theme-glass-material-selected:
        var(--theme-glass-reflection),
        linear-gradient(145deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0.3) 100%);
    --theme-glass-shadow: 0 8px 32px rgba(31, 38, 135, 0.08);
    --theme-glass-shadow-elevated: 0 12px 40px rgba(31, 38, 135, 0.12);
    --theme-glass-shadow-selected: 0 12px 40px rgba(37, 99, 235, 0.12);
    --theme-glass-button-shadow: 0 4px 12px rgba(31, 38, 135, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.4);
    --glass-row-background:
        var(--theme-glass-reflection),
        linear-gradient(145deg, rgba(255, 255, 255, 0.74), rgba(255, 255, 255, 0.48)),
        linear-gradient(135deg, rgba(236, 243, 255, 0.20), rgba(255, 246, 232, 0.12));
    --glass-row-hover-bg:
        var(--theme-glass-reflection),
        linear-gradient(145deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.58)),
        linear-gradient(135deg, rgba(236, 243, 255, 0.30), rgba(255, 246, 232, 0.16));
    --glass-row-active-bg: var(--theme-glass-material-selected);
    --glass-row-border: rgba(104, 119, 143, 0.30);
    --glass-row-hover-border: rgba(79, 70, 229, 0.24);
    --glass-row-shadow: var(--theme-glass-highlight), 0 9px 22px rgba(45, 58, 82, 0.10), 0 1px 3px rgba(15, 23, 42, 0.07);
    --glass-row-hover-shadow: var(--theme-glass-highlight), 0 15px 34px rgba(45, 58, 82, 0.14), 0 3px 9px rgba(15, 23, 42, 0.07);
    --glass-button-secondary-bg:
        var(--theme-glass-reflection),
        linear-gradient(145deg, rgba(255, 255, 255, 0.76), rgba(255, 255, 255, 0.50)),
        linear-gradient(135deg, rgba(236, 243, 255, 0.26), rgba(255, 246, 232, 0.14));
    --glass-button-secondary-hover-bg:
        var(--theme-glass-reflection),
        linear-gradient(145deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.62)),
        linear-gradient(135deg, rgba(236, 243, 255, 0.34), rgba(255, 246, 232, 0.18));
    --glass-button-secondary-active-bg:
        linear-gradient(145deg, rgba(245, 249, 255, 0.78), rgba(255, 255, 255, 0.54)),
        linear-gradient(135deg, rgba(79, 70, 229, 0.08), rgba(37, 99, 235, 0.07));
    --glass-button-secondary-border: rgba(104, 119, 143, 0.34);
    --glass-button-secondary-text: #223249;
    --glass-button-danger-bg:
        var(--theme-glass-reflection),
        linear-gradient(145deg, rgba(255, 255, 255, 0.76), rgba(255, 246, 248, 0.54)),
        linear-gradient(135deg, rgba(var(--theme-accent-red-rgb), 0.15), rgba(var(--theme-accent-rose-rgb), 0.12));
    --glass-button-danger-hover-bg:
        var(--theme-glass-reflection),
        linear-gradient(145deg, rgba(255, 255, 255, 0.86), rgba(255, 242, 246, 0.62)),
        linear-gradient(135deg, rgba(var(--theme-accent-red-rgb), 0.20), rgba(var(--theme-accent-rose-rgb), 0.16));
    --glass-button-danger-border: rgba(var(--theme-accent-red-rgb), 0.30);
    --glass-button-danger-text: #a93232;
    --glass-input-bg:
        linear-gradient(145deg, rgba(255, 255, 255, 0.84), rgba(255, 255, 255, 0.60)),
        linear-gradient(135deg, rgba(236, 243, 255, 0.20), rgba(255, 246, 232, 0.10));
    --glass-input-border: rgba(92, 108, 133, 0.38);
    --glass-focus-ring: 0 0 0 3px rgba(79, 70, 229, 0.16), 0 0 0 1px rgba(79, 70, 229, 0.36), 0 12px 28px rgba(79, 70, 229, 0.12);
    --glass-hover-bg: var(--glass-row-hover-bg);
    --glass-active-bg: var(--glass-row-active-bg);
    --glass-disabled-opacity: 0.54;
    --theme-glass-blur: 30px;
    --theme-glass-blur-soft: 16px;
    --theme-glass-saturate: 1.5;
    --theme-glass-overlay: rgba(16, 24, 39, 0.20);
    --theme-glass-text-contrast: #0b1220;
    --theme-glass-stat-value: #0b1220;
    --theme-glass-stat-label: #26384f;
    --theme-glass-caption: #334155;
    --theme-glass-icon: #132033;
}

html[data-theme="dark"] body.logged-in {
    background: var(--theme-page-background) !important;
    color: var(--theme-text);
}

html[data-theme="glass"] body.logged-in {
    background: var(--theme-page-background) !important;
    background-attachment: fixed;
    color: var(--theme-text);
}

html.theme-ready:not([data-theme="light"]) body.logged-in,
html.theme-ready:not([data-theme="light"]) body.logged-in .bg-white:not(#sidebar):not([class*="bg-opacity-"]),
html.theme-ready:not([data-theme="light"]) body.logged-in .bg-gray-50,
html.theme-ready:not([data-theme="light"]) body.logged-in .bg-gray-100,
html.theme-ready:not([data-theme="light"]) body.logged-in .bg-gray-200,
html.theme-ready:not([data-theme="light"]) body.logged-in .bg-blue-50,
html.theme-ready:not([data-theme="light"]) body.logged-in .bg-blue-100,
html.theme-ready:not([data-theme="light"]) body.logged-in .bg-green-50,
html.theme-ready:not([data-theme="light"]) body.logged-in .bg-green-100,
html.theme-ready:not([data-theme="light"]) body.logged-in .bg-red-50,
html.theme-ready:not([data-theme="light"]) body.logged-in .bg-red-100,
html.theme-ready:not([data-theme="light"]) body.logged-in .bg-yellow-50,
html.theme-ready:not([data-theme="light"]) body.logged-in .bg-yellow-100,
html.theme-ready:not([data-theme="light"]) body.logged-in .bg-indigo-50,
html.theme-ready:not([data-theme="light"]) body.logged-in .bg-indigo-100,
html.theme-ready:not([data-theme="light"]) body.logged-in .bg-purple-50,
html.theme-ready:not([data-theme="light"]) body.logged-in .bg-purple-100,
html.theme-ready:not([data-theme="light"]) body.logged-in .bg-orange-50,
html.theme-ready:not([data-theme="light"]) body.logged-in .bg-orange-100,
html.theme-ready:not([data-theme="light"]) body.logged-in input,
html.theme-ready:not([data-theme="light"]) body.logged-in select,
html.theme-ready:not([data-theme="light"]) body.logged-in textarea {
    transition-property: background-color, color, border-color, box-shadow, transform, opacity, filter, -webkit-backdrop-filter, backdrop-filter;
    transition-duration: 180ms;
    transition-timing-function: ease;
}

html[data-theme="dark"] #sidebar,
html[data-theme="glass"] #sidebar,
html[data-theme="dark"] .bg-white:not([class*="bg-opacity-"]),
html[data-theme="glass"] .bg-white:not([class*="bg-opacity-"]) {
    background-color: var(--theme-surface) !important;
}

html[data-theme="glass"] #sidebar,
html[data-theme="glass"] .swal2-popup,
html[data-theme="glass"] .theme-glass-panel,
html[data-theme="glass"] .signature-card,
html[data-theme="glass"] .signature-info-group,
html[data-theme="glass"] .stat-hover-card {
    -webkit-backdrop-filter: blur(var(--theme-glass-blur)) saturate(var(--theme-glass-saturate));
    backdrop-filter: blur(var(--theme-glass-blur)) saturate(var(--theme-glass-saturate));
    box-shadow: var(--theme-shadow);
}

.theme-surface {
    background-color: var(--theme-surface) !important;
    color: var(--theme-text);
    border-color: var(--theme-border) !important;
}

.theme-surface-muted {
    background-color: var(--theme-surface-muted) !important;
    color: var(--theme-text-soft);
    border-color: var(--theme-border) !important;
}

.theme-text {
    color: var(--theme-text) !important;
}

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

.theme-text-faint {
    color: var(--theme-text-faint) !important;
}

.card-hover-lift {
    transform: translate3d(0, 0, 0) scale(1);
    transform-origin: center;
    transition:
        transform 220ms cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 220ms cubic-bezier(0.22, 1, 0.36, 1),
        border-color 180ms ease;
}

.card-hover-lift:hover,
.group:hover .card-hover-lift {
    transform: translate3d(0, -3px, 0) scale(1.018);
}

.card-hover-lift:active,
.group:active .card-hover-lift {
    transform: translate3d(0, -1px, 0) scale(1.01);
}

html[data-theme="dark"] .bg-gray-50,
html[data-theme="dark"] .bg-gray-100,
html[data-theme="dark"] .bg-gray-200,
html[data-theme="glass"] .bg-gray-50,
html[data-theme="glass"] .bg-gray-100,
html[data-theme="glass"] .bg-gray-200 {
    background-color: var(--theme-surface-muted) !important;
}

html[data-theme="dark"] .bg-gray-300,
html[data-theme="dark"] .bg-gray-400,
html[data-theme="dark"] .bg-gray-500,
html[data-theme="dark"] .bg-gray-600,
html[data-theme="glass"] .bg-gray-300,
html[data-theme="glass"] .bg-gray-400,
html[data-theme="glass"] .bg-gray-500,
html[data-theme="glass"] .bg-gray-600 {
    background-color: var(--theme-surface-strong) !important;
}

html[data-theme="dark"] .bg-gray-800,
html[data-theme="glass"] .bg-gray-800 {
    background-color: var(--theme-footer-bg) !important;
    color: var(--theme-footer-text) !important;
}

html[data-theme="dark"] .text-gray-900,
html[data-theme="dark"] .text-gray-800,
html[data-theme="glass"] .text-gray-900,
html[data-theme="glass"] .text-gray-800 {
    color: var(--theme-text) !important;
}

html[data-theme="dark"] .text-gray-700,
html[data-theme="dark"] .text-gray-600,
html[data-theme="glass"] .text-gray-700,
html[data-theme="glass"] .text-gray-600 {
    color: var(--theme-text-soft) !important;
}

html[data-theme="dark"] .text-gray-500,
html[data-theme="dark"] .text-gray-400,
html[data-theme="dark"] .text-gray-300,
html[data-theme="glass"] .text-gray-500,
html[data-theme="glass"] .text-gray-400,
html[data-theme="glass"] .text-gray-300 {
    color: var(--theme-text-muted) !important;
}

html[data-theme="dark"] .border-gray-100,
html[data-theme="dark"] .border-gray-200,
html[data-theme="dark"] .border-gray-300,
html[data-theme="glass"] .border-gray-100,
html[data-theme="glass"] .border-gray-200,
html[data-theme="glass"] .border-gray-300 {
    border-color: var(--theme-border) !important;
}

html[data-theme="dark"] .divide-gray-200 > :not([hidden]) ~ :not([hidden]),
html[data-theme="dark"] .divide-gray-300 > :not([hidden]) ~ :not([hidden]),
html[data-theme="glass"] .divide-gray-200 > :not([hidden]) ~ :not([hidden]),
html[data-theme="glass"] .divide-gray-300 > :not([hidden]) ~ :not([hidden]) {
    border-color: var(--theme-border) !important;
}

html[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]),
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="glass"] input:not([type="checkbox"]):not([type="radio"]),
html[data-theme="glass"] select,
html[data-theme="glass"] textarea {
    background-color: var(--theme-input-bg) !important;
    border-color: var(--theme-border-strong) !important;
    color: var(--theme-text) !important;
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder,
html[data-theme="glass"] input::placeholder,
html[data-theme="glass"] textarea::placeholder {
    color: var(--theme-text-faint) !important;
}

html[data-theme="dark"] .bg-blue-50,
html[data-theme="dark"] .bg-blue-100,
html[data-theme="dark"] .bg-blue-200 {
    background-color: rgba(var(--theme-accent-blue-rgb), 0.14) !important;
}

html[data-theme="dark"] .bg-sky-50,
html[data-theme="dark"] .bg-sky-100,
html[data-theme="dark"] .bg-sky-200 {
    background-color: rgba(var(--theme-accent-blue-rgb), 0.14) !important;
}

html[data-theme="dark"] .bg-indigo-50,
html[data-theme="dark"] .bg-indigo-100,
html[data-theme="dark"] .bg-indigo-200,
html[data-theme="dark"] .bg-purple-50,
html[data-theme="dark"] .bg-purple-100,
html[data-theme="dark"] .bg-purple-200,
html[data-theme="dark"] .bg-violet-50,
html[data-theme="dark"] .bg-violet-100,
html[data-theme="dark"] .bg-violet-200 {
    background-color: rgba(var(--theme-accent-indigo-rgb), 0.15) !important;
}

html[data-theme="dark"] .bg-green-50,
html[data-theme="dark"] .bg-green-100,
html[data-theme="dark"] .bg-green-200,
html[data-theme="dark"] .bg-emerald-50,
html[data-theme="dark"] .bg-emerald-100,
html[data-theme="dark"] .bg-emerald-200,
html[data-theme="dark"] .bg-teal-50,
html[data-theme="dark"] .bg-teal-100,
html[data-theme="dark"] .bg-teal-200 {
    background-color: rgba(var(--theme-accent-green-rgb), 0.14) !important;
}

html[data-theme="dark"] .bg-red-50,
html[data-theme="dark"] .bg-red-100,
html[data-theme="dark"] .bg-red-200,
html[data-theme="dark"] .bg-rose-50,
html[data-theme="dark"] .bg-rose-100,
html[data-theme="dark"] .bg-rose-200 {
    background-color: rgba(var(--theme-accent-rose-rgb), 0.14) !important;
}

html[data-theme="dark"] .bg-yellow-50,
html[data-theme="dark"] .bg-yellow-100,
html[data-theme="dark"] .bg-yellow-200,
html[data-theme="dark"] .bg-amber-50,
html[data-theme="dark"] .bg-amber-100,
html[data-theme="dark"] .bg-amber-200,
html[data-theme="dark"] .bg-orange-50,
html[data-theme="dark"] .bg-orange-100,
html[data-theme="dark"] .bg-orange-200 {
    background-color: rgba(var(--theme-accent-amber-rgb), 0.15) !important;
}

html[data-theme="dark"] .bg-cyan-50,
html[data-theme="dark"] .bg-cyan-100,
html[data-theme="dark"] .bg-cyan-200,
html[data-theme="dark"] .bg-pink-50,
html[data-theme="dark"] .bg-pink-100,
html[data-theme="dark"] .bg-pink-200 {
    background-color: rgba(var(--theme-accent-cyan-rgb), 0.14) !important;
}

html[data-theme="glass"] .bg-blue-50,
html[data-theme="glass"] .bg-blue-100,
html[data-theme="glass"] .bg-blue-200,
html[data-theme="glass"] .bg-sky-50,
html[data-theme="glass"] .bg-sky-100,
html[data-theme="glass"] .bg-sky-200,
html[data-theme="glass"] .bg-indigo-50,
html[data-theme="glass"] .bg-indigo-100,
html[data-theme="glass"] .bg-indigo-200,
html[data-theme="glass"] .bg-purple-50,
html[data-theme="glass"] .bg-purple-100,
html[data-theme="glass"] .bg-purple-200,
html[data-theme="glass"] .bg-violet-50,
html[data-theme="glass"] .bg-violet-100,
html[data-theme="glass"] .bg-violet-200,
html[data-theme="glass"] .bg-cyan-50,
html[data-theme="glass"] .bg-cyan-100,
html[data-theme="glass"] .bg-cyan-200 {
    background-color: rgba(255, 255, 255, 0.5) !important;
}

html[data-theme="glass"] .bg-green-50,
html[data-theme="glass"] .bg-green-100,
html[data-theme="glass"] .bg-green-200,
html[data-theme="glass"] .bg-emerald-50,
html[data-theme="glass"] .bg-emerald-100,
html[data-theme="glass"] .bg-emerald-200,
html[data-theme="glass"] .bg-teal-50,
html[data-theme="glass"] .bg-teal-100,
html[data-theme="glass"] .bg-teal-200,
html[data-theme="glass"] .bg-yellow-50,
html[data-theme="glass"] .bg-yellow-100,
html[data-theme="glass"] .bg-yellow-200,
html[data-theme="glass"] .bg-amber-50,
html[data-theme="glass"] .bg-amber-100,
html[data-theme="glass"] .bg-amber-200,
html[data-theme="glass"] .bg-orange-50,
html[data-theme="glass"] .bg-orange-100,
html[data-theme="glass"] .bg-orange-200,
html[data-theme="glass"] .bg-red-50,
html[data-theme="glass"] .bg-red-100,
html[data-theme="glass"] .bg-red-200,
html[data-theme="glass"] .bg-rose-50,
html[data-theme="glass"] .bg-rose-100,
html[data-theme="glass"] .bg-rose-200,
html[data-theme="glass"] .bg-pink-50,
html[data-theme="glass"] .bg-pink-100,
html[data-theme="glass"] .bg-pink-200 {
    background-color: rgba(255, 255, 255, 0.44) !important;
}

html[data-theme="dark"] .text-blue-500,
html[data-theme="dark"] .text-blue-600,
html[data-theme="dark"] .text-blue-700,
html[data-theme="dark"] .text-blue-800,
html[data-theme="dark"] .text-blue-900,
html[data-theme="dark"] .text-sky-500,
html[data-theme="dark"] .text-sky-600,
html[data-theme="dark"] .text-sky-700,
html[data-theme="dark"] .text-sky-800,
html[data-theme="dark"] .text-sky-900,
html[data-theme="dark"] .text-indigo-500,
html[data-theme="dark"] .text-indigo-600,
html[data-theme="dark"] .text-indigo-700,
html[data-theme="dark"] .text-indigo-800,
html[data-theme="dark"] .text-indigo-900,
html[data-theme="dark"] .text-purple-500,
html[data-theme="dark"] .text-purple-600,
html[data-theme="dark"] .text-purple-700,
html[data-theme="dark"] .text-purple-800,
html[data-theme="dark"] .text-purple-900,
html[data-theme="dark"] .text-violet-500,
html[data-theme="dark"] .text-violet-600,
html[data-theme="dark"] .text-violet-700,
html[data-theme="dark"] .text-violet-800,
html[data-theme="dark"] .text-violet-900 {
    color: var(--theme-accent-indigo) !important;
}

html[data-theme="dark"] .text-green-500,
html[data-theme="dark"] .text-green-600,
html[data-theme="dark"] .text-green-700,
html[data-theme="dark"] .text-green-800,
html[data-theme="dark"] .text-green-900,
html[data-theme="dark"] .text-emerald-500,
html[data-theme="dark"] .text-emerald-600,
html[data-theme="dark"] .text-emerald-700,
html[data-theme="dark"] .text-emerald-800,
html[data-theme="dark"] .text-emerald-900,
html[data-theme="dark"] .text-teal-500,
html[data-theme="dark"] .text-teal-600,
html[data-theme="dark"] .text-teal-700,
html[data-theme="dark"] .text-teal-800,
html[data-theme="dark"] .text-teal-900 {
    color: var(--theme-accent-teal) !important;
}

html[data-theme="dark"] .text-red-500,
html[data-theme="dark"] .text-red-600,
html[data-theme="dark"] .text-red-700,
html[data-theme="dark"] .text-red-800,
html[data-theme="dark"] .text-red-900,
html[data-theme="dark"] .text-rose-500,
html[data-theme="dark"] .text-rose-600,
html[data-theme="dark"] .text-rose-700,
html[data-theme="dark"] .text-rose-800,
html[data-theme="dark"] .text-rose-900 {
    color: var(--theme-accent-rose) !important;
}

html[data-theme="dark"] .text-yellow-500,
html[data-theme="dark"] .text-yellow-600,
html[data-theme="dark"] .text-yellow-700,
html[data-theme="dark"] .text-yellow-800,
html[data-theme="dark"] .text-yellow-900,
html[data-theme="dark"] .text-amber-500,
html[data-theme="dark"] .text-amber-600,
html[data-theme="dark"] .text-amber-700,
html[data-theme="dark"] .text-amber-800,
html[data-theme="dark"] .text-amber-900,
html[data-theme="dark"] .text-orange-500,
html[data-theme="dark"] .text-orange-600,
html[data-theme="dark"] .text-orange-700,
html[data-theme="dark"] .text-orange-800,
html[data-theme="dark"] .text-orange-900 {
    color: var(--theme-accent-amber) !important;
}

html[data-theme="dark"] .text-cyan-500,
html[data-theme="dark"] .text-cyan-600,
html[data-theme="dark"] .text-cyan-700,
html[data-theme="dark"] .text-cyan-800,
html[data-theme="dark"] .text-cyan-900,
html[data-theme="dark"] .text-pink-500,
html[data-theme="dark"] .text-pink-600,
html[data-theme="dark"] .text-pink-700,
html[data-theme="dark"] .text-pink-800,
html[data-theme="dark"] .text-pink-900 {
    color: var(--theme-accent-cyan) !important;
}

html[data-theme="dark"] [class*="hover:bg-gray-"]:hover {
    background-color: rgba(148, 163, 184, 0.14) !important;
}

html[data-theme="dark"] [class*="hover:bg-blue-"]:hover,
html[data-theme="dark"] [class*="hover:bg-indigo-"]:hover,
html[data-theme="dark"] [class*="hover:bg-purple-"]:hover,
html[data-theme="dark"] [class*="hover:bg-violet-"]:hover,
html[data-theme="dark"] [class*="hover:bg-cyan-"]:hover {
    background-color: rgba(var(--theme-accent-indigo-rgb), 0.14) !important;
}

html[data-theme="dark"] [class*="hover:bg-green-"]:hover,
html[data-theme="dark"] [class*="hover:bg-emerald-"]:hover,
html[data-theme="dark"] [class*="hover:bg-teal-"]:hover {
    background-color: rgba(var(--theme-accent-teal-rgb), 0.14) !important;
}

html[data-theme="dark"] [class*="hover:bg-red-"]:hover,
html[data-theme="dark"] [class*="hover:bg-rose-"]:hover {
    background-color: rgba(var(--theme-accent-rose-rgb), 0.14) !important;
}

html[data-theme="dark"] [class*="hover:bg-yellow-"]:hover,
html[data-theme="dark"] [class*="hover:bg-amber-"]:hover,
html[data-theme="dark"] [class*="hover:bg-orange-"]:hover {
    background-color: rgba(var(--theme-accent-amber-rgb), 0.15) !important;
}

html[data-theme="dark"] [class*="hover:text-blue-"]:hover,
html[data-theme="dark"] [class*="hover:text-indigo-"]:hover,
html[data-theme="dark"] [class*="hover:text-purple-"]:hover,
html[data-theme="dark"] [class*="hover:text-violet-"]:hover,
html[data-theme="dark"] [class*="hover:text-cyan-"]:hover {
    color: #bfdbfe !important;
}

html[data-theme="dark"] [class*="hover:text-green-"]:hover,
html[data-theme="dark"] [class*="hover:text-emerald-"]:hover,
html[data-theme="dark"] [class*="hover:text-teal-"]:hover {
    color: #bbf7d0 !important;
}

html[data-theme="dark"] [class*="hover:text-red-"]:hover,
html[data-theme="dark"] [class*="hover:text-rose-"]:hover {
    color: #fecaca !important;
}

html[data-theme="glass"] [class*="hover:bg-"]:hover {
    background-color: rgba(255, 255, 255, 0.66) !important;
}

html[data-theme="glass"] .border-white,
html[data-theme="glass"] .border-gray-100,
html[data-theme="glass"] .border-gray-200,
html[data-theme="glass"] .border-gray-300 {
    border-color: var(--theme-border) !important;
}

html[data-theme="dark"] .swal2-popup,
html[data-theme="glass"] .swal2-popup {
    background: var(--theme-surface) !important;
    color: var(--theme-text) !important;
    border: 1px solid var(--theme-border) !important;
}

/* ===== Dark Mode Component Coverage ===== */
html[data-theme="dark"] .main-content {
    color: var(--theme-text);
}

html[data-theme="dark"] #sidebar {
    border-right-color: var(--theme-border) !important;
}

html[data-theme="dark"] .with-sidebar-footer {
    background-color: var(--theme-footer-bg) !important;
    color: var(--theme-footer-text) !important;
}

html[data-theme="dark"] hr,
html[data-theme="dark"] .border,
html[data-theme="dark"] .border-t,
html[data-theme="dark"] .border-r,
html[data-theme="dark"] .border-b,
html[data-theme="dark"] .border-l {
    border-color: var(--theme-border) !important;
}

html[data-theme="dark"] .border-blue-200,
html[data-theme="dark"] .border-blue-300,
html[data-theme="dark"] .border-indigo-200,
html[data-theme="dark"] .border-indigo-300,
html[data-theme="dark"] .border-purple-200,
html[data-theme="dark"] .border-purple-300,
html[data-theme="dark"] .border-cyan-200,
html[data-theme="dark"] .border-cyan-300,
html[data-theme="dark"] .border-teal-200,
html[data-theme="dark"] .border-teal-300,
html[data-theme="dark"] .border-green-200,
html[data-theme="dark"] .border-green-300,
html[data-theme="dark"] .border-emerald-200,
html[data-theme="dark"] .border-emerald-300,
html[data-theme="dark"] .border-yellow-200,
html[data-theme="dark"] .border-yellow-300,
html[data-theme="dark"] .border-amber-200,
html[data-theme="dark"] .border-amber-300,
html[data-theme="dark"] .border-orange-200,
html[data-theme="dark"] .border-orange-300,
html[data-theme="dark"] .border-red-200,
html[data-theme="dark"] .border-red-300,
html[data-theme="dark"] .border-rose-200,
html[data-theme="dark"] .border-rose-300,
html[data-theme="dark"] .border-pink-200,
html[data-theme="dark"] .border-pink-300 {
    border-color: var(--theme-border-strong) !important;
}

html[data-theme="dark"] .border-blue-400,
html[data-theme="dark"] .border-blue-500,
html[data-theme="dark"] .border-cyan-400,
html[data-theme="dark"] .border-cyan-500 {
    border-color: rgba(var(--theme-accent-blue-rgb), 0.72) !important;
}

html[data-theme="dark"] .border-indigo-400,
html[data-theme="dark"] .border-indigo-500,
html[data-theme="dark"] .border-indigo-600,
html[data-theme="dark"] .border-purple-400,
html[data-theme="dark"] .border-purple-500,
html[data-theme="dark"] .border-violet-400,
html[data-theme="dark"] .border-violet-500 {
    border-color: rgba(var(--theme-accent-indigo-rgb), 0.70) !important;
}

html[data-theme="dark"] .border-green-400,
html[data-theme="dark"] .border-green-500,
html[data-theme="dark"] .border-emerald-400,
html[data-theme="dark"] .border-emerald-500,
html[data-theme="dark"] .border-teal-400,
html[data-theme="dark"] .border-teal-500 {
    border-color: rgba(var(--theme-accent-teal-rgb), 0.68) !important;
}

html[data-theme="dark"] .border-yellow-400,
html[data-theme="dark"] .border-yellow-500,
html[data-theme="dark"] .border-amber-400,
html[data-theme="dark"] .border-amber-500,
html[data-theme="dark"] .border-orange-400,
html[data-theme="dark"] .border-orange-500 {
    border-color: rgba(var(--theme-accent-amber-rgb), 0.70) !important;
}

html[data-theme="dark"] .border-red-400,
html[data-theme="dark"] .border-red-500,
html[data-theme="dark"] .border-rose-400,
html[data-theme="dark"] .border-rose-500,
html[data-theme="dark"] .border-pink-400,
html[data-theme="dark"] .border-pink-500 {
    border-color: rgba(var(--theme-accent-rose-rgb), 0.68) !important;
}

html[data-theme="dark"] .border-white {
    border-color: rgba(255, 255, 255, 0.18) !important;
}

html[data-theme="dark"] .shadow-sm,
html[data-theme="dark"] .shadow,
html[data-theme="dark"] .shadow-md,
html[data-theme="dark"] .shadow-lg,
html[data-theme="dark"] .shadow-xl,
html[data-theme="dark"] .shadow-2xl {
    box-shadow: var(--theme-shadow) !important;
}

html[data-theme="dark"] table {
    color: var(--theme-text-soft);
}

html[data-theme="dark"] thead,
html[data-theme="dark"] tfoot {
    background-color: var(--theme-surface-muted);
    color: var(--theme-text);
}

html[data-theme="dark"] tbody,
html[data-theme="dark"] tr {
    border-color: var(--theme-border) !important;
}

html[data-theme="dark"] th,
html[data-theme="dark"] td {
    border-color: var(--theme-border) !important;
}

html[data-theme="dark"] tr[class*="hover:bg-"]:hover,
html[data-theme="dark"] tbody tr:hover {
    background-color: rgba(148, 163, 184, 0.10) !important;
}

html[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]):disabled,
html[data-theme="dark"] select:disabled,
html[data-theme="dark"] textarea:disabled,
html[data-theme="dark"] button:disabled,
html[data-theme="dark"] .disabled,
html[data-theme="dark"] [aria-disabled="true"] {
    cursor: not-allowed;
    opacity: 0.62;
}

html[data-theme="dark"] input[readonly],
html[data-theme="dark"] textarea[readonly] {
    background-color: var(--theme-surface-muted) !important;
    color: var(--theme-text-muted) !important;
}

html[data-theme="dark"] input[type="checkbox"],
html[data-theme="dark"] input[type="radio"] {
    background-color: var(--theme-input-bg);
    border-color: var(--theme-border-strong);
    color: var(--theme-accent);
    accent-color: var(--theme-accent);
}

html[data-theme="dark"] input[type="checkbox"]:checked,
html[data-theme="dark"] input[type="radio"]:checked {
    background-color: var(--theme-solid-indigo);
    border-color: var(--theme-accent);
}

html[data-theme="dark"] option,
html[data-theme="dark"] optgroup {
    background-color: var(--theme-surface);
    color: var(--theme-text);
}

html[data-theme="dark"] input[type="file"]::file-selector-button {
    background-color: var(--theme-surface-strong);
    border: 1px solid var(--theme-border);
    color: var(--theme-text-soft);
}

html[data-theme="dark"] input[type="file"]::file-selector-button:hover {
    background-color: rgba(var(--theme-accent-indigo-rgb), 0.11);
    color: var(--theme-text);
}

html[data-theme="dark"] .placeholder-gray-400::placeholder,
html[data-theme="dark"] .placeholder-gray-500::placeholder {
    color: var(--theme-text-faint) !important;
}

html[data-theme="dark"] .focus\:ring-offset-2:focus,
html[data-theme="dark"] .focus\:ring-offset-1:focus {
    --tw-ring-offset-color: var(--theme-page-background) !important;
}

html[data-theme="dark"] .ring-gray-300,
html[data-theme="dark"] .ring-gray-200,
html[data-theme="dark"] .ring-1,
html[data-theme="dark"] .ring {
    --tw-ring-color: var(--theme-border-strong) !important;
}

html[data-theme="dark"] .bg-clip-text.text-transparent {
    filter: brightness(1.16) saturate(0.92);
}

html[data-theme="dark"] .bg-gray-600.bg-opacity-50,
html[data-theme="dark"] .bg-black.bg-opacity-50 {
    background-color: rgba(2, 6, 23, 0.76) !important;
}

html[data-theme="dark"] .bg-opacity-20,
html[data-theme="dark"] .bg-opacity-30,
html[data-theme="dark"] .bg-opacity-50 {
    border-color: rgba(255, 255, 255, 0.16);
}

html[data-theme="dark"] .from-indigo-50,
html[data-theme="dark"] .from-blue-50,
html[data-theme="dark"] .from-purple-50 {
    --tw-gradient-from: rgba(var(--theme-accent-indigo-rgb), 0.10) var(--tw-gradient-from-position) !important;
    --tw-gradient-to: rgba(var(--theme-accent-indigo-rgb), 0) var(--tw-gradient-to-position) !important;
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important;
}

html[data-theme="dark"] .from-green-50,
html[data-theme="dark"] .from-emerald-50,
html[data-theme="dark"] .from-teal-50 {
    --tw-gradient-from: rgba(var(--theme-accent-green-rgb), 0.09) var(--tw-gradient-from-position) !important;
    --tw-gradient-to: rgba(var(--theme-accent-green-rgb), 0) var(--tw-gradient-to-position) !important;
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important;
}

html[data-theme="dark"] .from-red-50,
html[data-theme="dark"] .from-rose-50 {
    --tw-gradient-from: rgba(var(--theme-accent-rose-rgb), 0.09) var(--tw-gradient-from-position) !important;
    --tw-gradient-to: rgba(var(--theme-accent-rose-rgb), 0) var(--tw-gradient-to-position) !important;
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important;
}

html[data-theme="dark"] .to-purple-50,
html[data-theme="dark"] .to-indigo-50,
html[data-theme="dark"] .to-blue-50 {
    --tw-gradient-to: rgba(var(--theme-accent-indigo-rgb), 0.09) var(--tw-gradient-to-position) !important;
}

html[data-theme="dark"] .to-green-50,
html[data-theme="dark"] .to-emerald-50,
html[data-theme="dark"] .to-teal-50 {
    --tw-gradient-to: rgba(var(--theme-accent-teal-rgb), 0.09) var(--tw-gradient-to-position) !important;
}

html[data-theme="dark"] .to-red-100,
html[data-theme="dark"] .to-red-50,
html[data-theme="dark"] .to-rose-50 {
    --tw-gradient-to: rgba(var(--theme-accent-rose-rgb), 0.09) var(--tw-gradient-to-position) !important;
}

html[data-theme="dark"] .absolute.bg-white,
html[data-theme="dark"] .relative.bg-white,
html[data-theme="dark"] [role="menu"],
html[data-theme="dark"] [role="listbox"] {
    background-color: var(--theme-surface) !important;
    border-color: var(--theme-border) !important;
    color: var(--theme-text) !important;
    box-shadow: var(--theme-shadow) !important;
}

html[data-theme="dark"] [role="menu"] a,
html[data-theme="dark"] [role="menu"] button,
html[data-theme="dark"] [role="listbox"] [role="option"] {
    color: var(--theme-text-soft) !important;
}

html[data-theme="dark"] [role="menu"] a:hover,
html[data-theme="dark"] [role="menu"] button:hover,
html[data-theme="dark"] [role="listbox"] [role="option"]:hover {
    background-color: rgba(var(--theme-accent-indigo-rgb), 0.10) !important;
    color: var(--theme-text) !important;
}

html[data-theme="dark"] .btn-secondary {
    background-color: var(--theme-surface-strong) !important;
    color: var(--theme-text-soft) !important;
}

html[data-theme="dark"] .btn-secondary:hover:not(:disabled) {
    background-color: rgba(148, 163, 184, 0.24) !important;
}

html[data-theme="dark"] .btn,
html[data-theme="dark"] button,
html[data-theme="dark"] a {
    -webkit-tap-highlight-color: rgba(var(--theme-accent-indigo-rgb), 0.16);
}

html[data-theme="dark"] .loading,
html[data-theme="dark"] [aria-busy="true"] {
    color: var(--theme-text-muted);
}

html[data-theme="dark"] .swal2-title,
html[data-theme="dark"] .swal2-html-container,
html[data-theme="dark"] .swal2-content,
html[data-theme="dark"] .swal2-footer {
    color: var(--theme-text) !important;
}

html[data-theme="dark"] .swal2-html-container {
    color: var(--theme-text-muted) !important;
}

html[data-theme="dark"] .swal2-input,
html[data-theme="dark"] .swal2-textarea,
html[data-theme="dark"] .swal2-select {
    background-color: var(--theme-input-bg) !important;
    border-color: var(--theme-border-strong) !important;
    color: var(--theme-text) !important;
}

html[data-theme="dark"] .swal2-validation-message {
    background-color: rgba(var(--theme-accent-red-rgb), 0.12) !important;
    color: var(--theme-accent-red) !important;
}

html[data-theme="dark"] .swal2-timer-progress-bar {
    background-color: var(--theme-accent) !important;
}

html[data-theme="dark"] .session-expired-title {
    color: var(--theme-text) !important;
}

html[data-theme="dark"] .session-expired-popup p,
html[data-theme="dark"] .session-expired-popup span {
    color: var(--theme-text-muted) !important;
}

html[data-theme="dark"] pre,
html[data-theme="dark"] code,
html[data-theme="dark"] kbd {
    background-color: var(--theme-surface-muted) !important;
    color: var(--theme-text-soft) !important;
    border-color: var(--theme-border) !important;
}

html[data-theme="dark"] .prose,
html[data-theme="dark"] .prose p,
html[data-theme="dark"] .prose li,
html[data-theme="dark"] .prose td,
html[data-theme="dark"] .prose th {
    color: var(--theme-text-soft) !important;
}

html[data-theme="dark"] .text-black {
    color: var(--theme-text) !important;
}

html[data-theme="dark"] .json-preview,
html[data-theme="dark"] .type-card,
html[data-theme="dark"] .template-card {
    background-color: var(--theme-surface-muted) !important;
    border-color: var(--theme-border) !important;
    color: var(--theme-text-soft) !important;
}

html[data-theme="dark"] .type-card:hover,
html[data-theme="dark"] .template-card:hover {
    background-color: var(--theme-surface-strong) !important;
}

html[data-theme="dark"] .type-card.selected {
    background: linear-gradient(135deg, var(--theme-surface-selected), var(--theme-surface-active)) !important;
    border-color: rgba(var(--theme-accent-indigo-rgb), 0.70) !important;
    box-shadow: 0 0 0 1px rgba(var(--theme-accent-indigo-rgb), 0.14), 0 14px 32px rgba(0, 0, 0, 0.28) !important;
}

html[data-theme="dark"] .template-card.selected {
    background: linear-gradient(135deg, var(--theme-surface-selected), var(--theme-surface-active)) !important;
    border-color: rgba(var(--theme-accent-green-rgb), 0.66) !important;
    box-shadow: 0 0 0 1px rgba(var(--theme-accent-green-rgb), 0.13), 0 14px 32px rgba(0, 0, 0, 0.28) !important;
}

html[data-theme="dark"] label[class*="has-[:checked]:bg-"] {
    background-color: var(--theme-surface-muted) !important;
    border-color: var(--theme-border) !important;
    color: var(--theme-text-soft) !important;
    box-shadow: none !important;
}

html[data-theme="dark"] label[class*="has-[:checked]:bg-"]:hover {
    background-color: var(--theme-surface-hover) !important;
    border-color: var(--theme-border-strong) !important;
}

html[data-theme="dark"] label[class*="has-[:checked]:bg-"] .text-gray-900,
html[data-theme="dark"] label[class*="has-[:checked]:bg-"] .font-medium {
    color: var(--theme-text) !important;
}

html[data-theme="dark"] label[class*="has-[:checked]:bg-"] .text-gray-500,
html[data-theme="dark"] label[class*="has-[:checked]:bg-"] .text-sm {
    color: var(--theme-text-muted) !important;
}

html[data-theme="dark"] label[class*="has-[:checked]:bg-"]:has(input[type="radio"]:checked),
html[data-theme="dark"] label[class*="has-[:checked]:bg-"]:has(input[type="checkbox"]:checked) {
    background: linear-gradient(135deg, var(--theme-surface-selected), var(--theme-surface-active)) !important;
    border-color: var(--theme-accent) !important;
    color: var(--theme-text) !important;
    box-shadow: var(--theme-focus-glow) !important;
}

html[data-theme="dark"] label[class*="has-[:checked]:border-blue"]:has(input:checked) {
    border-color: rgba(var(--theme-accent-blue-rgb), 0.72) !important;
    box-shadow:
        0 0 0 1px rgba(var(--theme-accent-blue-rgb), 0.16),
        0 14px 32px rgba(0, 0, 0, 0.26) !important;
}

html[data-theme="dark"] label[class*="has-[:checked]:border-green"]:has(input:checked) {
    border-color: rgba(var(--theme-accent-green-rgb), 0.68) !important;
    box-shadow:
        0 0 0 1px rgba(var(--theme-accent-green-rgb), 0.14),
        0 14px 32px rgba(0, 0, 0, 0.26) !important;
}

html[data-theme="dark"] label[class*="has-[:checked]:border-purple"]:has(input:checked) {
    border-color: rgba(var(--theme-accent-indigo-rgb), 0.70) !important;
    box-shadow:
        0 0 0 1px rgba(var(--theme-accent-indigo-rgb), 0.14),
        0 14px 32px rgba(0, 0, 0, 0.26) !important;
}

html[data-theme="dark"] label[class*="has-[:checked]:border-orange"]:has(input:checked) {
    border-color: rgba(var(--theme-accent-amber-rgb), 0.70) !important;
    box-shadow:
        0 0 0 1px rgba(var(--theme-accent-amber-rgb), 0.13),
        0 14px 32px rgba(0, 0, 0, 0.26) !important;
}

html[data-theme="dark"] label[class*="has-[:checked]:bg-"]:has(input:checked) .font-medium,
html[data-theme="dark"] label[class*="has-[:checked]:bg-"]:has(input:checked) .text-gray-900 {
    color: #f8fafc !important;
}

html[data-theme="dark"] label[class*="has-[:checked]:bg-"]:has(input:checked) .text-sm,
html[data-theme="dark"] label[class*="has-[:checked]:bg-"]:has(input:checked) .text-gray-500 {
    color: #cbd5e1 !important;
}

html[data-theme="dark"] label[class*="has-[:checked]:bg-"]:has(input:checked) .bg-blue-100 {
    background-color: rgba(var(--theme-accent-blue-rgb), 0.15) !important;
}

html[data-theme="dark"] label[class*="has-[:checked]:bg-"]:has(input:checked) .bg-green-100 {
    background-color: rgba(var(--theme-accent-green-rgb), 0.14) !important;
}

html[data-theme="dark"] label[class*="has-[:checked]:bg-"]:has(input:checked) .bg-purple-100 {
    background-color: rgba(var(--theme-accent-indigo-rgb), 0.14) !important;
}

html[data-theme="dark"] label[class*="has-[:checked]:bg-"]:has(input:checked) .bg-orange-100 {
    background-color: rgba(var(--theme-accent-amber-rgb), 0.15) !important;
}

html[data-theme="dark"] label[class*="has-[:checked]:border-blue"]:has(input:checked) svg {
    color: var(--theme-accent-blue) !important;
}

html[data-theme="dark"] label[class*="has-[:checked]:border-green"]:has(input:checked) svg {
    color: var(--theme-accent-green) !important;
}

html[data-theme="dark"] label[class*="has-[:checked]:border-purple"]:has(input:checked) svg {
    color: var(--theme-accent-indigo) !important;
}

html[data-theme="dark"] label[class*="has-[:checked]:border-orange"]:has(input:checked) svg {
    color: var(--theme-accent-amber) !important;
}

html[data-theme="dark"] body.logged-in label:has(input[name="export_type"]) {
    background-color: var(--theme-surface-muted) !important;
    border-color: var(--theme-border) !important;
    color: var(--theme-text-soft) !important;
    box-shadow: none !important;
}

html[data-theme="dark"] body.logged-in label:has(input[name="export_type"]):hover {
    background-color: var(--theme-surface-hover) !important;
    border-color: var(--theme-border-strong) !important;
}

html[data-theme="dark"] body.logged-in label:has(input[name="export_type"]):active {
    background-color: var(--theme-surface-active) !important;
}

html[data-theme="dark"] body.logged-in label:has(input[name="export_type"]) .font-medium {
    color: var(--theme-text) !important;
}

html[data-theme="dark"] body.logged-in label:has(input[name="export_type"]) .text-sm {
    color: var(--theme-text-muted) !important;
}

html[data-theme="dark"] body.logged-in label:has(input[name="export_type"]) .bg-blue-100 {
    background-color: rgba(var(--theme-accent-blue-rgb), 0.14) !important;
}

html[data-theme="dark"] body.logged-in label:has(input[name="export_type"]) .bg-green-100 {
    background-color: rgba(var(--theme-accent-green-rgb), 0.14) !important;
}

html[data-theme="dark"] body.logged-in label:has(input[name="export_type"]) .bg-purple-100 {
    background-color: rgba(var(--theme-accent-indigo-rgb), 0.15) !important;
}

html[data-theme="dark"] body.logged-in label:has(input[name="export_type"]) .bg-orange-100 {
    background-color: rgba(var(--theme-accent-amber-rgb), 0.15) !important;
}

html[data-theme="dark"] body.logged-in label:has(input[name="export_type"]:checked) {
    background: linear-gradient(135deg, var(--theme-surface-selected), var(--theme-surface-active)) !important;
    border-color: var(--theme-accent) !important;
    color: var(--theme-text) !important;
    box-shadow: var(--theme-focus-glow) !important;
}

html[data-theme="dark"] body.logged-in label:has(input[name="export_type"][value="incoming"]:checked) {
    border-color: rgba(var(--theme-accent-blue-rgb), 0.72) !important;
    box-shadow: 0 0 0 1px rgba(var(--theme-accent-blue-rgb), 0.16), 0 14px 32px rgba(0, 0, 0, 0.28) !important;
}

html[data-theme="dark"] body.logged-in label:has(input[name="export_type"][value="outgoing"]:checked) {
    border-color: rgba(var(--theme-accent-green-rgb), 0.68) !important;
    box-shadow: 0 0 0 1px rgba(var(--theme-accent-green-rgb), 0.14), 0 14px 32px rgba(0, 0, 0, 0.28) !important;
}

html[data-theme="dark"] body.logged-in label:has(input[name="export_type"][value="inheritance"]:checked) {
    border-color: rgba(var(--theme-accent-indigo-rgb), 0.70) !important;
    box-shadow: 0 0 0 1px rgba(var(--theme-accent-indigo-rgb), 0.14), 0 14px 32px rgba(0, 0, 0, 0.28) !important;
}

html[data-theme="dark"] body.logged-in label:has(input[name="export_type"][value="notarization"]:checked) {
    border-color: rgba(var(--theme-accent-amber-rgb), 0.70) !important;
    box-shadow: 0 0 0 1px rgba(var(--theme-accent-amber-rgb), 0.13), 0 14px 32px rgba(0, 0, 0, 0.28) !important;
}

html[data-theme="dark"] body.logged-in label:has(input[name="export_type"]:checked) .font-medium {
    color: #f8fafc !important;
}

html[data-theme="dark"] body.logged-in label:has(input[name="export_type"]:checked) .text-sm {
    color: #cbd5e1 !important;
}

html[data-theme="dark"] body.logged-in label:has(input[name="export_type"][value="incoming"]:checked) .bg-blue-100 {
    background-color: rgba(var(--theme-accent-blue-rgb), 0.20) !important;
}

html[data-theme="dark"] body.logged-in label:has(input[name="export_type"][value="outgoing"]:checked) .bg-green-100 {
    background-color: rgba(var(--theme-accent-green-rgb), 0.19) !important;
}

html[data-theme="dark"] body.logged-in label:has(input[name="export_type"][value="inheritance"]:checked) .bg-purple-100 {
    background-color: rgba(var(--theme-accent-indigo-rgb), 0.19) !important;
}

html[data-theme="dark"] body.logged-in label:has(input[name="export_type"][value="notarization"]:checked) .bg-orange-100 {
    background-color: rgba(var(--theme-accent-amber-rgb), 0.20) !important;
}

html[data-theme="dark"] body.logged-in label:has(input[name="export_type"]:checked) > .absolute svg {
    filter: drop-shadow(0 0 5px rgba(var(--theme-accent-indigo-rgb), 0.18));
}

html[data-theme="dark"] body.logged-in label:has(input[name="export_type"][value="incoming"]:checked) > .absolute svg {
    color: var(--theme-accent-blue) !important;
}

html[data-theme="dark"] body.logged-in label:has(input[name="export_type"][value="outgoing"]:checked) > .absolute svg {
    color: var(--theme-accent-green) !important;
}

html[data-theme="dark"] body.logged-in label:has(input[name="export_type"][value="inheritance"]:checked) > .absolute svg {
    color: var(--theme-accent-indigo) !important;
}

html[data-theme="dark"] body.logged-in label:has(input[name="export_type"][value="notarization"]:checked) > .absolute svg {
    color: var(--theme-accent-amber) !important;
}

/* ===== Dark Premium Accent Pass ===== */
html[data-theme="dark"] .bg-blue-50,
html[data-theme="dark"] .bg-blue-100,
html[data-theme="dark"] .bg-blue-200 {
    background-color: rgba(var(--theme-accent-blue-rgb), 0.14) !important;
}

html[data-theme="dark"] .bg-sky-50,
html[data-theme="dark"] .bg-sky-100,
html[data-theme="dark"] .bg-sky-200 {
    background-color: rgba(var(--theme-accent-blue-rgb), 0.14) !important;
}

html[data-theme="dark"] .bg-indigo-50,
html[data-theme="dark"] .bg-indigo-100,
html[data-theme="dark"] .bg-indigo-200,
html[data-theme="dark"] .bg-purple-50,
html[data-theme="dark"] .bg-purple-100,
html[data-theme="dark"] .bg-purple-200,
html[data-theme="dark"] .bg-violet-50,
html[data-theme="dark"] .bg-violet-100,
html[data-theme="dark"] .bg-violet-200 {
    background-color: rgba(var(--theme-accent-indigo-rgb), 0.15) !important;
}

html[data-theme="dark"] .bg-cyan-50,
html[data-theme="dark"] .bg-cyan-100,
html[data-theme="dark"] .bg-cyan-200,
html[data-theme="dark"] .bg-teal-50,
html[data-theme="dark"] .bg-teal-100,
html[data-theme="dark"] .bg-teal-200 {
    background-color: rgba(var(--theme-accent-teal-rgb), 0.14) !important;
}

html[data-theme="dark"] .bg-green-50,
html[data-theme="dark"] .bg-green-100,
html[data-theme="dark"] .bg-green-200,
html[data-theme="dark"] .bg-emerald-50,
html[data-theme="dark"] .bg-emerald-100,
html[data-theme="dark"] .bg-emerald-200 {
    background-color: rgba(var(--theme-accent-green-rgb), 0.14) !important;
}

html[data-theme="dark"] .bg-yellow-50,
html[data-theme="dark"] .bg-yellow-100,
html[data-theme="dark"] .bg-yellow-200,
html[data-theme="dark"] .bg-amber-50,
html[data-theme="dark"] .bg-amber-100,
html[data-theme="dark"] .bg-amber-200,
html[data-theme="dark"] .bg-orange-50,
html[data-theme="dark"] .bg-orange-100,
html[data-theme="dark"] .bg-orange-200 {
    background-color: rgba(var(--theme-accent-amber-rgb), 0.15) !important;
}

html[data-theme="dark"] .bg-red-50,
html[data-theme="dark"] .bg-red-100,
html[data-theme="dark"] .bg-red-200,
html[data-theme="dark"] .bg-rose-50,
html[data-theme="dark"] .bg-rose-100,
html[data-theme="dark"] .bg-rose-200,
html[data-theme="dark"] .bg-pink-50,
html[data-theme="dark"] .bg-pink-100,
html[data-theme="dark"] .bg-pink-200 {
    background-color: rgba(var(--theme-accent-rose-rgb), 0.14) !important;
}

html[data-theme="dark"] .bg-blue-500,
html[data-theme="dark"] .bg-blue-600,
html[data-theme="dark"] .bg-blue-700,
html[data-theme="dark"] .hover\:bg-blue-600:hover,
html[data-theme="dark"] .hover\:bg-blue-700:hover {
    background-color: var(--theme-solid-blue) !important;
}

html[data-theme="dark"] .bg-indigo-500,
html[data-theme="dark"] .bg-indigo-600,
html[data-theme="dark"] .bg-indigo-700,
html[data-theme="dark"] .bg-purple-500,
html[data-theme="dark"] .bg-purple-600,
html[data-theme="dark"] .bg-purple-700,
html[data-theme="dark"] .bg-violet-500,
html[data-theme="dark"] .bg-violet-600,
html[data-theme="dark"] .bg-violet-700,
html[data-theme="dark"] .hover\:bg-indigo-600:hover,
html[data-theme="dark"] .hover\:bg-indigo-700:hover,
html[data-theme="dark"] .hover\:bg-purple-600:hover,
html[data-theme="dark"] .hover\:bg-purple-700:hover {
    background-color: var(--theme-solid-indigo) !important;
}

html[data-theme="dark"] .bg-cyan-500,
html[data-theme="dark"] .bg-cyan-600,
html[data-theme="dark"] .bg-cyan-700,
html[data-theme="dark"] .bg-teal-500,
html[data-theme="dark"] .bg-teal-600,
html[data-theme="dark"] .bg-teal-700,
html[data-theme="dark"] .hover\:bg-cyan-600:hover,
html[data-theme="dark"] .hover\:bg-cyan-700:hover,
html[data-theme="dark"] .hover\:bg-teal-600:hover,
html[data-theme="dark"] .hover\:bg-teal-700:hover {
    background-color: var(--theme-solid-teal) !important;
}

html[data-theme="dark"] .bg-green-500,
html[data-theme="dark"] .bg-green-600,
html[data-theme="dark"] .bg-green-700,
html[data-theme="dark"] .bg-emerald-500,
html[data-theme="dark"] .bg-emerald-600,
html[data-theme="dark"] .bg-emerald-700,
html[data-theme="dark"] .hover\:bg-green-600:hover,
html[data-theme="dark"] .hover\:bg-green-700:hover,
html[data-theme="dark"] .hover\:bg-emerald-600:hover,
html[data-theme="dark"] .hover\:bg-emerald-700:hover {
    background-color: var(--theme-solid-green) !important;
}

html[data-theme="dark"] .bg-yellow-500,
html[data-theme="dark"] .bg-yellow-600,
html[data-theme="dark"] .bg-yellow-700,
html[data-theme="dark"] .bg-amber-500,
html[data-theme="dark"] .bg-amber-600,
html[data-theme="dark"] .bg-amber-700,
html[data-theme="dark"] .bg-orange-500,
html[data-theme="dark"] .bg-orange-600,
html[data-theme="dark"] .bg-orange-700,
html[data-theme="dark"] .hover\:bg-yellow-600:hover,
html[data-theme="dark"] .hover\:bg-yellow-700:hover,
html[data-theme="dark"] .hover\:bg-amber-600:hover,
html[data-theme="dark"] .hover\:bg-amber-700:hover,
html[data-theme="dark"] .hover\:bg-orange-600:hover,
html[data-theme="dark"] .hover\:bg-orange-700:hover {
    background-color: var(--theme-solid-amber) !important;
}

html[data-theme="dark"] .bg-red-500,
html[data-theme="dark"] .bg-red-600,
html[data-theme="dark"] .bg-red-700,
html[data-theme="dark"] .bg-rose-500,
html[data-theme="dark"] .bg-rose-600,
html[data-theme="dark"] .bg-rose-700,
html[data-theme="dark"] .bg-pink-500,
html[data-theme="dark"] .bg-pink-600,
html[data-theme="dark"] .bg-pink-700,
html[data-theme="dark"] .hover\:bg-red-600:hover,
html[data-theme="dark"] .hover\:bg-red-700:hover,
html[data-theme="dark"] .hover\:bg-rose-600:hover,
html[data-theme="dark"] .hover\:bg-rose-700:hover,
html[data-theme="dark"] .hover\:bg-pink-600:hover,
html[data-theme="dark"] .hover\:bg-pink-700:hover {
    background-color: var(--theme-solid-rose) !important;
}

html[data-theme="dark"] .hover\:bg-blue-600:hover,
html[data-theme="dark"] .hover\:bg-blue-700:hover {
    background-color: var(--theme-solid-blue-hover) !important;
}

html[data-theme="dark"] .hover\:bg-indigo-600:hover,
html[data-theme="dark"] .hover\:bg-indigo-700:hover,
html[data-theme="dark"] .hover\:bg-purple-600:hover,
html[data-theme="dark"] .hover\:bg-purple-700:hover {
    background-color: var(--theme-solid-indigo-hover) !important;
}

html[data-theme="dark"] .hover\:bg-cyan-600:hover,
html[data-theme="dark"] .hover\:bg-cyan-700:hover,
html[data-theme="dark"] .hover\:bg-teal-600:hover,
html[data-theme="dark"] .hover\:bg-teal-700:hover {
    background-color: var(--theme-solid-teal-hover) !important;
}

html[data-theme="dark"] .hover\:bg-green-600:hover,
html[data-theme="dark"] .hover\:bg-green-700:hover,
html[data-theme="dark"] .hover\:bg-emerald-600:hover,
html[data-theme="dark"] .hover\:bg-emerald-700:hover {
    background-color: var(--theme-solid-green-hover) !important;
}

html[data-theme="dark"] .hover\:bg-yellow-600:hover,
html[data-theme="dark"] .hover\:bg-yellow-700:hover,
html[data-theme="dark"] .hover\:bg-amber-600:hover,
html[data-theme="dark"] .hover\:bg-amber-700:hover,
html[data-theme="dark"] .hover\:bg-orange-600:hover,
html[data-theme="dark"] .hover\:bg-orange-700:hover {
    background-color: var(--theme-solid-amber-hover) !important;
}

html[data-theme="dark"] .hover\:bg-red-600:hover,
html[data-theme="dark"] .hover\:bg-red-700:hover,
html[data-theme="dark"] .hover\:bg-rose-600:hover,
html[data-theme="dark"] .hover\:bg-rose-700:hover,
html[data-theme="dark"] .hover\:bg-pink-600:hover,
html[data-theme="dark"] .hover\:bg-pink-700:hover {
    background-color: var(--theme-solid-rose-hover) !important;
}

html[data-theme="dark"] .text-blue-100,
html[data-theme="dark"] .text-blue-200,
html[data-theme="dark"] .text-indigo-100,
html[data-theme="dark"] .text-indigo-200,
html[data-theme="dark"] .text-purple-100,
html[data-theme="dark"] .text-purple-200,
html[data-theme="dark"] .text-cyan-100,
html[data-theme="dark"] .text-cyan-200,
html[data-theme="dark"] .text-teal-100,
html[data-theme="dark"] .text-teal-200,
html[data-theme="dark"] .text-green-100,
html[data-theme="dark"] .text-green-200,
html[data-theme="dark"] .text-yellow-100,
html[data-theme="dark"] .text-yellow-200,
html[data-theme="dark"] .text-amber-100,
html[data-theme="dark"] .text-amber-200,
html[data-theme="dark"] .text-orange-100,
html[data-theme="dark"] .text-orange-200,
html[data-theme="dark"] .text-rose-100,
html[data-theme="dark"] .text-rose-200,
html[data-theme="dark"] .text-pink-100,
html[data-theme="dark"] .text-pink-200 {
    color: rgba(216, 222, 235, 0.78) !important;
}

html[data-theme="dark"] .text-blue-500,
html[data-theme="dark"] .text-blue-600,
html[data-theme="dark"] .text-blue-700,
html[data-theme="dark"] .text-blue-800,
html[data-theme="dark"] .text-blue-900,
html[data-theme="dark"] [class*="hover:text-blue-"]:hover {
    color: var(--theme-accent-blue) !important;
}

html[data-theme="dark"] .text-indigo-500,
html[data-theme="dark"] .text-indigo-600,
html[data-theme="dark"] .text-indigo-700,
html[data-theme="dark"] .text-indigo-800,
html[data-theme="dark"] .text-indigo-900,
html[data-theme="dark"] .text-purple-500,
html[data-theme="dark"] .text-purple-600,
html[data-theme="dark"] .text-purple-700,
html[data-theme="dark"] .text-purple-800,
html[data-theme="dark"] .text-purple-900,
html[data-theme="dark"] .text-violet-500,
html[data-theme="dark"] .text-violet-600,
html[data-theme="dark"] .text-violet-700,
html[data-theme="dark"] .text-violet-800,
html[data-theme="dark"] .text-violet-900,
html[data-theme="dark"] [class*="hover:text-indigo-"]:hover,
html[data-theme="dark"] [class*="hover:text-purple-"]:hover,
html[data-theme="dark"] [class*="hover:text-violet-"]:hover {
    color: var(--theme-accent-indigo) !important;
}

html[data-theme="dark"] .text-cyan-500,
html[data-theme="dark"] .text-cyan-600,
html[data-theme="dark"] .text-cyan-700,
html[data-theme="dark"] .text-cyan-800,
html[data-theme="dark"] .text-cyan-900,
html[data-theme="dark"] .text-teal-500,
html[data-theme="dark"] .text-teal-600,
html[data-theme="dark"] .text-teal-700,
html[data-theme="dark"] .text-teal-800,
html[data-theme="dark"] .text-teal-900,
html[data-theme="dark"] [class*="hover:text-cyan-"]:hover,
html[data-theme="dark"] [class*="hover:text-teal-"]:hover {
    color: var(--theme-accent-teal) !important;
}

html[data-theme="dark"] .text-green-500,
html[data-theme="dark"] .text-green-600,
html[data-theme="dark"] .text-green-700,
html[data-theme="dark"] .text-green-800,
html[data-theme="dark"] .text-green-900,
html[data-theme="dark"] .text-emerald-500,
html[data-theme="dark"] .text-emerald-600,
html[data-theme="dark"] .text-emerald-700,
html[data-theme="dark"] .text-emerald-800,
html[data-theme="dark"] .text-emerald-900,
html[data-theme="dark"] [class*="hover:text-green-"]:hover,
html[data-theme="dark"] [class*="hover:text-emerald-"]:hover {
    color: var(--theme-accent-green) !important;
}

html[data-theme="dark"] .text-yellow-500,
html[data-theme="dark"] .text-yellow-600,
html[data-theme="dark"] .text-yellow-700,
html[data-theme="dark"] .text-yellow-800,
html[data-theme="dark"] .text-yellow-900,
html[data-theme="dark"] .text-amber-500,
html[data-theme="dark"] .text-amber-600,
html[data-theme="dark"] .text-amber-700,
html[data-theme="dark"] .text-amber-800,
html[data-theme="dark"] .text-amber-900,
html[data-theme="dark"] .text-orange-500,
html[data-theme="dark"] .text-orange-600,
html[data-theme="dark"] .text-orange-700,
html[data-theme="dark"] .text-orange-800,
html[data-theme="dark"] .text-orange-900,
html[data-theme="dark"] [class*="hover:text-yellow-"]:hover,
html[data-theme="dark"] [class*="hover:text-amber-"]:hover,
html[data-theme="dark"] [class*="hover:text-orange-"]:hover {
    color: var(--theme-accent-amber) !important;
}

html[data-theme="dark"] .text-red-500,
html[data-theme="dark"] .text-red-600,
html[data-theme="dark"] .text-red-700,
html[data-theme="dark"] .text-red-800,
html[data-theme="dark"] .text-red-900,
html[data-theme="dark"] .text-rose-500,
html[data-theme="dark"] .text-rose-600,
html[data-theme="dark"] .text-rose-700,
html[data-theme="dark"] .text-rose-800,
html[data-theme="dark"] .text-rose-900,
html[data-theme="dark"] .text-pink-500,
html[data-theme="dark"] .text-pink-600,
html[data-theme="dark"] .text-pink-700,
html[data-theme="dark"] .text-pink-800,
html[data-theme="dark"] .text-pink-900,
html[data-theme="dark"] [class*="hover:text-red-"]:hover,
html[data-theme="dark"] [class*="hover:text-rose-"]:hover,
html[data-theme="dark"] [class*="hover:text-pink-"]:hover {
    color: var(--theme-accent-rose) !important;
}

html[data-theme="dark"] .from-blue-400,
html[data-theme="dark"] .from-blue-500,
html[data-theme="dark"] .from-blue-600,
html[data-theme="dark"] .from-blue-700,
html[data-theme="dark"] .hover\:from-blue-600:hover,
html[data-theme="dark"] .hover\:from-blue-700:hover {
    --tw-gradient-from: var(--theme-gradient-blue-from) var(--tw-gradient-from-position) !important;
    --tw-gradient-to: rgba(40, 60, 99, 0) var(--tw-gradient-to-position) !important;
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important;
}

html[data-theme="dark"] .to-blue-400,
html[data-theme="dark"] .to-blue-500,
html[data-theme="dark"] .to-blue-600,
html[data-theme="dark"] .to-blue-700,
html[data-theme="dark"] .hover\:to-blue-600:hover,
html[data-theme="dark"] .hover\:to-blue-700:hover {
    --tw-gradient-to: var(--theme-gradient-blue-to) var(--tw-gradient-to-position) !important;
}

html[data-theme="dark"] .via-blue-400,
html[data-theme="dark"] .via-blue-500,
html[data-theme="dark"] .via-blue-600,
html[data-theme="dark"] .via-blue-700 {
    --tw-gradient-to: rgba(48, 76, 115, 0) var(--tw-gradient-to-position) !important;
    --tw-gradient-stops: var(--tw-gradient-from), var(--theme-gradient-blue-to) var(--tw-gradient-via-position), var(--tw-gradient-to) !important;
}

html[data-theme="dark"] .from-indigo-400,
html[data-theme="dark"] .from-indigo-500,
html[data-theme="dark"] .from-indigo-600,
html[data-theme="dark"] .from-indigo-700,
html[data-theme="dark"] .from-purple-400,
html[data-theme="dark"] .from-purple-500,
html[data-theme="dark"] .from-purple-600,
html[data-theme="dark"] .from-purple-700,
html[data-theme="dark"] .from-violet-400,
html[data-theme="dark"] .from-violet-500,
html[data-theme="dark"] .from-violet-600,
html[data-theme="dark"] .from-violet-700,
html[data-theme="dark"] .hover\:from-indigo-600:hover,
html[data-theme="dark"] .hover\:from-indigo-700:hover,
html[data-theme="dark"] .hover\:from-purple-600:hover,
html[data-theme="dark"] .hover\:from-purple-700:hover {
    --tw-gradient-from: var(--theme-gradient-indigo-from) var(--tw-gradient-from-position) !important;
    --tw-gradient-to: rgba(52, 54, 93, 0) var(--tw-gradient-to-position) !important;
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important;
}

html[data-theme="dark"] .to-indigo-400,
html[data-theme="dark"] .to-indigo-500,
html[data-theme="dark"] .to-indigo-600,
html[data-theme="dark"] .to-indigo-700,
html[data-theme="dark"] .to-purple-400,
html[data-theme="dark"] .to-purple-500,
html[data-theme="dark"] .to-purple-600,
html[data-theme="dark"] .to-purple-700,
html[data-theme="dark"] .to-violet-400,
html[data-theme="dark"] .to-violet-500,
html[data-theme="dark"] .to-violet-600,
html[data-theme="dark"] .to-violet-700,
html[data-theme="dark"] .hover\:to-indigo-600:hover,
html[data-theme="dark"] .hover\:to-indigo-700:hover,
html[data-theme="dark"] .hover\:to-purple-600:hover,
html[data-theme="dark"] .hover\:to-purple-700:hover {
    --tw-gradient-to: var(--theme-gradient-indigo-to) var(--tw-gradient-to-position) !important;
}

html[data-theme="dark"] .via-indigo-400,
html[data-theme="dark"] .via-indigo-500,
html[data-theme="dark"] .via-indigo-600,
html[data-theme="dark"] .via-indigo-700,
html[data-theme="dark"] .via-purple-400,
html[data-theme="dark"] .via-purple-500,
html[data-theme="dark"] .via-purple-600,
html[data-theme="dark"] .via-purple-700 {
    --tw-gradient-to: rgba(63, 56, 95, 0) var(--tw-gradient-to-position) !important;
    --tw-gradient-stops: var(--tw-gradient-from), var(--theme-gradient-indigo-via) var(--tw-gradient-via-position), var(--tw-gradient-to) !important;
}

html[data-theme="dark"] .from-cyan-400,
html[data-theme="dark"] .from-cyan-500,
html[data-theme="dark"] .from-cyan-600,
html[data-theme="dark"] .from-cyan-700,
html[data-theme="dark"] .from-teal-400,
html[data-theme="dark"] .from-teal-500,
html[data-theme="dark"] .from-teal-600,
html[data-theme="dark"] .from-teal-700,
html[data-theme="dark"] .hover\:from-cyan-600:hover,
html[data-theme="dark"] .hover\:from-teal-600:hover {
    --tw-gradient-from: var(--theme-gradient-teal-from) var(--tw-gradient-from-position) !important;
    --tw-gradient-to: rgba(35, 77, 86, 0) var(--tw-gradient-to-position) !important;
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important;
}

html[data-theme="dark"] .to-cyan-400,
html[data-theme="dark"] .to-cyan-500,
html[data-theme="dark"] .to-cyan-600,
html[data-theme="dark"] .to-cyan-700,
html[data-theme="dark"] .to-teal-400,
html[data-theme="dark"] .to-teal-500,
html[data-theme="dark"] .to-teal-600,
html[data-theme="dark"] .to-teal-700,
html[data-theme="dark"] .hover\:to-cyan-600:hover,
html[data-theme="dark"] .hover\:to-teal-600:hover {
    --tw-gradient-to: var(--theme-gradient-teal-to) var(--tw-gradient-to-position) !important;
}

html[data-theme="dark"] .from-green-400,
html[data-theme="dark"] .from-green-500,
html[data-theme="dark"] .from-green-600,
html[data-theme="dark"] .from-green-700,
html[data-theme="dark"] .from-emerald-400,
html[data-theme="dark"] .from-emerald-500,
html[data-theme="dark"] .from-emerald-600,
html[data-theme="dark"] .from-emerald-700,
html[data-theme="dark"] .hover\:from-green-600:hover,
html[data-theme="dark"] .hover\:from-emerald-600:hover {
    --tw-gradient-from: var(--theme-gradient-green-from) var(--tw-gradient-from-position) !important;
    --tw-gradient-to: rgba(45, 81, 64, 0) var(--tw-gradient-to-position) !important;
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important;
}

html[data-theme="dark"] .to-green-400,
html[data-theme="dark"] .to-green-500,
html[data-theme="dark"] .to-green-600,
html[data-theme="dark"] .to-green-700,
html[data-theme="dark"] .to-emerald-400,
html[data-theme="dark"] .to-emerald-500,
html[data-theme="dark"] .to-emerald-600,
html[data-theme="dark"] .to-emerald-700,
html[data-theme="dark"] .hover\:to-green-600:hover,
html[data-theme="dark"] .hover\:to-emerald-600:hover {
    --tw-gradient-to: var(--theme-gradient-green-to) var(--tw-gradient-to-position) !important;
}

html[data-theme="dark"] .from-yellow-400,
html[data-theme="dark"] .from-yellow-500,
html[data-theme="dark"] .from-yellow-600,
html[data-theme="dark"] .from-yellow-700,
html[data-theme="dark"] .from-amber-400,
html[data-theme="dark"] .from-amber-500,
html[data-theme="dark"] .from-amber-600,
html[data-theme="dark"] .from-amber-700,
html[data-theme="dark"] .from-orange-400,
html[data-theme="dark"] .from-orange-500,
html[data-theme="dark"] .from-orange-600,
html[data-theme="dark"] .from-orange-700,
html[data-theme="dark"] .hover\:from-yellow-600:hover,
html[data-theme="dark"] .hover\:from-amber-600:hover,
html[data-theme="dark"] .hover\:from-orange-600:hover {
    --tw-gradient-from: var(--theme-gradient-amber-from) var(--tw-gradient-from-position) !important;
    --tw-gradient-to: rgba(104, 73, 40, 0) var(--tw-gradient-to-position) !important;
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important;
}

html[data-theme="dark"] .to-yellow-400,
html[data-theme="dark"] .to-yellow-500,
html[data-theme="dark"] .to-yellow-600,
html[data-theme="dark"] .to-yellow-700,
html[data-theme="dark"] .to-amber-400,
html[data-theme="dark"] .to-amber-500,
html[data-theme="dark"] .to-amber-600,
html[data-theme="dark"] .to-amber-700,
html[data-theme="dark"] .to-orange-400,
html[data-theme="dark"] .to-orange-500,
html[data-theme="dark"] .to-orange-600,
html[data-theme="dark"] .to-orange-700,
html[data-theme="dark"] .to-red-400,
html[data-theme="dark"] .to-red-500,
html[data-theme="dark"] .to-red-600,
html[data-theme="dark"] .to-red-700,
html[data-theme="dark"] .hover\:to-yellow-600:hover,
html[data-theme="dark"] .hover\:to-amber-600:hover,
html[data-theme="dark"] .hover\:to-orange-600:hover,
html[data-theme="dark"] .hover\:to-red-600:hover {
    --tw-gradient-to: var(--theme-gradient-amber-to) var(--tw-gradient-to-position) !important;
}

html[data-theme="dark"] .from-red-400,
html[data-theme="dark"] .from-red-500,
html[data-theme="dark"] .from-red-600,
html[data-theme="dark"] .from-red-700,
html[data-theme="dark"] .from-rose-400,
html[data-theme="dark"] .from-rose-500,
html[data-theme="dark"] .from-rose-600,
html[data-theme="dark"] .from-rose-700,
html[data-theme="dark"] .from-pink-400,
html[data-theme="dark"] .from-pink-500,
html[data-theme="dark"] .from-pink-600,
html[data-theme="dark"] .from-pink-700,
html[data-theme="dark"] .hover\:from-red-600:hover,
html[data-theme="dark"] .hover\:from-rose-600:hover,
html[data-theme="dark"] .hover\:from-pink-600:hover {
    --tw-gradient-from: var(--theme-gradient-rose-from) var(--tw-gradient-from-position) !important;
    --tw-gradient-to: rgba(88, 48, 68, 0) var(--tw-gradient-to-position) !important;
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important;
}

html[data-theme="dark"] .to-rose-400,
html[data-theme="dark"] .to-rose-500,
html[data-theme="dark"] .to-rose-600,
html[data-theme="dark"] .to-rose-700,
html[data-theme="dark"] .to-pink-400,
html[data-theme="dark"] .to-pink-500,
html[data-theme="dark"] .to-pink-600,
html[data-theme="dark"] .to-pink-700,
html[data-theme="dark"] .hover\:to-rose-600:hover,
html[data-theme="dark"] .hover\:to-pink-600:hover {
    --tw-gradient-to: var(--theme-gradient-rose-to) var(--tw-gradient-to-position) !important;
}

html[data-theme="dark"] body.logged-in .bg-gradient-to-r:not(.bg-clip-text),
html[data-theme="dark"] body.logged-in .bg-gradient-to-br:not(.bg-clip-text) {
    box-shadow: inset 0 1px 0 rgba(216, 222, 235, 0.08), inset 0 -1px 0 rgba(0, 0, 0, 0.18);
}

html[data-theme="dark"] body.logged-in .bg-gradient-to-r:not(.bg-clip-text) .bg-white.bg-opacity-20,
html[data-theme="dark"] body.logged-in .bg-gradient-to-br:not(.bg-clip-text) .bg-white.bg-opacity-20,
html[data-theme="dark"] body.logged-in .bg-gradient-to-r:not(.bg-clip-text) .bg-white.bg-opacity-30,
html[data-theme="dark"] body.logged-in .bg-gradient-to-br:not(.bg-clip-text) .bg-white.bg-opacity-30 {
    background-color: rgba(216, 222, 235, 0.12) !important;
}

html[data-theme="dark"] #sidebar .sidebar-logo-section,
html[data-theme="dark"] .sidebar-toggle-btn,
html[data-theme="dark"] #sidebar nav a.bg-gradient-to-r {
    background-image: linear-gradient(90deg, var(--theme-sidebar-active-from), var(--theme-sidebar-active-to)) !important;
}

html[data-theme="dark"] #sidebar .sidebar-logo-section {
    border-bottom: 1px solid rgba(216, 222, 235, 0.08);
}

html[data-theme="dark"] #sidebar nav a::before {
    background: linear-gradient(90deg, rgba(var(--theme-accent-indigo-rgb), 0.08), transparent);
}

html[data-theme="dark"] #sidebar nav a:not(.bg-gradient-to-r):hover {
    background-color: rgba(var(--theme-accent-indigo-rgb), 0.11) !important;
}

html[data-theme="dark"] #sidebar nav a.bg-gradient-to-r {
    box-shadow: var(--theme-sidebar-active-shadow) !important;
}

html[data-theme="dark"] #sidebar nav a.bg-gradient-to-r > div:first-child {
    background-color: rgba(216, 222, 235, 0.12) !important;
}

html[data-theme="dark"] .sidebar-toggle-btn {
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.34), inset 0 0 0 1px rgba(216, 222, 235, 0.10) !important;
}

html[data-theme="dark"] .sidebar-toggle-btn::after {
    opacity: 0.08;
}

html[data-theme="dark"] input[type="checkbox"],
html[data-theme="dark"] input[type="radio"] {
    color: var(--theme-accent);
    accent-color: var(--theme-accent);
}

html[data-theme="dark"] input[type="checkbox"]:checked,
html[data-theme="dark"] input[type="radio"]:checked {
    background-color: var(--theme-solid-indigo);
    border-color: var(--theme-accent);
}

html[data-theme="dark"] .swal2-timer-progress-bar {
    background-color: var(--theme-accent) !important;
}

html[data-theme="dark"] .border-blue-400,
html[data-theme="dark"] .border-blue-500,
html[data-theme="dark"] .border-blue-600,
html[data-theme="dark"] .border-cyan-400,
html[data-theme="dark"] .border-cyan-500,
html[data-theme="dark"] .border-cyan-600 {
    border-color: rgba(var(--theme-accent-blue-rgb), 0.72) !important;
}

html[data-theme="dark"] .border-indigo-400,
html[data-theme="dark"] .border-indigo-500,
html[data-theme="dark"] .border-indigo-600,
html[data-theme="dark"] .border-purple-400,
html[data-theme="dark"] .border-purple-500,
html[data-theme="dark"] .border-purple-600,
html[data-theme="dark"] .border-violet-400,
html[data-theme="dark"] .border-violet-500,
html[data-theme="dark"] .border-violet-600 {
    border-color: rgba(var(--theme-accent-indigo-rgb), 0.70) !important;
}

html[data-theme="dark"] .border-green-400,
html[data-theme="dark"] .border-green-500,
html[data-theme="dark"] .border-green-600,
html[data-theme="dark"] .border-emerald-400,
html[data-theme="dark"] .border-emerald-500,
html[data-theme="dark"] .border-emerald-600,
html[data-theme="dark"] .border-teal-400,
html[data-theme="dark"] .border-teal-500,
html[data-theme="dark"] .border-teal-600 {
    border-color: rgba(var(--theme-accent-teal-rgb), 0.68) !important;
}

html[data-theme="dark"] .border-yellow-400,
html[data-theme="dark"] .border-yellow-500,
html[data-theme="dark"] .border-yellow-600,
html[data-theme="dark"] .border-amber-400,
html[data-theme="dark"] .border-amber-500,
html[data-theme="dark"] .border-amber-600,
html[data-theme="dark"] .border-orange-400,
html[data-theme="dark"] .border-orange-500,
html[data-theme="dark"] .border-orange-600 {
    border-color: rgba(var(--theme-accent-amber-rgb), 0.70) !important;
}

html[data-theme="dark"] .border-red-400,
html[data-theme="dark"] .border-red-500,
html[data-theme="dark"] .border-red-600,
html[data-theme="dark"] .border-rose-400,
html[data-theme="dark"] .border-rose-500,
html[data-theme="dark"] .border-rose-600,
html[data-theme="dark"] .border-pink-400,
html[data-theme="dark"] .border-pink-500,
html[data-theme="dark"] .border-pink-600 {
    border-color: rgba(var(--theme-accent-rose-rgb), 0.68) !important;
}

html[data-theme="dark"] .type-card.selected {
    border-color: rgba(var(--theme-accent-indigo-rgb), 0.70) !important;
    box-shadow: 0 0 0 1px rgba(var(--theme-accent-indigo-rgb), 0.14), 0 14px 32px rgba(0, 0, 0, 0.28) !important;
}

html[data-theme="dark"] .template-card.selected {
    border-color: rgba(var(--theme-accent-green-rgb), 0.66) !important;
    box-shadow: 0 0 0 1px rgba(var(--theme-accent-green-rgb), 0.13), 0 14px 32px rgba(0, 0, 0, 0.28) !important;
}

html[data-theme="dark"] label[class*="has-[:checked]:border-blue"]:has(input:checked),
html[data-theme="dark"] body.logged-in label:has(input[name="export_type"][value="incoming"]:checked) {
    border-color: rgba(var(--theme-accent-blue-rgb), 0.72) !important;
    box-shadow: 0 0 0 1px rgba(var(--theme-accent-blue-rgb), 0.16), 0 14px 32px rgba(0, 0, 0, 0.28) !important;
}

html[data-theme="dark"] label[class*="has-[:checked]:border-green"]:has(input:checked),
html[data-theme="dark"] body.logged-in label:has(input[name="export_type"][value="outgoing"]:checked) {
    border-color: rgba(var(--theme-accent-green-rgb), 0.68) !important;
    box-shadow: 0 0 0 1px rgba(var(--theme-accent-green-rgb), 0.14), 0 14px 32px rgba(0, 0, 0, 0.28) !important;
}

html[data-theme="dark"] label[class*="has-[:checked]:border-purple"]:has(input:checked),
html[data-theme="dark"] body.logged-in label:has(input[name="export_type"][value="inheritance"]:checked) {
    border-color: rgba(var(--theme-accent-indigo-rgb), 0.70) !important;
    box-shadow: 0 0 0 1px rgba(var(--theme-accent-indigo-rgb), 0.14), 0 14px 32px rgba(0, 0, 0, 0.28) !important;
}

html[data-theme="dark"] label[class*="has-[:checked]:border-orange"]:has(input:checked),
html[data-theme="dark"] body.logged-in label:has(input[name="export_type"][value="notarization"]:checked) {
    border-color: rgba(var(--theme-accent-amber-rgb), 0.70) !important;
    box-shadow: 0 0 0 1px rgba(var(--theme-accent-amber-rgb), 0.13), 0 14px 32px rgba(0, 0, 0, 0.28) !important;
}

html[data-theme="dark"] label[class*="has-[:checked]:bg-"]:has(input:checked) .bg-blue-100,
html[data-theme="dark"] body.logged-in label:has(input[name="export_type"][value="incoming"]:checked) .bg-blue-100 {
    background-color: rgba(var(--theme-accent-blue-rgb), 0.20) !important;
}

html[data-theme="dark"] label[class*="has-[:checked]:bg-"]:has(input:checked) .bg-green-100,
html[data-theme="dark"] body.logged-in label:has(input[name="export_type"][value="outgoing"]:checked) .bg-green-100 {
    background-color: rgba(var(--theme-accent-green-rgb), 0.19) !important;
}

html[data-theme="dark"] label[class*="has-[:checked]:bg-"]:has(input:checked) .bg-purple-100,
html[data-theme="dark"] body.logged-in label:has(input[name="export_type"][value="inheritance"]:checked) .bg-purple-100 {
    background-color: rgba(var(--theme-accent-indigo-rgb), 0.19) !important;
}

html[data-theme="dark"] label[class*="has-[:checked]:bg-"]:has(input:checked) .bg-orange-100,
html[data-theme="dark"] body.logged-in label:has(input[name="export_type"][value="notarization"]:checked) .bg-orange-100 {
    background-color: rgba(var(--theme-accent-amber-rgb), 0.20) !important;
}

html[data-theme="dark"] label[class*="has-[:checked]:border-blue"]:has(input:checked) svg,
html[data-theme="dark"] body.logged-in label:has(input[name="export_type"][value="incoming"]:checked) > .absolute svg {
    color: var(--theme-accent-blue) !important;
}

html[data-theme="dark"] label[class*="has-[:checked]:border-green"]:has(input:checked) svg,
html[data-theme="dark"] body.logged-in label:has(input[name="export_type"][value="outgoing"]:checked) > .absolute svg {
    color: var(--theme-accent-green) !important;
}

html[data-theme="dark"] label[class*="has-[:checked]:border-purple"]:has(input:checked) svg,
html[data-theme="dark"] body.logged-in label:has(input[name="export_type"][value="inheritance"]:checked) > .absolute svg {
    color: var(--theme-accent-indigo) !important;
}

html[data-theme="dark"] label[class*="has-[:checked]:border-orange"]:has(input:checked) svg,
html[data-theme="dark"] body.logged-in label:has(input[name="export_type"][value="notarization"]:checked) > .absolute svg {
    color: var(--theme-accent-amber) !important;
}

html[data-theme="dark"] body.logged-in label:has(input[name="export_type"]:checked) > .absolute svg {
    filter: drop-shadow(0 0 5px rgba(var(--theme-accent-indigo-rgb), 0.18));
}

html[data-theme="dark"] .disabled-card {
    background-color: var(--theme-surface-disabled) !important;
    color: var(--theme-text-faint) !important;
    opacity: 0.5;
}

html[data-theme="dark"] .var-fill {
    background-color: rgba(var(--theme-accent-green-rgb), 0.13) !important;
    color: var(--theme-accent-green) !important;
    border-radius: 0.2rem;
}

html[data-theme="dark"] .bg-black:not([class*="bg-opacity-"]) {
    background-color: var(--theme-page-background) !important;
}

html[data-theme="dark"] .bg-transparent {
    background-color: transparent !important;
}

html[data-theme="dark"] ::selection {
    background-color: rgba(var(--theme-accent-indigo-rgb), 0.30);
    color: #ffffff;
}

/* Tắt mọi transition khi đang khởi tạo — tránh giật layout lúc load */
body.sidebar-loading #sidebar,
body.sidebar-loading .main-content,
body.sidebar-loading .with-sidebar-footer,
body.sidebar-loading .sidebar-toggle-btn {
    transition: none !important;
}

/* ===== Ổn định Scrollbar — chống "nhảy" layout giữa các trang =====
   LUÔN dành sẵn chỗ cho thanh cuộn dọc của trang, để trang CÓ hay KHÔNG có scrollbar
   đều cùng bề rộng (không lệch vài px khi chuyển trang). Trên macOS (overlay scrollbar)
   thuộc tính này không chiếm chỗ -> tự nhất quán trên mọi nền tảng. Thuần CSS, không JS. */
html {
    scrollbar-gutter: stable;
}

/* Tiện ích dùng chung cho vùng cuộn (modal/drawer/popup/danh sách/bảng) để nội dung
   không xê dịch khi scrollbar xuất hiện/biến mất. */
.ld-stable-scroll {
    scrollbar-gutter: stable;
}

/* ===== Main Content with Sidebar ===== */
.main-content {
    min-height: 100vh;
    transition: margin-left var(--sidebar-transition), padding-top var(--sidebar-transition);
    padding-bottom: 4rem;
    /* Space for footer */
}

@media (min-width: 1024px) {
    .main-content {
        margin-left: var(--sidebar-width);
    }
}

/* ===== Nội dung CO GIÃN theo Sidebar =====
   .main-content đã tự thu/giãn margin-left theo --sidebar-width (kể cả khi thu gọn).
   Khối nội dung mỗi trang đang bị giới hạn bởi .max-w-7xl (80rem) + mx-auto nên khi
   thu gọn Sidebar, phần không gian giải phóng chỉ thành khoảng trắng hai bên.
   Bỏ giới hạn này để nội dung LẤP ĐẦY phần còn lại và mở rộng theo THỜI GIAN THỰC
   (đồng bộ animation với margin của .main-content). Footer nằm NGOÀI .main-content
   nên không bị ảnh hưởng và vẫn căn giữa như cũ.
   Chỉ nhắm KHỐI BAO NỘI DUNG của trang (max-w-7xl + mx-auto) — KHÔNG đụng tới
   modal/hộp thoại (dùng "w-full max-w-7xl", không có mx-auto) để chúng giữ bề rộng tối đa. */
.main-content .max-w-7xl.mx-auto {
    max-width: none;
}

/* ===== Footer Adjustment ===== */
.system-footer {
    min-height: var(--system-footer-height);
    background: var(--theme-footer-bg) !important;
    color: var(--theme-footer-text) !important;
    border-top: 1px solid var(--theme-border);
    box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.10);
}

.system-footer > div {
    min-height: var(--system-footer-height);
    display: flex;
    align-items: center;
    justify-content: center;
}

.system-footer .text-gray-300,
.system-footer .text-gray-400 {
    color: color-mix(in srgb, var(--theme-footer-text) 72%, transparent) !important;
}

.system-footer #contact-trigger {
    color: inherit;
    text-underline-offset: 0.18em;
}

.system-footer #contact-trigger:hover {
    color: var(--theme-accent-indigo, #4f46e5) !important;
}

.with-sidebar-footer {
    left: 0;
    transition: left var(--sidebar-transition),
                width var(--sidebar-transition),
                background-color 0.18s ease,
                color 0.18s ease;
}

@media (min-width: 1024px) {
    .with-sidebar-footer {
        left: var(--sidebar-width);
        width: calc(100% - var(--sidebar-width));
    }
}

/* ===== Sidebar Base ===== */
#sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-min-width);
    max-width: var(--sidebar-max-width);
    overflow: hidden;
    transition: width var(--sidebar-transition),
                min-width var(--sidebar-transition),
                max-width var(--sidebar-transition),
                transform var(--sidebar-transition),
                background-color 0.18s ease,
                border-color 0.18s ease,
                box-shadow 0.18s ease,
                -webkit-backdrop-filter 0.18s ease,
                backdrop-filter 0.18s ease;
}

/* ===== Narrow Sidebar State ===== */
/* Khi sidebar hẹp, text tự xuống dòng & ẩn phần phụ để giữ UI sạch */

/* Logo: giữ lại trong sidebar, text co mượt khi thu gọn */
#sidebar .sidebar-logo-section {
    overflow: hidden;
    transition: padding var(--sidebar-transition);
}

#sidebar .sidebar-logo-icon {
    transition: margin var(--sidebar-transition), transform var(--sidebar-transition);
}

#sidebar .sidebar-logo-text {
    overflow: hidden;
    min-width: 0;
    max-width: calc(var(--sidebar-width) - 5.5rem);
    opacity: 1;
    transform: translateX(0);
    white-space: nowrap;
    transition: opacity var(--sidebar-label-duration) var(--sidebar-ease),
                transform var(--sidebar-label-duration) var(--sidebar-ease),
                max-width var(--sidebar-transition),
                margin var(--sidebar-transition);
}

#sidebar .sidebar-logo-text h1,
#sidebar .sidebar-logo-text p {
    white-space: nowrap;
}

/* User info: wrap tên, giữ hiển thị office khi hẹp */
#sidebar .sidebar-user-section {
    max-height: 5.5rem;
    opacity: 1;
    overflow: hidden;
    transition: max-height var(--sidebar-transition),
                opacity var(--sidebar-label-duration) var(--sidebar-ease),
                padding var(--sidebar-transition),
                border-color var(--sidebar-transition);
}

#sidebar .sidebar-user-section > .flex {
    height: 3.25rem; /* Locks container height so wrapped text during collapse doesn't push avatar down */
}

#sidebar .sidebar-user-info {
    min-width: 0;
    max-width: calc(var(--sidebar-width) - 5.5rem);
    overflow: hidden;
    transition: opacity var(--sidebar-label-duration) var(--sidebar-ease),
                transform var(--sidebar-label-duration) var(--sidebar-ease),
                max-width var(--sidebar-transition),
                margin-left var(--sidebar-transition);
}

#sidebar .sidebar-user-info p {
    word-break: break-word;
    width: max-content;
    max-width: calc(var(--sidebar-width) - 5.5rem);
}

/* Office name luôn hiển thị, chỉ thu nhỏ khi narrow */
#sidebar.sidebar-narrow .sidebar-user-office {
    display: block;
    opacity: 0.85;
    font-size: 0.7rem; /* Thu nhỏ khi narrow */
    transition: opacity 0.25s ease, font-size 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Nav items: wrap label text */
#sidebar nav a>span {
    word-break: break-word;
    min-width: 0;
}

#sidebar nav .py-2 {
    height: 2rem;
    transition: height var(--sidebar-transition),
                padding var(--sidebar-transition);
    overflow: hidden;
}

/* Section separators */
#sidebar nav .sidebar-section-label {
    word-break: break-word;
    overflow: hidden;
    white-space: nowrap;
    max-width: calc(var(--sidebar-width) - 5.5rem);
    transition: opacity var(--sidebar-label-duration) var(--sidebar-ease),
                transform var(--sidebar-label-duration) var(--sidebar-ease),
                max-width var(--sidebar-transition);
}

/* Bottom links: wrap */
#sidebar .sidebar-bottom-section a>span,
#sidebar .sidebar-bottom-section button>span {
    word-break: break-word;
    min-width: 0;
}

/* Icon containers: không co lại */
#sidebar nav a>div:first-child,
#sidebar .sidebar-bottom-section a>div:first-child,
#sidebar .sidebar-bottom-section button>div:first-child {
    flex-shrink: 0;
}

/* Khi rất hẹp: giảm padding nhưng vẫn giữ đủ khoảng cách */
#sidebar.sidebar-narrow nav {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

#sidebar.sidebar-narrow nav a {
    padding-left: 0.875rem;
    padding-right: 0.875rem;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

#sidebar.sidebar-narrow .sidebar-logo-section {
    padding-left: 1rem;
    padding-right: 1rem;
}

#sidebar.sidebar-narrow .sidebar-user-info {
    padding-left: 1rem;
    padding-right: 1rem;
}

/* ===== Sidebar Right Border (gợi ý resize) ===== */
@media (min-width: 1024px) {
    #sidebar {
        border-right: 1px solid rgba(99, 102, 241, 0.15);
    }
}

/* ===== Sidebar Resize Handle ===== */
.sidebar-resize-handle {
    position: absolute;
    top: 0;
    right: -6px;
    width: 12px;
    height: 100%;
    cursor: col-resize;
    z-index: 60;
    display: none;
    transition: background 0.2s ease;
}

@media (min-width: 1024px) {
    .sidebar-resize-handle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Grip dots: 3 chấm dọc luôn hiển thị — gợi ý "kéo được" */
.sidebar-resize-handle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 4px;
    height: 28px;
    /* Dùng radial-gradient tạo 3 chấm tròn */
    background-image: radial-gradient(circle, rgba(99, 102, 241, 0.4) 1.5px, transparent 1.5px);
    background-size: 4px 10px;
    background-repeat: repeat-y;
    background-position: center;
    border-radius: 2px;
    transition: opacity 0.2s ease, height 0.2s ease, background-image 0.2s ease;
}

/* Hover: dots sáng hơn + dài hơn + nền nhẹ */
.sidebar-resize-handle:hover {
    background: rgba(99, 102, 241, 0.06);
}

.sidebar-resize-handle:hover::before {
    height: 48px;
    background-image: radial-gradient(circle, rgba(99, 102, 241, 0.7) 1.5px, transparent 1.5px);
}

/* Thanh indicator khi hover — bổ sung ngoài dots */
.sidebar-resize-handle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 2px;
    height: 0;
    border-radius: 2px;
    background: rgba(99, 102, 241, 0);
    transition: background 0.2s ease, height 0.2s ease, box-shadow 0.2s ease;
}

.sidebar-resize-handle:hover::after {
    background: rgba(99, 102, 241, 0.3);
    height: 80px;
    box-shadow: 0 0 6px rgba(99, 102, 241, 0.15);
}

/* Active (đang kéo): thanh sáng, dots sáng nhất */
.sidebar-resize-handle:active::before,
.sidebar-resize-handle.resizing::before {
    height: 56px;
    background-image: radial-gradient(circle, rgba(99, 102, 241, 1) 1.5px, transparent 1.5px);
}

.sidebar-resize-handle:active::after,
.sidebar-resize-handle.resizing::after {
    background: rgba(99, 102, 241, 0.6);
    height: 100px;
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.3);
}

/* ===== First-time attention animation ===== */
/* Nhấp nháy grip dots 2 lần khi trang load lần đầu */
@keyframes gripPulse {

    0%,
    100% {
        opacity: 1;
    }

    25% {
        opacity: 0.3;
    }

    50% {
        opacity: 1;
    }

    75% {
        opacity: 0.3;
    }
}

.sidebar-resize-handle.first-visit::before {
    animation: gripPulse 2s ease-in-out 1s 1;
    height: 40px;
    background-image: radial-gradient(circle, rgba(99, 102, 241, 0.7) 1.5px, transparent 1.5px);
}

/* ===== Resize Tooltip ===== */
.sidebar-resize-tooltip {
    position: absolute;
    top: 50%;
    left: calc(100% + 8px);
    transform: translateY(-50%);
    background: #4338ca;
    color: white;
    font-size: 0.7rem;
    font-weight: 500;
    padding: 6px 10px;
    border-radius: 6px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    box-shadow: 0 4px 12px rgba(67, 56, 202, 0.4);
    z-index: 70;
}

/* Mũi tên trỏ vào handle */
.sidebar-resize-tooltip::before {
    content: '';
    position: absolute;
    top: 50%;
    left: -5px;
    transform: translateY(-50%);
    border: 5px solid transparent;
    border-right-color: #4338ca;
    border-left: none;
}

/* Hiện tooltip khi first-visit */
.sidebar-resize-handle.first-visit .sidebar-resize-tooltip {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

/* Ẩn tooltip khi hover handle (đã hiểu rồi) */
.sidebar-resize-handle:hover .sidebar-resize-tooltip {
    opacity: 0 !important;
}

/* Khi đang resize: tắt transition để mượt */
body.sidebar-resizing {
    cursor: col-resize !important;
    user-select: none !important;
    -webkit-user-select: none !important;
}

body.sidebar-resizing .main-content,
body.sidebar-resizing .with-sidebar-footer,
body.sidebar-resizing #sidebar {
    transition: none !important;
}

/* ===== Sidebar Scrollbar =====
   - Sidebar MỞ RỘNG (mặc định) và khi HOVER (hover-preview tự mở rộng): HIỆN scrollbar
     mảnh; dùng scrollbar-gutter: stable để dành sẵn chỗ -> không xê dịch khi nội dung
     có/không tràn (mở rộng thì text canh trái nên 6px bên phải không gây lệch thị giác).
   - Sidebar THU GỌN (và KHÔNG hover): ẨN HẲN scrollbar -> icon/menu luôn CĂN GIỮA,
     không chiếm chỗ, không bị dồn sang trái. Vẫn cuộn được bằng chuột/cảm ứng/kéo. */
#sidebar nav {
    overflow-y: auto;
    scrollbar-gutter: stable;                       /* dành sẵn chỗ -> thumb hiện ra KHÔNG làm xê dịch */
    scrollbar-width: thin;                          /* Firefox */
    scrollbar-color: transparent transparent;       /* mặc định: ẩn thumb (chỉ hiện khi cuộn) */
}

/* CHỈ hiện thumb khi đang cuộn (JS thêm class .is-scrolling lúc cuộn, gỡ sau ~800ms) */
#sidebar nav.is-scrolling {
    scrollbar-color: rgba(129, 140, 248, 0.6) transparent;
}

#sidebar nav::-webkit-scrollbar {
    width: 6px;
}

#sidebar nav::-webkit-scrollbar-track {
    background: transparent;
}

/* Webkit: thumb trong suốt mặc định, chỉ tô màu khi đang cuộn */
#sidebar nav::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 3px;
    transition: background 0.2s ease;
}

#sidebar nav.is-scrolling::-webkit-scrollbar-thumb {
    background: rgba(129, 140, 248, 0.6);
}

#sidebar nav.is-scrolling::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.85);
}

/* THU GỌN & KHÔNG hover -> ẩn hẳn scrollbar (icon căn giữa, không chiếm chỗ) */
body.sidebar-collapsed:not(.sidebar-hover-preview) #sidebar nav {
    scrollbar-gutter: auto;
    scrollbar-width: none;
}

body.sidebar-collapsed:not(.sidebar-hover-preview) #sidebar nav::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

/* ===== Sidebar Animations ===== */
@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.sidebar-animate-in {
    animation: slideInLeft 0.3s ease-out forwards;
}

/* ===== Menu Item Hover Effects ===== */
#sidebar nav a {
    position: relative;
    overflow: hidden;
    transition: background-color 0.18s ease,
                color 0.18s ease,
                box-shadow 0.22s ease,
                transform 0.18s ease,
                padding var(--sidebar-transition);
    min-height: 3.5rem;
}

#sidebar .sidebar-bottom-section a,
#sidebar .sidebar-bottom-section button {
    transition: background-color 0.18s ease,
                color 0.18s ease,
                transform 0.18s ease,
                padding var(--sidebar-transition);
}

#sidebar nav a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.12), transparent);
    transition: width 0.24s var(--sidebar-ease);
}

#sidebar nav a:hover::before {
    width: 50%;
}

/* Active state - smooth entrance with scale */
#sidebar nav a.bg-gradient-to-r {
    box-shadow: 0 4px 15px -3px rgba(99, 102, 241, 0.4);
}

/* Smooth icon background transition */
#sidebar nav a > div:first-child,
#sidebar .sidebar-bottom-section a > div:first-child,
#sidebar .sidebar-bottom-section button > div:first-child {
    transition: background-color 0.18s ease,
                transform 0.18s ease,
                margin-right var(--sidebar-transition);
}

/* ===== Theme Toggle Fix FOUC ===== */
#theme-toggle-icon .theme-icon-light,
#theme-toggle-icon .theme-icon-dark,
#theme-toggle-icon .theme-icon-glass {
    display: none;
}

html[data-theme="light"] #theme-toggle-icon .theme-icon-light,
html[data-theme="dark"] #theme-toggle-icon .theme-icon-dark,
html[data-theme="glass"] #theme-toggle-icon .theme-icon-glass {
    display: block;
}

html[data-theme="light"] #theme-toggle-label::after { content: ": Light"; }
html[data-theme="dark"] #theme-toggle-label::after { content: ": Dark"; }
html[data-theme="glass"] #theme-toggle-label::after { content: ": Glass"; }

/* Smooth text color transition */
#sidebar nav a span,
#sidebar .sidebar-bottom-section a span,
#sidebar .sidebar-bottom-section button span {
    display: inline-block;
    overflow: hidden;
    white-space: nowrap;
    max-width: calc(var(--sidebar-width) - 5.5rem);
    opacity: 1;
    transform: translateX(0);
    transition: color 0.18s ease,
                opacity var(--sidebar-label-duration) var(--sidebar-ease),
                transform var(--sidebar-label-duration) var(--sidebar-ease),
                max-width var(--sidebar-transition);
}

/* SVG icon color transition */
#sidebar nav a svg {
    transition: color 0.18s ease,
                transform 0.18s ease;
}

/* Smooth scroll behavior for sidebar navigation */
#sidebar nav {
    scroll-behavior: smooth;
}

/* Hover state smooth transition for non-active items */
#sidebar nav a:not(.bg-gradient-to-r):hover {
    background-color: rgba(99, 102, 241, 0.04);
    transform: translateX(4px);
}

/* Active item maintains position */
#sidebar nav a.bg-gradient-to-r {
    transform: translateX(0);
}

/* ===== User Avatar Animation ===== */
#sidebar .user-avatar {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#sidebar .user-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.3);
}

/* ===== Sidebar Toggle Button (Persistent — cả desktop & mobile) ===== */
/* Nút hamburger luôn hiện, dính cạnh phải sidebar, cách đều footer */
#sidebar-toggle {
    animation: fadeIn 0.5s ease-out;
}

.sidebar-toggle-btn {
    /* Cách đều footer: footer ~2.5rem cao, bottom = footer-height + spacing */
    bottom: calc(2.5rem + 0.75rem);
    z-index: 70;
    transition: left var(--sidebar-transition), transform 0.2s ease, box-shadow 0.3s ease;
}

/* Desktop: vị trí left do JS tính toán, giữ nút tròn */
@media (min-width: 1024px) {
    .sidebar-toggle-btn {
        /* left do JS set dựa trên sidebar width */
    }
}

/* Mobile: góc trái dưới cố định */
@media (max-width: 1023px) {
    .sidebar-toggle-btn {
        left: 1rem;
    }
}

.sidebar-toggle-btn:active {
    transform: scale(0.9);
}

/* Pulse effect for toggle button */
.sidebar-toggle-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: inherit;
    opacity: 0;
    animation: ping 1.5s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes ping {

    75%,
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* ===== Desktop Sidebar Collapsed State ===== */
@media (min-width: 1024px) {
    /* Sidebar thu gon theo width, van giu rail icon tren man hinh */
    #sidebar {
        transform: translateX(0) !important;
        will-change: width;
    }

    /* Khi collapsed: content va footer chua dung phan rail icon */
    body.sidebar-collapsed .main-content {
        margin-left: var(--sidebar-collapsed-width);
        padding-top: 0;
    }

    body.sidebar-collapsed .with-sidebar-footer {
        left: var(--sidebar-collapsed-width);
        width: calc(100% - var(--sidebar-collapsed-width));
    }

    body.sidebar-collapsed #sidebar {
        width: var(--sidebar-collapsed-width);
        min-width: var(--sidebar-collapsed-width);
        max-width: var(--sidebar-collapsed-width);
    }

    /* Ẩn resize handle khi sidebar collapsed */
    body.sidebar-collapsed #sidebar .sidebar-resize-handle {
        display: none;
    }

    body.sidebar-collapsed #sidebar .sidebar-logo-section {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    body.sidebar-collapsed #sidebar .sidebar-logo-icon {
        margin-left: 0;
        margin-right: 0;
    }

    body.sidebar-collapsed #sidebar .sidebar-logo-text {
        max-width: 0;
        opacity: 0;
        transform: translateX(-12px);
        margin-left: 0;
        pointer-events: none;
    }

    body.sidebar-collapsed #sidebar nav {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    body.sidebar-collapsed #sidebar nav a {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
        width: 100%;
        min-height: 3.5rem;
    }

    body.sidebar-collapsed #sidebar .sidebar-bottom-section .sidebar-bottom-action {
        width: 100%;
        min-width: 0;
        min-height: 0;
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    body.sidebar-collapsed #sidebar nav a > div:first-child,
    body.sidebar-collapsed #sidebar .sidebar-bottom-section .sidebar-bottom-action > div:first-child {
        margin-right: 0 !important;
    }

    body.sidebar-collapsed #sidebar nav a span,
    body.sidebar-collapsed #sidebar .sidebar-bottom-section .sidebar-bottom-action span,
    body.sidebar-collapsed #sidebar .sidebar-section-label {
        max-width: 0;
        opacity: 0;
        transform: translateX(-12px);
        pointer-events: none;
    }

    body.sidebar-collapsed #sidebar nav .py-2 {
        height: 0.75rem;
        padding-top: 0;
        padding-bottom: 0;
        overflow: hidden;
    }

    body.sidebar-collapsed #sidebar .sidebar-user-section {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }

    body.sidebar-collapsed #sidebar .sidebar-user-info {
        max-width: 0;
        opacity: 0;
        transform: translateX(-12px);
        pointer-events: none;
        margin-left: 0 !important;
    }

    body.sidebar-collapsed #sidebar .sidebar-bottom-section {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    body.sidebar-collapsed #sidebar nav a:not(.bg-gradient-to-r):hover {
        transform: none;
    }

    /* Hover-preview: mở rộng tạm thời, không thay đổi state collapsed chính thức */
    body.sidebar-collapsed.sidebar-hover-preview #sidebar {
        width: var(--sidebar-width);
        min-width: var(--sidebar-min-width);
        max-width: var(--sidebar-max-width);
    }

    body.sidebar-collapsed.sidebar-hover-preview #sidebar .sidebar-logo-section {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }

    body.sidebar-collapsed.sidebar-hover-preview #sidebar .sidebar-logo-text {
        max-width: calc(var(--sidebar-width) - 5.5rem);
        opacity: 1;
        transform: translateX(0);
        margin-left: 0.75rem;
        pointer-events: auto;
    }

    body.sidebar-collapsed.sidebar-hover-preview #sidebar nav a {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    body.sidebar-collapsed.sidebar-hover-preview #sidebar .sidebar-bottom-section .sidebar-bottom-action {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    body.sidebar-collapsed.sidebar-hover-preview #sidebar nav a > div:first-child {
        margin-right: 0.75rem !important;
    }

    body.sidebar-collapsed.sidebar-hover-preview #sidebar .sidebar-bottom-section .sidebar-bottom-action > div:first-child {
        margin-right: 0.5rem !important;
    }

    body.sidebar-collapsed.sidebar-hover-preview #sidebar nav a span,
    body.sidebar-collapsed.sidebar-hover-preview #sidebar .sidebar-bottom-section .sidebar-bottom-action span,
    body.sidebar-collapsed.sidebar-hover-preview #sidebar .sidebar-section-label {
        max-width: calc(var(--sidebar-width) - 5.5rem);
        opacity: 1;
        transform: translateX(0);
        pointer-events: auto;
    }

    body.sidebar-collapsed.sidebar-hover-preview #sidebar nav .py-2 {
        height: 2rem;
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }

    body.sidebar-collapsed.sidebar-hover-preview #sidebar .sidebar-user-section {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    body.sidebar-collapsed.sidebar-hover-preview #sidebar .sidebar-user-info {
        max-width: calc(var(--sidebar-width) - 5.5rem);
        opacity: 1;
        transform: translateX(0);
        pointer-events: auto;
        margin-left: 0.75rem !important;
    }

    body.sidebar-collapsed.sidebar-hover-preview #sidebar .sidebar-bottom-section {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
}

/* ===== Overlay Transition ===== */
#sidebar-overlay {
    transition: opacity 0.3s ease-in-out;
}

#sidebar-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

/* ===== Responsive Adjustments ===== */
@media (max-width: 1023px) {

    /* Stack content for mobile */
    .main-content {
        margin-left: 0;
    }

    /* Sidebar full height on mobile, fixed width */
    #sidebar {
        height: 100dvh;
        /* Use dvh for mobile browser compatibility */
        width: 16rem !important;
        /* Cố định trên mobile */
    }
}

/* ===== Print Styles ===== */
@media print {

    #sidebar,
    #sidebar-toggle,
    #sidebar-overlay {
        display: none !important;
    }

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

/* ===== Utility Classes ===== */
.sidebar-hidden-on-load {
    transform: translateX(-100%);
}

.sidebar-visible {
    transform: translateX(0);
}

/* Backdrop blur for overlay */
#sidebar-overlay {
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
    :root {
        --sidebar-duration: 1ms;
        --sidebar-label-duration: 1ms;
        --sidebar-transition: 1ms linear;
    }

    #sidebar,
    #sidebar *,
    body.logged-in,
    body.logged-in *,
    .main-content,
    .with-sidebar-footer,
    .sidebar-toggle-btn,
    #sidebar-overlay {
        animation: none !important;
        scroll-behavior: auto !important;
        transition-duration: 1ms !important;
    }
}

/* ===== Final Dark Premium Overrides ===== */
html[data-theme="dark"] .bg-black:not([class*="bg-opacity-"]) {
    background-color: var(--theme-page-background) !important;
}

html[data-theme="dark"] .var-fill {
    background-color: rgba(var(--theme-accent-green-rgb), 0.13) !important;
    color: var(--theme-accent-green) !important;
}

html[data-theme="dark"] ::selection {
    background-color: rgba(var(--theme-accent-indigo-rgb), 0.30);
    color: #ffffff;
}

html[data-theme="dark"] body.logged-in .bg-gradient-to-r:not(.bg-clip-text),
html[data-theme="dark"] body.logged-in .bg-gradient-to-br:not(.bg-clip-text) {
    box-shadow: inset 0 1px 0 rgba(216, 222, 235, 0.08), inset 0 -1px 0 rgba(0, 0, 0, 0.18), 0 14px 32px rgba(0, 0, 0, 0.18);
}

html[data-theme="dark"] #sidebar {
    border-right-color: var(--theme-border) !important;
}

html[data-theme="dark"] #sidebar .sidebar-logo-section,
html[data-theme="dark"] .sidebar-toggle-btn,
html[data-theme="dark"] #sidebar nav a.bg-gradient-to-r {
    background-image: linear-gradient(90deg, var(--theme-sidebar-active-from), var(--theme-sidebar-active-to)) !important;
}

html[data-theme="dark"] #sidebar nav a::before {
    background: linear-gradient(90deg, rgba(var(--theme-accent-indigo-rgb), 0.08), transparent);
}

html[data-theme="dark"] #sidebar nav a.bg-gradient-to-r {
    box-shadow: var(--theme-sidebar-active-shadow) !important;
}

html[data-theme="dark"] #sidebar nav a:not(.bg-gradient-to-r):hover {
    background-color: rgba(var(--theme-accent-indigo-rgb), 0.11) !important;
}

html[data-theme="dark"] #sidebar nav a.bg-gradient-to-r > div:first-child {
    background-color: rgba(216, 222, 235, 0.12) !important;
}

html[data-theme="dark"] #sidebar .sidebar-bottom-section a:hover,
html[data-theme="dark"] #sidebar .sidebar-bottom-section button:hover {
    background-color: rgba(var(--theme-accent-indigo-rgb), 0.11) !important;
}

html[data-theme="dark"] #sidebar nav.is-scrolling {
    scrollbar-color: var(--theme-accent-indigo) transparent;
}

html[data-theme="dark"] #sidebar nav.is-scrolling::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(var(--theme-accent-indigo-rgb), 0.72), rgba(var(--theme-accent-blue-rgb), 0.58));
}

html[data-theme="dark"] #sidebar nav.is-scrolling::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(var(--theme-accent-indigo-rgb), 0.84), rgba(var(--theme-accent-blue-rgb), 0.68));
}

html[data-theme="dark"] .sidebar-resize-handle::before {
    background-image: radial-gradient(circle, rgba(var(--theme-accent-indigo-rgb), 0.42) 1.5px, transparent 1.5px);
}

html[data-theme="dark"] .sidebar-resize-handle:hover {
    background: rgba(var(--theme-accent-indigo-rgb), 0.055);
}

html[data-theme="dark"] .sidebar-resize-handle:hover::before,
html[data-theme="dark"] .sidebar-resize-handle.first-visit::before {
    background-image: radial-gradient(circle, rgba(var(--theme-accent-indigo-rgb), 0.62) 1.5px, transparent 1.5px);
}

html[data-theme="dark"] .sidebar-resize-handle::after {
    background: rgba(var(--theme-accent-indigo-rgb), 0);
}

html[data-theme="dark"] .sidebar-resize-handle:hover::after {
    background: rgba(var(--theme-accent-indigo-rgb), 0.26);
    box-shadow: 0 0 6px rgba(var(--theme-accent-indigo-rgb), 0.14);
}

html[data-theme="dark"] .sidebar-resize-handle:active::before,
html[data-theme="dark"] .sidebar-resize-handle.resizing::before {
    background-image: radial-gradient(circle, rgba(var(--theme-accent-indigo-rgb), 0.78) 1.5px, transparent 1.5px);
}

html[data-theme="dark"] .sidebar-resize-handle:active::after,
html[data-theme="dark"] .sidebar-resize-handle.resizing::after {
    background: rgba(var(--theme-accent-indigo-rgb), 0.44);
    box-shadow: 0 0 10px rgba(var(--theme-accent-indigo-rgb), 0.20);
}

html[data-theme="dark"] #sidebar .user-avatar:hover {
    box-shadow: 0 0 0 3px rgba(var(--theme-accent-indigo-rgb), 0.18);
}

@media (min-width: 1024px) {
    html[data-theme="dark"] body.sidebar-collapsed.sidebar-hover-preview #sidebar .sidebar-user-section {
        border-color: var(--theme-border);
    }
}

/* ===== Glass Premium Overrides ===== */
html[data-theme="glass"] body.logged-in {
    background: var(--theme-page-background) !important;
    background-attachment: fixed;
    color: var(--theme-text);
}

html[data-theme="glass"] .glass-surface,
html[data-theme="glass"] #sidebar,
html[data-theme="glass"] body.logged-in .bg-white:not([class*="bg-opacity-"]),
html[data-theme="glass"] .absolute.bg-white,
html[data-theme="glass"] .relative.bg-white,
html[data-theme="glass"] [role="menu"],
html[data-theme="glass"] [role="listbox"],
html[data-theme="glass"] .swal2-popup,
html[data-theme="glass"] .json-preview,
html[data-theme="glass"] .type-card,
html[data-theme="glass"] .template-card,
html[data-theme="glass"] label[class*="has-[:checked]:bg-"] {
    background: var(--theme-glass-material) !important;
    border-color: var(--theme-glass-border) !important;
    box-shadow: var(--theme-glass-highlight), var(--theme-glass-shadow) !important;
    -webkit-backdrop-filter: blur(var(--theme-glass-blur)) saturate(var(--theme-glass-saturate));
    backdrop-filter: blur(var(--theme-glass-blur)) saturate(var(--theme-glass-saturate));
}

html[data-theme="glass"] .glass-elevated,
html[data-theme="glass"] .shadow-lg,
html[data-theme="glass"] .shadow-xl,
html[data-theme="glass"] .shadow-2xl,
html[data-theme="glass"] .swal2-popup {
    box-shadow: var(--theme-glass-highlight), var(--theme-glass-shadow-elevated) !important;
}

html[data-theme="glass"] .glass-button,
html[data-theme="glass"] button,
html[data-theme="glass"] .btn,
html[data-theme="glass"] .btn-secondary {
    transition: background-color 180ms ease, border-color 180ms ease, box-shadow 220ms ease, color 180ms ease, transform 180ms ease, opacity 180ms ease;
}

html[data-theme="glass"] .main-content,
html[data-theme="glass"] .with-sidebar-footer {
    color: var(--theme-text);
}

html[data-theme="glass"] .with-sidebar-footer {
    background: var(--theme-footer-bg) !important;
    color: var(--theme-footer-text) !important;
    border-top: 1px solid var(--theme-glass-border);
    box-shadow: 0 -10px 28px rgba(45, 58, 82, 0.11), inset 0 1px 0 rgba(255, 255, 255, 0.55);
    -webkit-backdrop-filter: blur(var(--theme-glass-blur-soft)) saturate(1.2);
    backdrop-filter: blur(var(--theme-glass-blur-soft)) saturate(1.2);
}

html[data-theme="glass"] #sidebar {
    border-right-color: var(--theme-glass-border) !important;
}

html[data-theme="glass"] #sidebar .sidebar-logo-section {
    border-bottom: 1px solid rgba(255, 255, 255, 0.46);
    background: var(--theme-glass-material-muted);
}

html[data-theme="glass"] #sidebar .sidebar-user-section,
html[data-theme="glass"] #sidebar .sidebar-bottom-section {
    border-color: rgba(255, 255, 255, 0.46) !important;
}

html[data-theme="glass"] #sidebar nav a:not(.bg-gradient-to-r):hover,
html[data-theme="glass"] #sidebar .sidebar-bottom-section a:hover,
html[data-theme="glass"] #sidebar .sidebar-bottom-section button:hover,
html[data-theme="glass"] [role="menu"] a:hover,
html[data-theme="glass"] [role="menu"] button:hover,
html[data-theme="glass"] [role="listbox"] [role="option"]:hover {
    background: var(--theme-glass-material-elevated) !important;
    color: var(--theme-text) !important;
    box-shadow: var(--theme-glass-highlight), 0 10px 22px rgba(45, 58, 82, 0.10);
}

html[data-theme="glass"] #sidebar nav a.bg-gradient-to-r,
html[data-theme="glass"] #sidebar .sidebar-logo-section,
html[data-theme="glass"] .sidebar-toggle-btn {
    background: var(--theme-glass-material-selected) !important;
    border: 1px solid var(--theme-glass-border) !important;
    box-shadow: var(--theme-glass-highlight), var(--theme-sidebar-active-shadow) !important;
    -webkit-backdrop-filter: blur(var(--theme-glass-blur)) saturate(var(--theme-glass-saturate));
    backdrop-filter: blur(var(--theme-glass-blur)) saturate(var(--theme-glass-saturate));
}

html[data-theme="glass"] #sidebar nav a.bg-gradient-to-r,
html[data-theme="glass"] #sidebar nav a.bg-gradient-to-r span,
html[data-theme="glass"] #sidebar nav a.bg-gradient-to-r svg,
html[data-theme="glass"] #sidebar nav a.bg-gradient-to-r .text-white {
    color: var(--theme-text) !important;
}

html[data-theme="glass"] #sidebar nav a.bg-gradient-to-r > div:first-child,
html[data-theme="glass"] #sidebar .sidebar-bottom-section a > div:first-child,
html[data-theme="glass"] #sidebar .sidebar-bottom-section button > div:first-child {
    background-color: rgba(255, 255, 255, 0.52) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

html[data-theme="glass"] #sidebar nav a::before {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.36), transparent);
}

html[data-theme="glass"] .sidebar-toggle-btn::after {
    opacity: 0.08;
}

html[data-theme="glass"] #sidebar nav.is-scrolling {
    scrollbar-color: rgba(var(--theme-accent-indigo-rgb), 0.58) transparent;
}

html[data-theme="glass"] #sidebar nav.is-scrolling::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(var(--theme-accent-indigo-rgb), 0.45), rgba(var(--theme-accent-blue-rgb), 0.36));
}

html[data-theme="glass"] .bg-gray-50,
html[data-theme="glass"] .bg-gray-100,
html[data-theme="glass"] .bg-gray-200 {
    background-color: var(--theme-glass-bg-muted) !important;
}

html[data-theme="glass"] .bg-gray-300,
html[data-theme="glass"] .bg-gray-400,
html[data-theme="glass"] .bg-gray-500,
html[data-theme="glass"] .bg-gray-600 {
    background-color: var(--theme-glass-bg-elevated) !important;
    color: var(--theme-text) !important;
}

html[data-theme="glass"] .text-gray-100,
html[data-theme="glass"] .text-gray-200,
html[data-theme="glass"] [class*="hover:text-gray-"]:hover,
html[data-theme="glass"] .group:hover [class*="group-hover:text-gray-"] {
    color: var(--theme-text-muted) !important;
}

html[data-theme="glass"] hr,
html[data-theme="glass"] .border,
html[data-theme="glass"] .border-t,
html[data-theme="glass"] .border-r,
html[data-theme="glass"] .border-b,
html[data-theme="glass"] .border-l,
html[data-theme="glass"] .divide-gray-200 > :not([hidden]) ~ :not([hidden]),
html[data-theme="glass"] .divide-gray-300 > :not([hidden]) ~ :not([hidden]) {
    border-color: var(--theme-border) !important;
}

html[data-theme="glass"] .shadow-sm,
html[data-theme="glass"] .shadow,
html[data-theme="glass"] .shadow-md {
    box-shadow: var(--theme-glass-highlight), var(--theme-glass-shadow) !important;
}

html[data-theme="glass"] input:not([type="checkbox"]):not([type="radio"]),
html[data-theme="glass"] select,
html[data-theme="glass"] textarea,
html[data-theme="glass"] .swal2-input,
html[data-theme="glass"] .swal2-textarea,
html[data-theme="glass"] .swal2-select {
    background: var(--theme-glass-material-muted) !important;
    border-color: var(--theme-border-strong) !important;
    color: var(--theme-text) !important;
    box-shadow: var(--theme-glass-edge-highlight), 0 8px 18px rgba(45, 58, 82, 0.075);
    -webkit-backdrop-filter: blur(var(--theme-glass-blur-soft)) saturate(1.2);
    backdrop-filter: blur(var(--theme-glass-blur-soft)) saturate(1.2);
}

html[data-theme="glass"] input:not([type="checkbox"]):not([type="radio"]):focus,
html[data-theme="glass"] select:focus,
html[data-theme="glass"] textarea:focus {
    border-color: rgba(var(--theme-accent-indigo-rgb), 0.42) !important;
    box-shadow: var(--theme-focus-glow) !important;
    outline: none;
}

html[data-theme="glass"] input[readonly],
html[data-theme="glass"] textarea[readonly],
html[data-theme="glass"] input:not([type="checkbox"]):not([type="radio"]):disabled,
html[data-theme="glass"] select:disabled,
html[data-theme="glass"] textarea:disabled,
html[data-theme="glass"] button:disabled,
html[data-theme="glass"] .disabled,
html[data-theme="glass"] [aria-disabled="true"] {
    background: var(--theme-surface-disabled) !important;
    color: var(--theme-text-faint) !important;
    cursor: not-allowed;
    opacity: 0.68;
}

html[data-theme="glass"] input[type="checkbox"],
html[data-theme="glass"] input[type="radio"] {
    background-color: rgba(255, 255, 255, 0.66);
    border-color: var(--theme-border-strong);
    color: var(--theme-accent);
    accent-color: var(--theme-accent);
}

html[data-theme="glass"] option,
html[data-theme="glass"] optgroup {
    background-color: rgba(255, 255, 255, 0.94);
    color: var(--theme-text);
}

html[data-theme="glass"] table {
    color: var(--theme-text-soft);
}

html[data-theme="glass"] thead,
html[data-theme="glass"] tfoot {
    background: var(--theme-glass-bg-muted) !important;
    color: var(--theme-text) !important;
}

html[data-theme="glass"] th,
html[data-theme="glass"] td,
html[data-theme="glass"] tbody,
html[data-theme="glass"] tr {
    border-color: var(--theme-border) !important;
}

html[data-theme="glass"] tr[class*="hover:bg-"]:hover,
html[data-theme="glass"] tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.46) !important;
}

html[data-theme="glass"] .bg-blue-50,
html[data-theme="glass"] .bg-blue-100,
html[data-theme="glass"] .bg-blue-200 {
    background-color: rgba(var(--theme-accent-blue-rgb), 0.12) !important;
}

html[data-theme="glass"] .bg-sky-50,
html[data-theme="glass"] .bg-sky-100,
html[data-theme="glass"] .bg-sky-200 {
    background-color: rgba(var(--theme-accent-blue-rgb), 0.12) !important;
}

html[data-theme="glass"] .bg-indigo-50,
html[data-theme="glass"] .bg-indigo-100,
html[data-theme="glass"] .bg-indigo-200,
html[data-theme="glass"] .bg-purple-50,
html[data-theme="glass"] .bg-purple-100,
html[data-theme="glass"] .bg-purple-200,
html[data-theme="glass"] .bg-violet-50,
html[data-theme="glass"] .bg-violet-100,
html[data-theme="glass"] .bg-violet-200 {
    background-color: rgba(var(--theme-accent-indigo-rgb), 0.12) !important;
}

html[data-theme="glass"] .bg-green-50,
html[data-theme="glass"] .bg-green-100,
html[data-theme="glass"] .bg-green-200,
html[data-theme="glass"] .bg-emerald-50,
html[data-theme="glass"] .bg-emerald-100,
html[data-theme="glass"] .bg-emerald-200,
html[data-theme="glass"] .bg-teal-50,
html[data-theme="glass"] .bg-teal-100,
html[data-theme="glass"] .bg-teal-200 {
    background-color: rgba(var(--theme-accent-teal-rgb), 0.12) !important;
}

html[data-theme="glass"] .bg-yellow-50,
html[data-theme="glass"] .bg-yellow-100,
html[data-theme="glass"] .bg-yellow-200,
html[data-theme="glass"] .bg-amber-50,
html[data-theme="glass"] .bg-amber-100,
html[data-theme="glass"] .bg-amber-200,
html[data-theme="glass"] .bg-orange-50,
html[data-theme="glass"] .bg-orange-100,
html[data-theme="glass"] .bg-orange-200 {
    background-color: rgba(var(--theme-accent-amber-rgb), 0.13) !important;
}

html[data-theme="glass"] .bg-red-50,
html[data-theme="glass"] .bg-red-100,
html[data-theme="glass"] .bg-red-200,
html[data-theme="glass"] .bg-rose-50,
html[data-theme="glass"] .bg-rose-100,
html[data-theme="glass"] .bg-rose-200,
html[data-theme="glass"] .bg-pink-50,
html[data-theme="glass"] .bg-pink-100,
html[data-theme="glass"] .bg-pink-200 {
    background-color: rgba(var(--theme-accent-rose-rgb), 0.12) !important;
}

html[data-theme="glass"] .text-blue-100,
html[data-theme="glass"] .text-blue-200,
html[data-theme="glass"] .text-indigo-100,
html[data-theme="glass"] .text-indigo-200,
html[data-theme="glass"] .text-purple-100,
html[data-theme="glass"] .text-purple-200,
html[data-theme="glass"] .text-violet-100,
html[data-theme="glass"] .text-violet-200,
html[data-theme="glass"] .text-cyan-100,
html[data-theme="glass"] .text-cyan-200,
html[data-theme="glass"] .text-teal-100,
html[data-theme="glass"] .text-teal-200,
html[data-theme="glass"] .text-green-100,
html[data-theme="glass"] .text-green-200,
html[data-theme="glass"] .text-emerald-100,
html[data-theme="glass"] .text-emerald-200,
html[data-theme="glass"] .text-yellow-100,
html[data-theme="glass"] .text-yellow-200,
html[data-theme="glass"] .text-amber-100,
html[data-theme="glass"] .text-amber-200,
html[data-theme="glass"] .text-orange-100,
html[data-theme="glass"] .text-orange-200,
html[data-theme="glass"] .text-red-100,
html[data-theme="glass"] .text-red-200,
html[data-theme="glass"] .text-rose-100,
html[data-theme="glass"] .text-rose-200,
html[data-theme="glass"] .text-pink-100,
html[data-theme="glass"] .text-pink-200 {
    color: var(--theme-glass-caption) !important;
}

html[data-theme="glass"] .text-blue-500,
html[data-theme="glass"] .text-blue-600,
html[data-theme="glass"] .text-blue-700,
html[data-theme="glass"] .text-blue-800,
html[data-theme="glass"] .text-blue-900,
html[data-theme="glass"] [class*="hover:text-blue-"]:hover,
html[data-theme="glass"] .group:hover [class*="group-hover:text-blue-"] {
    color: var(--theme-accent-blue) !important;
}

html[data-theme="glass"] .text-sky-500,
html[data-theme="glass"] .text-sky-600,
html[data-theme="glass"] .text-sky-700,
html[data-theme="glass"] .text-sky-800,
html[data-theme="glass"] .text-sky-900,
html[data-theme="glass"] [class*="hover:text-sky-"]:hover,
html[data-theme="glass"] .group:hover [class*="group-hover:text-sky-"] {
    color: var(--theme-accent-blue) !important;
}

html[data-theme="glass"] .text-indigo-500,
html[data-theme="glass"] .text-indigo-600,
html[data-theme="glass"] .text-indigo-700,
html[data-theme="glass"] .text-indigo-800,
html[data-theme="glass"] .text-indigo-900,
html[data-theme="glass"] .text-purple-500,
html[data-theme="glass"] .text-purple-600,
html[data-theme="glass"] .text-purple-700,
html[data-theme="glass"] .text-purple-800,
html[data-theme="glass"] .text-purple-900,
html[data-theme="glass"] .text-violet-500,
html[data-theme="glass"] .text-violet-600,
html[data-theme="glass"] .text-violet-700,
html[data-theme="glass"] .text-violet-800,
html[data-theme="glass"] .text-violet-900,
html[data-theme="glass"] [class*="hover:text-indigo-"]:hover,
html[data-theme="glass"] [class*="hover:text-purple-"]:hover,
html[data-theme="glass"] [class*="hover:text-violet-"]:hover,
html[data-theme="glass"] .group:hover [class*="group-hover:text-indigo-"],
html[data-theme="glass"] .group:hover [class*="group-hover:text-purple-"],
html[data-theme="glass"] .group:hover [class*="group-hover:text-violet-"] {
    color: var(--theme-accent-indigo) !important;
}

html[data-theme="glass"] .text-cyan-500,
html[data-theme="glass"] .text-cyan-600,
html[data-theme="glass"] .text-cyan-700,
html[data-theme="glass"] .text-cyan-800,
html[data-theme="glass"] .text-cyan-900,
html[data-theme="glass"] [class*="hover:text-cyan-"]:hover,
html[data-theme="glass"] .group:hover [class*="group-hover:text-cyan-"] {
    color: var(--theme-accent-cyan) !important;
}

html[data-theme="glass"] .text-green-500,
html[data-theme="glass"] .text-green-600,
html[data-theme="glass"] .text-green-700,
html[data-theme="glass"] .text-green-800,
html[data-theme="glass"] .text-green-900,
html[data-theme="glass"] .text-emerald-500,
html[data-theme="glass"] .text-emerald-600,
html[data-theme="glass"] .text-emerald-700,
html[data-theme="glass"] .text-emerald-800,
html[data-theme="glass"] .text-emerald-900,
html[data-theme="glass"] .text-teal-500,
html[data-theme="glass"] .text-teal-600,
html[data-theme="glass"] .text-teal-700,
html[data-theme="glass"] .text-teal-800,
html[data-theme="glass"] .text-teal-900,
html[data-theme="glass"] [class*="hover:text-green-"]:hover,
html[data-theme="glass"] [class*="hover:text-emerald-"]:hover,
html[data-theme="glass"] [class*="hover:text-teal-"]:hover,
html[data-theme="glass"] .group:hover [class*="group-hover:text-green-"],
html[data-theme="glass"] .group:hover [class*="group-hover:text-emerald-"],
html[data-theme="glass"] .group:hover [class*="group-hover:text-teal-"] {
    color: var(--theme-accent-teal) !important;
}

html[data-theme="glass"] .text-yellow-500,
html[data-theme="glass"] .text-yellow-600,
html[data-theme="glass"] .text-yellow-700,
html[data-theme="glass"] .text-yellow-800,
html[data-theme="glass"] .text-yellow-900,
html[data-theme="glass"] .text-amber-500,
html[data-theme="glass"] .text-amber-600,
html[data-theme="glass"] .text-amber-700,
html[data-theme="glass"] .text-amber-800,
html[data-theme="glass"] .text-amber-900,
html[data-theme="glass"] .text-orange-500,
html[data-theme="glass"] .text-orange-600,
html[data-theme="glass"] .text-orange-700,
html[data-theme="glass"] .text-orange-800,
html[data-theme="glass"] .text-orange-900,
html[data-theme="glass"] [class*="hover:text-yellow-"]:hover,
html[data-theme="glass"] [class*="hover:text-amber-"]:hover,
html[data-theme="glass"] [class*="hover:text-orange-"]:hover,
html[data-theme="glass"] .group:hover [class*="group-hover:text-yellow-"],
html[data-theme="glass"] .group:hover [class*="group-hover:text-amber-"],
html[data-theme="glass"] .group:hover [class*="group-hover:text-orange-"] {
    color: var(--theme-accent-amber) !important;
}

html[data-theme="glass"] .text-red-500,
html[data-theme="glass"] .text-red-600,
html[data-theme="glass"] .text-red-700,
html[data-theme="glass"] .text-red-800,
html[data-theme="glass"] .text-red-900,
html[data-theme="glass"] .text-rose-500,
html[data-theme="glass"] .text-rose-600,
html[data-theme="glass"] .text-rose-700,
html[data-theme="glass"] .text-rose-800,
html[data-theme="glass"] .text-rose-900,
html[data-theme="glass"] .text-pink-500,
html[data-theme="glass"] .text-pink-600,
html[data-theme="glass"] .text-pink-700,
html[data-theme="glass"] .text-pink-800,
html[data-theme="glass"] .text-pink-900,
html[data-theme="glass"] [class*="hover:text-red-"]:hover,
html[data-theme="glass"] [class*="hover:text-rose-"]:hover,
html[data-theme="glass"] [class*="hover:text-pink-"]:hover,
html[data-theme="glass"] .group:hover [class*="group-hover:text-red-"],
html[data-theme="glass"] .group:hover [class*="group-hover:text-rose-"],
html[data-theme="glass"] .group:hover [class*="group-hover:text-pink-"] {
    color: var(--theme-accent-rose) !important;
}

html[data-theme="glass"] .bg-blue-500,
html[data-theme="glass"] .bg-blue-600,
html[data-theme="glass"] .bg-blue-700,
html[data-theme="glass"] .bg-indigo-500,
html[data-theme="glass"] .bg-indigo-600,
html[data-theme="glass"] .bg-indigo-700,
html[data-theme="glass"] .bg-purple-500,
html[data-theme="glass"] .bg-purple-600,
html[data-theme="glass"] .bg-purple-700,
html[data-theme="glass"] .bg-cyan-500,
html[data-theme="glass"] .bg-cyan-600,
html[data-theme="glass"] .bg-cyan-700,
html[data-theme="glass"] .bg-teal-500,
html[data-theme="glass"] .bg-teal-600,
html[data-theme="glass"] .bg-teal-700,
html[data-theme="glass"] .bg-green-500,
html[data-theme="glass"] .bg-green-600,
html[data-theme="glass"] .bg-green-700,
html[data-theme="glass"] .bg-emerald-500,
html[data-theme="glass"] .bg-emerald-600,
html[data-theme="glass"] .bg-emerald-700,
html[data-theme="glass"] .bg-yellow-500,
html[data-theme="glass"] .bg-yellow-600,
html[data-theme="glass"] .bg-yellow-700,
html[data-theme="glass"] .bg-amber-500,
html[data-theme="glass"] .bg-amber-600,
html[data-theme="glass"] .bg-amber-700,
html[data-theme="glass"] .bg-orange-500,
html[data-theme="glass"] .bg-orange-600,
html[data-theme="glass"] .bg-orange-700,
html[data-theme="glass"] .bg-red-500,
html[data-theme="glass"] .bg-red-600,
html[data-theme="glass"] .bg-red-700,
html[data-theme="glass"] .bg-rose-500,
html[data-theme="glass"] .bg-rose-600,
html[data-theme="glass"] .bg-rose-700,
html[data-theme="glass"] .bg-pink-500,
html[data-theme="glass"] .bg-pink-600,
html[data-theme="glass"] .bg-pink-700 {
    background:
        var(--theme-glass-reflection),
        linear-gradient(145deg, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0.30)),
        linear-gradient(135deg, rgba(var(--theme-accent-indigo-rgb), 0.22), rgba(var(--theme-accent-blue-rgb), 0.14)) !important;
    border: 1px solid rgba(255, 255, 255, 0.52) !important;
    color: var(--theme-text) !important;
    box-shadow: var(--theme-glass-highlight), var(--theme-glass-button-shadow) !important;
    -webkit-backdrop-filter: blur(var(--theme-glass-blur-soft)) saturate(1.2);
    backdrop-filter: blur(var(--theme-glass-blur-soft)) saturate(1.2);
}

html[data-theme="glass"] .hover\:bg-blue-600:hover,
html[data-theme="glass"] .hover\:bg-blue-700:hover,
html[data-theme="glass"] .hover\:bg-indigo-600:hover,
html[data-theme="glass"] .hover\:bg-indigo-700:hover,
html[data-theme="glass"] .hover\:bg-purple-600:hover,
html[data-theme="glass"] .hover\:bg-purple-700:hover,
html[data-theme="glass"] .hover\:bg-cyan-600:hover,
html[data-theme="glass"] .hover\:bg-cyan-700:hover,
html[data-theme="glass"] .hover\:bg-green-600:hover,
html[data-theme="glass"] .hover\:bg-green-700:hover,
html[data-theme="glass"] .hover\:bg-amber-600:hover,
html[data-theme="glass"] .hover\:bg-orange-600:hover,
html[data-theme="glass"] .hover\:bg-red-600:hover,
html[data-theme="glass"] .hover\:bg-rose-600:hover {
    background:
        var(--theme-glass-reflection),
        linear-gradient(145deg, rgba(255, 255, 255, 0.68), rgba(255, 255, 255, 0.36)),
        linear-gradient(135deg, rgba(var(--theme-accent-indigo-rgb), 0.25), rgba(var(--theme-accent-blue-rgb), 0.17)) !important;
    transform: translateY(-1px);
}

html[data-theme="glass"] body.logged-in .bg-gradient-to-r:not(.bg-clip-text),
html[data-theme="glass"] body.logged-in .bg-gradient-to-br:not(.bg-clip-text) {
    background-image:
        var(--theme-glass-reflection),
        linear-gradient(145deg, rgba(255, 255, 255, 0.74), rgba(255, 255, 255, 0.46)),
        linear-gradient(135deg, rgba(var(--theme-accent-indigo-rgb), 0.18), rgba(var(--theme-accent-blue-rgb), 0.13), rgba(var(--theme-accent-amber-rgb), 0.07)) !important;
    border: 1px solid var(--theme-glass-border) !important;
    color: var(--theme-text) !important;
    box-shadow: var(--theme-glass-highlight), var(--theme-glass-shadow-elevated) !important;
    -webkit-backdrop-filter: blur(var(--theme-glass-blur)) saturate(var(--theme-glass-saturate));
    backdrop-filter: blur(var(--theme-glass-blur)) saturate(var(--theme-glass-saturate));
}

html[data-theme="glass"] body.logged-in .bg-gradient-to-r:not(.bg-clip-text) .text-white,
html[data-theme="glass"] body.logged-in .bg-gradient-to-r:not(.bg-clip-text).text-white,
html[data-theme="glass"] body.logged-in .bg-gradient-to-br:not(.bg-clip-text) .text-white,
html[data-theme="glass"] body.logged-in .bg-gradient-to-br:not(.bg-clip-text).text-white {
    color: var(--theme-glass-stat-value) !important;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.42);
}

html[data-theme="glass"] body.logged-in .counter-animation {
    color: var(--theme-glass-stat-value) !important;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.48);
}

html[data-theme="glass"] body.logged-in .bg-gradient-to-r:not(.bg-clip-text) .text-blue-100,
html[data-theme="glass"] body.logged-in .bg-gradient-to-r:not(.bg-clip-text) .text-blue-200,
html[data-theme="glass"] body.logged-in .bg-gradient-to-r:not(.bg-clip-text) .text-indigo-100,
html[data-theme="glass"] body.logged-in .bg-gradient-to-r:not(.bg-clip-text) .text-indigo-200,
html[data-theme="glass"] body.logged-in .bg-gradient-to-r:not(.bg-clip-text) .text-purple-100,
html[data-theme="glass"] body.logged-in .bg-gradient-to-r:not(.bg-clip-text) .text-purple-200,
html[data-theme="glass"] body.logged-in .bg-gradient-to-r:not(.bg-clip-text) .text-violet-100,
html[data-theme="glass"] body.logged-in .bg-gradient-to-r:not(.bg-clip-text) .text-violet-200,
html[data-theme="glass"] body.logged-in .bg-gradient-to-r:not(.bg-clip-text) .text-cyan-100,
html[data-theme="glass"] body.logged-in .bg-gradient-to-r:not(.bg-clip-text) .text-cyan-200,
html[data-theme="glass"] body.logged-in .bg-gradient-to-r:not(.bg-clip-text) .text-teal-100,
html[data-theme="glass"] body.logged-in .bg-gradient-to-r:not(.bg-clip-text) .text-teal-200,
html[data-theme="glass"] body.logged-in .bg-gradient-to-r:not(.bg-clip-text) .text-green-100,
html[data-theme="glass"] body.logged-in .bg-gradient-to-r:not(.bg-clip-text) .text-green-200,
html[data-theme="glass"] body.logged-in .bg-gradient-to-r:not(.bg-clip-text) .text-emerald-100,
html[data-theme="glass"] body.logged-in .bg-gradient-to-r:not(.bg-clip-text) .text-emerald-200,
html[data-theme="glass"] body.logged-in .bg-gradient-to-r:not(.bg-clip-text) .text-yellow-100,
html[data-theme="glass"] body.logged-in .bg-gradient-to-r:not(.bg-clip-text) .text-yellow-200,
html[data-theme="glass"] body.logged-in .bg-gradient-to-r:not(.bg-clip-text) .text-amber-100,
html[data-theme="glass"] body.logged-in .bg-gradient-to-r:not(.bg-clip-text) .text-amber-200,
html[data-theme="glass"] body.logged-in .bg-gradient-to-r:not(.bg-clip-text) .text-orange-100,
html[data-theme="glass"] body.logged-in .bg-gradient-to-r:not(.bg-clip-text) .text-orange-200,
html[data-theme="glass"] body.logged-in .bg-gradient-to-r:not(.bg-clip-text) .text-red-100,
html[data-theme="glass"] body.logged-in .bg-gradient-to-r:not(.bg-clip-text) .text-red-200,
html[data-theme="glass"] body.logged-in .bg-gradient-to-r:not(.bg-clip-text) .text-rose-100,
html[data-theme="glass"] body.logged-in .bg-gradient-to-r:not(.bg-clip-text) .text-rose-200,
html[data-theme="glass"] body.logged-in .bg-gradient-to-r:not(.bg-clip-text) .text-pink-100,
html[data-theme="glass"] body.logged-in .bg-gradient-to-r:not(.bg-clip-text) .text-pink-200,
html[data-theme="glass"] body.logged-in .bg-gradient-to-br:not(.bg-clip-text) .text-blue-100,
html[data-theme="glass"] body.logged-in .bg-gradient-to-br:not(.bg-clip-text) .text-blue-200,
html[data-theme="glass"] body.logged-in .bg-gradient-to-br:not(.bg-clip-text) .text-indigo-100,
html[data-theme="glass"] body.logged-in .bg-gradient-to-br:not(.bg-clip-text) .text-indigo-200,
html[data-theme="glass"] body.logged-in .bg-gradient-to-br:not(.bg-clip-text) .text-purple-100,
html[data-theme="glass"] body.logged-in .bg-gradient-to-br:not(.bg-clip-text) .text-purple-200,
html[data-theme="glass"] body.logged-in .bg-gradient-to-br:not(.bg-clip-text) .text-violet-100,
html[data-theme="glass"] body.logged-in .bg-gradient-to-br:not(.bg-clip-text) .text-violet-200,
html[data-theme="glass"] body.logged-in .bg-gradient-to-br:not(.bg-clip-text) .text-cyan-100,
html[data-theme="glass"] body.logged-in .bg-gradient-to-br:not(.bg-clip-text) .text-cyan-200,
html[data-theme="glass"] body.logged-in .bg-gradient-to-br:not(.bg-clip-text) .text-teal-100,
html[data-theme="glass"] body.logged-in .bg-gradient-to-br:not(.bg-clip-text) .text-teal-200,
html[data-theme="glass"] body.logged-in .bg-gradient-to-br:not(.bg-clip-text) .text-green-100,
html[data-theme="glass"] body.logged-in .bg-gradient-to-br:not(.bg-clip-text) .text-green-200,
html[data-theme="glass"] body.logged-in .bg-gradient-to-br:not(.bg-clip-text) .text-emerald-100,
html[data-theme="glass"] body.logged-in .bg-gradient-to-br:not(.bg-clip-text) .text-emerald-200,
html[data-theme="glass"] body.logged-in .bg-gradient-to-br:not(.bg-clip-text) .text-yellow-100,
html[data-theme="glass"] body.logged-in .bg-gradient-to-br:not(.bg-clip-text) .text-yellow-200,
html[data-theme="glass"] body.logged-in .bg-gradient-to-br:not(.bg-clip-text) .text-amber-100,
html[data-theme="glass"] body.logged-in .bg-gradient-to-br:not(.bg-clip-text) .text-amber-200,
html[data-theme="glass"] body.logged-in .bg-gradient-to-br:not(.bg-clip-text) .text-orange-100,
html[data-theme="glass"] body.logged-in .bg-gradient-to-br:not(.bg-clip-text) .text-orange-200,
html[data-theme="glass"] body.logged-in .bg-gradient-to-br:not(.bg-clip-text) .text-red-100,
html[data-theme="glass"] body.logged-in .bg-gradient-to-br:not(.bg-clip-text) .text-red-200,
html[data-theme="glass"] body.logged-in .bg-gradient-to-br:not(.bg-clip-text) .text-rose-100,
html[data-theme="glass"] body.logged-in .bg-gradient-to-br:not(.bg-clip-text) .text-rose-200,
html[data-theme="glass"] body.logged-in .bg-gradient-to-br:not(.bg-clip-text) .text-pink-100,
html[data-theme="glass"] body.logged-in .bg-gradient-to-br:not(.bg-clip-text) .text-pink-200 {
    color: var(--theme-glass-stat-label) !important;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.38);
}

html[data-theme="glass"] body.logged-in .bg-gradient-to-r:not(.bg-clip-text) svg,
html[data-theme="glass"] body.logged-in .bg-gradient-to-br:not(.bg-clip-text) svg {
    color: var(--theme-glass-icon) !important;
    stroke: currentColor;
}

html[data-theme="glass"] body.logged-in .bg-gradient-to-r:not(.bg-clip-text) .bg-white.bg-opacity-20,
html[data-theme="glass"] body.logged-in .bg-gradient-to-br:not(.bg-clip-text) .bg-white.bg-opacity-20,
html[data-theme="glass"] body.logged-in .bg-gradient-to-r:not(.bg-clip-text) .bg-white.bg-opacity-30,
html[data-theme="glass"] body.logged-in .bg-gradient-to-br:not(.bg-clip-text) .bg-white.bg-opacity-30 {
    background-color: rgba(255, 255, 255, 0.58) !important;
    border: 1px solid rgba(255, 255, 255, 0.54);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.76), 0 8px 18px rgba(45, 58, 82, 0.08);
}

html[data-theme="glass"] .type-card:hover,
html[data-theme="glass"] .template-card:hover,
html[data-theme="glass"] label[class*="has-[:checked]:bg-"]:hover {
    background: var(--theme-glass-material-elevated) !important;
    border-color: var(--theme-glass-border-strong) !important;
}

html[data-theme="glass"] .type-card.selected,
html[data-theme="glass"] .template-card.selected,
html[data-theme="glass"] label[class*="has-[:checked]:bg-"]:has(input[type="radio"]:checked),
html[data-theme="glass"] label[class*="has-[:checked]:bg-"]:has(input[type="checkbox"]:checked),
html[data-theme="glass"] body.logged-in label:has(input[name="export_type"]:checked) {
    background: var(--theme-glass-material-selected) !important;
    border-color: rgba(var(--theme-accent-indigo-rgb), 0.36) !important;
    color: var(--theme-text) !important;
    box-shadow: var(--theme-glass-highlight), var(--theme-glass-shadow-selected) !important;
}

html[data-theme="glass"] body.logged-in label:has(input[name="export_type"][value="incoming"]:checked) {
    border-color: rgba(var(--theme-accent-blue-rgb), 0.38) !important;
    box-shadow: var(--theme-glass-highlight), 0 22px 54px rgba(var(--theme-accent-blue-rgb), 0.15), 0 0 0 1px rgba(var(--theme-accent-blue-rgb), 0.13) !important;
}

html[data-theme="glass"] body.logged-in label:has(input[name="export_type"][value="outgoing"]:checked) {
    border-color: rgba(var(--theme-accent-green-rgb), 0.36) !important;
    box-shadow: var(--theme-glass-highlight), 0 22px 54px rgba(var(--theme-accent-green-rgb), 0.13), 0 0 0 1px rgba(var(--theme-accent-green-rgb), 0.12) !important;
}

html[data-theme="glass"] body.logged-in label:has(input[name="export_type"][value="inheritance"]:checked) {
    border-color: rgba(var(--theme-accent-indigo-rgb), 0.38) !important;
    box-shadow: var(--theme-glass-highlight), 0 22px 54px rgba(var(--theme-accent-indigo-rgb), 0.14), 0 0 0 1px rgba(var(--theme-accent-indigo-rgb), 0.13) !important;
}

html[data-theme="glass"] body.logged-in label:has(input[name="export_type"][value="notarization"]:checked) {
    border-color: rgba(var(--theme-accent-amber-rgb), 0.38) !important;
    box-shadow: var(--theme-glass-highlight), 0 22px 54px rgba(var(--theme-accent-amber-rgb), 0.13), 0 0 0 1px rgba(var(--theme-accent-amber-rgb), 0.12) !important;
}

html[data-theme="glass"] body.logged-in label:has(input[name="export_type"]:checked) > .absolute svg {
    filter: drop-shadow(0 4px 10px rgba(45, 58, 82, 0.16));
}

html[data-theme="glass"] body.logged-in label:has(input[name="export_type"][value="incoming"]:checked) .bg-blue-100 {
    background-color: rgba(var(--theme-accent-blue-rgb), 0.18) !important;
    border: 1px solid rgba(var(--theme-accent-blue-rgb), 0.18);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.66);
}

html[data-theme="glass"] body.logged-in label:has(input[name="export_type"][value="outgoing"]:checked) .bg-green-100 {
    background-color: rgba(var(--theme-accent-green-rgb), 0.18) !important;
    border: 1px solid rgba(var(--theme-accent-green-rgb), 0.18);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.66);
}

html[data-theme="glass"] body.logged-in label:has(input[name="export_type"][value="inheritance"]:checked) .bg-purple-100 {
    background-color: rgba(var(--theme-accent-indigo-rgb), 0.18) !important;
    border: 1px solid rgba(var(--theme-accent-indigo-rgb), 0.18);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.66);
}

html[data-theme="glass"] body.logged-in label:has(input[name="export_type"][value="notarization"]:checked) .bg-orange-100 {
    background-color: rgba(var(--theme-accent-amber-rgb), 0.18) !important;
    border: 1px solid rgba(var(--theme-accent-amber-rgb), 0.18);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.66);
}

html[data-theme="glass"] label[class*="has-[:checked]:bg-"] .font-medium,
html[data-theme="glass"] label[class*="has-[:checked]:bg-"] .text-gray-900,
html[data-theme="glass"] body.logged-in label:has(input[name="export_type"]) .font-medium {
    color: var(--theme-text) !important;
}

html[data-theme="glass"] label[class*="has-[:checked]:bg-"] .text-sm,
html[data-theme="glass"] label[class*="has-[:checked]:bg-"] .text-gray-500,
html[data-theme="glass"] body.logged-in label:has(input[name="export_type"]) .text-sm {
    color: var(--theme-glass-caption) !important;
}

html[data-theme="glass"] body.logged-in button[type="submit"].bg-gradient-to-r {
    background:
        var(--theme-glass-reflection),
        linear-gradient(145deg, rgba(255, 255, 255, 0.68), rgba(255, 255, 255, 0.42)),
        linear-gradient(135deg, rgba(var(--theme-accent-amber-rgb), 0.20), rgba(var(--theme-accent-orange-rgb), 0.13)) !important;
    border: 1px solid rgba(255, 255, 255, 0.58) !important;
    color: var(--theme-text) !important;
    box-shadow: var(--theme-glass-highlight), var(--theme-glass-button-shadow) !important;
    -webkit-backdrop-filter: blur(var(--theme-glass-blur-soft)) saturate(1.22);
    backdrop-filter: blur(var(--theme-glass-blur-soft)) saturate(1.22);
}

html[data-theme="glass"] body.logged-in button[type="submit"].bg-gradient-to-r:hover {
    box-shadow: var(--theme-glass-highlight), 0 18px 40px rgba(var(--theme-accent-amber-rgb), 0.16), 0 7px 16px rgba(15, 23, 42, 0.08) !important;
    transform: translateY(-1px);
}

html[data-theme="glass"] body.logged-in button[type="submit"].bg-gradient-to-r:active {
    transform: translateY(0);
    box-shadow: var(--theme-glass-inner-highlight), 0 8px 18px rgba(45, 58, 82, 0.12) !important;
}

html[data-theme="glass"] body.logged-in button[type="submit"].bg-gradient-to-r:focus-visible {
    outline: none;
    box-shadow: var(--theme-glass-highlight), var(--theme-focus-glow) !important;
}

/* ===== Glass Interactive Contrast ===== */
html[data-theme="glass"] body.logged-in .main-content .bg-white:is(.shadow, .shadow-sm, .shadow-md, .shadow-lg, .shadow-xl, .shadow-2xl) {
    background: var(--theme-glass-material-elevated) !important;
    border: 1px solid rgba(104, 119, 143, 0.20);
    box-shadow: var(--theme-glass-highlight), var(--theme-glass-shadow) !important;
    -webkit-backdrop-filter: blur(var(--theme-glass-blur)) saturate(var(--theme-glass-saturate));
    backdrop-filter: blur(var(--theme-glass-blur)) saturate(var(--theme-glass-saturate));
}

html[data-theme="glass"] body.logged-in .main-content :is(.glass-list-row, .glass-row, .file-row, #foldersList > div:not(.text-center), #filesList > div, #moveFoldersList > div:not(.text-center)) {
    background: var(--glass-row-background) !important;
    border-color: var(--glass-row-border) !important;
    color: var(--theme-text-soft);
    box-shadow: var(--glass-row-shadow) !important;
    -webkit-backdrop-filter: blur(var(--theme-glass-blur-soft)) saturate(1.18);
    backdrop-filter: blur(var(--theme-glass-blur-soft)) saturate(1.18);
    transition:
        background 160ms ease,
        border-color 160ms ease,
        box-shadow 160ms ease,
        transform 160ms ease,
        color 160ms ease;
}

html[data-theme="glass"] body.logged-in .main-content :is(.glass-list-row, .glass-row, .file-row, #foldersList > div:not(.text-center), #filesList > div, #moveFoldersList > div:not(.text-center)):hover {
    background: var(--glass-row-hover-bg) !important;
    border-color: var(--glass-row-hover-border) !important;
    box-shadow: var(--glass-row-hover-shadow) !important;
    transform: translateY(-1px);
}

html[data-theme="glass"] body.logged-in .main-content :is(.glass-list-row, .glass-row, .file-row, #foldersList > div:not(.text-center), #filesList > div, #moveFoldersList > div:not(.text-center)):active {
    background: var(--glass-active-bg) !important;
    transform: translateY(0);
    box-shadow: var(--theme-glass-inner-highlight), 0 7px 16px rgba(45, 58, 82, 0.10) !important;
}

html[data-theme="glass"] body.logged-in .main-content :is(.glass-list-row, .glass-row, .file-row, #foldersList > div:not(.text-center), #filesList > div, #moveFoldersList > div:not(.text-center)):focus-visible {
    outline: none;
    border-color: rgba(var(--theme-accent-indigo-rgb), 0.46) !important;
    box-shadow: var(--theme-glass-highlight), var(--glass-focus-ring) !important;
}

html[data-theme="glass"] body.logged-in .main-content :is(.glass-list-row, .glass-row, .file-row).is-selected,
html[data-theme="glass"] body.logged-in .main-content :is(.glass-list-row, .glass-row, .file-row).selected,


/* ===== Shared Stat Card Hover ===== */
.stat-hover-card {
    transform: translate3d(0, 0, 0) scale(1);
    transform-origin: center;
    transition:
        transform 220ms cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 220ms cubic-bezier(0.22, 1, 0.36, 1),
        border-color 180ms ease;
}

.stat-hover-card:hover {
    transform: translate3d(0, -3px, 0) scale(1.018);
}

.stat-hover-card:active {
    transform: translate3d(0, -1px, 0) scale(1.01);
}

@media (prefers-reduced-motion: reduce) {
    .card-hover-lift,
    .card-hover-lift:hover,
    .card-hover-lift:active,
    .group:hover .card-hover-lift,
    .group:active .card-hover-lift,
    .stat-hover-card,
    .stat-hover-card:hover,
    .stat-hover-card:active {
        transform: none;
        transition: box-shadow 120ms ease, border-color 120ms ease;
    }
}

html[data-theme="glass"] body.logged-in .main-content :is(.glass-list-row, .glass-row, .file-row).active,
html[data-theme="glass"] body.logged-in .main-content :is(.glass-list-row, .glass-row, .file-row)[aria-current="true"],
html[data-theme="glass"] body.logged-in .main-content :is(.glass-list-row, .glass-row, .file-row)[aria-selected="true"] {
    background: var(--glass-row-active-bg) !important;
    border-color: rgba(var(--theme-accent-indigo-rgb), 0.36) !important;
    color: var(--theme-text);
    box-shadow: var(--theme-glass-highlight), var(--theme-glass-shadow-selected) !important;
}

html[data-theme="glass"] body.logged-in .main-content :is(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), textarea) {
    background: var(--glass-input-bg) !important;
    border-color: var(--glass-input-border) !important;
    color: var(--theme-text) !important;
    box-shadow: var(--theme-glass-inner-highlight), 0 5px 14px rgba(45, 58, 82, 0.08) !important;
    -webkit-backdrop-filter: blur(var(--theme-glass-blur-soft)) saturate(1.12);
    backdrop-filter: blur(var(--theme-glass-blur-soft)) saturate(1.12);
}

html[data-theme="glass"] body.logged-in .main-content select {
    background-color: rgba(255, 255, 255, 0.78) !important;
    border-color: var(--glass-input-border) !important;
    color: var(--theme-text) !important;
    box-shadow: var(--theme-glass-inner-highlight), 0 5px 14px rgba(45, 58, 82, 0.08) !important;
    -webkit-backdrop-filter: blur(var(--theme-glass-blur-soft)) saturate(1.12);
    backdrop-filter: blur(var(--theme-glass-blur-soft)) saturate(1.12);
}

html[data-theme="glass"] body.logged-in .main-content :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea):focus,
html[data-theme="glass"] body.logged-in .main-content :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea):focus-visible {
    outline: none;
    border-color: rgba(var(--theme-accent-indigo-rgb), 0.46) !important;
    box-shadow: var(--theme-glass-highlight), var(--glass-focus-ring) !important;
}

html[data-theme="glass"] body.logged-in .main-content :is(input, textarea)::placeholder {
    color: rgba(51, 65, 85, 0.72) !important;
}

html[data-theme="glass"] body.logged-in .main-content :is(input[type="checkbox"], input[type="radio"]) {
    background-color: rgba(255, 255, 255, 0.78) !important;
    border-color: var(--glass-input-border) !important;
    color: var(--theme-accent-indigo) !important;
    accent-color: var(--theme-accent-indigo);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.74), 0 2px 5px rgba(45, 58, 82, 0.08);
}

html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).glass-btn,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]):not(:disabled) {
    -webkit-tap-highlight-color: rgba(var(--theme-accent-indigo-rgb), 0.16);
}

html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).glass-btn-secondary,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).btn-secondary,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-gray-50,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-gray-100,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-gray-200,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-gray-300,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-gray-400 {
    background: var(--glass-button-secondary-bg) !important;
    border: 1px solid var(--glass-button-secondary-border) !important;
    color: var(--glass-button-secondary-text) !important;
    box-shadow: var(--theme-glass-highlight), var(--theme-glass-button-shadow) !important;
    -webkit-backdrop-filter: blur(var(--theme-glass-blur-soft)) saturate(1.18);
    backdrop-filter: blur(var(--theme-glass-blur-soft)) saturate(1.18);
}

html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).glass-btn-secondary:hover,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).btn-secondary:hover,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-gray-50:hover,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-gray-100:hover,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-gray-200:hover,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-gray-300:hover,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-gray-400:hover {
    background: var(--glass-button-secondary-hover-bg) !important;
    border-color: rgba(79, 70, 229, 0.28) !important;
    box-shadow: var(--theme-glass-highlight), 0 16px 36px rgba(45, 58, 82, 0.14), 0 4px 10px rgba(15, 23, 42, 0.07) !important;
    transform: translateY(-1px);
}

html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).glass-btn-secondary:active,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).btn-secondary:active,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-gray-50:active,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-gray-100:active,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-gray-200:active,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-gray-300:active,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-gray-400:active {
    background: var(--glass-button-secondary-active-bg) !important;
}

html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-blue-50,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-blue-100,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-indigo-50,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-indigo-100,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-purple-50,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-purple-100,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-cyan-50,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-cyan-100 {
    background:
        var(--theme-glass-reflection),
        linear-gradient(145deg, rgba(255, 255, 255, 0.76), rgba(255, 255, 255, 0.52)),
        linear-gradient(135deg, rgba(var(--theme-accent-blue-rgb), 0.16), rgba(var(--theme-accent-indigo-rgb), 0.11)) !important;
    border: 1px solid rgba(var(--theme-accent-blue-rgb), 0.26) !important;
    color: var(--theme-accent-blue) !important;
    box-shadow: var(--theme-glass-highlight), var(--theme-glass-button-shadow) !important;
}

html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-green-50,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-green-100,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-emerald-50,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-emerald-100,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-teal-50,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-teal-100 {
    background:
        var(--theme-glass-reflection),
        linear-gradient(145deg, rgba(255, 255, 255, 0.76), rgba(248, 255, 252, 0.52)),
        linear-gradient(135deg, rgba(var(--theme-accent-green-rgb), 0.15), rgba(var(--theme-accent-teal-rgb), 0.11)) !important;
    border: 1px solid rgba(var(--theme-accent-green-rgb), 0.26) !important;
    color: var(--theme-accent-green) !important;
    box-shadow: var(--theme-glass-highlight), var(--theme-glass-button-shadow) !important;
}

html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-amber-50,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-amber-100,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-yellow-50,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-yellow-100,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-orange-50,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-orange-100 {
    background:
        var(--theme-glass-reflection),
        linear-gradient(145deg, rgba(255, 255, 255, 0.76), rgba(255, 250, 241, 0.54)),
        linear-gradient(135deg, rgba(var(--theme-accent-amber-rgb), 0.16), rgba(var(--theme-accent-orange-rgb), 0.11)) !important;
    border: 1px solid rgba(var(--theme-accent-amber-rgb), 0.28) !important;
    color: var(--theme-accent-amber) !important;
    box-shadow: var(--theme-glass-highlight), var(--theme-glass-button-shadow) !important;
}

html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-blue-50:hover,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-blue-100:hover,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-indigo-50:hover,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-indigo-100:hover,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-purple-50:hover,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-purple-100:hover,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-cyan-50:hover,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-cyan-100:hover {
    background:
        var(--theme-glass-reflection),
        linear-gradient(145deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.62)),
        linear-gradient(135deg, rgba(var(--theme-accent-blue-rgb), 0.20), rgba(var(--theme-accent-indigo-rgb), 0.14)) !important;
    border-color: rgba(var(--theme-accent-blue-rgb), 0.34) !important;
}

html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-green-50:hover,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-green-100:hover,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-emerald-50:hover,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-emerald-100:hover,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-teal-50:hover,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-teal-100:hover {
    background:
        var(--theme-glass-reflection),
        linear-gradient(145deg, rgba(255, 255, 255, 0.88), rgba(248, 255, 252, 0.62)),
        linear-gradient(135deg, rgba(var(--theme-accent-green-rgb), 0.19), rgba(var(--theme-accent-teal-rgb), 0.14)) !important;
    border-color: rgba(var(--theme-accent-green-rgb), 0.34) !important;
}

html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-amber-50:hover,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-amber-100:hover,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-yellow-50:hover,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-yellow-100:hover,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-orange-50:hover,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-orange-100:hover {
    background:
        var(--theme-glass-reflection),
        linear-gradient(145deg, rgba(255, 255, 255, 0.88), rgba(255, 250, 241, 0.64)),
        linear-gradient(135deg, rgba(var(--theme-accent-amber-rgb), 0.20), rgba(var(--theme-accent-orange-rgb), 0.14)) !important;
    border-color: rgba(var(--theme-accent-amber-rgb), 0.36) !important;
}

html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-blue-50:hover,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-blue-100:hover,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-indigo-50:hover,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-indigo-100:hover,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-purple-50:hover,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-purple-100:hover,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-cyan-50:hover,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-cyan-100:hover,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-green-50:hover,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-green-100:hover,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-emerald-50:hover,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-emerald-100:hover,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-teal-50:hover,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-teal-100:hover,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-amber-50:hover,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-amber-100:hover,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-yellow-50:hover,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-yellow-100:hover,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-orange-50:hover,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-orange-100:hover {
    box-shadow: var(--theme-glass-highlight), 0 16px 36px rgba(45, 58, 82, 0.14), 0 4px 10px rgba(15, 23, 42, 0.07) !important;
    transform: translateY(-1px);
}

html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-blue-500,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-blue-600,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-blue-700,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-indigo-500,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-indigo-600,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-indigo-700,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-purple-500,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-purple-600,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-purple-700,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-green-500,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-green-600,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-green-700,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-emerald-500,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-emerald-600,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-emerald-700,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-cyan-500,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-cyan-600,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-cyan-700,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-teal-500,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-teal-600,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-teal-700 {
    background:
        var(--theme-glass-reflection),
        linear-gradient(145deg, rgba(255, 255, 255, 0.76), rgba(255, 255, 255, 0.46)),
        linear-gradient(135deg, rgba(var(--theme-accent-indigo-rgb), 0.34), rgba(var(--theme-accent-blue-rgb), 0.24)) !important;
    border: 1px solid rgba(var(--theme-accent-indigo-rgb), 0.36) !important;
    color: var(--theme-text) !important;
    box-shadow: var(--theme-glass-highlight), 0 18px 42px rgba(var(--theme-accent-indigo-rgb), 0.18), 0 7px 15px rgba(15, 23, 42, 0.09) !important;
}

html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-blue-500:hover,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-blue-600:hover,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-blue-700:hover,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-indigo-500:hover,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-indigo-600:hover,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-indigo-700:hover,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-purple-500:hover,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-purple-600:hover,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-purple-700:hover,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-green-500:hover,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-green-600:hover,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-green-700:hover,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-emerald-500:hover,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-emerald-600:hover,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-emerald-700:hover,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-cyan-500:hover,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-cyan-600:hover,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-cyan-700:hover,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-teal-500:hover,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-teal-600:hover,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-teal-700:hover {
    background:
        var(--theme-glass-reflection),
        linear-gradient(145deg, rgba(255, 255, 255, 0.84), rgba(255, 255, 255, 0.54)),
        linear-gradient(135deg, rgba(var(--theme-accent-indigo-rgb), 0.42), rgba(var(--theme-accent-blue-rgb), 0.30)) !important;
    border-color: rgba(var(--theme-accent-indigo-rgb), 0.44) !important;
    box-shadow: var(--theme-glass-highlight), 0 22px 48px rgba(var(--theme-accent-indigo-rgb), 0.22), 0 8px 18px rgba(15, 23, 42, 0.10) !important;
    transform: translateY(-1px);
}

html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-red-50,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-red-100,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-red-500,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-red-600,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-red-700,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-rose-50,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-rose-100,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-rose-500,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-rose-600,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-rose-700,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).glass-btn-danger {
    background: var(--glass-button-danger-bg) !important;
    border: 1px solid var(--glass-button-danger-border) !important;
    color: var(--glass-button-danger-text) !important;
    box-shadow: var(--theme-glass-highlight), 0 12px 28px rgba(var(--theme-accent-red-rgb), 0.12), 0 3px 8px rgba(15, 23, 42, 0.06) !important;
    -webkit-backdrop-filter: blur(var(--theme-glass-blur-soft)) saturate(1.16);
    backdrop-filter: blur(var(--theme-glass-blur-soft)) saturate(1.16);
}

html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-red-50:hover,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-red-100:hover,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-red-500:hover,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-red-600:hover,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-red-700:hover,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-rose-50:hover,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-rose-100:hover,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-rose-500:hover,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-rose-600:hover,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).bg-rose-700:hover,
html[data-theme="glass"] body.logged-in .main-content :is(button, a, [role="button"]).glass-btn-danger:hover {
    background: var(--glass-button-danger-hover-bg) !important;
    border-color: rgba(var(--theme-accent-red-rgb), 0.42) !important;
    box-shadow: var(--theme-glass-highlight), 0 16px 36px rgba(var(--theme-accent-red-rgb), 0.16), 0 4px 10px rgba(15, 23, 42, 0.07) !important;
    transform: translateY(-1px);
}

html[data-theme="glass"] body.logged-in .main-content :is(button, [role="button"], .btn, .glass-btn, .glass-btn-secondary, .glass-btn-danger, a[class*="bg-"]):active {
    transform: translateY(0);
    box-shadow: var(--theme-glass-inner-highlight), 0 7px 16px rgba(45, 58, 82, 0.10) !important;
}

html[data-theme="glass"] body.logged-in .main-content :is(button, [role="button"], .btn, .glass-btn, .glass-btn-secondary, .glass-btn-danger, a[class*="bg-"]):focus-visible {
    outline: none;
    border-color: rgba(var(--theme-accent-indigo-rgb), 0.46) !important;
    box-shadow: var(--theme-glass-highlight), var(--glass-focus-ring) !important;
}

html[data-theme="glass"] body.logged-in .main-content :is(button, [role="button"], .btn, .glass-btn, .glass-btn-secondary, .glass-btn-danger, a[class*="bg-"], input, select, textarea):disabled,
html[data-theme="glass"] body.logged-in .main-content :is(button, [role="button"], .btn, .glass-btn, .glass-btn-secondary, .glass-btn-danger, a[class*="bg-"], input, select, textarea).disabled,
html[data-theme="glass"] body.logged-in .main-content :is(button, [role="button"], .btn, .glass-btn, .glass-btn-secondary, .glass-btn-danger, a[class*="bg-"], input, select, textarea)[aria-disabled="true"] {
    cursor: not-allowed !important;
    opacity: var(--glass-disabled-opacity) !important;
    transform: none !important;
    filter: saturate(0.76);
}

html[data-theme="glass"] .with-sidebar-footer,
html[data-theme="glass"] .with-sidebar-footer .text-white,
html[data-theme="glass"] .with-sidebar-footer .text-gray-300,
html[data-theme="glass"] .with-sidebar-footer .text-gray-400 {
    color: var(--theme-footer-text) !important;
}

html[data-theme="glass"] .with-sidebar-footer #contact-trigger:hover {
    color: var(--theme-accent-indigo) !important;
}

html[data-theme="glass"] .disabled-card {
    background: var(--theme-surface-disabled) !important;
    color: var(--theme-text-faint) !important;
    opacity: 0.62;
}

html[data-theme="glass"] .bg-black.bg-opacity-50,
html[data-theme="glass"] .bg-gray-600.bg-opacity-50,
html[data-theme="glass"] #sidebar-overlay {
    background-color: var(--theme-glass-overlay) !important;
    -webkit-backdrop-filter: blur(var(--theme-glass-blur-soft)) saturate(1.15);
    backdrop-filter: blur(var(--theme-glass-blur-soft)) saturate(1.15);
}

html[data-theme="glass"] pre,
html[data-theme="glass"] code,
html[data-theme="glass"] kbd {
    background: rgba(255, 255, 255, 0.54) !important;
    color: var(--theme-text-soft) !important;
    border-color: var(--theme-border) !important;
}

html[data-theme="glass"] .var-fill {
    background-color: rgba(var(--theme-accent-green-rgb), 0.12) !important;
    color: var(--theme-accent-green) !important;
    border-radius: 0.2rem;
}

html[data-theme="glass"] ::selection {
    background-color: rgba(var(--theme-accent-indigo-rgb), 0.18);
    color: var(--theme-text);
}

@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
    html[data-theme="glass"] {
        --theme-surface: rgba(255, 255, 255, 0.90);
        --theme-surface-muted: rgba(255, 255, 255, 0.78);
        --theme-surface-strong: rgba(255, 255, 255, 0.94);
        --theme-input-bg: rgba(255, 255, 255, 0.90);
        --theme-glass-bg: rgba(255, 255, 255, 0.90);
        --theme-glass-bg-muted: rgba(255, 255, 255, 0.78);
        --theme-glass-bg-elevated: rgba(255, 255, 255, 0.94);
    }
}

@media (max-width: 640px) {
    html[data-theme="glass"] {
        --theme-glass-blur: 24px;
        --theme-glass-blur-soft: 16px;
        --theme-glass-shadow: 0 12px 28px rgba(52, 65, 92, 0.13), 0 2px 6px rgba(15, 23, 42, 0.05);
        --theme-glass-shadow-elevated: 0 18px 44px rgba(52, 65, 92, 0.16), 0 6px 14px rgba(15, 23, 42, 0.07);
    }
}

/* ===== Mobile App Optimization ===== */
@media (max-width: 1023px) {
    html,
    body.logged-in {
        max-width: 100%;
        overflow-x: hidden;
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }

    body.logged-in .main-content {
        width: 100%;
        max-width: 100vw;
        margin-left: 0 !important;
        padding-bottom: 1.25rem;
    }

    body.logged-in.has-sidebar .main-content {
        padding-top: calc(env(safe-area-inset-top, 0px) + 4rem);
    }

    body.logged-in .main-content *,
    body.logged-in .swal2-container *,
    body.logged-in .fixed.inset-0 * {
        min-width: 0;
    }

    #sidebar {
        width: min(20rem, calc(100vw - 1.5rem)) !important;
        min-width: 0 !important;
        max-width: calc(100vw - 1.5rem) !important;
        height: 100dvh;
        border-radius: 0 1.25rem 1.25rem 0;
    }

    #sidebar .sidebar-logo-section {
        padding-top: calc(env(safe-area-inset-top, 0px) + 1rem);
        padding-left: 1rem;
        padding-right: 1rem;
    }

    #sidebar .sidebar-user-section {
        padding: 0.875rem 1rem;
    }

    #sidebar nav {
        padding: 0.75rem;
    }

    #sidebar nav a,
    #sidebar .sidebar-bottom-section a,
    #sidebar .sidebar-bottom-section button {
        min-height: 3.25rem;
        border-radius: 0.875rem;
    }

    #sidebar .sidebar-bottom-section {
        padding: 0.75rem;
        padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 0.75rem);
    }

    .sidebar-toggle-btn {
        top: calc(env(safe-area-inset-top, 0px) + 0.75rem) !important;
        bottom: auto !important;
        left: 0.75rem !important;
        width: 3rem;
        min-width: 3rem;
        height: 3rem;
        min-height: 3rem;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0 !important;
    }

    #sidebar-overlay {
        z-index: 45;
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
    }

    .with-sidebar-footer {
        left: 0 !important;
        width: 100% !important;
    }
}

@media (max-width: 767px) {
    body.logged-in .main-content > div,
    body.logged-in .main-content .max-w-7xl,
    body.logged-in .main-content .max-w-6xl,
    body.logged-in .main-content .max-w-5xl,
    body.logged-in .main-content .max-w-4xl,
    body.logged-in .main-content .max-w-3xl,
    body.logged-in .main-content .max-w-2xl,
    body.logged-in .main-content .max-w-xl,
    body.logged-in .main-content .max-w-lg,
    body.logged-in .main-content .max-w-md {
        width: 100%;
        max-width: 100% !important;
    }

    body.logged-in .main-content > div[class*="py-6"][class*="px-4"] {
        padding: 0.875rem;
        /* Honour the landscape notch / rounded-corner safe areas (iOS/Android) */
        padding-left: max(0.875rem, env(safe-area-inset-left, 0px));
        padding-right: max(0.875rem, env(safe-area-inset-right, 0px));
    }

    body.logged-in .main-content .px-6 {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    body.logged-in .main-content .py-4 {
        padding-top: 0.875rem !important;
        padding-bottom: 0.875rem !important;
    }

    body.logged-in .main-content .p-6 {
        padding: 1rem !important;
    }

    body.logged-in .main-content .gap-6 {
        gap: 1rem !important;
    }

    body.logged-in .main-content .gap-4 {
        gap: 0.875rem !important;
    }

    body.logged-in .main-content .mb-8 {
        margin-bottom: 1.25rem !important;
    }

    body.logged-in .main-content .mb-6 {
        margin-bottom: 1rem !important;
    }

    body.logged-in .main-content h1,
    body.logged-in .main-content .text-3xl {
        font-size: 1.5rem !important;
        line-height: 2rem !important;
    }

    body.logged-in .main-content h2,
    body.logged-in .main-content .text-2xl {
        font-size: 1.25rem !important;
        line-height: 1.75rem !important;
    }

    body.logged-in .main-content h3,
    body.logged-in .main-content .text-xl {
        font-size: 1.125rem !important;
        line-height: 1.6rem !important;
    }

    body.logged-in .main-content .text-xs,
    body.logged-in .main-content .text-sm {
        line-height: 1.45;
    }

    body.logged-in .main-content .grid,
    body.logged-in .main-content .md\:grid,
    body.logged-in .main-content .lg\:grid {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    body.logged-in .main-content .flex.flex-wrap > .flex-1,
    body.logged-in .main-content .flex.flex-wrap > [class*="min-w-"] {
        flex: 1 1 100% !important;
        min-width: 0 !important;
        width: 100%;
    }

    body.logged-in .main-content [class*="min-w-"] {
        min-width: 0 !important;
    }

    body.logged-in .main-content .whitespace-nowrap {
        white-space: normal !important;
    }

    body.logged-in .main-content [style*="max-width"] {
        max-width: 100% !important;
    }

    body.logged-in .main-content [class*="hover:scale"],
    body.logged-in .main-content [class*="scale-"] {
        transform: none !important;
    }

    body.logged-in button,
    body.logged-in .btn,
    body.logged-in [role="button"],
    body.logged-in input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
    body.logged-in select,
    body.logged-in textarea {
        min-height: 44px;
        font-size: 16px;
    }

    body.logged-in a[class*="px-"],
    body.logged-in a[class*="py-"],
    body.logged-in label[class*="cursor-pointer"] {
        min-height: 44px;
    }

    body.logged-in input[type="checkbox"],
    body.logged-in input[type="radio"] {
        min-width: 1.125rem;
        min-height: 1.125rem;
    }

    body.logged-in .main-content form.flex,
    body.logged-in .main-content form.flex-wrap,
    body.logged-in .main-content form[class*="md:flex"] {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
    }

    body.logged-in .main-content form.flex > *,
    body.logged-in .main-content form.flex-wrap > *,
    body.logged-in .main-content form[class*="md:flex"] > * {
        width: 100% !important;
        max-width: 100% !important;
    }

    body.logged-in .main-content form .flex,
    body.logged-in .main-content [class*="space-x-"] {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    body.logged-in .main-content [class*="space-x-"] > :not([hidden]) ~ :not([hidden]),
    body.logged-in .fixed.inset-0 [class*="space-x-"] > :not([hidden]) ~ :not([hidden]) {
        margin-left: 0 !important;
    }

    body.logged-in .main-content form .flex.gap-2 > button,
    body.logged-in .main-content form .flex.gap-2 > a,
    body.logged-in .main-content form [class*="justify-end"] > button,
    body.logged-in .main-content form [class*="justify-end"] > a {
        flex: 1 1 100%;
        width: 100%;
    }

    body.logged-in .main-content [class*="space-x-"] > a[class*="px-"],
    body.logged-in .main-content [class*="space-x-"] > button[class*="px-"] {
        flex: 1 1 auto;
        justify-content: center;
    }

    body.logged-in .main-content .justify-end {
        justify-content: stretch !important;
    }

    body.logged-in .main-content .justify-end > button,
    body.logged-in .main-content .justify-end > a {
        justify-content: center;
    }

    body.logged-in .main-content label:has(input[name="export_type"]) {
        align-items: flex-start !important;
        min-height: 5.25rem;
        padding: 1rem !important;
    }

    body.logged-in .main-content label:has(input[name="export_type"]) > .absolute {
        top: 0.875rem !important;
        right: 0.875rem !important;
    }

    body.logged-in .mobile-card-table {
        overflow: visible !important;
    }

    body.logged-in .mobile-card-table table {
        display: block;
        width: 100% !important;
        min-width: 0 !important;
        border: 0 !important;
    }

    body.logged-in .mobile-card-table thead {
        display: none !important;
    }

    body.logged-in .mobile-card-table tbody {
        display: grid;
        gap: 0.75rem;
        background: transparent !important;
        border: 0 !important;
    }

    body.logged-in .mobile-card-table tr {
        display: block;
        overflow: visible;
        border: 1px solid var(--theme-border);
        border-radius: 0.875rem;
        background: var(--theme-surface);
        box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    }

    body.logged-in .mobile-card-table td,
    body.logged-in .mobile-card-table th {
        display: grid;
        grid-template-columns: minmax(7rem, 38%) minmax(0, 1fr);
        gap: 0.75rem;
        align-items: start;
        width: 100% !important;
        max-width: none !important;
        padding: 0.75rem 1rem !important;
        border-bottom: 1px solid var(--theme-border);
        text-align: left !important;
        white-space: normal !important;
        overflow-wrap: anywhere;
    }

    body.logged-in .mobile-card-table td:last-child,
    body.logged-in .mobile-card-table th:last-child {
        border-bottom: 0;
    }

    body.logged-in .mobile-card-table td::before,
    body.logged-in .mobile-card-table th::before {
        content: attr(data-label);
        color: var(--theme-text-muted);
        font-size: 0.72rem;
        font-weight: 700;
        line-height: 1.25;
        letter-spacing: 0.02em;
        text-transform: uppercase;
    }

    body.logged-in .mobile-card-table td.mobile-actions-cell,
    body.logged-in .mobile-card-table th.mobile-actions-cell {
        display: block;
    }

    body.logged-in .mobile-card-table td.mobile-actions-cell::before,
    body.logged-in .mobile-card-table th.mobile-actions-cell::before {
        display: block;
        margin-bottom: 0.5rem;
    }

    body.logged-in .mobile-card-table td.mobile-actions-cell > div,
    body.logged-in .mobile-card-table td.mobile-actions-cell .flex {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        justify-content: flex-start !important;
    }

    body.logged-in .mobile-card-table td.mobile-actions-cell > div > a,
    body.logged-in .mobile-card-table td.mobile-actions-cell > div > button,
    body.logged-in .mobile-card-table td.mobile-actions-cell > a,
    body.logged-in .mobile-card-table td.mobile-actions-cell > button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 40px;
        padding: 0.45rem 0.7rem;
        border-radius: 0.55rem;
        background-color: var(--theme-surface-muted);
        text-decoration: none;
    }

    /* Alpine dropdown in mobile cards: show as full-width action sheet */
    body.logged-in .mobile-card-table td.mobile-actions-cell [x-data] {
        width: 100%;
    }

    body.logged-in .mobile-card-table td.mobile-actions-cell [x-data] > button {
        width: 100%;
        justify-content: center;
        min-height: 44px;
        padding: 0.625rem 1rem;
        border-radius: 0.75rem;
        font-size: 0.875rem;
    }

    body.logged-in .mobile-card-table td.mobile-actions-cell [x-show] {
        position: relative !important;
        top: auto !important;
        bottom: auto !important;
        right: auto !important;
        left: auto !important;
        width: 100% !important;
        margin-top: 0.5rem;
        border-radius: 0.75rem;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    }

    body.logged-in .mobile-card-table td.mobile-actions-cell [x-show] button,
    body.logged-in .mobile-card-table td.mobile-actions-cell [x-show] a {
        min-height: 44px;
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
        background-color: transparent;
        border-radius: 0;
    }

    body.logged-in .main-content .overflow-x-auto:not(.mobile-card-table),
    body.logged-in .main-content .table-responsive:not(.mobile-card-table) {
        max-width: 100%;
        border-radius: 0.875rem;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-inline: contain;
    }

    body.logged-in .fixed.inset-0 {
        padding: 0.75rem;
        align-items: center;
        justify-content: center;
    }

    body.logged-in .fixed.inset-0 > .relative,
    body.logged-in .fixed.inset-0 > div:not(.fixed):not([id$="overlay"]):not([id$="Overlay"]),
    body.logged-in #contact-modal > div,
    body.logged-in .swal2-popup {
        width: min(100%, calc(100vw - 1.5rem)) !important;
        max-width: calc(100vw - 1.5rem) !important;
        max-height: calc(100dvh - 1.5rem);
        margin: auto !important;
        top: auto !important;
        overflow-y: auto;
    }

    body.logged-in .fixed.inset-0 .px-6,
    body.logged-in .fixed.inset-0 .p-6 {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    body.logged-in [id$="_results"],
    body.logged-in [id$="-results"],
    body.logged-in [id$="Results"] {
        max-height: min(45dvh, 18rem) !important;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    body.logged-in footer.with-sidebar-footer,
    body.logged-in footer:not(.with-sidebar-footer) {
        position: static !important;
        left: 0 !important;
        right: auto !important;
        width: 100% !important;
        /* Clear the iOS home indicator / Android gesture bar */
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    body.logged-in footer .flex {
        flex-direction: column;
        gap: 0.125rem;
        text-align: center;
        font-size: 0.75rem;
        line-height: 1.35;
    }

    body.logged-in footer .text-gray-400 {
        display: none;
    }
}

@media (max-width: 430px) {
    body.logged-in .main-content > div[class*="py-6"][class*="px-4"] {
        padding-left: max(0.75rem, env(safe-area-inset-left, 0px));
        padding-right: max(0.75rem, env(safe-area-inset-right, 0px));
    }

    body.logged-in .main-content [class*="space-x-"] > a[class*="px-"],
    body.logged-in .main-content [class*="space-x-"] > button[class*="px-"],
    body.logged-in .main-content form .flex.gap-2 > button,
    body.logged-in .main-content form .flex.gap-2 > a {
        flex: 1 1 100%;
        width: 100%;
    }

    body.logged-in .mobile-card-table td,
    body.logged-in .mobile-card-table th {
        grid-template-columns: minmax(6.5rem, 42%) minmax(0, 1fr);
        padding: 0.7rem 0.875rem !important;
    }
}

@media (max-width: 390px) {
    body.logged-in .mobile-card-table td,
    body.logged-in .mobile-card-table th {
        display: block;
    }

    body.logged-in .mobile-card-table td::before,
    body.logged-in .mobile-card-table th::before {
        display: block;
        margin-bottom: 0.25rem;
    }

    body.logged-in .main-content .text-xs {
        font-size: 0.78rem !important;
    }
}

@media (max-width: 767px) and (hover: none) {
    body.logged-in .main-content [class*="hover:shadow"],
    body.logged-in .main-content [class*="hover:bg"],
    body.logged-in .main-content [class*="hover:text"] {
        transition-duration: 120ms;
    }

    body.logged-in .main-content a:active,
    body.logged-in .main-content button:active,
    body.logged-in label[class*="cursor-pointer"]:active {
        transform: translateY(1px);
    }
}

@media (max-width: 767px) {
    html[data-theme="dark"] body.logged-in .mobile-card-table tr {
        box-shadow: 0 12px 26px rgba(0, 0, 0, 0.22);
    }

    html[data-theme="glass"] {
        --theme-glass-blur: 24px;
        --theme-glass-blur-soft: 16px;
        --theme-glass-saturate: 1.35;
        --theme-glass-shadow: 0 8px 24px rgba(31, 38, 135, 0.08);
        --theme-glass-shadow-elevated: 0 14px 34px rgba(52, 65, 92, 0.15), 0 5px 12px rgba(15, 23, 42, 0.06);
        --theme-glass-shadow-selected: 0 14px 34px rgba(37, 99, 235, 0.12), 0 4px 12px rgba(15, 23, 42, 0.06), 0 0 0 1px rgba(79, 70, 229, 0.10);
    }

    html[data-theme="glass"] body.logged-in .mobile-card-table tr {
        background: var(--theme-glass-material) !important;
        border-color: var(--theme-glass-border) !important;
        box-shadow: var(--theme-glass-highlight), var(--theme-glass-shadow) !important;
        -webkit-backdrop-filter: blur(var(--theme-glass-blur-soft)) saturate(var(--theme-glass-saturate));
        backdrop-filter: blur(var(--theme-glass-blur-soft)) saturate(var(--theme-glass-saturate));
    }

    html[data-theme="glass"] body.logged-in .mobile-card-table td a,
    html[data-theme="glass"] body.logged-in .mobile-card-table td button {
        background: var(--theme-glass-material-muted) !important;
        border: 1px solid var(--theme-glass-border);
        box-shadow: var(--theme-glass-edge-highlight), 0 6px 14px rgba(45, 58, 82, 0.07);
    }
}

/* ===== Enhanced Mobile Responsive (2026-05-12) ===== */

/* --- Stat cards: 2 columns on tablet, 1 on small mobile --- */
@media (min-width: 480px) and (max-width: 767px) {
    body.logged-in .main-content .flex.flex-wrap > .flex-1,
    body.logged-in .main-content .flex.flex-wrap > [class*="min-w-"] {
        flex: 1 1 calc(50% - 0.5rem) !important;
        min-width: 0 !important;
        width: auto;
    }
}

/* --- Header cards: buttons full-width on small screens --- */
@media (max-width: 767px) {
    /* Header card title + button layout */
    body.logged-in .main-content .md\:flex.md\:items-center.md\:justify-between {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
    }

    body.logged-in .main-content .md\:flex.md\:items-center.md\:justify-between > div:last-child {
        margin-top: 0.75rem;
    }

    body.logged-in .main-content .md\:flex.md\:items-center.md\:justify-between .flex.space-x-3 {
        flex-direction: column;
        gap: 0.5rem;
    }

    body.logged-in .main-content .md\:flex.md\:items-center.md\:justify-between .flex.space-x-3 > * {
        width: 100%;
        justify-content: center;
    }

    /* Parties card layout: stack icon+name vertically */
    body.logged-in .main-content .flex.items-start.justify-between {
        flex-direction: column;
        gap: 0.75rem;
    }

    body.logged-in .main-content .flex.items-start.justify-between > .flex.items-center.gap-2,
    body.logged-in .main-content .flex.items-start.justify-between > .flex.gap-2 {
        width: 100%;
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    /* Party detail indent: remove left margin on mobile */
    body.logged-in .main-content .space-y-2.ml-14 {
        margin-left: 0 !important;
    }

    /* Pagination: stack on mobile */
    body.logged-in .main-content .bg-gray-50 .flex.items-center.justify-between {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
    }

    body.logged-in .main-content .bg-gray-50 .flex.space-x-2 {
        flex-wrap: wrap;
        justify-content: center;
    }

    /* Status dropdown: ensure visibility on mobile cards */
    body.logged-in .mobile-card-table .status-dropdown-container .dropdown-menu {
        position: fixed !important;
        left: 50% !important;
        transform: translateX(-50%);
        top: auto !important;
        bottom: 1rem;
        width: min(14rem, calc(100vw - 2rem));
        z-index: 99999 !important;
        border-radius: 0.875rem;
        box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.15);
    }

    /* Table header info (page count) */
    body.logged-in .main-content .bg-gray-50.px-6.py-4 .flex.items-center.justify-between {
        flex-direction: column;
        gap: 0.25rem;
        align-items: flex-start;
    }

    /* Form grid: ensure 1-col on mobile */
    body.logged-in .main-content .grid.grid-cols-1.md\:grid-cols-2,
    body.logged-in .main-content .grid.grid-cols-1.md\:grid-cols-3,
    body.logged-in .main-content .grid.grid-cols-1.md\:grid-cols-5 {
        grid-template-columns: 1fr !important;
    }

    /* Search filter form: stack all children */
    body.logged-in .main-content form.flex.flex-wrap.gap-4.items-end {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    body.logged-in .main-content form.flex.flex-wrap.gap-4.items-end > * {
        width: 100% !important;
        min-width: 0 !important;
    }

    body.logged-in .main-content form.flex.flex-wrap.gap-4.items-end .flex.gap-2 {
        flex-direction: column;
    }

    body.logged-in .main-content form.flex.flex-wrap.gap-4.items-end .flex.gap-2 > * {
        width: 100%;
        justify-content: center;
    }

    /* Filter section: date range side by side */
    body.logged-in .main-content .flex.flex-wrap.gap-4:not(form) {
        flex-direction: column;
    }

    /* Modal: ensure full-width on mobile */
    body.logged-in .fixed.inset-0 .max-w-7xl,
    body.logged-in .fixed.inset-0 .max-w-4xl,
    body.logged-in .fixed.inset-0 .max-w-2xl,
    body.logged-in .fixed.inset-0 .max-w-xl,
    body.logged-in .fixed.inset-0 .max-w-lg,
    body.logged-in .fixed.inset-0 .max-w-md {
        max-width: calc(100vw - 1.5rem) !important;
        width: 100% !important;
    }

    /* Audit log detail modal: scrollable */
    body.logged-in .fixed.inset-0 .max-h-\[90vh\] {
        max-height: calc(100dvh - 2rem) !important;
    }

    /* Mobile card table: action buttons side-by-side */
    body.logged-in .mobile-card-table td.mobile-actions-cell .flex {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    body.logged-in .mobile-card-table td.mobile-actions-cell .flex > * {
        flex: 1 1 auto;
        text-align: center;
        justify-content: center;
    }

    /* Enhance touch target for small icon buttons */
    body.logged-in .mobile-card-table td a[class*="p-1"],
    body.logged-in .mobile-card-table td button[class*="p-1"] {
        min-width: 44px;
        min-height: 44px;
        padding: 0.5rem !important;
    }

    /* Contract table: status dropdown in mobile cards */
    body.logged-in .mobile-card-table .relative.inline-block {
        display: block;
    }

    /* Auditlog: expand/collapse button */
    body.logged-in .mobile-card-table td [x-data] button {
        min-height: 36px;
    }
}

/* ===== Mobile tab strips → swipeable single row (2026-06) =====
   Unifies tabbed navigation across Quản lý Công văn (documents) and the
   Tính phí / Tính thời gian tools. On phones the equal-width tabs (w-1/3, w-1/4)
   with long Vietnamese labels wrap or overflow; switch them to one swipeable row
   with content-sized, comfortable tap targets. Desktop (>=768px) is untouched. */
@media (max-width: 767px) {
    body.logged-in .main-content nav[aria-label="Tabs"],
    body.logged-in .main-content #feeTabs,
    body.logged-in .main-content #timeTabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-inline: contain;
        scroll-snap-type: x proximity;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    body.logged-in .main-content nav[aria-label="Tabs"]::-webkit-scrollbar,
    body.logged-in .main-content #feeTabs::-webkit-scrollbar,
    body.logged-in .main-content #timeTabs::-webkit-scrollbar {
        display: none;
    }

    body.logged-in .main-content nav[aria-label="Tabs"] > a,
    body.logged-in .main-content #feeTabs > .fee-tab,
    body.logged-in .main-content #timeTabs > .time-tab {
        width: auto !important;
        flex: 0 0 auto;
        white-space: nowrap;
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        font-size: 0.875rem;
        scroll-snap-align: start;
    }
}

/* --- Very small screens (< 430px) additional fixes --- */
@media (max-width: 430px) {
    /* Page-level padding */
    body.logged-in .main-content > div[class*="py-6"] {
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
    }

    /* Compact header for small screens */
    body.logged-in .main-content h2 {
        font-size: 1.125rem !important;
    }

    /* Compact stat card text */
    body.logged-in .main-content .stat-hover-card .text-2xl,
    body.logged-in .main-content .stat-hover-card .text-xl {
        font-size: 1.25rem !important;
    }

    /* Parties: compact padding */
    body.logged-in .main-content .px-6.py-6 {
        padding: 0.875rem !important;
    }
}

/* --- Desktop: dropdown visible for status in contract table --- */
@media (min-width: 768px) {
    body.logged-in .overflow-x-auto:has(.status-dropdown-container) {
        overflow: visible;
    }
}

/* ===== LegalDocx UI Polish System (2026-05-12) ===== */
html[data-theme="light"],
html[data-theme="dark"],
html[data-theme="glass"] {
    --ui-radius-xs: 0.5rem;
    --ui-radius-sm: 0.625rem;
    --ui-radius-md: 0.75rem;
    --ui-radius-lg: 0.875rem;
    --ui-radius-xl: 1rem;
    --ui-radius-2xl: 1.125rem;
    --ui-card-padding: 1.5rem;
    --ui-control-height: 2.625rem;
    --ui-control-padding-x: 1rem;
    --ui-control-border: var(--theme-border);
    --ui-control-bg: var(--theme-input-bg, var(--theme-surface));
    --ui-control-text: var(--theme-text);
    --ui-control-placeholder: var(--theme-text-muted);
    --ui-card-bg: var(--theme-surface);
    --ui-card-border: var(--theme-border);
    --ui-card-shadow: var(--theme-shadow, 0 14px 34px rgba(15, 23, 42, 0.10));
    --ui-soft-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    --ui-row-hover: var(--theme-surface-hover, var(--theme-surface-muted));
    --ui-header-bg: var(--theme-surface-muted);
    --ui-focus-ring: 0 0 0 3px rgba(var(--theme-accent-indigo-rgb, 79, 70, 229), 0.18);
}

html[data-theme="light"] {
    --theme-surface-hover: #f3f4f6;
    --theme-surface-active: #e5e7eb;
    --ui-card-shadow: 0 16px 34px rgba(15, 23, 42, 0.10), 0 1px 0 rgba(255, 255, 255, 0.70) inset;
    --ui-soft-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

html[data-theme="dark"] {
    --ui-card-shadow: 0 10px 28px rgba(0, 0, 0, 0.30), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    --ui-soft-shadow: 0 8px 22px rgba(0, 0, 0, 0.26);
}

html[data-theme="glass"] {
    --ui-card-bg: var(--theme-glass-material, var(--theme-surface));
    --ui-card-border: var(--theme-glass-border, var(--theme-border));
    --ui-card-shadow: var(--theme-glass-highlight, inset 0 1px 0 rgba(255, 255, 255, 0.70)), var(--theme-glass-shadow, 0 16px 42px rgba(52, 65, 92, 0.16));
    --ui-header-bg: var(--theme-glass-material-muted, var(--theme-surface-muted));
}

body.logged-in .main-content {
    color: var(--theme-text);
}

body.logged-in .main-content > div[class*="py-6"] {
    max-width: 100%;
}

body.logged-in .main-content .bg-white.rounded-xl,
body.logged-in .main-content .bg-white.rounded-2xl,
body.logged-in .main-content .bg-gray-50.rounded-xl,
body.logged-in .main-content .bg-gray-100.rounded-xl,
body.logged-in .main-content .theme-surface,
body.logged-in .main-content .signature-card,
body.logged-in .main-content .signature-info-group {
    background: var(--ui-card-bg) !important;
    border: 1px solid var(--ui-card-border) !important;
    border-radius: var(--ui-radius-2xl) !important;
    box-shadow: var(--ui-card-shadow) !important;
}

html[data-theme="glass"] body.logged-in .main-content .bg-white.rounded-xl,
html[data-theme="glass"] body.logged-in .main-content .bg-white.rounded-2xl,
html[data-theme="glass"] body.logged-in .main-content .bg-gray-50.rounded-xl,
html[data-theme="glass"] body.logged-in .main-content .bg-gray-100.rounded-xl,
html[data-theme="glass"] body.logged-in .main-content .theme-surface,
html[data-theme="glass"] body.logged-in .main-content .signature-card,
html[data-theme="glass"] body.logged-in .main-content .signature-info-group {
    -webkit-backdrop-filter: blur(var(--theme-glass-blur-soft, 14px)) saturate(var(--theme-glass-saturate, 1.25));
    backdrop-filter: blur(var(--theme-glass-blur-soft, 14px)) saturate(var(--theme-glass-saturate, 1.25));
}

body.logged-in .main-content .stat-hover-card,
body.logged-in .main-content .rounded-xl.shadow-md,
body.logged-in .main-content .rounded-xl.shadow-lg {
    border-radius: var(--ui-radius-2xl) !important;
    border: 1px solid var(--ui-card-border) !important;
    box-shadow: var(--ui-soft-shadow) !important;
}

body.logged-in .main-content .stat-hover-card {
    min-height: 4.75rem;
    padding: 1rem !important;
}

body.logged-in .main-content .stat-hover-card:hover,
body.logged-in .main-content .card-hover-lift:hover,
body.logged-in .main-content .group:hover .card-hover-lift,
body.logged-in .main-content .card-hover-lift.hover\:shadow-2xl:hover {
    border-color: rgba(var(--theme-accent-indigo-rgb, 79, 70, 229), 0.32) !important;
    box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25) !important;
}

body.logged-in .main-content .stat-hover-card [class*="rounded-full"] {
    border: 1px solid rgba(var(--theme-accent-indigo-rgb, 79, 70, 229), 0.18);
}

body.logged-in .main-content .empty-state-panel {
    background: var(--ui-card-bg) !important;
    border: 1px solid var(--ui-card-border) !important;
    border-radius: var(--ui-radius-2xl) !important;
    box-shadow: var(--ui-card-shadow) !important;
    padding: 3rem 1.5rem !important;
    text-align: center;
}

body.logged-in .main-content .empty-state-panel .empty-state-icon {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--theme-accent-indigo-rgb, 79, 70, 229), 0.12) !important;
    border: 1px solid rgba(var(--theme-accent-indigo-rgb, 79, 70, 229), 0.20) !important;
    color: var(--theme-accent-indigo, #4f46e5) !important;
    font-size: 1.5rem;
}

body.logged-in .main-content .empty-state-panel :is(h3, h4) {
    color: var(--theme-text) !important;
    font-size: 1.125rem !important;
    font-weight: 600 !important;
    margin-bottom: 0.5rem !important;
}

body.logged-in .main-content .empty-state-panel p {
    color: var(--theme-text-muted) !important;
    margin-bottom: 0 !important;
}

body.logged-in .main-content .bg-white.rounded-xl > [class*="bg-gradient-to-r"][class*="text-white"]:first-child,
body.logged-in .main-content .bg-white.rounded-2xl > [class*="bg-gradient-to-r"][class*="text-white"]:first-child,
body.logged-in .main-content .bg-gray-50.rounded-xl > [class*="bg-gradient-to-r"][class*="text-white"]:first-child,
body.logged-in .main-content .bg-gray-100.rounded-xl > [class*="bg-gradient-to-r"][class*="text-white"]:first-child {
    border-radius: var(--ui-radius-2xl) var(--ui-radius-2xl) 0 0 !important;
}

body.logged-in .main-content .bg-white.rounded-xl > [class*="px-6"][class*="py-4"]:first-child,
body.logged-in .main-content .bg-white.rounded-2xl > [class*="px-6"][class*="py-4"]:first-child,
body.logged-in .main-content .bg-white.rounded-xl > [class*="p-6"]:first-child,
body.logged-in .main-content .bg-white.rounded-2xl > [class*="p-6"]:first-child {
    border-top-left-radius: calc(var(--ui-radius-2xl) - 1px) !important;
    border-top-right-radius: calc(var(--ui-radius-2xl) - 1px) !important;
}

body.logged-in .main-content .bg-white.rounded-xl > *:last-child,
body.logged-in .main-content .bg-white.rounded-2xl > *:last-child,
body.logged-in .main-content .bg-gray-50.rounded-xl > *:last-child,
body.logged-in .main-content .bg-gray-100.rounded-xl > *:last-child {
    border-bottom-left-radius: calc(var(--ui-radius-2xl) - 1px) !important;
    border-bottom-right-radius: calc(var(--ui-radius-2xl) - 1px) !important;
}

body.logged-in .main-content input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
body.logged-in .main-content select,
body.logged-in .main-content textarea,
body.logged-in .swal2-input,
body.logged-in .swal2-textarea,
body.logged-in .swal2-select {
    min-height: var(--ui-control-height);
    padding: 0.625rem var(--ui-control-padding-x) !important;
    background: var(--ui-control-bg) !important;
    border: 1px solid var(--ui-control-border) !important;
    border-radius: var(--ui-radius-md) !important;
    color: var(--ui-control-text) !important;
    box-shadow: none !important;
    transition: border-color 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

body.logged-in .main-content select {
    padding-right: 2.5rem !important;
}

body.logged-in .main-content input::placeholder,
body.logged-in .main-content textarea::placeholder {
    color: var(--ui-control-placeholder) !important;
    opacity: 0.82;
}

body.logged-in .main-content input:not([type="checkbox"]):not([type="radio"]):focus,
body.logged-in .main-content select:focus,
body.logged-in .main-content textarea:focus,
body.logged-in .swal2-input:focus,
body.logged-in .swal2-textarea:focus,
body.logged-in .swal2-select:focus {
    border-color: rgba(var(--theme-accent-indigo-rgb, 79, 70, 229), 0.72) !important;
    box-shadow: var(--ui-focus-ring) !important;
    outline: none !important;
}

body.logged-in .main-content button,
body.logged-in .main-content a[class*="px-"][class*="py-"] {
    border-radius: var(--ui-radius-md) !important;
    transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

body.logged-in .main-content .admin-user-avatar {
    border-radius: 999px !important;
    aspect-ratio: 1 / 1;
}

body.logged-in .main-content .admin-user-avatar img {
    border-radius: inherit;
}

body.logged-in .main-content button:not(:disabled),
body.logged-in .main-content a[href] {
    cursor: pointer;
}

body.logged-in .main-content button.bg-indigo-500,
body.logged-in .main-content button.bg-indigo-600,
body.logged-in .main-content button.bg-indigo-700,
body.logged-in .main-content a.bg-indigo-500,
body.logged-in .main-content a.bg-indigo-600,
body.logged-in .main-content a.bg-indigo-700,
body.logged-in .main-content button.bg-purple-500,
body.logged-in .main-content button.bg-purple-600,
body.logged-in .main-content button.bg-purple-700,
body.logged-in .main-content a.bg-purple-500,
body.logged-in .main-content a.bg-purple-600,
body.logged-in .main-content a.bg-purple-700 {
    background: linear-gradient(135deg, var(--theme-solid-indigo, #6359a0), var(--theme-sidebar-active-to, #765fa3)) !important;
    border: 1px solid rgba(var(--theme-accent-indigo-rgb, 79, 70, 229), 0.24) !important;
    box-shadow: 0 8px 18px rgba(var(--theme-accent-indigo-rgb, 79, 70, 229), 0.18) !important;
}

body.logged-in .main-content button.bg-gray-100,
body.logged-in .main-content button.bg-gray-200,
body.logged-in .main-content button.bg-gray-400,
body.logged-in .main-content button.bg-gray-500,
body.logged-in .main-content a.bg-gray-100,
body.logged-in .main-content a.bg-gray-200,
body.logged-in .main-content a.bg-gray-400,
body.logged-in .main-content a.bg-gray-500 {
    background: var(--theme-surface-muted) !important;
    border: 1px solid var(--theme-border) !important;
    color: var(--theme-text-soft) !important;
}

body.logged-in .main-content button:hover:not(:disabled),
body.logged-in .main-content a[class*="px-"][class*="py-"]:hover {
    transform: translateY(-1px);
    box-shadow: var(--ui-soft-shadow) !important;
}

body.no-sidebar:not(.logged-in) .system-footer,
body.login-page .system-footer {
    left: 0 !important;
    width: 100% !important;
}

@media (max-width: 640px) {
    .system-footer {
        min-height: var(--system-footer-mobile-height);
    }

    .system-footer > div {
        min-height: var(--system-footer-mobile-height);
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }

    .system-footer .flex {
        flex-direction: column;
        gap: 0.125rem;
        text-align: center;
        line-height: 1.35;
    }

    .system-footer .text-gray-400 {
        display: none;
    }
}

body.logged-in .main-content :is(a, button).bg-indigo-100,
body.logged-in .main-content :is(a, button).bg-indigo-50,
body.logged-in .main-content :is(a, button).bg-blue-100,
body.logged-in .main-content :is(a, button).bg-blue-50,
body.logged-in .main-content :is(a, button).bg-green-100,
body.logged-in .main-content :is(a, button).bg-green-50,
body.logged-in .main-content :is(a, button).bg-orange-100,
body.logged-in .main-content :is(a, button).bg-orange-50,
body.logged-in .main-content :is(a, button).bg-amber-50,
body.logged-in .main-content :is(a, button).bg-amber-100,
body.logged-in .main-content :is(a, button).bg-purple-50,
body.logged-in .main-content :is(a, button).bg-purple-100,
body.logged-in .main-content :is(a, button).bg-pink-50,
body.logged-in .main-content :is(a, button).bg-pink-100,
body.logged-in .main-content :is(a, button).bg-rose-50,
body.logged-in .main-content :is(a, button).bg-rose-100,
body.logged-in .main-content :is(a, button).bg-red-100 {
    box-shadow: none !important;
}

body.logged-in .main-content :is(a, button).bg-indigo-50,
body.logged-in .main-content :is(a, button).bg-indigo-100 {
    background: rgba(var(--theme-accent-indigo-rgb, 79, 70, 229), 0.14) !important;
    border: 1px solid rgba(var(--theme-accent-indigo-rgb, 79, 70, 229), 0.22) !important;
    color: var(--theme-accent-indigo, #4f46e5) !important;
}

body.logged-in .main-content :is(a, button).bg-blue-50,
body.logged-in .main-content :is(a, button).bg-blue-100 {
    background: rgba(var(--theme-accent-blue-rgb, 37, 99, 235), 0.14) !important;
    border: 1px solid rgba(var(--theme-accent-blue-rgb, 37, 99, 235), 0.22) !important;
    color: var(--theme-accent-blue, #2563eb) !important;
}

body.logged-in .main-content :is(a, button).bg-green-50,
body.logged-in .main-content :is(a, button).bg-green-100 {
    background: rgba(var(--theme-accent-green-rgb, 22, 131, 74), 0.14) !important;
    border: 1px solid rgba(var(--theme-accent-green-rgb, 22, 131, 74), 0.22) !important;
    color: var(--theme-accent-green, #16834a) !important;
}

body.logged-in .main-content :is(a, button).bg-orange-50,
body.logged-in .main-content :is(a, button).bg-orange-100 {
    background: rgba(var(--theme-accent-orange-rgb, 168, 74, 15), 0.14) !important;
    border: 1px solid rgba(var(--theme-accent-orange-rgb, 168, 74, 15), 0.22) !important;
    color: var(--theme-accent-orange, #a84a0f) !important;
}

body.logged-in .main-content :is(a, button).bg-amber-50,
body.logged-in .main-content :is(a, button).bg-amber-100 {
    background: rgba(var(--theme-accent-amber-rgb, 154, 91, 8), 0.14) !important;
    border: 1px solid rgba(var(--theme-accent-amber-rgb, 154, 91, 8), 0.22) !important;
    color: var(--theme-accent-amber, #9a5b08) !important;
}

body.logged-in .main-content :is(a, button).bg-purple-50,
body.logged-in .main-content :is(a, button).bg-purple-100 {
    background: rgba(var(--theme-accent-indigo-rgb, 79, 70, 229), 0.14) !important;
    border: 1px solid rgba(var(--theme-accent-indigo-rgb, 79, 70, 229), 0.22) !important;
    color: var(--theme-accent-indigo, #4f46e5) !important;
}

body.logged-in .main-content :is(a, button).bg-pink-50,
body.logged-in .main-content :is(a, button).bg-pink-100,
body.logged-in .main-content :is(a, button).bg-rose-50,
body.logged-in .main-content :is(a, button).bg-rose-100 {
    background: rgba(var(--theme-accent-rose-rgb, 184, 50, 107), 0.14) !important;
    border: 1px solid rgba(var(--theme-accent-rose-rgb, 184, 50, 107), 0.22) !important;
    color: var(--theme-accent-rose, #b8326b) !important;
}

body.logged-in .main-content :is(a, button).bg-red-50,
body.logged-in .main-content :is(a, button).bg-red-100 {
    background: rgba(var(--theme-accent-red-rgb, 194, 65, 61), 0.14) !important;
    border: 1px solid rgba(var(--theme-accent-red-rgb, 194, 65, 61), 0.22) !important;
    color: var(--theme-accent-red, #c2413d) !important;
}

html[data-theme="dark"] body.logged-in .main-content :is(a, button).bg-indigo-50,
html[data-theme="dark"] body.logged-in .main-content :is(a, button).bg-indigo-100,
html[data-theme="dark"] body.logged-in .main-content :is(a, button).bg-blue-50,
html[data-theme="dark"] body.logged-in .main-content :is(a, button).bg-blue-100,
html[data-theme="dark"] body.logged-in .main-content :is(a, button).bg-green-50,
html[data-theme="dark"] body.logged-in .main-content :is(a, button).bg-green-100,
html[data-theme="dark"] body.logged-in .main-content :is(a, button).bg-orange-50,
html[data-theme="dark"] body.logged-in .main-content :is(a, button).bg-orange-100,
html[data-theme="dark"] body.logged-in .main-content :is(a, button).bg-amber-50,
html[data-theme="dark"] body.logged-in .main-content :is(a, button).bg-amber-100,
html[data-theme="dark"] body.logged-in .main-content :is(a, button).bg-purple-50,
html[data-theme="dark"] body.logged-in .main-content :is(a, button).bg-purple-100,
html[data-theme="dark"] body.logged-in .main-content :is(a, button).bg-pink-50,
html[data-theme="dark"] body.logged-in .main-content :is(a, button).bg-pink-100,
html[data-theme="dark"] body.logged-in .main-content :is(a, button).bg-rose-50,
html[data-theme="dark"] body.logged-in .main-content :is(a, button).bg-rose-100,
html[data-theme="dark"] body.logged-in .main-content :is(a, button).bg-red-50,
html[data-theme="dark"] body.logged-in .main-content :is(a, button).bg-red-100 {
    background-color: color-mix(in srgb, currentColor 13%, var(--theme-surface-muted)) !important;
    border-color: color-mix(in srgb, currentColor 34%, var(--theme-border)) !important;
}

html[data-theme="dark"] body.logged-in .main-content :is(a, button).bg-indigo-50:hover,
html[data-theme="dark"] body.logged-in .main-content :is(a, button).bg-indigo-100:hover,
html[data-theme="dark"] body.logged-in .main-content :is(a, button).bg-blue-50:hover,
html[data-theme="dark"] body.logged-in .main-content :is(a, button).bg-blue-100:hover,
html[data-theme="dark"] body.logged-in .main-content :is(a, button).bg-green-50:hover,
html[data-theme="dark"] body.logged-in .main-content :is(a, button).bg-green-100:hover,
html[data-theme="dark"] body.logged-in .main-content :is(a, button).bg-orange-50:hover,
html[data-theme="dark"] body.logged-in .main-content :is(a, button).bg-orange-100:hover,
html[data-theme="dark"] body.logged-in .main-content :is(a, button).bg-amber-50:hover,
html[data-theme="dark"] body.logged-in .main-content :is(a, button).bg-amber-100:hover,
html[data-theme="dark"] body.logged-in .main-content :is(a, button).bg-purple-50:hover,
html[data-theme="dark"] body.logged-in .main-content :is(a, button).bg-purple-100:hover,
html[data-theme="dark"] body.logged-in .main-content :is(a, button).bg-pink-50:hover,
html[data-theme="dark"] body.logged-in .main-content :is(a, button).bg-pink-100:hover,
html[data-theme="dark"] body.logged-in .main-content :is(a, button).bg-rose-50:hover,
html[data-theme="dark"] body.logged-in .main-content :is(a, button).bg-rose-100:hover,
html[data-theme="dark"] body.logged-in .main-content :is(a, button).bg-red-50:hover,
html[data-theme="dark"] body.logged-in .main-content :is(a, button).bg-red-100:hover {
    background-color: color-mix(in srgb, currentColor 18%, var(--theme-surface-hover)) !important;
    border-color: color-mix(in srgb, currentColor 44%, var(--theme-border-strong)) !important;
}

html[data-theme="dark"] body.logged-in .main-content :is(a, button).glass-btn-secondary,
html[data-theme="dark"] body.logged-in .main-content :is(a, button).glass-btn-danger {
    box-shadow: none !important;
}

html[data-theme="dark"] body.logged-in .main-content :is(a, button).glass-btn-secondary {
    color: var(--theme-accent-blue) !important;
}

html[data-theme="dark"] body.logged-in .main-content :is(a, button).glass-btn-danger {
    color: var(--theme-accent-red) !important;
}

body.logged-in .main-content :is(a, button).bg-indigo-100:hover,
body.logged-in .main-content :is(a, button).bg-blue-100:hover,
body.logged-in .main-content :is(a, button).bg-green-100:hover,
body.logged-in .main-content :is(a, button).bg-orange-100:hover,
body.logged-in .main-content :is(a, button).bg-red-100:hover {
    box-shadow: none !important;
    filter: brightness(0.98);
}

/* Reports export type cards: accurate dark-mode backgrounds */
html[data-theme="dark"] body.logged-in .main-content label:has(input[name="export_type"]) {
    --export-accent-rgb: var(--theme-accent-indigo-rgb, 196, 181, 253);
    --export-accent: var(--theme-accent-indigo, #c4b5fd);
    background: var(--theme-surface-muted) !important;
    border-color: var(--theme-border-strong) !important;
    color: var(--theme-text-soft) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035) !important;
}

html[data-theme="dark"] body.logged-in .main-content label:has(input[name="export_type"][value="incoming"]) {
    --export-accent-rgb: var(--theme-accent-blue-rgb, 158, 200, 255);
    --export-accent: var(--theme-accent-blue, #9ec8ff);
}

html[data-theme="dark"] body.logged-in .main-content label:has(input[name="export_type"][value="outgoing"]) {
    --export-accent-rgb: var(--theme-accent-green-rgb, 151, 229, 170);
    --export-accent: var(--theme-accent-green, #97e5aa);
}

html[data-theme="dark"] body.logged-in .main-content label:has(input[name="export_type"][value="inheritance"]) {
    --export-accent-rgb: var(--theme-accent-indigo-rgb, 196, 181, 253);
    --export-accent: var(--theme-accent-indigo, #c4b5fd);
}

html[data-theme="dark"] body.logged-in .main-content label:has(input[name="export_type"][value="notarization"]) {
    --export-accent-rgb: var(--theme-accent-orange-rgb, 237, 169, 111);
    --export-accent: var(--theme-accent-orange, #eda96f);
}

html[data-theme="dark"] body.logged-in .main-content label:has(input[name="export_type"][value="notarization_request"]) {
    --export-accent-rgb: var(--theme-accent-teal-rgb, 125, 219, 210);
    --export-accent: var(--theme-accent-teal, #7dd3d0);
}

html[data-theme="dark"] body.logged-in .main-content label:has(input[name="export_type"][value="bieu14"]) {
    --export-accent-rgb: var(--theme-accent-rose-rgb, 244, 143, 160);
    --export-accent: var(--theme-accent-rose, #f48fa0);
}

html[data-theme="dark"] body.logged-in .main-content label:has(input[name="export_type"]):hover {
    background: linear-gradient(135deg, rgba(var(--export-accent-rgb), 0.13), var(--theme-surface-hover)) !important;
    border-color: rgba(var(--export-accent-rgb), 0.34) !important;
}

html[data-theme="dark"] body.logged-in .main-content label:has(input[name="export_type"]:checked) {
    background:
        linear-gradient(135deg, rgba(var(--export-accent-rgb), 0.24), rgba(var(--export-accent-rgb), 0.10)),
        var(--theme-surface-muted) !important;
    border-color: rgba(var(--export-accent-rgb), 0.76) !important;
    box-shadow: 0 0 0 1px rgba(var(--export-accent-rgb), 0.18), 0 14px 32px rgba(0, 0, 0, 0.24) !important;
}

html[data-theme="dark"] body.logged-in .main-content label:has(input[name="export_type"][value="incoming"]:checked) {
    border-color: rgba(var(--theme-accent-blue-rgb, 158, 200, 255), 0.76) !important;
}

html[data-theme="dark"] body.logged-in .main-content label:has(input[name="export_type"][value="outgoing"]:checked) {
    border-color: rgba(var(--theme-accent-green-rgb, 151, 229, 170), 0.76) !important;
}

html[data-theme="dark"] body.logged-in .main-content label:has(input[name="export_type"][value="inheritance"]:checked) {
    border-color: rgba(var(--theme-accent-indigo-rgb, 196, 181, 253), 0.76) !important;
}

html[data-theme="dark"] body.logged-in .main-content label:has(input[name="export_type"][value="notarization"]:checked) {
    border-color: rgba(var(--theme-accent-orange-rgb, 237, 169, 111), 0.76) !important;
}

html[data-theme="dark"] body.logged-in .main-content label:has(input[name="export_type"][value="notarization_request"]:checked) {
    border-color: rgba(var(--theme-accent-teal-rgb, 125, 219, 210), 0.76) !important;
}

html[data-theme="dark"] body.logged-in .main-content label:has(input[name="export_type"]) .font-medium,
html[data-theme="dark"] body.logged-in .main-content label:has(input[name="export_type"]) .text-gray-900 {
    color: var(--theme-text) !important;
}

html[data-theme="dark"] body.logged-in .main-content label:has(input[name="export_type"]) .text-sm,
html[data-theme="dark"] body.logged-in .main-content label:has(input[name="export_type"]) .text-gray-500 {
    color: var(--theme-text-muted) !important;
}

html[data-theme="dark"] body.logged-in .main-content label:has(input[name="export_type"]) [class*="bg-"][class*="-100"] {
    background-color: rgba(var(--export-accent-rgb), 0.16) !important;
    border: 1px solid rgba(var(--export-accent-rgb), 0.20) !important;
    color: var(--export-accent) !important;
}

html[data-theme="dark"] body.logged-in .main-content label:has(input[name="export_type"]:checked) [class*="bg-"][class*="-100"] {
    background-color: rgba(var(--export-accent-rgb), 0.22) !important;
    border-color: rgba(var(--export-accent-rgb), 0.30) !important;
}

html[data-theme="dark"] body.logged-in .main-content label:has(input[name="export_type"]) > .absolute svg {
    color: var(--export-accent) !important;
}

html[data-theme="dark"] body.logged-in .main-content .export-type-card {
    --export-accent-rgb: var(--theme-accent-indigo-rgb, 196, 181, 253);
    --export-accent: var(--theme-accent-indigo, #c4b5fd);
    background: var(--theme-surface-muted) !important;
    border-color: var(--theme-border-strong) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035) !important;
}

html[data-theme="dark"] body.logged-in .main-content .export-type-card:not(.is-selected) {
    background: var(--theme-surface-muted) !important;
    border-color: var(--theme-border-strong) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035) !important;
}

html[data-theme="dark"] body.logged-in .main-content .export-type-incoming {
    --export-accent-rgb: var(--theme-accent-blue-rgb, 158, 200, 255);
    --export-accent: var(--theme-accent-blue, #9ec8ff);
}

html[data-theme="dark"] body.logged-in .main-content .export-type-outgoing {
    --export-accent-rgb: var(--theme-accent-green-rgb, 151, 229, 170);
    --export-accent: var(--theme-accent-green, #97e5aa);
}

html[data-theme="dark"] body.logged-in .main-content .export-type-inheritance {
    --export-accent-rgb: var(--theme-accent-indigo-rgb, 196, 181, 253);
    --export-accent: var(--theme-accent-indigo, #c4b5fd);
}

html[data-theme="dark"] body.logged-in .main-content .export-type-notarization {
    --export-accent-rgb: var(--theme-accent-orange-rgb, 237, 169, 111);
    --export-accent: var(--theme-accent-orange, #eda96f);
}

html[data-theme="dark"] body.logged-in .main-content .export-type-request {
    --export-accent-rgb: var(--theme-accent-teal-rgb, 125, 219, 210);
    --export-accent: var(--theme-accent-teal, #7dd3d0);
}

html[data-theme="dark"] body.logged-in .main-content .export-type-bieu14 {
    --export-accent-rgb: var(--theme-accent-rose-rgb, 244, 143, 160);
    --export-accent: var(--theme-accent-rose, #f48fa0);
}

html[data-theme="dark"] body.logged-in .main-content .export-type-card:hover {
    background: linear-gradient(135deg, rgba(var(--export-accent-rgb), 0.13), var(--theme-surface-hover)) !important;
    border-color: rgba(var(--export-accent-rgb), 0.34) !important;
}

html[data-theme="dark"] body.logged-in .main-content .export-type-card:has(input[name="export_type"]:checked) {
    background:
        linear-gradient(135deg, rgba(var(--export-accent-rgb), 0.24), rgba(var(--export-accent-rgb), 0.10)),
        var(--theme-surface-muted) !important;
    border-color: rgba(var(--export-accent-rgb), 0.76) !important;
    box-shadow: 0 0 0 1px rgba(var(--export-accent-rgb), 0.18), 0 14px 32px rgba(0, 0, 0, 0.24) !important;
}

html[data-theme="dark"] body.logged-in .main-content .export-type-card.is-selected {
    background:
        linear-gradient(135deg, rgba(var(--export-accent-rgb), 0.24), rgba(var(--export-accent-rgb), 0.10)),
        var(--theme-surface-muted) !important;
    border-color: rgba(var(--export-accent-rgb), 0.76) !important;
    box-shadow: 0 0 0 1px rgba(var(--export-accent-rgb), 0.18), 0 14px 32px rgba(0, 0, 0, 0.24) !important;
}

html[data-theme="dark"] body.logged-in .main-content label.export-type-card:not(.is-selected) {
    background: var(--theme-surface-muted) !important;
    border-color: var(--theme-border-strong) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035) !important;
}

html[data-theme="dark"] body.logged-in .main-content label.export-type-card.export-type-incoming.is-selected {
    border-color: rgba(var(--theme-accent-blue-rgb, 158, 200, 255), 0.76) !important;
}

html[data-theme="dark"] body.logged-in .main-content label.export-type-card.export-type-outgoing.is-selected {
    border-color: rgba(var(--theme-accent-green-rgb, 151, 229, 170), 0.76) !important;
}

html[data-theme="dark"] body.logged-in .main-content label.export-type-card.export-type-inheritance.is-selected {
    border-color: rgba(var(--theme-accent-indigo-rgb, 196, 181, 253), 0.76) !important;
}

html[data-theme="dark"] body.logged-in .main-content label.export-type-card.export-type-notarization.is-selected {
    border-color: rgba(var(--theme-accent-orange-rgb, 237, 169, 111), 0.76) !important;
}

html[data-theme="dark"] body.logged-in .main-content label.export-type-card.export-type-request.is-selected {
    border-color: rgba(var(--theme-accent-teal-rgb, 125, 219, 210), 0.76) !important;
}

html[data-theme="dark"] body.logged-in .main-content label.export-type-card.export-type-bieu14.is-selected {
    border-color: rgba(var(--theme-accent-rose-rgb, 244, 143, 160), 0.76) !important;
}

html[data-theme="dark"] body.logged-in .main-content .export-type-card [class*="bg-"][class*="-100"] {
    background-color: rgba(var(--export-accent-rgb), 0.16) !important;
    border: 1px solid rgba(var(--export-accent-rgb), 0.20) !important;
    color: var(--export-accent) !important;
}

html[data-theme="dark"] body.logged-in .main-content .export-type-card:has(input[name="export_type"]:checked) [class*="bg-"][class*="-100"] {
    background-color: rgba(var(--export-accent-rgb), 0.22) !important;
    border-color: rgba(var(--export-accent-rgb), 0.30) !important;
}

html[data-theme="dark"] body.logged-in .main-content .export-type-card.is-selected [class*="bg-"][class*="-100"] {
    background-color: rgba(var(--export-accent-rgb), 0.22) !important;
    border-color: rgba(var(--export-accent-rgb), 0.30) !important;
}

html[data-theme="dark"] body.logged-in .main-content .export-type-card > .absolute svg {
    color: var(--export-accent) !important;
}

/* Documents tabs: child items inherit tab accent */
body.logged-in .documents-tab-incoming {
    --doc-accent: var(--theme-accent-blue, #2563eb);
    --doc-accent-rgb: var(--theme-accent-blue-rgb, 37, 99, 235);
    --doc-accent-strong: var(--theme-solid-blue, #2563eb);
    --doc-accent-hover: var(--theme-solid-blue-hover, #1d4ed8);
}

body.logged-in .documents-tab-outgoing {
    --doc-accent: var(--theme-accent-green, #16834a);
    --doc-accent-rgb: var(--theme-accent-green-rgb, 22, 131, 74);
    --doc-accent-strong: var(--theme-solid-green, #16834a);
    --doc-accent-hover: var(--theme-solid-green-hover, #166534);
}

body.logged-in .documents-tab-inheritance {
    --doc-accent: #9333ea;
    --doc-accent-rgb: 147, 51, 234;
    --doc-accent-strong: #7c3aed;
    --doc-accent-hover: #6d28d9;
}

body.logged-in .main-content .documents-page .doc-stat-card {
    background: var(--ui-card-bg) !important;
    border-width: 1px !important;
    border-style: solid !important;
    border-color: var(--ui-card-border) !important;
    box-shadow: var(--ui-soft-shadow) !important;
}

body.logged-in .main-content .documents-page .doc-stat-card:hover,
body.logged-in .main-content .documents-page .doc-stat-card.ring-2 {
    border-color: rgba(var(--theme-accent-indigo-rgb, 79, 70, 229), 0.32) !important;
    box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25) !important;
}

body.logged-in .main-content .documents-page nav[aria-label="Tabs"] a,
body.logged-in .main-content .documents-page nav[aria-label="Tabs"] a[class*="px-"][class*="py-"] {
    border-radius: 0 !important;
    border-bottom-width: 2px !important;
    transition: color 180ms ease, border-color 180ms ease, background-color 180ms ease;
}

body.logged-in .main-content .documents-page nav[aria-label="Tabs"] a:hover {
    border-bottom-color: rgba(var(--theme-accent-indigo-rgb, 79, 70, 229), 0.48) !important;
    color: var(--theme-accent-indigo, #4f46e5) !important;
    background: rgba(var(--theme-accent-indigo-rgb, 79, 70, 229), 0.06) !important;
}

body.logged-in .main-content .documents-page nav[aria-label="Tabs"] a[class*="border-blue-500"],
body.logged-in .main-content .documents-page nav[aria-label="Tabs"] a[class*="border-green-500"],
body.logged-in .main-content .documents-page nav[aria-label="Tabs"] a[class*="border-purple-500"] {
    border-bottom-color: var(--theme-accent-indigo, #4f46e5) !important;
    color: var(--theme-accent-indigo, #4f46e5) !important;
}

body.logged-in .main-content .documents-page nav[aria-label="Tabs"] a:first-child,
body.logged-in .main-content .documents-page nav[aria-label="Tabs"] a[class*="px-"][class*="py-"]:first-child {
    border-bottom-left-radius: calc(var(--ui-radius-2xl) - 1px) !important;
}

body.logged-in .main-content .documents-page nav[aria-label="Tabs"] a:last-child,
body.logged-in .main-content .documents-page nav[aria-label="Tabs"] a[class*="px-"][class*="py-"]:last-child {
    border-bottom-right-radius: calc(var(--ui-radius-2xl) - 1px) !important;
}

body.logged-in .documents-tab-content .bg-white.rounded-xl,
body.logged-in .documents-tab-content .bg-white.rounded-2xl {
    border-color: rgba(var(--doc-accent-rgb), 0.22) !important;
}

body.logged-in .documents-tab-content .bg-white.rounded-xl:hover,
body.logged-in .documents-tab-content .bg-white.rounded-2xl:hover {
    border-color: rgba(var(--doc-accent-rgb), 0.36) !important;
}

body.logged-in .documents-tab-content input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):focus,
body.logged-in .documents-tab-content select:focus,
body.logged-in .documents-tab-content textarea:focus {
    border-color: rgba(var(--doc-accent-rgb), 0.72) !important;
    box-shadow: 0 0 0 3px rgba(var(--doc-accent-rgb), 0.18) !important;
}

body.logged-in .documents-tab-content button[class*="bg-indigo"],
body.logged-in .documents-tab-content a[class*="bg-indigo"],
body.logged-in .documents-tab-content button[class*="bg-blue"],
body.logged-in .documents-tab-content a[class*="bg-blue"],
body.logged-in .documents-tab-content button[class*="bg-green"],
body.logged-in .documents-tab-content a[class*="bg-green"],
body.logged-in .documents-tab-content button[class*="bg-purple"],
body.logged-in .documents-tab-content a[class*="bg-purple"] {
    background: linear-gradient(135deg, var(--doc-accent-strong), var(--doc-accent-hover)) !important;
    border-color: rgba(var(--doc-accent-rgb), 0.34) !important;
    box-shadow: 0 8px 18px rgba(var(--doc-accent-rgb), 0.20) !important;
}

body.logged-in .documents-tab-content [class*="text-indigo"],
body.logged-in .documents-tab-content [class*="text-blue"],
body.logged-in .documents-tab-content [class*="text-green"],
body.logged-in .documents-tab-content [class*="text-purple"] {
    color: var(--doc-accent) !important;
}

body.logged-in .documents-tab-content [class*="bg-indigo-100"],
body.logged-in .documents-tab-content [class*="bg-blue-100"],
body.logged-in .documents-tab-content [class*="bg-green-100"],
body.logged-in .documents-tab-content [class*="bg-purple-100"],
body.logged-in .documents-tab-content [class*="bg-gray-100"][class*="rounded-full"] {
    background-color: rgba(var(--doc-accent-rgb), 0.16) !important;
    color: var(--doc-accent) !important;
    border-color: rgba(var(--doc-accent-rgb), 0.24) !important;
}

body.logged-in .documents-tab-content [class*="bg-gradient-to-r"][class*="text-white"] {
    background-image: linear-gradient(135deg, var(--doc-accent-strong), var(--doc-accent-hover)) !important;
}

body.logged-in .documents-tab-content [id$="_table_container"] > .bg-gray-50:first-child {
    background: rgba(var(--doc-accent-rgb), 0.10) !important;
    border-bottom-color: rgba(var(--doc-accent-rgb), 0.22) !important;
}

body.logged-in .documents-tab-content [id$="_table_container"] > .bg-gray-50:first-child h3,
body.logged-in .documents-tab-content [id$="_results_count"] {
    color: var(--doc-accent) !important;
}

body.logged-in .documents-tab-content div[id$="_table_container"] > div:first-child h3,
body.logged-in .documents-tab-content div[id$="_empty_state"] h4 {
    color: var(--doc-accent) !important;
}

body.logged-in .documents-tab-content div[id$="_empty_state"] > div:first-child {
    background-color: rgba(var(--doc-accent-rgb), 0.16) !important;
    color: var(--doc-accent) !important;
    border: 1px solid rgba(var(--doc-accent-rgb), 0.24) !important;
}

body.logged-in .documents-tab-content thead,
body.logged-in .documents-tab-content th {
    background: rgba(var(--doc-accent-rgb), 0.10) !important;
}

body.logged-in .documents-tab-content tbody tr:hover {
    background: rgba(var(--doc-accent-rgb), 0.08) !important;
}

body.logged-in .documents-tab-content .absolute.bg-white,
body.logged-in .documents-tab-content [id$="_results"] {
    border-color: rgba(var(--doc-accent-rgb), 0.28) !important;
}

body.logged-in .documents-tab-content [readonly][class*="font-bold"] {
    background: rgba(var(--doc-accent-rgb), 0.10) !important;
    color: var(--doc-accent) !important;
    border-color: rgba(var(--doc-accent-rgb), 0.24) !important;
}

body.logged-in .main-content button:disabled,
body.logged-in .main-content a[aria-disabled="true"] {
    opacity: 0.58;
    cursor: not-allowed;
    transform: none !important;
}

@media (min-width: 768px) {
    body.logged-in .main-content form.md\:flex.md\:items-end.md\:space-x-4,
    body.logged-in .main-content form.md\:flex.md\:items-center.md\:space-x-4 {
        flex-wrap: wrap;
        gap: 1rem;
    }

    body.logged-in .main-content form.md\:flex.md\:items-end.md\:space-x-4 > *,
    body.logged-in .main-content form.md\:flex.md\:items-center.md\:space-x-4 > * {
        margin-left: 0 !important;
        min-width: min(100%, 12rem);
    }

    body.logged-in .main-content form.md\:flex.md\:items-end.md\:space-x-4 > .flex-1,
    body.logged-in .main-content form.md\:flex.md\:items-center.md\:space-x-4 > .flex-1 {
        min-width: min(100%, 18rem);
    }
}

body.logged-in .main-content [class*="rounded-full"][class*="text-xs"],
body.logged-in .main-content [class*="rounded-full"][class*="text-sm"],
body.logged-in .main-content .latest-badge,
body.logged-in .main-content .change-badge {
    min-height: 1.375rem;
    align-items: center;
    border-radius: 999px !important;
    border: 1px solid currentColor;
    border-color: color-mix(in srgb, currentColor 28%, transparent);
    line-height: 1.15;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

body.logged-in .main-content .overflow-x-auto,
body.logged-in .main-content .table-responsive {
    max-width: 100%;
    border-radius: var(--ui-radius-2xl) !important;
}

body.logged-in .main-content .bg-white.rounded-xl > .overflow-x-auto,
body.logged-in .main-content .bg-white.rounded-xl > .table-responsive,
body.logged-in .main-content .bg-white.rounded-2xl > .overflow-x-auto,
body.logged-in .main-content .bg-white.rounded-2xl > .table-responsive {
    border-top-left-radius: 0 !important;
    border-top-right-radius: 0 !important;
}

body.logged-in .main-content table {
    width: 100%;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    background: var(--ui-card-bg) !important;
    color: var(--theme-text) !important;
}

body.logged-in .main-content thead,
body.logged-in .main-content thead[class*="bg-gray"] {
    background: var(--ui-header-bg) !important;
}

body.logged-in .main-content th {
    background: var(--ui-header-bg) !important;
    color: var(--theme-text-muted) !important;
    border-bottom: 1px solid var(--theme-border) !important;
    letter-spacing: 0.02em;
}

body.logged-in .main-content td {
    border-bottom: 1px solid var(--theme-border) !important;
    color: var(--theme-text) !important;
}

body.logged-in .main-content tbody,
body.logged-in .main-content tbody[class*="bg-white"] {
    background: var(--ui-card-bg) !important;
}

body.logged-in .main-content tbody tr {
    background: transparent !important;
    transition: background-color 160ms ease;
}

body.logged-in .main-content tbody tr:hover {
    background: var(--ui-row-hover) !important;
}

body.logged-in .main-content tbody tr[class*="bg-gray"],
body.logged-in .main-content tbody tr[class*="bg-blue"],
body.logged-in .main-content tbody tr[class*="bg-indigo"],
body.logged-in .main-content tbody tr[class*="bg-purple"] {
    background: var(--theme-surface-muted) !important;
}

body.logged-in .main-content .bg-white.rounded-lg.border,
body.logged-in .main-content .bg-gray-50.rounded-lg,
body.logged-in .main-content .border.rounded-lg:not(input):not(select):not(textarea),
body.logged-in .main-content .document-item,
body.logged-in .main-content .glass-list-row {
    background-color: var(--theme-surface-muted) !important;
    border-color: var(--theme-border) !important;
    border-radius: var(--ui-radius-lg) !important;
}

body.logged-in .main-content .bg-white.rounded-lg.border,
body.logged-in .main-content .bg-gray-50.rounded-lg,
body.logged-in .main-content .document-item,
body.logged-in .main-content .glass-list-row {
    box-shadow: none !important;
}

body.logged-in .main-content [class*="rounded-t"]:first-child {
    border-top-left-radius: calc(var(--ui-radius-2xl) - 1px) !important;
    border-top-right-radius: calc(var(--ui-radius-2xl) - 1px) !important;
}

body.logged-in .main-content [class*="rounded-b"]:last-child {
    border-bottom-left-radius: calc(var(--ui-radius-2xl) - 1px) !important;
    border-bottom-right-radius: calc(var(--ui-radius-2xl) - 1px) !important;
}

body.logged-in .main-content thead:first-child tr:first-child th:first-child {
    border-top-left-radius: calc(var(--ui-radius-2xl) - 1px);
}

body.logged-in .main-content thead:first-child tr:first-child th:last-child {
    border-top-right-radius: calc(var(--ui-radius-2xl) - 1px);
}

body.logged-in .main-content :is(.bg-white.rounded-xl, .bg-white.rounded-2xl) > :is(.overflow-x-auto, .table-responsive):not(:first-child) thead:first-child tr:first-child th:first-child {
    border-top-left-radius: 0 !important;
}

body.logged-in .main-content :is(.bg-white.rounded-xl, .bg-white.rounded-2xl) > :is(.overflow-x-auto, .table-responsive):not(:first-child) thead:first-child tr:first-child th:last-child {
    border-top-right-radius: 0 !important;
}

body.logged-in .main-content tbody:last-child tr:last-child td:first-child {
    border-bottom-left-radius: calc(var(--ui-radius-2xl) - 1px);
}

body.logged-in .main-content tbody:last-child tr:last-child td:last-child {
    border-bottom-right-radius: calc(var(--ui-radius-2xl) - 1px);
}

body.logged-in .main-content tbody:last-child tr:last-child td {
    border-bottom-color: transparent !important;
}

body.logged-in .main-content [role="menu"],
body.logged-in .main-content .dropdown-menu,
body.logged-in .main-content [x-show][class*="absolute"],
body.logged-in .main-content .absolute.bg-white {
    background: var(--ui-card-bg) !important;
    border: 1px solid var(--ui-card-border) !important;
    border-radius: var(--ui-radius-lg) !important;
    box-shadow: var(--ui-card-shadow) !important;
    overflow: hidden;
}

body.logged-in .main-content [role="menu"] a,
body.logged-in .main-content [role="menu"] button,
body.logged-in .main-content .dropdown-menu a,
body.logged-in .main-content .dropdown-menu button {
    border-radius: 0 !important;
}

/* Theme-consistent action buttons */
body.logged-in .main-content :is(a, button, input[type="button"], input[type="submit"], input[type="reset"]):is(
    .bg-indigo-500, .bg-indigo-600, .bg-indigo-700,
    .bg-blue-500, .bg-blue-600, .bg-blue-700,
    .bg-green-500, .bg-green-600, .bg-green-700,
    .bg-red-500, .bg-red-600, .bg-red-700,
    .bg-purple-500, .bg-purple-600, .bg-purple-700,
    .bg-teal-500, .bg-teal-600, .bg-teal-700,
    .bg-orange-500, .bg-orange-600, .bg-orange-700,
    .bg-amber-500, .bg-amber-600, .bg-amber-700,
    .bg-yellow-500, .bg-yellow-600, .bg-yellow-700
),
body.logged-in .main-content :is(a, button, input[type="button"], input[type="submit"], input[type="reset"])[class*="bg-gradient-to-r"][class*="text-white"] {
    background: linear-gradient(135deg, var(--theme-solid-indigo), var(--theme-solid-indigo-hover)) !important;
    border: 1px solid rgba(var(--theme-accent-rgb, 79, 70, 229), 0.32) !important;
    color: var(--theme-button-text, #ffffff) !important;
    box-shadow: 0 10px 22px rgba(var(--theme-accent-rgb, 79, 70, 229), 0.20) !important;
}

body.logged-in .main-content :is(a, button, input[type="button"], input[type="submit"], input[type="reset"]):is(
    .bg-indigo-500, .bg-indigo-600, .bg-indigo-700,
    .bg-blue-500, .bg-blue-600, .bg-blue-700,
    .bg-green-500, .bg-green-600, .bg-green-700,
    .bg-red-500, .bg-red-600, .bg-red-700,
    .bg-purple-500, .bg-purple-600, .bg-purple-700,
    .bg-teal-500, .bg-teal-600, .bg-teal-700,
    .bg-orange-500, .bg-orange-600, .bg-orange-700,
    .bg-amber-500, .bg-amber-600, .bg-amber-700,
    .bg-yellow-500, .bg-yellow-600, .bg-yellow-700
):hover,
body.logged-in .main-content :is(a, button, input[type="button"], input[type="submit"], input[type="reset"])[class*="bg-gradient-to-r"][class*="text-white"]:hover {
    background: linear-gradient(135deg, var(--theme-solid-indigo-hover), var(--theme-solid-indigo)) !important;
    box-shadow: 0 14px 28px rgba(var(--theme-accent-rgb, 79, 70, 229), 0.26) !important;
    filter: none !important;
}

body.logged-in .main-content :is(a, button, input[type="button"], input[type="submit"], input[type="reset"]):not(.card-hover-lift):is(
    .bg-gray-100, .bg-gray-200, .bg-gray-300, .bg-gray-400, .bg-gray-500,
    .bg-white
) {
    background: var(--theme-surface-muted) !important;
    border: 1px solid var(--theme-border-strong) !important;
    color: var(--theme-text-soft) !important;
    box-shadow: none !important;
}

body.logged-in .main-content :is(a, button, input[type="button"], input[type="submit"], input[type="reset"]):not(.card-hover-lift):is(
    .bg-gray-100, .bg-gray-200, .bg-gray-300, .bg-gray-400, .bg-gray-500,
    .bg-white
):hover {
    background: var(--theme-surface-hover, var(--theme-surface-strong)) !important;
    border-color: rgba(var(--theme-accent-rgb, 79, 70, 229), 0.28) !important;
    color: var(--theme-accent) !important;
}

body.logged-in .main-content :is(a, button, input[type="button"], input[type="submit"], input[type="reset"]):focus-visible {
    outline: 2px solid rgba(var(--theme-accent-rgb, 79, 70, 229), 0.72) !important;
    outline-offset: 2px;
    box-shadow: var(--theme-focus-glow, 0 0 0 3px rgba(var(--theme-accent-rgb, 79, 70, 229), 0.18)) !important;
}

body.logged-in .main-content .bg-green-50,
body.logged-in .main-content .bg-red-50,
body.logged-in .main-content .bg-yellow-50,
body.logged-in .main-content .bg-blue-50,
body.logged-in .main-content .bg-indigo-50 {
    border-radius: var(--ui-radius-lg) !important;
    border-width: 1px !important;
}

@media (max-width: 767px) {
    html[data-theme="light"],
    html[data-theme="dark"],
    html[data-theme="glass"] {
        --ui-card-padding: 1rem;
        --ui-control-height: 2.75rem;
    }

    body.logged-in .main-content .bg-white.rounded-xl,
    body.logged-in .main-content .bg-white.rounded-2xl,
    body.logged-in .main-content .bg-gray-50.rounded-xl,
    body.logged-in .main-content .bg-gray-100.rounded-xl {
        border-radius: var(--ui-radius-xl) !important;
    }

    body.logged-in .main-content .stat-hover-card {
        min-height: 4.25rem;
    }

    body.logged-in .main-content table {
        min-width: 0;
    }

    body.logged-in .mobile-card-table tr {
        border-radius: var(--ui-radius-xl) !important;
        background: var(--ui-card-bg) !important;
        border-color: var(--ui-card-border) !important;
        box-shadow: var(--ui-soft-shadow) !important;
    }

    body.logged-in .mobile-card-table td:first-child,
    body.logged-in .mobile-card-table th:first-child {
        border-top-left-radius: calc(var(--ui-radius-xl) - 1px);
        border-top-right-radius: calc(var(--ui-radius-xl) - 1px);
    }

    body.logged-in .mobile-card-table td:last-child,
    body.logged-in .mobile-card-table th:last-child {
        border-bottom-left-radius: calc(var(--ui-radius-xl) - 1px);
        border-bottom-right-radius: calc(var(--ui-radius-xl) - 1px);
    }

    body.logged-in .main-content button,
    body.logged-in .main-content a[class*="px-"][class*="py-"] {
        min-height: 2.5rem;
    }
}
