/* Brand theme variables — overridden per channel (TR default / Fusion) in _Layout head */
:root {
    --brand-from: #667EEA;
    --brand-to: #764BA2;
    --brand-accent: #FF6B6B;
    --brand-from-rgb: 102,126,234;
    --brand-to-rgb: 118,75,162;
    --brand-accent-rgb: 255,107,107;
    --brand-grad: linear-gradient(135deg, var(--brand-from) 0%, var(--brand-to) 100%);
    --brand-grad-v: linear-gradient(180deg, var(--brand-from) 0%, var(--brand-to) 50%, var(--brand-accent) 100%);
}

/* Sidebar items */
.sidebar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 10px;
    color: rgba(255,255,255,0.70);
    font-size: 13px;
    font-weight: 400;
    transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    text-decoration: none;
}
.sidebar-item:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}
.sidebar-item.active {
    background: rgba(var(--brand-from-rgb),0.25);
    color: #fff;
    font-weight: 500;
}

/* Glass card */
.glass-card {
    background: rgba(255,255,255,0.65);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.35);
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(31,38,135,0.10);
    padding: 22px;
    transition: transform 300ms cubic-bezier(0.34,1.56,0.64,1), box-shadow 250ms;
}
.glass-card:hover {
/*    transform: translateY(-2px);*/
    box-shadow: 0 8px 32px rgba(31,38,135,0.12);
}

/* KPI card variants */
.kpi-card { position: relative; border-radius: 14px; padding: 22px; overflow: hidden; transition: transform 350ms cubic-bezier(0.34,1.56,0.64,1), box-shadow 250ms; }
.kpi-card:hover { transform: translateY(-4px); box-shadow: 0 16px 48px rgba(31,38,135,0.16); }
.kpi-card::before { content: ''; position: absolute; inset: 0; background: rgba(255,255,255,0.60); backdrop-filter: blur(20px); z-index: 0; }
.kpi-card > * { position: relative; z-index: 1; }
.kpi-card--purple { background: linear-gradient(135deg, rgba(var(--brand-from-rgb),0.25), rgba(var(--brand-to-rgb),0.15)); box-shadow: 0 8px 32px rgba(31,38,135,0.10); }
.kpi-card--green { background: linear-gradient(135deg, rgba(16,185,129,0.25), rgba(6,182,212,0.15)); box-shadow: 0 8px 32px rgba(31,38,135,0.10); }
.kpi-card--indigo { background: linear-gradient(135deg, rgba(99,102,241,0.25), rgba(139,92,246,0.15)); box-shadow: 0 8px 32px rgba(31,38,135,0.10); }
.kpi-card--amber { background: linear-gradient(135deg, rgba(245,158,11,0.25), rgba(249,115,22,0.15)); box-shadow: 0 8px 32px rgba(31,38,135,0.10); }

/* Badge */
.badge { display: inline-flex; align-items: center; font-size: 12px; font-weight: 500; padding: 2px 10px; border-radius: 9999px; }
.badge--success { background: rgba(16,185,129,0.08); color: #10B981; border: 1px solid rgba(16,185,129,0.20); }
.badge--warning { background: rgba(245,158,11,0.08); color: #F59E0B; border: 1px solid rgba(245,158,11,0.20); }
.badge--error { background: rgba(239,68,68,0.08); color: #EF4444; border: 1px solid rgba(239,68,68,0.20); }
.badge--info { background: rgba(var(--brand-from-rgb),0.08); color: var(--brand-from); border: 1px solid rgba(var(--brand-from-rgb),0.20); }
.badge--neutral { background: rgba(148,163,184,0.08); color: #94A3B8; border: 1px solid rgba(148,163,184,0.20); }

/* Table inside glass card */
.glass-card table { width: 100%; border-collapse: collapse; }
.glass-card th { text-align: left; font-size: 12px; font-weight: 500; color: #94A3B8; text-transform: uppercase; letter-spacing: 0.5px; padding: 10px 14px; border-bottom: 1px solid #E2E8F0; }
.glass-card td { padding: 12px 14px; border-bottom: 1px solid #F1F5F9; font-size: 13px; color: #0F172A; transition: background-color 200ms ease; }
.glass-card tr:last-child td { border-bottom: none; }
.glass-card tr:hover td { background: rgba(var(--brand-from-rgb),0.03); }
/* REER-173 : ligne (planning clôturé) en vert. Le fond va sur les td, pas le tr,
   sinon le hover ci-dessus (qui peint les td) masque le vert. Hover = vert plus
   soutenu pour garder le retour visuel au survol. */
.glass-card tr.row-closed td { background: #d1fae5; }
.glass-card tr.row-closed:hover td { background: #a7f3d0; }

/* Surlignage de la ligne après ajout/modif (écran de gestion tarif, spec 2026-07-10 v2) */
@keyframes row-flash { 0% { background: rgba(102,126,234,0.22); } 100% { background: transparent; } }
.glass-card tr.row-flash td { animation: row-flash 2s ease-out; }
@media (prefers-reduced-motion: reduce) { .glass-card tr.row-flash td { animation: none; background: rgba(102,126,234,0.12); } }

/* REER-121 (v2) : barre de scroll horizontale révélée AU SURVOL, calée sous la ligne de
   filtres, + chevrons « pastille » signalant les colonnes masquées. Générique sur toutes
   les listes. Cf. spec 2026-06-29-liste-overflow-cue. */
.overflow-cue-wrap { position: relative; }

/* barre synchronisée, visible en permanence dès que la liste déborde (JS gère display) */
.list-scrollbar {
    position: absolute; left: 0; right: 0; height: 12px; z-index: 6;
    overflow-x: auto; overflow-y: hidden;
}
.list-scrollbar > div { height: 1px; }
.list-scrollbar::-webkit-scrollbar { height: 11px; -webkit-appearance: none; }
.list-scrollbar::-webkit-scrollbar-track { background: rgba(148,163,184,0.15); border-radius: 6px; }
.list-scrollbar::-webkit-scrollbar-thumb { background: var(--brand-grad); border-radius: 6px; border: 2px solid transparent; background-clip: padding-box; }
.list-scrollbar { scrollbar-width: thin; }

/* chevrons « pastille » : repère permanent des colonnes masquées (gauche / droite) */
.list-scroll-chev {
    position: absolute; z-index: 7; width: 34px; height: 34px; border-radius: 50%;
    display: none; align-items: center; justify-content: center; padding: 0;
    background: #fff; color: rgb(var(--brand-from-rgb)); cursor: pointer;
    border: 1px solid rgba(100,116,139,0.18);
    box-shadow: 0 6px 18px -6px rgba(var(--brand-from-rgb),0.55);
    transition: transform 150ms ease, box-shadow 150ms ease;
}
.list-scroll-chev.show { display: flex; }
.list-scroll-chev:hover { transform: scale(1.07); box-shadow: 0 8px 22px -6px rgba(var(--brand-from-rgb),0.7); }
.list-scroll-chev:focus-visible { outline: 2px solid rgb(var(--brand-from-rgb)); outline-offset: 2px; }
.list-scroll-chev svg { width: 20px; height: 20px; }
.list-scroll-chev--left { left: 8px; }
.list-scroll-chev--right { right: 8px; }

@media (prefers-reduced-motion: reduce) {
    .list-scrollbar, .list-scroll-chev { transition: none; }
    .list-scroll-chev:hover { transform: none; }
}

/* Btn primary gradient */
.btn-primary { display: inline-flex; align-items: center; gap: 6px; padding: 7px 16px; border-radius: 10px; font-size: 13px; font-weight: 500; color: #fff; border: none; cursor: pointer; transition: all 200ms; background: var(--brand-grad); box-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 0 24px rgba(var(--brand-from-rgb),0.20); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(31,38,135,0.08), 0 0 28px rgba(var(--brand-from-rgb),0.30); }

.btn-secondary { display: inline-flex; align-items: center; gap: 6px; padding: 7px 16px; border-radius: 10px; font-size: 13px; font-weight: 500; color: #0F172A; border: 1px solid #E2E8F0; cursor: pointer; transition: all 200ms; background: rgba(255,255,255,0.65); backdrop-filter: blur(8px); }
.btn-secondary:hover { background: rgba(255,255,255,0.80); border-color: rgba(var(--brand-from-rgb),0.20); }

.btn-danger { display: inline-flex; align-items: center; gap: 6px; padding: 7px 16px; border-radius: 10px; font-size: 13px; font-weight: 500; color: #fff; border: none; cursor: pointer; background: #EF4444; }
.btn-danger:hover { background: #DC2626; }

/* Form inputs */
.form-input { width: 100%; padding: 8px 12px; border: 1px solid #E2E8F0; border-radius: 10px; font-size: 13px; background: rgba(255,255,255,0.80); backdrop-filter: blur(8px); transition: border-color 200ms; }
.form-input:focus { outline: none; border-color: var(--brand-from); box-shadow: 0 0 0 3px rgba(var(--brand-from-rgb),0.10); }
.form-label { display: block; font-size: 13px; font-weight: 500; color: #475569; margin-bottom: 4px; }

/* Delete modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.40); backdrop-filter: blur(4px); z-index: 100; display: none; }
.modal-backdrop.show { display: flex; align-items: center; justify-content: center; }
.modal-content { background: #fff; border-radius: 14px; padding: 24px; max-width: 400px; width: 100%; box-shadow: 0 16px 48px rgba(31,38,135,0.16); }

/* === Turbo Drive === */

/* Progress bar */
.turbo-progress-bar {
    height: 3px;
    background: linear-gradient(90deg, var(--brand-from) 0%, var(--brand-to) 50%, var(--brand-accent) 100%);
    box-shadow: 0 0 12px rgba(var(--brand-from-rgb),0.50);
    z-index: 9999;
}

/* Page transitions */
.page-content {
    animation: pageEnter 250ms cubic-bezier(0.4, 0, 0.2, 1) both;
}

.is-leaving .page-content {
    animation: pageLeave 150ms cubic-bezier(0.4, 0, 0.2, 1) both;
}

/* ponytail: opacity-only — un transform (même translateY(0)) sur .page-content crée un
   bloc conteneur qui décroche les enfants position:fixed (barre d'action) du viewport. */
@keyframes pageEnter {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes pageLeave {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* Button loading spinner */
.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}
.btn-loading::after {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-left: 6px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 6px;
    height: 14px;
    display: inline-block;
}
.skeleton-row td {
    padding: 14px !important;
}
.skeleton-wide { width: 70%; }
.skeleton-medium { width: 45%; }
.skeleton-short { width: 25%; }

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Smooth sidebar active transition */
.sidebar-item { position: relative; }
.sidebar-item::before {
    content: '';
    position: absolute;
    left: -3px;
    top: 50%;
    transform: translateY(-50%) scaleY(0);
    width: 3px;
    height: 60%;
    border-radius: 2px;
    background: linear-gradient(180deg, var(--brand-from), var(--brand-to));
    transition: transform 200ms cubic-bezier(0.4, 0, 0.2, 1);
}
.sidebar-item.active::before {
    transform: translateY(-50%) scaleY(1);
}

/* Pagination */
.pagination { display: flex; gap: 4px; }
.pagination a, .pagination span { padding: 6px 12px; border-radius: 8px; font-size: 13px; text-decoration: none; color: #475569; border: 1px solid #E2E8F0; background: rgba(255,255,255,0.65); }
.pagination a:hover { background: rgba(255,255,255,0.80); border-color: rgba(var(--brand-from-rgb),0.20); }
.pagination .active { background: linear-gradient(135deg, var(--brand-from), var(--brand-to)); color: #fff; border-color: transparent; }

/* === Dashboard Gridstack === */
.grid-stack { min-height: 200px; }
.grid-stack-item { overflow: hidden; }
.grid-stack-item-content {
    background: rgba(255,255,255,0.85);
    border: 1px solid rgba(226,232,240,0.6);
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    padding: 16px;
    overflow: hidden;
    transition: box-shadow 250ms;
    display: flex;
    flex-direction: column;
}
.grid-stack-item-content:hover { box-shadow: 0 4px 12px rgba(31,38,135,0.08); }
.grid-stack-item-content .widget-header {
    display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; flex-shrink: 0;
}
.grid-stack-item-content .widget-title {
    font-family: 'Plus Jakarta Sans', sans-serif; font-size: 13px; font-weight: 600; color: #0F172A;
}
.grid-stack-item-content .widget-remove {
    width: 22px; height: 22px; border-radius: 6px; border: none; background: transparent;
    color: #94A3B8; font-size: 14px; cursor: pointer; display: flex; align-items: center;
    justify-content: center; transition: all 150ms; opacity: 0;
}
.grid-stack-item-content:hover .widget-remove { opacity: 1; }
.grid-stack-item-content .widget-remove:hover { background: rgba(239,68,68,0.08); color: #EF4444; }
.grid-stack-item-content .widget-body { flex: 1; min-height: 0; overflow: hidden; }

/* KPI widget variant (gradient background) */
.grid-stack-item-content.kpi-widget { padding: 22px; }
.grid-stack-item-content.kpi-widget::before { display: none; }
.kpi-widget--purple { background: linear-gradient(135deg, rgba(var(--brand-from-rgb),0.25), rgba(var(--brand-to-rgb),0.15)) !important; }
.kpi-widget--green { background: linear-gradient(135deg, rgba(16,185,129,0.25), rgba(6,182,212,0.15)) !important; }
.kpi-widget--indigo { background: linear-gradient(135deg, rgba(99,102,241,0.25), rgba(139,92,246,0.15)) !important; }
.kpi-widget--amber { background: linear-gradient(135deg, rgba(245,158,11,0.25), rgba(249,115,22,0.15)) !important; }

/* Filter bar */
.filter-btn {
    padding: 6px 16px; border-radius: 10px; font-size: 12px; font-weight: 500;
    cursor: pointer; transition: all 200ms; border: 1px solid rgba(255,255,255,0.35);
    background: rgba(255,255,255,0.50); backdrop-filter: blur(8px); color: #475569;
    font-family: 'Inter', sans-serif;
}
.filter-btn:hover { background: rgba(255,255,255,0.70); border-color: rgba(var(--brand-from-rgb),0.20); }
.filter-btn.active {
    background: linear-gradient(135deg, var(--brand-from) 0%, var(--brand-to) 100%); color: #fff;
    border: none; box-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 0 24px rgba(var(--brand-from-rgb),0.20);
}
.filter-select {
    padding: 6px 12px; border-radius: 10px; font-size: 12px; font-weight: 500; color: #475569;
    background: rgba(255,255,255,0.50); backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.35); cursor: pointer; font-family: 'Inter', sans-serif;
}
.filter-select:hover { background: rgba(255,255,255,0.70); border-color: rgba(var(--brand-from-rgb),0.20); }
.widget-library-toggle {
    display: flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 10px;
    font-size: 12px; font-weight: 600; color: #fff; border: none; cursor: pointer;
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, var(--brand-from) 0%, var(--brand-to) 100%);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 0 16px rgba(var(--brand-from-rgb),0.15);
    transition: all 200ms cubic-bezier(0.34,1.56,0.64,1);
}
.widget-library-toggle:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(31,38,135,0.12), 0 0 20px rgba(var(--brand-from-rgb),0.25); }

/* Widget library panel */
.widget-library-panel {
    position: fixed; right: 0; top: 0; width: 280px; height: 100vh; z-index: 200;
    background: rgba(26,26,46,0.92); backdrop-filter: blur(24px);
    border-left: 1px solid rgba(255,255,255,0.08); padding: 24px 16px;
    overflow-y: auto; box-shadow: -8px 0 32px rgba(0,0,0,0.2);
    transform: translateX(0); transition: transform 300ms cubic-bezier(0.4,0,0.2,1);
}
.widget-library-panel.hidden { transform: translateX(100%); }
.widget-library-panel::before {
    content: ''; position: absolute; right: 0; top: 24px; bottom: 24px; width: 3px;
    background: linear-gradient(180deg, var(--brand-from) 0%, var(--brand-to) 50%, var(--brand-accent) 100%);
    border-radius: 2px; opacity: 0.5;
}
.widget-library-close {
    position: absolute; top: 20px; right: 16px; width: 28px; height: 28px; border-radius: 10px;
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.10);
    color: rgba(255,255,255,0.5); font-size: 16px; display: flex; align-items: center;
    justify-content: center; cursor: pointer; transition: all 200ms;
}
.widget-library-close:hover { background: rgba(239,68,68,0.15); border-color: rgba(239,68,68,0.30); color: #EF4444; }
.widget-library-search {
    width: 100%; padding: 8px 12px; border-radius: 10px; font-size: 12px;
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.10);
    color: rgba(255,255,255,0.7); font-family: 'Inter', sans-serif; margin-bottom: 16px; outline: none;
}
.widget-library-search:focus { border-color: rgba(var(--brand-from-rgb),0.40); background: rgba(255,255,255,0.10); }
.widget-library-section { margin-bottom: 16px; }
.widget-library-section-title {
    font-size: 10px; font-weight: 500; color: rgba(255,255,255,0.35);
    text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 8px;
}
.widget-library-item {
    display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px;
    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.8); font-size: 12px; cursor: grab; transition: all 200ms; margin-bottom: 6px;
}
.widget-library-item:hover { background: rgba(var(--brand-from-rgb),0.15); border-color: rgba(var(--brand-from-rgb),0.30); transform: translateX(-4px); }
.widget-library-item { cursor: pointer; }
.widget-library-item.on-grid { opacity: 0.45; cursor: default; pointer-events: none; }
.widget-library-item.on-grid:hover { transform: none; background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.08); }
.widget-library-item .added-tag {
    margin-left: auto; font-size: 10px; font-weight: 600; padding: 2px 10px;
    border-radius: 9999px; background: rgba(16,185,129,0.20); color: #10B981;
    border: 1px solid rgba(16,185,129,0.30); white-space: nowrap;
}
.widget-library-item .add-to-grid-btn {
    margin-left: auto; width: 24px; height: 24px; border-radius: 6px; border: none;
    background: rgba(var(--brand-from-rgb),0.25); color: var(--brand-from); font-size: 16px; font-weight: 700;
    display: flex; align-items: center; justify-content: center; cursor: pointer;
    transition: all 200ms; flex-shrink: 0;
}
.widget-library-item:hover .add-to-grid-btn { background: rgba(var(--brand-from-rgb),0.5); color: #fff; }

/* Alert items in widget */
.alert-item {
    display: flex; align-items: center; gap: 10px; padding: 10px 14px;
    border-radius: 10px; border-left: 3px solid; backdrop-filter: blur(4px); margin-bottom: 8px;
}
.alert-item--error { background: rgba(239,68,68,0.08); border-color: #EF4444; }
.alert-item--warning { background: rgba(245,158,11,0.08); border-color: #F59E0B; }
.alert-tag { font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 9999px; text-transform: uppercase; }
.alert-tag--ops { background: rgba(239,68,68,0.12); color: #EF4444; }
.alert-tag--biz { background: rgba(245,158,11,0.12); color: #F59E0B; }
.alert-count { margin-left: auto; font-family: 'Plus Jakarta Sans', sans-serif; font-size: 16px; font-weight: 700; }

/* === Drag & Drop UX === */

/* A: Drop zone placeholder — pulsing indigo zone */
.grid-stack-placeholder > .placeholder-content {
    background: rgba(var(--brand-from-rgb),0.08) !important;
    border: 2px dashed rgba(var(--brand-from-rgb),0.5) !important;
    border-radius: 14px;
    animation: gs-placeholder-pulse 1.5s ease-in-out infinite;
}
@keyframes gs-placeholder-pulse {
    0%, 100% { border-color: rgba(var(--brand-from-rgb),0.3); background: rgba(var(--brand-from-rgb),0.05); }
    50%      { border-color: rgba(var(--brand-from-rgb),0.7); background: rgba(var(--brand-from-rgb),0.12); }
}

/* A: Dragged widget — reduced opacity + elevated shadow */
.grid-stack-item.ui-draggable-dragging > .grid-stack-item-content {
    opacity: 0.4 !important;
    box-shadow: 0 12px 40px rgba(var(--brand-from-rgb),0.25) !important;
    border-color: rgba(var(--brand-from-rgb),0.3);
}

/* C: Resize handles — visible on hover */
.grid-stack-item > .ui-resizable-se {
    width: 16px !important;
    height: 16px !important;
    background: linear-gradient(135deg, var(--brand-from), var(--brand-to)) !important;
    border: 2px solid rgba(255,255,255,0.9);
    border-radius: 5px;
    opacity: 0;
    transition: opacity 200ms;
    z-index: 10;
    bottom: 2px !important;
    right: 2px !important;
    background-image: none !important;
    box-shadow: 0 0 8px rgba(var(--brand-from-rgb),0.4);
}
.grid-stack-item:hover > .ui-resizable-se {
    opacity: 1;
}
.grid-stack-item > .ui-resizable-e {
    width: 6px !important;
    right: 0 !important;
    top: 20% !important;
    bottom: 20% !important;
    background: rgba(var(--brand-from-rgb),0.4) !important;
    border-radius: 3px;
    opacity: 0;
    transition: opacity 200ms;
    background-image: none !important;
}
.grid-stack-item:hover > .ui-resizable-e {
    opacity: 0.7;
}
.grid-stack-item > .ui-resizable-s {
    height: 6px !important;
    bottom: 0 !important;
    left: 20% !important;
    right: 20% !important;
    background: rgba(var(--brand-from-rgb),0.4) !important;
    border-radius: 3px;
    opacity: 0;
    transition: opacity 200ms;
    background-image: none !important;
}
.grid-stack-item:hover > .ui-resizable-s {
    opacity: 0.7;
}

/* C: Grid overlay visible during resize */
#dashboardGrid.grid-resizing {
    background-image:
        repeating-linear-gradient(
            90deg,
            rgba(var(--brand-from-rgb),0.06) 0px,
            rgba(var(--brand-from-rgb),0.06) 1px,
            transparent 1px,
            transparent calc(100% / 12)
        );
    background-size: calc(100% / 12) 100%;
}
.grid-stack-item.ui-resizable-resizing > .grid-stack-item-content {
    border-color: rgba(var(--brand-from-rgb),0.4);
    box-shadow: 0 0 0 2px rgba(var(--brand-from-rgb),0.15);
}

/* C: Size badge during resize */
.gs-size-badge {
    position: absolute;
    bottom: -24px;
    right: 4px;
    font-size: 11px;
    font-weight: 600;
    font-family: 'Plus Jakarta Sans', sans-serif;
    color: var(--brand-from);
    background: rgba(var(--brand-from-rgb),0.12);
    padding: 2px 10px;
    border-radius: 6px;
    white-space: nowrap;
    z-index: 100;
    pointer-events: none;
    animation: gs-badge-in 150ms ease-out;
}
@keyframes gs-badge-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* B: Drag helper from library */
.gs-drag-helper {
    padding: 10px 16px;
    border-radius: 10px;
    background: rgba(26,26,46,0.92);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(var(--brand-from-rgb),0.4);
    color: rgba(255,255,255,0.9);
    font-size: 12px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3), 0 0 16px rgba(var(--brand-from-rgb),0.15);
    display: flex;
    align-items: center;
    gap: 8px;
    pointer-events: none;
    z-index: 10001;
    white-space: nowrap;
}

/* D: Widget preview tooltip */
.widget-preview-tooltip {
    position: fixed;
    z-index: 300;
    width: 220px;
    background: rgba(26,26,46,0.95);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(var(--brand-from-rgb),0.3);
    border-radius: 12px;
    padding: 14px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    pointer-events: none;
    animation: tooltip-in 150ms ease-out;
}
@keyframes tooltip-in {
    from { opacity: 0; transform: translateX(8px); }
    to   { opacity: 1; transform: translateX(0); }
}
.widget-preview-tooltip .wpt-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: #F1F5F9;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.widget-preview-tooltip .wpt-desc {
    font-size: 11px;
    color: #64748B;
    line-height: 1.5;
    margin-bottom: 10px;
}
.widget-preview-tooltip .wpt-mini {
    background: rgba(255,255,255,0.04);
    border-radius: 8px;
    padding: 10px;
    height: 56px;
    display: flex;
    align-items: flex-end;
    gap: 3px;
    overflow: hidden;
}
.widget-preview-tooltip .wpt-mini-bar {
    flex: 1;
    border-radius: 3px 3px 0 0;
    background: linear-gradient(180deg, var(--brand-from), var(--brand-to));
    opacity: 0.7;
}
.widget-preview-tooltip .wpt-mini-line {
    width: 100%;
    height: 100%;
    position: relative;
}
.widget-preview-tooltip .wpt-mini-line svg {
    width: 100%;
    height: 100%;
}
.widget-preview-tooltip .wpt-mini-donut {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 6px solid var(--brand-from);
    border-right-color: var(--brand-to);
    border-bottom-color: rgba(255,255,255,0.1);
    margin: 0 auto;
}
.widget-preview-tooltip .wpt-mini-gauge {
    width: 40px;
    height: 20px;
    border-radius: 40px 40px 0 0;
    border: 4px solid var(--brand-from);
    border-bottom: none;
    margin: auto auto 0;
    position: relative;
}
.widget-preview-tooltip .wpt-mini-kpi {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
}
.widget-preview-tooltip .wpt-mini-kpi-value {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 18px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--brand-from), var(--brand-to));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.widget-preview-tooltip .wpt-mini-kpi-label {
    font-size: 9px;
    color: #64748B;
}
.widget-preview-tooltip .wpt-mini-table {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 3px;
    justify-content: center;
}
.widget-preview-tooltip .wpt-mini-table-row {
    height: 6px;
    border-radius: 3px;
    background: rgba(var(--brand-from-rgb),0.2);
}
.widget-preview-tooltip .wpt-mini-table-row:first-child {
    background: rgba(var(--brand-from-rgb),0.4);
}
.widget-preview-tooltip .wpt-mini-alert {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 4px;
    justify-content: center;
}
.widget-preview-tooltip .wpt-mini-alert-row {
    height: 8px;
    border-radius: 4px;
    border-left: 3px solid;
}
.widget-preview-tooltip .wpt-mini-alert-row:nth-child(1) { background: rgba(239,68,68,0.15); border-color: #EF4444; width: 90%; }
.widget-preview-tooltip .wpt-mini-alert-row:nth-child(2) { background: rgba(245,158,11,0.15); border-color: #F59E0B; width: 75%; }
.widget-preview-tooltip .wpt-mini-alert-row:nth-child(3) { background: rgba(239,68,68,0.15); border-color: #EF4444; width: 60%; }
.widget-preview-tooltip .wpt-size {
    font-size: 10px;
    color: #475569;
    margin-top: 8px;
}

/* ── Custom Scrollbar: Glass & Branded ────────────────────────── */

/* Global defaults (light context) — WebKit (Chrome, Edge, Safari) */
*::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
*::-webkit-scrollbar-track {
    background: rgba(var(--brand-from-rgb),0.04);
    border-radius: 4px;
    margin: 4px 0;
}
*::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(var(--brand-from-rgb),0.35), rgba(var(--brand-to-rgb),0.25));
    border-radius: 4px;
    transition: background 0.3s;
}
*::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(var(--brand-from-rgb),0.55), rgba(var(--brand-to-rgb),0.45));
}

/* Auto-hide: transparent at rest, visible on container hover */
*::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, transparent, transparent);
}
*:hover::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(var(--brand-from-rgb),0.35), rgba(var(--brand-to-rgb),0.25));
}
*:hover::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(var(--brand-from-rgb),0.55), rgba(var(--brand-to-rgb),0.45));
}

/* Firefox fallback */
* {
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
}
*:hover {
    scrollbar-color: rgba(var(--brand-from-rgb),0.35) rgba(var(--brand-from-rgb),0.04);
}

/* Dark context override (sidebar, widget library panel) */
.sidebar-nav::-webkit-scrollbar-track,
.widget-library-panel::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.05);
}
.sidebar-nav::-webkit-scrollbar-thumb,
.widget-library-panel::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, transparent, transparent);
}
.sidebar-nav:hover::-webkit-scrollbar-thumb,
.widget-library-panel:hover::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(var(--brand-from-rgb),0.6), rgba(var(--brand-to-rgb),0.6));
    box-shadow: 0 0 6px rgba(var(--brand-from-rgb),0.25);
}
.sidebar-nav:hover::-webkit-scrollbar-thumb:hover,
.widget-library-panel:hover::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(var(--brand-from-rgb),0.85), rgba(var(--brand-to-rgb),0.85));
    box-shadow: 0 0 8px rgba(var(--brand-from-rgb),0.4);
}

/* Firefox dark context */
.sidebar-nav,
.widget-library-panel {
    scrollbar-color: transparent transparent;
}
.sidebar-nav:hover,
.widget-library-panel:hover {
    scrollbar-color: rgba(var(--brand-from-rgb),0.6) rgba(255,255,255,0.05);
}

/* Compact variant (dropdowns, small containers) */
.dropdown-scroll::-webkit-scrollbar {
    width: 5px;
}

/* === Collapsible Sidebar === */

/* Transition on sidebar and main */
.sidebar-nav {
    transition: width 300ms ease;
}
#main-content {
    transition: margin-left 300ms ease;
}

/* Collapsed sidebar */
body.sidebar-collapsed .sidebar-nav {
    width: 64px !important;
    padding: 20px 6px;
}
body.sidebar-collapsed #main-content {
    margin-left: 64px !important;
}

/* Hide text elements in collapsed mode */
body.sidebar-collapsed .sidebar-brand-text,
body.sidebar-collapsed .sidebar-section-label,
body.sidebar-collapsed .sidebar-item-label,
body.sidebar-collapsed .sidebar-backoffice-label,
body.sidebar-collapsed .sidebar-section-toggle,
body.sidebar-collapsed .sidebar-user-info,
body.sidebar-collapsed .sidebar-country-full,
body.sidebar-collapsed .sidebar-lang-full {
    display: none !important;
}

/* Center icons in collapsed mode */
body.sidebar-collapsed .sidebar-item {
    justify-content: center;
    padding: 8px;
}
body.sidebar-collapsed .sidebar-item svg {
    margin: 0;
}

/* Logo in collapsed mode: just the icon */
body.sidebar-collapsed .sidebar-logo-full {
    display: none !important;
}
body.sidebar-collapsed .sidebar-logo-icon {
    margin: 0 auto;
}

/* User profile in collapsed mode: just initials */
body.sidebar-collapsed .sidebar-user-full {
    display: none !important;
}
body.sidebar-collapsed .sidebar-user-avatar {
    margin: 0 auto;
    cursor: pointer;
}
body.sidebar-collapsed #user-menu > div:first-child {
    justify-content: center;
    padding: 8px;
}

/* Toggle button */
.sidebar-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 8px;
    border-radius: 10px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: all 200ms;
    font-size: 14px;
    margin-top: 8px;
}
.sidebar-toggle-btn:hover {
    background: rgba(255,255,255,0.10);
    color: rgba(255,255,255,0.8);
}

/* Tooltips in collapsed mode */
body.sidebar-collapsed .sidebar-item {
    position: relative;
}
body.sidebar-collapsed .sidebar-item[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%);
    background: rgba(26,26,46,0.95);
    color: #fff;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    pointer-events: none;
}

/* Collapsed admin sections: keep icons visible, hide toggle button */
body.sidebar-collapsed .sidebar-section-content {
    max-height: none !important;
}
body.sidebar-collapsed .sidebar-section-content .sidebar-item {
    display: flex !important;
}

/* Action icons in tables */
.action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    color: #475569;
    transition: all 150ms;
    cursor: pointer;
    border: none;
    background: none;
    text-decoration: none;
}
.action-icon:hover {
    background: rgba(0,0,0,0.05);
    color: var(--brand-from);
}
.action-icon--danger:hover {
    background: rgba(239,68,68,0.08);
    color: #EF4444;
}

/* List table column (generic alias) */
.list-col {}

/* ===== Patron UI cartes (Details / Edit) ===== */

/* En-tête de page */
.page-header { display:flex; align-items:flex-start; justify-content:space-between; gap:20px; margin-bottom:24px; flex-wrap:wrap; }
.page-header h1 { font-family:'Plus Jakarta Sans',sans-serif; font-size:26px; font-weight:700; margin:0 0 8px; letter-spacing:-0.01em; }
.page-header .subtitle { font-size:13px; color:#475569; margin:0 0 12px; }
.page-header .badges { display:flex; gap:8px; flex-wrap:wrap; }
.page-header-actions { display:flex; gap:10px; }

/* Titre de carte */
.card-title { display:flex; align-items:center; gap:8px; font-size:11px; font-weight:600; text-transform:uppercase; letter-spacing:1px; color:#94A3B8; margin-bottom:18px; }
.card-title svg { width:15px; height:15px; color:var(--brand-from); }

/* Grille libellé / valeur (Détail) */
.detail-dl { display:grid; grid-template-columns:1fr 1fr; gap:18px 24px; }
.detail-dl .full { grid-column:1 / -1; }
.detail-dl dt { font-size:12px; color:#94A3B8; margin-bottom:3px; }
.detail-dl dd { font-size:14px; font-weight:500; color:#0F172A; margin:0; }
.detail-dl dd.muted { color:#CBD5E1; font-weight:400; }

/* Mini-récap KPI (sidebar) */
.kpis { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; }
.kpi { text-align:center; padding:12px 6px; border-radius:12px; background:rgba(var(--brand-from-rgb),0.06); }
.kpi .v { font-family:'Plus Jakarta Sans',sans-serif; font-size:22px; font-weight:700; color:#0F172A; line-height:1; }
.kpi .l { font-size:11px; color:#94A3B8; margin-top:5px; }

/* Pills checkbox (catalogues, options) */
.toggle { display:inline-flex; align-items:center; gap:8px; padding:8px 14px; border-radius:10px; border:1px solid #E2E8F0; background:rgba(255,255,255,0.6); font-size:13px; cursor:pointer; transition:all 160ms; user-select:none; }
.toggle input { width:15px; height:15px; accent-color:var(--brand-from); }
.toggle:has(input:checked) { border-color:rgba(var(--brand-from-rgb),0.45); background:rgba(var(--brand-from-rgb),0.07); color:var(--brand-from); font-weight:500; }

/* REER-105 — interrupteur Animé(vert)/Non-animé(gris) du planning hebdo */
.day-switch { display:inline-flex; align-items:center; cursor:pointer; }
.day-switch input { position:absolute; opacity:0; width:0; height:0; }
.day-switch .track { position:relative; display:inline-block; width:40px; height:22px; border-radius:9999px; background:#CBD5E1; transition:background-color 220ms ease; }
.day-switch .thumb { position:absolute; top:2px; left:2px; width:18px; height:18px; border-radius:50%; background:#fff; box-shadow:0 1px 3px rgba(0,0,0,0.2); transition:transform 220ms cubic-bezier(0.34,1.56,0.64,1); }
.day-switch input:checked + .track { background:#10B981; }
.day-switch input:checked + .track .thumb { transform:translateX(18px); }
.day-switch input:focus-visible + .track { box-shadow:0 0 0 3px rgba(16,185,129,0.25); }
.day-switch input:disabled + .track { opacity:0.5; cursor:not-allowed; }

/* REER-105 — horaires : fondu + translation quand le jour (dés)activé */
.time-input { transition:opacity 250ms ease, transform 250ms ease; }
.time-input:disabled { opacity:0.45; transform:translateY(2px); pointer-events:none; background:#F8FAFC; }

/* Barre d'action sticky */
.form-action-bar { position:fixed; left:0; right:0; bottom:0; z-index:50; background:rgba(255,255,255,0.80); backdrop-filter:blur(20px); -webkit-backdrop-filter:blur(20px); border-top:1px solid rgba(255,255,255,0.6); box-shadow:0 -4px 24px rgba(31,38,135,0.08); padding:12px 28px; }
.form-action-bar .action-inner { display:flex; align-items:center; justify-content:flex-end; gap:10px; }
.dirty { display:inline-flex; align-items:center; gap:7px; font-size:12.5px; color:#64748B; margin-right:auto; }
.dirty .dot { width:8px; height:8px; border-radius:50%; background:var(--brand-accent); box-shadow:0 0 0 3px rgba(var(--brand-accent-rgb),0.18); }

/* Badges complémentaires (réutilise .badge existant) */
.badge-channel { background:rgba(118,75,162,0.10); color:#7C3AED; border:1px solid rgba(118,75,162,0.20); }
.badge-siscom  { background:rgba(148,163,184,0.12); color:#64748B; border:1px solid rgba(148,163,184,0.22); }

/* Pages avec barre d'action : réserver l'espace en bas */
.page-content:has(.form-action-bar) { padding-bottom:84px; }

/* Listes : tri + filtre par colonne */
.sort-th { cursor: pointer; user-select: none; }
.sort-arrow { color: #CBD5E1; font-size: 11px; }
.sort-arrow.active { color: var(--brand-from); }
.filter-row th { padding: 4px 8px 8px; }
.filter-row .filter-input { width: 100%; min-width: 80px; padding: 4px 8px; font-size: 12px; }
.list-loading { opacity: 0.6; transition: opacity .1s; }

/* Champ en erreur de validation (classe émise par les tag-helpers asp-validation-for) */
.input-validation-error { border-color: #f87171 !important; background-color: #fef2f2; }
.field-validation-error { color: #b91c1c; font-size: 12px; display: block; margin-top: 4px; }

/* ---- Champ Email (Store Details/Edit) ---- */
.email-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.email-chip {
  display: inline-flex; align-items: center; gap: 7px; min-width: 0;
  max-width: 100%; padding: 6px 11px; border-radius: 10px;
  font-size: 13px; background: rgba(var(--brand-from-rgb),.06);
  border: 1px solid rgba(var(--brand-from-rgb),.18); color: inherit;
}
.email-chip .em { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.email-chip .dot { flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--brand-from); }
.email-count {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: rgba(var(--brand-from-rgb),.10); color: var(--brand-from);
}
.email-actions { display: flex; align-items: center; gap: 10px; margin-top: 12px; }

.tag-editor {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  padding: 9px 10px; min-height: 46px; border-radius: 10px;
  border: 1px solid rgba(148,163,184,.4); background: #fff;
}
.tag-editor:focus-within { border-color: var(--brand-from); box-shadow: 0 0 0 3px rgba(var(--brand-from-rgb),.15); }
.tag-editor .tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 6px 5px 10px; border-radius: 8px; font-size: 13px;
  border: 1px solid rgba(148,163,184,.35); background: #f8fafc;
}
.tag-editor .tag.bad { border-color: #e5484d; color: #e5484d; background: rgba(229,72,77,.07); }
.tag-editor .tag-x {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; padding: 0; border: none; background: none; font: inherit; line-height: 1;
  border-radius: 5px; cursor: pointer; color: #94a3b8;
}
.tag-editor .tag-x:hover { background: rgba(148,163,184,.25); color: inherit; }
.tag-editor .tag-x:focus-visible { outline: 2px solid var(--brand-from); outline-offset: 1px; }
.tag-editor input.tag-input {
  flex: 1; min-width: 160px; border: none; background: transparent; outline: none;
  font-size: 13px; padding: 5px 4px;
}
