/* ==========================================================================
   AUTO GUADELOUPE STORE — Administration
   Design system autonome (aucune dépendance CDN).
   Direction : clair, minimal, dense — inspiration Linear / Notion.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Jetons de design
   -------------------------------------------------------------------------- */
:root {
  /* Surfaces */
  --bg-app:        #fbfbfa;
  --bg-surface:    #ffffff;
  --bg-sunken:     #f6f6f4;
  --bg-hover:      #f4f4f2;
  --bg-active:     #eeeeeb;

  /* Bordures */
  --border:        #e9e9e6;
  --border-strong: #dcdcd7;

  /* Texte */
  --text:          #1a1a19;
  --text-2:        #5f5f59;
  --text-3:        #8d8d85;
  --text-inverse:  #ffffff;

  /* Accent — bleu Auto Guadeloupe */
  --accent:        #1f56c3;
  --accent-hover:  #18449c;
  --accent-soft:   #eef3fc;
  --accent-border: #cfdcf5;

  /* États */
  --success:       #16704a;
  --success-soft:  #e9f5ef;
  --warning:       #8a6100;
  --warning-soft:  #fdf4e2;
  --danger:        #b02a1f;
  --danger-hover:  #8f2018;
  --danger-soft:   #fceceb;
  --info:          #1f5f9e;
  --info-soft:     #ecf3fa;

  /* Rayons */
  --r-sm: 6px;
  --r:    8px;
  --r-lg: 12px;
  --r-xl: 16px;

  /* Ombres */
  --shadow-xs: 0 1px 2px rgba(20, 20, 19, .05);
  --shadow-sm: 0 1px 3px rgba(20, 20, 19, .07);
  --shadow:    0 4px 12px rgba(20, 20, 19, .07), 0 1px 3px rgba(20, 20, 19, .05);
  --shadow-lg: 0 16px 48px rgba(20, 20, 19, .14), 0 4px 12px rgba(20, 20, 19, .06);

  /* Typo */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;

  /* Gabarit */
  --sidebar-w: 248px;
  --topbar-h:  60px;

  --ease: cubic-bezier(.16, 1, .3, 1);
}

/* --------------------------------------------------------------------------
   2. Base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg-app);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv11', 'ss01';
}

h1, h2, h3, h4, h5, h6, p, figure { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
table { border-collapse: collapse; width: 100%; }
hr { border: 0; border-top: 1px solid var(--border); margin: 20px 0; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

::selection { background: var(--accent-soft); }

/* Barres de défilement discrètes */
* { scrollbar-width: thin; scrollbar-color: #d5d5d0 transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb {
  background: #d9d9d4;
  border-radius: 8px;
  border: 3px solid transparent;
  background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover { background: #c4c4be; background-clip: content-box; }
*::-webkit-scrollbar-track { background: transparent; }

/* Icônes (sprite SVG) */
.ico { width: 16px; height: 16px; flex: none; stroke-width: 1.75; }
.ico--lg { width: 20px; height: 20px; }
.ico--xl { width: 28px; height: 28px; }

/* --------------------------------------------------------------------------
   3. Gabarit général
   -------------------------------------------------------------------------- */
.admin { display: flex; min-height: 100vh; }

/* ---- Barre latérale ---- */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: var(--bg-app);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 40;
  transition: transform .3s var(--ease);
}

.sidebar-head {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  flex: none;
}
.sidebar-logo {
  width: 30px; height: 30px;
  border-radius: var(--r-sm);
  background: var(--text);
  color: var(--bg-surface);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
  font-family: Georgia, serif;
  flex: none;
}
.sidebar-title { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.sidebar-title strong { font-size: 13.5px; font-weight: 600; letter-spacing: -.01em; }
.sidebar-title span { font-size: 11px; color: var(--text-3); }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 8px 10px 16px; }

.nav-group + .nav-group { margin-top: 20px; }
.nav-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 0 8px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-radius: var(--r-sm);
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 500;
  transition: background .12s, color .12s;
  position: relative;
}
.nav-item:hover { background: var(--bg-hover); color: var(--text); }
.nav-item.is-active { background: var(--bg-active); color: var(--text); font-weight: 600; }
.nav-item.is-active .ico { color: var(--accent); }
.nav-item .ico { color: var(--text-3); transition: color .12s; }
.nav-item:hover .ico { color: var(--text-2); }
.nav-item-count {
  margin-left: auto;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-3);
  background: var(--bg-sunken);
  border-radius: 20px;
  padding: 1px 7px;
}
.nav-item.is-active .nav-item-count { background: var(--bg-surface); color: var(--text-2); }

/* Pied de la barre latérale : compte utilisateur */
.sidebar-foot { flex: none; border-top: 1px solid var(--border); padding: 10px; }

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 8px;
  border: 0;
  background: none;
  border-radius: var(--r-sm);
  text-align: left;
  transition: background .12s;
}
.user-chip:hover { background: var(--bg-hover); }
.avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent-border);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
  flex: none;
}
.user-chip-text { min-width: 0; line-height: 1.25; }
.user-chip-text strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-chip-text span { display: block; font-size: 11px; color: var(--text-3); }

/* ---- Zone principale ---- */
.main {
  flex: 1;
  min-width: 0;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--topbar-h);
  background: rgba(251, 251, 250, .85);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
}
.topbar-crumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--text-3);
  min-width: 0;
}
.topbar-crumb a:hover { color: var(--text); }
.topbar-crumb strong {
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-crumb .sep { color: var(--border-strong); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.sidebar-toggle {
  display: none;
  width: 32px; height: 32px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  border-radius: var(--r-sm);
  place-items: center;
}

.content { padding: 28px 24px 64px; flex: 1; }
.content-inner { max-width: 1180px; margin: 0 auto; }
.content-inner--narrow { max-width: 820px; }

/* En-tête de page */
.page-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.page-head h1 {
  font-size: 24px;
  font-weight: 650;
  letter-spacing: -.02em;
  line-height: 1.25;
}
.page-head p { color: var(--text-2); font-size: 13.5px; margin-top: 3px; }
.page-head-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* --------------------------------------------------------------------------
   4. Boutons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 34px;
  padding: 0 13px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  font-size: 13.5px;
  font-weight: 550;
  letter-spacing: -.005em;
  white-space: nowrap;
  transition: background .13s, border-color .13s, color .13s, box-shadow .13s;
  user-select: none;
}
.btn:disabled, .btn.is-disabled { opacity: .5; pointer-events: none; }

.btn--primary {
  background: var(--text);
  color: var(--text-inverse);
  box-shadow: var(--shadow-xs);
}
.btn--primary:hover { background: #333331; }

.btn--accent {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-xs);
}
.btn--accent:hover { background: var(--accent-hover); }

.btn--default {
  background: var(--bg-surface);
  border-color: var(--border-strong);
  color: var(--text);
  box-shadow: var(--shadow-xs);
}
.btn--default:hover { background: var(--bg-hover); }

.btn--ghost { background: transparent; color: var(--text-2); }
.btn--ghost:hover { background: var(--bg-hover); color: var(--text); }

.btn--danger { background: var(--danger); color: #fff; }
.btn--danger:hover { background: var(--danger-hover); }

.btn--danger-ghost { background: transparent; color: var(--danger); }
.btn--danger-ghost:hover { background: var(--danger-soft); }

.btn--sm { height: 28px; padding: 0 10px; font-size: 12.5px; gap: 5px; }
.btn--lg { height: 40px; padding: 0 18px; font-size: 14.5px; }
.btn--icon { width: 34px; padding: 0; }
.btn--icon.btn--sm { width: 28px; }
.btn--block { width: 100%; }

/* Bouton d'action discret dans les tableaux */
.icon-btn {
  width: 28px; height: 28px;
  display: inline-grid;
  place-items: center;
  border: 0;
  background: transparent;
  border-radius: var(--r-sm);
  color: var(--text-3);
  transition: background .12s, color .12s;
}
.icon-btn:hover { background: var(--bg-hover); color: var(--text); }
.icon-btn--danger:hover { background: var(--danger-soft); color: var(--danger); }

/* --------------------------------------------------------------------------
   5. Cartes
   -------------------------------------------------------------------------- */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
}
.card + .card { margin-top: 20px; }

.card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.card-head h2, .card-head h3 {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.01em;
}
.card-head p { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.card-head-actions { margin-left: auto; display: flex; gap: 8px; }

.card-body { padding: 20px; }
.card-body--flush { padding: 0; }
.card-foot {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg-sunken);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
  display: flex;
  align-items: center;
  gap: 10px;
}

/* --------------------------------------------------------------------------
   6. Statistiques
   -------------------------------------------------------------------------- */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.stat {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow-xs);
  transition: box-shadow .18s, transform .18s;
}
.stat:hover { box-shadow: var(--shadow-sm); }
.stat-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-3);
}
.stat-label .ico { width: 14px; height: 14px; }
.stat-value {
  font-size: 28px;
  font-weight: 650;
  letter-spacing: -.03em;
  line-height: 1.1;
  margin-top: 8px;
}
.stat-hint { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.stat--accent .stat-value { color: var(--accent); }

/* --------------------------------------------------------------------------
   7. Formulaires
   -------------------------------------------------------------------------- */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.form-grid--1 { grid-template-columns: minmax(0, 1fr); }
.form-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.span-2 { grid-column: 1 / -1; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }

.label {
  font-size: 13px;
  font-weight: 550;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}
.label .req { color: var(--danger); font-weight: 400; }
.hint { font-size: 12px; color: var(--text-3); line-height: 1.5; }
.error-text { font-size: 12px; color: var(--danger); }

.input, .select, .textarea {
  width: 100%;
  min-height: 36px;
  padding: 7px 11px;
  font: inherit;
  font-size: 13.5px;
  color: var(--text);
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  transition: border-color .13s, box-shadow .13s, background .13s;
  box-shadow: var(--shadow-xs);
}
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:hover, .select:hover, .textarea:hover { border-color: #c9c9c3; }
.input:focus, .select:focus, .textarea:focus {
  outline: 0;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(31, 86, 195, .13);
}
.input:disabled, .textarea:disabled { background: var(--bg-sunken); color: var(--text-3); }
.input.has-error, .textarea.has-error { border-color: var(--danger); }

.textarea { min-height: 92px; resize: vertical; line-height: 1.6; }
.textarea--lg { min-height: 160px; }

.select {
  appearance: none;
  padding-right: 32px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238d8d85' stroke-width='1.8'%3E%3Cpath d='M4 6.5l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.input-prefix { display: flex; align-items: stretch; }
.input-prefix .prefix {
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  background: var(--bg-sunken);
  border: 1px solid var(--border-strong);
  border-right: 0;
  border-radius: var(--r-sm) 0 0 var(--r-sm);
  font-size: 12.5px;
  color: var(--text-3);
  font-family: var(--mono);
  white-space: nowrap;
}
.input-prefix .input { border-radius: 0 var(--r-sm) var(--r-sm) 0; }

/* Interrupteur */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track {
  width: 36px; height: 20px;
  border-radius: 20px;
  background: var(--border-strong);
  position: relative;
  transition: background .18s var(--ease);
  flex: none;
}
.switch-track::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow-xs);
  transition: transform .18s var(--ease);
}
.switch input:checked + .switch-track { background: var(--success); }
.switch input:checked + .switch-track::after { transform: translateX(16px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch-text { font-size: 13.5px; font-weight: 500; }

/* Cases à cocher / radios */
.check { display: inline-flex; align-items: flex-start; gap: 9px; cursor: pointer; font-size: 13.5px; }
.check input { margin: 2px 0 0; accent-color: var(--accent); width: 15px; height: 15px; }

/* Groupe de champs */
.fieldset { border: 0; padding: 0; margin: 0; }
.fieldset + .fieldset { margin-top: 28px; padding-top: 28px; border-top: 1px solid var(--border); }
.fieldset-head { margin-bottom: 16px; }
.fieldset-head h3 { font-size: 14px; font-weight: 620; letter-spacing: -.01em; }
.fieldset-head p { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }

/* --------------------------------------------------------------------------
   8. Tableaux
   -------------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; border-radius: 0 0 var(--r-lg) var(--r-lg); }

.table { font-size: 13.5px; }
.table th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 10px 16px;
  background: var(--bg-sunken);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table tbody tr { transition: background .1s; }
.table tbody tr:hover { background: var(--bg-hover); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .col-actions { width: 1%; white-space: nowrap; text-align: right; }
.table .cell-title { font-weight: 550; color: var(--text); }
.table .cell-muted { color: var(--text-3); font-size: 12.5px; }

.row-actions { display: flex; gap: 2px; justify-content: flex-end; }

.thumb {
  width: 40px; height: 40px;
  border-radius: var(--r-sm);
  object-fit: cover;
  background: var(--bg-sunken);
  border: 1px solid var(--border);
}
.thumb--empty {
  display: grid;
  place-items: center;
  color: var(--text-3);
}

/* Un bloc de SQL a copier : il doit pouvoir etre selectionne d'un geste,
   et ne jamais replier une instruction au milieu d'un nom de colonne. */
.code-bloc {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--bg-sunken);
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  user-select: all;
}

.code {
  font-family: var(--mono);
  font-size: 12px;
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  color: var(--text-2);
}

/* --------------------------------------------------------------------------
   9. Badges, pastilles, alertes
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 21px;
  padding: 0 8px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .01em;
  white-space: nowrap;
}
.badge::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
}
.badge--success { background: var(--success-soft); color: var(--success); }
.badge--warning { background: var(--warning-soft); color: var(--warning); }
.badge--danger  { background: var(--danger-soft);  color: var(--danger); }
.badge--info    { background: var(--info-soft);    color: var(--info); }
.badge--accent  { background: var(--accent-soft);  color: var(--accent); }
.badge--muted   { background: var(--bg-sunken);    color: var(--text-3); }
.badge--plain::before { display: none; }

.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--r);
  border: 1px solid transparent;
  font-size: 13.5px;
  line-height: 1.55;
  margin-bottom: 18px;
}
.alert .ico { margin-top: 1px; }
.alert--success { background: var(--success-soft); border-color: #cfe6da; color: var(--success); }
.alert--error   { background: var(--danger-soft);  border-color: #f3d3d0; color: var(--danger); }
.alert--warning { background: var(--warning-soft); border-color: #f0e0bd; color: var(--warning); }
.alert--info    { background: var(--info-soft);    border-color: #d3e2f2; color: var(--info); }
.alert a { text-decoration: underline; font-weight: 600; }
.alert ul { list-style: disc; padding-left: 18px; }

/* État vide */
.empty {
  text-align: center;
  padding: 56px 24px;
  color: var(--text-3);
}
.empty .ico--xl { margin: 0 auto 12px; color: var(--border-strong); }
.empty strong { display: block; color: var(--text); font-size: 14.5px; font-weight: 600; margin-bottom: 4px; }
.empty p { font-size: 13px; max-width: 380px; margin: 0 auto 18px; }

/* --------------------------------------------------------------------------
   10. Onglets
   -------------------------------------------------------------------------- */
.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  position: relative;
  padding: 11px 12px;
  border: 0;
  background: none;
  font-size: 13.5px;
  font-weight: 520;
  color: var(--text-3);
  white-space: nowrap;
  transition: color .13s;
}
.tab:hover { color: var(--text); }
.tab.is-active { color: var(--text); font-weight: 600; }
.tab.is-active::after {
  content: '';
  position: absolute;
  left: 8px; right: 8px; bottom: -1px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px 2px 0 0;
}
.tab-count {
  margin-left: 6px;
  font-size: 11px;
  font-weight: 600;
  background: var(--bg-sunken);
  border-radius: 20px;
  padding: 1px 6px;
  color: var(--text-3);
}

.tab-panel { display: none; padding: 22px 20px; }
.tab-panel.is-active { display: block; animation: fade .2s var(--ease); }

@keyframes fade { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }

/* --------------------------------------------------------------------------
   11. Zone de dépôt et grilles d'images
   -------------------------------------------------------------------------- */
.dropzone {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--r);
  background: var(--bg-sunken);
  padding: 22px 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  position: relative;
}
.dropzone:hover { border-color: var(--accent); background: var(--accent-soft); }
.dropzone.is-dragover { border-color: var(--accent); background: var(--accent-soft); }
.dropzone .ico { margin: 0 auto 8px; color: var(--text-3); }
.dropzone-text { font-size: 13px; font-weight: 550; }
.dropzone-hint { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.dropzone input[type="file"] { display: none; }

.dropzone-progress {
  display: none;
  height: 4px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 12px;
}
.dropzone-progress span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width .2s;
}
.dropzone.is-uploading .dropzone-progress { display: block; }
.dropzone.is-uploading .dropzone-text,
.dropzone.is-uploading .dropzone-hint,
.dropzone.is-uploading > .ico { opacity: .4; }

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.media-grid:empty { margin-top: 0; }
.media-grid--sm { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); }
.media-grid--single { grid-template-columns: minmax(0, 220px); }

.media-item {
  position: relative;
  border-radius: var(--r);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-sunken);
  aspect-ratio: 1;
}
.media-item img { width: 100%; height: 100%; object-fit: cover; }
.media-item.is-dragging { opacity: .4; }
.media-item.is-drop-target { outline: 2px solid var(--accent); outline-offset: -2px; }

.media-item-remove {
  position: absolute;
  top: 5px; right: 5px;
  width: 22px; height: 22px;
  border: 0;
  border-radius: 50%;
  background: rgba(20, 20, 19, .72);
  color: #fff;
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity .15s, background .15s;
}
.media-item:hover .media-item-remove { opacity: 1; }
.media-item-remove:hover { background: var(--danger); }
.media-item-remove .ico { width: 12px; height: 12px; }

.media-item-order {
  position: absolute;
  top: 5px; left: 5px;
  min-width: 18px; height: 18px;
  padding: 0 5px;
  border-radius: 20px;
  background: rgba(20, 20, 19, .72);
  color: #fff;
  font-size: 10.5px;
  font-weight: 600;
  display: grid;
  place-items: center;
}
.media-item-handle {
  position: absolute;
  inset: auto 0 0 0;
  padding: 4px;
  background: linear-gradient(transparent, rgba(20, 20, 19, .55));
  color: #fff;
  font-size: 10px;
  text-align: center;
  opacity: 0;
  transition: opacity .15s;
  cursor: grab;
}
.media-item:hover .media-item-handle { opacity: 1; }

/* Nuancier de façades */
.swatch-list { display: flex; flex-direction: column; gap: 10px; }
.swatch-row {
  display: grid;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--bg-surface);
  /* grid-template-columns : voir section 21 */
}
/* .swatch-preview servait à l'ancienne vignette non cliquable.
   Conservé pour l'aperçu du haut, qui utilise .facade-preview img. */

/* --------------------------------------------------------------------------
   12. Barre d'outils / filtres
   -------------------------------------------------------------------------- */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}
.search {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 340px;
}
.search .ico {
  position: absolute;
  left: 10px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  pointer-events: none;
}
.search .input { padding-left: 32px; }

.segmented {
  display: inline-flex;
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 2px;
  gap: 2px;
}
.segmented a {
  padding: 4px 11px;
  border-radius: 4px;
  font-size: 12.5px;
  font-weight: 550;
  color: var(--text-2);
  transition: background .12s, color .12s;
}
.segmented a:hover { color: var(--text); }
.segmented a.is-active { background: var(--bg-surface); color: var(--text); box-shadow: var(--shadow-xs); }

/* --------------------------------------------------------------------------
   13. Notifications
   -------------------------------------------------------------------------- */
.toast-stack {
  position: fixed;
  right: 20px; bottom: 20px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 240px;
  max-width: 380px;
  padding: 11px 14px;
  border-radius: var(--r);
  background: var(--text);
  color: #fff;
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  transform: translateY(12px);
  opacity: 0;
  transition: opacity .22s var(--ease), transform .22s var(--ease);
  pointer-events: auto;
}
.toast.is-visible { opacity: 1; transform: none; }
.toast .ico { flex: none; }
.toast--success .ico { color: #6ee7a8; }
.toast--error   { background: var(--danger); }
.toast--warning { background: var(--warning); }

/* --------------------------------------------------------------------------
   14. Fenêtre modale
   -------------------------------------------------------------------------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(20, 20, 19, .38);
  backdrop-filter: blur(2px);
  display: grid;
  place-items: center;
  padding: 24px;
  opacity: 0;
  transition: opacity .2s var(--ease);
}
.modal-backdrop.is-open { opacity: 1; }
.modal-backdrop[hidden] { display: none; }

.modal {
  background: var(--bg-surface);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 420px;
  transform: scale(.97);
  transition: transform .2s var(--ease);
}
.modal-backdrop.is-open .modal { transform: none; }
.modal-body { padding: 22px 24px; }
.modal-body h2 { font-size: 16px; font-weight: 620; margin-bottom: 6px; }
.modal-body p { font-size: 13.5px; color: var(--text-2); line-height: 1.6; }
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 24px;
  border-top: 1px solid var(--border);
  background: var(--bg-sunken);
  border-radius: 0 0 var(--r-xl) var(--r-xl);
}
.modal-icon {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  background: var(--danger-soft);
  color: var(--danger);
}

/* --------------------------------------------------------------------------
   15. Page de connexion
   -------------------------------------------------------------------------- */
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(1000px 500px at 50% -10%, #f3f6fc 0%, transparent 70%),
    var(--bg-app);
}
.login-card {
  width: 100%;
  max-width: 384px;
}
.login-brand { text-align: center; margin-bottom: 26px; }
.login-brand .sidebar-logo {
  width: 44px; height: 44px;
  font-size: 20px;
  margin: 0 auto 14px;
  border-radius: var(--r);
}
.login-brand h1 { font-size: 19px; font-weight: 620; letter-spacing: -.02em; }
.login-brand p { font-size: 13.5px; color: var(--text-3); margin-top: 3px; }

.login-box {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 26px;
  box-shadow: var(--shadow);
}
.login-box .field + .field { margin-top: 16px; }
.login-box .btn { margin-top: 22px; }
.login-foot { text-align: center; font-size: 12px; color: var(--text-3); margin-top: 20px; }

.password-wrap { position: relative; }
.password-wrap .input { padding-right: 38px; }
.password-toggle {
  position: absolute;
  right: 4px; top: 50%;
  transform: translateY(-50%);
  width: 28px; height: 28px;
  border: 0;
  background: none;
  border-radius: var(--r-sm);
  color: var(--text-3);
  display: grid;
  place-items: center;
}
.password-toggle:hover { background: var(--bg-hover); color: var(--text); }

/* --------------------------------------------------------------------------
   16. Utilitaires
   -------------------------------------------------------------------------- */
.stack     { display: flex; flex-direction: column; gap: 16px; }
.stack--sm { gap: 8px; }
.row       { display: flex; align-items: center; gap: 10px; }
.row--wrap { flex-wrap: wrap; }
.spacer    { margin-left: auto; }
.muted     { color: var(--text-3); }
.small     { font-size: 12.5px; }
.strong    { font-weight: 600; }
.truncate  { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-0  { margin-top: 0; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-0  { margin-bottom: 0; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.hidden { display: none !important; }

.link { color: var(--accent); font-weight: 550; }
.link:hover { text-decoration: underline; }

.url-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: var(--r);
  font-size: 12.5px;
  color: var(--text-2);
  overflow: hidden;
}
.url-preview a { font-family: var(--mono); color: var(--accent); font-size: 12px; }
.url-preview a:hover { text-decoration: underline; }

/* --------------------------------------------------------------------------
   17. Adaptatif
   -------------------------------------------------------------------------- */
@media (max-width: 1023px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); background: var(--bg-surface); }
  .sidebar.is-open { transform: none; }
  .main { margin-left: 0; }
  .sidebar-toggle { display: grid; }
  .content { padding: 20px 16px 56px; }
  .topbar { padding: 0 16px; }
  .form-grid, .form-grid--3 { grid-template-columns: minmax(0, 1fr); }
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 35;
  background: rgba(20, 20, 19, .3);
  opacity: 0;
  transition: opacity .25s var(--ease);
}
.sidebar-backdrop.is-visible { opacity: 1; }
.sidebar-backdrop[hidden] { display: none; }
@media (min-width: 1024px) { .sidebar-backdrop { display: none !important; } }

@media (max-width: 560px) {
  .page-head-actions { width: 100%; }
  .page-head-actions .btn { flex: 1; }
  .toolbar { padding: 12px 16px; }
  .search { max-width: none; }
  .card-body, .tab-panel { padding: 16px; }
  .tabs { padding: 0 8px; }
  .table th, .table td { padding: 10px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

@media print {
  .sidebar, .topbar, .page-head-actions, .toast-stack { display: none !important; }
  .main { margin-left: 0; }
  .card { border: 1px solid #ddd; box-shadow: none; }
}
/* ==========================================================================
   22. Écran Paramètres — navigation verticale
   Le nombre d'onglets a dépassé ce qu'une barre horizontale peut porter
   lisiblement : la navigation passe sur le côté.
   ========================================================================== */
.reglages {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  align-items: start;
}

.reglages-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 10px;
  border-right: 1px solid var(--border);
  position: sticky;
  top: calc(var(--topbar-h) + 16px);
}

.reglages-onglet {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  background: none;
  border-radius: var(--r-sm);
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 500;
  text-align: left;
  transition: background .12s, color .12s;
}
.reglages-onglet:hover { background: var(--bg-hover); color: var(--text); }
.reglages-onglet .ico { color: var(--text-3); flex: none; transition: color .12s; }
.reglages-onglet:hover .ico { color: var(--text-2); }

.reglages-onglet.is-active {
  background: var(--bg-active);
  color: var(--text);
  font-weight: 600;
}
.reglages-onglet.is-active .ico { color: var(--accent); }

.reglages-onglet span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reglages-panneaux { min-width: 0; }
.reglages-panneaux .tab-panel { padding: 22px 24px; }

/* Sous 900 px la colonne latérale mangerait la largeur utile :
   la navigation repasse en bandeau défilant au-dessus des champs. */
@media (max-width: 899px) {
  .reglages { grid-template-columns: minmax(0, 1fr); }

  .reglages-nav {
    position: static;
    flex-direction: row;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 10px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .reglages-nav::-webkit-scrollbar { display: none; }

  .reglages-onglet { width: auto; white-space: nowrap; }
  .reglages-onglet .ico { display: none; }

  .reglages-panneaux .tab-panel { padding: 18px 16px; }
}
/* --------------------------------------------------------------------------
   18. Demandes de contact
   -------------------------------------------------------------------------- */
.segmented-compte {
  display: inline-block;
  margin-left: 5px;
  padding: 0 5px;
  border-radius: 20px;
  background: var(--bg-sunken);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
}
.segmented a.is-active .segmented-compte { background: var(--bg-app); color: var(--text-2); }

/* Le compteur du menu passe en alerte tant que des demandes attendent. */
.nav-item-count--alerte { background: var(--warning-soft); color: var(--warning); }

/* Sélecteur compact, dans une ligne de tableau. */
.input--mini { height: 28px; padding: 0 26px 0 8px; font-size: 12.5px; }
.statut-inline { display: inline-flex; align-items: center; gap: 6px; }

/* Fiche en deux colonnes : intitulé au-dessus, valeur en dessous. */
.fiche {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px 32px;
  margin: 0;
}
@media (min-width: 640px) { .fiche { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.fiche dt {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-3);
  margin-bottom: 3px;
}
.fiche dd { margin: 0; font-size: 14px; color: var(--text); }
.fiche dd a { color: var(--accent); }

/* Le message reçu : on garde les retours à la ligne de la personne. */
.message-recu {
  padding: 16px 18px;
  border-radius: var(--r-sm);
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  font-size: 14px;
  line-height: 1.65;
  color: var(--text);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* --------------------------------------------------------------------------
   19. Interrupteur
   -------------------------------------------------------------------------- */
.bascule {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  cursor: pointer;
  user-select: none;
}
/* La vraie case reste dans le document : c'est elle qui reçoit le focus
   clavier et qui est lue par un lecteur d'écran. On la rend seulement
   invisible, sans la retirer. */
.bascule input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.bascule-piste {
  flex: none;
  width: 40px;
  height: 23px;
  margin-top: 1px;
  border-radius: 999px;
  background: var(--border-strong);
  transition: background .18s ease;
}
.bascule-pastille {
  display: block;
  width: 17px;
  height: 17px;
  margin: 3px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow-xs);
  transition: transform .18s ease;
}
.bascule input:checked + .bascule-piste { background: var(--success); }
.bascule input:checked + .bascule-piste .bascule-pastille { transform: translateX(17px); }
.bascule input:focus-visible + .bascule-piste {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.bascule-texte strong { display: block; font-size: 14px; color: var(--text); }
.bascule-texte .hint { margin-top: 2px; }

@media (prefers-reduced-motion: reduce) {
  .bascule-piste, .bascule-pastille { transition: none; }
}
/* Trois chiffres en tête de l'onglet des adresses. */
.chiffres {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  padding: 18px 20px 0;
}
.chiffre {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--bg-sunken);
}
.chiffre strong {
  display: block;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.1;
  color: var(--text);
}
.chiffre span { font-size: 12.5px; color: var(--text-3); }

/* ==========================================================================
   AUTO GUADELOUPE — Composants propres au stock véhicules
   ========================================================================== */
.content-inner--wide { max-width: 1600px; }
.sidebar-logo { font-family: var(--font); font-size: 12px; letter-spacing: -.02em; background: var(--accent); }
.mono { font-family: var(--mono); font-size: 12.5px; letter-spacing: .01em; }
.nowrap { white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table th.num { text-align: right; }

/* Pastille de référentiel colorée (couleur définie dans Référentiels) */
.badge--ref {
  background: color-mix(in srgb, var(--c) 11%, #fff);
  color: color-mix(in srgb, var(--c) 82%, #000);
}

/* Plaque d'immatriculation */
.plaque {
  display: inline-flex;
  align-items: stretch;
  height: 22px;
  border: 1px solid #c9ccd3;
  border-radius: 4px;
  background: #fff;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .04em;
  overflow: hidden;
  white-space: nowrap;
  box-shadow: var(--shadow-xs);
}
.plaque::before { content: ''; width: 7px; background: #1f4fb5; flex: none; }
.plaque span { padding: 0 7px; display: flex; align-items: center; }
.plaque--vide { color: var(--text-3); font-weight: 500; font-family: var(--font); font-size: 11.5px; }

/* ---- Filtres du listing ---- */
.filtres {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}
.filtres .search { max-width: 280px; min-width: 220px; flex: 0 1 280px; }
.filtres .select { width: auto; min-width: 128px; max-width: 200px; min-height: 34px; padding-top: 5px; padding-bottom: 5px; }
.filtres .select.is-set { border-color: var(--accent); background-color: var(--accent-soft); color: var(--accent-hover); font-weight: 550; }
.filtres-reset { margin-left: 2px; }
.filtres-bas {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 20px; border-bottom: 1px solid var(--border); background: var(--bg-sunken);
  font-size: 12.5px; color: var(--text-3);
}
.filtres-bas strong { color: var(--text); font-weight: 600; }

/* Tableau des véhicules */
.table--vehicules td { padding-top: 9px; padding-bottom: 9px; }
.table--vehicules tbody tr { cursor: pointer; }
.table--vehicules tr.is-archive td { color: var(--text-3); }
.table--vehicules tr.is-archive .thumb { filter: grayscale(1); opacity: .6; }
.vehicule-cell { display: flex; align-items: center; gap: 12px; min-width: 280px; }
.vehicule-cell .thumb { width: 64px; height: 44px; flex: none; }
.vehicule-texte { min-width: 0; }
.vehicule-texte strong { display: block; font-weight: 600; line-height: 1.3; color: var(--text); white-space: nowrap; }
.vehicule-texte span { display: block; font-size: 12px; color: var(--text-3); line-height: 1.35; max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vehicule-texte span.mono { font-size: 11px; }
.type-pastille { font-style: normal; font-size: 10px; font-weight: 650; letter-spacing: .03em; color: var(--text-2); background: var(--bg-sunken); border: 1px solid var(--border); border-radius: 4px; padding: 0 4px; margin-left: 4px; vertical-align: 1px; }
.table--vehicules th, .table--vehicules td { padding-left: 12px; padding-right: 12px; }
.table--vehicules th:first-child, .table--vehicules td:first-child { padding-left: 20px; }
.photos-compte { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--text-2); }
.photos-compte .ico { width: 14px; height: 14px; color: var(--text-3); }
.photos-compte--zero { color: var(--warning); }
.photos-compte--zero .ico { color: var(--warning); }

.th-sort { display: inline-flex; align-items: center; gap: 4px; color: inherit; }
.th-sort:hover { color: var(--text); }
.th-sort.is-active { color: var(--text); }
.th-sort .fleche { font-size: 10px; opacity: .8; }

.table-wrap { transition: opacity .15s; }
.table-wrap.is-loading { opacity: .45; pointer-events: none; }

/* Pagination */
.pagination { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.pagination a, .pagination span {
  min-width: 30px; height: 30px; padding: 0 9px;
  display: inline-grid; place-items: center;
  border-radius: var(--r-sm); font-size: 13px; font-weight: 550; color: var(--text-2);
}
.pagination a:hover { background: var(--bg-hover); color: var(--text); }
.pagination .is-active { background: var(--text); color: #fff; }
.pagination .gap { color: var(--text-3); }

/* ---- Fiche véhicule ---- */
.fiche-entete { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.fiche-entete .thumb { width: 96px; height: 64px; border-radius: var(--r); }
.fiche-grille { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
@media (max-width: 1100px) { .fiche-grille { grid-template-columns: minmax(0, 1fr); } }
.fiche-cote .card + .card { margin-top: 16px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 13px; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; text-align: right; font-weight: 550; }
.input-suffix { position: relative; }
.input-suffix .input { padding-right: 38px; }
.input-suffix .suffix { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); font-size: 12.5px; color: var(--text-3); pointer-events: none; }

/* ---- Photos ---- */
.media-grid--photos { grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; }
.media-grid--photos .media-item { aspect-ratio: 4 / 3; cursor: grab; }
.media-grid--photos .media-item:active { cursor: grabbing; }
.media-item-order { min-width: 22px; height: 22px; font-size: 11px; }
.media-item:first-child .media-item-order { background: var(--accent); }
.media-item-principale {
  position: absolute; left: 5px; bottom: 5px;
  padding: 2px 8px; border-radius: 20px;
  background: var(--accent); color: #fff; font-size: 10.5px; font-weight: 600;
  display: none;
}
.media-item:first-child .media-item-principale { display: block; }
.media-item-poids {
  position: absolute; right: 5px; bottom: 5px;
  padding: 2px 6px; border-radius: 20px;
  background: rgba(20, 20, 19, .62); color: #fff; font-size: 10px; font-weight: 500;
  opacity: 0; transition: opacity .15s;
}
.media-item:hover .media-item-poids { opacity: 1; }
.media-item.is-uploading { display: grid; place-items: center; cursor: default; }
.media-item.is-uploading .dropzone-progress { display: block; width: 70%; margin: 0; }
.media-item.is-uploading small { position: absolute; bottom: 8px; left: 8px; right: 8px; text-align: center; font-size: 11px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dropzone--photos { padding: 28px 16px; }

/* ---- Import ---- */
.etapes { display: flex; gap: 6px; align-items: center; margin-bottom: 20px; flex-wrap: wrap; font-size: 13px; }
.etape { display: flex; align-items: center; gap: 8px; color: var(--text-3); font-weight: 550; }
.etape b {
  width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--bg-sunken); border: 1px solid var(--border-strong);
  font-size: 11px; color: var(--text-3);
}
.etape.is-active { color: var(--text); }
.etape.is-active b { background: var(--accent); border-color: var(--accent); color: #fff; }
.etape.is-done b { background: var(--success); border-color: var(--success); color: #fff; }
.etape-sep { width: 28px; height: 1px; background: var(--border-strong); }

.chiffres--import { padding: 0; margin-bottom: 20px; }
.chiffre--success strong { color: var(--success); }
.chiffre--info strong { color: var(--info); }
.chiffre--warning strong { color: var(--warning); }
.chiffre--danger strong { color: var(--danger); }

details.bloc { border: 1px solid var(--border); border-radius: var(--r); background: var(--bg-surface); }
details.bloc + details.bloc { margin-top: 10px; }
details.bloc > summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; font-weight: 600; font-size: 13.5px;
}
details.bloc > summary::-webkit-details-marker { display: none; }
details.bloc > summary::after { content: '▸'; margin-left: auto; color: var(--text-3); transition: transform .15s; }
details.bloc[open] > summary::after { transform: rotate(90deg); }
details.bloc > .bloc-corps { border-top: 1px solid var(--border); max-height: 420px; overflow: auto; }
details.bloc .table th { position: sticky; top: 0; z-index: 1; }

.diff { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; }
.diff span { white-space: nowrap; }
.diff em { font-style: normal; color: var(--text-3); }
.diff del { color: var(--danger); text-decoration: line-through; text-decoration-color: rgba(176, 42, 31, .4); }
.diff ins { color: var(--success); text-decoration: none; font-weight: 600; }

.colonnes-trouvees { display: flex; flex-wrap: wrap; gap: 6px; }
.colonnes-trouvees .pastille b { font-family: var(--mono); color: var(--text-3); font-weight: 600; margin-right: 4px; }

/* ---- Référentiels ---- */
.ref-liste { display: flex; flex-direction: column; }
.ref-row {
  display: grid;
  grid-template-columns: 22px 34px minmax(140px, 1.2fr) minmax(140px, 1fr) 90px auto;
  gap: 10px; align-items: center;
  padding: 8px 20px; border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
}
.ref-row:last-child { border-bottom: 0; }
.ref-row.is-dragging { opacity: .45; }
.ref-row.is-drop-target { box-shadow: inset 0 2px 0 var(--accent); }
.ref-row .swatch-handle { height: 30px; }
.ref-row .input { min-height: 32px; padding-top: 5px; padding-bottom: 5px; }
.ref-couleur { width: 34px; height: 32px; padding: 2px; border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: #fff; cursor: pointer; }
.ref-compte { font-size: 12.5px; color: var(--text-3); text-align: right; white-space: nowrap; }
.ref-compte strong { color: var(--text); }
.ref-groupe { padding: 10px 20px 6px; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); background: var(--bg-sunken); border-bottom: 1px solid var(--border); }
.ref-entete { display: grid; grid-template-columns: 22px 34px minmax(140px, 1.2fr) minmax(140px, 1fr) 90px auto; gap: 10px; padding: 8px 20px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; color: var(--text-3); border-bottom: 1px solid var(--border); background: var(--bg-sunken); }
@media (max-width: 860px) {
  .ref-row, .ref-entete { grid-template-columns: 22px 34px minmax(0, 1fr) auto; }
  .ref-row > .ref-alias, .ref-row > .ref-compte, .ref-entete > :nth-child(4), .ref-entete > :nth-child(5) { display: none; }
}

/* ---- Paramètres : curseur de qualité ---- */
.range-row { display: flex; align-items: center; gap: 14px; }
.range-row input[type=range] { flex: 1; accent-color: var(--accent); }
.range-row output { min-width: 44px; text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; }
.apercu-qualite { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.apercu-qualite figure { border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; background: var(--bg-sunken); }
.apercu-qualite img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.apercu-qualite figcaption { padding: 8px 10px; font-size: 12px; color: var(--text-2); display: flex; justify-content: space-between; }

/* ---- Tableau de bord ---- */
.grille-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.grille-2 > .card + .card { margin-top: 0; }
@media (max-width: 900px) { .grille-2 { grid-template-columns: minmax(0, 1fr); } }
.barres { display: flex; flex-direction: column; gap: 9px; }
.barre { display: grid; grid-template-columns: 120px minmax(0, 1fr) 44px; gap: 10px; align-items: center; font-size: 13px; }
.barre-libelle { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.barre-piste { height: 8px; background: var(--bg-sunken); border-radius: 8px; overflow: hidden; }
.barre-piste span { display: block; height: 100%; background: var(--c, var(--accent)); border-radius: 8px; }
.barre-valeur { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
a.barre:hover .barre-libelle { color: var(--accent); }
/* --------------------------------------------------------------------------
   21. Diagnostic d'envoi
   -------------------------------------------------------------------------- */
.diagnostic { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.diagnostic-point {
  display: flex;
  gap: 10px;
  padding: 11px 13px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--bg-sunken);
}
.diagnostic-point .ico { margin-top: 2px; }
.diagnostic-point strong { display: block; font-size: 13.5px; color: var(--text); }
.diagnostic-point .hint { margin-top: 2px; }

.diagnostic-point--ok        { border-color: #cfe6da; background: var(--success-soft, #e9f5ef); }
.diagnostic-point--ok .ico   { color: var(--success); }
.diagnostic-point--attention { border-color: #f0e0bd; background: var(--warning-soft); }
.diagnostic-point--attention .ico { color: var(--warning); }
.diagnostic-point--erreur    { border-color: #f3d3d0; background: var(--danger-soft); }
.diagnostic-point--erreur .ico    { color: var(--danger); }

/* Badge d'alerte accolé à un statut. */
.badge--warning .ico { width: 12px; height: 12px; margin-right: 3px; vertical-align: -1px; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.diagnostic-point--ok { border-color: #cfe6da; }

.thumb-wrap { position: relative; flex: none; display: block; }
.thumb-compte { position: absolute; right: 3px; bottom: 3px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: rgba(20,20,19,.72); color: #fff; font-size: 10px; font-weight: 650; display: grid; place-items: center; }
.vehicule-cell .thumb--sans { border-style: dashed; border-color: #e6c98a; background: var(--warning-soft); color: var(--warning); }
.apercu-qualite .chiffres { align-content: start; }
@media (max-width: 700px) {
  .filtres { padding: 12px 16px; }
  .filtres .search { flex: 1 1 100%; max-width: none; }
  .filtres .select { flex: 1 1 calc(50% - 4px); max-width: none; min-width: 0; }
  .filtres-bas { padding: 10px 16px; }
  .segmented a { padding: 4px 8px; }
}

/* ---- Mapping référentiel externe ---- */
.ext-chip {
  display: flex; align-items: center; gap: 4px;
  margin-top: 5px; max-width: 150px; height: 20px; padding: 0 7px;
  border: 1px solid var(--border); border-radius: 20px; background: var(--bg-surface);
  font-size: 11px; font-weight: 600; color: var(--success); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  cursor: pointer; transition: border-color .12s, background .12s;
}
.ext-chip .ico { width: 11px; height: 11px; flex: none; }
.ext-chip:hover { border-color: var(--accent); background: var(--accent-soft); }
.ext-chip--manquant { color: var(--danger); background: var(--danger-soft); border-color: #f3d3d0; }
.ext-chip--manuel { color: var(--info); }
.modal--large { max-width: 560px; }
.radios { display: flex; flex-direction: column; gap: 8px; }
.radio-carte { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r-sm); cursor: pointer; font-size: 13px; }
.radio-carte:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.radio-carte input { margin-top: 3px; accent-color: var(--accent); }
.radio-carte strong { display: block; font-weight: 600; }
.radio-carte span { color: var(--text-3); font-size: 12px; }
.chiffres--import a.chiffre:hover { border-color: var(--accent); }
.radio-carte[hidden] { display: none; }
.ext-ajout { padding: 12px; border: 1px solid var(--border); border-radius: var(--r); background: var(--bg-sunken); }
.table--vehicules th, .table--vehicules td { padding-left: 10px; padding-right: 10px; }
.vehicule-texte span { max-width: 250px; }

/* ---- Photos : IA Photoroom ---- */
.photos-barre { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.ia-bascule { display: inline-flex; align-items: center; gap: 9px; padding: 6px 12px 6px 6px; border: 1px solid var(--border-strong); border-radius: 30px; background: var(--bg-surface); cursor: pointer; font-size: 13px; font-weight: 550; user-select: none; transition: border-color .15s, background .15s; }
.ia-bascule input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ia-pastille { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 9px; border-radius: 20px; background: var(--bg-sunken); color: var(--text-3); font-size: 11.5px; font-weight: 700; letter-spacing: .02em; transition: background .15s, color .15s; }
.ia-pastille .ico { width: 13px; height: 13px; }
.ia-bascule:has(input:checked) { border-color: #b9a4f5; background: #f6f2ff; }
.ia-bascule:has(input:checked) .ia-pastille { background: linear-gradient(135deg, #7c4dff, #c25bf5); color: #fff; }
.ia-bascule:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.ia-bascule.is-disabled { opacity: .55; cursor: not-allowed; }
.media-item-ia { position: absolute; left: 5px; top: 30px; display: inline-flex; align-items: center; gap: 3px; height: 18px; padding: 0 6px; border-radius: 20px; background: linear-gradient(135deg, #7c4dff, #c25bf5); color: #fff; font-size: 10px; font-weight: 700; }
.media-item-ia .ico { width: 10px; height: 10px; }
.media-item.is-ia { background: #fff; }
.media-item.is-ia img { object-fit: contain; }
.media-item-actions { position: absolute; right: 5px; top: 32px; display: flex; flex-direction: column; gap: 4px; opacity: 0; transition: opacity .15s; }
.media-item:hover .media-item-actions { opacity: 1; }
.media-item-actions button, .media-item-actions a { width: 26px; height: 26px; border: 0; border-radius: 50%; background: rgba(20,20,19,.72); color: #fff; display: grid; place-items: center; cursor: pointer; }
.media-item-actions button:hover, .media-item-actions a:hover { background: #7c4dff; }
.media-item-actions .ico { width: 13px; height: 13px; }
.media-item.is-busy { pointer-events: none; }
.media-item.is-busy::after { content: 'IA en cours…'; position: absolute; inset: 0; display: grid; place-items: center; background: rgba(255,255,255,.78); font-size: 12px; font-weight: 600; color: #6a3fe0; }
