/* ============================================================
   L'App du Coq — CSS complet fidèle au template React
   Traduit depuis src/index.css (Tailwind design tokens)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700;800&family=Source+Sans+3:wght@300;400;500;600;700&display=swap');

/* ---- CSS Variables (design tokens du template) ---- */
:root {
  --background: hsl(40, 33%, 96%);
  --foreground: hsl(230, 52%, 24%);
  --card: hsl(0, 0%, 100%);
  --card-foreground: hsl(230, 52%, 24%);
  --primary: hsl(230, 52%, 24%);
  --primary-foreground: hsl(40, 33%, 96%);
  --secondary: hsl(40, 20%, 92%);
  --secondary-foreground: hsl(230, 52%, 24%);
  --muted: hsl(40, 15%, 90%);
  --muted-foreground: hsl(230, 20%, 46%);
  --accent: hsl(8, 55%, 49%);
  --accent-foreground: hsl(0, 0%, 100%);
  --destructive: hsl(8, 55%, 49%);
  --destructive-foreground: hsl(0, 0%, 100%);
  --border: hsl(230, 20%, 88%);
  --input: hsl(230, 20%, 88%);
  --ring: hsl(230, 52%, 24%);
  --radius: 0.5rem;
  --success: hsl(142, 60%, 40%);
  --success-foreground: hsl(0, 0%, 100%);
  --warning: hsl(38, 92%, 50%);
  --warning-foreground: hsl(0, 0%, 100%);
  --sidebar-bg: hsl(230, 52%, 18%);
  --sidebar-fg: hsl(40, 33%, 96%);
  --sidebar-accent: hsl(230, 52%, 28%);
  --sidebar-accent-fg: hsl(40, 33%, 96%);
  --sidebar-border: hsl(230, 40%, 26%);
  --font-sans: 'Source Sans 3', system-ui, sans-serif;
  --font-serif: 'Playfair Display', serif;
}

/* ---- Reset ---- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-serif);
}

a {
  color: inherit;
  text-decoration: none;
}

/* ============================================================
   LAYOUT — sidebar + main
   ============================================================ */
.depot-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ---- Sidebar ---- */
.depot-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  color: var(--sidebar-fg);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  transition: width 0.2s ease;
  z-index: 100;
}

.depot-sidebar.collapsed {
  width: 52px;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}

.sidebar-logo-img-wrap {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: transparent;
  overflow: visible;
  padding: 0;
  box-sizing: border-box;
}

.sidebar-logo img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center center;
  display: block;
}

.sidebar-logo-text {
  min-width: 0;
}

.sidebar-logo-text p:first-child {
  font-size: 13px;
  font-weight: 700;
  color: var(--sidebar-fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-logo-text p:last-child {
  font-size: 11px;
  color: rgba(249, 245, 236, 0.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-logo-text p:only-child {
  font-size: 13px;
  font-weight: 700;
  color: var(--sidebar-fg);
}

.depot-sidebar.collapsed .sidebar-logo {
  justify-content: center;
  padding: 12px 6px;
}

.depot-sidebar.collapsed .sidebar-logo-text {
  display: none;
}

.sidebar-group {
  padding: 8px 0;
}

.sidebar-group-label {
  padding: 4px 12px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(249, 245, 236, 0.45);
  white-space: nowrap;
  overflow: hidden;
}

.depot-sidebar.collapsed .sidebar-group-label {
  display: none;
}

.sidebar-menu {
  list-style: none;
  padding: 2px 8px;
}

.sidebar-item a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--sidebar-fg);
  transition: background 0.15s;
  white-space: nowrap;
  overflow: hidden;
}

.sidebar-item a:hover {
  background: rgba(255, 255, 255, 0.08);
}

.sidebar-item a.active {
  background: var(--sidebar-accent);
  color: var(--sidebar-accent-fg);
  font-weight: 500;
}

.sidebar-item a svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.sidebar-item-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.depot-sidebar.collapsed .sidebar-item-label {
  display: none;
}

.depot-sidebar.collapsed .sidebar-badge {
  display: none;
}

.sidebar-badge {
  margin-left: auto;
  background: var(--accent);
  color: var(--accent-foreground);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 100px;
  line-height: 1.4;
  flex-shrink: 0;
}

.sidebar-badge-alert {
  background: var(--destructive);
  color: #fff;
  animation: sidebar-badge-pulse 2.2s ease-in-out infinite;
}

@keyframes sidebar-badge-pulse {

  0%,
  100% {
    box-shadow: 0 0 0 0 hsla(8, 55%, 49%, 0.55);
  }

  50% {
    box-shadow: 0 0 0 5px hsla(8, 55%, 49%, 0);
  }
}

/* Sidebar submenu (dépliant) */
.sidebar-submenu {
  list-style: none;
}

.sidebar-submenu-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 10px;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  color: var(--sidebar-fg);
  background: transparent;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
  overflow: hidden;
  text-align: left;
}

.sidebar-submenu-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
}

.sidebar-submenu.has-active > .sidebar-submenu-toggle {
  color: var(--sidebar-accent-fg);
  font-weight: 500;
}

.sidebar-submenu-toggle svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.sidebar-submenu-chevron {
  width: 14px !important;
  height: 14px !important;
  margin-left: auto;
  flex-shrink: 0;
  opacity: 0.6;
  transition: transform 0.2s ease;
}

.sidebar-submenu.is-open > .sidebar-submenu-toggle .sidebar-submenu-chevron {
  transform: rotate(90deg);
}

.sidebar-submenu-items {
  list-style: none;
  padding: 0;
  margin: 0;
  display: none;
}

.sidebar-submenu.is-open > .sidebar-submenu-items {
  display: block;
}

.sidebar-submenu-items .sidebar-item a {
  padding-left: 28px;
  font-size: 12.5px;
  position: relative;
}

.sidebar-submenu-items .sidebar-item a::before {
  content: '';
  position: absolute;
  left: 16px;
  top: 50%;
  width: 4px;
  height: 4px;
  margin-top: -2px;
  border-radius: 50%;
  background: rgba(249, 245, 236, 0.45);
}

.sidebar-submenu-items .sidebar-item a.active::before {
  background: var(--sidebar-accent-fg);
}

.depot-sidebar.collapsed .sidebar-submenu-items {
  display: none !important;
}

.depot-sidebar.collapsed .sidebar-submenu-chevron {
  display: none;
}

/* Sidebar footer */
.sidebar-footer {
  margin-top: auto;
  padding: 12px;
  border-top: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}

.sidebar-logout-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 13px;
  color: rgba(249, 245, 236, 0.85);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.sidebar-logout-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.depot-sidebar.collapsed .sidebar-footer--logout {
  display: none;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--sidebar-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-avatar svg {
  width: 16px;
  height: 16px;
  color: var(--sidebar-accent-fg);
}

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

.sidebar-user-info p:first-child {
  font-size: 13px;
  font-weight: 500;
  color: var(--sidebar-fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-info p:last-child {
  font-size: 11px;
  color: rgba(249, 245, 236, 0.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.depot-sidebar.collapsed .sidebar-user-info {
  display: none;
}

.depot-sidebar.collapsed .sidebar-bell {
  display: none;
}

.sidebar-bell svg {
  width: 16px;
  height: 16px;
  color: var(--accent);
}

/* ---- Main zone ---- */
.depot-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* ---- Header ---- */
.depot-header {
  height: 48px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border);
  background: var(--card);
  padding: 0 16px;
  flex-shrink: 0;
  gap: 12px;
}

.sidebar-trigger {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
}

.sidebar-trigger:hover {
  background: var(--muted);
}

.sidebar-trigger svg {
  width: 16px;
  height: 16px;
  color: var(--foreground);
}

.header-status {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  flex-shrink: 0;
  animation: pulse 2s infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.4;
  }
}

.header-status span {
  font-size: 12px;
  color: var(--muted-foreground);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-status-short {
  display: none;
}

.depot-header-labo-form {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.depot-header-labo-select {
  max-width: 200px;
  min-width: 120px;
}

.depot-header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  min-width: 0;
}

.depot-header-user {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--muted-foreground);
  min-width: 0;
}

.depot-header-user-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

.depot-header-user-role {
  font-size: 10px;
  background: hsla(230, 52%, 24%, 0.12);
  color: var(--primary);
  border: 1px solid var(--primary);
  border-radius: 4px;
  padding: 1px 5px;
  font-weight: 600;
  flex-shrink: 0;
}

.depot-header-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 30px;
  height: 30px;
  padding: 0 10px;
  border-radius: 6px;
  text-decoration: none;
  color: var(--muted-foreground);
  background: var(--card);
  border: 1px solid var(--border);
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  flex-shrink: 0;
  font-size: 12px;
  box-sizing: border-box;
}

.depot-header-icon-btn:hover {
  color: var(--foreground);
  border-color: var(--foreground);
}

.depot-header-icon-btn.is-active {
  color: var(--primary);
  border-color: var(--primary);
  background: hsla(230, 52%, 24%, 0.08);
}

.depot-header-icon-btn--logout:hover {
  color: var(--destructive);
  border-color: var(--destructive);
}

.depot-header-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.depot-header .visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---- Page content ---- */
.depot-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  position: relative;
}

/* ============================================================
   COMPONENTS
   ============================================================ */

/* --- Card --- */
.card {
  background: var(--card);
  color: var(--card-foreground);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.card-header {
  padding: 20px 20px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.card-title {
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 600;
  color: var(--card-foreground);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-description {
  font-size: 13px;
  color: var(--muted-foreground);
}

.card-content {
  padding: 0 20px 20px;
}

.card-content.p-0 {
  padding: 0;
}

.card-content.p-4 {
  padding: 16px;
}

.card-content.p-5 {
  padding: 20px;
}

/* --- Badge --- */
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 100px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}

.badge-xs {
  font-size: 10px;
  padding: 1px 6px;
}

.badge-sm {
  font-size: 10px;
  padding: 2px 6px;
}

.badge-primary {
  background: var(--primary);
  color: var(--primary-foreground);
}

.badge-secondary {
  background: var(--secondary);
  color: var(--secondary-foreground);
}

.badge-destructive,
.badge-accent {
  background: var(--destructive);
  color: var(--destructive-foreground);
}

.badge-success {
  background: var(--success);
  color: var(--success-foreground);
}

.badge-warning {
  background: var(--warning);
  color: var(--warning-foreground);
}

.badge-muted {
  background: var(--muted);
  color: var(--muted-foreground);
}

.badge-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--foreground);
}

.badge-outline-success {
  background: transparent;
  border: 1px solid var(--success);
  color: var(--success);
}

.badge-outline-warning {
  background: transparent;
  border: 1px solid var(--warning);
  color: var(--warning);
}

.badge-outline-destructive {
  background: transparent;
  border: 1px solid var(--destructive);
  color: var(--destructive);
}

.badge-outline-primary {
  background: transparent;
  border: 1px solid var(--primary);
  color: var(--primary);
}

.badge-soft-success {
  background: hsla(142, 60%, 40%, 0.1);
  color: var(--success);
}

.badge-soft-warning {
  background: hsla(38, 92%, 50%, 0.1);
  color: var(--warning);
}

.badge-soft-destructive {
  background: hsla(8, 55%, 49%, 0.1);
  color: var(--destructive);
}

.badge-soft-primary {
  background: hsla(230, 52%, 24%, 0.1);
  color: var(--primary);
}

.badge-soft-muted {
  background: var(--muted);
  color: var(--muted-foreground);
}

/* --- Button --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s, background 0.15s;
  white-space: nowrap;
  font-family: var(--font-sans);
}

.btn:hover {
  opacity: 0.9;
}

.btn:active {
  opacity: 0.8;
}

.btn svg {
  width: 14px;
  height: 14px;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

.btn-sm svg {
  width: 13px;
  height: 13px;
}

.btn-xs {
  padding: 3px 8px;
  font-size: 11px;
}

.btn-xs svg {
  width: 12px;
  height: 12px;
}

.btn-default {
  background: var(--primary);
  color: var(--primary-foreground);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--foreground);
}

.btn-outline:hover {
  background: var(--muted);
}

.btn-ghost {
  background: transparent;
  color: var(--foreground);
}

.btn-ghost:hover {
  background: var(--muted);
}

.btn-destructive {
  background: var(--destructive);
  color: var(--destructive-foreground);
}

.btn-success {
  background: var(--success);
  color: var(--success-foreground);
}

/* --- Table --- */
.table-container {
  overflow-x: auto;
}

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

table.data-table thead tr {
  border-bottom: 1px solid var(--border);
  background: transparent;
}

table.data-table thead th {
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  color: var(--muted-foreground);
  white-space: nowrap;
}

table.data-table thead th.text-right {
  text-align: right;
}

table.data-table thead th.text-center {
  text-align: center;
}

table.data-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}

table.data-table tbody tr:last-child {
  border-bottom: none;
}

table.data-table tbody tr:hover {
  background: var(--muted);
}

table.data-table tbody tr.cursor-pointer {
  cursor: pointer;
}

table.data-table td {
  padding: 10px 12px;
  color: var(--card-foreground);
  vertical-align: middle;
}

table.data-table td.text-right {
  text-align: right;
}

table.data-table td.text-center {
  text-align: center;
}

table.data-table td.font-medium {
  font-weight: 500;
}

table.data-table td.font-bold {
  font-weight: 700;
}

table.data-table td.font-mono {
  font-family: monospace;
}

table.data-table td.text-sm {
  font-size: 12px;
}

table.data-table td.text-xs {
  font-size: 11px;
}

table.data-table td.text-muted {
  color: var(--muted-foreground);
}

table.data-table tbody tr.row-destructive {
  background: hsla(8, 55%, 49%, 0.05);
}

table.data-table tbody tr.row-warning {
  background: hsla(38, 92%, 50%, 0.05);
}

table.data-table tbody tr.row-muted {
  opacity: 0.6;
}

table.data-table tbody tr.row-bold td {
  font-weight: 700;
  background: var(--muted);
}

/* --- KPI "premium" (référentiel MP) ---- */
.mp-kpi {
  margin-bottom: 8px;
}

.kpi-premium {
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 128px;
  border: 1px solid var(--border);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.kpi-premium.is-warning {
  border-color: var(--destructive);
}

.kpi-premium .kpi-head {
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-size: 10.5px;
  color: var(--muted-foreground);
  font-weight: 600;
}

.kpi-premium .kpi-number {
  font-size: 34px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.015em;
  color: var(--foreground);
  margin-top: 2px;
}

.kpi-premium .kpi-sub {
  font-size: 12px;
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.kpi-premium .kpi-sub svg {
  flex-shrink: 0;
}

/* --- Toolbar filtres alignée ---- */
.mp-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.mp-toolbar-search {
  flex: 1 1 320px;
  min-width: 240px;
}

.mp-toolbar .select-wrap {
  min-width: 170px;
}

.mp-toolbar .form-input,
.mp-toolbar .form-select {
  height: 38px;
}

.mp-toolbar .btn {
  height: 38px;
  padding: 0 14px;
  white-space: nowrap;
}

/* --- Table "premium" (référentiel MP) ---- */
table.mp-table {
  --row-h: 56px;
}

table.mp-table tbody tr {
  transition: background 0.15s ease;
}

table.mp-table tbody tr:hover {
  background: var(--muted);
}

table.mp-table tbody td {
  padding-top: 14px;
  padding-bottom: 14px;
  vertical-align: middle;
}

table.mp-table thead th {
  text-transform: uppercase;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--muted-foreground);
  font-weight: 600;
}

/* --- Jauge de niveau de stock ---- */
.mp-gauge {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 140px;
}

.mp-gauge-track {
  position: relative;
  height: 6px;
  background: var(--muted);
  border-radius: 999px;
  overflow: hidden;
}

.mp-gauge-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 999px;
  transition: width 0.25s ease;
}

.mp-gauge-marker {
  position: absolute;
  top: -2px;
  bottom: -2px;
  width: 2px;
  background: var(--foreground);
  opacity: 0.35;
  transform: translateX(-1px);
}

.mp-gauge-label {
  font-size: 10.5px;
  color: var(--muted-foreground);
  letter-spacing: 0.02em;
}

/* --- Progress ---- */
.progress-bar {
  height: 8px;
  background: var(--muted);
  border-radius: 100px;
  overflow: hidden;
}

.progress-bar.h-2 {
  height: 8px;
}

.progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 100px;
  transition: width 0.3s;
}

/* --- Tabs --- */
.tabs-list {
  display: inline-flex;
  background: var(--muted);
  border-radius: var(--radius);
  padding: 4px;
  gap: 2px;
}

.tabs-list.w-full {
  display: flex;
  width: 100%;
}

.tab-btn {
  padding: 5px 12px;
  border-radius: calc(var(--radius) - 2px);
  border: none;
  background: transparent;
  color: var(--muted-foreground);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-sans);
  white-space: nowrap;
}

.tabs-list.w-full .tab-btn {
  flex: 1;
  justify-content: center;
}

.tab-btn:hover {
  color: var(--foreground);
}

.tab-btn.active {
  background: var(--card);
  color: var(--foreground);
  font-weight: 600;
}

.tab-btn svg {
  width: 14px;
  height: 14px;
}

.tab-panel {
  display: none;
  margin-top: 16px;
}

.tab-panel.active {
  display: block;
}

/* --- Input & Select --- */
.form-input,
.form-select,
.form-textarea {
  width: 100%;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--foreground);
  font-size: 13px;
  font-family: var(--font-sans);
  outline: none;
  transition: border-color 0.15s;
}

.form-textarea {
  height: auto;
  padding: 8px 12px;
  resize: vertical;
  min-height: 80px;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--ring);
}

.form-select {
  cursor: pointer;
}

.search-input-wrap {
  position: relative;
}

.search-input-wrap .search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--muted-foreground);
  pointer-events: none;
}

.search-input-wrap input {
  padding-left: 32px;
}

.select-wrap {
  position: relative;
  display: inline-block;
}

.select-wrap select {
  appearance: none;
  padding-right: 28px;
}

.select-wrap::after {
  content: '';
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  border: 4px solid transparent;
  border-top-color: var(--muted-foreground);
  margin-top: 2px;
  pointer-events: none;
}

/* --- Label --- */
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 4px;
  color: var(--foreground);
}

/* --- Checkbox --- */
.form-checkbox {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--primary);
}

/* ============================================================
   LAYOUT UTILITIES
   ============================================================ */
.space-y-4>*+* {
  margin-top: 16px;
}

.space-y-6>*+* {
  margin-top: 24px;
}

.space-y-3>*+* {
  margin-top: 12px;
}

.space-y-2>*+* {
  margin-top: 8px;
}

.flex {
  display: flex;
}

.flex-wrap {
  flex-wrap: wrap;
}

.flex-1 {
  flex: 1;
}

.items-center {
  align-items: center;
}

.items-start {
  align-items: flex-start;
}

.justify-between {
  justify-content: space-between;
}

.justify-center {
  justify-content: center;
}

.gap-2 {
  gap: 8px;
}

.gap-3 {
  gap: 12px;
}

.gap-4 {
  gap: 16px;
}

.gap-6 {
  gap: 24px;
}

.min-w-0 {
  min-width: 0;
}

.flex-shrink-0 {
  flex-shrink: 0;
}

.grid {
  display: grid;
}

.grid-1 {
  grid-template-columns: 1fr;
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 640px) {
  .sm\:grid-2 {
    grid-template-columns: 1fr;
  }

  .sm\:grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 1024px) {
  .lg\:col-span-2 {
    grid-column: span 1;
  }
}

/* Colspan */
.col-span-2 {
  grid-column: span 2;
}

.col-span-3 {
  grid-column: span 3;
}

/* Text utilities */
.text-2xl {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.3;
}

.text-3xl {
  font-size: 30px;
  font-weight: 700;
  font-family: var(--font-sans);
}

.text-xl {
  font-size: 20px;
  font-weight: 600;
}

.text-lg {
  font-size: 16px;
  font-weight: 600;
}

.text-sm {
  font-size: 13px;
}

.text-xs {
  font-size: 11px;
}

.text-base {
  font-size: 14px;
}

.font-bold {
  font-weight: 700;
}

.font-medium {
  font-weight: 500;
}

.font-mono {
  font-family: monospace;
}

.font-sans {
  font-family: var(--font-sans);
}

.text-muted {
  color: var(--muted-foreground);
}

.text-primary {
  color: var(--primary);
}

.text-accent {
  color: var(--accent);
}

.text-success {
  color: var(--success);
}

.text-warning {
  color: var(--warning);
}

.text-destructive {
  color: var(--destructive);
}

.text-right {
  text-align: right;
}

.text-center {
  text-align: center;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Background utilities */
.bg-muted {
  background: var(--muted);
}

.bg-muted-50 {
  background: hsla(40, 15%, 90%, 0.5);
}

.bg-card {
  background: var(--card);
}

.bg-primary {
  background: var(--primary);
}

/* ============================================================
   PAGE HEADER COMPONENT
   ============================================================ */
.page-header {}

.page-header h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--foreground);
}

.page-header p {
  font-size: 13px;
  color: var(--muted-foreground);
  margin-top: 2px;
}

/* KPI grid */
.kpi-grid {
  display: grid;
  gap: 16px;
}

.kpi-grid-5 {
  grid-template-columns: repeat(5, 1fr);
}

.kpi-grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

.kpi-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.kpi-grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

@media (max-width: 1024px) {
  .kpi-grid-5 {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {

  .kpi-grid-5,
  .kpi-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .kpi-grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {

  .kpi-grid-5,
  .kpi-grid-4,
  .kpi-grid-3,
  .kpi-grid-2 {
    grid-template-columns: 1fr;
  }
}

/* KPI card content */
.kpi-card {
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.kpi-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kpi-icon svg {
  width: 20px;
  height: 20px;
}

.kpi-icon.primary {
  background: var(--primary);
  color: var(--primary-foreground);
}

.kpi-icon.success {
  background: var(--success);
  color: var(--success-foreground);
}

.kpi-icon.warning {
  background: var(--warning);
  color: var(--warning-foreground);
}

.kpi-icon.destructive {
  background: var(--destructive);
  color: var(--destructive-foreground);
}

.kpi-icon.soft-primary {
  background: hsla(230, 52%, 24%, 0.1);
  color: var(--primary);
}

.kpi-icon.soft-destructive {
  background: hsla(8, 55%, 49%, 0.1);
  color: var(--destructive);
}

.kpi-icon.soft-success {
  background: hsla(142, 60%, 40%, 0.1);
  color: var(--success);
}

.kpi-icon.soft-warning {
  background: hsla(38, 92%, 50%, 0.1);
  color: var(--warning);
}

.kpi-value {
  font-size: 28px;
  font-weight: 700;
  font-family: var(--font-sans);
  color: var(--foreground);
  line-height: 1;
}

.kpi-label {
  font-size: 12px;
  color: var(--muted-foreground);
  margin-top: 2px;
}

.kpi-delta {
  font-size: 11px;
  font-weight: 500;
  background: var(--muted);
  color: var(--muted-foreground);
  padding: 1px 8px;
  border-radius: 100px;
  margin-left: auto;
}

.kpi-delta-up {
  background: hsla(142, 60%, 40%, 0.12);
  color: var(--success);
}

.kpi-delta-down {
  background: hsla(8, 55%, 49%, 0.12);
  color: var(--destructive);
}

/* Progress bar (taux mapping) */
.kpi-progress-track {
  height: 6px;
  background: var(--muted);
  border-radius: 100px;
  overflow: hidden;
  margin-top: 8px;
}

.kpi-progress-bar {
  height: 100%;
  border-radius: 100px;
  background: var(--success);
  transition: width 0.4s ease;
}

.kpi-progress-bar.warning {
  background: var(--warning);
}

.kpi-progress-bar.danger {
  background: var(--destructive);
}

/* Preset pills (filtres rapides) */
.preset-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.preset-pill {
  font-size: 12px;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 100px;
  border: 1.5px solid var(--border);
  background: var(--background);
  color: var(--foreground);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.preset-pill:hover {
  background: var(--muted);
  border-color: var(--primary);
}

.preset-pill.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

button.preset-pill {
  font-family: inherit;
}

/* Filtres page ventes */
.ventes-filters-body {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.vf-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.vf-section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted-foreground);
}

.vf-period {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
}

.vf-date-range {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.vf-date-field {
  display: flex;
  align-items: center;
  gap: 6px;
}

.vf-date-lbl {
  font-size: 12px;
  color: var(--muted-foreground);
  white-space: nowrap;
}

.vf-date-input {
  font-size: 12px;
  height: 32px;
  width: 148px;
}

.vf-date-sep {
  color: var(--muted-foreground);
  font-size: 13px;
}

.vf-shops {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: stretch;
}

.vf-section-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 4px;
  border-top: 1px solid var(--border);
}

.vf-actions-left,
.vf-actions-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.vf-compare-label {
  font-size: 11px;
  color: var(--muted-foreground);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
}

.vf-compare-select {
  font-size: 12px;
  height: 32px;
  min-width: 190px;
}

.vf-warn {
  color: var(--warning);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Multi-select dropdown (enseigne / corner) */
.ms-wrap {
  position: relative;
  display: inline-block;
}

.ms-wrap-wide {
  flex: 1;
  min-width: 220px;
  max-width: 420px;
}

.ms-wrap-corner {
  max-width: 480px;
}

.ms-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  width: 100%;
  justify-content: space-between;
  font-size: 12px;
  height: 36px;
  text-align: left;
}

.ms-trigger-prefix {
  color: var(--muted-foreground);
  flex-shrink: 0;
  display: flex;
}

.ms-trigger .ms-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ms-trigger .ms-caret {
  font-size: 10px;
  color: var(--muted-foreground);
  flex-shrink: 0;
}

.ms-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 200;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(0, 0, 0, .12);
  min-width: 100%;
  width: max(100%, 280px);
  max-height: 360px;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.ms-panel-wide {
  width: max(100%, 340px);
  max-height: 420px;
}

/* Filtre PDV — vcm-sheet : liste scrollable, footer toujours visible */
#ms-panel-corner .vcm-sheet {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

#ms-panel-corner .vcm-options {
  flex: 1;
  min-height: 0;
}

.ms-panel.open {
  display: flex;
}

.ms-panel-loading {
  opacity: 0.72;
  pointer-events: none;
}

.ms-search-wrap {
  position: relative;
  padding: 8px 10px 6px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.ms-search-wrap .ms-search-ico {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted-foreground);
  pointer-events: none;
}

.ms-search {
  width: 100%;
  font-size: 12px;
  height: 32px;
  padding: 0 10px 0 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--background);
  color: var(--foreground);
}

.ms-search:focus {
  outline: none;
  border-color: var(--primary);
}

.ms-options {
  overflow-y: auto;
  flex: 1;
  padding: 4px 0;
}

.ms-group-label {
  padding: 8px 14px 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-foreground);
  position: sticky;
  top: 0;
  background: var(--card);
  z-index: 1;
}

.ms-option {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 7px 14px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.1s;
}

.ms-option-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.ms-option-name {
  font-weight: 500;
  line-height: 1.3;
}

.ms-option-sub {
  font-size: 10px;
  color: var(--muted-foreground);
  line-height: 1.2;
}

.ms-footer {
  flex-shrink: 0;
  z-index: 1;
  padding: 8px 10px;
  border-top: 1px solid var(--border);
  background: var(--card);
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.ms-foot-btn {
  height: 28px;
  font-size: 11px;
  padding: 0 10px;
}

.ms-apply-btn {
  height: 28px;
  font-size: 11px;
  padding: 0 12px;
  margin-left: auto;
}

.ms-option:hover {
  background: var(--muted);
}

.ms-option input[type=checkbox] {
  accent-color: var(--primary);
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  margin-top: 2px;
}

.ms-option .ms-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 4px;
}

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

/* Page ventes — compléments */
.ventes-page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 8px;
}

.ventes-header-sub {
  margin-top: 4px;
}

.ventes-comp-badge {
  font-size: 11px;
  align-self: center;
}

.ventes-freshness {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 14px;
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 12px;
}

.ventes-freshness-warn {
  border-color: hsla(38, 92%, 50%, 0.45);
  background: hsla(38, 92%, 50%, 0.06);
}

.ventes-freshness-main,
.ventes-freshness-alert {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.ventes-freshness-alert {
  color: var(--warning);
}

.ventes-freshness-toggle {
  border: none;
  background: transparent;
  color: var(--primary);
  font-size: 11px;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.ventes-silent-list {
  font-size: 11px;
  color: var(--muted-foreground);
  line-height: 1.5;
}

.vf-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.vf-chips-label {
  font-size: 11px;
  color: var(--muted-foreground);
}

.vf-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 100px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--foreground);
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
}

.vf-chip:hover {
  border-color: var(--primary);
  background: hsla(230, 52%, 24%, 0.06);
}

.ventes-kpi-card {
  display: flex;
  flex-direction: column;
}

.ventes-kpi-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0;
}

.ventes-kpi-body {
  padding-top: 8px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.ventes-kpi-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ventes-kpi-body .kpi-label {
  margin-top: 4px;
}

.ventes-charts-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  align-items: start;
}

@media (max-width: 900px) {
  .ventes-charts-grid {
    grid-template-columns: 1fr;
  }
}

.ventes-card-header-actions {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.ventes-table-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ventes-table-search {
  font-size: 12px;
  height: 32px;
  min-width: 180px;
}

.ventes-corner-link {
  font-weight: 500;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  color: var(--foreground);
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ventes-corner-link:hover {
  color: var(--primary);
}

/* Drawer détail corner */
.ventes-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 900;
}

.ventes-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(480px, 100vw);
  height: 100vh;
  background: var(--card);
  border-left: 1px solid var(--border);
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.12);
  z-index: 901;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  display: flex;
  flex-direction: column;
}

.ventes-drawer.open {
  transform: translateX(0);
}

body.ventes-drawer-open {
  overflow: hidden;
}

.ventes-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.ventes-drawer-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 2px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.ventes-drawer-title {
  font-size: 18px;
  margin: 0;
  line-height: 1.2;
}

.ventes-drawer-close {
  border: 1px solid var(--border);
  background: var(--background);
  border-radius: 6px;
  width: 32px;
  height: 32px;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

.ventes-drawer-body {
  overflow-y: auto;
  padding: 16px 18px;
  flex: 1;
}

.ventes-drawer-loading {
  color: var(--muted-foreground);
  font-size: 13px;
  padding: 24px 0;
  text-align: center;
}

.ventes-drawer-kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.ventes-drawer-kpi {
  background: var(--muted);
  border-radius: var(--radius);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ventes-drawer-kpi span {
  font-size: 10px;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ventes-drawer-kpi strong {
  font-size: 14px;
  font-family: var(--font-mono, monospace);
}

.ventes-drawer-section {
  margin-bottom: 18px;
}

.ventes-drawer-section-title {
  font-size: 12px;
  font-weight: 600;
  margin: 0 0 8px;
}

.ventes-drawer-table {
  font-size: 11px;
}

.ventes-drawer-table th,
.ventes-drawer-table td {
  padding: 6px 8px;
}

/* ── Modal détail CA (style commercialisation_v2) ── */
.ventes-ca-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(0, 0, 0, 0.5);
  align-items: stretch;
  justify-content: stretch;
  padding: 0;
}

.ventes-ca-modal-overlay.open,
.ventes-ca-modal-overlay:not([hidden]) {
  display: flex;
}

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

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

.ventes-ca-modal {
  width: 100%;
  max-width: 100%;
  height: 100vh;
  max-height: 100vh;
  background: var(--card);
  border-radius: 0;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: ventes-ca-modal-in 0.2s ease;
}

@keyframes ventes-ca-modal-in {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* En-tête — why-modal / pdv-identity */
.ventes-ca-modal-header {
  position: relative;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, hsla(230, 52%, 24%, 0.04), hsla(230, 52%, 24%, 0.01));
}

.ventes-ca-modal-identity {
  display: flex;
  align-items: stretch;
  gap: 0;
  min-width: 0;
  padding-right: 36px;
  position: relative;
  width: 100%;
}

.ventes-ca-modal-nav {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-width: 0;
}

.ventes-ca-modal-nav-main {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
  justify-content: flex-start;
}

.ventes-ca-modal-header-kpis {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-shrink: 0;
  padding: 4px 18px;
  margin-left: auto;
  border-left: 1px solid var(--border);
}

.ventes-ca-header-kpi {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  min-width: 52px;
}

.ventes-ca-header-kpi-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-foreground);
  line-height: 1.2;
}

.ventes-ca-header-kpi-value {
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--foreground);
  line-height: 1.1;
}

.ventes-ca-header-kpi-pos .ventes-ca-header-kpi-value {
  font-size: 15px;
  font-weight: 600;
  color: var(--muted-foreground);
}

@media (max-width: 640px) {
  .ventes-ca-modal-nav {
    flex-wrap: wrap;
    gap: 10px;
  }

  .ventes-ca-modal-nav-main {
    order: 2;
    flex: 1 1 calc(100% - 96px);
  }

  .ventes-ca-modal-header-kpis {
    order: 3;
    flex: 1 1 100%;
    margin-left: 0;
    padding: 8px 0 0;
    border-left: none;
    border-top: 1px solid var(--border);
    justify-content: flex-start;
  }

  .ventes-ca-header-kpi {
    align-items: flex-start;
  }
}

.ventes-ca-modal-arrow {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: var(--foreground);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s;
}

.ventes-ca-modal-arrow:hover:not(:disabled) {
  background: var(--muted);
  border-color: hsl(230, 52%, 40%);
}

.ventes-ca-modal-arrow:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.ventes-ca-modal-pdv-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  text-align: left;
  max-width: 100%;
}

.ventes-ca-modal-pdv-btn:hover .ventes-ca-modal-title {
  color: hsl(230, 52%, 40%);
}

.ventes-ca-modal-pdv-caret {
  font-size: 10px;
  color: var(--muted-foreground);
}

.ventes-ca-modal-date-btn {
  border: none;
  background: none;
  padding: 0;
  margin: 0;
  font: inherit;
  font-size: 1.125rem;
  font-weight: 700;
  color: inherit;
  cursor: pointer;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
  letter-spacing: 0.01em;
}

.ventes-ca-modal-date-btn:hover {
  color: hsl(230, 52%, 40%);
}

.ventes-ca-modal-pos {
  display: none;
}

.ventes-ca-modal-popover {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  width: min(320px, calc(100vw - 48px));
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
  padding: 10px;
  animation: ventes-ca-popover-in 0.15s ease;
}

@keyframes ventes-ca-popover-in {
  from { opacity: 0; transform: translateX(-50%) translateY(-4px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

#ventes-ca-pdv-popover {
  max-height: 280px;
  display: flex;
  flex-direction: column;
}

#ventes-ca-pdv-popover[hidden],
#ventes-ca-date-popover[hidden] {
  display: none !important;
}

.ventes-ca-pdv-search {
  margin-bottom: 8px;
  flex-shrink: 0;
}

.ventes-ca-pdv-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  flex: 1;
}

.ventes-ca-pdv-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  background: none;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  font-size: 13px;
}

.ventes-ca-pdv-option:hover {
  background: var(--muted);
}

.ventes-ca-pdv-option.is-active {
  background: hsla(230, 52%, 24%, 0.08);
}

.ventes-ca-pdv-option-name {
  font-weight: 600;
}

.ventes-ca-pdv-option-ens {
  font-size: 11px;
  color: var(--muted-foreground);
}

.ventes-ca-pdv-empty {
  padding: 12px;
  text-align: center;
}

.ventes-ca-date-popover-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ventes-ca-date-input {
  flex: 1;
  min-width: 0;
}

.ventes-ca-date-popover-hint {
  margin: 8px 0 0;
}

.ventes-ca-date-popover-range {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ventes-ca-date-range-fields {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ventes-ca-date-range-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted-foreground);
}

.ventes-ca-date-range-apply {
  align-self: flex-end;
}

.ventes-ca-modal-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--ens-accent, hsl(230, 52%, 32%));
  flex-shrink: 0;
}

.enseigne-icon {
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 4px;
}

.ventes-ca-modal-ens-icon {
  width: 36px;
  height: 36px;
}

.ventes-hero-ens-icon {
  width: 40px;
  height: 40px;
  padding: 3px;
  background: hsl(40, 25%, 97%);
  border-radius: 6px;
  box-shadow: 0 0 0 1px hsla(40, 15%, 82%, 0.65);
}

.ventes-hero-ens-brand {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 0;
  max-width: 100%;
}

.ventes-hero-ens-brand:has(.ventes-hero-ens-icon) .ventes-hero-ens-label {
  display: none;
}

.ventes-hero-ens-filter-btn {
  border: none;
  background: none;
  padding: 3px;
  margin: -3px;
  border-radius: 8px;
  cursor: pointer;
  color: inherit;
  font: inherit;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.ventes-hero-ens-filter-btn:hover {
  background: hsla(230, 52%, 24%, 0.07);
}

.ventes-hero-ens-filter-btn.is-active {
  background: hsla(230, 52%, 24%, 0.1);
  box-shadow: 0 0 0 2px hsla(230, 52%, 24%, 0.28);
}

.ventes-hero-ens-filter-btn:focus-visible {
  outline: 2px solid hsl(230, 52%, 40%);
  outline-offset: 2px;
}

.ventes-hero-ens-label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.15;
  text-align: left;
  color: var(--muted-foreground);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ms-enseigne-icon {
  width: 18px;
  height: 18px;
}

.vf-chip-enseigne {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.vf-chip-enseigne-icon {
  width: 14px;
  height: 14px;
}

.ventes-drawer-ens-icon {
  width: 18px;
  height: 18px;
}

.ventes-ca-modal-titles {
  min-width: 0;
}

.ventes-ca-modal-title {
  margin: 0 0 2px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--foreground);
}

.ventes-ca-modal-subtitle {
  margin: 0;
  font-size: 12px;
  color: var(--muted-foreground);
}

.ventes-ca-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 5;
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: var(--muted-foreground);
  padding: 4px 10px;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}

.ventes-ca-modal-close:hover {
  background: var(--muted);
  color: var(--foreground);
}

.ventes-ca-modal-tabs {
  display: flex;
  gap: 0;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.ventes-ca-modal-tab {
  padding: 8px 14px;
  border: none;
  background: none;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted-foreground);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
}

.ventes-ca-modal-tab:hover {
  color: var(--foreground);
}

.ventes-ca-modal-tab.is-active {
  color: hsl(230, 52%, 28%);
  border-bottom-color: hsl(230, 52%, 28%);
  font-weight: 600;
}

.ventes-ca-modal-body {
  padding: 18px 22px 22px;
  overflow-y: auto;
  flex: 1;
  max-height: none;
  background: var(--background);
}

/* KPIs — ca-hero commercialisation */
.ventes-ca-hero {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.ventes-ca-hero-3 {
  grid-template-columns: 2fr 1fr 1fr;
}

.ventes-ca-hero-5 {
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
}

@media (max-width: 900px) {
  .ventes-ca-hero-5 {
    grid-template-columns: 1fr 1fr;
  }

  .ventes-ca-hero-5 .ventes-ca-card.main {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .ventes-ca-hero {
    grid-template-columns: 1fr 1fr;
  }

  .ventes-ca-hero-3,
  .ventes-ca-hero-5 {
    grid-template-columns: 1fr;
  }

  .ventes-ca-hero-5 .ventes-ca-card.main {
    grid-column: auto;
  }
}

.ventes-ca-card-warn {
  border-color: hsla(38, 92%, 50%, 0.35);
  background: hsla(38, 92%, 50%, 0.06);
}

.ventes-ca-section-title {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-foreground);
}

.ventes-ca-products-count {
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: var(--muted-foreground);
}

/* Contexte — facteurs */
.ventes-ca-contexte {
  margin-bottom: 16px;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.ventes-ca-facteurs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.ventes-ca-facteur {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: hsl(40, 18%, 99%);
}

.ventes-ca-facteur-pos {
  border-left: 3px solid var(--success);
}

.ventes-ca-facteur-neg {
  border-left: 3px solid var(--destructive);
}

.ventes-ca-facteur-warn {
  border-left: 3px solid hsl(38, 92%, 50%);
}

.ventes-ca-facteur-emoji {
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
}

.ventes-ca-facteur-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ventes-ca-facteur-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted-foreground);
}

.ventes-ca-facteur-value {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--foreground);
}

.ventes-ca-facteur-detail {
  font-size: 11px;
  color: var(--muted-foreground);
  line-height: 1.35;
}

.ventes-ca-evts-block {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.ventes-ca-evts-label,
.ventes-ca-jours-label {
  margin: 0 0 8px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted-foreground);
}

.ventes-ca-evts-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ventes-ca-evt-pill {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 12px;
  border-radius: 20px;
  font-size: 12px;
  background: hsla(38, 92%, 50%, 0.08);
  border: 1px solid hsla(38, 92%, 50%, 0.25);
}

.ventes-ca-evt-pill.is-positive {
  background: hsla(142, 71%, 45%, 0.08);
  border-color: hsla(142, 71%, 45%, 0.25);
}

.ventes-ca-evt-pill.is-negative {
  background: hsla(0, 84%, 60%, 0.06);
  border-color: hsla(0, 84%, 60%, 0.2);
}

.ventes-ca-evt-pill strong {
  font-weight: 700;
}

.ventes-ca-evt-pill span {
  font-size: 10px;
  color: var(--muted-foreground);
}

.ventes-ca-jours-wrap {
  margin-top: 12px;
}

.ventes-ca-jours-table {
  width: 100%;
  font-size: 12px;
}

.ventes-ca-jours-table th {
  font-size: 10px;
  padding: 6px 8px;
}

.ventes-ca-jours-table td {
  padding: 6px 8px;
  vertical-align: middle;
}

.ventes-ca-jour-row.is-ferie {
  background: hsla(0, 60%, 55%, 0.06);
}

/* Produits — tableau lignes */
.ventes-ca-prod-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.ventes-ca-prod-table {
  width: 100%;
  font-size: 14px;
}

.ventes-ca-prod-table thead th {
  position: sticky;
  top: 0;
  background: var(--muted);
  font-size: 11px;
  padding: 10px 12px;
  z-index: 1;
}

.ventes-ca-prod-th-num {
  min-width: 88px;
}

.ventes-ca-prod-group td {
  background: hsl(230, 25%, 96%);
  font-size: 14px;
  padding: 10px 12px;
}

.ventes-ca-prod-group-name {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.ventes-ca-prod-casse {
  color: hsl(15, 55%, 42%);
  font-weight: 600;
}

.ventes-ca-prod-layout-toggle {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 0 0 12px;
}

.ventes-ca-prod-layout-opt {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted-foreground);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.ventes-ca-prod-layout-opt:hover {
  background: var(--muted);
  color: var(--foreground);
}

.ventes-ca-prod-layout-opt.is-active {
  background: hsl(230, 52%, 24%);
  border-color: hsl(230, 52%, 24%);
  color: #fff;
}

.ventes-ca-prod-layout-range {
  font-size: 12px;
  color: var(--muted-foreground);
  margin-left: auto;
}

.ventes-ca-prod-week-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.ventes-ca-week-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ventes-ca-week-block-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: hsl(230, 52%, 24%);
  letter-spacing: 0.01em;
}

.ventes-ca-week-table--products {
  font-size: 13px;
}

.ventes-ca-week-prod-col {
  width: min(280px, 36vw);
  min-width: 160px;
}

.ventes-ca-week-prod-name {
  font-weight: 600;
  line-height: 1.3;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ventes-ca-prod-week-group-row td {
  background: hsl(230, 25%, 96%);
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}

.ventes-ca-prod-week-row td {
  padding: 8px 6px;
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
}

.ventes-ca-prod-week-row:hover td {
  background: hsla(230, 40%, 50%, 0.05);
}

.ventes-ca-week-empty {
  text-align: center;
  padding: 16px 12px !important;
}

.ventes-ca-week-scroll {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.ventes-ca-week-table {
  width: 100%;
  font-size: 12px;
  table-layout: fixed;
}

.ventes-ca-week-col {
  width: 108px;
  min-width: 108px;
}

.ventes-ca-week-dow {
  width: 40px;
  min-width: 40px;
  text-align: center !important;
  padding-left: 4px !important;
  padding-right: 4px !important;
}

.ventes-ca-week-table td.num {
  text-align: center;
  padding: 8px 4px;
}

.ventes-ca-week-label {
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.ventes-ca-week-table td.has-val strong {
  font-weight: 800;
  color: var(--foreground);
}

.ventes-ca-week-table th.is-highlight-dow,
.ventes-ca-week-table td.is-highlight-dow {
  background: hsla(230, 40%, 50%, 0.1);
}

.ventes-ca-week-table th.is-highlight-dow {
  color: hsl(230, 52%, 28%);
  font-weight: 800;
}

.ventes-ca-prod-row:hover td {
  background: hsla(230, 40%, 50%, 0.06);
}

.ventes-ca-prod-row td {
  padding: 10px 12px;
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
}

.ventes-ca-prod-photo-cell {
  width: 52px;
  padding: 8px !important;
}

.ventes-ca-prod-thumb {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  display: block;
}

.ventes-ca-prod-thumb-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  font-size: 1.4rem;
  background: var(--muted);
  border-radius: 8px;
}

.ventes-ca-prod-name-cell {
  min-width: 180px;
  max-width: 360px;
}

.ventes-ca-prod-name {
  display: block;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
}

.ventes-produits-custom-cols {
  padding: 12px 14px 14px;
  border-bottom: 1px solid var(--border);
  background: hsl(220, 14%, 97%);
}

.ventes-produits-custom-cols-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-bottom: 10px;
}

.ventes-produits-custom-search {
  flex: 1 1 200px;
  min-width: 160px;
  max-width: 320px;
  padding: 6px 10px;
  font-size: 13px;
}

.ventes-produits-custom-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 6px 12px;
  max-height: 220px;
  overflow-y: auto;
  padding: 8px 10px;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.ventes-produits-custom-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  line-height: 1.25;
}

.ventes-produits-custom-item:hover {
  background: hsla(230, 40%, 50%, 0.06);
}

.ventes-produits-custom-item[hidden] {
  display: none;
}

.ventes-produits-custom-name {
  flex: 1;
  min-width: 0;
}

.ventes-produits-custom-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  justify-content: flex-end;
}

/* ── Vue Produits — tableau & barre d'outils ── */
#ventes-produits-panel {
  overflow: hidden;
  border-radius: calc(var(--radius) + 2px);
}

#ventes-produits-panel .ventes-produits-toolbar {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: hsl(40, 28%, 97%);
  border-bottom: 1px solid hsl(40, 18%, 88%);
}

#ventes-produits-panel .ventes-produits-pill-bar {
  padding: 10px 16px;
  border-bottom: 1px solid hsl(40, 18%, 90%);
  background: transparent;
}

#ventes-produits-panel .ventes-produits-pill-bar:last-child {
  border-bottom: none;
}

#ventes-produits-panel .ventes-produits-metrics-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  padding: 10px 16px;
  border-bottom: 1px solid hsl(40, 18%, 90%);
}

#ventes-produits-panel .ventes-produits-metric-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

#ventes-produits-panel .ventes-produits-metric-group-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted-foreground);
}

#ventes-produits-panel .ventes-produits-segment {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  background: var(--background);
  border: 1px solid hsl(40, 16%, 86%);
  border-radius: 10px;
  box-shadow: inset 0 1px 2px hsla(230, 30%, 20%, 0.04);
}

#ventes-produits-panel .ventes-produits-segment .preset-pill,
#ventes-produits-panel .ventes-produits-pill-bar--segmented .ventes-produits-segment .preset-pill {
  border: none;
  border-radius: 7px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  color: hsl(230, 25%, 38%);
  background: transparent;
}

#ventes-produits-panel .ventes-produits-segment .preset-pill:hover,
#ventes-produits-panel .ventes-produits-pill-bar--segmented .preset-pill:hover {
  background: hsl(40, 20%, 94%);
  color: hsl(230, 45%, 28%);
}

#ventes-produits-panel .ventes-produits-segment .preset-pill.active,
#ventes-produits-panel .ventes-produits-pill-bar--segmented .preset-pill.active {
  background: #fff;
  color: hsl(230, 52%, 24%);
  font-weight: 600;
  box-shadow: 0 1px 3px hsla(230, 40%, 30%, 0.12);
}

#ventes-produits-panel .ventes-produits-pill-bar--segmented .ventes-produits-segment {
  flex: 0 1 auto;
}

#ventes-produits-panel .ventes-produits-table-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: #fff;
}

#ventes-produits-panel .ventes-produits-search {
  flex: 1;
  max-width: 320px;
  margin: 0;
  padding: 8px 12px;
  font-size: 13px;
  border-radius: 10px;
  border: 1px solid hsl(40, 16%, 86%);
  background: hsl(40, 25%, 98%);
}

#ventes-produits-panel .ventes-produits-table-count {
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted-foreground);
  white-space: nowrap;
}

#ventes-produits-panel .ventes-produits-wrap {
  padding: 0 0 8px;
}

#ventes-produits-panel .ventes-produits-table {
  font-size: 13px;
  min-width: 820px;
  border-collapse: separate;
  border-spacing: 0;
}

#ventes-produits-panel .ventes-produits-table th,
#ventes-produits-panel .ventes-produits-table td {
  padding: 11px 14px;
  vertical-align: middle;
  white-space: nowrap;
  border-bottom: 1px solid hsl(40, 18%, 92%);
}

#ventes-produits-panel .ventes-produits-table thead th {
  position: sticky;
  top: 0;
  z-index: 4;
  background: hsl(40, 22%, 95%);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: hsl(230, 20%, 42%);
  padding-top: 10px;
  padding-bottom: 10px;
}

#ventes-produits-panel .ventes-produits-table th.text-right,
#ventes-produits-panel .ventes-produits-table td.text-right {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

#ventes-produits-panel .ventes-produits-table .ventes-grille-sticky {
  left: 0;
  z-index: 5;
  min-width: 260px;
  max-width: 380px;
  white-space: normal;
  background: #fff;
  box-shadow: 4px 0 8px -2px hsla(230, 30%, 20%, 0.06);
}

#ventes-produits-panel .ventes-produits-table thead .ventes-grille-sticky {
  z-index: 6;
  background: hsl(40, 22%, 95%);
}

#ventes-produits-panel .ventes-produits-table tfoot .ventes-grille-sticky {
  background: hsl(40, 24%, 93%);
}

#ventes-produits-panel .ventes-produits-repas {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

#ventes-produits-panel .ventes-produits-repas-photo {
  flex: 0 0 auto;
}

#ventes-produits-panel .ventes-produits-repas-img,
#ventes-produits-panel .ventes-produits-repas-ph {
  width: 60px;
  height: 60px;
  border-radius: 14px;
  object-fit: cover;
  display: block;
  box-shadow: 0 2px 10px hsla(230, 30%, 20%, 0.12);
  border: 2px solid transparent;
}

#ventes-produits-panel .ventes-produits-repas-photo--rank-1 .ventes-produits-repas-img,
#ventes-produits-panel .ventes-produits-repas-photo--rank-1 .ventes-produits-repas-ph {
  border-color: hsl(42, 90%, 52%);
  box-shadow: 0 0 0 1px hsla(42, 90%, 52%, 0.35), 0 4px 12px hsla(42, 60%, 40%, 0.2);
}

#ventes-produits-panel .ventes-produits-repas-photo--rank-2 .ventes-produits-repas-img,
#ventes-produits-panel .ventes-produits-repas-photo--rank-2 .ventes-produits-repas-ph {
  border-color: hsl(220, 12%, 68%);
}

#ventes-produits-panel .ventes-produits-repas-photo--rank-3 .ventes-produits-repas-img,
#ventes-produits-panel .ventes-produits-repas-photo--rank-3 .ventes-produits-repas-ph {
  border-color: hsl(28, 55%, 58%);
}

#ventes-produits-panel .ventes-produits-repas-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  background: linear-gradient(145deg, hsl(40, 25%, 94%), hsl(40, 18%, 88%));
}

#ventes-produits-panel .ventes-produits-repas-body {
  flex: 1;
  min-width: 0;
}

#ventes-produits-panel .ventes-produits-repas-name {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  color: hsl(230, 52%, 22%);
}

#ventes-produits-panel .ventes-produits-repas-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin-top: 5px;
}

#ventes-produits-panel .ventes-produits-cat {
  display: inline-block;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.4;
  color: hsl(230, 25%, 40%);
  background: hsl(40, 18%, 92%);
  border-radius: 100px;
}

#ventes-produits-panel .ventes-produits-tag {
  display: inline-block;
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 600;
  border-radius: 100px;
}

#ventes-produits-panel .ventes-produits-tag--muted {
  color: var(--muted-foreground);
  background: hsl(40, 15%, 94%);
}

#ventes-produits-panel .ventes-produits-td-metric {
  font-size: 14px;
  font-weight: 700;
  color: hsl(230, 52%, 22%);
}

#ventes-produits-panel .ventes-produits-td-metric.has-ca .ventes-produits-metric-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5em;
  padding: 3px 10px;
  border-radius: 8px;
  background: hsla(230, 52%, 40%, 0.08);
  border: 1px solid hsla(230, 52%, 40%, 0.12);
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

#ventes-produits-panel .ventes-produits-td-metric.has-ca .ventes-produit-cell-btn:hover .ventes-produits-metric-pill {
  background: hsla(230, 52%, 40%, 0.14);
  border-color: hsla(230, 52%, 40%, 0.28);
  box-shadow: 0 2px 8px hsla(230, 40%, 30%, 0.1);
}

#ventes-produits-panel .ventes-produits-part-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  min-width: 72px;
}

#ventes-produits-panel .ventes-produits-part-val {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted-foreground);
  font-variant-numeric: tabular-nums;
}

#ventes-produits-panel .ventes-produits-part-bar {
  display: block;
  width: 100%;
  max-width: 72px;
  height: 4px;
  border-radius: 999px;
  background: hsla(230, 30%, 40%, 0.1);
  overflow: hidden;
}

#ventes-produits-panel .ventes-produits-part-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, hsl(230, 52%, 42%), hsl(230, 45%, 54%));
}

#ventes-produits-panel .ventes-produits-td-part,
#ventes-produits-panel .ventes-produits-td-taux,
#ventes-produits-panel .ventes-produits-td-moy {
  color: var(--muted-foreground);
  font-size: 12px;
}

#ventes-produits-panel .ventes-produits-th-casse,
#ventes-produits-panel .ventes-produits-td-casse {
  border-left: 1px solid hsl(40, 18%, 90%);
}

#ventes-produits-panel .ventes-produits-th-casse {
  background: hsl(8, 30%, 97%);
}

#ventes-produits-panel .ventes-produits-td-casse {
  background: hsla(8, 40%, 98%, 0.55);
  font-size: 12px;
}

#ventes-produits-panel .ventes-produits-row:hover td {
  background: hsla(230, 40%, 50%, 0.04);
}

#ventes-produits-panel .ventes-produits-row:hover .ventes-grille-sticky {
  background: hsl(230, 40%, 98%);
}

#ventes-produits-panel .ventes-produits-row:hover .ventes-produits-td-casse {
  background: hsla(8, 35%, 96%, 0.7);
}

#ventes-produits-panel .ventes-crosshair-table tbody tr:nth-child(even) > .ventes-grille-sticky {
  background: hsl(40, 25%, 99%);
}

#ventes-produits-panel .ventes-crosshair-table tbody tr:nth-child(odd) > .ventes-grille-sticky {
  background: #fff;
}

#ventes-produits-panel .ventes-produits-evol-cell {
  background: transparent !important;
}

#ventes-produits-panel .ventes-produits-evol-cell .ventes-delta {
  font-size: 11px;
  padding: 3px 9px;
  white-space: nowrap;
}

#ventes-produits-panel .ventes-produits-total-row td {
  background: hsl(40, 24%, 93%) !important;
  font-size: 12px;
  border-top: 2px solid hsl(40, 18%, 86%);
  border-bottom: none;
}

#ventes-produits-panel .ventes-produits-custom-cols {
  margin: 0;
  border-bottom: 1px solid hsl(40, 18%, 90%);
  background: hsl(40, 25%, 96%);
}

@media (max-width: 720px) {
  #ventes-produits-panel .ventes-produits-metrics-row {
    flex-direction: column;
    align-items: flex-start;
  }

  #ventes-produits-panel .ventes-produits-table .ventes-grille-sticky {
    min-width: 200px;
    max-width: 240px;
  }

  #ventes-produits-panel .ventes-produits-repas-img,
  #ventes-produits-panel .ventes-produits-repas-ph {
    width: 44px;
    height: 44px;
  }
}

#ventes-produits-panel .ventes-produits-table thead th.th-tip {
  cursor: help;
  text-decoration: underline dotted hsl(230, 20%, 58%);
  text-underline-offset: 3px;
}

#ventes-produits-panel .ventes-produits-table thead th.th-tip:hover {
  color: hsl(230, 45%, 28%);
}

#ventes-produits-panel .ventes-ens-carousel-slide th.th-tip.text-center {
  min-width: 70px;
  font-size: 11px;
  white-space: normal;
  line-height: 1.3;
}

#ventes-produits-panel .ventes-produits-rep-col-th {
  min-width: 72px;
  max-width: 96px;
  padding: 8px 6px !important;
  vertical-align: bottom;
}

#ventes-produits-panel .ventes-produits-rep-col-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

#ventes-produits-panel .ventes-produits-rep-col-img,
#ventes-produits-panel .ventes-produits-rep-col-ph {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
  flex: 0 0 auto;
  box-shadow: 0 1px 4px hsla(230, 30%, 20%, 0.12);
}

#ventes-produits-panel .ventes-produits-rep-col-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  background: hsl(40, 18%, 92%);
}

#ventes-produits-panel .ventes-produits-rep-col-ph--autres {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--muted-foreground);
}

#ventes-produits-panel .ventes-produits-rep-col-label {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.25;
  color: hsl(230, 45%, 28%);
  text-align: center;
  word-break: break-word;
}

#ventes-produits-panel .ventes-ens-carousel-slide th.th-tip.ventes-grille-sticky {
  min-width: 160px;
}

#ventes-produits-panel .ventes-produits-cols-bar {
  align-items: center;
}

#ventes-produits-panel .ventes-produits-cols-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

#ventes-control-toolbar .ms-wrap-produit-cols,
#ventes-produits-panel .ms-wrap-produit-cols {
  min-width: 200px;
  max-width: 280px;
  position: relative;
}

#ventes-control-toolbar .ms-panel-produit-cols {
  z-index: 250;
}

#ventes-control-toolbar .ventes-produits-col-trigger,
#ventes-produits-panel .ventes-produits-col-trigger {
  min-height: 32px;
  font-size: 12px;
  font-weight: 600;
}

#ventes-control-toolbar .ms-panel-produit-cols,
#ventes-produits-panel .ms-panel-produit-cols {
  min-width: 320px;
  max-width: min(420px, 92vw);
}

#ventes-control-toolbar .ventes-produits-col-options,
#ventes-produits-panel .ventes-produits-col-options {
  max-height: 320px;
}

#ventes-control-toolbar .ms-option-produit,
#ventes-produits-panel .ms-option-produit {
  align-items: center;
  gap: 10px;
}

#ventes-control-toolbar .ms-option-produit .ventes-produits-col-photo,
#ventes-control-toolbar .ms-option-produit .ventes-produits-col-photo-ph,
#ventes-produits-panel .ms-option-produit .ventes-produits-col-photo,
#ventes-produits-panel .ms-option-produit .ventes-produits-col-photo-ph {
  width: 36px;
  height: 36px;
  max-width: 36px;
  max-height: 36px;
  border-radius: 8px;
  object-fit: cover;
  flex: 0 0 36px;
}

#ventes-control-toolbar .ms-option-produit .ventes-produits-col-photo-ph,
#ventes-produits-panel .ms-option-produit .ventes-produits-col-photo-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  background: hsl(40, 18%, 92%);
}

#ventes-control-toolbar .ms-option-produit .ms-option-name,
#ventes-produits-panel .ms-option-produit .ms-option-name {
  font-size: 13px;
  line-height: 1.3;
  white-space: normal;
}

#ventes-produits-panel .ventes-produits-table--jour {
  min-width: 840px;
}

#ventes-produits-panel .ventes-produits-th-jour,
#ventes-produits-panel .ventes-produits-td-jour {
  min-width: 3.5rem;
}

#ventes-produits-panel .ventes-produits-th-weekend,
#ventes-produits-panel .ventes-produits-td-weekend {
  background: hsla(230, 30%, 94%, 0.65);
}

#ventes-produits-panel .ventes-produits-td-jour {
  vertical-align: middle;
  line-height: 1.25;
}

#ventes-produits-panel .ventes-produits-jour-val {
  display: block;
}

#ventes-produits-panel .ventes-produits-jour-casse {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  font-weight: 600;
  color: hsl(15, 55%, 38%);
  letter-spacing: 0.01em;
}

#ventes-produits-panel .ventes-produits-td-jour-peak {
  background: hsla(142, 45%, 42%, 0.1);
}

#ventes-produits-panel .ventes-produits-td-jour-peak .ventes-produits-jour-val {
  font-weight: 700;
  color: hsl(230, 52%, 22%);
}

.ventes-ca-prod-sku {
  display: block;
  font-size: 11px;
  color: var(--muted-foreground);
  margin-top: 2px;
}

.ventes-ca-prod-source {
  display: block;
  font-size: 11px;
  color: var(--muted-foreground);
  margin-top: 3px;
  line-height: 1.35;
  font-style: italic;
}

.ventes-ca-repas-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
  padding: 12px 14px;
  margin-bottom: 14px;
  background: hsl(220, 14%, 97%);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 12px;
}

.ventes-ca-repas-summary-label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted-foreground);
  margin-bottom: 2px;
}

.ventes-ca-repas-summary strong {
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.ventes-ca-repas-warn {
  color: hsl(32, 75%, 40%);
}

.ventes-ca-casse-hero {
  margin-bottom: 4px;
}

.ventes-ca-casse-cats {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ventes-ca-casse-cat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: hsl(40, 18%, 99%);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
}

.ventes-ca-casse-cat-name {
  font-weight: 600;
}

.ventes-ca-casse-cat-meta {
  font-variant-numeric: tabular-nums;
  color: var(--muted-foreground);
  white-space: nowrap;
}

.ventes-ca-prod-prix {
  font-size: 14px !important;
  color: var(--muted-foreground);
}

.ventes-ca-prod-prix-estime {
  font-style: italic;
  color: hsl(230, 30%, 45%);
}

.ventes-ca-casse-jours {
  margin-bottom: 8px;
}

.ventes-ca-casse-cout-cell {
  white-space: nowrap;
}

.ventes-ca-casse-cout-val {
  display: inline-block;
  margin-right: 4px;
}

.ventes-ca-casse-cout-badge {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.4;
  vertical-align: middle;
  background: hsla(230, 52%, 40%, 0.1);
  color: hsl(230, 52%, 32%);
}

.ventes-ca-casse-cout-badge--fallback {
  background: hsla(38, 92%, 50%, 0.14);
  color: hsl(32, 85%, 32%);
}

.ventes-ca-casse-cout-note {
  display: inline-block;
  margin-left: 4px;
  font-size: 11px;
  color: var(--muted-foreground);
  cursor: help;
  vertical-align: middle;
}

.ventes-ca-casse-prod-table .ventes-ca-prod-photo-cell {
  width: 44px;
  padding-right: 0;
}

.ventes-ca-prod-badge {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  border-radius: 4px;
  background: hsla(32, 80%, 50%, 0.12);
  color: hsl(32, 75%, 35%);
}

.ventes-ca-prod-num {
  font-size: 17px !important;
  font-weight: 700 !important;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ventes-ca-prod-ca {
  color: hsl(230, 52%, 28%);
}

.ventes-ca-prod-pct {
  color: var(--muted-foreground);
  font-size: 15px !important;
}

.ventes-ca-prod-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.ventes-ca-prod-tab {
  min-height: 32px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted-foreground);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.ventes-ca-prod-tab:hover {
  color: var(--foreground);
  border-color: hsl(230, 30%, 75%);
}

.ventes-ca-prod-tab.is-active {
  color: hsl(230, 52%, 28%);
  border-color: hsl(230, 52%, 28%);
  background: hsla(230, 52%, 28%, 0.06);
}

.ventes-ca-prod-total td {
  background: hsl(230, 25%, 96%);
  border-top: 2px solid var(--border);
  padding: 12px;
  font-size: 14px;
}

.ventes-ca-prod-total .ventes-ca-prod-num {
  color: hsl(230, 52%, 28%);
}

.ventes-ca-card {
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
}

.ventes-ca-card.main {
  background: linear-gradient(135deg, hsla(230, 52%, 24%, 0.06), hsla(230, 52%, 24%, 0.02));
  border-color: hsla(230, 52%, 24%, 0.2);
}

.ventes-ca-card-action {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.ventes-ca-card-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-decoration: none;
  color: inherit;
  height: 100%;
  justify-content: center;
}

.ventes-ca-card-link:hover .ventes-ca-card-link-txt {
  color: hsl(230, 52%, 28%);
  text-decoration: underline;
}

.ventes-ca-card-link-txt {
  font-size: 14px;
  font-weight: 700;
  color: hsl(230, 52%, 36%);
}

.ventes-ca-card-label {
  font-size: 11px;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  font-weight: 600;
  margin-bottom: 6px;
}

.ventes-ca-card-value {
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  color: var(--foreground);
  font-variant-numeric: tabular-nums;
}

.ventes-ca-card-value.big {
  font-size: 28px;
}

.ventes-ca-card-sub {
  font-size: 11px;
  color: var(--muted-foreground);
  margin-top: 6px;
  line-height: 1.35;
}

.ventes-ca-cal-link {
  font-size: 12px;
  color: hsl(230, 52%, 36%);
  font-weight: 600;
  text-decoration: none;
}

.ventes-ca-cal-link:hover {
  text-decoration: underline;
}

/* Dashboard visuel */
.ventes-ca-dash {
  margin-bottom: 12px;
}

.ventes-ca-hero+.ventes-ca-insight+.ventes-ca-dash,
.ventes-ca-insight+.ventes-ca-dash {
  margin-top: 0;
}

.ventes-ca-insight {
  margin: 0 0 12px;
  padding: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted-foreground);
  grid-column: 1 / -1;
}

.ventes-ca-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

@media (max-width: 640px) {
  .ventes-ca-cards {
    grid-template-columns: 1fr;
  }
}

.ventes-ca-card {
  padding: 10px 12px;
  background: var(--card);
  border: 1px solid hsla(230, 20%, 50%, 0.1);
  border-radius: 10px;
  box-shadow: 0 2px 8px hsla(230, 30%, 20%, 0.04);
}

.ventes-ca-card-ctx {
  background: linear-gradient(160deg, hsl(200, 40%, 98%) 0%, var(--card) 100%);
}

.ventes-ca-card-ventes {
  background: linear-gradient(160deg, hsl(230, 35%, 97%) 0%, var(--card) 100%);
}

.ventes-ca-card-top {
  background: linear-gradient(160deg, hsl(40, 50%, 97%) 0%, var(--card) 100%);
}

.ventes-ca-card-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.ventes-ca-card-emoji {
  font-size: 14px;
  line-height: 1;
}

.ventes-ca-card-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted-foreground);
}

.ventes-ca-card-facts {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ventes-ca-card-facts li {
  font-size: 12px;
  line-height: 1.35;
  color: var(--card-foreground);
  padding: 2px 0;
}

.ventes-ca-card-facts li+li {
  border-top: 1px solid hsla(230, 15%, 50%, 0.08);
  margin-top: 2px;
  padding-top: 4px;
}

/* Top produits — bandeau */
.ventes-ca-topstrip {
  margin-bottom: 14px;
  padding: 12px;
  background: var(--card);
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 4px 16px hsla(230, 25%, 30%, 0.06);
}

.ventes-ca-topstrip-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.ventes-ca-topstrip-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-foreground);
}

.ventes-ca-topstrip-cal {
  font-size: 11px;
  font-weight: 600;
  color: hsl(230, 52%, 36%);
  text-decoration: none;
}

.ventes-ca-topstrip-cal:hover {
  text-decoration: underline;
}

.ventes-ca-topstrip-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ventes-ca-top-item {
  display: grid;
  grid-template-columns: 22px 44px 1fr;
  gap: 10px;
  align-items: center;
}

.ventes-ca-top-rank {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: hsl(230, 45%, 35%);
  background: hsla(230, 40%, 50%, 0.12);
  border-radius: 6px;
}

.ventes-ca-top-photo {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--muted);
}

.ventes-ca-top-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ventes-ca-top-photo span {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-size: 1.25rem;
}

.ventes-ca-top-name {
  display: block;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ventes-ca-top-bar {
  height: 4px;
  background: var(--muted);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 3px;
}

.ventes-ca-top-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--ens-accent, hsl(230, 52%, 32%)), hsl(40, 70%, 55%));
  border-radius: 4px;
  min-width: 4px;
}

.ventes-ca-top-meta {
  font-size: 10px;
  color: var(--muted-foreground);
  font-variant-numeric: tabular-nums;
}

.ventes-ca-analyse {
  margin-bottom: 12px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.ventes-ca-analyse summary {
  padding: 7px 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted-foreground);
  cursor: pointer;
  list-style: none;
  background: transparent;
}

.ventes-ca-analyse summary::-webkit-details-marker {
  display: none;
}

.ventes-ca-analyse-body {
  padding: 0 12px 10px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted-foreground);
}

.ventes-ca-analyse-body p {
  margin: 0 0 8px;
}

.ventes-ca-analyse-body strong {
  color: var(--card-foreground);
  font-weight: 600;
}

.ventes-ca-details {
  margin-top: 12px;
  border: none;
  border-radius: 8px;
  overflow: hidden;
  opacity: 0.85;
}

.ventes-ca-details summary {
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  color: var(--muted-foreground);
  background: hsl(40, 16%, 98%);
  list-style: none;
}

.ventes-ca-details summary::-webkit-details-marker {
  display: none;
}

.ventes-ca-details-body {
  padding: 10px 12px 12px;
  font-size: 12px;
}

.ventes-ca-details-meteo {
  margin: 0 0 8px;
  color: var(--muted-foreground);
}

.ventes-ca-evts-list-compact .ventes-ca-evt {
  padding: 6px 0;
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
}

.ventes-ca-evts-list-compact .ventes-ca-evt:last-child {
  border-bottom: none;
}

.ventes-ca-modal-loading,
.ventes-ca-modal-error {
  padding: 24px;
  text-align: center;
  color: var(--muted-foreground);
}

.ventes-ca-context {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.ventes-ca-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ventes-ca-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: var(--muted);
  color: var(--card-foreground);
}

.ventes-ca-chip-ferie {
  background: hsla(0, 72%, 50%, 0.12);
  color: hsl(0, 65%, 38%);
}

.ventes-ca-chip-pont {
  background: hsla(35, 90%, 50%, 0.15);
  color: hsl(32, 80%, 32%);
}

.ventes-ca-chip-vacances {
  background: hsla(200, 70%, 45%, 0.12);
  color: hsl(200, 60%, 32%);
}

.ventes-ca-chip-we {
  background: hsla(270, 50%, 50%, 0.1);
  color: hsl(270, 45%, 38%);
}

.ventes-ca-chip-day {
  background: hsla(230, 52%, 24%, 0.1);
  color: var(--primary);
}

.ventes-ca-meteo-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 16px;
  background: linear-gradient(145deg, hsl(200, 40%, 97%) 0%, hsl(40, 30%, 98%) 100%);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 2px);
}

.ventes-ca-meteo-emoji {
  font-size: 2rem;
  line-height: 1;
}

.ventes-ca-meteo-temps {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted-foreground);
}

.ventes-ca-meteo-precip,
.ventes-ca-meteo-note {
  margin: 2px 0 0;
  font-size: 11px;
  color: var(--muted-foreground);
}

.ventes-ca-meteo-badge {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  background: hsla(142, 50%, 40%, 0.15);
  color: hsl(142, 45%, 30%);
}

.ventes-ca-evts-title,
.ventes-ca-timeline-title {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-foreground);
}

.ventes-ca-evts-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ventes-ca-evt {
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
}

.ventes-ca-evt.is-positive {
  border-left: 3px solid var(--success);
}

.ventes-ca-evt.is-negative {
  border-left: 3px solid var(--destructive);
}

.ventes-ca-evt-type {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.ventes-ca-evt-meta {
  display: block;
  font-size: 11px;
  color: var(--muted-foreground);
  margin-top: 2px;
}

.ventes-ca-timeline-track {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.ventes-ca-tl-day {
  flex: 1;
  min-width: 36px;
  max-width: 52px;
  padding: 6px 4px;
  text-align: center;
  border-radius: 6px;
  background: var(--muted);
  font-size: 10px;
}

.ventes-ca-tl-day.is-ferie {
  background: hsla(0, 60%, 55%, 0.15);
}

.ventes-ca-tl-day.is-we {
  background: hsla(270, 40%, 55%, 0.1);
}

.ventes-ca-tl-day.has-evt {
  box-shadow: inset 0 0 0 2px hsla(230, 52%, 40%, 0.35);
}

.ventes-ca-tl-emoji {
  display: block;
  font-size: 14px;
}

.ventes-ca-tl-label {
  display: block;
  font-weight: 600;
  color: var(--muted-foreground);
}

.ventes-ca-products {
  background: var(--card);
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 12px 14px;
}

.ventes-ca-products-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.ventes-ca-products-title {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-foreground);
}

.ventes-ca-products-warn {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 600;
  color: hsl(32, 75%, 38%);
}

.ventes-ca-product-search {
  flex: 1;
  max-width: 200px;
  min-height: 32px;
  font-size: 12px;
}

.ventes-ca-product-group {
  margin-bottom: 6px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid hsla(230, 15%, 50%, 0.08);
}

.ventes-ca-product-group-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  cursor: pointer;
  font-weight: 600;
  background: hsl(40, 18%, 97%);
  list-style: none;
}

.ventes-ca-product-group-summary::-webkit-details-marker {
  display: none;
}

.ventes-ca-product-group-name {
  font-size: 12px;
}

.ventes-ca-product-group-meta {
  font-size: 11px;
  font-weight: 600;
  color: hsl(230, 45%, 32%);
  font-variant-numeric: tabular-nums;
}

.ventes-ca-product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 8px;
  padding: 8px;
}

.ventes-ca-product-card {
  display: flex;
  flex-direction: column;
  padding: 8px;
  border-radius: 10px;
  background: hsl(40, 20%, 99%);
  border: 1px solid hsla(230, 15%, 50%, 0.1);
  transition: transform 0.12s, box-shadow 0.12s;
}

.ventes-ca-product-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px hsla(230, 25%, 30%, 0.1);
}

.ventes-ca-product-photo {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  background: var(--muted);
  margin-bottom: 6px;
}

.ventes-ca-product-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ventes-ca-product-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-size: 2rem;
  opacity: 0.45;
}

.ventes-ca-product-info {
  min-width: 0;
}

.ventes-ca-product-name {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.5em;
}

.ventes-ca-product-bar {
  height: 3px;
  background: var(--muted);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 6px;
}

.ventes-ca-product-bar span {
  display: block;
  height: 100%;
  background: var(--ens-accent, hsl(230, 52%, 32%));
  border-radius: 3px;
}

.ventes-ca-product-foot {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 4px;
  font-size: 10px;
  color: var(--muted-foreground);
}

.ventes-ca-product-pct {
  font-weight: 700;
  color: hsl(230, 45%, 32%);
}

.ventes-ca-product-ca {
  font-weight: 700;
  color: var(--card-foreground);
}

.ventes-ca-product-unmapped {
  display: inline-block;
  margin-top: 4px;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  background: hsla(32, 80%, 50%, 0.12);
  color: hsl(32, 75%, 35%);
}

.ventes-ca-products-empty {
  padding: 32px;
  text-align: center;
  color: var(--muted-foreground);
}

.ventes-ca-cell-btn {
  display: inline;
  padding: 0;
  margin: 0;
  border: none;
  background: none;
  font: inherit;
  font-variant-numeric: tabular-nums;
  color: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
  transition: text-decoration-color 0.15s, color 0.15s;
}

.ventes-grille-cell.has-ca .ventes-ca-cell-btn:hover,
.ventes-grille-total-col.has-ca .ventes-ca-cell-btn:hover {
  text-decoration-color: hsla(230, 52%, 40%, 0.45);
  color: hsl(230, 52%, 32%);
}

.ventes-ca-cell-btn-total {
  font-weight: 700;
}

.ventes-produit-cell-btn {
  display: inline;
  padding: 0;
  margin: 0;
  border: none;
  background: none;
  font: inherit;
  font-variant-numeric: tabular-nums;
  color: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
  transition: text-decoration-color 0.15s, color 0.15s;
}

.has-ca .ventes-produit-cell-btn:hover,
.ventes-produits-td-metric.has-ca .ventes-produit-cell-btn:hover,
.ventes-produits-td-casse.has-ca .ventes-produit-cell-btn:hover {
  text-decoration-color: hsla(230, 52%, 40%, 0.45);
  color: hsl(230, 52%, 32%);
}

.ventes-produit-cell-btn--inline {
  font-size: inherit;
}

.ventes-produit-cell-btn--casse {
  font-size: 10px;
  opacity: 0.85;
}

body.ventes-produit-modal-open {
  overflow: hidden;
}

body.ventes-produit-col-resizing {
  cursor: col-resize;
  user-select: none;
}

.ventes-produit-modal-overlay {
  z-index: 1210;
}

.ventes-produit-modal {
  width: min(920px, 100%);
}

.ventes-produit-modal-icon {
  overflow: hidden;
  padding: 0;
}

.ventes-produit-modal-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ventes-produit-modal-photo-ph {
  font-size: 22px;
  line-height: 1;
}

.ventes-produit-modal-hint {
  margin: 6px 0 0;
  font-size: 11px;
  line-height: 1.45;
  color: var(--muted-foreground);
  max-width: 52ch;
}

.ventes-produit-modal-body {
  padding: 0;
}

.ventes-produit-modal-table-card {
  margin: 16px 18px 18px;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.05);
  overflow: hidden;
}

.ventes-produit-modal-table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, hsl(40, 20%, 98%), hsl(40, 18%, 96%));
}

.ventes-produit-modal-table-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-foreground);
}

.ventes-produit-modal-table-hint {
  font-size: 11px;
  color: var(--muted-foreground);
}

.ventes-produit-modal-table-wrap {
  overflow: auto;
  max-height: min(50vh, 440px);
}

.ventes-produit-detail-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.ventes-produit-detail-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted-foreground);
  background: hsl(40, 20%, 96%);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  position: relative;
  user-select: none;
}

.ventes-produit-detail-table thead th.ventes-produit-th-sortable {
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.ventes-produit-detail-table thead th.ventes-produit-th-sortable:hover {
  background: hsl(40, 18%, 93%);
  color: var(--foreground);
}

.ventes-produit-detail-table thead th.ventes-produit-th-sorted {
  color: hsl(230, 52%, 28%);
  background: hsl(230, 30%, 96%);
}

.ventes-produit-detail-table thead th .ventes-produit-th-sort-icon {
  display: inline-block;
  margin-left: 4px;
  font-size: 10px;
  opacity: 0.45;
}

.ventes-produit-detail-table thead th.ventes-produit-th-sorted .ventes-produit-th-sort-icon {
  opacity: 1;
}

.ventes-produit-detail-table thead th .ventes-produit-th-label {
  display: inline-block;
  padding-right: 8px;
}

.ventes-produit-col-resize {
  position: absolute;
  top: 0;
  right: -4px;
  width: 12px;
  height: 100%;
  cursor: col-resize;
  touch-action: none;
  z-index: 3;
}

.ventes-produit-col-resize::after {
  content: '';
  position: absolute;
  top: 20%;
  bottom: 20%;
  right: 3px;
  width: 2px;
  border-radius: 1px;
  background: hsla(230, 20%, 40%, 0.18);
  transition: background 0.15s;
}

.ventes-produit-col-resize:hover::after,
body.ventes-produit-col-resizing .ventes-produit-col-resize::after {
  background: hsla(230, 52%, 40%, 0.55);
}

.ventes-produit-detail-table tbody td {
  padding: 11px 14px;
  font-size: 13px;
  border-bottom: 1px solid hsla(40, 15%, 50%, 0.1);
  vertical-align: middle;
}

.ventes-produit-detail-row:hover td {
  background: hsla(230, 52%, 40%, 0.04);
}

.ventes-produit-detail-row[data-alt="1"] td {
  background: hsla(40, 20%, 50%, 0.03);
}

.ventes-produit-detail-row:hover[data-alt="1"] td {
  background: hsla(230, 52%, 40%, 0.05);
}

.ventes-produit-td-pdv {
  min-width: 0;
}

.ventes-produit-pdv-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  margin: 0;
  border: none;
  background: none;
  font: inherit;
  font-weight: 600;
  color: hsl(230, 52%, 28%);
  cursor: pointer;
  text-align: left;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
  transition: color 0.15s, text-decoration-color 0.15s;
  min-width: 0;
  max-width: 100%;
}

.ventes-produit-rank {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: hsl(230, 25%, 42%);
  background: hsla(230, 30%, 50%, 0.08);
  border: 1px solid hsla(230, 25%, 50%, 0.12);
}

.ventes-produit-rank--1 {
  color: hsl(42, 80%, 32%);
  background: hsla(42, 90%, 52%, 0.18);
  border-color: hsla(42, 80%, 45%, 0.35);
}

.ventes-produit-rank--2 {
  color: hsl(220, 15%, 38%);
  background: hsla(220, 12%, 68%, 0.2);
}

.ventes-produit-rank--3 {
  color: hsl(28, 50%, 36%);
  background: hsla(28, 55%, 58%, 0.18);
}

.ventes-produit-val-cell {
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: hsl(230, 52%, 22%);
}

.ventes-produit-pdv-btn:hover {
  color: hsl(230, 52%, 20%);
  text-decoration-color: hsla(230, 52%, 40%, 0.45);
}

.ventes-produit-pdv-name {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ventes-produit-ens-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.ventes-produit-ens-icon {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.ventes-produit-ens-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--foreground);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ventes-produit-detail-table .font-mono,
.ventes-produit-detail-table td.text-right {
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono, ui-monospace, monospace);
}

.ventes-produit-part-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  min-width: 72px;
}

.ventes-produit-part-val {
  font-size: 13px;
  font-weight: 600;
}

.ventes-produit-part-bar {
  display: block;
  width: 100%;
  max-width: 88px;
  height: 4px;
  border-radius: 999px;
  background: hsla(230, 30%, 40%, 0.1);
  overflow: hidden;
}

.ventes-produit-part-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, hsl(230, 52%, 42%), hsl(230, 45%, 54%));
}

.ventes-produit-modal-empty {
  padding: 28px 20px;
  text-align: center;
  color: var(--muted-foreground);
  font-size: 13px;
}

@media (max-width: 640px) {
  .ventes-produit-modal-table-hint {
    display: none;
  }

  .ventes-produit-modal-table-card {
    margin: 12px 10px 14px;
  }
}

@media (max-width: 640px) {
  .ventes-ca-modal-overlay {
    padding: 0;
    align-items: stretch;
  }

  .ventes-ca-modal {
    min-height: 100vh;
    border-radius: 0;
  }

  .ventes-ca-modal-body {
    max-height: none;
  }

  .ventes-ca-product-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Suivi ventes v2 ── */
.ventes-v2 .ventes-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  padding: 4px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 2px);
  width: fit-content;
  max-width: 100%;
}

.ventes-tab {
  font-size: 13px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: var(--radius);
  color: var(--muted-foreground);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.ventes-tab:hover {
  background: var(--muted);
  color: var(--foreground);
}

.ventes-tab.active {
  background: var(--primary);
  color: #fff;
}

/* Panneau détail — onglets de vue intégrés */
.ventes-panel-header-detail {
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
}

.ventes-panel-header-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ventes-detail-view-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 3px;
  background: hsl(40, 20%, 94%);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 2px);
}

.ventes-detail-view-tab {
  font-size: 12px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: var(--radius);
  color: var(--muted-foreground);
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}

.ventes-detail-view-tab:hover {
  background: hsla(0, 0%, 100%, 0.7);
  color: var(--foreground);
}

.ventes-detail-view-tab.is-active {
  background: #fff;
  color: hsl(230, 52%, 24%);
  box-shadow: 0 1px 3px hsla(230, 52%, 24%, 0.08);
}

.ventes-panel-header-detail .ventes-panel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ventes-panel-header-detail .ventes-grille-search {
  min-width: 160px;
  max-width: 220px;
}

/* Carrousel enseignes — tableau détail */
.ventes-panel-detail .card-content {
  padding: 0;
}

.ventes-grille-metric-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: hsl(40, 25%, 96%);
}

.ventes-grille-metric-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-foreground);
  margin-right: 4px;
}

.ventes-grille-metric-btn {
  min-height: 30px;
  padding: 0 12px;
  font-size: 12px;
}

.ventes-ens-carousel {
  width: 100%;
}

.ventes-ens-carousel-switcher {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid hsl(40, 15%, 90%);
  background: hsl(40, 25%, 96%);
}

.ventes-ens-carousel-switcher-center {
  flex: 1;
  min-width: 0;
  text-align: center;
}

.ventes-ens-carousel-hint {
  display: block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-foreground);
  margin-bottom: 2px;
}

.ventes-ens-carousel-title {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: hsl(230, 52%, 24%);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ventes-ens-carousel-count {
  display: block;
  font-size: 11px;
  color: var(--muted-foreground);
  margin-top: 2px;
}

.ventes-ens-carousel-switcher .ventes-ens-carousel-btn {
  flex: 0 0 auto;
  width: auto;
  min-width: 44px;
  height: 40px;
  padding: 0 10px;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
}

.ventes-ens-carousel-btn-label {
  line-height: 1;
}

.ventes-ens-carousel-viewport-wrap {
  position: relative;
  display: flex;
  align-items: stretch;
}

.ventes-ens-carousel-edge {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 36px;
  height: 56px;
  border: 1px solid hsl(40, 15%, 86%);
  border-radius: 10px;
  background: hsla(0, 0%, 100%, 0.95);
  color: hsl(230, 52%, 24%);
  box-shadow: 0 2px 10px hsla(230, 52%, 24%, 0.12);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.ventes-ens-carousel-edge:disabled,
.ventes-ens-carousel-edge[hidden] {
  display: none;
}

.ventes-ens-carousel-edge-prev {
  left: 6px;
}

.ventes-ens-carousel-edge-next {
  right: 6px;
}

.ventes-ens-carousel-viewport {
  flex: 1;
  overflow-x: hidden;
  overflow-y: visible;
}

.ventes-ens-carousel-track {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;
  overflow-x: auto;
  overflow-y: visible;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  gap: 0;
}

.ventes-ens-carousel-track::-webkit-scrollbar {
  display: none;
}

.ventes-ens-carousel-slide {
  flex: 0 0 100%;
  width: 100%;
  min-width: 100%;
  scroll-snap-align: center;
  scroll-snap-stop: always;
  padding: 0 2px 8px;
  box-sizing: border-box;
}

.ventes-ens-slide-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid hsl(40, 15%, 90%);
  background: linear-gradient(180deg, hsla(40, 33%, 97%, 0.9) 0%, hsla(40, 25%, 95%, 0.4) 100%);
}

.ventes-ens-slide-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.ventes-ens-slide-icon {
  flex-shrink: 0;
  border-radius: 8px;
}

.ventes-ens-slide-dot {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  flex-shrink: 0;
}

.ventes-ens-slide-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
}

.ventes-ens-slide-meta {
  margin: 2px 0 0;
  font-size: 11px;
  color: var(--muted-foreground);
}

.ventes-ens-slide-total {
  text-align: right;
  flex-shrink: 0;
}

.ventes-ens-slide-total-label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted-foreground);
}

.ventes-ens-slide-total-value {
  display: block;
  font-size: 18px;
  font-weight: 700;
  color: hsl(230, 52%, 24%);
  line-height: 1.2;
}

.ventes-ens-carousel-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 10px 16px 14px;
  border-top: 1px solid hsl(40, 15%, 88%);
}

.ventes-ens-carousel-btn {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  border: 1px solid hsl(40, 15%, 86%);
  border-radius: 999px;
  background: #fff;
  color: hsl(230, 52%, 24%);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.ventes-ens-carousel-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.ventes-ens-carousel-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  border: none;
  padding: 0;
  background: hsl(40, 15%, 82%);
  cursor: pointer;
  transition: width 0.2s ease, background 0.2s ease;
}

.ventes-ens-carousel-dot.is-active {
  width: 20px;
  background: hsl(230, 52%, 24%);
}

@media (max-width: 640px) {
  .ventes-panel-header-top {
    flex-direction: column;
    align-items: stretch;
  }

  .ventes-detail-view-tabs {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
  }

  .ventes-detail-view-tabs::-webkit-scrollbar {
    display: none;
  }

  .ventes-panel-header-detail .ventes-grille-search {
    max-width: none;
    width: 100%;
  }
}

.ventes-ens-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.ventes-ens-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 2px);
  padding: 14px 16px;
  border-top: 3px solid var(--ens-color, var(--primary));
}

.ventes-ens-card-total {
  border-top-color: var(--primary);
  background: hsla(40, 33%, 96%, 0.6);
}

.ventes-ens-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.ventes-ens-card-head h3 {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  margin: 0;
}

.ventes-ens-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--ens-color, var(--primary));
  flex-shrink: 0;
}

.ventes-ens-ca {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.1;
  margin: 0 0 8px;
  font-family: var(--font-serif);
}

.ventes-ens-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}

.ventes-ens-casse {
  font-size: 11px;
  color: var(--muted-foreground);
}

.ventes-chart-card .card-content {
  padding-top: 8px;
  padding-bottom: 12px;
}

.ventes-split-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
  align-items: start;
}

.ventes-split-grid-wide {
  grid-template-columns: 1fr 1fr;
}

@media (max-width: 900px) {

  .ventes-split-grid,
  .ventes-split-grid-wide {
    grid-template-columns: 1fr;
  }
}

.ventes-mini-table {
  font-size: 12px;
}

.ventes-mini-table th,
.ventes-mini-table td {
  padding: 8px 12px;
}

.ventes-grille-wrap {
  overflow-x: auto;
  max-width: 100%;
}

.ventes-grille-table {
  font-size: 12px;
  min-width: 640px;
}

.ventes-grille-table th,
.ventes-grille-table td {
  padding: 7px 10px;
  white-space: nowrap;
}

.ventes-grille-sticky {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--card);
  min-width: 180px;
  max-width: 220px;
  box-shadow: 2px 0 4px hsla(0, 0%, 0%, 0.04);
}

.ventes-grille-table thead .ventes-grille-sticky {
  background: var(--muted);
}

.ventes-grille-table tfoot .ventes-grille-sticky {
  background: var(--muted);
}

.ventes-grille-ens {
  display: block;
  font-size: 10px;
  color: var(--muted-foreground);
  margin-top: 1px;
}

.ventes-grille-cell.is-empty {
  color: var(--muted-foreground);
}

.ventes-grille-total-col {
  background: hsla(40, 33%, 96%, 0.5);
  font-weight: 600;
}

.ventes-grille-table thead .ventes-grille-total-col {
  background: var(--muted);
}

/* Jour unique (ex. filtre « Hier ») : 2 colonnes compactes, sans doublon Total */
.ventes-grille-wrap--single-day {
  overflow-x: visible;
  max-width: min(480px, 100%);
  margin-inline: auto;
  padding: 4px 16px 16px;
}

.ventes-ens-carousel-slide .ventes-grille-wrap--single-day {
  padding-inline: 16px;
}

.ventes-grille-table--single-day {
  min-width: 0;
  width: 100%;
  max-width: 480px;
  margin-inline: auto;
  table-layout: fixed;
}

.ventes-grille-table--single-day .ventes-grille-sticky {
  width: auto;
  min-width: 0;
  max-width: none;
}

.ventes-grille-table--single-day th.text-right,
.ventes-grille-table--single-day td.text-right.font-mono {
  width: 7.5rem;
  padding-left: 8px;
  padding-right: 12px;
}

.ventes-grille-table--single-day .ventes-grille-cell {
  font-size: 13px;
  font-weight: 600;
}

.ventes-grille-table--single-day .ventes-ca-cell-btn {
  font-size: 13px;
  font-weight: 600;
}

.ventes-grille-table--single-day .ventes-corner-link {
  white-space: normal;
  word-break: break-word;
  line-height: 1.3;
}

/* ── Grilles : cible ligne + colonne au survol ── */
.ventes-crosshair-table {
  --x-row: hsla(230, 22%, 42%, 0.06);
  --x-col: hsla(230, 22%, 42%, 0.1);
  --x-focus: hsla(230, 22%, 42%, 0.16);
  border-collapse: separate;
  border-spacing: 0;
}

.ventes-crosshair-table tbody tr:nth-child(even)>td {
  background-color: hsl(40, 16%, 97%);
}

.ventes-crosshair-table tbody tr:nth-child(even)>.ventes-grille-sticky {
  background-color: hsl(40, 16%, 97%);
}

.ventes-crosshair-table tbody tr:nth-child(odd)>.ventes-grille-sticky {
  background-color: var(--card);
}

.ventes-crosshair-table tr.ventes-x-row>td,
.ventes-crosshair-table tr.ventes-x-row>th {
  background-color: var(--x-row) !important;
}

.ventes-crosshair-table .ventes-x-col {
  background-color: var(--x-col) !important;
}

.ventes-crosshair-table .ventes-x-focus {
  background-color: var(--x-focus) !important;
  box-shadow: inset 0 0 0 1px hsla(230, 22%, 42%, 0.18);
}

.ventes-crosshair-table thead th.ventes-x-col {
  background-color: hsla(230, 22%, 42%, 0.12) !important;
}

.ventes-crosshair-table tfoot td.ventes-x-col {
  background-color: hsla(230, 22%, 42%, 0.12) !important;
}

.ventes-cell-tip {
  position: fixed;
  z-index: 950;
  pointer-events: none;
  padding: 5px 10px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 4px 14px hsla(0, 0%, 0%, 0.12);
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-mono, monospace);
  color: var(--foreground);
  transform: translate(-50%, calc(-100% - 8px));
  white-space: nowrap;
}

.ventes-cell-tip[hidden] {
  display: none;
}

.ventes-delta-cell {
  font-weight: 600;
  font-size: 12px;
}

.ventes-delta-up {
  background: hsla(142, 60%, 40%, 0.15);
  color: var(--success);
}

.ventes-delta-down {
  background: hsla(8, 55%, 49%, 0.12);
  color: var(--destructive);
}

.ventes-year-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.ventes-donut-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.ventes-donut-wrap canvas {
  max-width: 200px;
  max-height: 200px;
}

/* ── Ventes v2 — bandeau KPI ── */
.ventes-hero {
  padding: 20px 22px;
  background: linear-gradient(135deg, hsl(40, 33%, 97%) 0%, hsl(40, 25%, 93%) 100%);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
}

.ventes-hero-band {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 18px;
}

.ventes-hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 20px;
  flex-wrap: wrap;
}

.ventes-hero-main {
  flex: 1;
  min-width: 200px;
}

.ventes-hero-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding-top: 2px;
}

.ventes-hero-filters-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin-top: 8px;
}

.ventes-hero-chips {
  margin-top: 6px;
  width: 100%;
}

.ventes-hero-chips:empty {
  display: none;
  margin: 0;
}

.ventes-hero-filters-primary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  flex: 1;
  min-width: 0;
}

.ventes-hero-filters-sep {
  color: var(--muted-foreground);
  opacity: 0.55;
  font-size: 13px;
  user-select: none;
}

.ventes-hero-clear-link {
  font-size: 11px;
  color: var(--muted-foreground);
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
}

.ventes-hero-clear-link:hover {
  color: var(--foreground);
}

.ms-wrap-hero {
  display: inline-block;
  vertical-align: middle;
  max-width: 100%;
}

.ms-wrap-period {
  flex: 0 1 auto;
  max-width: min(100%, 340px);
}

.ms-wrap-corner {
  flex: 1 1 220px;
  min-width: 200px;
  max-width: 380px;
}

.ms-wrap-compare {
  flex-shrink: 0;
  max-width: min(100%, 300px);
}

.ms-trigger-compare .ms-label {
  max-width: 240px;
}

.ms-panel-period {
  min-width: 0;
  width: fit-content;
  max-width: min(96vw, 440px);
  max-height: none;
}

.ms-panel-period .ms-panel-inner {
  padding: 0;
  overflow: visible;
}

.ms-panel-compare {
  width: max(100%, 240px);
}

.ms-panel-inner {
  padding: 12px 14px;
  overflow: auto;
  max-height: inherit;
}

.ms-panel-inner-compact {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ms-panel-title {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-foreground);
}

.vf-period-panel {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: fit-content;
}

.ventes-period-layout {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.ventes-period-layout .ventes-range-picker {
  flex: 1 1 auto;
  min-width: 0;
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

.ventes-period-presets {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 0 0 118px;
  padding-left: 10px;
  border-left: 1px solid var(--border);
}

.ventes-period-presets .preset-pill {
  width: 100%;
  font-size: 11px;
  padding: 6px 10px;
  text-align: left;
  white-space: nowrap;
}

.ventes-period-compare {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.ventes-period-compare-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  padding: 0 2px;
}

.vf-period-panel .vf-date-range {
  flex-wrap: wrap;
}

.vf-period-panel .vf-date-input {
  width: 132px;
  height: 32px;
}

.vf-period-panel .vf-period-hint {
  margin: 0;
}

/* Calendrier période — double vue début / fin */
.ventes-range-picker {
  padding: 0;
  width: fit-content;
}

.ventes-range-picker-header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 6px 8px;
  background: hsl(220, 14%, 96%);
  border-radius: var(--radius) var(--radius) 0 0;
}

.ventes-range-preset-select {
  appearance: none;
  padding: 4px 24px 4px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 6px center;
  font-size: 11px;
  font-weight: 500;
  color: var(--foreground);
  cursor: pointer;
}

.ventes-range-calendars {
  display: grid;
  grid-template-columns: repeat(2, 196px);
  gap: 0;
  padding: 8px 6px;
}

.ventes-range-cal {
  width: 196px;
  padding: 0 4px;
  box-sizing: border-box;
}

.ventes-range-cal[data-cal="start"] {
  border-right: 1px solid var(--border);
}

.ventes-range-cal-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted-foreground);
  text-align: center;
  margin-bottom: 4px;
}

.ventes-range-cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2px;
  margin-bottom: 4px;
}

.ventes-range-month-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--foreground);
  flex: 1;
  text-align: center;
  white-space: nowrap;
}

.ventes-range-month-select,
.ventes-range-year-select {
  height: 26px;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--foreground);
  cursor: pointer;
  width: auto;
  max-width: none;
}

.ventes-range-month-select {
  flex: 1 1 96px;
  min-width: 88px;
}

.ventes-range-year-select {
  flex: 0 0 64px;
  width: 64px;
}

.ventes-range-nav {
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--muted-foreground);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0;
  flex-shrink: 0;
}

.ventes-range-nav:hover {
  background: hsl(220, 14%, 94%);
  color: var(--foreground);
}

.ventes-range-cal-weekdays,
.ventes-range-cal-days {
  display: grid;
  grid-template-columns: repeat(7, 26px);
  gap: 1px;
  justify-content: center;
  text-align: center;
}

.ventes-range-cal-weekdays {
  margin-bottom: 2px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.ventes-range-cal-weekdays span {
  font-size: 9px;
  font-weight: 600;
  color: var(--muted-foreground);
  line-height: 1;
}

.ventes-range-day {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 500;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--foreground);
  cursor: pointer;
  padding: 0;
}

.ventes-range-day:hover:not(:disabled):not(.is-outside) {
  background: hsl(220, 14%, 94%);
}

.ventes-range-day.is-outside {
  visibility: hidden;
  pointer-events: none;
}

.ventes-range-day.is-disabled,
.ventes-range-day:disabled {
  color: hsl(220, 9%, 75%);
  cursor: not-allowed;
}

.ventes-range-day.is-selected {
  background: hsl(230, 70%, 50%);
  color: #fff;
  border-radius: 50%;
}

.ventes-range-compare {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  padding: 5px 8px;
  border-top: 1px solid var(--border);
  background: hsl(220, 14%, 98%);
  font-size: 10px;
}

.ventes-range-compare .preset-pill {
  padding: 3px 8px;
  font-size: 10px;
}

.ventes-range-compare-label {
  color: var(--muted-foreground);
  font-weight: 500;
}

.ventes-range-apply:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.ventes-range-footer {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  padding: 5px 8px 7px;
  border-top: 1px solid var(--border);
}

.ventes-range-footer .btn-sm {
  height: 26px;
  padding: 0 10px;
  font-size: 11px;
}

.ventes-range-compare-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

/* Sélecteur mobile — masqué sur desktop */
.vdm-picker {
  display: none;
}

.vcm-mobile-chrome {
  display: none;
}

.ventes-range-desktop {
  display: block;
}

/* Filtres période + PDV — mobile (Chrome Android, etc.) */
@media (max-width: 768px) {
  body:has(#ms-panel-period.open),
  body:has(#ms-panel-corner.open),
  body.ventes-filter-sheet-open {
    overflow: hidden;
  }

  body:has(#ms-panel-period.open)::before,
  body:has(#ms-panel-corner.open)::before,
  body.ventes-filter-sheet-open::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 1480;
    background: rgba(15, 23, 42, 0.52);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    pointer-events: none;
  }

  body.ventes-filter-sheet-open .ia-fab {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transform: none;
  }

  body.ventes-filter-sheet-open .app-content-loader {
    z-index: 100;
  }

  #ms-panel-period.open,
  #ms-panel-corner.open {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    width: 100%;
    max-width: none;
    min-width: 0;
    margin: 0;
    height: auto;
    max-height: min(90dvh, 90vh);
    border: none;
    border-radius: 22px 22px 0 0;
    box-shadow: 0 -24px 64px rgba(15, 23, 42, 0.32);
    z-index: 1490;
    animation: vdm-sheet-up 0.32s cubic-bezier(0.22, 1, 0.36, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-sizing: border-box;
  }

  @keyframes vdm-sheet-up {
    from { transform: translateY(100%); opacity: 0.6; }
    to { transform: translateY(0); opacity: 1; }
  }

  .ms-wrap-corner .ms-panel-wide:not(.open) {
    display: none !important;
  }

  #ms-panel-corner.open {
    max-height: min(92dvh, 92vh);
  }

  #ms-panel-corner.open .vcm-sheet {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    width: 100%;
    box-sizing: border-box;
  }

  #ms-panel-corner.open .vcm-options {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .ms-panel-period .ms-panel-inner {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    padding: 0;
    max-height: none;
  }

  .ms-panel-wide {
    width: 100%;
    max-height: min(85dvh, 85vh);
  }

  .ventes-range-desktop {
    display: none !important;
  }

  .ventes-range-picker {
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  /* ——— Sélecteur de dates mobile (vdm) ——— */
  .vdm-picker {
    --vdm-accent: hsl(230, 70%, 48%);
    --vdm-hero: linear-gradient(155deg, hsl(230, 54%, 20%) 0%, hsl(230, 48%, 30%) 48%, hsl(235, 42%, 36%) 100%);
    --vdm-pad-x: max(16px, env(safe-area-inset-left, 0px));
    display: flex;
    flex-direction: column;
    flex: 1;
    width: 100%;
    min-width: 0;
    min-height: 0;
    box-sizing: border-box;
    background: hsl(220, 22%, 97%);
  }

  .vdm-sheet-handle-row {
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    padding: 10px var(--vdm-pad-x) 0;
    background: hsl(220, 22%, 97%);
  }

  .vdm-sheet-handle {
    display: block;
    width: 40px;
    height: 4px;
    border-radius: 99px;
    background: hsl(220, 14%, 80%);
  }

  .vdm-hero {
    position: relative;
    flex-shrink: 0;
    margin: 8px var(--vdm-pad-x) 0;
    padding: 18px 16px 24px;
    border-radius: 18px;
    background: var(--vdm-hero);
    color: #fff;
    text-align: center;
    box-shadow: 0 8px 28px hsl(230 52% 18% / 0.35);
    overflow: hidden;
  }

  .vdm-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 80% 60% at 50% -10%, rgba(255, 255, 255, 0.14) 0%, transparent 70%);
    pointer-events: none;
  }

  .vdm-hero::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 12px;
    background: hsl(220, 22%, 97%);
    border-radius: 14px 14px 0 0;
  }

  .vdm-close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    touch-action: manipulation;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
  }

  .vdm-hero-icon {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    margin-bottom: 8px;
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
  }

  .vdm-hero-range {
    position: relative;
    z-index: 1;
    margin: 0;
    padding: 0 28px;
    font-family: inherit;
    font-size: clamp(17px, 4.8vw, 20px);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.3;
    color: #fff;
  }

  .vdm-hero-preset {
    position: relative;
    z-index: 1;
    margin: 5px 0 0;
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.78);
  }

  .vdm-tabs {
    display: flex;
    gap: 5px;
    margin: -4px var(--vdm-pad-x) 10px;
    padding: 4px;
    position: relative;
    z-index: 1;
    background: var(--card);
    border-radius: 13px;
    box-shadow: 0 2px 14px rgba(15, 23, 42, 0.08);
    flex-shrink: 0;
    box-sizing: border-box;
  }

  #ms-panel-period .vf-period-panel,
  #ms-panel-period .ventes-range-picker {
    width: 100%;
    max-width: none;
    box-sizing: border-box;
  }

  .vdm-tab {
    flex: 1;
    min-width: 0;
    min-height: 40px;
    border: none;
    border-radius: 10px;
    background: transparent;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted-foreground);
    cursor: pointer;
    touch-action: manipulation;
    transition: background 0.18s, color 0.18s, box-shadow 0.18s;
  }

  .vdm-tab.is-active {
    background: hsl(230, 70%, 97%);
    color: hsl(230, 52%, 26%);
    box-shadow: inset 0 0 0 1px hsl(230 70% 50% / 0.22);
  }

  .vdm-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0 var(--vdm-pad-x) 8px;
    box-sizing: border-box;
    width: 100%;
  }

  .vdm-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
  }

  .vdm-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 84px;
    min-width: 0;
    padding: 10px 4px;
    border: 1.5px solid hsl(220, 16%, 90%);
    border-radius: 14px;
    background: var(--card);
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.05);
    font-family: inherit;
    cursor: pointer;
    touch-action: manipulation;
    transition: transform 0.12s, box-shadow 0.15s, border-color 0.15s;
    box-sizing: border-box;
  }

  .vdm-card:active {
    transform: scale(0.97);
  }

  .vdm-card.is-active {
    border-color: var(--vdm-accent);
    background: linear-gradient(180deg, hsl(230, 70%, 98%) 0%, var(--card) 100%);
    box-shadow: 0 3px 14px hsl(230 70% 50% / 0.16);
  }

  .vdm-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 11px;
    background: hsl(230, 70%, 96%);
    color: hsl(230, 52%, 30%);
    flex-shrink: 0;
  }

  .vdm-card.is-active .vdm-card-icon {
    background: var(--vdm-accent);
    color: #fff;
  }

  .vdm-card-label {
    font-size: 10px;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    color: var(--foreground);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .vdm-card.is-active .vdm-card-label {
    color: hsl(230, 52%, 26%);
  }

  .vdm-date-cards {
    display: flex;
    align-items: stretch;
    gap: 0;
    margin-top: 4px;
    width: 100%;
  }

  .vdm-date-card {
    position: relative;
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 116px;
    padding: 14px 8px;
    border-radius: 16px;
    background: var(--card);
    box-shadow: 0 3px 16px rgba(15, 23, 42, 0.07);
    cursor: pointer;
    overflow: hidden;
    touch-action: manipulation;
    box-sizing: border-box;
  }

  .vdm-date-card:active {
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.1);
  }

  .vdm-date-card-tag {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted-foreground);
  }

  .vdm-date-card-day {
    font-size: clamp(28px, 8vw, 36px);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.03em;
    color: hsl(230, 52%, 22%);
    font-variant-numeric: tabular-nums;
  }

  .vdm-date-card-month {
    font-size: 12px;
    font-weight: 600;
    color: var(--muted-foreground);
    text-align: center;
  }

  .vdm-date-native {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    border: none;
    font-size: 16px;
  }

  .vdm-date-card-sep {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    flex-shrink: 0;
  }

  .vdm-date-card-sep span {
    display: block;
    width: 16px;
    height: 2px;
    border-radius: 1px;
    background: hsl(220, 14%, 82%);
  }

  .vdm-calendar-hint {
    margin: 12px 0 0;
    text-align: center;
    font-size: 12px;
    color: var(--muted-foreground);
  }

  .vdm-footer {
    flex-shrink: 0;
    padding: 12px var(--vdm-pad-x) max(14px, env(safe-area-inset-bottom));
    background: var(--card);
    border-top: 1px solid hsl(220, 14%, 92%);
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.05);
    box-sizing: border-box;
    width: 100%;
  }

  .vdm-compare {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-width: 0;
  }

  .vdm-compare-label {
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted-foreground);
  }

  .vdm-segmented {
    flex: 1;
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    padding: 3px;
    border-radius: 11px;
    background: hsl(220, 14%, 94%);
  }

  .vdm-seg-btn {
    min-height: 36px;
    padding: 6px 4px;
    border: none;
    border-radius: 8px;
    background: transparent;
    font-size: 10px;
    font-weight: 600;
    color: var(--muted-foreground);
    cursor: pointer;
    touch-action: manipulation;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .vdm-seg-btn.active {
    background: var(--card);
    color: hsl(230, 70%, 40%);
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
  }

  .vdm-apply {
    width: 100%;
    min-height: 48px;
    border: none;
    border-radius: 13px;
    background: linear-gradient(135deg, hsl(230, 52%, 22%) 0%, hsl(230, 70%, 44%) 100%);
    color: #fff;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.01em;
    cursor: pointer;
    touch-action: manipulation;
    box-shadow: 0 4px 14px hsl(230 52% 22% / 0.32);
    box-sizing: border-box;
  }

  .vdm-apply[hidden] {
    display: none !important;
  }

  .vdm-apply:active {
    transform: scale(0.98);
  }

  /* ——— Filtre points de vente mobile (vcm) ——— */
  #ms-panel-corner.open .vcm-mobile-chrome {
    display: block;
    flex-shrink: 0;
  }

  #ms-panel-corner.open .vcm-sheet {
    --vcm-pad-x: max(16px, env(safe-area-inset-left, 0px));
    background: hsl(220, 22%, 97%);
  }

  .vcm-sheet-handle-row {
    display: flex;
    justify-content: center;
    padding: 10px var(--vcm-pad-x, 16px) 0;
    background: hsl(220, 22%, 97%);
  }

  .vcm-sheet-handle {
    display: block;
    width: 40px;
    height: 4px;
    border-radius: 99px;
    background: hsl(220, 14%, 80%);
  }

  .vcm-hero {
    position: relative;
    margin: 8px var(--vcm-pad-x, 16px) 0;
    padding: 16px 16px 20px;
    border-radius: 18px;
    background: linear-gradient(155deg, hsl(230, 54%, 20%) 0%, hsl(230, 48%, 30%) 48%, hsl(235, 42%, 36%) 100%);
    color: #fff;
    text-align: center;
    box-shadow: 0 8px 28px hsl(230 52% 18% / 0.35);
    overflow: hidden;
  }

  .vcm-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 80% 60% at 50% -10%, rgba(255, 255, 255, 0.14) 0%, transparent 70%);
    pointer-events: none;
  }

  .vcm-close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    touch-action: manipulation;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
  }

  .vcm-hero-icon {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    margin-bottom: 8px;
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
  }

  .vcm-hero-title {
    position: relative;
    z-index: 1;
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.72);
  }

  .vcm-hero-sub {
    position: relative;
    z-index: 1;
    margin: 4px 0 0;
    padding: 0 28px;
    font-size: clamp(16px, 4.5vw, 19px);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.3;
    color: #fff;
  }

  #ms-panel-corner.open .vcm-search-wrap {
    flex-shrink: 0;
    margin: 12px var(--vcm-pad-x, 16px) 0;
    padding: 0 12px 0 36px;
    border-radius: 14px;
    border: 1px solid hsl(220, 16%, 88%);
    background: var(--card);
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
  }

  #ms-panel-corner.open .vcm-search-wrap .ms-search-ico {
    left: 14px;
  }

  #ms-panel-corner.open .vcm-search-wrap .ms-search {
    height: 46px;
    font-size: 16px;
    border: none;
    background: transparent;
    padding-left: 0;
  }

  #ms-panel-corner.open .vcm-options {
    padding: 8px var(--vcm-pad-x, 16px) 4px;
    box-sizing: border-box;
  }

  #ms-panel-corner.open .ms-group-label {
    padding: 12px 4px 6px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--muted-foreground);
  }

  #ms-panel-corner.open .ms-option {
    min-height: 48px;
    padding: 10px 12px;
    margin-bottom: 2px;
    border-radius: 12px;
    font-size: 14px;
    transition: background 0.12s;
  }

  #ms-panel-corner.open .ms-option:active {
    background: hsl(230, 70%, 97%);
  }

  #ms-panel-corner.open .ms-group-label-check {
    min-height: 48px;
    padding: 4px 12px;
    margin-bottom: 2px;
    border-radius: 12px;
  }

  #ms-panel-corner.open .vcm-footer {
    flex-shrink: 0;
    display: grid;
    grid-template-columns: 1fr 1fr 1.35fr;
    gap: 8px;
    padding: 12px var(--vcm-pad-x, 16px) max(14px, env(safe-area-inset-bottom));
    background: var(--card);
    border-top: 1px solid hsl(220, 14%, 92%);
    box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.05);
    box-sizing: border-box;
  }

  #ms-panel-corner.open .vcm-foot-btn {
    min-height: 46px;
    margin: 0;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    touch-action: manipulation;
  }

  #ms-panel-corner.open .vcm-apply-btn {
    min-height: 46px;
    margin: 0;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    touch-action: manipulation;
    box-shadow: 0 4px 14px hsl(230 52% 22% / 0.28);
  }

  #ms-panel-corner.ms-panel-loading .vcm-options {
    opacity: 0.55;
    pointer-events: none;
  }

  .ms-search {
    height: 44px;
    font-size: 16px;
  }

  .ms-option {
    min-height: 44px;
    padding: 10px 16px;
    font-size: 14px;
  }

  .ms-group-label {
    padding: 10px 16px 6px;
    font-size: 11px;
  }

  .ms-group-label-check {
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .ms-option input[type=checkbox],
  .ms-group-label input[type=checkbox] {
    width: 20px;
    height: 20px;
    margin-top: 0;
  }

  .ms-footer {
    padding: 12px 12px max(12px, env(safe-area-inset-bottom));
    gap: 8px;
    justify-content: stretch;
  }

  .ms-foot-btn,
  .ms-apply-btn {
    flex: 1;
    min-height: 44px;
    font-size: 14px;
    touch-action: manipulation;
  }

  .ms-apply-btn {
    margin-left: 0;
    flex: 1.2;
  }

  .ms-trigger-hero {
    min-height: 44px;
    font-size: 14px;
    touch-action: manipulation;
  }
}

@keyframes ms-filter-sheet-in {
  from {
    opacity: 0;
    transform: translateY(100%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ventes-hero-kpi-shell {
  width: 100%;
}

/* Carrousel KPI (mobile) — structure neutre sur desktop */
.ventes-kpi-carousel {
  width: 100%;
}

.ventes-kpi-carousel-viewport {
  width: 100%;
}

.ventes-kpi-carousel-footer {
  display: none;
}

/* Grille KPI : 4 tuiles, répartition au clic */
.ventes-hero-kpi-grid {
  --ventes-kpi-main-col: 9.5rem;
  --ventes-ens-col-name: 3.1rem;
  --ventes-ens-col-cur: 4.35rem;
  --ventes-ens-col-prev: 4.35rem;
  --ventes-ens-col-evol: 3.5rem;
  --kpi-tile-count: 4;
  display: grid;
  grid-template-columns: repeat(var(--kpi-tile-count), minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
  width: 100%;
}

.ventes-hero-kpi-shell.is-kpi-expanded .ventes-hero-kpi-grid {
  display: flex;
  align-items: stretch;
}

.ventes-hero-kpi-shell.is-kpi-expanded .ventes-hero-kpi-tile--toggle:not(.is-kpi-open) {
  flex: 1 1 0;
  min-width: 0;
}

.ventes-hero-kpi-shell.is-kpi-expanded .ventes-hero-kpi-tile.is-kpi-open {
  flex: 2.5 1 0;
  min-width: 0;
  max-width: 58%;
}

.ventes-hero-kpi-tile {
  display: block;
  padding: 14px 18px;
  min-width: 0;
  overflow: hidden;
  transition: flex 0.32s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.ventes-hero-kpi-tile--toggle {
  cursor: pointer;
}

.ventes-hero-kpi-tile--toggle:hover:not(.is-kpi-open) {
  border-color: hsla(38, 55%, 45%, 0.45);
}

.ventes-hero-kpi-tile.is-kpi-open {
  border-color: hsl(230, 52%, 24%);
  box-shadow: 0 4px 14px hsla(230, 52%, 24%, 0.08);
  z-index: 1;
}

.ventes-hero-kpi-tile:not(.ventes-hero-kpi-tile--with-ens) .ventes-hero-ens-wrap {
  display: none;
}

.ventes-hero-kpi-tile--with-ens .ventes-hero-kpi-body {
  grid-template-columns: 1fr;
  gap: 14px;
}

.ventes-hero-kpi-tile--with-ens .ventes-hero-kpi-main,
.ventes-hero-kpi-tile--with-ens .ventes-hero-ca-main {
  width: 100%;
}

.ventes-hero-kpi-tile--with-ens .ventes-hero-ens-wrap {
  padding-left: 0;
  border-left: none;
  border-top: 1px solid hsl(40, 15%, 86%);
  padding-top: 12px;
}

.ventes-hero-kpi-body,
.ventes-hero-ca-body {
  display: grid;
  grid-template-columns: var(--ventes-kpi-main-col) minmax(0, 1fr);
  gap: 16px 16px;
  align-items: center;
  width: 100%;
}

.ventes-hero-kpi-body-solo,
.ventes-hero-ca-body-solo {
  grid-template-columns: 1fr;
}

.ventes-hero-kpi-main,
.ventes-hero-ca-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
  flex-shrink: 0;
  width: var(--ventes-kpi-main-col);
}

.ventes-hero-ens-wrap {
  min-width: 0;
  padding-left: 16px;
  border-left: 1px solid hsl(40, 15%, 86%);
}

.ventes-hero-ens-head {
  display: block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-foreground);
  margin-bottom: 8px;
}

.ventes-hero-ens-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ventes-hero-ens-row {
  display: grid;
  grid-template-columns: var(--ventes-ens-col-name) var(--ventes-ens-col-cur) var(--ventes-ens-col-prev) var(--ventes-ens-col-evol);
  gap: 5px 6px;
  align-items: center;
  font-size: 11px;
  line-height: 1.25;
}

.ventes-hero-ens-row:not(.ventes-hero-ens-row-head) .ventes-hero-ens-name {
  justify-content: center;
}

.ventes-hero-ens-row-head {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted-foreground);
  padding-bottom: 4px;
  border-bottom: 1px solid hsl(40, 15%, 90%);
  margin-bottom: 2px;
}

.ventes-hero-ens-row-head .ventes-hero-ens-cur,
.ventes-hero-ens-row-head .ventes-hero-ens-amt,
.ventes-hero-ens-row-head .ventes-hero-ens-delta {
  text-align: right;
}

.ventes-hero-ens-name {
  display: flex;
  align-items: center;
  gap: 7px;
  overflow: hidden;
  min-width: 0;
}

.ventes-hero-ens-name>span:not(.ventes-hero-ens-dot) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ventes-hero-ens-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.ventes-hero-ens-cur {
  font-size: 11px;
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
}

.ventes-hero-ens-amt {
  font-size: 11px;
  font-weight: 500;
  text-align: right;
  white-space: nowrap;
  color: var(--muted-foreground);
}

.ventes-hero-ens-delta {
  display: flex;
  justify-content: flex-end;
}

.ventes-hero-ens-delta .ventes-delta {
  font-size: 10px;
  padding: 2px 6px;
  white-space: nowrap;
}

/* Colonne ÉVOL. : n'afficher que le % (pas le montant) pour tenir dans la colonne */
.ventes-hero-ens-delta .ventes-delta-amt,
.ventes-hero-ens-delta .ventes-delta-sep {
  display: none;
}

.ventes-hero-kpi-tile {
  background: hsla(0, 0%, 100%, 0.5);
  border: 1px solid hsl(40, 15%, 88%);
  border-radius: calc(var(--radius) + 2px);
}

.ventes-hero-kpi-tile-primary {
  background: #fff;
  border-color: hsla(38, 55%, 45%, 0.35);
  box-shadow: 0 1px 4px hsla(38, 30%, 40%, 0.08);
}

.ventes-hero-kpi-tile-casse:not(.ventes-hero-kpi-tile-primary) {
  border-color: hsla(8, 45%, 82%, 0.9);
  background: hsla(8, 55%, 49%, 0.06);
}

.ventes-hero-kpi-tile-casse.ventes-hero-kpi-tile-primary {
  border-color: hsla(8, 55%, 49%, 0.35);
}

.ventes-hero-kpi-tile-ht-client,
.ventes-hero-kpi-tile-ttc {
  border-color: hsla(210, 55%, 78%, 0.9);
  background: hsla(210, 60%, 50%, 0.05);
}

.ventes-hero-kpi-tile-ht-client .ventes-hero-kpi-label,
.ventes-hero-kpi-tile-ttc .ventes-hero-kpi-label {
  color: hsl(210, 55%, 38%);
}

.ventes-hero-eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0;
}

.ventes-hero-eyebrow-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin-bottom: 4px;
}

.ventes-hero h1 {
  font-size: 26px;
  margin: 0 0 6px;
  line-height: 1.15;
}

/* Voyant ETL — imports quotidiens J-1 */
.ventes-etl-voyant {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: hsla(0, 0%, 100%, 0.8);
  font-size: 11px;
  font-weight: 600;
  color: var(--foreground);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
  line-height: 1.2;
}

.ventes-etl-voyant:hover {
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.ventes-etl-voyant-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--muted-foreground);
}

.ventes-etl-voyant--ok .ventes-etl-voyant-dot,
.ventes-etl-health--ok .ventes-etl-voyant-dot,
.ventes-etl-modal-summary--ok .ventes-etl-voyant-dot {
  background: var(--success);
  box-shadow: 0 0 0 3px hsla(158, 64%, 36%, 0.15);
}

.ventes-etl-voyant--warn .ventes-etl-voyant-dot,
.ventes-etl-health--warn .ventes-etl-voyant-dot,
.ventes-etl-modal-summary--warn .ventes-etl-voyant-dot {
  background: var(--warning);
  box-shadow: 0 0 0 3px hsla(45, 90%, 50%, 0.2);
  animation: ventes-etl-pulse 2s infinite;
}

.ventes-etl-voyant--danger .ventes-etl-voyant-dot,
.ventes-etl-health--danger .ventes-etl-voyant-dot,
.ventes-etl-modal-summary--danger .ventes-etl-voyant-dot {
  background: var(--destructive);
  box-shadow: 0 0 0 3px hsla(0, 84%, 60%, 0.2);
  animation: ventes-etl-pulse 2s infinite;
}

@keyframes ventes-etl-pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

.ventes-etl-voyant-label {
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ventes-etl-voyant-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  background: hsla(38, 92%, 50%, 0.15);
  color: hsl(30, 70%, 32%);
  border: 1px solid hsla(38, 92%, 50%, 0.35);
  flex-shrink: 0;
}

.ventes-etl-voyant--has-actions.ventes-etl-voyant--ok {
  border-color: hsla(158, 64%, 36%, 0.35);
}

body.ventes-etl-modal-open {
  overflow: hidden;
}

.ventes-etl-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9997;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.ventes-etl-modal-overlay[hidden] {
  display: none;
}

.ventes-etl-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(3px);
}

.ventes-etl-modal {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: min(96vw, 880px);
  max-height: min(90vh, 920px);
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  min-height: 0;
}

#ventes-etl-modal-inner {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.ventes-etl-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--card);
}

.ventes-etl-modal-title {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 700;
}

.ventes-etl-modal-subtitle {
  margin: 0;
  font-size: 12px;
  color: var(--muted-foreground);
}

.ventes-etl-modal-close {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  background: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: var(--foreground);
  flex-shrink: 0;
}

.ventes-etl-modal-close:hover {
  background: var(--border);
}

.ventes-etl-modal-summary {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.ventes-etl-modal-summary strong {
  display: block;
  font-size: 14px;
  margin-bottom: 2px;
}

.ventes-etl-modal-summary p {
  margin: 0;
  font-size: 12px;
  color: var(--muted-foreground);
  line-height: 1.45;
}

.ventes-etl-modal-summary--ok {
  background: hsla(158, 64%, 36%, 0.06);
}

.ventes-etl-modal-summary--warn {
  background: hsla(38, 92%, 50%, 0.08);
}

.ventes-etl-modal-summary--danger {
  background: hsla(0, 84%, 60%, 0.06);
}

.ventes-etl-modal-actions {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  background: hsla(38, 92%, 50%, 0.06);
}

.ventes-etl-modal-actions-title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  color: hsl(30, 70%, 32%);
}

.ventes-etl-action-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ventes-etl-action-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--card);
  border: 1px solid hsla(38, 92%, 50%, 0.25);
  border-radius: 10px;
}

.ventes-etl-action-icon {
  flex-shrink: 0;
  color: hsl(30, 70%, 38%);
}

.ventes-etl-action-text {
  flex: 1;
  font-size: 12px;
  line-height: 1.45;
  min-width: 0;
}

.ventes-etl-action-btn {
  flex-shrink: 0;
  height: 28px;
  font-size: 11px;
}

.ventes-etl-action-item--expandable {
  display: block;
  padding: 0;
  overflow: hidden;
}

.ventes-etl-action-details {
  width: 100%;
}

.ventes-etl-action-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.ventes-etl-action-summary::-webkit-details-marker {
  display: none;
}

.ventes-etl-action-chevron {
  margin-left: auto;
  flex-shrink: 0;
  opacity: 0.7;
  transition: transform 0.2s ease;
}

.ventes-etl-action-details[open] .ventes-etl-action-chevron {
  transform: rotate(90deg);
}

.ventes-etl-mapping-corners-list {
  list-style: none;
  margin: 0;
  padding: 0 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-top: 1px dashed hsla(38, 92%, 50%, 0.25);
}

.ventes-etl-mapping-corner-link {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--muted);
  text-decoration: none;
  color: inherit;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.ventes-etl-mapping-corner-link:hover {
  background: hsla(230, 52%, 40%, 0.08);
  border-color: hsla(230, 52%, 40%, 0.25);
}

.ventes-etl-mapping-corner-link.is-static {
  cursor: default;
}

.ventes-etl-mapping-corner-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--foreground);
  line-height: 1.35;
}

.ventes-etl-mapping-corner-meta {
  font-size: 10px;
  color: var(--muted-foreground);
  line-height: 1.4;
}

.ventes-etl-silent-block {
  padding-top: 4px;
}

.ventes-etl-silent-details {
  margin-top: 12px;
  border-top: 1px dashed hsla(38, 92%, 50%, 0.35);
  padding-top: 8px;
}

.ventes-etl-silent-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  color: hsl(30, 70%, 32%);
  list-style: none;
  user-select: none;
}

.ventes-etl-silent-summary::-webkit-details-marker {
  display: none;
}

.ventes-etl-silent-chevron {
  margin-left: auto;
  transition: transform 0.2s ease;
  opacity: 0.7;
}

.ventes-etl-silent-details[open] .ventes-etl-silent-chevron {
  transform: rotate(90deg);
}

.ventes-etl-silent-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.ventes-etl-silent-action {
  text-align: right;
  white-space: nowrap;
}

.ventes-etl-silent-action .btn {
  height: 26px;
  font-size: 10px;
  padding: 0 8px;
}

.ventes-etl-acquit-intro {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  background: hsla(38, 92%, 50%, 0.08);
  border: 1px solid hsla(38, 92%, 50%, 0.2);
}

.ventes-etl-acquit-intro-lead {
  margin: 0 0 10px;
  font-size: 12px;
  line-height: 1.5;
  color: hsl(30, 55%, 28%);
}

.ventes-etl-acquit-steps {
  margin: 0;
  padding-left: 1.15rem;
  font-size: 11px;
  line-height: 1.55;
  color: var(--muted-foreground);
}

.ventes-etl-acquit-steps li+li {
  margin-top: 4px;
}

.ventes-etl-acquit-log-details {
  border-top: 1px solid hsla(38, 92%, 50%, 0.12);
  background: hsla(38, 92%, 50%, 0.03);
}

.ventes-etl-acquit-log-summary {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted-foreground);
  cursor: pointer;
  list-style: none;
}

.ventes-etl-acquit-log-summary::-webkit-details-marker {
  display: none;
}

.ventes-etl-acquit-log-list {
  margin: 0;
  padding: 0 12px 10px;
  list-style: none;
}

.ventes-etl-acquit-log-item {
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  font-size: 11px;
  line-height: 1.45;
}

.ventes-etl-acquit-log-item+.ventes-etl-acquit-log-item {
  margin-top: 6px;
}

.ventes-etl-acquit-log-corner {
  display: block;
  font-weight: 600;
  color: var(--foreground);
}

.ventes-etl-acquit-log-meta {
  display: block;
  font-size: 10px;
  color: var(--muted-foreground);
  margin-top: 2px;
}

.ventes-etl-acquit-log-comment {
  display: block;
  margin: 4px 0 0;
  padding: 0;
  font-style: normal;
  color: var(--foreground);
}

.ventes-etl-silent-group {
  margin-bottom: 12px;
  border: 1px solid hsla(38, 92%, 50%, 0.22);
  border-radius: 12px;
  overflow: hidden;
  background: var(--card);
}

.ventes-etl-silent-group-head {
  padding: 12px 14px;
  background: hsla(38, 92%, 50%, 0.06);
  border-bottom: 1px solid hsla(38, 92%, 50%, 0.15);
}

.ventes-etl-silent-group-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.ventes-etl-flux-kicker {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-foreground);
}

.ventes-etl-flux-name {
  font-size: 13px;
}

.ventes-etl-silent-group-meta {
  margin: 6px 0 0;
  font-size: 11px;
  color: var(--muted-foreground);
}

.ventes-etl-corner-cards {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.ventes-etl-corner-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
  gap: 12px 16px;
  padding: 14px;
  border-bottom: 1px solid var(--border);
}

.ventes-etl-corner-card:last-child {
  border-bottom: none;
}

@media (max-width: 640px) {
  .ventes-etl-corner-card {
    grid-template-columns: 1fr;
  }
}

.ventes-etl-corner-card-kicker {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: hsl(30, 70%, 38%);
  margin-bottom: 4px;
}

.ventes-etl-corner-card-name {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--foreground);
}

.ventes-etl-corner-card-ids {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin: 0;
  font-size: 11px;
}

.ventes-etl-corner-card-ids>div {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.ventes-etl-corner-card-ids dt {
  margin: 0;
  font-weight: 600;
  color: var(--muted-foreground);
  text-transform: uppercase;
  font-size: 9px;
  letter-spacing: 0.04em;
}

.ventes-etl-corner-card-ids dd {
  margin: 0;
}

.ventes-etl-corner-acquit-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-self: center;
}

.ventes-etl-corner-acquit-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--foreground);
}

.ventes-etl-required {
  color: var(--destructive);
}

.ventes-etl-corner-acquit-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: stretch;
}

.ventes-etl-corner-acquit-input {
  flex: 1;
  min-width: 140px;
  font-size: 12px;
  height: 34px;
}

.ventes-etl-corner-acquit-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 34px;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 600;
}

.ventes-etl-corner-acquit-btn--definitif {
  border-color: color-mix(in srgb, var(--warning) 55%, var(--border));
  color: var(--warning);
}

.ventes-etl-corner-acquit-note {
  margin: 0;
  font-size: 10px;
  color: var(--muted-foreground);
  line-height: 1.4;
}

.ventes-etl-bulk-acquit {
  margin-top: 12px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: var(--muted);
}

.ventes-etl-bulk-acquit-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted-foreground);
  cursor: pointer;
  list-style: none;
}

.ventes-etl-bulk-acquit-summary::-webkit-details-marker {
  display: none;
}

.ventes-etl-bulk-acquit-form {
  padding: 0 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ventes-etl-bulk-acquit-warn {
  margin: 0;
  font-size: 11px;
  line-height: 1.45;
  color: var(--muted-foreground);
}

.ventes-etl-bulk-acquit-btn {
  align-self: flex-start;
}

.ventes-etl-silent-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.ventes-etl-silent-table thead th {
  text-align: left;
  padding: 8px 12px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted-foreground);
  background: var(--muted);
  border-bottom: 1px solid var(--border);
}

.ventes-etl-silent-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.ventes-etl-silent-table tbody tr:last-child td {
  border-bottom: none;
}

.ventes-etl-silent-corner {
  font-weight: 600;
  margin-right: 6px;
}

.ventes-etl-tag {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  margin: 0 3px 3px 0;
}

.ventes-etl-tag--warn {
  background: hsla(38, 92%, 50%, 0.12);
  color: hsl(30, 70%, 32%);
  border: 1px solid hsla(38, 92%, 50%, 0.3);
}

.ventes-etl-modal-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-left: auto;
}

.ventes-etl-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.ventes-etl-pill--ok {
  background: hsla(158, 64%, 36%, 0.12);
  color: hsl(158, 55%, 28%);
  border: 1px solid hsla(158, 64%, 36%, 0.25);
}

.ventes-etl-pill--warn {
  background: hsla(38, 92%, 50%, 0.12);
  color: hsl(30, 70%, 32%);
  border: 1px solid hsla(38, 92%, 50%, 0.3);
}

.ventes-etl-pill--danger {
  background: hsla(0, 84%, 60%, 0.08);
  color: hsl(0, 65%, 38%);
  border: 1px solid hsla(0, 84%, 60%, 0.25);
}

.ventes-etl-modal-body {
  padding: 0 18px 12px;
  overflow: visible;
  flex: none;
  min-height: 0;
}

.ventes-etl-modal-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 8px;
}

.ventes-etl-modal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  min-width: 640px;
}

.ventes-etl-modal-table thead th {
  text-align: left;
  padding: 10px 12px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-foreground);
  background: var(--muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.ventes-etl-modal-table tbody tr {
  border-bottom: 1px solid var(--border);
}

.ventes-etl-modal-table tbody tr.is-warn {
  background: hsla(38, 92%, 50%, 0.04);
}

.ventes-etl-modal-table tbody tr.is-danger {
  background: hsla(0, 84%, 60%, 0.04);
}

.ventes-etl-modal-table td {
  padding: 12px;
  vertical-align: middle;
}

.ventes-etl-source-title {
  font-weight: 700;
  font-size: 13px;
}

.ventes-etl-health {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.ventes-etl-meta {
  font-size: 10px;
  color: var(--muted-foreground);
  margin-top: 3px;
  line-height: 1.4;
}

.ventes-etl-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  background: var(--muted);
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
  z-index: 3;
}

.ventes-etl-modal-footnote {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 11px;
  color: var(--muted-foreground);
  flex: 1;
  min-width: 200px;
}

.ventes-etl-modal-footer-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.ventes-etl-collecte-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.ventes-etl-collecte-actions .btn,
.ventes-etl-collecte-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  font-size: 11px;
  white-space: nowrap;
}

.etl-crf-panel-footer {
  padding: 0 22px 20px;
  text-align: center;
}

.etl-crf-dismiss {
  min-width: 120px;
}

.etl-crf-dismiss[hidden] {
  display: none;
}

.etl-crf-overlay {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.etl-crf-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.etl-crf-panel {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.22);
  overflow: hidden;
  transform: translateY(12px) scale(0.98);
  transition: transform 0.3s ease;
}

.etl-crf-overlay.is-open .etl-crf-panel {
  transform: translateY(0) scale(1);
}

.etl-crf-panel-header {
  padding: 20px 22px 0;
  text-align: center;
}

.etl-crf-panel-header h3 {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 700;
  color: var(--foreground);
}

.etl-crf-panel-header p {
  margin: 0;
  font-size: 12px;
  color: var(--muted-foreground);
  line-height: 1.5;
}

.etl-crf-spinner {
  width: 44px;
  height: 44px;
  margin: 0 auto 14px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: etl-crf-spin 0.85s linear infinite;
}

.etl-crf-spinner.is-done {
  animation: none;
  border-color: var(--success);
  border-top-color: var(--success);
}

.etl-crf-spinner.is-error {
  animation: none;
  border-color: var(--destructive);
  border-top-color: var(--destructive);
}

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

.etl-crf-steps {
  padding: 16px 22px 22px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.etl-crf-step {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 0;
  position: relative;
}

.etl-crf-step:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 11px;
  top: 30px;
  bottom: -2px;
  width: 2px;
  background: var(--border);
}

.etl-crf-step.is-done:not(:last-child)::after {
  background: var(--success);
}

.etl-crf-step-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  background: var(--muted);
  color: var(--muted-foreground);
  border: 2px solid var(--border);
  transition: all 0.3s ease;
  z-index: 1;
}

.etl-crf-step.is-active .etl-crf-step-icon {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px hsla(230, 52%, 40%, 0.2);
}

.etl-crf-step.is-done .etl-crf-step-icon {
  background: var(--success);
  color: #fff;
  border-color: var(--success);
}

.etl-crf-step.is-error .etl-crf-step-icon {
  background: var(--destructive);
  color: #fff;
  border-color: var(--destructive);
}

.etl-crf-step-body {
  flex: 1;
  min-width: 0;
  padding-top: 2px;
}

.etl-crf-step-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted-foreground);
  transition: color 0.2s;
}

.etl-crf-step.is-active .etl-crf-step-title,
.etl-crf-step.is-done .etl-crf-step-title {
  color: var(--foreground);
}

.etl-crf-step-detail {
  font-size: 11px;
  color: var(--muted-foreground);
  margin-top: 2px;
  line-height: 1.4;
}

.etl-crf-step.is-active .etl-crf-step-detail {
  color: var(--foreground);
  opacity: 0.85;
}

.etl-crf-result {
  margin: 0 22px 22px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.5;
  display: none;
}

.etl-crf-result.is-visible {
  display: block;
}

.etl-crf-result.is-ok {
  background: hsla(158, 64%, 36%, 0.1);
  border: 1px solid hsla(158, 64%, 36%, 0.35);
  color: hsl(158, 64%, 28%);
}

.etl-crf-result.is-err {
  background: hsla(0, 84%, 60%, 0.08);
  border: 1px solid hsla(0, 84%, 60%, 0.3);
  color: hsl(0, 72%, 42%);
}

.ventes-etl-analyse-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.ventes-etl-analyse-overlay[hidden] {
  display: none;
}

.ventes-etl-analyse-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(3px);
}

.ventes-etl-analyse-dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: min(96vw, 1200px);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22);
  overflow: hidden;
  min-height: 0;
}

.ventes-etl-analyse-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.ventes-etl-analyse-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.ventes-etl-analyse-close {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 8px;
  background: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: var(--foreground);
  flex-shrink: 0;
}

.ventes-etl-analyse-close:hover {
  background: var(--border);
}

.ventes-etl-analyse-body {
  padding: 14px 16px 16px;
  overflow: auto;
  flex: 1;
  min-height: 0;
  overscroll-behavior: contain;
}

@media (max-width: 640px) {
  .ventes-etl-voyant-label {
    display: none;
  }

  .ventes-etl-modal-pills {
    margin-left: 0;
    width: 100%;
  }
}

.ms-trigger-hero {
  height: 34px;
  font-size: 13px;
  background: hsla(0, 0%, 100%, 0.75);
  border-color: var(--border);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.ms-panel-hero {
  z-index: 250;
}

.ms-group-label-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  cursor: pointer;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: inherit;
}

.ms-group-label-check input[type="checkbox"] {
  flex-shrink: 0;
  margin: 0;
  cursor: pointer;
}

.ms-group-label-check span {
  flex: 1;
  min-width: 0;
}

.ventes-hero-kpi-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ventes-hero-kpi-label svg {
  opacity: 0.7;
}

.ventes-hero-kpi-value {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.05;
  color: var(--foreground);
}

.ventes-hero-kpi-value-sm {
  font-size: 28px;
}

.ventes-hero-kpi-meta {
  font-size: 11px;
  line-height: 1.3;
  color: var(--muted-foreground);
  margin: 0;
}

.ventes-hero-kpi-tile .ventes-delta {
  margin-top: 2px;
}

.ventes-hero-casse {
  font-size: 11px;
  color: var(--muted-foreground);
}

.ventes-alert-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: hsla(38, 92%, 50%, 0.1);
  border: 1px solid hsla(38, 92%, 50%, 0.35);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--foreground);
}

.ventes-alert-banner a {
  color: var(--warning);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ventes-section-title {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 10px;
}

.ventes-view-section {
  margin-bottom: 8px;
}

/* Loader global (logo login) */
.app-page-loader {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(155deg, hsl(230, 40%, 12%) 0%, hsl(230, 32%, 20%) 45%, hsl(230, 38%, 14%) 100%);
  transition: opacity 0.45s ease, visibility 0.45s ease;
}

.app-page-loader.is-hiding {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.app-page-loader[hidden],
.app-page-loader.is-hidden {
  display: none !important;
}

.app-page-loader-inner {
  text-align: center;
  animation: ventes-loader-enter 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.app-page-loader-visual {
  position: relative;
  width: 112px;
  height: 112px;
  margin: 0 auto 18px;
}

.app-page-loader-visual--sm {
  width: 72px;
  height: 72px;
  margin: 0 auto 10px;
}

.app-page-loader-visual--sm .app-page-loader-logo {
  inset: 12px;
  width: calc(100% - 24px);
  height: calc(100% - 24px);
}

.app-page-loader-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: rgba(255, 255, 255, 0.85);
  animation: ventes-loader-spin 0.95s linear infinite;
}

.app-page-loader-ring--accent {
  inset: 9px;
  border-width: 2px;
  border-top-color: hsl(8, 62%, 58%);
  animation-duration: 1.35s;
  animation-direction: reverse;
}

.app-page-loader-logo {
  position: absolute;
  inset: 20px;
  width: calc(100% - 40px);
  height: calc(100% - 40px);
  object-fit: contain;
  animation: ventes-loader-pulse 2.2s ease-in-out infinite;
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.28));
}

.app-page-loader-title {
  margin: 0 0 4px;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.app-page-loader-sub,
.app-content-loader-text {
  margin: 0;
  color: rgba(255, 255, 255, 0.58);
  font-size: 12px;
}

.app-page-loader-dots {
  display: flex;
  justify-content: center;
  gap: 7px;
  margin-top: 18px;
}

.app-page-loader-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  animation: ventes-loader-dot 1.15s ease-in-out infinite;
}

.app-page-loader-dots span:nth-child(2) { animation-delay: 0.16s; }
.app-page-loader-dots span:nth-child(3) { animation-delay: 0.32s; }

.app-content-loader {
  position: absolute;
  top: 48px;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: 0;
  animation: ventes-loader-fade-in 0.2s ease;
  pointer-events: auto;
}

.app-content-loader[hidden] {
  display: none !important;
}

.app-content-loader-inner {
  text-align: center;
  padding: 20px 24px;
  border-radius: 14px;
  background: linear-gradient(155deg, hsl(230, 40%, 12%) 0%, hsl(230, 32%, 20%) 100%);
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.22);
  animation: ventes-loader-enter 0.35s ease;
}

.app-content-loader-text {
  color: rgba(255, 255, 255, 0.7);
  font-size: 11px;
  font-weight: 600;
}

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

@keyframes ventes-loader-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.07); }
}

@keyframes ventes-loader-dot {
  0%, 80%, 100% { opacity: 0.35; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-5px); }
}

@keyframes ventes-loader-enter {
  from { opacity: 0; transform: translateY(14px) scale(0.94); }
  to { opacity: 1; transform: none; }
}

@keyframes ventes-loader-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.ventes-panel-header,
.ventes-panel-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  flex-wrap: wrap;
}

.ventes-v2 .ventes-panel-header.card-header {
  flex-direction: row;
  align-items: center;
  gap: 12px 16px;
  padding-bottom: 12px;
}

.ventes-panel-head-main {
  flex: 1;
  min-width: 160px;
}

.ventes-grille-search {
  font-size: 12px;
  height: 32px;
  flex: 0 0 auto;
  width: 220px;
  max-width: 100%;
}

.ventes-panel-actions {
  margin-left: auto;
}

.ventes-empty-cell {
  text-align: center;
  padding: 28px 16px !important;
  color: var(--muted-foreground);
}

.ventes-empty-hint {
  padding: 12px 0;
  font-size: 13px;
}

.ventes-view-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 1px solid hsla(220, 60%, 45%, 0.25);
  background: hsla(220, 60%, 45%, 0.06);
  color: var(--foreground);
  font-size: 13px;
  line-height: 1.45;
}

.ventes-view-notice[hidden] {
  display: none !important;
}

.ventes-view-notice p {
  margin: 0;
}

.ventes-view-notice svg {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--primary);
}

.ventes-delta {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 100px;
}

.ventes-delta-up {
  background: hsla(142, 60%, 40%, 0.14);
  color: var(--success);
}

.ventes-delta-down {
  background: hsla(8, 55%, 49%, 0.12);
  color: var(--destructive);
}

.ventes-delta-neutral {
  color: var(--muted-foreground);
  background: transparent;
  padding: 0;
}

.ventes-v2 .ventes-tab.active {
  background: var(--accent);
  color: #fff;
}

.ventes-v2 .ventes-grille-table thead th {
  background: hsl(40, 20%, 94%);
  color: var(--foreground);
  font-weight: 600;
  font-size: 11px;
  border-bottom: 1px solid var(--border);
}

.ventes-v2 .ventes-grille-table tfoot td {
  background: hsl(40, 25%, 92%);
}

.ventes-v2 .ventes-comp-table thead th {
  background: hsl(40, 20%, 94%);
}

.ventes-v2 .ventes-mag-table thead th {
  background: hsl(40, 20%, 94%);
}

/* Navigation vues — barre d'outils unifiée */
.ventes-control-toolbar {
  margin-bottom: 12px;
  border-radius: calc(var(--radius) + 2px);
  overflow: visible;
  position: relative;
  z-index: 30;
}

.ventes-control-toolbar:has(.ms-panel-produit-cols.open) {
  z-index: 120;
}

#ventes-view-content {
  position: relative;
  z-index: 1;
}

.ventes-control-toolbar-inner {
  display: flex;
  flex-direction: column;
}

.ventes-control-toolbar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  padding: 12px 16px;
}

.ventes-control-toolbar-row--nav {
  border-bottom: 1px solid var(--border);
  background: var(--card);
}

.ventes-control-toolbar-row--filters {
  background: hsl(40, 25%, 97%);
  border-bottom: none;
}

.ventes-control-toolbar-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.ventes-control-toolbar-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted-foreground);
  flex-shrink: 0;
}

.ventes-control-toolbar-divider {
  width: 1px;
  height: 24px;
  background: hsl(40, 15%, 85%);
  flex-shrink: 0;
}

.ventes-control-toolbar-divider--inline {
  height: 28px;
  margin: 0 2px;
}

.ventes-control-segment {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  padding: 3px;
  background: hsl(40, 20%, 94%);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 2px);
}

.ventes-control-segment--primary {
  background: hsl(40, 22%, 92%);
}

.ventes-control-tab,
.ventes-control-pill,
.ventes-control-toolbar .ventes-grille-metric-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  color: hsl(230, 25%, 38%);
  text-decoration: none;
  white-space: nowrap;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
  font-family: inherit;
}

button.ventes-control-tab,
button.ventes-control-pill {
  appearance: none;
}

.ventes-control-tab:hover,
.ventes-control-pill:hover,
.ventes-control-toolbar .ventes-grille-metric-btn:hover {
  background: hsla(0, 0%, 100%, 0.7);
  color: hsl(230, 45%, 28%);
}

.ventes-control-tab.is-active,
.ventes-control-pill.is-active,
.ventes-control-toolbar .ventes-grille-metric-btn.is-active {
  background: #fff;
  color: hsl(230, 52%, 24%);
  font-weight: 600;
  box-shadow: 0 1px 3px hsla(230, 40%, 30%, 0.1);
}

.ventes-control-toolbar-metrics {
  gap: 10px;
}

.ventes-control-toolbar-cols-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

#ventes-control-toolbar .ms-wrap-produit-cols {
  min-width: 180px;
}

.ventes-view-nav {
  margin-bottom: 12px;
}

.ventes-grille-metric-btn.preset-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
}

.ventes-view-nav-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.ventes-view-nav-group-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted-foreground);
  min-width: 52px;
}

/* Barre outils vues analyse */
.ventes-analyse-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  margin-bottom: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 2px);
}

.ventes-analyse-toolbar-filters,
.ventes-analyse-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
}

.ventes-analyse-filter-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted-foreground);
  margin-bottom: 4px;
}

.ventes-analyse-dow {
  border: none;
  margin: 0;
  padding: 0;
}

.ventes-analyse-dow-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.ventes-analyse-dow-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  user-select: none;
}

.ventes-analyse-dow-item:has(input:checked) {
  background: hsl(230, 52%, 24%);
  border-color: hsl(230, 52%, 24%);
  color: #fff;
}

.ventes-analyse-dow-item input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.ventes-analyse-select-wrap {
  min-width: 120px;
}

.ventes-analyse-select-wrap--grow {
  flex: 1;
  min-width: 160px;
  max-width: 280px;
}

.ventes-analyse-segments {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 3px;
  background: hsl(40, 20%, 94%);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 2px);
}

.ventes-analyse-segment-btn {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted-foreground);
  cursor: pointer;
}

.ventes-analyse-segment-btn:hover {
  background: hsla(0, 0%, 100%, 0.7);
  color: var(--foreground);
}

.ventes-analyse-segment-btn.is-active {
  background: hsl(230, 52%, 24%);
  color: #fff;
}

.ventes-analyse-segment-btn--soft.is-active {
  background: #fff;
  color: hsl(230, 52%, 24%);
  box-shadow: 0 1px 3px hsla(230, 52%, 24%, 0.08);
}

.ventes-perf-search {
  min-width: 180px;
  max-width: 240px;
}

.ventes-perf-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: hsl(40, 25%, 96%);
}

.ventes-perf-summary-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 100px;
}

.ventes-perf-summary-value {
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.ventes-perf-summary-label {
  font-size: 11px;
  color: var(--muted-foreground);
}

.ventes-perf-table thead th {
  background: hsl(230, 52%, 24%);
  color: #fff;
}

.ventes-perf-rank-col {
  width: 40px;
  color: var(--muted-foreground);
}

.ventes-perf-hint {
  margin: 0;
  padding: 10px 16px;
  font-size: 12px;
  color: var(--muted-foreground);
  border-bottom: 1px solid var(--border);
  background: hsl(45, 100%, 96%);
}

.ventes-produit-link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-weight: 600;
  color: hsl(230, 52%, 30%);
  cursor: pointer;
  text-align: left;
}

.ventes-produit-link:hover {
  text-decoration: underline;
}

.ventes-produit-drawer-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--muted-foreground);
}

.ventes-v2 .preset-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

@media (min-width: 961px) {
  .ventes-kpi-carousel-footer {
    display: none !important;
  }

  /* Répartition enseignes repliée par défaut — clic sur la tuile pour déplier */
  .ventes-hero-kpi-tile--toggle:not(.is-kpi-open) .ventes-hero-ens-wrap {
    display: none;
  }

  .ventes-hero-kpi-tile--toggle:not(.is-kpi-open) .ventes-hero-kpi-body {
    grid-template-columns: 1fr;
  }

  .ventes-hero-kpi-tile--toggle:not(.is-kpi-open)::after {
    content: 'Par enseigne ▸';
    display: block;
    margin-top: 8px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted-foreground);
    opacity: 0.85;
  }

  .ventes-hero-kpi-tile--toggle.is-kpi-open::after {
    content: 'Par enseigne ▾';
  }
}

@media (max-width: 1200px) {
  .ventes-hero-kpi-shell:not(.is-kpi-expanded) .ventes-hero-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ventes-hero-kpi-shell.is-kpi-expanded .ventes-hero-kpi-grid {
    flex-wrap: wrap;
  }

  .ventes-hero-kpi-shell.is-kpi-expanded .ventes-hero-kpi-tile.is-kpi-open {
    flex: 1 1 100%;
    max-width: 100%;
  }
}

@media (max-width: 960px) {
  /* Carrousel KPI — une tuile à la fois, répartition enseignes dans la tuile */
  .ventes-kpi-carousel-viewport {
    overflow-x: hidden;
    overflow-y: visible;
    margin-inline: -16px;
    padding-inline: 0;
  }

  .ventes-kpi-carousel-track.ventes-hero-kpi-grid {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: flex-start;
    grid-template-columns: unset !important;
    gap: 0 !important;
    width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scroll-padding-inline: 16px;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .ventes-kpi-carousel-track.ventes-hero-kpi-grid::-webkit-scrollbar {
    display: none;
  }

  .ventes-hero-kpi-shell .ventes-hero-kpi-tile {
    flex: 0 0 calc(100% - 32px);
    width: calc(100% - 32px);
    min-width: calc(100% - 32px);
    max-width: calc(100% - 32px);
    margin-inline: 16px;
    scroll-snap-align: center;
    scroll-snap-stop: always;
    min-height: 118px;
    height: auto;
    overflow: visible;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  }

  .ventes-hero-kpi-shell .ventes-hero-kpi-tile:not(.is-kpi-carousel-active) {
    opacity: 0.92;
  }

  .ventes-hero-kpi-shell .ventes-hero-kpi-tile.is-kpi-carousel-active {
    opacity: 1;
    border-color: hsl(230, 52%, 24%);
    box-shadow: 0 4px 14px hsla(230, 52%, 24%, 0.1);
  }

  /* Pas d’expansion latérale desktop sur mobile */
  .ventes-hero-kpi-shell.is-kpi-expanded .ventes-kpi-carousel-track {
    display: flex !important;
    flex-wrap: nowrap !important;
  }

  .ventes-hero-kpi-shell.is-kpi-expanded .ventes-hero-kpi-tile.is-kpi-open {
    flex: 0 0 calc(100% - 32px);
    max-width: calc(100% - 32px);
  }

  .ventes-hero-kpi-shell.is-kpi-expanded .ventes-hero-kpi-tile--toggle:not(.is-kpi-open) {
    flex: 0 0 calc(100% - 32px);
    min-width: calc(100% - 32px);
  }

  .ventes-hero-kpi-tile.is-kpi-open .ventes-hero-kpi-main,
  .ventes-hero-kpi-tile.is-kpi-open .ventes-hero-ca-main {
    width: 100%;
  }

  .ventes-kpi-carousel-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
    padding-inline: 4px;
  }

  .ventes-kpi-carousel-btn {
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    border: 1px solid hsl(40, 15%, 86%);
    border-radius: 999px;
    background: #fff;
    color: hsl(230, 52%, 24%);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
  }

  .ventes-kpi-carousel-btn:disabled {
    opacity: 0.35;
    cursor: default;
  }

  .ventes-kpi-carousel-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
  }

  .ventes-kpi-carousel-dot {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    border: none;
    padding: 0;
    background: hsl(40, 15%, 82%);
    cursor: pointer;
    transition: width 0.2s ease, background 0.2s ease;
  }

  .ventes-kpi-carousel-dot.is-active {
    width: 20px;
    background: hsl(230, 52%, 24%);
  }

  .ventes-hero-kpi-tile.is-kpi-open .ventes-hero-kpi-body,
  .ventes-hero-kpi-tile.is-kpi-open .ventes-hero-ca-body {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .ventes-hero-kpi-tile.is-kpi-open .ventes-hero-kpi-main,
  .ventes-hero-kpi-tile.is-kpi-open .ventes-hero-ca-main {
    width: 100%;
  }

  .ventes-hero-kpi-tile.is-kpi-open .ventes-hero-ens-wrap {
    padding-left: 0;
    border-left: none;
    border-top: 1px solid hsl(40, 15%, 86%);
    padding-top: 12px;
  }

  .ventes-hero-kpi-tile.is-kpi-open {
    --ventes-ens-col-name: 3.25rem;
  }

  .ventes-hero-kpi-tile.is-kpi-open .ventes-hero-ens-icon {
    width: 44px;
    height: 44px;
    padding: 4px;
  }
}

@media (max-width: 640px) {
  .ventes-hero {
    padding: 16px;
  }

  .ventes-hero h1 {
    font-size: 22px;
  }

  .ventes-hero-kpi-value {
    font-size: 24px;
  }

  .ms-wrap-compare {
    width: 100%;
    max-width: none;
  }

  .ventes-hero-filters-primary {
    flex-direction: column;
    align-items: stretch;
  }

  .ventes-hero-filters-sep {
    display: none;
  }

  .ms-wrap-period,
  .ms-wrap-corner {
    flex: 1 1 100%;
    max-width: none;
    width: 100%;
  }
}

.ventes-grille-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  padding: 12px 16px;
  background: hsl(40, 25%, 94%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 12px;
}

.ventes-grille-summary-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.ventes-col-current {
  background: hsla(38, 70%, 55%, 0.12) !important;
  box-shadow: inset 0 -2px 0 hsla(38, 70%, 45%, 0.45);
}

.ventes-col-filter-link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dashed var(--muted-foreground);
}

.ventes-col-filter-link:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.ventes-delta-sep {
  opacity: 0.45;
  font-weight: 400;
}

.ventes-charts-bottom {
  margin-top: 8px;
}

.ventes-sort-th.ventes-sort-active {
  color: var(--accent);
}

.ventes-sort-th.ventes-sort-asc::after {
  content: ' ↑';
  font-size: 10px;
}

.ventes-sort-th.ventes-sort-active:not(.ventes-sort-asc)::after {
  content: ' ↓';
  font-size: 10px;
}

/* KPI solo (big centered) */
.kpi-center {
  text-align: center;
  padding: 16px;
}

.kpi-center .kpi-value {
  font-size: 28px;
  margin: 4px 0;
}

.kpi-center svg {
  color: var(--primary);
  margin: 0 auto;
  display: block;
}

/* Info tiles */
.info-grid {
  display: grid;
  gap: 12px;
}

.info-tile {
  padding: 12px;
  background: var(--muted);
  border-radius: var(--radius);
  font-size: 13px;
}

.info-tile span.label {
  color: var(--muted-foreground);
  display: block;
  font-size: 11px;
  margin-bottom: 2px;
}

.info-tile p {
  font-weight: 500;
}

/* ============================================================
   MODAL / DIALOG
   ============================================================ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  overflow-y: auto;
  padding: 20px;
}

.modal-overlay.open {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 40px;
}

.modal {
  background: var(--card);
  border-radius: calc(var(--radius) * 1.5);
  border: 1px solid var(--border);
  width: 100%;
  max-width: 600px;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  animation: modal-in 0.2s ease;
  max-height: 85vh;
  overflow-y: auto;
}

.modal-lg {
  max-width: 900px;
}

.modal-sm {
  max-width: 460px;
}

.modal-md {
  max-width: 640px;
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(-8px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.modal-header {
  padding: 20px 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-title {
  font-size: 18px;
  font-family: var(--font-sans);
  font-weight: 600;
  color: var(--foreground);
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-close {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted-foreground);
}

.modal-close:hover {
  background: var(--muted);
}

.modal-close svg {
  width: 16px;
  height: 16px;
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  padding: 0 20px 20px;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* ============================================================
   MISC COMPONENTS
   ============================================================ */

/* Alert banner */
.alert-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
}

.alert-banner svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.alert-warning {
  background: hsla(38, 92%, 50%, 0.1);
  border: 1px solid hsla(38, 92%, 50%, 0.3);
  color: var(--warning);
}

.alert-destructive {
  background: hsla(8, 55%, 49%, 0.1);
  border: 1px solid hsla(8, 55%, 49%, 0.3);
  color: var(--destructive);
}

.alert-success {
  background: hsla(142, 60%, 40%, 0.1);
  border: 1px solid hsla(142, 60%, 40%, 0.3);
  color: var(--success);
}

/* Timeline */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.timeline-item {
  display: flex;
  gap: 12px;
}

.timeline-line {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.timeline-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 2px;
}

.timeline-dot.success {
  background: var(--success);
}

.timeline-dot.error {
  background: var(--destructive);
}

.timeline-connector {
  width: 2px;
  flex: 1;
  background: var(--border);
  margin: 4px 0;
  min-height: 32px;
}

.timeline-content {
  flex: 1;
  padding-bottom: 20px;
  min-width: 0;
}

/* Slider */
.range-slider {
  width: 100%;
  height: 6px;
  appearance: none;
  background: var(--muted);
  border-radius: 100px;
  outline: none;
  cursor: pointer;
}

.range-slider::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.15s;
}

.range-slider::-webkit-slider-thumb:hover {
  background: var(--accent);
}

/* Mobile phone mockup */
.phone-mockup {
  width: 375px;
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 32px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.phone-status-bar {
  background: var(--primary);
  color: var(--primary-foreground);
  padding: 6px 24px;
  display: flex;
  justify-content: space-between;
  font-size: 11px;
}

.phone-header {
  background: var(--primary);
  color: var(--primary-foreground);
  padding: 8px 20px 12px;
}

.phone-body {
  padding: 12px 16px;
  min-height: 420px;
  max-height: 420px;
  overflow-y: auto;
}

.phone-footer {
  border-top: 1px solid var(--border);
  padding: 12px 16px;
  background: var(--card);
  display: flex;
  justify-content: space-around;
  font-size: 11px;
  color: var(--muted-foreground);
}

/* Mobile step indicators */
.step-indicators {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
}

.step-pill {
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 10px;
  background: rgba(255, 255, 255, 0.15);
  color: rgba(249, 245, 236, 0.5);
}

.step-pill.active {
  background: rgba(255, 255, 255, 1);
  color: var(--primary);
  font-weight: 700;
}

/* PDV card (phone step) */
.phone-pdv-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
  transition: border-color 0.15s;
  background: var(--card);
}

.phone-pdv-card:hover {
  border-color: var(--primary);
}

.phone-pdv-card.selected {
  box-shadow: 0 0 0 2px var(--primary);
}

.phone-pdv-card.done {
  background: var(--muted);
  opacity: 0.6;
}

/* Summary boxes in phone */
.phone-summary-box {
  padding: 12px;
  border-radius: 12px;
  text-align: center;
}

.phone-summary-box.green {
  background: hsla(142, 60%, 40%, 0.1);
}

.phone-summary-box.red {
  background: hsla(8, 55%, 49%, 0.1);
}

/* ============================================================
   MOBILE SIDEBAR TOGGLE
   ============================================================ */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 99;
}

@media (max-width: 768px) {
  .depot-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    transform: translateX(-100%);
    transition: transform 0.25s ease, width 0.2s;
    width: 240px !important;
  }

  .depot-sidebar.mobile-open {
    transform: translateX(0);
  }

  /* Drawer mobile = pleine largeur : réafficher les libellés même si collapsed (ex. commandes_liste) */
  .depot-sidebar.collapsed .sidebar-logo {
    justify-content: flex-start;
    padding: 16px;
  }
  .depot-sidebar.collapsed .sidebar-logo-text,
  .depot-sidebar.collapsed .sidebar-group-label,
  .depot-sidebar.collapsed .sidebar-item-label,
  .depot-sidebar.collapsed .sidebar-badge,
  .depot-sidebar.collapsed .sidebar-user-info,
  .depot-sidebar.collapsed .sidebar-bell,
  .depot-sidebar.collapsed .sidebar-submenu-chevron,
  .depot-sidebar.collapsed .sidebar-footer--logout {
    display: revert;
  }
  .depot-sidebar.collapsed .sidebar-submenu-items {
    display: block !important;
  }

  .sidebar-overlay.open {
    display: block;
  }

  .depot-content {
    padding: 16px;
  }

  .depot-header {
    height: 48px;
    display: flex;
    align-items: center;
    padding: 0 8px;
    gap: 6px;
  }

  .header-status {
    display: flex;
    flex: 1;
    min-width: 0;
  }

  .header-status-long {
    display: none;
  }

  .header-status-short {
    display: block;
    font-size: 10px;
  }

  .depot-header-actions {
    display: flex;
    margin-left: 0;
    gap: 4px;
    flex-shrink: 0;
    align-items: center;
  }

  .depot-header-labo-form {
    display: flex;
    flex-shrink: 0;
    min-width: 0;
  }

  .depot-header-labo-select {
    width: 72px;
    max-width: 72px;
    min-width: 0;
    height: 28px;
    font-size: 10px;
    padding: 0 18px 0 5px;
    line-height: 1.2;
  }

  .depot-header-user {
    display: none;
  }

  .depot-header-tools {
    gap: 4px;
  }

  .depot-header-icon-btn {
    padding: 0;
    width: 32px;
    min-width: 32px;
  }

  .depot-header-logout-label {
    display: none;
  }
}

/* =====================================================
   SCROLLBARS PERSONNALISÉES — intégrées au design
   ===================================================== */

/* Webkit (Chrome, Safari, Edge) */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: hsl(230, 20%, 78%);
  border-radius: 100px;
  transition: background 0.2s;
}

::-webkit-scrollbar-thumb:hover {
  background: hsl(230, 30%, 60%);
}

::-webkit-scrollbar-corner {
  background: transparent;
}

/* Sidebar — scrollbar encore plus discrète */
.depot-sidebar::-webkit-scrollbar {
  width: 4px;
}

.depot-sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 100px;
}

.depot-sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.30);
}

/* Contenu principal */
.depot-main::-webkit-scrollbar-track,
.depot-content::-webkit-scrollbar-track {
  background: hsl(40, 33%, 94%);
}

/* Tableaux et zones de scroll horizontales */
.table-container::-webkit-scrollbar,
[style*="overflow-x:auto"]::-webkit-scrollbar,
[style*="overflow-y:auto"]::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

.table-container::-webkit-scrollbar-track {
  background: hsl(40, 15%, 93%);
  border-radius: 100px;
}

.table-container::-webkit-scrollbar-thumb {
  background: hsl(230, 20%, 80%);
  border-radius: 100px;
}

.table-container::-webkit-scrollbar-thumb:hover {
  background: hsl(230, 52%, 40%);
}

/* Firefox (scrollbar-width + scrollbar-color) */
* {
  scrollbar-width: thin;
  scrollbar-color: hsl(230, 20%, 78%) transparent;
}

.depot-sidebar {
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

/* ===== Tooltips sur les en-têtes de colonnes (géré par JS) ===== */

th.th-tip {
  cursor: help;
  border-bottom: 1px dotted var(--muted-foreground);
}

/* Bulle tooltip — créée dynamiquement par JS, positionnée en fixed */
#col-tooltip {
  position: fixed;
  z-index: 9999;
  background: hsl(230, 30%, 16%);
  color: #fff;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.55;
  padding: 9px 13px;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.30);
  max-width: 260px;
  white-space: normal;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  text-align: left;
}

#col-tooltip.visible {
  opacity: 1;
}

/* Petite flèche bas du tooltip */
#col-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: hsl(230, 30%, 16%);
}

/* ===== Feedback visuel J+2 / J+3 (Plan de Production) ===== */

/* Stock J+2 positif → sécurisé */
.cell-stock-ok {
  color: var(--success);
  font-weight: 600;
}

/* Rupture J+2 = stock = 0, production à relancer demain */
.cell-stock-rupture {
  color: var(--warning);
  font-weight: 600;
}

/* ALERTE CASSE : stock J+3 > 0, des unités vont expirer (DLC = 3 jours) */
.cell-alert-casse {
  color: #C62828;
  font-weight: 700;
  background: hsla(0, 60%, 44%, 0.10);
  border-radius: 4px;
  padding: 2px 6px;
}

/* Cellule zéro neutre après correction */
.cell-stock-zero {
  color: var(--muted-foreground);
  font-size: 12px;
}

/* Légende inline dans les en-têtes de colonne J+3 */
th .dlc-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 400;
  color: var(--muted-foreground);
  background: var(--muted);
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 4px;
  vertical-align: middle;
}

/* ── Module Facturation ─────────────────────────────────────────────────── */
.fact-workflow {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 8px 12px;
  padding: 14px 16px;
  background: var(--muted);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.fact-workflow-actions {
  align-items: center;
}

.fact-step-btn {
  cursor: pointer;
  border: none;
  background: transparent;
  text-align: left;
  padding: 0;
  font: inherit;
  color: inherit;
  flex: 1;
  min-width: 160px;
}

.fact-step-btn:hover .fact-step-num {
  border-color: var(--primary);
}

.fact-step-form {
  margin: 0;
  flex: 1;
  min-width: 160px;
}

.fact-step-muted {
  opacity: 0.65;
}

.fact-workflow-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-left: auto;
  align-items: center;
}

.fact-recon-card-header {
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.fact-data-status {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 1rem;
}

.fact-data-status-item {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 220px;
  padding: 10px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.85rem;
}

.fact-data-status-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--muted);
  color: var(--muted-foreground);
  flex-shrink: 0;
}

.fact-data-status-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted-foreground);
  margin-bottom: 2px;
}

.fact-data-status-value {
  display: block;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.fact-data-status-sub {
  font-weight: 400;
  font-size: 0.78rem;
  color: var(--muted-foreground);
  margin-left: 4px;
}

.fact-import-panel {
  width: min(480px, 95vw);
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  margin: 0 auto;
}

#modal-fact-import.modal-overlay>.card {
  pointer-events: auto;
}

@media (max-width: 900px) {
  .fact-workflow-tools {
    width: 100%;
    margin-left: 0;
    margin-top: 8px;
  }
}

.fact-step {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  flex: 1;
  min-width: 160px;
  font-size: 0.85rem;
}

.fact-step p {
  margin: 2px 0 0;
  color: var(--muted-foreground);
  font-size: 0.78rem;
  line-height: 1.35;
}

.fact-step-num {
  flex-shrink: 0;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 50%;
  background: var(--card);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
}

.fact-step-active .fact-step-num {
  background: var(--primary);
  color: var(--primary-foreground);
  border-color: var(--primary);
}

.fact-step-arrow {
  align-self: center;
  color: var(--muted-foreground);
  font-size: 1.1rem;
  padding: 0 4px;
}

.fact-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 768px) {
  .fact-actions-grid {
    grid-template-columns: 1fr;
  }
}

.fact-action-block h4 {
  margin: 0 0 10px;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.fact-action-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fact-recon-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}

.fact-ens-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.recon-ens-btn {
  font-size: 0.72rem;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1.5px solid var(--ens-color, var(--border));
  background: transparent;
  color: var(--ens-color, var(--muted-foreground));
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.recon-ens-btn.active {
  background: var(--ens-color, var(--primary));
  color: #fff;
}

.fact-statut-pills {
  display: flex;
  gap: 2px;
}

.fact-recon-count {
  padding: 6px 16px;
  font-size: 0.78rem;
  color: var(--muted-foreground);
  border-bottom: 1px solid var(--border);
}

.fact-lot-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fact-ens-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.fact-ens-tag {
  font-size: 0.68rem;
  padding: 1px 6px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--c) 12%, transparent);
  color: var(--c);
  border: 1px solid color-mix(in srgb, var(--c) 35%, transparent);
}

.fact-ens-group-row td {
  padding: 6px 14px;
  background: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  border-top: 2px solid var(--border);
}

#recon-table tbody tr.recon-row {
  cursor: pointer;
}

#recon-table tbody tr.recon-row:hover {
  background: var(--muted);
}

.fact-recon-note-badge {
  margin-left: 6px;
  font-size: 0.75rem;
  vertical-align: middle;
  opacity: 0.85;
}

.data-table-compact th,
.data-table-compact td {
  padding: 0.4rem 0.65rem;
  font-size: 0.82rem;
}

/* ── Facturation — layout sidebar + génération ─────────────────────────── */
.fact-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 900px) {
  .fact-layout {
    grid-template-columns: 1fr;
  }
  .fact-sidebar {
    position: static !important;
  }
}

.fact-sidebar {
  position: sticky;
  top: 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.fact-sidebar-head {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--muted);
}

.fact-sidebar-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.9rem;
}

.fact-sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: 0.5rem;
  gap: 2px;
}

.fact-sidebar-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--muted-foreground);
  text-decoration: none;
  transition: background 0.12s, color 0.12s;
}

.fact-sidebar-link:hover {
  background: var(--muted);
  color: var(--foreground);
}

.fact-sidebar-link.active {
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  color: var(--primary);
  font-weight: 600;
}

.fact-sidebar-link-main {
  font-weight: 600;
  color: var(--foreground);
}

.fact-main .page-header h1 {
  font-size: 1.35rem;
}

.fact-gen-filters {
  padding: 1rem;
}

.fact-gen-filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  align-items: end;
}

.fact-gen-filters-actions {
  display: flex;
  align-items: flex-end;
}

.kpi-grid-6 {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

@media (max-width: 1100px) {
  .kpi-grid-6 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .kpi-grid-6 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.fact-gen-kpi-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.fact-gen-view-toggle {
  display: flex;
  gap: 4px;
  margin-bottom: 1rem;
}

.fact-gen-enseignes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  margin-bottom: 1rem;
}

.fact-gen-ens-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.fact-gen-row {
  cursor: pointer;
}

.fact-gen-row:hover td {
  background: rgba(99, 102, 241, 0.06);
}

/* Drawer fiche */
.fact-fiche-drawer {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9100;
}

.fact-fiche-drawer.is-open {
  display: block;
}

.fact-fiche-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(3px);
}

.fact-fiche-drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(640px, 100%);
  height: 100%;
  background: var(--card);
  box-shadow: -8px 0 40px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.fact-fiche-drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, var(--muted) 0%, var(--card) 100%);
  flex-shrink: 0;
}

.fact-fiche-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.15rem 2rem;
}

.fact-fiche-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.fact-ebp-preview {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem;
  background: var(--muted);
}

.fact-ebp-doc-header {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.fact-ebp-title {
  font-size: 1.15rem;
  font-weight: 600;
}

.fact-ebp-meta th,
.fact-ebp-meta td {
  font-size: 0.78rem;
}

.fact-ebp-entete td {
  font-style: italic;
  color: var(--muted-foreground);
  border-bottom: none !important;
}

.fact-ebp-totals {
  margin-top: 0.75rem;
  display: grid;
  gap: 0.5rem;
}

.fact-ebp-tva {
  max-width: 360px;
}

.fact-ebp-total-line {
  display: flex;
  justify-content: flex-end;
  gap: 1.5rem;
  font-size: 0.9rem;
}

.fact-jour-acquitte td {
  background: rgba(59, 130, 246, 0.06);
}

.fact-jour-manquant td {
  background: rgba(245, 158, 11, 0.08);
}