/* ═══════════════════════════════════════════════════════════════════════════
   CRM — feuille de style unique.
   Un composant n'est défini qu'ici : pas de style de bouton ad hoc dans les
   pages. Aucune couleur, ombre ou rayon en dur — tout passe par les jetons.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Jetons ──────────────────────────────────────────────────────────────── */
:root {
  --accent: #2f6f4e;
  --accent-hover: #255c40;
  --accent-soft: #eaf3ee;
  --accent-texte: #ffffff;

  --bleu: #2563eb;
  --bleu-soft: #eef4ff;
  --ambre: #b45309;
  --ambre-soft: #fef6e7;
  --rouge: #b42318;
  --rouge-soft: #fdf0ef;
  --vert: #15803d;
  --vert-soft: #edf7f0;

  --fond: #f6f7f8;
  --surface: #ffffff;
  --surface-2: #fbfbfc;
  --surface-3: #f1f2f4;

  --texte: #1f2328;
  --texte-doux: #4a5157;
  --text-muted: #757d85;
  --texte-inverse: #ffffff;

  --border-light: #e5e7ea;
  --border: #d6d9dd;

  --ds-r-sm: 6px;
  --ds-r-md: 10px;
  --ds-r-lg: 14px;
  --ds-r-full: 999px;

  --ds-shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --ds-shadow-md: 0 2px 8px rgba(16, 24, 40, .07);
  --ds-shadow-lg: 0 12px 32px rgba(16, 24, 40, .14);

  --laterale-l: 244px;
  --police: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --police-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
}

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

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

body {
  margin: 0;
  font-family: var(--police);
  font-size: 14px;
  line-height: 1.5;
  color: var(--texte);
  background: var(--fond);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 20px; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: none; }

.material-symbols-outlined {
  font-family: "Material Symbols Outlined";
  font-weight: normal;
  font-style: normal;
  font-size: 20px;
  line-height: 1;
  display: inline-block;
  vertical-align: middle;
  user-select: none;
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
}

/* Accessibilité clavier : anneau visible et cohérent partout. */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--ds-r-sm);
}

/* ── Mise en page ────────────────────────────────────────────────────────── */
.laterale {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--laterale-l);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--border-light);
  z-index: 40;
}

.laterale__marque {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 16px 18px 14px;
}
.laterale__logo {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: var(--ds-r-md);
  background: var(--accent);
  color: var(--accent-texte);
}
.laterale__logo .material-symbols-outlined { font-size: 20px; }
.laterale__nom { font-weight: 650; font-size: 15px; letter-spacing: -.01em; }

.laterale__nav { flex: 1; overflow-y: auto; padding: 4px 10px 12px; }

.laterale__groupe {
  padding: 14px 10px 5px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.laterale__lien {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  margin-bottom: 1px;
  border-radius: var(--ds-r-sm);
  color: var(--texte-doux);
  font-size: 13.5px;
  font-weight: 500;
}
.laterale__lien .material-symbols-outlined { font-size: 20px; color: var(--text-muted); }
.laterale__lien:hover { background: var(--surface-3); color: var(--texte); }
.laterale__lien.is-active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.laterale__lien.is-active .material-symbols-outlined { color: var(--accent); }

/* Mise en garde dans le menu (expiration proche). Le sélecteur est plus
   spécifique que `.laterale__lien .material-symbols-outlined`, qui grise
   toutes les icônes du menu. */
.laterale__lien .laterale__alerte {
  margin-left: auto;
  font-size: 18px;
  color: var(--ambre);
}
.laterale__lien .laterale__alerte--urgent {
  color: var(--rouge);
  animation: veille-pulse 2.4s ease-in-out infinite;
}
@keyframes veille-pulse {
  0%, 70%, 100% { opacity: 1; }
  85% { opacity: .35; }
}

.laterale__pied { padding: 12px; border-top: 1px solid var(--border-light); }
.laterale__user { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.laterale__avatar {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: var(--ds-r-full);
  background: var(--surface-3);
  font-size: 11.5px; font-weight: 650; color: var(--texte-doux);
}
.laterale__user-info { display: flex; flex-direction: column; min-width: 0; }
.laterale__user-nom { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.laterale__user-role { font-size: 11px; color: var(--text-muted); }

.contenu {
  margin-left: var(--laterale-l);
  min-height: 100vh;
  padding: 0 26px 60px;
}
body.sans-menu .contenu { margin-left: 0; padding: 0; }

.entete {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 22px 0 18px;
  position: sticky;
  top: 0;
  background: var(--fond);
  z-index: 20;
}
.entete__titre { flex: 1; min-width: 0; }
.entete__sous { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.entete__actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.entete__burger { display: none; cursor: pointer; }

.bascule-menu, .voile-menu { display: none; }

/* ── Boutons (§2 des conventions) ────────────────────────────────────────── */
.sm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 13px;
  border: 1px solid transparent;
  border-radius: var(--ds-r-sm);
  background: var(--surface);
  color: var(--texte);
  font: inherit;
  font-size: 13px;
  font-weight: 550;
  line-height: 1.35;
  cursor: pointer;
  white-space: nowrap;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.sm-btn .material-symbols-outlined { font-size: 18px; }
.sm-btn--primary { background: var(--accent); color: var(--accent-texte); }
.sm-btn--primary:hover { background: var(--accent-hover); }
.sm-btn--ghost { background: transparent; border-color: var(--border); color: var(--texte-doux); }
.sm-btn--ghost:hover { background: var(--surface-3); color: var(--texte); }
.sm-btn--soft { background: var(--surface-3); color: var(--texte-doux); }
.sm-btn--soft:hover { background: var(--border-light); color: var(--texte); }
.sm-btn--danger { background: var(--rouge); color: #fff; }
.sm-btn--danger:hover { filter: brightness(.93); }
.sm-btn--white { background: var(--surface); border-color: var(--border); }
.sm-btn--full { width: 100%; }
.sm-btn.is-disabled { opacity: .45; pointer-events: none; }
.sm-btn:disabled { opacity: .5; cursor: not-allowed; }

.form-inline { display: inline-flex; }

/* ── Boîtes ──────────────────────────────────────────────────────────────── */
.ds-box {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--ds-r-lg);
  box-shadow: var(--ds-shadow-sm);
  padding: 16px 18px;
}
.ds-box + .ds-box { margin-top: 14px; }
.ds-box__entete {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: -2px 0 14px;
}
.ds-box__entete h2 { flex: 1; }
.ds-box__entete .material-symbols-outlined { font-size: 19px; color: var(--text-muted); }
.ds-box--plat { box-shadow: none; }
.ds-box--serre { padding: 0; overflow: hidden; }
.ds-box--serre .ds-box__entete { padding: 15px 18px 0; margin-bottom: 12px; }

.grille { display: grid; gap: 14px; }
.grille--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grille--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grille--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grille--5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.grille--sidebar { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
.grille--form { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }

/* ── Statistiques ────────────────────────────────────────────────────────── */
.ds-stat {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--ds-r-lg);
  box-shadow: var(--ds-shadow-sm);
  padding: 14px 16px 15px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.ds-stat__haut { display: flex; align-items: center; gap: 8px; }
.ds-stat__libelle { flex: 1; font-size: 12px; font-weight: 550; color: var(--text-muted); }
.ds-stat__icone { font-size: 19px; color: var(--text-muted); }
.ds-stat__valeur { font-size: 22px; font-weight: 660; letter-spacing: -.02em; }
.ds-stat__detail { font-size: 12px; color: var(--text-muted); }
.ds-stat__lien {
  margin-top: 7px;
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 600; color: var(--accent);
}
.ds-stat__lien .material-symbols-outlined { font-size: 15px; }
.ds-stat--success .ds-stat__valeur { color: var(--vert); }
.ds-stat--danger .ds-stat__valeur { color: var(--rouge); }
.ds-stat--warning .ds-stat__valeur { color: var(--ambre); }
.ds-stat--info .ds-stat__valeur { color: var(--bleu); }

.ds-barre {
  height: 6px;
  margin-top: 9px;
  border-radius: var(--ds-r-full);
  background: var(--surface-3);
  overflow: hidden;
}
.ds-barre__jauge { height: 100%; border-radius: inherit; background: var(--accent); transition: width .25s ease; }
.ds-barre--fin { height: 4px; }

/* ── Tableaux ────────────────────────────────────────────────────────────── */
.ds-table-wrap {
  border: 1px solid var(--border-light);
  border-radius: var(--ds-r-lg);
  background: var(--surface);
  box-shadow: var(--ds-shadow-sm);
  overflow-x: auto;
}
.ds-table { width: 100%; border-collapse: collapse; }
.ds-table th {
  padding: 10px 16px;
  text-align: left;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
}
.ds-table td {
  padding: 12px 16px;
  font-size: 13.5px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}
.ds-table tbody tr:last-child td { border-bottom: 0; }
.ds-table tbody tr:hover { background: var(--surface-2); }
.ds-table__num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ds-td--actions { text-align: right; white-space: nowrap; }
.ds-td--actions > * { vertical-align: middle; }
.ds-row--highlight { background: var(--ambre-soft); }
.ds-row--danger { background: var(--rouge-soft); }
.ds-table__vide td { padding: 30px; text-align: center; color: var(--text-muted); }
.ds-table tfoot td {
  padding: 11px 16px;
  font-weight: 650;
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  font-size: 13.5px;
}
.ds-th-tri { display: inline-flex; align-items: center; gap: 3px; color: inherit; }
.ds-th-tri:hover { color: var(--texte); }
.ds-th-tri .material-symbols-outlined { font-size: 15px; }

.ds-person { display: flex; align-items: center; gap: 9px; min-width: 0; }
.ds-person__img {
  width: 28px; height: 28px; flex: none;
  display: grid; place-items: center;
  border-radius: var(--ds-r-full);
  background: var(--surface-3);
  font-size: 11px; font-weight: 650; color: var(--texte-doux);
}
.ds-person__txt { display: flex; flex-direction: column; min-width: 0; }
.ds-person__name { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
a.ds-person__name:hover { color: var(--accent); }
.ds-person__sub { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Badges & compteurs ──────────────────────────────────────────────────── */
.ds-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--ds-r-full);
  background: var(--surface-3);
  color: var(--texte-doux);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}
.ds-badge .material-symbols-outlined { font-size: 14px; }
.ds-badge--success { background: var(--vert-soft); color: var(--vert); }
.ds-badge--warning { background: var(--ambre-soft); color: var(--ambre); }
.ds-badge--danger { background: var(--rouge-soft); color: var(--rouge); }
.ds-badge--info { background: var(--bleu-soft); color: var(--bleu); }
.ds-badge--solid { background: var(--accent); color: var(--accent-texte); }

.ds-count {
  display: inline-grid; place-items: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: var(--ds-r-full);
  background: var(--surface-3);
  font-size: 11px; font-weight: 650; color: var(--texte-doux);
}

/* ── Actions en icône ────────────────────────────────────────────────────── */
.ds-ico {
  display: inline-grid; place-items: center;
  width: 30px; height: 30px;
  border: 0; padding: 0;
  border-radius: var(--ds-r-sm);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}
.ds-ico:hover { background: var(--surface-3); color: var(--texte); }
.ds-ico .material-symbols-outlined { font-size: 19px; }
.ds-ico--danger:hover { background: var(--rouge-soft); color: var(--rouge); }

/* ── Champs ──────────────────────────────────────────────────────────────── */
.ds-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.ds-label { font-size: 12.5px; font-weight: 550; color: var(--texte-doux); }
.ds-label__requis { color: var(--rouge); }
.ds-input, .ds-select, .ds-textarea {
  width: 100%;
  padding: 8px 11px;
  border: 1px solid var(--border);
  border-radius: var(--ds-r-sm);
  background: var(--surface);
  color: var(--texte);
  font: inherit;
  font-size: 13.5px;
}
.ds-textarea { resize: vertical; min-height: 70px; line-height: 1.55; }
.ds-input:focus, .ds-select:focus, .ds-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.ds-input::placeholder, .ds-textarea::placeholder { color: #a7aeb5; }

/* Champ de fichier : le bouton natif reprend l'allure d'un .sm-btn--soft. */
.ds-input[type="file"] { padding: 6px 8px; line-height: 1.6; cursor: pointer; }
.ds-input[type="file"]::file-selector-button {
  margin-right: 10px;
  padding: 5px 11px;
  border: 1px solid var(--border-light);
  border-radius: var(--ds-r-sm);
  background: var(--surface-3);
  color: var(--texte-doux);
  font: inherit;
  font-size: 13px;
  font-weight: 550;
  cursor: pointer;
}
.ds-input[type="file"]::file-selector-button:hover { background: var(--border-light); color: var(--texte); }

/* Pièces jointes d'une facture */
.doc-vignette {
  display: block;
  width: 38px;
  height: 38px;
  object-fit: cover;
  border: 1px solid var(--border-light);
  border-radius: var(--ds-r-sm);
  background: var(--surface-3);
}
.doc-icone { font-size: 26px; color: var(--rouge); }
.ds-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23757d85' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  padding-right: 30px;
}
.ds-help { font-size: 11.5px; color: var(--text-muted); }

.ds-input-group { display: flex; align-items: stretch; }
.ds-input-group .ds-input { border-radius: 0; }
.ds-input-group > :first-child { border-top-left-radius: var(--ds-r-sm); border-bottom-left-radius: var(--ds-r-sm); }
.ds-input-group > :last-child { border-top-right-radius: var(--ds-r-sm); border-bottom-right-radius: var(--ds-r-sm); }
.ds-input-group__ic, .ds-input-group__prefix, .ds-input-group__suffix {
  display: grid; place-items: center;
  padding: 0 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 12.5px;
  white-space: nowrap;
}
.ds-input-group__ic { border-right: 0; }
.ds-input-group__prefix { border-right: 0; }
.ds-input-group__suffix { border-left: 0; }
.ds-input-group .ds-input:focus { position: relative; z-index: 1; }

.ds-choice { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; cursor: pointer; }
.ds-choice input { width: 15px; height: 15px; accent-color: var(--accent); margin: 0; }

.ds-switch { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.ds-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.ds-switch__piste {
  width: 38px; height: 22px; flex: none;
  border-radius: var(--ds-r-full);
  background: var(--border);
  position: relative;
  transition: background .16s ease;
}
.ds-switch__piste::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 16px; height: 16px;
  border-radius: var(--ds-r-full);
  background: #fff;
  box-shadow: var(--ds-shadow-sm);
  transition: transform .16s ease;
}
.ds-switch input:checked + .ds-switch__piste { background: var(--accent); }
.ds-switch input:checked + .ds-switch__piste::after { transform: translateX(16px); }
.ds-switch input:focus-visible + .ds-switch__piste { outline: 2px solid var(--accent); outline-offset: 2px; }
.ds-switch__texte { display: flex; flex-direction: column; font-size: 13.5px; font-weight: 550; }
.ds-switch__texte small { font-weight: 400; font-size: 11.5px; color: var(--text-muted); }

.ds-range { width: 100%; accent-color: var(--accent); }

fieldset.bloc-form {
  margin: 0 0 18px;
  padding: 0;
  border: 0;
}
fieldset.bloc-form > legend {
  padding: 0 0 10px;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.form-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 16px;
  margin-top: 4px;
  border-top: 1px solid var(--border-light);
}
.form-actions--fin { justify-content: flex-end; }

/* ── Barre d'outils ──────────────────────────────────────────────────────── */
.ds-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.ds-toolbar__end { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.ds-toolbar .ds-select { width: auto; min-width: 130px; }
.ds-search {
  display: flex; align-items: center; gap: 7px;
  padding: 0 11px;
  min-width: 230px;
  border: 1px solid var(--border);
  border-radius: var(--ds-r-sm);
  background: var(--surface);
}
.ds-search .material-symbols-outlined { font-size: 18px; color: var(--text-muted); }
.ds-search input {
  flex: 1;
  border: 0; outline: none;
  padding: 8px 0;
  font: inherit; font-size: 13.5px;
  background: transparent;
  min-width: 0;
}

/* ── Onglets ─────────────────────────────────────────────────────────────── */
.ds-tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 16px;
  overflow-x: auto;
}
.ds-tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 12px;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 13.5px; font-weight: 550;
  white-space: nowrap;
}
.ds-tab .material-symbols-outlined { font-size: 18px; }
.ds-tab:hover { color: var(--texte); }
.ds-tab.is-active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.ds-tab__count {
  display: inline-grid; place-items: center;
  min-width: 17px; height: 17px; padding: 0 5px;
  border-radius: var(--ds-r-full);
  background: var(--surface-3);
  font-size: 10.5px; font-weight: 650;
}
.ds-tab.is-active .ds-tab__count { background: var(--accent-soft); color: var(--accent); }

/* ── Alertes ─────────────────────────────────────────────────────────────── */
.flashs { position: sticky; top: 0; z-index: 30; padding-top: 14px; }
.ds-alert {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 11px 13px;
  margin-bottom: 10px;
  border: 1px solid var(--border-light);
  border-radius: var(--ds-r-md);
  background: var(--surface);
  box-shadow: var(--ds-shadow-sm);
  font-size: 13.5px;
}
.ds-alert .material-symbols-outlined { font-size: 19px; flex: none; }
.ds-alert > span:nth-child(2) { flex: 1; }
.ds-alert--success { background: var(--vert-soft); border-color: #cfe7d8; color: #17563a; }
.ds-alert--info { background: var(--bleu-soft); border-color: #d3e2fd; color: #1e40af; }
.ds-alert--warning { background: var(--ambre-soft); border-color: #f5e2bf; color: #8a4b06; }
.ds-alert--danger { background: var(--rouge-soft); border-color: #f6d5d2; color: #97231a; }
.ds-alert--row { align-items: center; }

/* ── Bandeau de veille ─────────────────────────────────────────────────────
   Expirations de domaine / hébergement, présent sur toutes les pages. Il ne se
   ferme pas — c'est justement son rôle. Composant autonome plutôt que
   `.ds-alert` : celui-ci est prévu pour une ligne de texte, pas une liste. */
.veille {
  margin: 16px 0 0;
  border: 1px solid var(--border-light);
  border-left: 3px solid var(--ambre);
  border-radius: var(--ds-r-md);
  background: var(--surface);
  box-shadow: var(--ds-shadow-sm);
  overflow: hidden;
}
.veille--urgent { border-left-color: var(--rouge); }

.veille__tete {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  background: var(--ambre-soft);
  border-bottom: 1px solid var(--border-light);
}
.veille--urgent .veille__tete { background: var(--rouge-soft); }
.veille__ic { font-size: 19px; color: var(--ambre); }
.veille--urgent .veille__ic { color: var(--rouge); }
.veille__titre { flex: 1; font-size: 13px; font-weight: 650; color: #8a4b06; }
.veille--urgent .veille__titre { color: #97231a; }
.veille__lien { font-size: 12.5px; font-weight: 550; color: inherit; opacity: .8; white-space: nowrap; }
.veille__lien:hover { opacity: 1; text-decoration: underline; }

.veille__liste { list-style: none; margin: 0; padding: 0; }
.veille__liste li + li { border-top: 1px solid var(--border-light); }

.veille__item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 13px;
  color: var(--texte);
  font-size: 13px;
}
.veille__item:hover { background: var(--surface-3); }

/* Pastille de délai : largeur fixe, pour que les noms de sites s'alignent
   les uns sous les autres quel que soit le libellé. */
.veille__delai {
  flex: none;
  width: 88px;
  padding: 2px 8px;
  border-radius: var(--ds-r-full);
  background: var(--ambre-soft);
  color: #8a4b06;
  font-size: 11.5px;
  font-weight: 650;
  text-align: center;
}
.veille__delai--urgent { background: var(--rouge-soft); color: #97231a; }

.veille__quoi { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 7px; }
.veille__site { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.veille__detail { color: var(--text-muted); font-size: 12.5px; }
.veille__date { flex: none; color: var(--text-muted); font-size: 12.5px; }

.veille__plus {
  display: block;
  padding: 8px 13px;
  border-top: 1px solid var(--border-light);
  background: var(--surface-2);
  color: var(--texte-doux);
  font-size: 12.5px;
  font-weight: 550;
}
.veille__plus:hover { background: var(--surface-3); color: var(--texte); }

@media (max-width: 700px) {
  .veille__item { flex-wrap: wrap; gap: 6px 9px; }
  .veille__quoi { flex-basis: 100%; order: 3; }
  .veille__date { margin-left: auto; }
}
.flash-fermer { border: 0; background: transparent; color: inherit; cursor: pointer; padding: 0; opacity: .6; }
.flash-fermer:hover { opacity: 1; }

/* ── Pagination ──────────────────────────────────────────────────────────── */
.ds-pager {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 2px 0;
  font-size: 12.5px; color: var(--text-muted);
}
.ds-pager__info { flex: 1; }
.ds-pager__boutons { display: flex; align-items: center; gap: 8px; }
.ds-pager__page { font-weight: 550; }

/* ── État vide ───────────────────────────────────────────────────────────── */
.ds-vide {
  display: flex; flex-direction: column; align-items: center;
  gap: 6px;
  padding: 46px 20px;
  text-align: center;
  color: var(--text-muted);
}
.ds-vide > .material-symbols-outlined { font-size: 34px; opacity: .5; }
.ds-vide__titre { font-size: 14.5px; font-weight: 600; color: var(--texte-doux); }
.ds-vide__texte { font-size: 13px; max-width: 380px; }
.ds-vide__action { margin-top: 10px; }

/* ── Fiches : lignes d'information ───────────────────────────────────────── */
.info-liste { display: flex; flex-direction: column; }
.info-ligne {
  display: flex;
  gap: 14px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 13.5px;
}
.info-ligne:last-child { border-bottom: 0; }
.info-ligne__libelle { width: 165px; flex: none; color: var(--text-muted); font-size: 12.5px; padding-top: 1px; }
.info-ligne__valeur { flex: 1; min-width: 0; word-break: break-word; }
a.info-ligne__valeur { color: var(--accent); }
a.info-ligne__valeur:hover { text-decoration: underline; }

.puces { display: flex; flex-wrap: wrap; gap: 5px; }

/* ── Chronologie ─────────────────────────────────────────────────────────── */
.chrono { display: flex; flex-direction: column; gap: 2px; }
.chrono__item {
  display: flex; gap: 11px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
}
.chrono__item:last-child { border-bottom: 0; }
.chrono__ico {
  width: 30px; height: 30px; flex: none;
  display: grid; place-items: center;
  border-radius: var(--ds-r-full);
  background: var(--surface-3);
  color: var(--texte-doux);
}
.chrono__ico .material-symbols-outlined { font-size: 17px; }
.chrono__corps { flex: 1; min-width: 0; }
.chrono__meta {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 12px; color: var(--text-muted);
  margin-bottom: 3px;
}
.chrono__texte { font-size: 13.5px; white-space: pre-wrap; word-break: break-word; }
.chrono__item--epingle { background: var(--ambre-soft); border-radius: var(--ds-r-md); padding: 12px; }

/* ── Graphique en colonnes (statistiques) ────────────────────────────────── */
.graphe { display: flex; align-items: flex-end; gap: 3px; height: 190px; padding: 0 2px; }
.graphe__mois { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; height: 100%; }
.graphe__paire { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 2px; }
.graphe__barre { width: 42%; max-width: 18px; border-radius: 3px 3px 0 0; background: var(--accent); min-height: 2px; }
.graphe__barre--depense { background: var(--rouge); opacity: .75; }
.graphe__etiquette { font-size: 10.5px; color: var(--text-muted); text-transform: capitalize; }
.legende { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-muted); margin-top: 12px; }
.legende__item { display: inline-flex; align-items: center; gap: 6px; }
.legende__pastille { width: 9px; height: 9px; border-radius: 2px; background: var(--accent); }
.legende__pastille--depense { background: var(--rouge); opacity: .75; }

/* ── Colonnes (tâches) ───────────────────────────────────────────────────── */
.colonnes { display: grid; grid-template-columns: repeat(5, minmax(200px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.colonne { background: var(--surface-3); border-radius: var(--ds-r-lg); padding: 10px; min-width: 200px; }
.colonne__entete { display: flex; align-items: center; gap: 6px; padding: 2px 4px 9px; font-size: 12.5px; font-weight: 650; color: var(--texte-doux); }
.colonne__entete .material-symbols-outlined { font-size: 17px; }
.colonne__liste { display: flex; flex-direction: column; gap: 7px; }
.carte-tache {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--ds-r-md);
  padding: 9px 11px;
  box-shadow: var(--ds-shadow-sm);
}
.carte-tache__titre { font-size: 13px; font-weight: 600; margin-bottom: 5px; }
.carte-tache__meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 11.5px; color: var(--text-muted); }
.carte-tache .ds-select { padding: 4px 24px 4px 7px; font-size: 12px; background-position: right 5px center; }

/* ── Divers ──────────────────────────────────────────────────────────────── */
.mono { font-family: var(--police-mono); font-size: 12.5px; }
.muet { color: var(--text-muted); }
.gras { font-weight: 650; }
.nb { font-variant-numeric: tabular-nums; }
.retard { color: var(--rouge); font-weight: 600; }
.ok { color: var(--vert); font-weight: 600; }
.centre { text-align: center; }
.droite { text-align: right; }
.pile { display: flex; flex-direction: column; gap: 2px; }
.rangee { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rangee--fin { justify-content: flex-end; }
.ecart-haut { margin-top: 14px; }
.pleine-largeur { grid-column: 1 / -1; }
.coupe { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.etoiles { color: var(--ambre); letter-spacing: 1px; font-size: 12px; }

.tableau-lignes .ds-input, .tableau-lignes .ds-select { padding: 6px 9px; font-size: 13px; }
.tableau-lignes td { padding: 6px 8px; }
.tableau-lignes th { padding: 8px; }

/* ── Modales ─────────────────────────────────────────────────────────────── */
.modale { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; }
.modale[hidden] { display: none; }
.modale__voile { position: absolute; inset: 0; background: rgba(16, 24, 40, .45); }
.modale__boite {
  position: relative;
  width: min(560px, 100%);
  max-height: 88vh;
  display: flex; flex-direction: column;
  background: var(--surface);
  border-radius: var(--ds-r-lg);
  box-shadow: var(--ds-shadow-lg);
  animation: apparition .14s ease;
}
.modale__boite--large { width: min(880px, 100%); }
.modale__entete {
  display: flex; align-items: center; gap: 10px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--border-light);
}
.modale__entete h2 { flex: 1; }
.modale__corps { padding: 18px; overflow-y: auto; }
@keyframes apparition { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ── Connexion ───────────────────────────────────────────────────────────── */
.connexion {
  min-height: 100vh;
  display: grid; place-items: center;
  padding: 24px;
  background: linear-gradient(160deg, var(--accent-soft), var(--fond) 60%);
}
.connexion__boite {
  width: min(400px, 100%);
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--ds-r-lg);
  box-shadow: var(--ds-shadow-lg);
  padding: 28px 26px;
}
.connexion__marque { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.connexion__titre { font-size: 18px; font-weight: 660; }
.connexion__sous { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.connexion .ds-field { margin-bottom: 13px; }
.connexion__pied { margin-top: 18px; font-size: 11.5px; color: var(--text-muted); text-align: center; }

/* ── Réactif ─────────────────────────────────────────────────────────────── */
@media (max-width: 1180px) {
  .grille--5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grille--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grille--sidebar { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 900px) {
  .laterale { transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--ds-shadow-lg); }
  .bascule-menu:checked ~ .laterale { transform: none; }
  .bascule-menu:checked ~ .voile-menu { display: block; position: fixed; inset: 0; background: rgba(16, 24, 40, .4); z-index: 35; }
  .contenu { margin-left: 0; padding: 0 16px 50px; }
  .entete__burger { display: grid; place-items: center; width: 34px; height: 34px; border-radius: var(--ds-r-sm); background: var(--surface); border: 1px solid var(--border); }
  .grille--3, .grille--2, .grille--4, .grille--5 { grid-template-columns: minmax(0, 1fr); }
  .info-ligne { flex-direction: column; gap: 2px; }
  .info-ligne__libelle { width: auto; }
  .colonnes { grid-template-columns: repeat(5, 78vw); }
}

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

/* ── Application installée (PWA) ──────────────────────────────────────────
   Le zoom est désactivé côté balise viewport. Deux compléments ici :
   `touch-action: manipulation` supprime le zoom par double frappe (que la
   balise ne couvre pas), et les champs passent à 16 px sur écran tactile —
   en dessous, iOS zoome de force à la mise au point, quoi qu'en dise le
   viewport, et l'écran reste décalé après la saisie. */
body { touch-action: manipulation; }

@media (pointer: coarse) {
  .ds-input, .ds-select, .ds-textarea { font-size: 16px; }
}

/* Encoche et barre d'accueil : `viewport-fit=cover` étend la page sous
   celles-ci, il faut donc écarter le contenu soi-même. */
@media (max-width: 900px) {
  .contenu {
    padding-top: env(safe-area-inset-top);
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
    padding-bottom: calc(50px + env(safe-area-inset-bottom));
  }
  body.sans-menu .contenu { padding-top: env(safe-area-inset-top); }
  .laterale { padding-top: env(safe-area-inset-top); }
}

/* Page « hors ligne » */
.hors-ligne {
  max-width: 420px;
  margin: 14vh auto 0;
  display: grid;
  justify-items: center;
  gap: 10px;
  text-align: center;
}
.hors-ligne__ic { font-size: 44px; color: var(--text-muted); }
