/*
 * Tâches CDE: design system (spec 5.2, errata brand traps, T3).
 *
 * Rules enforced by test/ui-css.test.js:
 *  - Yellow and orange are fills and borders only, never `color:`.
 *  - Every rule that sets `color:` either sets its own background in the same
 *    rule, or declares the backgrounds it sits on with an `on:` comment
 *    (e.g. on: --surface --cde-bg). Each pair must reach 4.5:1.
 *  - Every focus ring declares the surfaces it sits on with `ring-on:`, 3:1.
 *  - No font-size under 12px.
 * No web fonts, no gradients, no `opacity` on cards (Terminé uses a tint).
 */

/* ---------- Tokens ---------- */
:root {
  /* Brand (5.2) */
  --cde-navy: #2B435E;
  --cde-blue: #305AA3;
  --cde-teal: #0D7B81;
  --cde-yellow: #F9B837;
  --cde-orange: #EA8F34;
  --cde-bg: #F6F5F4;
  --surface: #FFFFFF;
  --header-beige: #EFE6D8;
  --text: #1D2B3C;
  --muted: #5F6A7A;
  --danger: #B8352E;

  /* Derived (tints for fills only; text on them stays --text / --muted) */
  --on-dark: #FFFFFF;
  --on-dark-muted: #D5DEEA;
  --border: #E3E0DB;
  --field-border: #7A8494;
  --done-tint: #EAF3F3;
  --info-tint: #E9EEF6;
  --warning-tint: #FDF1D6;
  --danger-tint: #FBEAE9;

  /* Type */
  --font: "Segoe UI", Calibri, Carlito, system-ui, sans-serif;
  --fs-xs: 0.75rem;    /* 12px, the floor */
  --fs-sm: 0.8125rem;  /* 13px */
  --fs-body: 1rem;     /* 16px */
  --fs-md: 1.125rem;   /* 18px */
  --fs-lg: 1.375rem;   /* 22px */
  --fs-xl: 1.75rem;    /* 28px */

  /* Space, shape */
  --gutter: 16px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --radius-sm: 6px;
  --radius: 10px;
  --radius-pill: 999px;
  --tap: 44px;
  --max-width: 72rem;

  color-scheme: light;
}

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

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

body {
  margin: 0;
  min-width: 0;
  background: var(--cde-bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

img, svg { display: block; max-width: 100%; height: auto; }
.icon { display: inline-block; width: 1em; height: 1em; flex: none; }
.field__error .icon { width: 12px; height: 12px; }

[hidden] { display: none !important; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 var(--space-3); }
h1 { font-size: var(--fs-xl); }
h2 { font-size: var(--fs-lg); }
h3 { font-size: var(--fs-md); }
p { margin: 0 0 var(--space-2); }

h1, h2 {
  /* on: --cde-bg --surface */
  color: var(--cde-navy);
}

a {
  /* on: --cde-bg --surface */
  color: var(--cde-blue);
  text-underline-offset: 2px;
}

/* Focus: 2px blue ring with an offset on light surfaces (5.2). */
:focus-visible {
  /* ring-on: --cde-bg --surface --done-tint --info-tint --warning-tint --danger-tint */
  outline: 2px solid var(--cde-blue);
  outline-offset: 2px;
}

.muted {
  /* on: --cde-bg --surface --done-tint */
  color: var(--muted);
}

.small { font-size: var(--fs-sm); }

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.pre-wrap { white-space: pre-wrap; }

.skip-link {
  position: absolute;
  left: var(--space-2);
  top: -100px;
  z-index: 10;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--cde-blue);
  font-weight: 600;
}
.skip-link:focus { top: var(--space-2); }

/* ---------- App header: beige band + facet cluster ---------- */
/* No overflow: hidden here: it would clip the focus ring of the header links.
   The motif is an <img> sized inside the band (object-fit), so nothing spills. */
.app-header {
  position: relative;
  background: var(--header-beige);
  color: var(--cde-navy);
}

/* Dark focus ring on the beige header. */
.app-header :focus-visible {
  /* ring-on: --header-beige */
  outline-color: var(--cde-navy);
}


.auth__band :focus-visible {
  /* ring-on: --cde-navy */
  outline-color: var(--on-dark);
}

.app-header__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-4);
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-3) var(--gutter);
}

.app-header__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: var(--tap);
  min-width: 0;
  background: var(--header-beige);
  color: var(--cde-navy);
  font-size: var(--fs-md);
  font-weight: 700;
  text-decoration: none;
}
.app-header__logo { width: 120px; height: 36px; object-fit: cover; flex: none; }

.app-header__motif {
  position: absolute;
  top: 0;
  right: 0;
  width: 150px;
  height: 68px;
  object-fit: cover;
  object-position: right center;
  pointer-events: none;
}
/* Below 900px the brand shares its row with the motif: keep it clear of the
   facets (text never over facets). The 120px PNG logo (PR #2) is wider than the
   old cube, so the motif narrows and, on the smallest phones, the logo too; the
   name may then wrap onto two lines instead of running under the motif. */
.app-header__motif { width: 112px; height: 60px; } /* stays above the wrapped nav row */
.app-header__brand { margin-right: calc(112px - var(--gutter)); }
@media (max-width: 399px) {
  .app-header__logo { width: 96px; height: 29px; }
}
.app-nav { flex-basis: 100%; margin: 0 -10px; }
@media (min-width: 900px) {
  .app-header__brand { margin-right: 0; }
  .app-nav { flex-basis: auto; margin: 0 -10px 0 auto; }
  .app-header__motif { width: 240px; height: 100%; }
  /* Keep the nav clear of the motif on any width (text never over facets). */
  .app-header__inner {
    padding-right: max(calc(var(--gutter) + 112px), calc(256px - (100vw - var(--max-width)) / 2));
  }
}

.app-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin: 0;
  padding: 0;
  list-style: none;
}
.app-nav a,
.app-nav button {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  padding: 0 10px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: var(--header-beige);
  color: var(--cde-navy);
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.app-nav a:hover,
.app-nav button:hover { border-bottom-color: var(--cde-navy); }
.app-nav a[aria-current="page"] { border-bottom-color: var(--cde-yellow); }

.app-nav__badge {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: var(--radius-pill);
  background: var(--cde-yellow);
  color: var(--cde-navy);
  font-size: var(--fs-xs);
  font-weight: 700;
}

.app-main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-5) var(--gutter) 48px;
}

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.page-head h1 { margin: 0; }

/* ---------- Auth: split screen (desktop), top band (mobile) ---------- */
.auth {
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  grid-template-rows: auto 1fr;
}

.auth__band {
  position: relative;
  overflow: hidden;
  min-height: 120px;
  background: var(--cde-navy);
}
.auth__art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: right center;
}
.auth__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 var(--space-5);
  /* on: --cde-bg */
  color: var(--cde-navy);
  font-size: var(--fs-md);
  font-weight: 700;
}
.auth__brand img { width: 120px; height: 36px; object-fit: cover; }

.auth__panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  max-width: 28rem;
  margin: 0 auto;
  padding: var(--space-5) var(--gutter) 48px;
}
.auth__panel h1 { margin-bottom: var(--space-2); }
.auth__lead { margin-bottom: var(--space-5); }
.auth__alt { margin-top: var(--space-4); }

@media (min-width: 900px) {
  .auth {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    grid-template-rows: none;
  }
  .auth__band { min-height: 100vh; min-height: 100dvh; }
  .auth__art { object-position: center; }
  .auth__panel { padding: var(--space-6) var(--space-5); }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--tap);
  padding: 0 var(--space-4);
  border: 2px solid var(--cde-navy);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--cde-navy);
  font: inherit;
  font-size: var(--fs-body);
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { background: var(--cde-bg); color: var(--cde-navy); }

.btn--primary {
  border-color: var(--cde-blue);
  background: var(--cde-blue);
  color: var(--on-dark);
}
.btn--primary:hover { border-color: var(--cde-navy); background: var(--cde-navy); color: var(--on-dark); }

/* Yellow fill, navy text (5.2): the « add » action. */
.btn--accent {
  border-color: var(--cde-yellow);
  background: var(--cde-yellow);
  color: var(--cde-navy);
}
.btn--accent:hover { border-color: var(--cde-orange); background: var(--cde-yellow); color: var(--cde-navy); }

.btn--danger {
  border-color: var(--danger);
  background: var(--danger);
  color: var(--on-dark);
}
.btn--danger:hover { border-color: var(--text); background: var(--text); color: var(--on-dark); }

.btn--link {
  min-height: var(--tap);
  padding: 0 var(--space-2);
  border-color: transparent;
  background: transparent;
  /* on: --cde-bg --surface */
  color: var(--cde-blue);
  text-decoration: underline;
}
.btn--link:hover {
  background: transparent;
  /* on: --cde-bg --surface */
  color: var(--cde-navy);
}

.btn--block { width: 100%; }

.btn[disabled],
.btn[aria-disabled="true"] {
  border-color: var(--border);
  background: var(--cde-bg);
  color: var(--muted);
  cursor: not-allowed;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}

/* ---------- Status badges: always icon + label ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 2px 10px;
  border: 2px solid transparent;
  border-radius: var(--radius-pill);
  font-size: var(--fs-sm);
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}
.badge .icon { width: 12px; height: 12px; flex: none; }

.badge--todo {
  border-color: var(--muted);
  background: var(--surface);
  color: var(--muted);
}
.badge--in_progress {
  border-color: var(--cde-blue);
  background: var(--cde-blue);
  color: var(--on-dark);
}
.badge--waiting {
  border-color: var(--cde-yellow);
  background: var(--cde-yellow);
  color: var(--cde-navy);
}
/* Brand trap (b): teal only on the icon and the border, label in --text. */
.badge--done {
  border-color: var(--cde-teal);
  background: var(--surface);
  color: var(--text);
}
.badge--done .icon {
  /* on: --surface */
  color: var(--cde-teal);
}
.badge--declined {
  border-color: var(--danger);
  background: var(--danger);
  color: var(--on-dark);
}
.badge--overdue {
  border-color: var(--danger);
  background: var(--surface);
  color: var(--danger);
}

.priority {
  /* on: --surface --done-tint */
  color: var(--muted);
  font-size: var(--fs-sm);
  font-weight: 600;
}
.priority--high {
  /* on: --surface --done-tint */
  color: var(--danger);
}

/* ---------- Cards ---------- */
.card-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr));
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.card {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-left: 6px solid var(--muted);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}
.card--in_progress { border-left-color: var(--cde-blue); }
.card--waiting { border-left-color: var(--cde-yellow); }
.card--declined { border-left-color: var(--danger); }
/* Terminé: lighter fill, never opacity (5.2); text stays --text/--muted. */
.card--done {
  border-color: var(--cde-teal);
  border-left-color: var(--cde-teal);
  background: var(--done-tint);
  color: var(--text);
}

.card__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}
.card__title {
  margin: 0;
  font-size: var(--fs-md);
  font-weight: 700;
}
.card__title a {
  /* on: --surface --done-tint */
  color: var(--text);
  text-decoration: none;
}
.card__title a:hover { text-decoration: underline; }
.card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-3);
  margin: 0;
  /* on: --surface --done-tint */
  color: var(--muted);
  font-size: var(--fs-sm);
}
.card__meta dt { font-weight: 600; }
.card__meta dd { margin: 0; }
.card__meta div { display: flex; gap: 4px; }

.panel {
  padding: var(--space-5) var(--gutter);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.panel--accent { border-top: 4px solid var(--cde-yellow); }

/* ---------- Forms ---------- */
.form { display: grid; gap: var(--space-4); }

.field { display: grid; gap: 6px; }
.field__label {
  /* on: --surface --cde-bg */
  color: var(--text);
  font-weight: 600;
}
.field__req {
  /* on: --surface --cde-bg */
  color: var(--muted);
  font-size: var(--fs-sm);
  font-weight: 400;
}
.field__hint {
  /* on: --surface --cde-bg */
  color: var(--muted);
  font-size: var(--fs-sm);
}
.field__input {
  width: 100%;
  min-height: var(--tap);
  padding: 10px 12px;
  border: 1px solid var(--field-border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: var(--fs-body);
}
textarea.field__input { min-height: 7rem; resize: vertical; }
.field__input:focus-visible { border-color: var(--cde-blue); }

.field__error {
  display: flex;
  align-items: center;
  gap: 6px;
  /* on: --surface --cde-bg */
  color: var(--danger);
  font-size: var(--fs-sm);
  font-weight: 600;
}
.field--invalid .field__input { border: 2px solid var(--danger); }

.check {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--tap);
}
.check input { width: 20px; height: 20px; margin: 0; accent-color: var(--cde-blue); }

/* ---------- Banners ---------- */
.banner {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border);
  border-left: 6px solid var(--cde-blue);
  border-radius: var(--radius-sm);
  background: var(--info-tint);
  color: var(--text);
}
.banner__icon { display: flex; flex: none; padding-top: 4px; }
.banner__icon .icon { width: 16px; height: 16px; }
.app-main > .banner,
.panel > .banner { margin-bottom: var(--space-4); }
.banner__body > :last-child { margin-bottom: 0; }
.banner ul { margin: var(--space-1) 0 0; padding-left: 1.25rem; }
.banner a {
  /* on: --info-tint --warning-tint --danger-tint --done-tint */
  color: var(--text);
}
.banner--warning {
  border-left-color: var(--cde-orange);
  background: var(--warning-tint);
  color: var(--text);
}
.banner--danger {
  border-left-color: var(--danger);
  background: var(--danger-tint);
  color: var(--text);
}
.banner--success {
  border-left-color: var(--cde-teal);
  background: var(--done-tint);
  color: var(--text);
}

/* ---------- KPI tiles with the hexagon badge ---------- */
.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 8rem), 1fr));
  gap: var(--space-3);
  margin: 0 0 var(--space-5);
  padding: 0;
  list-style: none;
}
.kpi {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}
a.kpi:hover { border-color: var(--cde-blue); }
.kpi__hex {
  display: grid;
  flex: none;
  place-items: center;
  width: 52px;
  height: 58px;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  background: var(--cde-navy);
  color: var(--on-dark);
  font-size: var(--fs-md);
  font-weight: 700;
}
.kpi__hex--blue { background: var(--cde-blue); color: var(--on-dark); }
.kpi__hex--teal { background: var(--cde-teal); color: var(--on-dark); }
.kpi__hex--yellow { background: var(--cde-yellow); color: var(--cde-navy); }
.kpi__hex--danger { background: var(--danger); color: var(--on-dark); }
.kpi__label {
  /* on: --surface */
  color: var(--muted);
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: 1.3;
}

@media (max-width: 479px) {
  .kpi { flex-direction: column; align-items: flex-start; gap: var(--space-2); }
  .kpi__hex { width: 44px; height: 50px; }
}
.kpi__label { overflow-wrap: normal; hyphens: auto; }

/* ---------- Empty state ---------- */
.empty {
  display: grid;
  justify-items: center;
  gap: var(--space-2);
  padding: var(--space-6) var(--gutter);
  border: 1px dashed var(--field-border);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: center;
}
.empty__art { width: 96px; height: 96px; margin-bottom: var(--space-2); }
.empty__title {
  margin: 0;
  /* on: --surface */
  color: var(--cde-navy);
  font-size: var(--fs-md);
}
.empty__body {
  max-width: 32rem;
  /* on: --surface */
  color: var(--muted);
}

/* ---------- Tasks (T6) ---------- */
/* Date inputs: Chromium and WebKit move focus into the inner date fields, so
   :focus-visible never matches the input itself; ring the wrapper instead. */
.field__input:focus-within {
  /* ring-on: --cde-bg --surface */
  outline: 2px solid var(--cde-blue);
  outline-offset: 2px;
  border-color: var(--cde-blue);
}
textarea.field__input--short { min-height: 5rem; }
select.field__input { appearance: auto; }

/* Unread dot (5.1): a filled blue circle, the text alternative is visually hidden. */
.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: var(--space-2);
  border-radius: 50%;
  background: var(--cde-blue);
  vertical-align: middle;
}

/* « Retirée », « Archivée »: neutral outline flags, never a status shape. */
.badge--flag {
  border-color: var(--field-border);
  background: var(--surface);
  color: var(--text);
}
.card--withdrawn { border-left-style: dashed; }
.marker {
  /* on: --surface --done-tint */
  color: var(--danger);
  font-weight: 600;
}

.group { margin-bottom: var(--space-5); }
.group__title { font-size: var(--fs-lg); }
.group__count {
  /* on: --cde-bg */
  color: var(--muted);
  font-size: var(--fs-body);
  font-weight: 400;
}
.group__details > summary {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--tap);
  cursor: pointer;
}
.group__details > summary .group__title { display: inline; margin: 0; }

.filters {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 12rem), 1fr));
  gap: var(--space-3);
  align-items: end;
  margin-bottom: var(--space-4);
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.filters__actions { align-self: end; }

.detail__head { display: grid; gap: var(--space-2); margin-bottom: var(--space-4); }
.detail__title { margin: 0; overflow-wrap: anywhere; }
.detail__block { margin-bottom: var(--space-5); }
.detail__fields {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr));
  gap: var(--space-3);
  margin: 0 0 var(--space-3);
}
.detail__fields dt {
  /* on: --surface */
  color: var(--muted);
  font-size: var(--fs-sm);
  font-weight: 600;
}
.detail__fields dd { margin: 0; overflow-wrap: anywhere; }
.detail__subtitle { margin-top: var(--space-3); }
.detail__description { overflow-wrap: anywhere; }
.detail__actions { margin-bottom: var(--space-4); }
.detail__more {
  margin-bottom: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.detail__more > summary {
  display: flex;
  align-items: center;
  min-height: var(--tap);
  cursor: pointer;
  font-weight: 600;
}
.detail__more[open] > summary { margin-bottom: var(--space-3); }

.comments, .history { display: grid; gap: var(--space-3); margin: 0 0 var(--space-4); padding: 0; list-style: none; }
.comment {
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
}
.comment__meta {
  /* on: --surface */
  color: var(--muted);
  font-size: var(--fs-sm);
}
.comment__body { margin: 0; overflow-wrap: anywhere; }
.history__item { padding-left: var(--space-3); border-left: 3px solid var(--border); }
.history__item p { margin: 0; overflow-wrap: anywhere; }

/* ---------- Style guide (dev only) ---------- */
.sg-section {
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-5);
  border-bottom: 1px solid var(--border);
}
.sg-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
  margin-bottom: var(--space-3);
}
.sg-swatches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 8rem), 1fr));
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}
.sg-swatch {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: var(--fs-sm);
}
.sg-swatch__chip { height: 56px; border-bottom: 1px solid var(--border); }
.sg-swatch__name { display: block; padding: var(--space-2) var(--space-2) 0; font-weight: 700; }
.sg-swatch__hex {
  display: block;
  padding: 0 var(--space-2) var(--space-2);
  /* on: --surface */
  color: var(--muted);
}
.sg-chip--navy { background: var(--cde-navy); }
.sg-chip--blue { background: var(--cde-blue); }
.sg-chip--teal { background: var(--cde-teal); }
.sg-chip--yellow { background: var(--cde-yellow); }
.sg-chip--orange { background: var(--cde-orange); }
.sg-chip--bg { background: var(--cde-bg); }
.sg-chip--surface { background: var(--surface); }
.sg-chip--text { background: var(--text); }
.sg-chip--muted { background: var(--muted); }
.sg-chip--danger { background: var(--danger); }
.sg-chip--done-tint { background: var(--done-tint); }
.sg-type > * { margin-bottom: var(--space-2); }

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

/* ---------- T5: Utilisateurs, Journal ---------- */
.admin-section { margin-bottom: var(--space-5); }
.admin-section h2 { margin-top: 0; font-size: var(--fs-md); }

.user-list { margin: 0; padding: 0; list-style: none; }
.user-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-top: 1px solid var(--border);
}
.user-row:first-child { border-top: 0; }
.user-row__who { display: grid; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.user-row__name { font-weight: 600; }
.user-row__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }

.inline-form { display: inline; margin: 0; }
.btn--sm { min-height: var(--tap); padding: 0 var(--space-3); font-size: var(--fs-sm); }

.reject-all {
  display: grid;
  gap: var(--space-2);
  justify-items: start;
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}
.checkbox { display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--tap); }
.checkbox input { width: 20px; height: 20px; }

.temp-reveal { margin-bottom: var(--space-5); }
.temp-reveal__password code {
  display: inline-block;
  padding: var(--space-2) var(--space-3);
  border: 2px dashed var(--cde-navy);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: var(--fs-lg);
  letter-spacing: 0.08em;
  overflow-wrap: anywhere;
}

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.audit { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.audit th, .audit td { padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.audit th { font-weight: 700; }
.audit td time { white-space: nowrap; }
.audit__detail { white-space: pre-wrap; overflow-wrap: anywhere; }
.audit__pager { display: flex; gap: var(--space-4); margin-top: var(--space-4); }

/* ---------- T7: push opt-in, Mon compte ---------- */
.push-optin { margin-bottom: var(--space-3); }
.push-optin h2 { margin-top: 0; font-size: var(--fs-md); }
.push-optin__status { font-weight: 600; }
.push-optin__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.account-devices { margin: 0 0 var(--space-5); }
.toggles { display: grid; gap: var(--space-1); margin: 0; padding: 0; border: 0; }
.toggles__hint { margin: 0 0 var(--space-2) 28px; }

/* ---------- Recurring tasks (v1.1) ---------- */
.badge--recurring .icon {
  /* on: --surface */
  color: var(--cde-blue);
}
.series__links {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
}
