/* ─── RTL OVERRIDES ─── */

html[dir="rtl"] body {
    padding-left: 0 !important;
    padding-right: var(--sidebar-width);
    overflow-x: hidden;
}

html[dir="rtl"] .shell {
    direction: rtl;
    width: 100%;
}

html[dir="rtl"] .sidebar {
    left: auto !important;
    right: 0 !important;
    border-right: none !important;
    border-left: 1px solid var(--border);
}

html[dir="rtl"] .topbar {
    left: 0 !important;
    right: var(--sidebar-width) !important;
    width: auto !important;
    margin: 0 !important;
    box-sizing: border-box;
}

/* When sidebar is collapsed */
html[dir="rtl"] body.sidebar-collapsed {
    padding-right: var(--sidebar-collapsed-width);
    padding-left: 0;
}

html[dir="rtl"] body.sidebar-collapsed .topbar {
    right: var(--sidebar-collapsed-width) !important;
    left: 0 !important;
    width: auto !important;
}

html[dir="rtl"] body.sidebar-collapsed .sidebar {
    width: var(--sidebar-collapsed-width);
}

/* Main content should not be narrowed a second time */
html[dir="rtl"] .main {
    margin: 0 !important;
    width: auto !important;
    min-width: 0;
    padding: 20px 24px;
    overflow-x: auto;
}

/* Active state border on the correct side */
html[dir="rtl"] .sidebar .nav-item.active,
html[dir="rtl"] .sidebar .nav-dropdown-trigger.active {
    border-left: none !important;
    border-right: 3px solid var(--gold);
}

/* Header content alignment */
html[dir="rtl"] .topbar-left,
html[dir="rtl"] .topbar-actions {
    flex-direction: row-reverse;
}

html[dir="rtl"] .topbar-user {
    align-items: flex-end;
    text-align: right;
}

html[dir="rtl"] .topbar-search input {
    text-align: right;
}

/* ─── DROPDOWN MENU POSITION ─── */
html[dir="rtl"] .admin-dropdown-menu {
    right: auto !important;
    left: 0 !important;
}

html[dir="rtl"] .dropdown-arrow,
html[dir="rtl"] .user-chevron {
    margin-left: 0;
    margin-right: auto;
}

/* ─── RESPONSIVE ADJUSTMENTS ─── */
@media (max-width: 768px) {
    html[dir="rtl"] body {
        padding-right: var(--sidebar-collapsed-width);
        padding-left: 0;
    }

    html[dir="rtl"] .topbar {
        right: var(--sidebar-collapsed-width) !important;
        left: 0 !important;
        width: auto !important;
    }

    html[dir="rtl"] body.sidebar-collapsed {
        padding-right: var(--sidebar-collapsed-width);
        padding-left: 0;
    }

    html[dir="rtl"] body.sidebar-collapsed .topbar {
        right: var(--sidebar-collapsed-width) !important;
        left: 0 !important;
    }

    html[dir="rtl"] .main {
        margin: 0 !important;
        width: auto !important;
    }
}

@media (max-width: 576px) {
    html[dir="rtl"] body {
        padding-right: var(--sidebar-collapsed-width);
        padding-left: 0;
    }

    html[dir="rtl"] .topbar {
        right: var(--sidebar-collapsed-width) !important;
        left: 0 !important;
        width: auto !important;
    }
}

/* ─── SETUP GUIDE ACTIVE (topbar décalé) ─── */
html[dir="rtl"] body.setup-guide-active {
    padding-top: calc(var(--header-height, 70px) + var(--guide-height));
    /* keep right padding as defined above */
}

/* Variables globales */
        :root {
            --gold: #c9a84c;
            --gold2: #e8c97a;
            --gold3: #a0782a;
            --gold-dim: rgba(201, 168, 76, 0.12);
            --border: rgba(201, 168, 76, 0.2);
            --border2: rgba(201, 168, 76, 0.3);
            --bg: #0a0806;
            --bg2: #0e0c09;
            --bg3: #141209;
            --bg4: #1e2228;
            --card: #131109;
            --text: #f0ece3;
            --text2: #b0a08a;
            --text3: #7a6e5f;
            --radius: 12px;
            --radius-sm: 8px;
            --green: #10b981;
            --green-dim: rgba(74, 222, 128, 0.12);
            --red: #f87171;
            --red-dim: rgba(248, 113, 113, 0.12);
            --teal: #2dd4bf;
            --teal-dim: rgba(45, 212, 191, 0.12);
            --amber: #fbbf24;
            --amber-dim: rgba(251, 191, 36, 0.12);
            --blue: #60a5fa;
            --blue-dim: rgba(96, 165, 250, 0.12);
            --purple: #a78bfa;
            --purple-dim: rgba(167, 139, 250, 0.12);
            --font-body: 'Inter', sans-serif;
            --font-mono: 'SF Mono', 'Menlo', monospace;
            --font-arabic: 'Cairo', sans-serif;
            --guide-height: 80px;
        }

        body {
            font-family: var(--font-body);
            background: var(--bg);
            color: var(--text);
            margin: 0;
            padding: 0;
            min-height: 100vh;
            padding-top: calc(var(--app-top-offset) + var(--app-top-gap)) !important;
            transition: padding-top 0.35s ease;
        }

        /* Layout */
        .shell {
            display: flex;
            min-height: 100vh;
        }

        .main {
            flex: 1;
            min-width: 0;
            padding: 20px 24px;
            overflow-x: auto;
        }

        /* Light mode */
        body.light {
            --bg: #f7f4ef;
            --bg2: #edeae3;
            --bg3: #e3dfd6;
            --bg4: #e2e8f0;
            --card: #ffffff;
            --text: #1a1610;
            --text2: #5a5245;
            --text3: #9a8f80;
            --border: rgba(201, 168, 76, 0.2);
            --border2: rgba(0, 0, 0, 0.12);
        }

        .light-bg-overlay {
            position: fixed;
            inset: 0;
            z-index: -1;
            pointer-events: none;
            background: var(--bg);
        }

        /* ═══════ TOP SETUP GUIDE BAR ═══════ */
        .setup-guide-topbar {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            z-index: 10000; /* au‑dessus du header (1001) et de la sidebar (1000) */
            height: var(--guide-height) !important;
            background: rgba(14, 12, 9, 0.92);
            backdrop-filter: blur(8px);
            border-bottom: 1px solid rgba(212, 175, 55, 0.4);
            box-shadow: 0 2px 16px rgba(0, 0, 0, 0.5);
            transform: translateY(-100%);
            transition: transform 0.35s cubic-bezier(.4, 0, .2, 1);
            padding: 6px 20px 7px !important;
            box-sizing: border-box !important;
            overflow: hidden;
        }

        body.light .setup-guide-topbar {
            background: rgba(237, 234, 227, 0.95);
        }

        .setup-guide-topbar.visible {
            transform: translateY(0);
        }

        .setup-guide-container {
            max-width: 1400px;
            margin: 0 auto;
            display: flex;
            flex-direction: column;
            gap: 4px;
            height: 100%;
            justify-content: center;
        }

        .setup-guide-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
        }

        .setup-guide-title {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .setup-guide-title-icon {
            width: 28px;
            height: 28px;
            border-radius: 50%;
            background: var(--gold-dim);
            color: var(--gold2);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 14px;
            flex-shrink: 0;
        }

        .setup-guide-title h3 {
            margin: 0;
            font-size: 13px;
            font-weight: 500;
            color: var(--gold);
            white-space: nowrap;
        }

        .setup-guide-actions {
            display: flex;
            align-items: center;
            gap: 10px;
            flex-shrink: 0;
        }

        .progress-ring-wrap {
            position: relative;
            width: 28px;
            height: 28px;
            flex-shrink: 0;
        }

        .progress-ring-wrap svg {
            transform: rotate(-90deg);
        }

        .progress-ring-bg {
            fill: none;
            stroke: rgba(255, 255, 255, 0.08);
            stroke-width: 2.5;
        }

        .progress-ring-fill {
            fill: none;
            stroke: var(--gold);
            stroke-width: 2.5;
            stroke-linecap: round;
            transition: stroke-dashoffset 0.6s cubic-bezier(.4, 0, .2, 1);
        }

        .progress-ring-label {
            position: absolute;
            inset: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 8px;
            font-weight: 600;
            color: var(--gold);
            pointer-events: none;
        }

        .setup-guide-btn {
            padding: 4px 12px;
            border-radius: 6px;
            font-size: 12px;
            cursor: pointer;
            transition: all 0.2s;
            font-weight: 500;
            border: none;
        }

        .setup-guide-btn-primary {
            background: var(--gold);
            color: #1a1a2e;
        }
        .setup-guide-btn-primary:hover {
            background: #c4a030;
            transform: translateY(-1px);
        }

        .setup-guide-btn-secondary {
            background: transparent;
            border: 1px solid var(--border);
            color: var(--text2);
        }
        .setup-guide-btn-secondary:hover {
            background: rgba(255, 255, 255, 0.05);
        }

        .setup-guide-btn-danger {
            background: transparent;
            border: 1px solid #dc2626;
            color: #dc2626;
        }
        .setup-guide-btn-danger:hover {
            background: rgba(220, 38, 38, 0.1);
        }

        .setup-guide-progress {
            margin-top: 0;
        }

        .progress-steps {
            display: flex;
            gap: 5px;
            min-height: 30px;
            flex-wrap: nowrap;
            overflow-x: auto;
        }

        .progress-step {
            flex: 1;
            min-width: 60px;
            padding: 0 8px;
            height: 30px;
            background: rgba(255, 255, 255, 0.04);
            border: 1px solid rgba(255, 255, 255, 0.08);
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.2s;
            position: relative;
            overflow: hidden;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 4px;
        }

        .progress-step::before {
            content: '';
            position: absolute;
            bottom: 0; left: 0; right: 0;
            height: 2px;
            background: var(--gold);
            transform: scaleX(0);
            transform-origin: left;
            transition: transform 0.35s cubic-bezier(.4, 0, .2, 1);
            border-radius: 0 0 2px 2px;
        }

        .progress-step.completed::before {
            transform: scaleX(1);
        }
        .progress-step.active::before {
            transform: scaleX(0.5);
            background: linear-gradient(90deg, var(--gold), rgba(212, 175, 55, 0.3));
        }

        .progress-step.completed {
            background: rgba(212, 175, 55, 0.08);
            border-color: rgba(212, 175, 55, 0.25);
        }
        .progress-step.active {
            background: rgba(212, 175, 55, 0.15);
            border-color: rgba(212, 175, 55, 0.5);
        }

        .progress-step:hover:not(.disabled) {
            border-color: rgba(212, 175, 55, 0.4);
            transform: translateY(-1px);
            box-shadow: 0 3px 8px rgba(212, 175, 55, 0.1);
        }
        .progress-step.disabled {
            opacity: 0.4;
            cursor: not-allowed;
        }

        .step-icon-wrap {
            position: relative;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 18px;
            height: 18px;
            flex-shrink: 0;
        }
        .step-icon {
            font-size: 14px;
            line-height: 1;
        }
        .step-check-badge {
            position: absolute;
            inset: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            background: rgba(212, 175, 55, 0.9);
            border-radius: 50%;
            font-size: 9px;
            color: #1a1a2e;
            opacity: 0;
            transform: scale(0.5);
            transition: opacity 0.25s ease, transform 0.25s cubic-bezier(.34, 1.56, .64, 1);
            pointer-events: none;
        }
        .progress-step.completed .step-check-badge {
            opacity: 1;
            transform: scale(1);
        }

        .step-name {
            font-size: 11px;
            font-weight: 500;
            color: var(--text2);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            max-width: 80px;
        }
        .progress-step.active .step-name { color: var(--gold); }
        .progress-step.completed .step-name { color: rgba(212, 175, 55, 0.75); }

        /* ── Body quand le guide est visible ── */
        body.setup-guide-active {
            padding-top: calc(var(--header-height, 70px) + var(--guide-height));
            --app-top-offset: calc(var(--header-height) + var(--guide-height));
           --app-top-gap: 8px;
        }

        /* ── Header décalé vers le bas quand le guide est visible ── */
       body.setup-guide-active .topbar {
    top: var(--guide-height) !important;
}

        /* ── Sidebar décalée vers le bas quand le guide est visible ── */
     body.setup-guide-active .sidebar {
    top: var(--guide-height) !important;
    height: calc(100% - var(--guide-height)) !important;
}

        /* ===== HEADER (topbar) ===== */
        :root {
            --header-height: 70px;
            --sidebar-width: 260px;
            --sidebar-collapsed-width: 72px;
            --guide-height: 80px;
            --app-top-offset: var(--header-height);
            --app-top-gap: 0px;
        }

        .topbar {
            background: var(--bg2);
            border-bottom: 1px solid var(--border);
            padding: 12px 24px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 12px;
            position: fixed;
            top: 0;
            left: var(--sidebar-width);
            right: 0;
            z-index: 1001;
            min-width: 0;
            flex-wrap: nowrap;
            overflow: hidden;
            height: var(--header-height);
            box-sizing: border-box;
            transition: top 0.35s ease, left 0.3s ease;
        }

        body.sidebar-collapsed .topbar {
            left: var(--sidebar-collapsed-width);
        }

        /* Responsive : ajuster la hauteur du header et le padding */
        @media (max-width: 768px) {
            :root {
                --header-height: 64px;
                --sidebar-collapsed-width: 64px;
               --guide-height: 70px;
            }
            .topbar {
                padding: 8px 12px;
            }
              body {
        padding-top: calc(var(--app-top-offset) + var(--app-top-gap)) !important;
    }

    body.setup-guide-active {
        --app-top-offset: calc(var(--header-height) + var(--guide-height));
        --app-top-gap: 8px;
    }
        }

        @media (max-width: 576px) {
            :root {
                --header-height: 60px;
                --sidebar-collapsed-width: 56px;
                --guide-height: 60px;
            }
            .topbar {
                padding: 7px 10px;
            }
                body {
        padding-top: calc(var(--app-top-offset) + var(--app-top-gap)) !important;
    }

    body.setup-guide-active {
        --app-top-offset: calc(var(--header-height) + var(--guide-height));
        --app-top-gap: 8px;
    }
        }

        /* (Le reste des styles du header est inchangé) */
        .topbar-left {
            display: flex;
            align-items: center;
            gap: 12px;
            min-width: 0;
            flex: 1 1 auto;
            overflow: hidden;
            flex-wrap: nowrap;
        }

        .topbar-user-wrap {
            min-width: 0;
            max-width: 100%;
            overflow: hidden;
            flex: 0 1 auto;
        }

        .topbar-user {
            display: flex;
            flex-direction: column;
            align-items: flex-start;
            gap: 2px;
            min-width: 0;
            max-width: 100%;
            overflow: hidden;
            line-height: 1.1;
        }

        .topbar-username {
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            max-width: 100%;
            font-size: 14px;
        }

        .topbar-role-badge {
            font-size: 12px;
            padding: 2px 8px;
            background: var(--blue-dim);
            color: var(--blue);
            border-radius: 9999px;
            white-space: nowrap;
            max-width: 100%;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .topbar-muted {
            font-size: 12px;
            color: var(--text3);
            white-space: nowrap;
            max-width: 100%;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .topbar-muted-pill {
            padding: 2px 8px;
            background: var(--text3);
            color: var(--text);
            border-radius: 9999px;
        }

        .topbar-actions {
            display: flex;
            align-items: center;
            gap: 12px;
            min-width: 0;
            flex-wrap: nowrap;
            justify-content: flex-end;
            overflow-x: auto;
            overflow-y: hidden;
            scrollbar-width: none;
            -ms-overflow-style: none;
            flex: 0 1 auto;
            max-width: 100%;
        }

        .topbar-actions::-webkit-scrollbar {
            display: none;
        }

        .topbar-search {
            display: flex;
            align-items: center;
            background: var(--bg3);
            border: 1px solid var(--border);
            border-radius: 8px;
            padding: 6px 12px;
            gap: 8px;
            min-width: 0;
            flex: 0 0 auto;
        }

        .topbar-search input {
            background: transparent;
            border: none;
            color: var(--text);
            font-size: 13px;
            width: 220px;
            min-width: 0;
        }

        .topbar-search input:focus {
            outline: none;
        }

        .topbar-search-icon {
            color: var(--text3);
            flex-shrink: 0;
        }

        .icon-btn {
            background: var(--bg3);
            border: 1px solid var(--border);
            border-radius: 8px;
            padding: 8px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--text2);
            transition: all 0.2s;
            position: relative;
            flex-shrink: 0;
            width: 38px;
            height: 38px;
        }

        .icon-btn:hover {
            background: var(--bg4);
            color: var(--text);
        }

        .sidebar-toggle-btn {
            display: none;
        }

        .notif-dot {
            position: absolute;
            top: 4px;
            right: 4px;
            width: 8px;
            height: 8px;
            background: var(--red);
            border-radius: 50%;
        }

        .lang-switcher {
            display: flex;
            gap: 4px;
            background: var(--bg3);
            padding: 4px;
            border-radius: 8px;
            flex-shrink: 0;
            flex: 0 0 auto;
        }

        .lang-form {
            display: flex;
            gap: 4px;
            margin: 0;
            padding: 0;
        }

        .lang-btn-fr,
        .lang-btn-ar {
            padding: 6px 14px;
            border: none;
            border-radius: 6px;
            font-size: 12px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
            background: transparent;
            color: var(--text2);
            display: flex;
            align-items: center;
            gap: 6px;
            white-space: nowrap;
            flex-shrink: 0;
        }

        .lang-btn-fr i,
        .lang-btn-ar i {
            font-size: 12px;
        }

        .lang-btn-fr.active,
        .lang-btn-ar.active {
            background: var(--gold);
            color: #111;
        }

        .lang-btn-fr:hover,
        .lang-btn-ar:hover {
            background: var(--bg4);
            color: var(--text);
        }

        .theme-icon {
            width: 18px;
            height: 18px;
            transition: all 0.3s ease;
            flex-shrink: 0;
        }

        .theme-dark-icon { display: block; }
        .theme-light-icon { display: none; }
        body.light .theme-dark-icon { display: none; }
        body.light .theme-light-icon { display: block; }

        body.light .mode-toggle,
        body.dark .mode-toggle {
            background: var(--bg3);
            border-color: var(--border);
            color: var(--text);
        }
        body.light .mode-toggle:hover,
        body.dark .mode-toggle:hover {
            background: var(--bg4);
            color: var(--gold);
        }

        [dir="rtl"] .topbar-search input {
            text-align: right;
        }
        [dir="rtl"] .admin-dropdown-menu {
            right: auto;
            left: 0;
        }
        [dir="rtl"] .topbar-left {
            flex-direction: row-reverse;
        }
        [dir="rtl"] .topbar-actions {
            flex-direction: row-reverse;
        }

        .admin-dropdown {
            position: relative;
            flex-shrink: 0;
        }

        .avatar-btn {
            background: none;
            border: none;
            cursor: pointer;
            padding: 0;
            flex-shrink: 0;
        }

        .avatar {
            width: 36px;
            height: 36px;
            background: var(--gold-dim);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 700;
            color: var(--gold);
            font-size: 14px;
        }

        .admin-dropdown-menu {
            position: absolute;
            top: 100%;
            right: 0;
            margin-top: 8px;
            background: var(--bg2);
            border: 1px solid var(--border);
            border-radius: 12px;
            width: 260px;
            box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
            display: none;
            z-index: 100;
            overflow: hidden;
        }

        .admin-dropdown-menu.open {
            display: block;
            animation: fadeIn 0.2s ease;
        }

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

        .dropdown-header {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 16px;
        }

        .dropdown-avatar {
            width: 40px;
            height: 40px;
            background: var(--gold-dim);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 700;
            color: var(--gold);
        }

        .dropdown-info {
            flex: 1;
            min-width: 0;
        }

        .dropdown-name {
            font-size: 14px;
            font-weight: 600;
            color: var(--text);
        }

        .dropdown-role {
            font-size: 11px;
            color: var(--text3);
        }

        .dropdown-divider {
            height: 1px;
            background: var(--border);
            margin: 4px 0;
        }

        .dropdown-item {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 10px 16px;
            color: var(--text2);
            text-decoration: none;
            font-size: 13px;
            transition: all 0.2s;
            cursor: pointer;
        }

        .dropdown-item:hover {
            background: var(--bg3);
            color: var(--text);
        }

        .dropdown-item.logout {
            color: var(--red);
        }
        .dropdown-item.logout:hover {
            background: var(--red-dim);
            color: var(--red);
        }

        #logout-form .dropdown-item {
            width: 100%;
            text-align: left;
            background: none;
            border: none;
            font-family: inherit;
            font-size: 13px;
            cursor: pointer;
        }

        /* Modal */
        .modal {
            display: none;
            position: fixed;
            top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(0, 0, 0, 0.6);
            z-index: 1000;
            align-items: center;
            justify-content: center;
        }
        .modal.show { display: flex; }
        .modal-content {
            background: var(--bg2);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            width: 90%;
            max-width: 600px;
            max-height: 90vh;
            overflow-y: auto;
            animation: slideUp 0.3s ease;
        }
        @keyframes slideUp {
            from { transform: translateY(20px); opacity: 0; }
            to { transform: translateY(0); opacity: 1; }
        }
        .modal-header {
            padding: 20px;
            border-bottom: 1px solid var(--border);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        .modal-title { font-size: 15px; font-weight: 700; color: var(--text); }
        .modal-close {
            background: none;
            border: none;
            font-size: 20px;
            color: var(--text3);
            cursor: pointer;
        }
        .modal-body { padding: 20px; }
        .modal-footer {
            padding: 16px 20px;
            border-top: 1px solid var(--border);
            display: flex;
            gap: 10px;
            justify-content: flex-end;
        }
        .form-group {
            margin-bottom: 16px;
        }
        .form-label {
            display: block;
            font-size: 12.5px;
            font-weight: 600;
            color: var(--text);
            margin-bottom: 6px;
        }
        .form-input,
        .form-select,
        .form-textarea {
            width: 100%;
            padding: 10px 12px;
            background: var(--bg3);
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            color: var(--text);
            font-family: var(--font-body);
            font-size: 13px;
            box-sizing: border-box;
        }
        .form-input:focus,
        .form-select:focus,
        .form-textarea:focus {
            outline: none;
            border-color: var(--gold);
            box-shadow: 0 0 0 3px var(--gold-dim);
        }
        .form-textarea { resize: vertical; min-height: 100px; }
        .toast {
            position: fixed;
            bottom: 20px;
            right: 20px;
            background: var(--green);
            color: white;
            padding: 14px 20px;
            border-radius: var(--radius-sm);
            font-size: 13px;
            z-index: 2000;
            animation: slideInRight 0.3s ease;
        }
        @keyframes slideInRight {
            from { transform: translateX(400px); opacity: 0; }
            to { transform: translateX(0); opacity: 1; }
        }

        /* Scrollbar */
        ::-webkit-scrollbar {
            width: 6px;
            height: 6px;
        }
        ::-webkit-scrollbar-track {
            background: var(--bg3);
        }
        ::-webkit-scrollbar-thumb {
            background: var(--gold3);
            border-radius: 3px;
        }

        /* Responsive topbar et guide */
        @media (max-width: 768px) {
            :root {
                --guide-height: 70px;
            }
            .topbar {
                left: var(--sidebar-collapsed-width);
            }
            .sidebar-toggle-btn {
                display: inline-flex;
            }
            .topbar-search {
                display: none;
            }
        }

        @media (max-width: 576px) {
            :root {
                --guide-height: 60px;
            }
            .topbar {
                left: var(--sidebar-collapsed-width);
            }
            .step-name { display: none; }
            .progress-step { min-width: 36px; padding: 0 6px; }
        }

        /* Fix extra left gap on large screens */
        @media (min-width: 993px) {
            .main,
            .shell .main {
                margin-left: 0 !important;
                padding-left: 0 !important;
            }
        }