/* --- Retro Futurism Theme --- */
/* A dark, moody theme focused on shadow, atmospheric black, and romantic/dramatic elements */
/* Warm amber and copper accents against deep blacks with cinematic vignette */

:root.theme-retro {
    /* Core Palette - Warm Noir */
    --retro-amber: #d4a574;
    --retro-copper: #b87333;
    --retro-bronze: #8c6b4a;
    --retro-gold: #c9a227;
    --retro-crimson: #8b3a3a;
    --retro-rose: #9e6b6b;
    
    /* Dark Base Colors - Atmospheric Black */
    --retro-black: #0d0b0a;
    --retro-void: #0a0807;
    --retro-shadow: #151210;
    --retro-panel: #1a1614;
    --retro-border: #25201d;
    
    /* Theme Variables Mapped */
    --title: #e8ddd4;
    --body: var(--retro-black);
    --htitle: #f5ebe0;
    --hbody: var(--retro-shadow);
    --table-row: var(--retro-panel);
    --table-row-hover: #251f1b;
    --primal: var(--retro-amber);
    --primal_dark: var(--retro-copper);
    --primal-rgb: 212, 165, 116;
    --btn-primary-shadow: rgba(212, 165, 116, 0.4);
    --nav-item-color: var(--retro-amber);
    color-scheme: dark;

    /* Bootstrap Overrides with Warm Accents */
    --bs-primary: var(--retro-amber);
    --bs-primary-rgb: var(--primal-rgb);
    --bs-btn-bg: var(--retro-amber);
    --bs-btn-border-color: var(--retro-amber);
    --bs-btn-hover-bg: var(--retro-copper);
    --bs-btn-hover-border-color: var(--retro-copper);
    --bs-link-color: var(--retro-amber);
    --bs-link-hover-color: var(--retro-copper);
    --bs-body-bg: var(--retro-black);
    --bs-body-color: var(--title);

    /* Login Theme Variables */
    --bg-gradient: linear-gradient(135deg, var(--retro-black) 0%, var(--retro-shadow) 50%, #1a1412 100%);
    --right-bg: var(--title);
    --primary-color: var(--retro-amber);
    
    /* Setup Builder Theme Tokens - Retro Edition */
    --ms-setup-shell-bg: linear-gradient(180deg, rgba(21, 18, 16, 0.98), rgba(13, 11, 10, 0.98));
    --ms-setup-shell-border: rgba(212, 165, 116, 0.15);
    --ms-setup-card-bg: rgba(26, 22, 20, 0.95);
    --ms-setup-card-border: rgba(184, 115, 51, 0.12);
    --ms-setup-pane-bg: rgba(212, 165, 116, 0.03);
    --ms-setup-pane-border: rgba(212, 165, 116, 0.1);
    --ms-setup-item-bg: rgba(26, 22, 20, 0.9);
    --ms-setup-item-border: rgba(212, 165, 116, 0.12);
    --ms-setup-item-hover-bg: rgba(212, 165, 116, 0.06);
    --ms-setup-item-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
    --ms-setup-item-active-bg: rgba(212, 165, 116, 0.08);
    --ms-setup-item-active-ring: rgba(212, 165, 116, 0.25);
    --ms-setup-tree-bg: linear-gradient(180deg, rgba(13, 11, 10, 0.95), rgba(21, 18, 16, 0.95));
    --ms-setup-tree-accent: rgba(184, 115, 51, 0.25);
    --ms-setup-connector: rgba(212, 165, 116, 0.2);
    --ms-setup-badge-bg: rgba(212, 165, 116, 0.12);
    --ms-setup-badge-color: #e8ddd4;
    --ms-setup-text: var(--title);
    --ms-setup-muted: #a09084;
    /* Microsys Table Tokens */
    --ms-table-surface:
        radial-gradient(circle at top, rgba(212, 165, 116, 0.08), transparent 66%),
        linear-gradient(180deg, rgba(29, 24, 21, 0.98), rgba(13, 11, 10, 0.99));
    --ms-table-border: rgba(212, 165, 116, 0.16);
    --ms-table-border-strong: rgba(212, 165, 116, 0.28);
    --ms-table-shadow: 0 18px 42px -28px rgba(0, 0, 0, 0.66);
    --ms-table-header-surface: linear-gradient(180deg, rgba(34, 28, 24, 0.98), rgba(28, 24, 22, 0.98));
    --ms-table-header-text: #f5ebe0;
    --ms-table-row-odd: rgba(13, 11, 10, 0.98);
    --ms-table-row-even: rgba(26, 22, 20, 0.98);
    --ms-table-row-hover: rgba(37, 31, 27, 0.98);
    --ms-table-cell-border: rgba(212, 165, 116, 0.12);
    --ms-table-sort-muted: rgba(232, 221, 212, 0.74);
    --ms-table-empty-muted: rgba(183, 164, 143, 0.86);
    --ms-table-empty-surface: linear-gradient(180deg, rgba(21, 18, 16, 0.98), rgba(13, 11, 10, 0.99));
    --ms-table-empty-icon-bg: rgba(212, 165, 116, 0.08);
    --ms-table-empty-icon-color: #f0dfcf;
    --ms-table-empty-icon-shadow: inset 0 0 0 1px rgba(212, 165, 116, 0.14);
    --ms-table-footer-surface: linear-gradient(180deg, rgba(18, 15, 13, 0.98), rgba(10, 8, 7, 0.99));
    --ms-table-footer-border: rgba(212, 165, 116, 0.2);
    --ms-table-footer-text: rgba(216, 196, 175, 0.82);
    --ms-density-card-border: rgba(212, 165, 116, 0.16);
    --ms-density-card-surface:
        radial-gradient(circle at top, rgba(212, 165, 116, 0.08), transparent 68%),
        linear-gradient(180deg, rgba(26, 22, 20, 0.98), rgba(13, 11, 10, 0.99));
    --ms-density-card-shadow:
        inset 0 1px 0 rgba(245, 235, 224, 0.04),
        0 18px 34px -28px rgba(0, 0, 0, 0.7);
    --ms-density-card-hover-border: rgba(212, 165, 116, 0.24);
    --ms-density-card-hover-shadow:
        inset 0 1px 0 rgba(245, 235, 224, 0.05),
        0 20px 36px -28px rgba(0, 0, 0, 0.74);
    --ms-density-card-active-border: rgba(212, 165, 116, 0.3);
    --ms-density-card-active-shadow:
        inset 0 1px 0 rgba(245, 235, 224, 0.05),
        0 0 0 0.18rem rgba(212, 165, 116, 0.12);
    --ms-density-card-icon-bg: rgba(212, 165, 116, 0.08);
    --ms-density-card-icon-color: #f3e2d1;
    --ms-density-card-title: #f5ebe0;
    --ms-density-card-copy: rgba(183, 164, 143, 0.9);
    --ms-table-chip-bg: rgba(212, 165, 116, 0.06);
    --ms-table-chip-border: rgba(212, 165, 116, 0.18);
    --ms-table-chip-text: #f1e5d9;
    --ms-table-chip-hover-bg: rgba(212, 165, 116, 0.14);
    --ms-table-chip-active-bg: rgba(212, 165, 116, 0.2);
    --ms-table-chip-active-border: rgba(212, 165, 116, 0.34);
    --ms-table-page-bg: rgba(212, 165, 116, 0.05);
    --ms-table-page-border: rgba(212, 165, 116, 0.16);
    --ms-table-page-text: #f3e9df;
    --ms-table-page-hover-bg: rgba(212, 165, 116, 0.12);
    --ms-table-page-hover-border: rgba(212, 165, 116, 0.28);
    --ms-table-page-active-bg: rgba(212, 165, 116, 0.94);
    --ms-table-page-active-border: rgba(212, 165, 116, 0.94);
    --ms-table-page-active-text: #120f0d;
    --ms-table-page-disabled-bg: rgba(255, 255, 255, 0.02);
    --ms-table-page-disabled-border: rgba(212, 165, 116, 0.08);
    --ms-table-page-disabled-text: rgba(216, 196, 175, 0.4);
    --ms-table-scroll-bg: rgba(13, 11, 10, 0.72);
    --ms-table-sticky-shadow: 10px 0 24px -20px rgba(0, 0, 0, 0.76);
    --ms-table-row-deleted-bg: rgba(255, 255, 255, 0.03);
    --ms-table-row-deleted-text: #a08a75;
    --ms-table-row-danger-bg: rgba(78, 28, 28, 0.82);
    --ms-table-row-danger-hover-bg: rgba(98, 36, 36, 0.9);
}

/* Cinematic Vignette Effect */
:root.theme-retro::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse at 50% 0%, rgba(212, 165, 116, 0.03) 0%, transparent 50%),
        radial-gradient(ellipse at 100% 100%, rgba(139, 58, 58, 0.04) 0%, transparent 40%),
        radial-gradient(ellipse at 0% 100%, rgba(0, 0, 0, 0.3) 0%, transparent 60%);
    pointer-events: none;
    z-index: -1;
}

/* Shadow vignette at edges */
:root.theme-retro body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    box-shadow: inset 0 0 150px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    z-index: 9998;
}

/* Force options to inherit retro theme colors */
:root.theme-retro select option {
    background-color: var(--retro-panel);
    color: var(--title);
}

/* --- Global Elements with Warm Noir --- */

/* 1. Global, Cards & Modals - Cinematic Panels */
:root.theme-retro .card:not([class*="text-bg-"]):not([class*="bg-"]),
:root.theme-retro .card-body:not([class*="text-bg-"]):not([class*="bg-"]),
:root.theme-retro .dashboard-card:not([class*="text-bg-"]):not([class*="bg-"]), 
:root.theme-retro .option-section:not([class*="text-bg-"]):not([class*="bg-"]),
:root.theme-retro .list-group-item:not([class*="text-bg-"]):not([class*="bg-"]):not(.active),
:root.theme-retro .modal-content,
:root.theme-retro .chart-container-sys {
    background-color: var(--retro-panel) !important;
    color: var(--title) !important;
    /* border: 1px solid rgba(212, 165, 116, 0.1) !important; */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4) !important;
}

:root.theme-retro .card:hover,
:root.theme-retro .dashboard-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(212, 165, 116, 0.08) !important;
    border-color: rgba(212, 165, 116, 0.2) !important;
}

/* Selective Border Coloring */
:root.theme-retro .card:not([class*="border-"]),
:root.theme-retro .card-body:not([class*="border-"]),
:root.theme-retro .dashboard-card:not([class*="border-"]),
:root.theme-retro .list-group-item:not([class*="border-"]),
:root.theme-retro .modal-content:not([class*="border-"]),
:root.theme-retro .chart-container-sys:not([class*="border-"]) {
    border-color: rgba(212, 165, 116, 0.1) !important;
}

/* Chart Fix */
:root.theme-retro .chart-container-sys {
    background-color: transparent !important;
    border-color: rgba(212, 165, 116, 0.15) !important;
    box-shadow: none !important;
}

:root.theme-retro .module-card,
:root.theme-retro .chart-container-sys {
    background:
        linear-gradient(180deg, rgba(29, 24, 21, 0.98) 0%, rgba(13, 11, 10, 0.98) 100%) !important;
    border-color: rgba(212, 165, 116, 0.18) !important;
    box-shadow:
        0 12px 30px rgba(0, 0, 0, 0.42),
        0 0 18px rgba(212, 165, 116, 0.08),
        inset 0 1px 0 rgba(245, 235, 224, 0.04),
        inset 0 -1px 0 rgba(184, 115, 51, 0.14) !important;
}

:root.theme-retro .module-card:hover,
:root.theme-retro .chart-container-sys:hover {
    border-color: rgba(212, 165, 116, 0.28) !important;
    box-shadow:
        0 16px 34px rgba(0, 0, 0, 0.48),
        0 0 24px rgba(212, 165, 116, 0.12),
        inset 0 1px 0 rgba(245, 235, 224, 0.05),
        inset 0 -1px 0 rgba(201, 162, 39, 0.16) !important;
}

:root.theme-retro .module-card .module-icon-wrapper {
    background:
        radial-gradient(circle at 30% 30%, rgba(212, 165, 116, 0.22), transparent 68%),
        linear-gradient(180deg, rgba(36, 28, 24, 0.98), rgba(16, 13, 11, 0.94)) !important;
    border: 1px solid rgba(212, 165, 116, 0.2) !important;
    box-shadow:
        0 0 16px rgba(212, 165, 116, 0.1),
        inset 0 0 14px rgba(184, 115, 51, 0.07) !important;
}

:root.theme-retro .module-card .module-name,
:root.theme-retro .chart-container-sys h5,
:root.theme-retro .chart-container-sys h6 {
    color: #f5ebe0 !important;
    text-shadow: 0 0 10px rgba(212, 165, 116, 0.1) !important;
}

:root.theme-retro .module-card .module-desc,
:root.theme-retro .module-card .text-muted,
:root.theme-retro .chart-container-sys .text-muted,
:root.theme-retro .chart-container-sys small {
    color: #b7a48f !important;
}

:root.theme-retro .module-card .module-action,
:root.theme-retro .chart-container-sys .module-action {
    color: var(--retro-amber) !important;
    text-shadow: 0 0 8px rgba(212, 165, 116, 0.14) !important;
}

:root.theme-retro .module-card .border-top,
:root.theme-retro .chart-container-sys .border-top {
    border-top-color: rgba(212, 165, 116, 0.14) !important;
    box-shadow: inset 0 1px 0 rgba(245, 235, 224, 0.03);
}

:root.theme-retro .module-card .display-6,
:root.theme-retro .chart-container-sys .display-6 {
    text-shadow: 0 0 12px rgba(212, 165, 116, 0.14) !important;
}

:root.theme-retro .list-group-item.bg-transparent {
    background-color: transparent !important;
}

/* Sidebar - Cinematic Edition */
:root.theme-retro #sidebar {
    background: linear-gradient(180deg, var(--retro-shadow) 0%, var(--retro-black) 100%) !important;
    border-left: 1px solid rgba(212, 165, 116, 0.15) !important;
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.5) !important;
}

:root.theme-retro .text-muted,
:root.theme-retro .text-secondary {
    color: #908070 !important;
}

:root.theme-retro .bg-light {
    background-color: var(--retro-shadow) !important;
    border-color: rgba(212, 165, 116, 0.1) !important;
}

:root.theme-retro .bg-white {
    background-color: var(--retro-panel) !important;
    color: var(--title) !important;
}

:root.theme-retro .border-white {
    border-color: rgba(212, 165, 116, 0.15) !important;
}

/* 2. Titlebar - Dramatic Header */
:root.theme-retro .titlebar {
    background: linear-gradient(90deg, var(--retro-black) 0%, var(--retro-shadow) 50%, #1a1512 100%) !important;
    border-bottom: 1px solid rgba(212, 165, 116, 0.2) !important;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.4) !important;
}

:root.theme-retro .titlebar p,
:root.theme-retro .titlebar .btn-light,
:root.theme-retro .titlebar .btn-light .bi {
    color: var(--retro-amber) !important;
}

:root.theme-retro .titlebar .btn-light:hover {
    background-color: rgba(212, 165, 116, 0.1) !important;
    color: var(--retro-copper) !important;
    box-shadow: 0 0 15px rgba(212, 165, 116, 0.2) !important;
}

:root.theme-retro .titlebar[data-titlebar-logo-treatment="plate"] .titlebar__logo {
    background:
        linear-gradient(135deg, rgba(212, 165, 116, 0.18), rgba(184, 115, 51, 0.08)),
        rgba(245, 235, 224, 0.92) !important;
    border-color: rgba(212, 165, 116, 0.36) !important;
}

:root.theme-retro .titlebar[data-titlebar-logo-treatment="halo"] .titlebar__logo,
:root.theme-retro .titlebar[data-titlebar-logo-treatment="contrast"] .titlebar__logo {
    filter:
        brightness(1.12)
        contrast(1.14)
        drop-shadow(0 0 0.42rem rgba(212, 165, 116, 0.42)) !important;
}

:root.theme-retro .bi-three-dots,
:root.theme-retro .bi-three-dots-vertical,
:root.theme-retro .bi:not(.btn-primary .bi):not(.btn-light .bi):not(.btn-secondary .bi):not(.btn-success .bi):not(.btn-info .bi):not(.btn-warning .bi):not(.btn-danger .bi) {
    color: var(--retro-amber) !important;
    text-shadow: 0 0 5px rgba(212, 165, 116, 0.22) !important;
}

:root.theme-retro .lang-option,
.theme-retro .lang-option {
    background-color: rgba(26, 22, 20, 0.92) !important;
    border-color: rgba(212, 165, 116, 0.14) !important;
    color: #b7a48f !important;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.22) !important;
}

:root.theme-retro .lang-option:hover,
.theme-retro .lang-option:hover {
    background-color: rgba(36, 28, 24, 0.96) !important;
    border-color: rgba(212, 165, 116, 0.28) !important;
    color: var(--retro-amber) !important;
}

:root.theme-retro .lang-option.lang-active,
:root.theme-retro .lang-option.active,
:root.theme-retro .lang-active,
.theme-retro .lang-option.lang-active,
.theme-retro .lang-option.active,
.theme-retro .lang-active {
    background-color: rgba(212, 165, 116, 0.12) !important;
    border-color: var(--retro-amber) !important;
    color: var(--retro-amber) !important;
    box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.14) !important;
}

:root.theme-retro .theme-preview,
.theme-retro .theme-preview {
    border: none !important;
    box-shadow: none !important;
    outline: 2px solid rgba(212, 165, 116, 0.2) !important;
    outline-offset: 2px !important;
}

:root.theme-retro .theme-preview.active,
.theme-retro .theme-preview.active {
    outline-color: var(--retro-amber) !important;
    box-shadow: 0 0 18px rgba(212, 165, 116, 0.24) !important;
}

/* 3. Forms & Inputs - Warm Glowing Fields */
:root.theme-retro .microsys-form,
:root.theme-retro .archive-document-form,
:root.theme-retro .microsys-filter {
    --archive-form-surface: linear-gradient(180deg, rgba(26, 22, 20, 0.98), rgba(15, 13, 12, 0.96));
    --archive-form-border: rgba(212, 165, 116, 0.15);
    --archive-form-border-strong: rgba(212, 165, 116, 0.35);
    --archive-form-focus-ring: rgba(212, 165, 116, 0.2);
    --archive-form-muted: #a09084;
}

:root.theme-retro .form-control,
:root.theme-retro .form-select,
:root.theme-retro .input-group-text {
    background-color: var(--retro-panel) !important;
    border-color: rgba(212, 165, 116, 0.15) !important;
    color: var(--title) !important;
}

:root.theme-retro .form-control:focus,
:root.theme-retro .form-select:focus {
    background-color: var(--retro-shadow) !important;
    border-color: var(--retro-amber) !important;
    color: #fff !important;
    box-shadow: 0 0 0 0.2rem rgba(212, 165, 116, 0.2) !important;
    outline: none !important;
}

:root.theme-retro .microsys-filter .form-control,
:root.theme-retro .microsys-filter .form-select,
:root.theme-retro .microsys-filter textarea {
    background: var(--archive-form-surface) !important;
    border-color: rgba(212, 165, 116, 0.18) !important;
    color: #f3e7db !important;
    box-shadow:
        inset 0 1px 0 rgba(245, 235, 224, 0.04),
        0 10px 22px -18px rgba(0, 0, 0, 0.38) !important;
}

:root.theme-retro .microsys-filter .form-control::placeholder,
:root.theme-retro .microsys-filter textarea::placeholder {
    color: rgba(183, 164, 143, 0.88) !important;
}

:root.theme-retro .microsys-filter .form-control:hover,
:root.theme-retro .microsys-filter .form-select:hover,
:root.theme-retro .microsys-filter textarea:hover {
    border-color: rgba(212, 165, 116, 0.28) !important;
}

:root.theme-retro .microsys-filter .form-control:focus,
:root.theme-retro .microsys-filter .form-select:focus,
:root.theme-retro .microsys-filter textarea:focus {
    background: linear-gradient(180deg, rgba(33, 27, 24, 0.98), rgba(19, 16, 14, 0.96)) !important;
    color: #fff8ef !important;
}

:root.theme-retro .microsys-filter .btn.microsys-filter-submit.btn-secondary {
    background:
        radial-gradient(circle at top, rgba(212, 165, 116, 0.12), transparent 58%),
        linear-gradient(180deg, rgba(29, 24, 21, 0.98), rgba(16, 13, 12, 0.96)) !important;
    border-color: rgba(212, 165, 116, 0.24) !important;
    color: var(--retro-amber) !important;
    box-shadow:
        inset 0 1px 0 rgba(245, 235, 224, 0.04),
        0 12px 24px -18px rgba(0, 0, 0, 0.4) !important;
}

:root.theme-retro .microsys-filter .btn.microsys-filter-submit.btn-secondary i {
    color: var(--retro-amber) !important;
    text-shadow: none !important;
}

:root.theme-retro .form-control[type="file"]::file-selector-button {
    background: linear-gradient(135deg, var(--retro-amber) 0%, var(--retro-copper) 100%) !important;
    color: var(--retro-black) !important;
    border: none !important;
    border-inline-end: 1px solid rgba(212, 165, 116, 0.2) !important;
    padding: 0.375rem 0.75rem;
    margin-inline-end: 0.75rem;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
    cursor: pointer;
}

:root.theme-retro .form-control[type="file"]::file-selector-button:hover {
    background: linear-gradient(135deg, var(--retro-copper) 0%, var(--retro-bronze) 100%) !important;
    box-shadow: 0 0 15px rgba(212, 165, 116, 0.2) !important;
}

/* 4. Tables - Cinematic Data Grid */
:root.theme-retro .table {
    color: var(--title) !important;
    --bs-table-color: var(--title) !important;
    --bs-table-striped-color: var(--title) !important;
    --bs-table-active-color: var(--title) !important;
}

:root.theme-retro .table thead th {
    background: var(--ms-table-header-surface) !important;
    color: var(--retro-amber) !important;
    border-color: rgba(212, 165, 116, 0.15) !important;
    border-bottom: 2px solid var(--retro-amber) !important;
}

:root.theme-retro .table>tbody>tr:nth-child(odd)>td, 
:root.theme-retro .table>tbody>tr:nth-child(odd)>th {
    --bs-table-bg-type: var(--retro-black) !important; 
    background-color: var(--retro-black) !important;
    color: var(--htitle) !important;
}

:root.theme-retro .table>tbody>tr:nth-child(even)>td, 
:root.theme-retro .table>tbody>tr:nth-child(even)>th {
    --bs-table-bg-type: var(--retro-panel) !important;
    background-color: var(--retro-panel) !important;
    color: var(--htitle) !important;
}

/* 5. Dropdowns - Dramatic Menu */
:root.theme-retro .dropdown-menu {
    background-color: var(--retro-panel) !important;
    border-color: rgba(212, 165, 116, 0.2) !important;
    border: 1px solid rgba(212, 165, 116, 0.2) !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5) !important;
}

:root.theme-retro .dropdown-item {
    color: var(--title) !important;
}

:root.theme-retro .dropdown-item:hover,
:root.theme-retro .dropdown-item:focus,
:root.theme-retro .dropdown-item:active,
:root.theme-retro .dropdown-item.active {
    background-color: rgba(212, 165, 116, 0.09) !important;
    color: #f0d6ba !important;
    border-color: transparent !important;
    box-shadow:
        inset 3px 0 0 rgba(212, 165, 116, 0.82),
        inset 0 0 0 1px rgba(212, 165, 116, 0.18) !important;
    text-shadow: none !important;
}

:root.theme-retro .dropdown-item:hover i,
:root.theme-retro .dropdown-item:focus i,
:root.theme-retro .dropdown-item:active i,
:root.theme-retro .dropdown-item.active i {
    color: var(--retro-amber) !important;
    opacity: 1 !important;
}

:root.theme-retro .context-menu {
    background: linear-gradient(180deg, rgba(26, 22, 20, 0.98), rgba(13, 11, 10, 0.99)) !important;
    border: 1px solid rgba(212, 165, 116, 0.2) !important;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.38) !important;
}

:root.theme-retro .context-menu-item {
    color: var(--title) !important;
}

:root.theme-retro .context-menu-item:hover,
:root.theme-retro .context-menu-item:focus,
:root.theme-retro .context-menu-item:active {
    background-color: rgba(212, 165, 116, 0.09) !important;
    color: #f0d6ba !important;
    box-shadow:
        inset 3px 0 0 rgba(212, 165, 116, 0.82),
        inset 0 0 0 1px rgba(212, 165, 116, 0.18) !important;
    text-shadow: none !important;
}

:root.theme-retro .context-menu-item:hover i,
:root.theme-retro .context-menu-item:focus i,
:root.theme-retro .context-menu-item:active i {
    color: var(--retro-amber) !important;
    opacity: 1 !important;
}

:root.theme-retro .context-menu-item.text-danger:hover,
:root.theme-retro .context-menu-item.text-danger:focus,
:root.theme-retro .context-menu-item.text-danger:active {
    background-color: rgba(139, 58, 58, 0.24) !important;
    color: #f2b9b0 !important;
    box-shadow:
        inset 3px 0 0 rgba(201, 107, 107, 0.76),
        inset 0 0 0 1px rgba(201, 107, 107, 0.16) !important;
}

:root.theme-retro .context-menu-divider {
    border-top-color: rgba(212, 165, 116, 0.14) !important;
}

/* 6. Buttons - Warm Primary */
:root.theme-retro .btn-primary, 
:root.theme-retro .btn-primary *,
:root.theme-retro .btn-primary:hover,
:root.theme-retro .btn-primary:active,
.theme-retro .btn-primary,
.theme-retro .btn-primary * {
    background: linear-gradient(135deg, var(--retro-amber) 0%, var(--retro-copper) 100%) !important;
    border-color: var(--retro-amber) !important;
    color: var(--retro-black) !important;
    font-weight: 600 !important;
}

:root.theme-retro .btn-primary:hover {
    background: linear-gradient(135deg, var(--retro-copper) 0%, var(--retro-bronze) 100%) !important;
    box-shadow: 0 0 20px rgba(212, 165, 116, 0.3) !important;
}

:root.theme-retro .microsys-filter .microsys-filter-action.btn-primary > .bi,
.theme-retro .microsys-filter .microsys-filter-action.btn-primary > .bi {
    background: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
    color: inherit !important;
}

:root.theme-retro .btn-secondary,
:root.theme-retro .btn-success,
:root.theme-retro .btn-info,
:root.theme-retro .btn-warning,
:root.theme-retro .btn-danger,
:root.theme-retro .btn-light {
    color: var(--retro-black) !important;
    font-weight: 600 !important;
}

:root.theme-retro .btn-secondary .bi,
:root.theme-retro .btn-success .bi,
:root.theme-retro .btn-info .bi,
:root.theme-retro .btn-warning .bi,
:root.theme-retro .btn-danger .bi,
:root.theme-retro .btn-light .bi {
    color: inherit !important;
}

:root.theme-retro .glass-profile .action-btn,
:root.theme-retro .glass-card .action-btn {
    min-height: 42px;
    padding: 10px 20px;
    font-size: 0.95rem;
    line-height: 1.2;
}

/* 7. Sidebar Active State */
:root.theme-retro .sidebar,
.theme-retro .sidebar {
    --sidebar-divider-color: rgba(212, 165, 116, 0.075);
    --sidebar-hover-bg: rgba(212, 165, 116, 0.05);
    --sidebar-folder-bg: rgba(42, 28, 18, 0.28);
    --sidebar-folder-active-bg: rgba(212, 165, 116, 0.1);
    --sidebar-root-active-bg: rgba(212, 165, 116, 0.075);
    --sidebar-folder-indicator-border: rgba(212, 165, 116, 0.18);
}

:root.theme-retro .sidebar .list-group-item.active,
.theme-retro .sidebar .list-group-item.active,
:root.theme-retro .sidebar.collapsed .accordion-button.has-active-child,
.theme-retro .sidebar.collapsed .accordion-button.has-active-child {
    color: var(--retro-amber) !important;
    background: rgba(212, 165, 116, 0.08) !important;
    border-left: 3px solid var(--retro-amber) !important;
    box-shadow: inset 5px 0 15px rgba(212, 165, 116, 0.08) !important;
}

:root.theme-retro ::-webkit-scrollbar-track {
    background: var(--retro-black); 
}

:root.theme-retro ::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--retro-amber), var(--retro-copper)) !important;
    border: 3px solid var(--retro-black);
}

/* 8. Text Elements */
:root.theme-retro h1, 
:root.theme-retro h2, 
:root.theme-retro h3, 
:root.theme-retro h4, 
:root.theme-retro h5, 
:root.theme-retro h6,
:root.theme-retro .header-title,
:root.theme-retro .stat-value,
:root.theme-retro .form-text,
:root.theme-retro .accordion-button,
:root.theme-retro label,
:root.theme-retro .form-label,
:root.theme-retro .titlebar p,
:root.theme-retro .card-title-sys,
.theme-retro h1, 
.theme-retro h2, 
.theme-retro h3, 
.theme-retro h4, 
.theme-retro h5, 
.theme-retro h6,
.theme-retro .header-title,
.theme-retro .stat-value,
.theme-retro .form-text,
.theme-retro .accordion-button,
.theme-retro label,
.theme-retro .form-label,
.theme-retro .titlebar p,
.theme-retro .card-title-sys {
    color: #ffffff !important;
}

:root.theme-retro h1, 
:root.theme-retro h2, 
:root.theme-retro .page-title,
.theme-retro h1, 
.theme-retro h2, 
.theme-retro .page-title {
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5) !important;
}

/* 9. Glass Components */
:root.theme-retro .glass-profile,
:root.theme-retro .glass-card,
:root.theme-retro .glass-detail {
    background: rgba(26, 22, 20, 0.95) !important;
    border: 1px solid rgba(212, 165, 116, 0.15) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4) !important;
}

/* 10. Nav Tabs - Warm Tabs */
:root.theme-retro .nav-link.active {
    color: var(--retro-amber) !important;
    background-color: rgba(212, 165, 116, 0.1) !important;
    border-color: var(--retro-amber) !important;
    border-bottom-color: transparent !important;
    box-shadow: inset 0 -2px 0 var(--retro-amber);
}

:root.theme-retro .modern-tabs .nav-link.active {
    color: var(--retro-black) !important;
    background: linear-gradient(135deg, var(--retro-amber) 0%, var(--retro-copper) 100%) !important;
    border-color: var(--retro-amber) !important;
}

/* 11. Alerts - Warm Notifications */
:root.theme-retro .alert-success {
    background-color: rgba(201, 162, 39, 0.12) !important;
    border-color: rgba(201, 162, 39, 0.3) !important;
    color: var(--retro-gold) !important;
}

:root.theme-retro .alert-warning {
    background-color: rgba(212, 165, 116, 0.1) !important;
    border-color: rgba(212, 165, 116, 0.3) !important;
    color: var(--retro-amber) !important;
}

:root.theme-retro .alert-danger {
    background-color: rgba(139, 58, 58, 0.15) !important;
    border-color: rgba(139, 58, 58, 0.3) !important;
    color: var(--retro-crimson) !important;
}

:root.theme-retro .alert-info {
    background-color: rgba(184, 115, 51, 0.12) !important;
    border-color: rgba(184, 115, 51, 0.3) !important;
    color: var(--retro-copper) !important;
}

/* 12. Pagination - Warm Navigation */
:root.theme-retro .pagination .page-link {
    background-color: var(--retro-panel) !important;
    border-color: rgba(212, 165, 116, 0.15) !important;
    color: #908070 !important;
}

:root.theme-retro .pagination .page-link:hover {
    background-color: rgba(212, 165, 116, 0.1) !important;
    color: var(--retro-amber) !important;
}

:root.theme-retro .pagination .page-item.active .page-link {
    background: linear-gradient(135deg, var(--retro-amber) 0%, var(--retro-copper) 100%) !important;
    border-color: var(--retro-amber) !important;
    color: var(--retro-black) !important;
}

/* 13. Badges - Warm Indicators */
:root.theme-retro .badge.bg-primary {
    background: linear-gradient(135deg, var(--retro-amber) 0%, var(--retro-copper) 100%) !important;
    color: var(--retro-black) !important;
}

/* 14. Login Screen - Cinematic */
:root.theme-retro .page .left {
    background: rgba(26, 22, 20, 0.98) !important;
    border: 1px solid rgba(212, 165, 116, 0.2) !important;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5) !important;
}

:root.theme-retro .page .right {
    background: linear-gradient(135deg, var(--retro-shadow) 0%, #1a1512 100%) !important;
    color: var(--retro-amber) !important;
}

/* 15. Progress Bars */
:root.theme-retro .progress-bar {
    background: linear-gradient(90deg, var(--retro-amber) 0%, var(--retro-copper) 100%) !important;
}

/* 16. Form Check */
:root.theme-retro .form-check-input {
    background-color: var(--retro-panel) !important;
    border-color: rgba(212, 165, 116, 0.3) !important;
}

:root.theme-retro .form-check-input:checked {
    background-color: var(--retro-amber) !important;
    border-color: var(--retro-amber) !important;
}

/* 17. Tooltip */
:root.theme-retro .tooltip-inner {
    background-color: var(--retro-panel) !important;
    color: var(--retro-amber) !important;
    border: 1px solid rgba(212, 165, 116, 0.2) !important;
}

/* 18. Modal */
:root.theme-retro .modal-header {
    background: linear-gradient(90deg, var(--retro-shadow) 0%, var(--retro-panel) 100%) !important;
    border-bottom: 1px solid rgba(212, 165, 116, 0.15) !important;
}

:root.theme-retro .modal-header .modal-title {
    color: var(--retro-amber) !important;
}

/* 19. List Group */
:root.theme-retro .list-group-item.active {
    background: linear-gradient(90deg, rgba(212, 165, 116, 0.1) 0%, rgba(184, 115, 51, 0.05) 100%) !important;
    border-color: var(--retro-amber) !important;
    color: var(--retro-amber) !important;
}

/* 20. Accordion */
:root.theme-retro .accordion-button:not(.collapsed) {
    background: linear-gradient(90deg, rgba(212, 165, 116, 0.08) 0%, transparent 100%) !important;
    color: var(--retro-amber) !important;
}

/* 21. User Hub, Activity, Tutorial, and System Settings */
:root.theme-retro .ms-user-trigger {
    background: linear-gradient(135deg, rgba(212, 165, 116, 0.1), rgba(184, 115, 51, 0.08)) !important;
    border-color: rgba(212, 165, 116, 0.2) !important;
    box-shadow: 0 0 18px rgba(212, 165, 116, 0.08) !important;
}

:root.theme-retro .ms-user-trigger:hover {
    background: linear-gradient(135deg, rgba(212, 165, 116, 0.16), rgba(184, 115, 51, 0.12)) !important;
    border-color: rgba(212, 165, 116, 0.34) !important;
}

:root.theme-retro .ms-user-dropdown-card,
:root.theme-retro .stats-card,
:root.theme-retro .timeline-content,
:root.theme-retro .driver-popover {
    background: linear-gradient(180deg, rgba(26, 22, 20, 0.98), rgba(13, 11, 10, 0.98)) !important;
    border-color: rgba(212, 165, 116, 0.18) !important;
    color: var(--title) !important;
}

:root.theme-retro .ms-user-dropdown-card,
:root.theme-retro .driver-popover {
    box-shadow:
        0 18px 44px rgba(0, 0, 0, 0.55),
        0 0 26px rgba(212, 165, 116, 0.1) !important;
}

:root.theme-retro .ms-dropdown-header,
:root.theme-retro #activityLogDetailModal .modal-footer,
:root.theme-retro #activityLogDetailModal .modal-header {
    border-color: rgba(212, 165, 116, 0.12) !important;
}

:root.theme-retro .ms-dropdown-toolbar,
:root.theme-retro .completeness-container,
:root.theme-retro .glass-profile .bg-light.border,
:root.theme-retro .glass-card .bg-light.border,
:root.theme-retro #activityLogDetailModal .bg-light,
:root.theme-retro #backupCodesModal .alert.alert-warning,
:root.theme-retro #otpSetupSuccess .alert.alert-warning {
    background: linear-gradient(180deg, rgba(26, 22, 20, 0.96), rgba(21, 18, 16, 0.94)) !important;
    border-color: rgba(212, 165, 116, 0.16) !important;
    color: var(--title) !important;
}

:root.theme-retro .ms-user-role,
:root.theme-retro #activityLogDetailModal .badge.bg-secondary {
    background: rgba(212, 165, 116, 0.12) !important;
    color: var(--retro-amber) !important;
    border: 1px solid rgba(212, 165, 116, 0.18) !important;
}

:root.theme-retro .ms-tool-btn,
:root.theme-retro .ms-avatar-preview.bg-light {
    background: linear-gradient(180deg, rgba(26, 22, 20, 0.96), rgba(13, 11, 10, 0.96)) !important;
    border-color: rgba(212, 165, 116, 0.18) !important;
    color: var(--retro-amber) !important;
}

:root.theme-retro .ms-tool-btn:hover,
:root.theme-retro .driver-popover-prev-btn:hover {
    background: rgba(212, 165, 116, 0.12) !important;
    border-color: rgba(212, 165, 116, 0.34) !important;
    color: #f5ebe0 !important;
}

:root.theme-retro .ms-avatar-preview,
:root.theme-retro .ms-trigger-avatar,
:root.theme-retro .profile-img-container,
:root.theme-retro .preview-img,
:root.theme-retro .ms-image-preview-circle {
    border-color: rgba(212, 165, 116, 0.24) !important;
    box-shadow:
        0 12px 28px rgba(0, 0, 0, 0.4),
        0 0 20px rgba(212, 165, 116, 0.1) !important;
}

:root.theme-retro .stats-card:hover {
    box-shadow:
        0 12px 30px rgba(0, 0, 0, 0.45),
        0 0 22px rgba(212, 165, 116, 0.1) !important;
}

:root.theme-retro .stats-value,
:root.theme-retro .stats-icon,
:root.theme-retro #activityLogDetailModal .modal-title,
:root.theme-retro #activityLogDetailModal h6,
:root.theme-retro #activityLogDetailModal .text-secondary,
:root.theme-retro .driver-popover-title {
    color: var(--retro-amber) !important;
}

:root.theme-retro .stats-label,
:root.theme-retro .timeline-time,
:root.theme-retro .driver-popover-progress-text,
:root.theme-retro .driver-popover-close-btn,
:root.theme-retro .text-white-50 {
    color: #a09084 !important;
}

:root.theme-retro .activity-timeline {
    border-color: rgba(212, 165, 116, 0.2) !important;
}

:root.theme-retro .timeline-title,
:root.theme-retro .driver-popover-description {
    color: #f5ebe0 !important;
}

:root.theme-retro .timeline-dot {
    border-color: var(--retro-black) !important;
    box-shadow:
        0 0 0 2px rgba(212, 165, 116, 0.2),
        0 0 12px rgba(212, 165, 116, 0.14) !important;
}

:root.theme-retro .progress-custom {
    background-color: rgba(212, 165, 116, 0.08) !important;
}

:root.theme-retro .activitylog-page-card,
:root.theme-retro #activityLogDetailModal .table-responsive {
    background: transparent !important;
}

:root.theme-retro .ms-tooltip {
    --ms-tooltip-bg: rgba(13, 11, 10, 0.95);
    --ms-tooltip-color: var(--retro-amber);
    --ms-tooltip-border: rgba(212, 165, 116, 0.22);
    background: rgba(13, 11, 10, 0.95) !important;
    color: var(--retro-amber) !important;
    border-color: rgba(212, 165, 116, 0.22) !important;
}

:root.theme-retro .driver-popover-next-btn {
    background: linear-gradient(90deg, rgba(212, 165, 116, 0.94), rgba(184, 115, 51, 0.86)) !important;
    border-color: rgba(212, 165, 116, 0.28) !important;
    color: var(--retro-black) !important;
}

:root.theme-retro .driver-popover-next-btn:hover {
    background: linear-gradient(90deg, rgba(212, 165, 116, 1), rgba(184, 115, 51, 0.94)) !important;
}

:root.theme-retro .driver-popover-prev-btn {
    background: rgba(26, 22, 20, 0.95) !important;
    color: #e8ddd4 !important;
    border-color: rgba(212, 165, 116, 0.14) !important;
}

:root.theme-retro .driver-popover-close-btn:hover {
    color: var(--retro-gold) !important;
}

:root.theme-retro .driver-popover-arrow {
    color: rgba(26, 22, 20, 0.98) !important;
}

:root.theme-retro .text-bg-primary,
:root.theme-retro .badge.text-bg-primary,
:root.theme-retro .ms-system-settings-shell .text-bg-primary {
    background: linear-gradient(135deg, var(--retro-amber) 0%, var(--retro-copper) 100%) !important;
    color: var(--retro-black) !important;
    border: 1px solid rgba(212, 165, 116, 0.24) !important;
    text-shadow: none !important;
}

:root.theme-retro .sidebar-toolbar {
    border-top-color: rgba(212, 165, 116, 0.08) !important;
    background:
        linear-gradient(180deg, rgba(245, 235, 224, 0.04), rgba(255, 255, 255, 0)),
        linear-gradient(to top, rgba(212, 165, 116, 0.18), rgba(13, 11, 10, 0.95)) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.03),
        0 -10px 24px rgba(0, 0, 0, 0.3) !important;
}

:root.theme-retro .sidebar-toolbar::before {
    border-color: rgba(212, 165, 116, 0.12) !important;
    background:
        linear-gradient(180deg, rgba(245, 235, 224, 0.05), rgba(255, 255, 255, 0.012)),
        repeating-linear-gradient(
            90deg,
            rgba(212, 165, 116, 0.045) 0 1px,
            transparent 1px 24px
        ) !important;
    box-shadow: inset 0 1px 0 rgba(245, 235, 224, 0.05) !important;
}

:root.theme-retro .sidebar-toolbar-link,
:root.theme-retro .reorder-toggle {
    color: rgba(232, 221, 212, 0.82) !important;
    background: rgba(255, 255, 255, 0.045) !important;
    border-color: rgba(212, 165, 116, 0.14) !important;
    box-shadow:
        inset 0 1px 0 rgba(245, 235, 224, 0.04),
        0 5px 14px rgba(0, 0, 0, 0.22) !important;
}

:root.theme-retro .sidebar-toolbar-link:hover,
:root.theme-retro .reorder-toggle:hover,
:root.theme-retro .reorder-toggle.active {
    color: var(--retro-amber) !important;
    background:
        radial-gradient(circle at top, rgba(212, 165, 116, 0.18), transparent 70%),
        rgba(255, 255, 255, 0.075) !important;
    border-color: rgba(212, 165, 116, 0.28) !important;
}

:root.theme-retro .theme-arrow {
    color: var(--retro-amber) !important;
}

:root.theme-retro .sidebar-density-indicator {
    color: rgba(232, 221, 212, 0.82) !important;
    background: rgba(255, 255, 255, 0.045) !important;
    border-color: rgba(212, 165, 116, 0.18) !important;
    box-shadow:
        inset 0 1px 0 rgba(245, 235, 224, 0.04),
        0 5px 14px rgba(0, 0, 0, 0.22) !important;
}

:root.theme-retro .sidebar-density-indicator:hover {
    color: var(--retro-amber) !important;
    background:
        radial-gradient(circle at top, rgba(212, 165, 116, 0.14), transparent 70%),
        rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(212, 165, 116, 0.32) !important;
}

:root.theme-retro .sidebar-density-popup {
    background: linear-gradient(180deg, rgba(26, 22, 20, 0.98), rgba(13, 11, 10, 0.98)) !important;
    border-color: rgba(212, 165, 116, 0.2) !important;
    color: var(--title) !important;
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(212, 165, 116, 0.06) !important;
}

:root.theme-retro .sidebar-density-popup .small {
    color: var(--retro-amber) !important;
    border-bottom-color: rgba(212, 165, 116, 0.12) !important;
}

:root.theme-retro .sidebar-density-chip {
    background: rgba(255, 255, 255, 0.04) !important;
    border-color: rgba(212, 165, 116, 0.18) !important;
    color: rgba(232, 221, 212, 0.55) !important;
}

:root.theme-retro .sidebar-density-chip.is-active,
:root.theme-retro .sidebar-density-chip:hover {
    color: var(--retro-amber) !important;
    border-color: rgba(212, 165, 116, 0.32) !important;
    background: rgba(212, 165, 116, 0.1) !important;
}

:root.theme-retro .current-theme-indicator {
    border-color: rgba(212, 165, 116, 0.42) !important;
    box-shadow:
        inset 0 0 0 1px rgba(245, 235, 224, 0.06),
        0 6px 16px rgba(0, 0, 0, 0.24),
        0 0 18px rgba(212, 165, 116, 0.12) !important;
}

:root.theme-retro .theme-popup {
    background: linear-gradient(180deg, rgba(26, 22, 20, 0.98), rgba(13, 11, 10, 0.98)) !important;
    border-color: rgba(212, 165, 116, 0.2) !important;
    color: var(--title) !important;
    box-shadow:
        0 18px 40px rgba(0, 0, 0, 0.5),
        0 0 26px rgba(212, 165, 116, 0.08) !important;
}

:root.theme-retro .theme-popup .small {
    color: var(--retro-amber) !important;
    border-bottom-color: rgba(212, 165, 116, 0.12) !important;
}

:root.theme-retro .theme-option-circle {
    border-color: rgba(212, 165, 116, 0.16) !important;
    box-shadow: inset 0 0 0 1px rgba(212, 165, 116, 0.14) !important;
}

:root.theme-retro .theme-option-circle.active {
    border-color: var(--retro-amber) !important;
    box-shadow:
        0 0 0 2px var(--retro-black),
        0 0 0 4px var(--retro-amber),
        0 0 18px rgba(212, 165, 116, 0.24) !important;
}

.theme-retro .theme-option-circle {
    border-color: rgba(212, 165, 116, 0.16) !important;
    box-shadow: inset 0 0 0 1px rgba(212, 165, 116, 0.14) !important;
}

.theme-retro .theme-option-circle.active {
    border-color: var(--retro-amber) !important;
    box-shadow:
        0 0 0 2px var(--retro-black),
        0 0 0 4px var(--retro-amber),
        0 0 18px rgba(212, 165, 116, 0.24) !important;
}

:root.theme-retro .sidebar .list-group-item,
:root.theme-retro .sidebar .accordion-button,
:root.theme-retro .sidebar .accordion-item,
:root.theme-retro .sidebar .accordion-body,
:root.theme-retro .sidebar .group-url-btn,
.theme-retro .sidebar .list-group-item,
.theme-retro .sidebar .accordion-button,
.theme-retro .sidebar .accordion-item,
.theme-retro .sidebar .accordion-body,
.theme-retro .sidebar .group-url-btn {
    border-width: 0 !important;
    border-color: transparent !important;
    box-shadow: none !important;
}

:root.theme-retro .sidebar .list-group-item.active,
:root.theme-retro .sidebar .accordion-button:not(.collapsed),
.theme-retro .sidebar .list-group-item.active,
.theme-retro .sidebar .accordion-button:not(.collapsed) {
    border-left: none !important;
    box-shadow: none !important;
}

:root.theme-retro .sidebar.collapsed .accordion-button.has-active-child,
.theme-retro .sidebar.collapsed .accordion-button.has-active-child,
:root.theme-retro .sidebar .list-group-item.active,
.theme-retro .sidebar .list-group-item.active {
    border-left: none !important;
    box-shadow: none !important;
}

:root.theme-retro .sidebar .accordion-button:not(.collapsed),
.theme-retro .sidebar .accordion-button:not(.collapsed) {
    background:
        linear-gradient(180deg, rgba(245, 235, 224, 0.02), rgba(245, 235, 224, 0.006)),
        rgba(255, 255, 255, 0.018) !important;
    box-shadow:
        inset 0 1px 0 rgba(245, 235, 224, 0.04),
        inset 0 -1px 0 rgba(0, 0, 0, 0.16) !important;
}

:root.theme-retro .sidebar.collapsed .accordion-button.has-active-child,
.theme-retro .sidebar.collapsed .accordion-button.has-active-child {
    background:
        linear-gradient(180deg, rgba(245, 235, 224, 0.03), rgba(245, 235, 224, 0.008)),
        rgba(212, 165, 116, 0.055) !important;
    box-shadow:
        inset 0 1px 0 rgba(245, 235, 224, 0.04),
        inset 0 -1px 0 rgba(212, 165, 116, 0.055) !important;
}

/* 23. Tutorial Controls Bar */
:root.theme-retro #tutorial-controls {
    --tut-bar-bg: rgba(21, 18, 16, 0.96);
    --tut-bar-border: var(--retro-border);
    --tut-bar-shadow: rgba(13, 11, 10, 0.4);
    --tut-progress-color: var(--retro-rose);
    --tut-next-bg: linear-gradient(135deg, var(--retro-amber), var(--retro-copper));
    --tut-next-bg-hover: linear-gradient(135deg, var(--retro-copper), var(--retro-bronze));
    --tut-next-color: var(--retro-black);
    --tut-next-shadow: rgba(184, 115, 51, 0.3);
    --tut-prev-bg: rgba(255, 255, 255, 0.05);
    --tut-prev-bg-hover: rgba(255, 255, 255, 0.1);
    --tut-prev-color: #e8ddd4;
    --tut-prev-border: var(--retro-border);
    --tut-skip-color: #e57373;
    --tut-skip-border: rgba(229, 115, 115, 0.2);
    --tut-skip-bg-hover: rgba(229, 115, 115, 0.08);
}

:root.theme-retro .tut-btn-next {
    background: var(--tut-next-bg) !important;
}

:root.theme-retro .tut-btn-next:hover {
    background: var(--tut-next-bg-hover) !important;
}

/* 24. Titlebar Home Button */
:root.theme-retro .titlebar .ms-titlebar-home,
:root.theme-retro .titlebar .ms-login-round {
    color: var(--retro-amber) !important;
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(184, 115, 51, 0.18) !important;
    box-shadow: none !important;
}

:root.theme-retro .titlebar .ms-titlebar-home:hover,
:root.theme-retro .titlebar .ms-login-round:hover,
:root.theme-retro .titlebar .ms-titlebar-home:focus,
:root.theme-retro .titlebar .ms-login-round:focus,
:root.theme-retro .titlebar .ms-titlebar-home:focus-visible,
:root.theme-retro .titlebar .ms-login-round:focus-visible {
    color: #f5ebe0 !important;
    background: rgba(212, 165, 116, 0.14) !important;
    border-color: rgba(212, 165, 116, 0.3) !important;
    box-shadow: 0 0 14px rgba(212, 165, 116, 0.12) !important;
}

/* Form action buttons (archive-form-action / microsys-form-action) */
:root.theme-retro .archive-form-action,
:root.theme-retro .microsys-form-action,
:root.theme-retro .microsys-filter .microsys-filter-chip,
:root.theme-retro .microsys-filter .microsys-filter-action {
    border-color: rgba(212, 165, 116, 0.16) !important;
    background: linear-gradient(180deg, rgba(30, 24, 20, 0.98), rgba(18, 15, 12, 0.96)) !important;
    color: var(--title) !important;
    box-shadow: none !important;
}
:root.theme-retro .archive-form-action:hover,
:root.theme-retro .archive-form-action:focus-visible,
:root.theme-retro .microsys-form-action:hover,
:root.theme-retro .microsys-form-action:focus-visible,
:root.theme-retro .microsys-filter .microsys-filter-chip:hover,
:root.theme-retro .microsys-filter .microsys-filter-action:hover {
    border-color: rgba(212, 165, 116, 0.32) !important;
    box-shadow: none !important;
}
:root.theme-retro .archive-form-action-icon,
:root.theme-retro .microsys-form-action-icon {
    color: var(--retro-amber) !important;
}
:root.theme-retro .archive-form-action-primary {
    border-color: rgba(139, 110, 75, 0.28) !important;
    background: linear-gradient(180deg, rgba(26, 22, 18, 0.98), rgba(18, 15, 12, 0.96)) !important;
}
:root.theme-retro .archive-form-action-primary .archive-form-action-icon {
    background: rgba(212, 165, 116, 0.14) !important;
    color: #c8e6c9 !important;
}
:root.theme-retro .archive-form-action-secondary .archive-form-action-icon {
    background: rgba(212, 165, 116, 0.12) !important;
    color: var(--retro-amber) !important;
}
:root.theme-retro .archive-form-action-neutral .archive-form-action-icon {
    background: rgba(139, 58, 58, 0.18) !important;
    color: #ffcdd2 !important;
}
:root.theme-retro .microsys-form-action-primary {
    border-color: rgba(139, 110, 75, 0.24) !important;
    background: linear-gradient(180deg, rgba(26, 22, 18, 0.98), rgba(18, 15, 12, 0.96)) !important;
}
:root.theme-retro .microsys-form-action-neutral {
    border-color: rgba(139, 58, 58, 0.2) !important;
    background:
        radial-gradient(circle at top, rgba(139, 58, 58, 0.1), transparent 56%),
        linear-gradient(180deg, rgba(32, 18, 18, 0.98), rgba(20, 13, 13, 0.96)) !important;
}
:root.theme-retro .microsys-filter .btn.microsys-filter-submit {
    color: var(--retro-amber) !important;
    border-color: rgba(212, 165, 116, 0.22) !important;
    background: linear-gradient(180deg, rgba(28, 22, 18, 0.98), rgba(18, 15, 12, 0.96)) !important;
}

/* Archive file upload widget */
:root.theme-retro .archive-file-card {
    border-color: rgba(212, 165, 116, 0.14) !important;
    background: linear-gradient(180deg, rgba(26, 22, 20, 0.98), rgba(15, 13, 12, 0.96)) !important;
    box-shadow: none !important;
}
:root.theme-retro .archive-file-field.is-dragover .archive-file-card,
:root.theme-retro .archive-file-card:hover,
:root.theme-retro .archive-file-card:focus-visible {
    border-color: rgba(212, 165, 116, 0.3) !important;
    box-shadow: none !important;
}
:root.theme-retro .archive-file-tag {
    background: rgba(212, 165, 116, 0.12) !important;
    color: var(--retro-amber) !important;
}
:root.theme-retro .archive-file-tool {
    background: rgba(255, 255, 255, 0.05) !important;
    color: var(--retro-amber) !important;
    box-shadow: none !important;
}
:root.theme-retro .archive-file-tool-upload {
    background: rgba(212, 165, 116, 0.14) !important;
    color: var(--retro-amber) !important;
}
:root.theme-retro .archive-file-tool-scan {
    background: rgba(201, 162, 39, 0.16) !important;
    color: #f0d060 !important;
}
:root.theme-retro .archive-file-tool-clear {
    background: rgba(139, 58, 58, 0.16) !important;
    color: #ffcdd2 !important;
}
:root.theme-retro .archive-file-icon {
    background: rgba(212, 165, 116, 0.12) !important;
    color: var(--retro-amber) !important;
}
:root.theme-retro .archive-file-name {
    color: var(--title) !important;
}
:root.theme-retro .archive-file-meta {
    color: #a09084 !important;
}

/* ms-settings-toggle-field card (bg-light override on dark background) */
:root.theme-retro .ms-settings-toggle-field {
    background-color: rgba(26, 22, 20, 0.92) !important;
    border-color: rgba(212, 165, 116, 0.14) !important;
    color: var(--title) !important;
}

/* Print - Disable effects */
@media print {
    :root.theme-retro * {
        text-shadow: none !important;
        box-shadow: none !important;
    }

    :root.theme-retro body::before,
    :root.theme-retro::before {
        display: none !important;
    }
}
