/* ====================================================================
   DASHBOARD COPILOTE — styles scoped à html.ui-premium #dashboard-view
   Chargé après design-system.css pour garantir la priorité de cascade.
   ==================================================================== */

/* ── Police Geist ── */
body {
  font-family: 'Geist', 'Inter', system-ui, sans-serif;
}

/* ── Layout global : fluide jusqu'à 1760 px, conteneur centré ── */
html.ui-premium .app-topbar {
  width: min(1760px, calc(100% - 40px));
  min-height: 64px;
  padding: 4px 18px;
  margin: 4px auto 0;
  /* overflow: hidden supprimé — clippait les .topbar-nav-submenu en position:absolute */
}

html.ui-premium .app-topbar-left {
  display: inline-flex;
  align-items: center;
  overflow: hidden;
}

html.ui-premium .app-topbar-logo {
  height: 54px;
  width: auto;
  max-height: 100%;
  transform: none;
  display: block;
  mix-blend-mode: multiply;
}

html.ui-premium .topbar-nav {
  gap: 32px;
}

html.ui-premium .page-shell {
  width: min(92vw, 1760px);
  padding-top: 0;
}

/* ── Layout principal : flux vertical (override design-system display:grid) ── */
html.ui-premium #dashboard-view {
  background: #f7f8fa;
  width: 100%;
  padding: 0 28px 28px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: stretch;
  /* Le dashboard occupe toute la zone — pas de carte avec coins arrondis */
  border: none;
  border-radius: 0;
  box-shadow: none;
}

/* ── 1. Salutation (standalone, pas de carte) ── */
html.ui-premium #dashboard-view .dash-hero {
  padding-top: 4px;
}

html.ui-premium #dashboard-view .dashboard-hero-title {
  font-size: 28px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.25;
  margin: 0;
  text-align: left;
}

html.ui-premium #dashboard-view .dashboard-hero-name-accent {
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

html.ui-premium #dashboard-view .dashboard-hero-subtitle {
  font-size: 13.5px;
  color: var(--ink-2);
  font-weight: 400;
  margin-top: 5px;
  white-space: nowrap;
  text-align: left;
}

html.ui-premium #dashboard-view .dashboard-hero-mini-kpis {
  display: none !important;
}

/* ── 2. Zone principale 2 colonnes ── */
html.ui-premium #dashboard-view .dash-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 16px;
  align-items: stretch;
}

/* Grille KPI 3 × 2 dans la colonne gauche */
html.ui-premium #dashboard-view .dash-kpi-col .dash-kpis-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

/* ── 3. Activité des prix ── */
html.ui-premium #dashboard-view .dash-price-activity {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dash-price-activity-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ── Groupes workflow (À traiter / En attente commercial) ── */
.pra-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pra-group + .pra-group { margin-top: 20px; }

.pra-group-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.pra-group-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--ink-3);
  flex: 1;
}
.pra-group-count {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-3);
  background: var(--neutral-bg);
  padding: 2px 9px;
  border-radius: var(--radius-pill);
}

/* Style du groupe "À traiter" — label plus visible */
.pra-group[data-group="a_traiter"] .pra-group-label {
  color: var(--brand);
}
.pra-group[data-group="a_traiter"] .pra-group-count {
  background: var(--pat-bg);
  color: var(--brand);
}
/* Style du groupe "En attente commercial" */
.pra-group[data-group="en_attente_commercial"] .pra-group-count {
  background: #FFF7E6;
  color: #B45309;
}

.dash-price-activity-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ── Boutons de statut — variantes workflow ── */
.pra-status-btn--todo[data-active="true"] {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.pra-status-btn--pending[data-active="true"] {
  background: #D97706;
  border-color: #D97706;
  color: #fff;
}
.pra-status-btn--done[data-active="true"] {
  background: var(--good);
  border-color: var(--good);
  color: #fff;
}

/* ── Historique clôturé ── */
.pra-history-section {
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  padding: 16px;
  background: var(--card);
  margin-bottom: 24px;
}
.pra-history-subgroup-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0 6px;
  border-top: 1px solid var(--card-border);
  margin-top: 10px;
}
.pra-history-section > .pra-history-subgroup-head:first-of-type {
  border-top: none;
  margin-top: 8px;
}
.pra-history-subgroup-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  flex: 1;
}
.pra-history-subgroup-label--danger { color: var(--bad); }
.pra-history-subgroup-label--warning { color: #B45309; }
.pra-history-subgroup-label--good { color: var(--good); }
.pra-history-subgroup-count {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-3);
  background: var(--neutral-bg);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}
.pra-history-list { margin-bottom: 4px; }

.dash-price-activity-empty {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 20px 0;
  font-size: 13.5px;
  color: var(--ink-3);
}

.dash-price-activity-empty i {
  font-size: 18px;
  color: var(--ink-3);
  opacity: 0.5;
}

/* ── Bouton refresh dans le footer Aujourd'hui ── */
.sly-today-footer-refresh {
  margin-left: auto;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid var(--card-border);
  background: transparent;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  flex-shrink: 0;
  transition: background 120ms ease, color 120ms ease;
}
.sly-today-footer-refresh:hover {
  background: rgba(7, 60, 191, 0.06);
  color: var(--brand);
}

/* ── Infrastructure legacy (hors flux) ── */
html.ui-premium #dashboard-view .dash-legacy {
  display: none !important;
}

html.ui-premium #dashboard-view > #last-update-card,
html.ui-premium #dashboard-view > #dashboard-import-input {
  display: none !important;
}

/* ── Panels : cartes sobres (legacy compatible) ── */
html.ui-premium #dashboard-view .panel {
  background: var(--card);
  border: 0.5px solid var(--card-border);
  border-radius: var(--radius-card);
  box-shadow: none;
}
html.ui-premium #dashboard-view .panel-head {
  margin-bottom: 14px;
}

/* ── Titres de section (legacy compatible) ── */
html.ui-premium #dashboard-view .dashboard-section-title,
html.ui-premium #dashboard-view .supplier-alert-section-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  text-transform: none !important;
  letter-spacing: 0;
}
html.ui-premium #dashboard-view .supplier-alert-section-count {
  font-size: 11px;
  font-weight: 500;
  text-transform: none !important;
  letter-spacing: 0;
  min-height: auto;
  padding: 2px 8px;
  border-radius: 6px;
}

/* ── KPI grid (dashboard-kpi-grid legacy) ── */
html.ui-premium #dashboard-view #dashboard-kpi-grid {
  display: none !important;
}

/* ── Bloc "Aujourd'hui" ── */
#dashboard-today-block {
  margin: 0;
}
.dashboard-today-card {
  background: #fff;
  border: 0.5px solid rgba(15, 23, 42, 0.08);
  border-radius: 12px;
  overflow: hidden;
}
.dashboard-today-header {
  padding: 14px 18px 10px;
  border-bottom: 0.5px solid rgba(15, 23, 42, 0.06);
}
.dashboard-today-header-title {
  font-size: 14px;
  font-weight: 500;
  color: #94a3b8;
}
.dashboard-today-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 18px;
}
.dashboard-today-divider {
  height: 0.5px;
  background: rgba(15, 23, 42, 0.06);
  margin: 0 18px;
}
.dashboard-today-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
}
.dashboard-today-dot-alert   { background: rgba(234, 179, 8, 0.12);  color: #b45309; }
.dashboard-today-dot-good    { background: rgba(22, 163, 74, 0.10);  color: #16a34a; }
.dashboard-today-dot-neutral { background: rgba(15, 23, 42, 0.06);   color: #475569; }
.dashboard-today-dot-info    { background: rgba(0, 71, 255, 0.07);   color: #0047ff; }
.dashboard-today-copy {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.dashboard-today-title {
  font-size: 13px;
  font-weight: 500;
  color: #0f172a;
}
.dashboard-today-subtitle {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 400;
}
.dashboard-today-cta {
  flex-shrink: 0;
  padding: 5px 12px;
  border-radius: 7px;
  border: 1px solid rgba(0, 71, 255, 0.22);
  background: transparent;
  color: #0047ff;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.13s, border-color 0.13s;
  font-family: inherit;
}
.dashboard-today-cta:hover {
  background: rgba(0, 71, 255, 0.06);
  border-color: #0047ff;
}

/* ── Panneau alertes unique ── */
.dashboard-alert-panel {
  background: #fff;
  border: 0.5px solid rgba(15, 23, 42, 0.08);
  border-radius: 12px;
  overflow: hidden;
}

.dashboard-alert-panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px 12px;
  border-bottom: 0.5px solid rgba(15, 23, 42, 0.06);
}

.dashboard-alert-panel-title {
  font-size: 14px;
  font-weight: 500;
  color: #0f172a;
  margin: 0;
}

.dashboard-alert-panel-count {
  font-size: 11px;
  font-weight: 500;
  color: #64748b;
  background: rgba(15, 23, 42, 0.05);
  border-radius: 5px;
  padding: 2px 8px;
}

/* Grille commune en-têtes + lignes */
.dashboard-alert-col-headers,
.dashboard-alert-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 180px 130px 220px;
  gap: 16px;
  align-items: center;
  padding-left: 18px;
  padding-right: 18px;
}

.dashboard-alert-col-headers {
  padding-top: 8px;
  padding-bottom: 8px;
  background: rgba(248, 250, 252, 0.9);
  border-bottom: 0.5px solid rgba(15, 23, 42, 0.06);
}

.dashboard-alert-col-headers span {
  font-size: 10px;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.dashboard-alert-col-headers span:nth-child(2),
.dashboard-alert-col-headers span:nth-child(3),
.dashboard-alert-col-headers span:nth-child(4) {
  text-align: right;
}

.dashboard-alert-row {
  padding-top: 13px;
  padding-bottom: 13px;
  border-bottom: 0.5px solid rgba(15, 23, 42, 0.05);
  transition: background 0.12s;
}

.dashboard-alert-row:last-child {
  border-bottom: none;
}

.dashboard-alert-row:hover {
  background: rgba(15, 23, 42, 0.015);
}

/* Colonne 1 : Produit */
.dashboard-alert-cell-product {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.dashboard-alert-name-line {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  overflow: hidden;
}

.dashboard-alert-product-name {
  font-size: 13px;
  font-weight: 500;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dashboard-alert-supplier-chip {
  font-size: 11px;
  color: #64748b;
  background: rgba(15, 23, 42, 0.05);
  border-radius: 4px;
  padding: 1px 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

.dashboard-alert-ref {
  font-size: 11px;
  color: #94a3b8;
}

/* Colonne 2 : Prix */
.dashboard-alert-cell-price {
  font-size: 12px;
  color: #64748b;
  text-align: right;
  white-space: nowrap;
}

.dashboard-alert-cell-price strong {
  color: #0f172a;
  font-weight: 500;
}

/* Colonne 3 : Variation + impact */
.dashboard-alert-cell-variation {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}

.dashboard-alert-var-badge {
  font-size: 12px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 5px;
  white-space: nowrap;
}

.dashboard-alert-var-badge--decrease { background: rgba(22, 163, 74, 0.09); color: #16a34a; }
.dashboard-alert-var-badge--increase { background: rgba(220, 38, 38, 0.08); color: #dc2626; }

.dashboard-alert-impact {
  font-size: 11px;
  font-weight: 500;
}

.dashboard-alert-impact--good    { color: #16a34a; }
.dashboard-alert-impact--danger  { color: #dc2626; }
.dashboard-alert-impact--neutral { color: #94a3b8; }

/* Colonne 4 : Actions */
.dashboard-alert-cell-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

/* ── Bande metric 3 cartes ── */
.dashboard-metric-band {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.dashboard-metric-card {
  background: #f0f2f5;
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dashboard-metric-label {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 400;
}
.dashboard-metric-value {
  font-size: 22px;
  font-weight: 500;
  color: #0f172a;
  line-height: 1.1;
}
.dashboard-metric-value--good   { color: #16a34a; }
.dashboard-metric-value--danger { color: #dc2626; }

/* ── Toolbar surface reset ── */
html.ui-premium #dashboard-view .dashboard-supplier-alert-toolbar-surface {
  background: none !important;
  box-shadow: none !important;
  border: none !important;
  padding: 0 !important;
}
html.ui-premium #dashboard-view .dashboard-supplier-alert-summary-grid {
  display: none !important; /* remplacé par dashboard-metric-band */
}

/* ── Section alertes : liste verticale ── */
html.ui-premium #dashboard-view .supplier-alert-section {
  display: flex;
  flex-direction: column;
  gap: 0;
}
html.ui-premium #dashboard-view .supplier-alert-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
html.ui-premium #dashboard-view .supplier-alert-section-note {
  display: none;
}
/* Grille horizontale → liste verticale */
html.ui-premium #dashboard-view .supplier-alert-section-grid {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  overflow: visible !important;
  scroll-snap-type: none !important;
  grid-auto-flow: unset !important;
  grid-auto-columns: unset !important;
}
html.ui-premium #dashboard-view .supplier-alert-list-head {
  display: none !important;
}

/* ── Carte alerte — layout 2 lignes ── */
html.ui-premium #dashboard-view .supplier-alert-row {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 9px !important;
  padding: 12px 14px !important;
  background: #fff !important;
  border: 0.5px solid rgba(15, 23, 42, 0.08) !important;
  border-left: none !important;
  border-radius: 12px !important;
  min-height: auto !important;
  max-height: none !important;
  min-width: 0 !important;
  max-width: 900px;
  grid-template-columns: unset !important;
  grid-template-rows: unset !important;
  grid-column: unset !important;
  margin-bottom: 8px;
}

/* Ligne 1 : [groupe gauche] ··· [badge] */
html.ui-premium #dashboard-view .supplier-alert-row-line1 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}
html.ui-premium #dashboard-view .supplier-alert-row-line1-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
}

/* Ligne 2 : [groupe gauche] ··· [boutons] */
html.ui-premium #dashboard-view .supplier-alert-row-line2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
}
html.ui-premium #dashboard-view .supplier-alert-row-line2-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
html.ui-premium #dashboard-view .supplier-alert-row-line2-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* Éléments de la ligne 1 */
.supplier-alert-product-name {
  font-size: 13px;
  font-weight: 500;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 340px;  /* plus de place en desktop */
}
.supplier-alert-supplier-chip {
  font-size: 11px;
  color: #64748b;
  background: rgba(15, 23, 42, 0.05);
  border-radius: 4px;
  padding: 1px 6px;
  white-space: nowrap;
  flex-shrink: 0;
}
.supplier-alert-row-ref {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 400;
  flex-shrink: 0;
}
.supplier-alert-variation-badge {
  font-size: 12px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  white-space: nowrap;
}
.supplier-alert-variation-badge--increase { background: rgba(220, 38, 38, 0.08); color: #dc2626; }
.supplier-alert-variation-badge--decrease { background: rgba(22, 163, 74, 0.09); color: #16a34a; }

/* Éléments de la ligne 2 */
.supplier-alert-prices {
  font-size: 12px;
  color: #64748b;
  font-weight: 400;
  white-space: nowrap;
}
.supplier-alert-prices strong {
  color: #0f172a;
  font-weight: 500;
}
.supplier-alert-impact {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 5px;
  white-space: nowrap;
}
.supplier-alert-impact--good    { background: rgba(22, 163, 74, 0.09); color: #15803d; }
.supplier-alert-impact--danger  { background: rgba(220, 38, 38, 0.08); color: #dc2626; }
.supplier-alert-impact--neutral { color: #94a3b8; }

/* Boutons des cartes alertes */
.supplier-alert-btn-primary {
  padding: 5px 11px;
  border-radius: 6px;
  border: none;
  background: #0047ff;
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.13s;
  font-family: inherit;
  white-space: nowrap;
}
.supplier-alert-btn-primary:hover:not(:disabled) { background: #0039d6; }
.supplier-alert-btn-primary:disabled             { opacity: 0.45; cursor: not-allowed; }
.supplier-alert-btn-primary--danger              { background: #1e40af; }
.supplier-alert-btn-primary--danger:hover:not(:disabled) { background: #1e3a8a; }

.supplier-alert-btn-secondary {
  padding: 5px 11px;
  border-radius: 6px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: transparent;
  color: #475569;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.13s;
  font-family: inherit;
  white-space: nowrap;
}
.supplier-alert-btn-secondary:hover:not(:disabled) { background: rgba(15, 23, 42, 0.04); }
.supplier-alert-btn-secondary:disabled             { opacity: 0.45; cursor: not-allowed; }

/* "Voir toutes les alertes" */
.dashboard-alerts-see-all {
  display: block;
  margin-top: 8px;
  text-align: center;
  font-size: 13px;
  color: #0047ff;
  cursor: pointer;
  font-weight: 500;
  background: none;
  border: none;
  width: 100%;
  padding: 8px;
  font-family: inherit;
  border-radius: 7px;
  transition: background 0.12s;
}
.dashboard-alerts-see-all:hover { background: rgba(0, 71, 255, 0.04); }

/* ── Sync footer discret ── */
.dashboard-sync-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 0 2px;
  font-size: 12px;
  color: #94a3b8;
}
.dashboard-sync-footer-sep    { color: #cbd5e1; }
.dashboard-sync-footer-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: none;
  border: none;
  font-size: 12px;
  color: #64748b;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 5px;
  transition: color 0.12s, background 0.12s;
  font-family: inherit;
}
.dashboard-sync-footer-btn:hover:not(:disabled) { color: #0047ff; background: rgba(0, 71, 255, 0.05); }
.dashboard-sync-footer-btn:disabled             { opacity: 0.5; cursor: not-allowed; }

/* ── Filtres période suivi fournisseurs — compacts dans le rail ── */
html.ui-premium #dashboard-view .supplier-trend-period-switch {
  flex-wrap: nowrap !important;
  overflow-x: auto;
  width: 100%;
  scrollbar-width: none;
}
html.ui-premium #dashboard-view .supplier-trend-period-switch::-webkit-scrollbar {
  display: none;
}
html.ui-premium #dashboard-view .supplier-trend-period-button {
  min-height: 26px !important;
  padding: 0 9px !important;
  font-size: 0.67rem !important;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Raccourcis condensés ── */
html.ui-premium #dashboard-view .dashboard-shortcut-card {
  min-height: 68px !important;
  padding: 13px 16px !important;
  border-radius: 10px !important;
  box-shadow: none !important;
  border: 0.5px solid rgba(15, 23, 42, 0.08) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 10px !important;
}
html.ui-premium #dashboard-view .dashboard-shortcut-body {
  display: flex;
  align-items: center;
  gap: 10px;
}
html.ui-premium #dashboard-view .dashboard-shortcut-title {
  font-size: 14px !important;
  font-weight: 500 !important;
}
.dashboard-shortcut-icon {
  font-size: 18px;
  opacity: 0.6;
  flex-shrink: 0;
}

/* ════════════════════════════════════════
   Bande KPI
   ════════════════════════════════════════ */

.dash-kpis-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.dash-kpi-card {
  background: #fff;
  border: 0.5px solid rgba(15, 23, 42, 0.08);
  border-radius: 12px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 92px;
  transition: box-shadow 140ms ease, border-color 140ms ease;
}

.dash-kpi-card--clickable {
  cursor: pointer;
}

.dash-kpi-card--clickable:hover {
  border-color: rgba(28, 63, 196, 0.28);
  box-shadow: 0 0 0 3px rgba(28, 63, 196, 0.08);
}

.dash-kpi-card--clickable:focus-visible {
  outline: 2px solid #1C3FC4;
  outline-offset: 2px;
}

.dash-kpi-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94a3b8;
  line-height: 1.3;
}

.dash-kpi-value {
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}

.dash-kpi-subtitle {
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
  line-height: 1.4;
}

.dash-kpi-subtitle--good  { color: #16a34a; }
.dash-kpi-subtitle--alert { color: #dc2626; }

.dash-kpi-hint-btn {
  margin-top: 4px;
  background: none;
  border: none;
  padding: 0;
  font-size: 13px;
  color: #1C3FC4;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  line-height: 1.4;
}

.dash-kpi-hint-btn:hover { text-decoration: underline; }

/* ── Cartes « à venir » ── */
.dash-kpi-card--upcoming {
  border: 1.5px dashed rgba(15, 23, 42, 0.14);
  background: rgba(248, 250, 252, 0.7);
  cursor: default;
}

.dash-kpi-card--upcoming .dash-kpi-label {
  color: #cbd5e1;
}

.dash-kpi-upcoming-tag {
  display: inline-block;
  margin-top: 8px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #94a3b8;
  background: rgba(15, 23, 42, 0.04);
  border-radius: 4px;
  padding: 2px 7px;
}

/* ════════════════════════════════════════
   Modal — Saisie du CA
   ════════════════════════════════════════ */

.ca-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(15, 23, 42, 0.42);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: ca-modal-in 180ms ease-out;
}

.ca-modal-backdrop[hidden] { display: none !important; }

@keyframes ca-modal-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.ca-modal-dialog {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 24px 56px rgba(15, 23, 42, 0.20);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ca-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.07);
  flex-shrink: 0;
}

.ca-modal-title {
  font-size: 18px;
  font-weight: 600;
  color: #0f172a;
  margin: 0;
}

.ca-modal-close {
  background: none;
  border: none;
  font-size: 20px;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  border-radius: 6px;
  font-family: inherit;
}

.ca-modal-close:hover { background: rgba(15, 23, 42, 0.06); color: #0f172a; }

.ca-modal-body {
  overflow-y: auto;
  flex: 1;
}

.ca-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.ca-table th,
.ca-table td {
  padding: 8px 14px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  text-align: left;
  vertical-align: middle;
}

.ca-table thead th {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #94a3b8;
  background: #f8fafc;
  position: sticky;
  top: 0;
  z-index: 1;
}

.ca-th-month { width: 28%; }
.ca-th-year  { width: 36%; }

.ca-cell-month {
  color: #374151;
  font-weight: 500;
}

.ca-cell-input { position: relative; }

.ca-input-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 100%;
  max-width: 140px;
}

.ca-input {
  width: 100%;
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  padding: 6px 26px 6px 8px;
  font-size: 13px;
  font-family: inherit;
  color: #0f172a;
  background: #fff;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.ca-input:focus {
  outline: none;
  border-color: #1C3FC4;
  box-shadow: 0 0 0 3px rgba(28, 63, 196, 0.12);
}

.ca-input::placeholder { color: #cbd5e1; }

.ca-input-suffix {
  position: absolute;
  right: 8px;
  font-size: 12px;
  color: #94a3b8;
  pointer-events: none;
  user-select: none;
}

.ca-tfoot-total th,
.ca-tfoot-total td {
  font-weight: 600;
  color: #0f172a;
  background: #f8fafc;
  font-variant-numeric: tabular-nums;
  border-bottom: 0.5px solid rgba(15, 23, 42, 0.08);
}

.ca-tfoot-pct td {
  border-bottom: none;
  padding-top: 6px;
  padding-bottom: 8px;
}

.ca-total-pct-cell {
  font-size: 13px;
  color: #64748b;
}

.ca-total-pct-cell--up   { color: #16a34a; font-weight: 500; }
.ca-total-pct-cell--down { color: #dc2626; font-weight: 500; }

.ca-modal-foot {
  padding: 14px 24px;
  border-top: 1px solid rgba(15, 23, 42, 0.07);
  display: flex;
  justify-content: flex-end;
  flex-shrink: 0;
}

.ca-modal-save {
  background: #1C3FC4;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 9px 24px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 120ms ease;
}

.ca-modal-save:hover { background: #1633a3; }

body.ca-modal-open { overflow: hidden; }

/* ── État vide alertes prix ── */
.dashboard-empty-state-title {
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  margin: 0 0 4px 0;
}
.dashboard-empty-state-sub {
  font-size: 13px;
  color: #94a3b8;
  margin: 0;
}

/* ══════════════════════════════════════════════════════════════════
   ACTIVITÉ DES PRIX — lignes accordéon
   ══════════════════════════════════════════════════════════════════ */

/* ── Ligne (shell) ── */
.pra-row {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-alert-row);
  overflow: hidden;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
  will-change: transform;
}
.pra-row:hover {
  border-color: var(--brand-border);
  box-shadow: var(--shadow-row-hover);
  transform: translateY(-1px);
}
.pra-row[data-expanded="true"] {
  border-color: var(--brand-border-strong);
  box-shadow: var(--shadow-row-active);
  transform: none;
}
.pra-row--flagged { border-color: var(--bad-border); }

/* ── Résumé (bouton, toujours visible) ── */
.pra-row-summary {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 15px 18px;
  min-height: 62px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: background 180ms ease;
}
.pra-row-summary:hover { background: var(--brand-bg-subtle); }

/* Bloc gauche : nom + meta empilés */
.pra-summary-left {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 0 1 auto;
}
.pra-summary-name {
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
}
.pra-summary-meta {
  font-size: 12.5px;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
}

/* Espace flexible */
.pra-summary-spacer { flex: 1; min-width: 12px; }

/* Mouvement avant → après */
.pra-summary-prices {
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.pra-summary-price-old {
  font-size: 13px;
  color: var(--ink-3);
  font-weight: 400;
}
.pra-summary-arrow {
  font-size: 12px;
  color: var(--ink-3);
  opacity: 0.6;
}
.pra-summary-price-new {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
}

/* Chip directionnel — largeur fixe pour alignement vertical */
.pra-summary-chip {
  min-width: 76px;
  text-align: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Chevron — glisse + bleu au survol */
.pra-summary-chevron {
  color: var(--ink-3);
  font-size: 14px;
  flex-shrink: 0;
  transition: transform 180ms ease, color 180ms ease;
}
.pra-row:hover .pra-summary-chevron {
  color: var(--brand);
  transform: translateX(2px);
}
.pra-row[data-expanded="true"] .pra-summary-chevron {
  transform: rotate(90deg);
  color: var(--brand);
}
.pra-row[data-expanded="true"]:hover .pra-summary-chevron {
  transform: rotate(90deg) translateX(0);
}

/* ── Panneau déplié ── */
.pra-row-detail {
  border-top: 1px solid var(--card-border);
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  background: rgba(5,16,64,.015);
}
.pra-row-detail[hidden] { display: none !important; }

/* En-tête du panneau */
.pra-detail-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.pra-detail-name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink);
  flex: 1;
  min-width: 0;
}
.pra-detail-price {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

/* Chips d'info */
.pra-detail-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.pra-info-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: var(--neutral-bg);
  font-size: 11.5px;
}
.pra-info-chip-label { color: var(--ink-3); font-weight: 500; }
.pra-info-chip-value { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }

/* Corps 2 colonnes */
.pra-detail-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.pra-detail-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pra-detail-col-title {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  margin: 0;
}
.pra-detail-empty {
  font-size: 12.5px;
  color: var(--ink-3);
  font-style: italic;
}

/* Timeline historique */
.pra-timeline { display: flex; flex-direction: column; gap: 5px; }
.pra-timeline-item {
  display: grid;
  grid-template-columns: 10px auto 1fr;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.pra-timeline-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand);
  justify-self: center;
}
.pra-timeline-date { color: var(--ink-3); white-space: nowrap; }
.pra-timeline-prices { color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; }

/* Chips plats liés */
.pra-usage-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.pra-usage-chip {
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--pat-bg);
  color: var(--brand);
  font-size: 12px;
  font-weight: 500;
}

/* ── Barre de statut ── */
.pra-status-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  border-top: 1px solid var(--card-border);
  padding-top: 12px;
}
.pra-status-btn {
  padding: 5px 13px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--card-border);
  background: transparent;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
  font-family: inherit;
}
.pra-status-btn:hover {
  border-color: rgba(7,60,191,.3);
  color: var(--brand);
}
.pra-status-btn[data-active="true"] {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

/* ── Boutons d'action ── */
.pra-detail-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.pra-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 13px;
  border-radius: 8px;
  border: 1px solid var(--card-border);
  background: transparent;
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  min-height: 34px;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}
.pra-action-btn:hover {
  background: rgba(7,60,191,.05);
  border-color: rgba(7,60,191,.25);
  color: var(--brand);
}
.pra-action-btn[data-active="true"] {
  background: var(--pat-bg);
  border-color: rgba(7,60,191,.3);
  color: var(--brand);
}
.pra-action-btn--flag { color: var(--bad); border-color: var(--bad-bg); }
.pra-action-btn--flag:hover,
.pra-action-btn--flag[data-active="true"] {
  background: var(--bad-bg);
  border-color: rgba(163,45,45,.45);
  color: var(--bad);
}

/* ── Variante mailto du bouton d'action ── */
.pra-action-btn--mail {
  text-decoration: none;
  background: var(--pat-bg);
  border-color: rgba(7,60,191,.2);
  color: var(--brand);
}
.pra-action-btn--mail:hover {
  background: rgba(7,60,191,.12);
  border-color: rgba(7,60,191,.35);
  color: var(--brand-deep);
}

/* ── PRA — Section négociation prix (Prompt 2) ── */
.pra-negotiated-section {
  margin: 14px 0 4px;
  padding: 12px 14px;
  background: var(--brand-bg-subtle);
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-row);
}
.pra-negotiated-section-title {
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-2);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.pra-negotiated-content { display: flex; flex-direction: column; gap: 0; }

/* Formulaire saisie */
.pra-neg-form { display: flex; flex-direction: column; gap: 7px; }
.pra-neg-label { font-size: 0.8125rem; color: var(--ink-3); font-weight: 500; }
.pra-neg-input-row { display: flex; align-items: center; gap: 6px; }
.pra-neg-input {
  width: 88px;
  padding: 7px 10px;
  border: 1.5px solid var(--card-border);
  border-radius: 8px;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ink);
  background: var(--card);
  outline: none;
  transition: border-color 160ms;
  font-variant-numeric: tabular-nums;
}
.pra-neg-input:focus { border-color: var(--brand); }
.pra-neg-input--error { border-color: var(--bad) !important; animation: pra-shake .28s ease; }
.pra-neg-unit { font-size: 0.9375rem; font-weight: 600; color: var(--ink-2); }
.pra-neg-save-btn {
  padding: 7px 14px;
  border-radius: 8px;
  border: none;
  background: var(--brand);
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 160ms;
}
.pra-neg-save-btn:hover { opacity: 0.86; }

/* Prix enregistré */
.pra-neg-price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 10px;
}
.pra-neg-price-label { font-size: 0.8125rem; color: var(--ink-3); font-weight: 500; }
.pra-neg-price-value { font-size: 1.0625rem; font-weight: 700; color: var(--brand); font-variant-numeric: tabular-nums; }
.pra-neg-edit-btn {
  margin-left: auto;
  padding: 3px 10px;
  border-radius: 6px;
  border: 1px solid var(--card-border);
  background: transparent;
  color: var(--ink-3);
  font-size: 0.75rem;
  cursor: pointer;
  transition: color 160ms, border-color 160ms;
}
.pra-neg-edit-btn:hover { color: var(--ink); border-color: var(--ink-3); }

/* Bouton Vérifier */
.pra-neg-verify-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1.5px solid var(--brand-border-strong);
  background: transparent;
  color: var(--brand);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 160ms, border-color 160ms;
  margin-bottom: 8px;
}
.pra-neg-verify-btn:hover:not(:disabled) { background: rgba(7,60,191,.07); border-color: var(--brand); }
.pra-neg-verify-btn:disabled { opacity: 0.6; cursor: wait; }
.pra-neg-verify-btn--loading .ti { animation: supplier-refresh-spin 0.8s linear infinite; }
.pra-neg-no-verify { font-size: 0.8rem; color: var(--ink-3); margin: 4px 0 8px; }

/* Résultat vérification */
.pra-neg-result {
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 8px 11px;
  border-radius: 8px;
  margin-top: 2px;
  line-height: 1.45;
}
.pra-neg-result--success { background: var(--good-bg); color: var(--good); }
.pra-neg-result--pending { background: rgba(180,83,9,.07); color: #B45309; }
.pra-neg-result--error   { background: var(--bad-bg);  color: var(--bad); }
.pra-neg-relance-btn { margin-top: 9px; }

@keyframes pra-shake {
  0%,100% { transform: translateX(0); }
  25%      { transform: translateX(-4px); }
  75%      { transform: translateX(4px); }
}

/* ── PRA Guided UX — Prompt 3 (parcours guidé piloté par le statut) ── */

/* En-tête commun */
.pra-guided-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px 8px;
}
.pra-guided-header-left { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.pra-guided-name { font-size: 0.9375rem; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pra-guided-meta { font-size: 0.775rem; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pra-guided-header-right { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; flex-shrink: 0; }

/* Prix avant → après */
.pra-guided-prices { display: flex; align-items: baseline; gap: 4px; }
.pra-guided-price-old { font-size: 0.8125rem; color: var(--ink-3); text-decoration: line-through; font-variant-numeric: tabular-nums; }
.pra-guided-price-arrow { font-size: 0.75rem; color: var(--ink-3); }
.pra-guided-price-new { font-size: 0.9375rem; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.pra-guided-price-chip { font-size: 0.75rem !important; padding: 2px 6px !important; }

/* Badge de statut (En attente commercial) */
.pra-status-badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: var(--radius-pill); font-size: 0.75rem; font-weight: 600; }
.pra-status-badge--pending { background: rgba(180,83,9,.09); color: #B45309; border: 1px solid rgba(180,83,9,.2); }
.pra-status-badge--pending .ti { animation: supplier-refresh-spin 1.6s linear infinite; }

/* Chips d'info (ligne sous l'en-tête) */
.pra-guided-chips { display: flex; flex-wrap: wrap; gap: 5px; padding: 0 14px 10px; }

/* Menu ⋯ */
.pra-dot-menu { position: relative; }
.pra-dot-trigger {
  padding: 4px 6px;
  border-radius: 7px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-3);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  transition: background 130ms, color 130ms;
}
.pra-dot-trigger:hover { background: var(--neutral-bg); color: var(--ink); }
.pra-dot-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 30;
  min-width: 196px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 11px;
  box-shadow: 0 8px 24px rgba(5,16,64,.13);
  padding: 5px 0;
}
.pra-dot-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 14px;
  background: transparent;
  border: none;
  color: var(--ink);
  font-size: 0.875rem;
  cursor: pointer;
  text-align: left;
  transition: background 110ms;
}
.pra-dot-item:hover { background: var(--neutral-bg); }
.pra-dot-item[data-current="true"] { font-weight: 700; color: var(--brand); }
.pra-dot-item--flag { color: var(--bad); }
.pra-dot-item--flag:hover { background: var(--bad-bg); }
.pra-dot-divider { margin: 4px 0; border: none; border-top: 1px solid var(--card-border); }

/* Carte de décision (état À traiter) */
.pra-decision-card {
  margin: 2px 14px 14px;
  padding: 16px;
  background: var(--neutral-bg);
  border-radius: var(--radius-row);
  border: 1px solid var(--card-border);
}
.pra-decision-card--good { background: rgba(21,128,61,.04); border-color: rgba(21,128,61,.18); }
.pra-decision-question { margin: 0 0 5px; font-size: 0.9375rem; font-weight: 700; color: var(--ink); }
.pra-decision-sub { margin: 0 0 14px; font-size: 0.8125rem; color: var(--ink-3); line-height: 1.5; }
.pra-decision-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pra-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 9px;
  border: none;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 150ms, transform 110ms;
}
.pra-btn:active { transform: scale(0.975); }
.pra-btn--accept { background: var(--good); color: #fff; }
.pra-btn--accept:hover { opacity: 0.87; }
.pra-btn--contest { background: var(--brand-gradient); color: #fff; }
.pra-btn--contest:hover { opacity: 0.9; }

/* Parcours 3 étapes (état En attente commercial) */
.pra-steps {
  display: flex;
  flex-direction: column;
  margin: 2px 14px 14px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-row);
  overflow: hidden;
}
.pra-step { display: flex; gap: 12px; padding: 14px; align-items: flex-start; background: var(--card); }
.pra-step + .pra-step { border-top: 1px solid var(--card-border); }
.pra-step-badge {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--brand);
  color: #fff;
}
.pra-step--done .pra-step-badge { background: var(--good); }
.pra-step--disabled .pra-step-badge { background: var(--disabled-bg); color: var(--disabled-icon); }
.pra-step--disabled { opacity: 0.52; pointer-events: none; }
.pra-step-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.pra-step-title { margin: 0; font-size: 0.875rem; font-weight: 600; color: var(--ink); padding-top: 2px; }
.pra-step-sub { margin: 0; font-size: 0.8rem; color: var(--ink-3); line-height: 1.45; }
.pra-step-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* Vue clôturée (état Clôturé) */
.pra-cloture-view {
  margin: 2px 14px 14px;
  padding: 14px;
  background: rgba(21,128,61,.04);
  border: 1px solid rgba(21,128,61,.18);
  border-radius: var(--radius-row);
}
.pra-cloture-check-row { display: flex; align-items: flex-start; gap: 10px; }
.pra-cloture-icon { font-size: 1.25rem; color: var(--good); flex-shrink: 0; margin-top: 1px; }
.pra-cloture-text { display: flex; flex-direction: column; gap: 4px; }
.pra-cloture-name { font-size: 0.9375rem; font-weight: 700; color: var(--ink); }
.pra-cloture-chip { font-size: 0.75rem !important; vertical-align: middle; }
.pra-cloture-sub { font-size: 0.8rem; color: var(--ink-3); }
.pra-cloture-recap { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.pra-cloture-confirmed {
  display: inline-flex !important;
  align-items: center;
  gap: 4px;
  color: var(--good);
  border: 1px solid rgba(21,128,61,.25) !important;
  background: rgba(21,128,61,.08) !important;
  font-weight: 600;
}

/* PRA footer — Actualiser les prix + Voir l'historique */
.pra-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 0 2px;
  flex-wrap: wrap;
}
.pra-footer-ts { font-size: 0.775rem; color: var(--ink-3); }
.pra-footer-spacer { flex: 1; }
.pra-footer-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 8px;
  border: 1px solid var(--card-border);
  background: var(--card);
  color: var(--ink-2);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 130ms, color 130ms, border-color 130ms;
  text-decoration: none;
}
.pra-footer-btn:hover:not(:disabled) { background: var(--neutral-bg); color: var(--ink); }
.pra-footer-btn:disabled { opacity: 0.55; cursor: wait; }
.pra-footer-btn--history { color: var(--brand); border-color: var(--brand-border); }
.pra-footer-btn--history:hover { background: var(--brand-bg-subtle); color: var(--brand-deep); }
.pra-footer-btn--reset { color: #B45309; border-color: rgba(180,83,9,.3); }
.pra-footer-btn--reset:hover:not(:disabled) { background: rgba(180,83,9,.07); color: #92400E; }
.pra-footer-btn--demo-off { color: var(--bad); border-color: var(--bad-bg); }
.pra-footer-btn--demo-off:hover:not(:disabled) { background: var(--bad-bg); }

/* Compteur de progression inline dans le bouton "Actualiser les prix" */
.pra-footer-progress-count {
  font-size: 0.74rem;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  color: var(--ink-3);
  margin-left: 5px;
  white-space: nowrap;
}

/* Barre de progression — s'étend sur toute la largeur du footer (flex-basis:100%) */
.pra-footer-progress-track {
  flex-basis: 100%;
  height: 3px;
  background: var(--neutral-bg, #f3f4f6);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 2px;
}
.pra-footer-progress-fill {
  height: 100%;
  background: var(--brand, #2563eb);
  border-radius: 99px;
  transition: width 0.4s ease;
  min-width: 4px;
}

/* Alerte de démonstration */
.pra-row--demo { outline: 2px dashed rgba(124,58,237,.45); outline-offset: -1px; }
.pra-demo-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 7px;
  padding: 1px 6px;
  border-radius: 5px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: .06em;
  background: rgba(124,58,237,.12);
  color: #7C3AED;
  border: 1px solid rgba(124,58,237,.25);
  vertical-align: middle;
  line-height: 1.4;
}

/* Bannière verrou bloqué */
.pra-stale-lock-banner {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 14px;
  background: rgba(180,83,9,.06);
  border: 1px solid rgba(180,83,9,.22);
  border-radius: var(--radius-row);
  flex-wrap: wrap;
  width: 100%;
  box-sizing: border-box;
}
.pra-stale-lock-banner .ti-lock { color: #B45309; font-size: 1rem; flex-shrink: 0; }
.pra-stale-lock-text { flex: 1; font-size: 0.8125rem; color: #92400E; min-width: 0; line-height: 1.4; }

/* ── Responsive ── */
@media (max-width: 900px) {
  /* Tablette / mobile : topband en colonne unique, padding réduit */
  html.ui-premium #dashboard-view {
    padding: 14px 16px;
  }
  html.ui-premium #dashboard-view .dash-topband {
    grid-template-columns: 1fr;
  }
  .dash-kpis-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .supplier-alert-product-name { max-width: 160px; }
  .dashboard-metric-band { gap: 8px; }
  .dashboard-metric-value { font-size: 18px; }
  .supplier-alert-row-line2-actions { flex-wrap: wrap; }
  .dashboard-today-row { padding: 11px 14px; }
}

@media (max-width: 480px) {
  .dash-kpis-grid { grid-template-columns: 1fr; }
  .ca-modal-dialog { border-radius: 12px; }
}

/* ── Bandeau "MODE DÉMO" ───────────────────────────────────────── */
.demo-mode-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 11px 20px;
  background: linear-gradient(90deg, #8B5CF6 0%, #4C1D95 100%);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: .02em;
  box-shadow: 0 -2px 20px rgba(139,92,246,.45);
}
.demo-mode-banner-label { flex: 1; text-align: center; }
.demo-mode-banner-off {
  padding: 5px 14px;
  border-radius: 7px;
  border: 1.5px solid rgba(255,255,255,.55);
  background: transparent;
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.demo-mode-banner-off:hover { background: rgba(255,255,255,.18); }

/* Espace de sécurité en bas de page quand le bandeau flotte au-dessus */
body:has(#demo-mode-banner) .page-shell { padding-bottom: 60px; }

/* ── Signaux visuels mode démo — prix, tags, bordure ── */

/* Prix fictifs en violet */
.demo-price { color: #7C3AED !important; font-weight: 700; }

/* Chip "DÉMO" dans la fiche détail produit et cartes stats */
.mrc-demo-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  margin-left: 6px;
  border-radius: 5px;
  background: rgba(124,58,237,.12);
  color: #7C3AED;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: .04em;
  vertical-align: middle;
  line-height: 1.4;
}

/* Badge "🎭 DONNÉES FICTIVES" dans le bandeau sync mercuriale */
.mrc-sync-demo-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 5px;
  background: rgba(124,58,237,.13);
  color: #7C3AED;
  font-size: 0.72rem;
  font-weight: 700;
  margin-left: 10px;
  letter-spacing: .02em;
}

/* Bordure violette légère autour du bloc mercuriale complet */
body:has(#demo-mode-banner) #purchases-view .mercuriale-panel {
  outline: 2px solid rgba(124,58,237,.28);
  outline-offset: -2px;
}

/* ── Toggle Mode démo dans Paramètres ─────────────────────────── */
.settings-demo-section {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border, rgba(0,0,0,.09));
}
.settings-demo-section-title {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--fg-muted, #888);
  margin: 0 0 12px;
}
.settings-demo-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border, rgba(0,0,0,.09));
  background: var(--surface-2, #fafafa);
}
.settings-demo-info { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.settings-demo-label { font-size: 0.9375rem; font-weight: 600; }
.settings-demo-desc { font-size: 0.8125rem; color: var(--fg-muted, #888); line-height: 1.4; }

/* Toggle switch */
.settings-demo-toggle {
  flex-shrink: 0;
  width: 46px; height: 26px;
  border-radius: 999px;
  border: none;
  background: var(--border, #d1d5db);
  cursor: pointer;
  position: relative;
  transition: background .2s;
}
.settings-demo-toggle::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
  transition: transform .2s;
}
.settings-demo-toggle--on { background: #7C3AED; }
.settings-demo-toggle--on::after { transform: translateX(20px); }

/* Message "Aucun changement" dans le récap de synchro */
.price-summary-no-changes {
  font-size: 0.8rem;
  color: var(--ink-3, #6b7280);
  font-style: italic;
  text-align: center;
  padding: 12px 0 4px;
}

/* ── Mercuriale add – étape validation unité ─────────────────────────── */
.mercuriale-add-validate {
  display: grid;
  gap: 10px;
  padding: 4px 0 6px;
}

.mercuriale-add-validate-name {
  margin: 0;
  font-size: 0.93rem;
  font-weight: 700;
  color: var(--ink, #111827);
}

.mercuriale-add-validate-cond,
.mercuriale-add-validate-unit {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted, #6b7280);
}

.mercuriale-add-validate-hint {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(0, 123, 200, 0.82);
  background: rgba(0, 173, 239, 0.07);
  border-left: 3px solid rgba(0, 123, 200, 0.35);
  padding: 7px 10px;
  border-radius: 0 8px 8px 0;
}

/* ── Mercuriale add – étape récap ────────────────────────────────────── */
.mercuriale-add-recap {
  display: grid;
  gap: 10px;
  padding: 4px 0 6px;
}

.mercuriale-add-recap-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 750;
  width: fit-content;
}

.mercuriale-add-recap-badge::before {
  content: "✓";
  font-weight: 900;
}

.mercuriale-add-recap-badge-success {
  background: rgba(22, 163, 74, 0.1);
  color: var(--success, #16a34a);
  border: 1px solid rgba(22, 163, 74, 0.22);
}

.mercuriale-add-recap-name {
  margin: 0;
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--ink, #111827);
}

.mercuriale-add-recap-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 5px 14px;
  margin: 0;
}

.mercuriale-add-recap-grid dt {
  font-size: 0.77rem;
  font-weight: 600;
  color: var(--muted, #6b7280);
  align-self: center;
}

.mercuriale-add-recap-grid dd {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink, #111827);
  align-self: center;
}

/* -------------------------------------------------------------------------- */
/* Menu ⋯ mercuriale — overflow + stacking context fix                        */
/* 1. overflow:hidden sur .mrc-detail clippait le panel position:absolute.    */
/*    .mrc-detail-hero n'a pas de background propre → overflow:visible safe.  */
/* 2. La carte suivante peint par-dessus (DOM order) même avec z-index élevé  */
/*    si aucun ancêtre ne crée de stacking context. On isole le shell ouvert  */
/*    avec position:relative + z-index:10 → il peint au-dessus de ses frères. */
/* -------------------------------------------------------------------------- */
.mrc-detail {
  overflow: visible;
  position: relative;
}

.mrc-demo-tag--corner {
  float: right;
  clear: right;
  margin: 0 0 4px 8px;
}

.mercuriale-row-shell[data-expanded="true"] {
  position: relative;
  z-index: 10;
}

html.ui-premium .mercuriale-row-menu-panel {
  z-index: 999;
}

/* ========================================================================= */
/* Parcours guidé "Ajouter un produit" — rail 3 étapes + layout               */
/* ========================================================================= */

/* ── Rail de progression ─────────────────────────────────────────────────── */
.madd-rail {
  display: flex;
  align-items: flex-start;
  gap: 0;
  padding: 4px 0 20px;
}

.madd-rail-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
  position: relative;
}

/* Ligne de liaison entre les cercles */
.madd-rail-step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 14px;
  left: calc(50% + 16px);
  right: calc(-50% + 16px);
  height: 2px;
  background: #e2e8f0;
  border-radius: 1px;
  z-index: 0;
}

/* Segment vert uniquement après une étape validée */
.madd-rail-step[data-done="true"]:not(:last-child)::after {
  background: linear-gradient(90deg, #16a34a, #15803d);
}

/* Cercle */
.madd-rail-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid #e2e8f0;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.74rem;
  font-weight: 800;
  color: #94a3b8;
  position: relative;
  z-index: 1;
  transition: border-color 200ms, background 200ms, color 200ms, box-shadow 200ms;
}

/* Étape active : dégradé bleu, chiffre blanc */
.madd-rail-step[data-active="true"] .madd-rail-dot {
  background: linear-gradient(135deg, #073CBF 0%, #051040 100%);
  border-color: #073CBF;
  color: #fff;
  box-shadow: 0 0 0 4px rgba(7, 60, 191, 0.14);
}

/* Étape validée : fond vert, ✓ vert foncé — label + couleur (daltonien) */
.madd-rail-step[data-done="true"] .madd-rail-dot {
  background: #dcfce7;
  border-color: #16a34a;
  color: #15803d;
  font-size: 0.88rem;
}

/* Label sous le cercle */
.madd-rail-label {
  font-size: 0.66rem;
  font-weight: 700;
  color: #94a3b8;
  white-space: nowrap;
  letter-spacing: 0.03em;
  transition: color 200ms;
}

.madd-rail-step[data-active="true"] .madd-rail-label {
  color: #073CBF;
}

.madd-rail-step[data-done="true"] .madd-rail-label {
  color: #15803d;
}

/* ── Corps de chaque étape ───────────────────────────────────────────────── */
.madd-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Champ label + input */
.madd-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Labels style premium : petites caps espacées, gris-bleu doux */
.madd-field-label {
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #64748b;
}

.madd-field-hint {
  font-size: 0.72rem;
  color: #9ca3af;
  margin-top: 1px;
  line-height: 1.4;
}

/* Inputs et selects */
.madd-input,
.madd-select {
  width: 100%;
  padding: 10px 13px;
  border: 1.5px solid #e2e8f0;
  border-radius: 11px;
  font-size: 0.84rem;
  color: #111827;
  background: #fff;
  outline: none;
  transition: border-color 150ms, box-shadow 150ms;
  appearance: none;
  -webkit-appearance: none;
  box-sizing: border-box;
}

.madd-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  padding-right: 34px;
  cursor: pointer;
}

.madd-input:focus,
.madd-select:focus {
  border-color: #073CBF;
  box-shadow: 0 0 0 3px rgba(7, 60, 191, 0.1);
}

.madd-input::placeholder {
  color: #b0bac6;
}

/* Rangée 2 champs côte-à-côte */
.madd-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* ── Encart prix interne calculé ─────────────────────────────────────────── */
.madd-price-preview {
  padding: 14px 16px;
  border-radius: 12px;
  background: #f0fdf4;
  border: 1.5px solid #86efac;
  font-size: 0.9rem;
  color: #15803d;
  font-weight: 700;
  line-height: 1.4;
}

.madd-price-preview--neutral {
  background: rgba(148, 163, 184, 0.08);
  border-color: rgba(148, 163, 184, 0.25);
  color: #64748b;
  font-size: 0.8rem;
  font-weight: 400;
}

/* ── Encart saisie unité manuelle ────────────────────────────────────────── */
.madd-unit-box {
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(7, 60, 191, 0.03);
  border: 1.5px solid rgba(7, 60, 191, 0.14);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.madd-unit-box-title {
  font-size: 0.7rem;
  font-weight: 800;
  color: #073CBF;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ── Destination classement ──────────────────────────────────────────────── */
.madd-destination {
  padding: 11px 15px;
  border-radius: 10px;
  background: rgba(7, 60, 191, 0.04);
  border: 1px solid rgba(7, 60, 191, 0.12);
  font-size: 0.8rem;
  color: #374151;
  line-height: 1.5;
}

.madd-destination strong {
  color: #073CBF;
  font-weight: 700;
}

/* ── Récap final ─────────────────────────────────────────────────────────── */
.madd-recap-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: 22px;
  background: #dcfce7;
  border: 1.5px solid #86efac;
  color: #15803d;
  font-size: 0.8rem;
  font-weight: 800;
  margin-bottom: 16px;
  letter-spacing: 0.01em;
}

.madd-recap-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 9px 18px;
  margin: 0;
}

.madd-recap-grid dt {
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #94a3b8;
  align-self: center;
}

.madd-recap-grid dd {
  margin: 0;
  font-size: 0.84rem;
  font-weight: 700;
  color: #111827;
  align-self: center;
}

/* ── Footer boutons ──────────────────────────────────────────────────────── */
.madd-footer {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 6px;
  padding-top: 18px;
  border-top: 1px solid #f1f5f9;
}

.madd-btn-ghost,
.madd-btn-primary,
.madd-btn-success {
  padding: 10px 22px;
  border-radius: 11px;
  font-size: 0.83rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 120ms, transform 80ms, box-shadow 120ms;
  border: none;
}

.madd-btn-ghost:active,
.madd-btn-primary:active,
.madd-btn-success:active { transform: scale(0.97); }

.madd-btn-ghost {
  background: #fff;
  border: 1.5px solid #e2e8f0;
  color: #475569;
}

.madd-btn-ghost:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.madd-btn-primary {
  background: linear-gradient(135deg, #073CBF 0%, #051040 100%);
  color: #fff;
  box-shadow: 0 2px 10px rgba(7, 60, 191, 0.28);
}

.madd-btn-primary:hover { opacity: 0.92; }
.madd-btn-primary:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.madd-btn-success {
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
  color: #fff;
  box-shadow: 0 2px 10px rgba(22, 163, 74, 0.28);
}

.madd-btn-success:hover { opacity: 0.92; }

/* ── Création de catégorie inline (step 3) ───────────────────────────────── */
.madd-create-link {
  display: inline-block;
  margin-top: 6px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.74rem;
  font-weight: 700;
  color: #073CBF;
  letter-spacing: 0.02em;
  text-decoration: none;
  opacity: 0.85;
  transition: opacity 120ms;
}
.madd-create-link:hover { opacity: 1; text-decoration: underline; }

.madd-cancel-link {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.74rem;
  font-weight: 600;
  color: #94a3b8;
  padding: 0;
  margin-left: 10px;
  transition: color 120ms;
}
.madd-cancel-link:hover { color: #64748b; }

.madd-new-category-wrap {
  display: flex;
  align-items: center;
  gap: 0;
  margin-top: 8px;
}
.madd-new-category-wrap .madd-input {
  flex: 1;
}

/* ═══════════════════════════════════════════════════════════════════════════
   MERCURIALE — Refonte header "classeur" (bandeau sombre + onglets)
   ═══════════════════════════════════════════════════════════════════════════ */

/* Supprime le padding du card-parent : le bandeau prend toute la largeur */
html.ui-premium .mrc-header {
  padding: 0;
}

/* ── Bandeau sombre ────────────────────────────────────────────────────── */
.mrc-banner {
  background:
    radial-gradient(ellipse at 85% 0%, rgba(7, 60, 191, 0.5) 0%, transparent 55%),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 22px,
      rgba(255, 255, 255, 0.035) 22px,
      rgba(255, 255, 255, 0.035) 23px
    ),
    #051040;
  padding: 22px 22px 0;
}

.mrc-banner-body {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
}

.mrc-banner-left {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.mrc-banner-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Eyebrow */
.mrc-eyebrow {
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: #A9BAEE;
}

/* Titre et sous-titre sur fond sombre */
.mrc-banner .mrc-title {
  color: #ffffff;
}

.mrc-banner .mrc-subtitle {
  color: #A9BAEE;
  white-space: nowrap;
}

/* ── Badge "Prix à jour" ───────────────────────────────────────────────── */
.mrc-sync-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 20px;
  font-size: 0.71rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.72);
  white-space: nowrap;
}

.mrc-sync-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  flex-shrink: 0;
  box-shadow: 0 0 7px rgba(74, 222, 128, 0.65);
}

/* Admin tabs (Produits / Catégories) — version glassy sur fond sombre */
.mrc-banner .mrc-tabs.mercuriale-admin-tabs {
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.mrc-banner .mrc-tabs .mercuriale-admin-tab {
  color: rgba(255, 255, 255, 0.55);
}

.mrc-banner .mrc-tabs .mercuriale-admin-tab[data-active="true"] {
  background: rgba(255, 255, 255, 0.20);
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.mrc-banner .mrc-tabs .mercuriale-admin-tab:hover:not([data-active="true"]) {
  color: rgba(255, 255, 255, 0.85);
}

/* Bouton reset — glassy sur fond sombre */
.mrc-banner .mrc-reset-btn {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.65);
}

.mrc-banner .mrc-reset-btn:hover {
  background: rgba(239, 68, 68, 0.28);
  border-color: rgba(239, 68, 68, 0.5);
  color: #fca5a5;
}

/* ── Onglets fournisseurs (classeur) ───────────────────────────────────── */
.mrc-classeur-row {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  padding: 0 22px;
  overflow-x: auto;
  scrollbar-width: none;
}

.mrc-classeur-row::-webkit-scrollbar { display: none; }

.mrc-classeur-tabs-host {
  display: flex;
  align-items: flex-end;
  gap: 3px;
}

.mrc-classeur-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-bottom: none;
  border-radius: 10px 10px 0 0;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.83rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.mrc-classeur-tab:hover:not([data-active="true"]) {
  background: rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.88);
}

.mrc-classeur-tab[data-active="true"] {
  background: #ffffff;
  color: #0f172a;
  border-color: #e8edf4;
  border-bottom-color: #ffffff;
  font-weight: 700;
  position: relative;
  top: 1px;
}

.mrc-classeur-tab-name { /* héritage du parent */ }

.mrc-classeur-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  padding: 1px 6px;
  height: 18px;
  border-radius: 9px;
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.65);
  transition: background 0.15s, color 0.15s;
}

.mrc-classeur-tab[data-active="true"] .mrc-classeur-tab-count {
  background: rgba(7, 60, 191, 0.10);
  color: #073CBF;
}

/* ── Section blanche (stats + toolbar) ────────────────────────────────── */
.mrc-body {
  background: #ffffff;
  padding: 18px 22px 0;
  border-top: 1px solid #e8edf4;
}

/* Les stats sont déjà séparées du toolbar par leur padding-bottom */
.mrc-body .mrc-stats {
  padding-bottom: 18px;
}

/* ── Cartes stats — polish (coins 16px, ombre douce) ──────────────────── */
html.ui-premium .mrc-stat-card {
  border-radius: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,.04), 0 6px 18px rgba(0,0,0,.06);
}

/* SVG dans l'icône stat */
.mrc-stat-icon {
  font-size: 0;  /* masque tout texte résiduel */
}

.mrc-stat-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

/* ── Actions toolbar — hiérarchie ──────────────────────────────────────── */

/* "Ajouter un produit" = bouton principal bleu dégradé */
html.ui-premium .mrc-btn.mrc-btn-accent {
  background: linear-gradient(135deg, #073CBF 0%, #051040 100%);
  color: #fff;
  border: none;
  box-shadow: 0 2px 10px rgba(7, 60, 191, 0.30);
}

html.ui-premium .mrc-btn.mrc-btn-accent:hover {
  opacity: 0.9;
}

/* "Importer catalogue" = lien secondaire discret */
.mrc-import-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 6px;
  height: 36px;
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 0.77rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s;
  white-space: nowrap;
  text-decoration: none;
  border-radius: 8px;
}

.mrc-import-link:hover {
  color: #073CBF;
  background: rgba(7, 60, 191, 0.05);
}

.mrc-import-link svg {
  opacity: 0.6;
  flex-shrink: 0;
}

/* Dropdown sous-catégorie désactivé — état clair */
.purchase-filter-select-sub:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════════════════════
   MERCURIALE — Ajustements toolbar v2 + menu ⋯ + modale PIN
   ═══════════════════════════════════════════════════════════════════════════ */

/* 1. Titre Mercuriale : passe en sans-serif (même famille que les autres titres UI) */
.mrc-banner .mrc-title {
  font-family: var(--ds-font-sans);
  letter-spacing: -0.03em;
}

/* Dropdowns famille/sous-cat masqués — override le display:flex de styles.css */
.mrc-filters[hidden] { display: none !important; }

/* Barre de recherche — prend tout l'espace disponible une fois les filtres cachés */
.mrc-body .mrc-toolbar .mrc-search {
  flex: 1 1 auto;
  min-width: 0;
}

/* ── Menu ⋯ ────────────────────────────────────────────────────────────── */
.mrc-overflow-wrap {
  position: relative;
  flex-shrink: 0;
}

.mrc-more-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1.5px solid #e2e8f0;
  background: #fff;
  color: #64748b;
  cursor: pointer;
  transition: background 120ms, border-color 120ms, color 120ms;
  flex-shrink: 0;
}

.mrc-more-btn:hover,
.mrc-more-btn[aria-expanded="true"] {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #0f172a;
}

.mrc-more-menu {
  position: fixed;
  z-index: 9100;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.13), 0 1px 4px rgba(0, 0, 0, 0.07);
  min-width: 228px;
  padding: 6px;
  overflow: hidden;
}

.mrc-more-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 12px;
  background: none;
  border: none;
  border-radius: 8px;
  font-size: 0.83rem;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  text-align: left;
  transition: background 100ms, color 100ms;
  white-space: nowrap;
  font-family: inherit;
}

.mrc-more-item:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.mrc-more-item--danger {
  color: #dc2626;
}

.mrc-more-item--danger:hover {
  background: #fef2f2;
  color: #b91c1c;
}

.mrc-more-separator {
  height: 1px;
  background: #f1f5f9;
  margin: 4px 6px;
}

/* ── Modale de confirmation PIN ────────────────────────────────────────── */
.mrc-pin-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(5, 16, 64, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  transition: opacity 200ms ease;
}

.mrc-pin-modal-overlay[data-active="true"] {
  opacity: 1;
}

.mrc-pin-modal {
  background: #fff;
  border-radius: 20px;
  padding: 28px 24px 22px;
  max-width: 390px;
  width: 100%;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.10);
  display: flex;
  flex-direction: column;
  gap: 16px;
  transform: translateY(14px) scale(0.97);
  transition: transform 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

.mrc-pin-modal-overlay[data-active="true"] .mrc-pin-modal {
  transform: translateY(0) scale(1);
}

.mrc-pin-modal-warn {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: #fff7ed;
  border: 1.5px solid #fed7aa;
  border-radius: 12px;
}

.mrc-pin-modal-warn-icon {
  color: #ea580c;
  flex-shrink: 0;
  margin-top: 2px;
}

.mrc-pin-modal-title {
  font-size: 0.98rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
  margin: 0 0 5px;
  line-height: 1.2;
}

.mrc-pin-modal-body {
  font-size: 0.81rem;
  color: #64748b;
  line-height: 1.55;
  margin: 0;
}

.mrc-pin-modal-label {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
  display: block;
  margin-bottom: -6px;
}

.mrc-pin-modal-input {
  width: 100%;
  height: 48px;
  border: 1.5px solid #e2e8f0;
  border-radius: 11px;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.5em;
  text-align: center;
  color: #0f172a;
  padding: 0 12px;
  box-sizing: border-box;
  transition: border-color 150ms, box-shadow 150ms;
  outline: none;
  font-family: ui-monospace, "SF Mono", "Courier New", monospace;
}

.mrc-pin-modal-input:focus {
  border-color: #073CBF;
  box-shadow: 0 0 0 3px rgba(7, 60, 191, 0.12);
}

.mrc-pin-modal-input.error {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
  animation: mrc-pin-shake 0.35s ease;
}

@keyframes mrc-pin-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

.mrc-pin-modal-error {
  font-size: 0.78rem;
  color: #ef4444;
  font-weight: 600;
  margin: -6px 0 0;
  display: flex;
  align-items: center;
  gap: 5px;
}

.mrc-pin-modal-footer {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding-top: 2px;
  border-top: 1px solid #f1f5f9;
}

.mrc-pin-cancel-btn {
  padding: 9px 18px;
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  font-size: 0.83rem;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: background 120ms, border-color 120ms;
  font-family: inherit;
}

.mrc-pin-cancel-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.mrc-pin-confirm-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  background: #dc2626;
  border: none;
  border-radius: 10px;
  font-size: 0.83rem;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  transition: opacity 120ms, background 120ms;
  font-family: inherit;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.28);
}

.mrc-pin-confirm-btn:hover { background: #b91c1c; }
.mrc-pin-confirm-btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ══════════════════════════════════════════════════════════════════════
   REFONTE NAV PLATE (2026-07-04) — Étape 1 : layout CSS
   ══════════════════════════════════════════════════════════════════════ */

/* Sidebar restaurant — disparaît définitivement */
#restaurant-sidebar,
.rs-sidebar {
  display: none !important;
}

/* En-tête "Restaurant" dans le contenu — doublon avec la nav plate */
.restaurant-view-header {
  display: none !important;
}

/* Layout — une seule colonne (contenu pleine largeur).
   Doit matcher les sélecteurs de design-system.css (même spécificité,
   mais dashboard.css est chargé après → cascade gagne). */
html.ui-premium .app-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}
html.ui-premium body.has-rest-sidebar .app-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

/* Nav cluster — centrée entre logo et avatar (design-system.css a déjà center, on retire l'ancien override flex-start) */

/* ── Onglets plats (utilisés dès l'étape JS) ────────────────────────── */
html.ui-premium .flat-nav-tab {
  position: relative;
  padding: 0 6px;
  height: 64px;           /* aligné sur la hauteur topbar */
  display: inline-flex;
  align-items: center;
  background: none;
  border: none;
  border-radius: 0;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ds-text-muted, #64748b);
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: color 120ms;
  outline: none;
}
html.ui-premium .flat-nav-tab:hover {
  color: var(--ds-text, #0f172a);
}
html.ui-premium .flat-nav-tab:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: -2px;
  border-radius: 4px;
}
html.ui-premium .flat-nav-tab[data-active="true"] {
  color: var(--ds-text, #0f172a);
  font-weight: 700;
}
html.ui-premium .flat-nav-tab[data-active="true"]::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--brand, #073CBF);
  border-radius: 2px 2px 0 0;
}

/* Conteneur des onglets plats — gap généreux */
html.ui-premium .flat-nav-list {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
html.ui-premium .flat-nav-list::-webkit-scrollbar { display: none; }

/* Chrome sticky (breadcrumb "← Retour") — supprimé, navigation plate suffit */
html.ui-premium #restaurant-margins-sticky-chrome {
  display: none !important;
}


/* ── Panneau recherche produit (product-add-panel.js) ───────────────────── */

.pap-panel {
  width: min(100%, 580px);
  padding: 0;
  gap: 0;
  overflow: hidden;
}

.pap-head {
  background: linear-gradient(135deg, #073CBF, #051040);
  padding: 18px 20px;
  border-radius: inherit;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.pap-head .mercuriale-add-panel-title {
  color: #ffffff;
  font-size: 1rem;
}

.pap-close {
  background: rgba(255,255,255,0.12) !important;
  border-color: rgba(255,255,255,0.18) !important;
  color: rgba(255,255,255,0.85) !important;
}
.pap-close:hover {
  background: rgba(255,255,255,0.22) !important;
  color: #ffffff !important;
}

.pap-search-wrap {
  padding: 14px 18px 10px;
  background: #f4f7fc;
  border-bottom: 1px solid rgba(7,60,191,0.08);
}

.pap-search-input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid rgba(7,60,191,0.15);
  border-radius: 10px;
  background: #ffffff;
  font-size: 0.93rem;
  color: var(--ink, #0f172a);
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease;
  box-sizing: border-box;
}
.pap-search-input:focus {
  border-color: #073CBF;
  box-shadow: 0 0 0 3px rgba(7,60,191,0.10);
}

.pap-results {
  max-height: 55vh;
  overflow-y: auto;
  padding: 10px 18px;
  display: grid;
  gap: 10px;
}

.pap-hint {
  margin: 16px 0;
  font-size: 0.82rem;
  color: var(--muted, #64748b);
  text-align: center;
}

.pap-product-card {
  border: 1px solid rgba(7,60,191,0.08);
  border-radius: 12px;
  padding: 12px 14px;
  background: #fafcff;
  display: grid;
  gap: 8px;
}

.pap-product-name {
  font-size: 0.88rem;
  font-weight: 650;
  color: var(--ink, #0f172a);
  letter-spacing: -0.01em;
}

.pap-product-cat {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pap-no-price {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted, #64748b);
  font-style: italic;
}

.pap-supp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
}

.pap-supp-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 10px 12px;
  border: 1.5px solid rgba(7,60,191,0.10);
  border-radius: 16px;
  background: #ffffff;
  cursor: pointer;
  text-align: left;
  transition: border-color 130ms ease, box-shadow 130ms ease, background 130ms ease;
}
.pap-supp-card:hover {
  border-color: #073CBF;
  box-shadow: 0 2px 8px rgba(7,60,191,0.12);
}

.pap-supp-card--reco {
  background: #e4f7ef;
  border-color: #22c55e;
}
.pap-supp-card--reco:hover {
  border-color: #16a34a;
  box-shadow: 0 2px 8px rgba(22,163,74,0.15);
}

.pap-reco-badge {
  font-size: 0.62rem;
  font-weight: 700;
  color: #166534;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.pap-supp-label {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--ink, #0f172a);
}

.pap-supp-price {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink, #0f172a);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.pap-supp-price--missing {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted, #64748b);
  font-style: italic;
}

.pap-supp-norm {
  font-size: 0.68rem;
  color: var(--muted, #64748b);
}

.pap-footer {
  padding: 10px 18px 14px;
  border-top: 1px solid rgba(7,60,191,0.06);
  background: #fafcff;
  text-align: center;
}

.pap-create-link {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.78rem;
  color: var(--muted, #64748b);
  transition: color 120ms;
  padding: 4px 8px;
}
.pap-create-link:hover { color: #073CBF; text-decoration: underline; }

.pap-coming-soon {
  display: block;
  margin-top: 6px;
  padding: 6px 12px;
  background: linear-gradient(135deg, #f0f4ff, #e8eeff);
  border: 1px solid rgba(7, 60, 191, 0.15);
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #073CBF;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 200ms ease, transform 200ms ease;
  pointer-events: none;
}
.pap-coming-soon[data-visible="true"] {
  opacity: 1;
  transform: translateY(0);
}
.pap-coming-soon[data-visible="false"] {
  opacity: 0;
  transform: translateY(-4px);
}

/* ── Étape quantité (product-add-panel.js) ─────────────────────────────── */

/* Header avec bouton retour */
.pap-head--qty {
  justify-content: space-between;
}

.pap-back-btn {
  background: rgba(255, 255, 255, .14);
  border: none;
  border-radius: 999px;
  color: rgba(255, 255, 255, .9);
  font: inherit;
  font-size: .78rem;
  font-weight: 700;
  padding: 6px 12px;
  cursor: pointer;
  transition: background .12s;
  white-space: nowrap;
  flex-shrink: 0;
}
.pap-back-btn:hover { background: rgba(255, 255, 255, .24); }

/* Body de l'étape quantité */
.pap-qty-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Récap produit + fournisseur */
.pap-qty-recap {
  background: #eef2fa;
  border-radius: 12px;
  padding: 12px 14px;
  display: grid;
  gap: 3px;
}

.pap-qty-recap-name {
  font-size: .93rem;
  font-weight: 750;
  color: #0f172a;
  letter-spacing: -.01em;
}

.pap-qty-recap-meta {
  font-size: .75rem;
  font-weight: 600;
  color: #64748b;
}

.pap-qty-recap-price {
  font-size: .82rem;
  font-weight: 700;
  color: #0f172a;
  margin-top: 4px;
}
.pap-qty-recap-price--missing { color: #dc2626; }

.pap-qty-recap-norm {
  font-size: .74rem;
  font-weight: 600;
  color: #073CBF;
}

/* Label champ quantité */
.pap-qty-lab {
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: -6px;
}

/* Ligne quantité + unité */
.pap-qty-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.pap-qty-input {
  flex: 1;
  background: #ffffff;
  border: 1.5px solid #dde5f4;
  border-radius: 12px;
  padding: 13px 14px;
  font: inherit;
  font-size: 1.1rem;
  font-weight: 700;
  color: #0f172a;
  text-align: center;
  transition: border-color .14s, box-shadow .14s;
  box-sizing: border-box;
}
.pap-qty-input:focus {
  outline: none;
  border-color: #073CBF;
  box-shadow: 0 0 0 3px rgba(7, 60, 191, .10);
}

.pap-qty-select {
  background: #ffffff;
  border: 1.5px solid #dde5f4;
  border-radius: 12px;
  padding: 0 10px;
  font: inherit;
  font-size: .9rem;
  font-weight: 700;
  color: #0f172a;
  cursor: pointer;
  min-width: 72px;
  transition: border-color .14s;
}
.pap-qty-select:focus {
  outline: none;
  border-color: #073CBF;
}

/* Bouton CTA */
.pap-qty-add-btn {
  width: 100%;
  background: linear-gradient(135deg, #073CBF, #051040);
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 14px;
  font: inherit;
  font-size: .93rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(7, 60, 191, .28);
  transition: box-shadow .12s, transform .12s;
  box-sizing: border-box;
}
.pap-qty-add-btn:hover {
  box-shadow: 0 8px 24px rgba(7, 60, 191, .40);
  transform: translateY(-1px);
}
