/* =============================================================
   AMSTOCK — SIDEBAR PREMIUM
   Rail gauche, expandable au hover ou pinned, dropdowns flyout.
   ============================================================= */

:root {
    --sidebar-w-collapsed: 68px;
    --sidebar-w-expanded: 240px;
    --sidebar-bg: linear-gradient(180deg, #0f1226 0%, #141838 55%, #181c3f 100%);
    --sidebar-border: rgba(255, 255, 255, 0.06);
    --sidebar-item-color: rgba(255, 255, 255, 0.66);
    --sidebar-item-hover: rgba(255, 255, 255, 0.10);
    --sidebar-item-active: rgba(255, 255, 255, 0.14);
}

/* Cache l'ancien header AMSTOCK quand la sidebar premium est utilisée */
.has-premium-sidebar .page-header-section,
.has-premium-sidebar .app-header { display: none !important; }

/* Décalage du contenu */
.has-premium-sidebar body { padding-left: var(--sidebar-w-collapsed); transition: padding-left 240ms var(--easing-out); }
.has-premium-sidebar.sidebar-pinned body { padding-left: var(--sidebar-w-expanded); }

/* Sidebar */
.app-sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: var(--sidebar-w-collapsed);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    overflow: visible;
    transition: width 240ms var(--easing-out);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.02) inset, 8px 0 28px -18px rgba(15, 23, 42, 0.55);
}
.app-sidebar:hover,
.sidebar-pinned .app-sidebar { width: var(--sidebar-w-expanded); }

.app-sidebar .sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 14px 14px;
    min-height: 62px;
    border-bottom: 1px solid var(--sidebar-border);
    gap: 10px;
}
.app-sidebar .sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    font-weight: 700;
    letter-spacing: -0.02em;
    font-size: 1em;
    white-space: nowrap;
    overflow: hidden;
}
.app-sidebar .sidebar-logo i {
    background: linear-gradient(135deg, #a5b4fc, #c4b5fd);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 1.3em;
    min-width: 26px;
    text-align: center;
    filter: drop-shadow(0 2px 6px rgba(165, 180, 252, 0.35));
}
.app-sidebar .sidebar-logo .sidebar-label {
    opacity: 0;
    transform: translateX(-6px);
    transition: opacity 180ms var(--easing-out) 60ms, transform 180ms var(--easing-out) 60ms;
}
.app-sidebar:hover .sidebar-label,
.sidebar-pinned .sidebar-label { opacity: 1; transform: translateX(0); }

.app-sidebar .sidebar-pin {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.10);
    color: rgba(255, 255, 255, 0.70);
    width: 30px; height: 30px;
    border-radius: 8px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all var(--t-fast);
    font-size: 0.8em;
}
.app-sidebar:hover .sidebar-pin,
.sidebar-pinned .sidebar-pin { display: inline-flex; }
.app-sidebar .sidebar-pin:hover { background: rgba(255, 255, 255, 0.14); color: #fff; }
.sidebar-pinned .sidebar-pin { color: #a5b4fc; border-color: rgba(165, 180, 252, 0.4); background: rgba(165, 180, 252, 0.12); }

.sidebar-search-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 12px 12px 8px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.60);
    cursor: pointer;
    font-size: 0.85em;
    font-family: inherit;
    text-align: left;
    transition: all var(--t-fast);
    min-height: 40px;
    overflow: hidden;
}
.sidebar-search-btn:hover {
    background: rgba(255, 255, 255, 0.10);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.16);
}
.sidebar-search-btn i { min-width: 18px; text-align: center; color: rgba(255, 255, 255, 0.50); }
.sidebar-search-btn .sidebar-search-label { flex: 1; opacity: 0; transition: opacity 180ms var(--easing-out) 60ms; white-space: nowrap; }
.app-sidebar:hover .sidebar-search-label,
.sidebar-pinned .sidebar-search-label { opacity: 1; }
.sidebar-search-btn kbd {
    font-size: 0.72em;
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.70);
    padding: 2px 6px;
    border-radius: 5px;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    opacity: 0;
    transition: opacity 180ms var(--easing-out) 60ms;
}
.app-sidebar:hover .sidebar-search-btn kbd,
.sidebar-pinned .sidebar-search-btn kbd { opacity: 1; }

.sidebar-nav {
    flex: 1;
    overflow: visible;
    padding: 8px 8px 16px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-height: 0;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 14px;
    color: var(--sidebar-item-color);
    border-radius: 10px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.88em;
    font-family: inherit;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: background var(--t-fast), color var(--t-fast);
    white-space: nowrap;
    overflow: hidden;
    position: relative;
    width: 100%;
}
.sidebar-item .sidebar-chevron {
    margin-left: auto;
    font-size: 0.75em;
    opacity: 0;
    transition: opacity 180ms var(--easing-out) 60ms;
    color: rgba(255, 255, 255, 0.40);
}
.app-sidebar:hover .sidebar-chevron,
.sidebar-pinned .sidebar-chevron { opacity: 1; }
.sidebar-item > i:first-child {
    min-width: 22px;
    text-align: center;
    font-size: 1em;
    color: rgba(255, 255, 255, 0.80);
}
.sidebar-item .sidebar-label {
    opacity: 0;
    transition: opacity 180ms var(--easing-out) 60ms;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}
.app-sidebar:hover .sidebar-item .sidebar-label,
.sidebar-pinned .sidebar-item .sidebar-label { opacity: 1; }

.sidebar-item:hover { background: var(--sidebar-item-hover); color: #fff; }
.sidebar-item.active,
.nav-dropdown.active .sidebar-item {
    background: var(--sidebar-item-active);
    color: #fff;
}
.sidebar-item.active::before,
.nav-dropdown.active > .sidebar-item::before {
    content: "";
    position: absolute;
    left: 0; top: 8px; bottom: 8px;
    width: 3px;
    background: linear-gradient(180deg, var(--brand-400), var(--accent-500));
    border-radius: 0 3px 3px 0;
}

/* Dropdowns flyout (Configuration sub-items) */
.app-sidebar .nav-dropdown { position: relative; display: block; }
.app-sidebar .nav-dropdown-menu {
    position: absolute;
    top: 0;
    left: 100%;
    margin-left: 6px;
    min-width: 230px;
    background: var(--surface-card);
    color: var(--text-base);
    border: 1px solid var(--border-base);
    border-radius: 12px;
    box-shadow: var(--shadow-xl), 0 0 0 1px rgba(15, 23, 42, 0.04);
    padding: 6px;
    display: none;
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity 160ms var(--easing-out), transform 160ms var(--easing-out);
    z-index: 1100;
}
.app-sidebar .nav-dropdown-menu::before {
    content: "";
    position: absolute;
    left: -10px; top: 0;
    width: 10px; height: 100%;
}
.app-sidebar .nav-dropdown:hover > .nav-dropdown-menu,
.app-sidebar .nav-dropdown.open > .nav-dropdown-menu {
    display: block; opacity: 1; transform: translateX(0);
}
.app-sidebar .nav-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    color: var(--text-base);
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.88em;
    font-weight: 500;
    transition: background var(--t-fast), color var(--t-fast), transform var(--t-fast);
}
.app-sidebar .nav-dropdown-item:hover {
    background: var(--brand-50);
    color: var(--brand-700);
    transform: translateX(2px);
}
.app-sidebar .nav-dropdown-item i {
    color: var(--brand-500);
    min-width: 18px;
    text-align: center;
}

/* Section title (groupement dans le menu déroulant) */
.app-sidebar .nav-dropdown-section {
    padding: 8px 12px 4px;
    font-size: 0.65em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.10em;
    color: var(--text-faint);
    user-select: none;
}
.app-sidebar .nav-dropdown-sep {
    height: 1px;
    background: var(--border-soft);
    margin: 6px 8px;
}

/* Item courant (page active) */
.app-sidebar .nav-dropdown-item.is-current {
    background: var(--brand-50);
    color: var(--brand-700);
    font-weight: 700;
}
.app-sidebar .nav-dropdown-item.is-current::before {
    content: "";
    position: absolute;
    left: 4px; top: 50%;
    transform: translateY(-50%);
    width: 3px; height: 14px;
    background: linear-gradient(180deg, var(--brand-500), var(--accent-500));
    border-radius: 2px;
}
.app-sidebar .nav-dropdown-item { position: relative; }

/* Item désactivé (placeholder) */
.app-sidebar .nav-dropdown-item.is-disabled {
    color: var(--text-faint);
    cursor: not-allowed;
    opacity: 0.7;
}
.app-sidebar .nav-dropdown-item.is-disabled:hover {
    background: var(--surface-soft);
    color: var(--text-faint);
    transform: none;
}
.app-sidebar .nav-dropdown-item.is-disabled i { color: var(--text-faint); }

.app-sidebar .nav-dropdown-soon {
    margin-left: auto;
    background: linear-gradient(135deg, #cbd5e1, #94a3b8);
    color: #fff;
    font-size: 0.62em;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* Dark mode adjustments */
[data-theme="dark"] .app-sidebar .nav-dropdown-section { color: rgba(255, 255, 255, 0.42); }
[data-theme="dark"] .app-sidebar .nav-dropdown-sep { background: rgba(255, 255, 255, 0.08); }
[data-theme="dark"] .app-sidebar .nav-dropdown-item.is-current {
    background: rgba(165, 180, 252, 0.18);
    color: #c7d2fe;
}
[data-theme="dark"] .app-sidebar .nav-dropdown-item.is-disabled { color: rgba(255, 255, 255, 0.28); }
[data-theme="dark"] .app-sidebar .nav-dropdown-item.is-disabled:hover { background: rgba(255, 255, 255, 0.04); color: rgba(255, 255, 255, 0.28); }
[data-theme="dark"] .app-sidebar .nav-dropdown-item.is-disabled i { color: rgba(255, 255, 255, 0.28); }
[data-theme="dark"] .app-sidebar .nav-dropdown-soon {
    background: linear-gradient(135deg, #475569, #334155);
    color: #cbd5e1;
}

[data-theme="dark"] .app-sidebar .nav-dropdown-menu {
    background: #2a335a;
    border-color: rgba(165, 180, 252, 0.40);
    box-shadow: 0 24px 48px -10px rgba(0, 0, 0, 0.80);
    color: var(--text-base);
}
[data-theme="dark"] .app-sidebar .nav-dropdown-item { color: rgba(226, 232, 240, 0.9); }
[data-theme="dark"] .app-sidebar .nav-dropdown-item i { color: #a5b4fc; }
[data-theme="dark"] .app-sidebar .nav-dropdown-item:hover {
    background: rgba(165, 180, 252, 0.12);
    color: #c7d2fe;
}

/* Footer */
.sidebar-footer {
    margin-top: auto;
    padding: 10px 10px 14px;
    border-top: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.sidebar-footer form { width: 100%; }
.sidebar-footer form button { width: 100%; }

/* Admin badge dans la sidebar */
.app-sidebar .admin-badge {
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: #fff;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.72em;
    font-weight: 700;
    letter-spacing: 0.02em;
    margin-left: auto;
    opacity: 0;
    transition: opacity 180ms;
}
.app-sidebar:hover .admin-badge,
.sidebar-pinned .admin-badge { opacity: 1; }

/* ============= COMMAND PALETTE ============= */
.cmd-palette {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 14vh;
}
.cmd-palette.open { display: flex; animation: cmdIn 180ms var(--easing-out); }
@keyframes cmdIn { from { opacity: 0; } to { opacity: 1; } }

.cmd-backdrop {
    position: absolute; inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(10px) saturate(140%);
    -webkit-backdrop-filter: blur(10px) saturate(140%);
}
.cmd-box {
    position: relative;
    width: min(640px, calc(100vw - 32px));
    max-height: 70vh;
    background: var(--surface-card);
    border-radius: 16px;
    box-shadow: var(--shadow-2xl);
    border: 1px solid var(--border-soft);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: cmdRise 220ms var(--easing-out);
}
@keyframes cmdRise { from { transform: translateY(-8px) scale(0.98); opacity: 0; } to { transform: translateY(0) scale(1); opacity: 1; } }

.cmd-search-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-soft);
    background: linear-gradient(180deg, var(--surface-card), var(--surface-soft));
}
.cmd-search-icon { color: var(--text-faint); }
.cmd-input {
    flex: 1; border: none; background: transparent; outline: none;
    font-size: 1.05em; color: var(--text-strong); font-family: inherit;
}
.cmd-input::placeholder { color: var(--text-faint); }
.cmd-kbd {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.72em;
    background: var(--surface-soft);
    border: 1px solid var(--border-base);
    color: var(--text-soft);
    padding: 3px 7px;
    border-radius: 5px;
}

.cmd-results { flex: 1; overflow-y: auto; padding: 6px; }
.cmd-group-title {
    padding: 10px 12px 6px;
    font-size: 0.68em;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 700;
    color: var(--text-faint);
}
.cmd-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    width: 100%;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-base);
    text-align: left;
    font-family: inherit;
    font-size: 0.92em;
    transition: background var(--t-fast), transform var(--t-fast);
}
.cmd-item.active { background: var(--brand-50); color: var(--brand-700); transform: translateX(2px); }
.cmd-item-icon {
    width: 32px; height: 32px;
    background: var(--surface-soft);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: var(--brand-500);
    font-size: 0.9em;
    flex-shrink: 0;
}
.cmd-item.active .cmd-item-icon { background: var(--brand-100); color: var(--brand-700); }
.cmd-item-body { flex: 1; min-width: 0; }
.cmd-item-title { font-weight: 600; color: var(--text-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmd-item.active .cmd-item-title { color: var(--brand-800); }
.cmd-item-sub { font-size: 0.78em; color: var(--text-soft); margin-top: 1px; }
.cmd-item-arrow { color: var(--text-faint); font-size: 0.8em; opacity: 0; transition: opacity var(--t-fast); }
.cmd-item.active .cmd-item-arrow { opacity: 1; color: var(--brand-500); }
.cmd-empty { padding: 40px 20px; text-align: center; color: var(--text-soft); }
.cmd-empty i { font-size: 2em; opacity: 0.35; margin-bottom: 10px; display: block; color: var(--brand-400); }
.cmd-footer {
    padding: 10px 16px;
    border-top: 1px solid var(--border-soft);
    background: var(--surface-soft);
    display: flex;
    gap: 18px;
    font-size: 0.75em;
    color: var(--text-soft);
}
.cmd-footer kbd {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    background: var(--surface-card);
    border: 1px solid var(--border-base);
    padding: 1px 6px;
    border-radius: 4px;
    margin-right: 4px;
    font-size: 0.92em;
}

/* ============= BREADCRUMBS ============= */
.am-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 24px 10px;
    font-size: 0.82em;
    color: var(--text-soft);
    flex-wrap: wrap;
    margin: 0;
}
.am-breadcrumb {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.am-breadcrumb a {
    color: var(--text-soft);
    text-decoration: none;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 6px;
    transition: all 120ms;
}
.am-breadcrumb a:hover {
    background: var(--brand-50);
    color: var(--brand-700);
}
.am-breadcrumb.is-current {
    color: var(--text-strong);
    font-weight: 600;
}
.am-breadcrumb-sep {
    color: var(--text-faint);
    font-size: 0.9em;
}
[data-theme="dark"] .am-breadcrumb a:hover {
    background: rgba(129, 140, 248, 0.12);
    color: #c7d2fe;
}

/* Avatars (utilisés par premium-features.js) */
.user-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--avatar-size, 28px);
    height: var(--avatar-size, 28px);
    border-radius: 50%;
    background: var(--avatar-bg, linear-gradient(135deg, #667eea, #8b5cf6));
    color: #fff;
    font-weight: 700;
    font-size: calc(var(--avatar-size, 28px) * 0.42);
    letter-spacing: -0.02em;
    text-transform: uppercase;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.12);
    position: relative;
    overflow: hidden;
    line-height: 1;
    vertical-align: middle;
    user-select: none;
}
.user-avatar::after {
    content: "";
    position: absolute; inset: 0;
    background: radial-gradient(circle at 25% 20%, rgba(255,255,255,0.30), transparent 55%);
    pointer-events: none;
}
.user-avatar.sm { --avatar-size: 22px; }
.user-avatar.lg { --avatar-size: 36px; }
.user-avatar.xl { --avatar-size: 48px; }

/* Hover preview */
.am-preview {
    position: fixed;
    z-index: 3500;
    pointer-events: none;
    opacity: 0;
    transform: translateY(4px) scale(0.98);
    transition: opacity 160ms var(--easing-out), transform 160ms var(--easing-out);
    min-width: 280px;
    max-width: 340px;
    background: var(--surface-card);
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    box-shadow: var(--shadow-xl);
    padding: 0;
    overflow: hidden;
}
.am-preview.open { opacity: 1; transform: translateY(0) scale(1); }
.am-preview-head {
    padding: 12px 14px 10px;
    background: linear-gradient(180deg, var(--surface-card), var(--surface-soft));
    border-bottom: 1px solid var(--border-soft);
}
.am-preview-title {
    font-weight: 700; font-size: 1em; color: var(--text-strong);
    letter-spacing: -0.01em; margin-bottom: 4px;
}
.am-preview-sub { font-size: 0.76em; color: var(--text-soft); }
.am-preview-body { padding: 12px 14px; font-size: 0.82em; color: var(--text-base); }

/* Donut */
.donut-ring {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    vertical-align: middle;
}
.donut-ring .donut-svg { display: block; overflow: visible; }
.donut-ring .donut-bg { stroke: var(--border-soft); }
.donut-ring .donut-fg { transition: stroke-dashoffset 900ms var(--easing-out); filter: drop-shadow(0 0 6px rgba(102, 126, 234, 0.35)); }
.donut-ring .donut-label {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; letter-spacing: -0.02em;
    color: var(--text-strong);
    font-variant-numeric: tabular-nums;
    font-size: 1.05em;
}
.donut-ring .donut-label span {
    font-size: 0.55em; color: var(--text-soft); margin-left: 1px; font-weight: 600;
}

/* Density toggle */
[data-density="compact"] body { font-size: 14.5px; }
[data-density="compact"] .ag-theme-alpine { --ag-grid-size: 5px; --ag-list-item-height: 26px; --ag-font-size: 12.5px; --ag-cell-horizontal-padding: 10px; }
[data-density="comfortable"] body { font-size: 16.5px; }
[data-density="comfortable"] .ag-theme-alpine { --ag-grid-size: 7px; --ag-list-item-height: 34px; --ag-font-size: 14px; }

/* ============= EASTER EGG : items secrets de Configuration ============= */
.app-sidebar .nav-dropdown-item.is-secret,
.app-sidebar .nav-dropdown-section.is-secret,
.app-sidebar .nav-dropdown-sep.is-secret { display: none !important; }

.app-sidebar.config-revealed .nav-dropdown-item.is-secret,
.app-sidebar.config-revealed .nav-dropdown-section.is-secret,
.app-sidebar.config-revealed .nav-dropdown-sep.is-secret {
    display: flex !important;
    animation: secretReveal 380ms var(--easing-out) both;
}
.app-sidebar.config-revealed .nav-dropdown-sep.is-secret { display: block !important; }
@keyframes secretReveal {
    from { opacity: 0; transform: translateX(-6px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* Petit accent pour indiquer la zone "avancée" */
.app-sidebar.config-revealed .nav-dropdown-section.is-secret {
    color: var(--brand-700);
    background: var(--brand-50);
    margin: 4px 6px;
    padding: 6px 8px;
    border-radius: 6px;
    align-items: center;
    gap: 6px;
}

/* ============= IMPERSONATION BANNER ============= */
.impersonation-banner {
    position: fixed;
    top: 0;
    left: var(--sidebar-w-collapsed);
    right: 0;
    z-index: 950;
    background: linear-gradient(135deg, #d97706, #b45309);
    color: #fff;
    box-shadow: 0 6px 18px -6px rgba(180, 83, 9, 0.55);
    transition: left 240ms var(--easing-out);
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}
.sidebar-pinned .impersonation-banner { left: var(--sidebar-w-expanded); }

.impersonation-banner-inner {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 22px;
    flex-wrap: wrap;
    font-size: 0.92em;
    font-weight: 500;
}
.impersonation-banner-inner > i {
    font-size: 1.1em;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.28);
    width: 32px; height: 32px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.impersonation-banner-inner strong { font-weight: 700; }

.impersonation-stop-btn {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 16px;
    background: rgba(255, 255, 255, 0.95);
    color: #92400e;
    border: 1px solid rgba(255, 255, 255, 1);
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.88em;
    text-decoration: none;
    box-shadow: 0 4px 12px -3px rgba(0, 0, 0, 0.2);
    transition: all 140ms var(--easing-out);
}
.impersonation-stop-btn:hover {
    background: #fff;
    color: #b45309;
    transform: translateY(-1px);
    box-shadow: 0 8px 18px -4px rgba(0, 0, 0, 0.30);
}

/* Hauteur banner (utilisée pour le décalage du contenu) */
:root { --imperson-banner-h: 76px; }

/* Décale le contenu sous la bannière */
.is-impersonating body { padding-top: var(--imperson-banner-h); }

/* CRUCIAL : les pages avec .page-container { height: 100vh } overflow sinon */
.is-impersonating .page-container { height: calc(100vh - var(--imperson-banner-h)) !important; }
.is-impersonating .hub-content { max-height: calc(100vh - var(--imperson-banner-h)); }
.is-impersonating .main-container { padding-top: 0 !important; }
.is-impersonating.has-citation .main-container { padding-top: 80px !important; }

/* Pages standalone qui forcent html, body height: 100% */
.is-impersonating html, .is-impersonating body { height: auto !important; min-height: 100vh; }

/* Responsive */
@media (max-width: 768px) {
    .has-premium-sidebar body { padding-left: 0; }
    .app-sidebar {
        width: var(--sidebar-w-expanded);
        transform: translateX(-100%);
        transition: transform 240ms var(--easing-out);
    }
    .has-premium-sidebar.mobile-sidebar-open .app-sidebar { transform: translateX(0); }
    .cmd-box { width: calc(100vw - 24px); }
}
