/* =====================================================================
   Logistique DUO 3.4 — système de design
   Chargé en dernier. Source unique des couleurs, de la coquille et des
   composants partagés. Les écrans ajoutent leurs règles dans screens/*.css.
   Sens des couleurs (inchangé) : vert = conforme, ambre = écart à traiter,
   rouge = logo, erreur et suppression. Les teintes de rubrique et de type
   de mission n'utilisent ni le vert, ni l'ambre, ni le rouge.
   ===================================================================== */

:root {
  /* surfaces et texte */
  --bg: #eef2f6;
  --surface: #ffffff;
  --surface2: #f5f7fa;
  --text: #1b2a38;
  --muted: #5a6b7b;
  --faint: #8494a3;
  --line: #dfe5eb;
  /* marque et sens */
  --brand: #d71931;
  --red: #c7243b;
  --red-soft: #fcecef;
  --green: #147b5b;
  --green-soft: #e5f4ee;
  --blue: #356c9c;
  --blue-soft: #e8f1fb;
  --amber: #8a5a0c;
  --amber-soft: #fff2da;
  --amber-line: #f0d29a;
  --amber-strong: #d9861a;
  --inventory-ok-bg: #f2faf6;
  --inventory-gap-bg: #fffaef;
  /* commandes */
  --action-bg: #2d5b83;
  --action-text: #ffffff;
  --action-hover: #244b6d;
  --action-shadow: transparent;
  --focus: #2d5b83;
  --selection-line: #b5cbdc;
  --secondary-bg: #ffffff;
  --secondary-hover: #f5f7fa;
  --soft-hover: #e4edf5;
  --active-bg: #eaf1f8;
  --active-text: #2d5b83;
  --danger-hover: #f9e2e7;
  --danger-line: #e8abb5;
  /* coquille */
  --sidebar: 252px;
  --side: #16232f;
  --side-2: #1f2f3d;
  --side-text: #c9d5df;
  --side-muted: #7f93a4;
  /* teintes de rubrique */
  --c-home: #d71931;
  --c-missions: #4c5fd5;
  --c-live: #c2410c;
  --c-materiel: #0e8a8a;
  --c-armoire: #7c4ddb;
  --c-vehicules: #1c86c9;
  --c-equipe: #5b6b7c;
  /* types de mission */
  --t-dps: #4c5fd5;
  --t-paps: #0e8a8a;
  --t-maraude: #7c4ddb;
  --t-autre: #5b6b7c;
  /* relief */
  --r: 16px;
  --r-sm: 11px;
  --shadow-sm: 0 1px 2px rgba(22, 35, 47, 0.06), 0 1px 1px rgba(22, 35, 47, 0.04);
  --shadow: 0 2px 6px rgba(22, 35, 47, 0.06), 0 8px 24px rgba(22, 35, 47, 0.07);
  --shadow-lg: 0 24px 64px rgba(22, 35, 47, 0.22);
}
html[data-theme="dark"] {
  --bg: #0f171f;
  --surface: #18242f;
  --surface2: #1e2c39;
  --text: #e6eef4;
  --muted: #a9b9c6;
  --faint: #7e909f;
  --line: #2e3f4e;
  --brand: #ff8392;
  --red: #ff8a9a;
  --red-soft: #442936;
  --green: #76d6b2;
  --green-soft: #1b3832;
  --blue: #9bc7ef;
  --blue-soft: #1f3850;
  --amber: #e8c37d;
  --amber-soft: #3a311e;
  --amber-line: #6a5630;
  --amber-strong: #e8c37d;
  --inventory-ok-bg: #20322e;
  --inventory-gap-bg: #302e26;
  --action-bg: #8fb8e0;
  --action-text: #0e2232;
  --action-hover: #a9caea;
  --focus: #9fc3e4;
  --selection-line: #526e85;
  --secondary-bg: #1e2c39;
  --secondary-hover: #243443;
  --soft-hover: #314c62;
  --active-bg: #263c50;
  --active-text: #9fc3e4;
  --danger-hover: #51303e;
  --danger-line: #835263;
  --side: #0b1218;
  --side-2: #15212b;
  --c-missions: #8f9cf0;
  --c-live: #fb923c;
  --c-materiel: #4fc7c4;
  --c-armoire: #b497f2;
  --c-vehicules: #6cbdf0;
  --c-equipe: #a3b1bf;
  --t-dps: #8f9cf0;
  --t-paps: #4fc7c4;
  --t-maraude: #b497f2;
  --t-autre: #a3b1bf;
  --shadow-sm: none;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.03);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.6);
}

/* ---------------------------------------------------------------- base */
html body {
  background: var(--bg);
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
html .icon {
  display: block;
  flex: none;
}
html :focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* ---------------------------------------------------------------- coquille */
html .sidebar {
  background: var(--side);
  color: var(--side-text);
  border-right: 0;
  width: var(--sidebar);
  padding: 20px 14px 14px;
  gap: 4px;
  overflow-y: auto;
}
html .sidebar .brand {
  padding: 0 6px 6px;
  border: 0;
  margin: 0;
}
html .sidebar .brand > a {
  text-decoration: none;
}
html .local-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
}
html .sidebar .local-brand > .icon {
  width: 34px;
  height: 34px;
  padding: 6px;
  border-radius: 10px;
  background: #fff;
  color: #d71931;
  stroke-width: 2;
}
html .sidebar .local-brand strong {
  color: #fff;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.01em;
}
html .brand-tag {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  background: #d71931;
  color: #fff;
  border-radius: 6px;
  padding: 2px 6px;
}
html .sidebar .brand-unit {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 14px 0 6px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--side-2);
  color: var(--side-text);
  font-size: 12px;
  font-weight: 500;
}
html .sidebar .brand-unit .icon {
  width: 14px;
  height: 14px;
  color: var(--side-muted);
}
html .sidebar .nav-label {
  color: var(--side-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  margin: 12px 8px 4px;
}
html .sidebar .nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--side-text);
  font-weight: 500;
  text-decoration: none;
  background: transparent;
  border: 0;
}
html .sidebar .nav-link:hover {
  background: var(--side-2);
  color: #fff;
}
html .sidebar .nav-link.active {
  background: var(--side-2);
  color: #fff;
  font-weight: 600;
}
html .sidebar .nav-link.active::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 8px;
  bottom: 8px;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: var(--hue);
}
html .nav-pill {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  flex: none;
  background: color-mix(in srgb, var(--hue) 22%, transparent);
  color: color-mix(in srgb, var(--hue) 55%, #fff);
}
html .nav-pill .icon {
  width: 16px;
  height: 16px;
}
html .nav-link.active .nav-pill {
  background: var(--hue);
  color: #fff;
}
html .sidebar-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--side-2);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
html .sidebar .site-copyright {
  color: var(--side-muted);
  font-size: 11.5px;
  margin: 4px 10px 0;
}
html .app-body {
  margin-left: var(--sidebar);
  min-width: 0;
}
html .topbar {
  height: 64px;
  padding: 0 32px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  box-shadow: none;
}
html .breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  min-width: 0;
}
html .breadcrumb a {
  color: var(--muted);
  text-decoration: none;
}
html .breadcrumb a:hover {
  color: var(--text);
}
html .breadcrumb [aria-current] {
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
html .breadcrumb .icon {
  width: 14px;
  height: 14px;
  color: var(--faint);
}
html .top-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}
html .notification-button {
  position: relative;
}
html .badge-count {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
  border: 2px solid var(--surface);
}
html[data-theme="dark"] .badge-count {
  color: #2a0d14;
}
html .profile-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 4px 6px;
  border-radius: 12px;
}
html .profile-btn:hover {
  background: var(--surface2);
}
html .profile-btn small {
  color: var(--muted);
}
html .avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: var(--hue, var(--action-bg));
  flex: none;
}
html[data-theme="dark"] .avatar {
  color: #0e2232;
}
html .main {
  padding: 28px 32px 56px;
  max-width: 1320px;
}
html .mobile-brand {
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
}
html .mobile-brand > .icon {
  color: #d71931;
}

/* ---------------------------------------------------------------- titres de page */
html .page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
html .page-heading h1 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  font-size: 28px;
  letter-spacing: -0.02em;
}
html .page-heading p {
  margin: 4px 0 0;
  color: var(--muted);
}
.title-pill {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  flex: none;
  background: color-mix(in srgb, var(--hue) 14%, var(--surface));
  color: var(--hue);
}
.title-pill .icon {
  width: 23px;
  height: 23px;
}
.ds-eyebrow {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 6px;
}
.ds-eyebrow .icon {
  width: 14px;
  height: 14px;
}

/* ---------------------------------------------------------------- boutons */
html .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 18px;
  border-radius: var(--r-sm);
  font-weight: 600;
  white-space: nowrap;
}
html .btn .icon {
  width: 17px;
  height: 17px;
}
html .btn.sm {
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
  border-radius: 9px;
}
html .btn.success {
  background: var(--green);
  color: #fff;
  border-color: transparent;
}
html[data-theme="dark"] .btn.success {
  color: #0d2b22;
}
html .icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: inline-grid;
  place-items: center;
  color: var(--muted);
}
html .icon-btn:hover:not(:disabled) {
  color: var(--text);
}

/* ---------------------------------------------------------------- champs */
html .input {
  min-height: 44px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
}
html .input:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 18%, transparent);
  outline: none;
}
html .label {
  font-weight: 600;
  font-size: 13px;
}

/* ---------------------------------------------------------------- panneaux */
html .panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
}
.ds-panel-h {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.ds-panel-h h2 {
  margin: 0;
  font-size: 15.5px;
}
.ds-panel-h p {
  margin: 1px 0 0;
  color: var(--muted);
  font-size: 12.5px;
}
.ds-panel-h .ds-right {
  margin-left: auto;
  display: flex;
  gap: 8px;
  align-items: center;
}
.ds-panel-b {
  padding: 16px 18px;
}
html .panel.ds-flush {
  padding: 0;
  overflow: hidden;
}
.ds-pill {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex: none;
  background: color-mix(in srgb, var(--hue) 14%, var(--surface));
  color: var(--hue);
}
.ds-pill .icon {
  width: 17px;
  height: 17px;
}
.ds-pill.lg {
  width: 42px;
  height: 42px;
  border-radius: 12px;
}
.ds-pill.lg .icon {
  width: 21px;
  height: 21px;
}
.ds-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--active-text);
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
}
.ds-link .icon {
  width: 15px;
  height: 15px;
}
.ds-link:hover {
  text-decoration: underline;
}

/* grilles */
.ds-grid {
  display: grid;
  gap: 18px;
}
.ds-g2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.ds-g3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.ds-g4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.ds-gmain {
  grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
}
.ds-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.ds-mb {
  margin-bottom: 18px;
}

/* tuiles chiffrées */
.ds-tile {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
  color: var(--text);
  text-decoration: none;
  text-align: left;
  font: inherit;
  width: 100%;
}
button.ds-tile {
  cursor: pointer;
}
.ds-tile:hover {
  box-shadow: var(--shadow);
}
.ds-tile::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 3px;
  background: var(--hue);
}
.ds-tile.sel {
  border-color: var(--hue);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--hue) 16%, transparent);
}
.ds-tile-body {
  min-width: 0;
}
.ds-tile-body b {
  display: block;
  font-size: 26px;
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.ds-tile-body strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-top: 3px;
}
.ds-tile-body small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}
.ds-tile .ds-chev {
  margin-left: auto;
  color: var(--faint);
  width: 16px;
  height: 16px;
  align-self: center;
}

/* lignes de liste */
.ds-rows {
  display: flex;
  flex-direction: column;
}
.ds-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  text-decoration: none;
  text-align: left;
  width: 100%;
  font: inherit;
}
.ds-row:first-child {
  border-top: 0;
}
a.ds-row:hover,
button.ds-row:hover {
  background: var(--surface2);
  cursor: pointer;
}
.ds-row-main {
  flex: 1;
  min-width: 0;
}
.ds-row-main > b {
  display: block;
  font-size: 13.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ds-row-main > small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ds-row-end {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
  color: var(--muted);
  font-size: 12.5px;
}
.ds-chev {
  width: 16px;
  height: 16px;
  color: var(--faint);
}
.ds-thumb {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  background: var(--surface2);
  display: grid;
  place-items: center;
  flex: none;
  overflow: hidden;
}
.ds-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
}
.ds-empty {
  padding: 28px 18px;
  text-align: center;
  color: var(--muted);
}
.ds-empty .ds-pill {
  margin: 0 auto 10px;
  width: 46px;
  height: 46px;
  border-radius: 14px;
}
.ds-empty b {
  display: block;
  color: var(--text);
}

/* pastilles d'état */
html .badge,
.ds-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  background: var(--surface2);
  color: var(--muted);
  border: 0;
}
html .badge .icon,
.ds-chip .icon {
  width: 13px;
  height: 13px;
}
html .badge.green,
.ds-chip.ok {
  background: var(--green-soft);
  color: var(--green);
}
html .badge.amber,
.ds-chip.warn {
  background: var(--amber-soft);
  color: var(--amber);
}
html .badge.red,
.ds-chip.danger {
  background: var(--red-soft);
  color: var(--red);
}
html .badge.blue,
.ds-chip.info {
  background: var(--blue-soft);
  color: var(--blue);
}
.ds-chip.hue {
  background: color-mix(in srgb, var(--hue) 13%, var(--surface));
  color: var(--hue);
}
.ds-chip.live {
  background: color-mix(in srgb, var(--c-live) 12%, var(--surface));
  color: var(--c-live);
}
.ds-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  animation: ds-pulse 1.6s infinite;
  flex: none;
}
@keyframes ds-pulse {
  0% {
    box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 60%, transparent);
  }
  70% {
    box-shadow: 0 0 0 7px transparent;
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
  }
}

/* avis */
html .notice {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 13px;
  line-height: 1.4;
  border: 0;
}
html .notice .icon {
  width: 16px;
  height: 16px;
  margin-top: 1px;
}
html .notice.amber,
html .notice.warn {
  background: var(--amber-soft);
  color: var(--amber);
}
html .notice.green {
  background: var(--green-soft);
  color: var(--green);
}
html .notice.red {
  background: var(--red-soft);
  color: var(--red);
}

/* jauges et quantités */
.ds-bar {
  display: block;
  height: 8px;
  border-radius: 999px;
  background: var(--surface2);
  overflow: hidden;
}
.ds-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--hue, var(--green));
}
.ds-ring {
  --p: 0;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: conic-gradient(var(--green) calc(var(--p) * 1%), var(--surface2) 0);
  display: grid;
  place-items: center;
  flex: none;
}
.ds-ring b {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface);
  display: grid;
  place-items: center;
  font-size: 10px;
  color: var(--text);
}
.ds-ring b .icon {
  width: 15px;
  height: 15px;
  color: var(--green);
  stroke-width: 2.6;
}
.ds-ring.sm {
  width: 26px;
  height: 26px;
}
.ds-ring.sm b {
  width: 18px;
  height: 18px;
}

/* sélecteurs segmentés et filtres */
.ds-segs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  max-width: 100%;
  overflow-x: auto;
}
.ds-seg {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 13px;
  border-radius: 9px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}
.ds-seg .icon {
  width: 15px;
  height: 15px;
}
.ds-seg .ds-count {
  min-width: 20px;
  height: 19px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--surface2);
  font-size: 11px;
  display: grid;
  place-items: center;
}
.ds-seg.sel,
.ds-seg[aria-pressed="true"] {
  background: color-mix(in srgb, var(--hue, var(--action-bg)) 12%, var(--surface));
  color: var(--hue, var(--active-text));
}
.ds-seg.sel .ds-count,
.ds-seg[aria-pressed="true"] .ds-count {
  background: var(--hue, var(--action-bg));
  color: #fff;
}
.ds-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.ds-fchip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-weight: 600;
  font-size: 12.5px;
  cursor: pointer;
  white-space: nowrap;
}
.ds-fchip .icon {
  width: 15px;
  height: 15px;
  color: var(--hue, currentColor);
}
.ds-fchip.sel,
.ds-fchip[aria-pressed="true"] {
  border-color: var(--hue, var(--action-bg));
  color: var(--text);
  background: color-mix(in srgb, var(--hue, var(--action-bg)) 9%, var(--surface));
}
.ds-fchip .ds-count {
  color: var(--faint);
}
.ds-search {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 380px;
}
.ds-search .icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  color: var(--faint);
}
.ds-search .input {
  padding-left: 38px;
  width: 100%;
}

/* compteur − / + */
.ds-stepper {
  display: inline-flex;
  align-items: center;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  flex: none;
  background: var(--surface);
}
.ds-stepper button {
  width: 34px;
  height: 100%;
  border: 0;
  background: var(--surface2);
  color: var(--muted);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.ds-stepper button .icon {
  width: 14px;
  height: 14px;
}
.ds-stepper input {
  width: 48px;
  height: 100%;
  border: 0;
  text-align: center;
  font-weight: 700;
  background: var(--surface);
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* tableau */
.ds-table-wrap {
  overflow-x: auto;
}
.ds-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.ds-table th {
  text-align: left;
  font-size: 11.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  padding: 10px 18px;
  background: var(--surface2);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.ds-table td {
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.ds-table tr:last-child td {
  border-bottom: 0;
}

/* bandeau d'accueil */
.ds-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  padding: 26px 28px;
  border-radius: 18px;
  color: #fff;
  background: var(--hero, linear-gradient(115deg, #2a3a9e 0%, #4c5fd5 55%, #6c7be6 100%));
  box-shadow: var(--shadow);
  margin-bottom: 22px;
}
.ds-hero::after {
  content: "";
  position: absolute;
  right: -60px;
  top: -80px;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.18), transparent 65%);
  pointer-events: none;
}
.ds-hero > * {
  position: relative;
  z-index: 1;
}
.ds-hero h1,
.ds-hero h2 {
  margin: 0 0 4px;
  font-size: 28px;
  letter-spacing: -0.02em;
  color: #fff;
}
.ds-hero p {
  margin: 0;
  opacity: 0.85;
  color: #fff;
}
.ds-hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
  max-width: 560px;
}
.ds-hero-stat {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px 10px 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.14);
  min-width: 0;
}
.ds-hero-stat > .ds-hs-ic {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.18);
  display: grid;
  place-items: center;
  flex: none;
}
.ds-hero-stat .icon {
  width: 20px;
  height: 20px;
}
.ds-hero-stat b {
  display: block;
  font-size: 22px;
  line-height: 1;
  font-weight: 800;
}
.ds-hero-stat span {
  display: block;
  font-size: 12px;
  line-height: 1.2;
  opacity: 0.88;
  margin-top: 3px;
}
html .ds-hero .btn.ds-hero-btn {
  background: #fff;
  color: var(--hero-ink, #2a3a9e);
  min-height: 48px;
  padding: 0 22px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
  border: 0;
}
html .ds-hero .btn.ds-hero-btn:hover {
  background: #f1f3ff;
}

/* ---------------------------------------------------------------- popups */
html .modal-backdrop {
  background: rgba(14, 22, 30, 0.55);
  backdrop-filter: blur(3px);
}
html .modal {
  background: var(--surface);
  border-radius: 20px;
  border: 0;
  box-shadow: var(--shadow-lg);
}
html .modal-header {
  display: flex;
  align-items: center;
  gap: 14px;
}
html .modal-header h2 {
  font-size: 19px;
  letter-spacing: -0.01em;
}
html .modal-footer {
  border-top: 1px solid var(--line);
}
/* grande popup en étapes (création de mission) */
html .modal.ds-wizard {
  width: min(1080px, calc(100vw - 48px));
  max-width: none;
  height: min(780px, calc(100dvh - 48px));
  padding: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  overflow: hidden;
}
html .modal.ds-wizard > .modal-header {
  padding: 20px 24px 14px;
  margin: 0;
}
.ds-wiz-steps {
  display: flex;
  gap: 8px;
  padding: 0 24px 16px;
  border-bottom: 1px solid var(--line);
}
.ds-wiz-step {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  text-align: left;
  cursor: pointer;
  font: inherit;
}
.ds-wiz-step .num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 12.5px;
  background: var(--surface2);
  flex: none;
}
.ds-wiz-step .num .icon {
  width: 14px;
  height: 14px;
  stroke-width: 2.6;
}
.ds-wiz-step b {
  display: block;
  font-size: 13px;
  color: var(--text);
}
.ds-wiz-step small {
  font-size: 11.5px;
}
.ds-wiz-step.active {
  border-color: var(--c-missions);
  background: color-mix(in srgb, var(--c-missions) 7%, var(--surface));
}
.ds-wiz-step.active .num {
  background: var(--c-missions);
  color: #fff;
}
.ds-wiz-step.done .num {
  background: var(--green);
  color: #fff;
}
.ds-wiz-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  min-height: 0;
}
.ds-wiz-main {
  overflow: auto;
  padding: 22px 24px 28px;
  min-width: 0;
}
.ds-wiz-side {
  border-left: 1px solid var(--line);
  background: var(--surface2);
  overflow: auto;
  padding: 20px;
}
html .modal.ds-wizard .ds-wiz-form > .modal-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  margin: 0;
}
.ds-wiz-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12.5px;
}
.ds-wiz-hint .icon {
  width: 15px;
  height: 15px;
}
.ds-spacer {
  flex: 1;
}
/* sections de formulaire */
.ds-sec {
  margin-bottom: 26px;
}
.ds-sec-h {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}
.ds-sec-h .ds-pill {
  margin-top: 2px;
}
.ds-sec-h h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.3;
}
.ds-sec-h p {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
}
.ds-sec-h .ds-right {
  margin-left: auto;
  align-self: center;
}
.ds-quick {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 10px;
}
.ds-quick > span {
  color: var(--muted);
  font-size: 12.5px;
}
.ds-quick button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 12.5px;
  cursor: pointer;
}
.ds-quick button:hover {
  border-color: var(--c-missions);
  color: var(--c-missions);
}
.ds-quick .icon {
  width: 13px;
  height: 13px;
}
.ds-check-line {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 12px;
  font-size: 13px;
  line-height: 1.4;
  cursor: pointer;
}
.ds-check-line input {
  width: 17px;
  height: 17px;
  margin: 1px 0 0;
  accent-color: var(--action-bg);
  flex: none;
}
/* volet latéral (notifications) */
html .modal.ds-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(440px, 100vw);
  max-width: none;
  max-height: none;
  height: 100dvh;
  margin: 0;
  border-radius: 0;
  animation: ds-slide 0.2s ease;
}
@keyframes ds-slide {
  from {
    transform: translateX(30px);
    opacity: 0.4;
  }
}

/* toast */
html .toast {
  background: var(--side);
  color: #fff;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
}

/* ---------------------------------------------------------------- mobile */
@media (max-width: 1100px) {
  .ds-g4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ds-gmain {
    grid-template-columns: minmax(0, 1fr);
  }
  .ds-wiz-body {
    grid-template-columns: minmax(0, 1fr);
  }
  .ds-wiz-side {
    display: none;
  }
  .ds-wiz-side.open {
    display: block;
    position: absolute;
    inset: auto 0 0 0;
    max-height: 72%;
    border-left: 0;
    border-top: 1px solid var(--line);
    border-radius: 18px 18px 0 0;
    box-shadow: var(--shadow-lg);
    z-index: 4;
  }
  html .modal.ds-wizard {
    position: relative;
  }
}
@media (min-width: 1101px) {
  .ds-recap-toggle {
    display: none !important;
  }
}
@media (max-width: 860px) {
  html .app-body {
    margin-left: 0;
  }
  html .topbar {
    padding: 0 16px;
    height: 56px;
  }
  html .main {
    padding: 16px 16px 96px;
  }
  html .page-heading h1 {
    font-size: 22px;
  }
  html .mobile-nav {
    background: var(--surface);
    border-top: 1px solid var(--line);
  }
  html .mobile-nav a,
  html .mobile-nav button {
    color: var(--muted);
  }
  html .mobile-nav .active {
    color: var(--hue, var(--active-text));
  }
  html .mobile-nav .active .icon {
    background: color-mix(in srgb, var(--hue, var(--active-text)) 15%, transparent);
    border-radius: 999px;
  }
  .ds-g2,
  .ds-g3,
  .ds-g4 {
    grid-template-columns: minmax(0, 1fr);
  }
  .ds-g4.ds-tiles-m {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ds-tile {
    padding: 12px;
    gap: 10px;
  }
  .ds-tile-body b {
    font-size: 21px;
  }
  .ds-hero {
    grid-template-columns: minmax(0, 1fr);
    padding: 20px;
  }
  .ds-hero h1,
  .ds-hero h2 {
    font-size: 22px;
  }
  html .ds-hero .btn.ds-hero-btn {
    width: 100%;
  }
  .ds-hero-stat {
    padding: 8px 10px 8px 8px;
    gap: 8px;
  }
  .ds-hero-stat > .ds-hs-ic {
    width: 30px;
    height: 30px;
  }
  .ds-hero-stat b {
    font-size: 18px;
  }
  .ds-hero-stat span {
    font-size: 10.5px;
  }
  .ds-row {
    padding: 12px 14px;
  }
  .ds-panel-h,
  .ds-panel-b {
    padding-left: 14px;
    padding-right: 14px;
  }
  .ds-search {
    max-width: none;
  }
  html .modal.ds-wizard {
    width: 100vw;
    height: 100dvh;
    border-radius: 0;
  }
  .ds-wiz-steps {
    padding: 0 16px 12px;
    gap: 6px;
  }
  .ds-wiz-step {
    padding: 8px;
    justify-content: center;
  }
  .ds-wiz-step .txt {
    display: none;
  }
  .ds-wiz-step.active {
    flex: 3;
    justify-content: flex-start;
  }
  .ds-wiz-step.active .txt {
    display: block;
  }
  .ds-wiz-main {
    padding: 16px;
  }
  html .modal.ds-wizard > .modal-header {
    padding: 14px 16px 12px;
  }
  html .modal.ds-wizard .ds-wiz-form > .modal-footer {
    padding: 12px 16px;
  }
  .ds-wiz-hint,
  .ds-hide-m {
    display: none !important;
  }
}
@media (prefers-reduced-motion: reduce) {
  html *,
  html *::before,
  html *::after {
    animation: none !important;
    transition: none !important;
  }
}
html .modal.ds-wizard .modal-header h2 {
  flex: 1;
  margin: 0;
  text-align: left;
}
html .modal.ds-wizard .ds-wiz-form > .modal-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
}
