
  :root {
    --bg: #EDF1EE;
    --surface: #FFFFFF;
    --surface-2: #F5F8F6;
    --ink: #15302A;
    --muted: #536B65;
    --line: #C7D5CF;
    --accent: #1D6B58;
    --accent-ink: #FFFFFF;
    --accent-soft: #DCEEE7;
    --danger: #A8261D;
    --danger-soft: #FBE7E4;
    --warn: #8A5510;
    --warn-soft: #FBF0DC;
    --focus: #0F5FD1;
  }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      --bg: #0E1815;
      --surface: #15231F;
      --surface-2: #1B2D28;
      --ink: #E3EEEA;
      --muted: #97B0A8;
      --line: #2C423B;
      --accent: #4FB89A;
      --accent-ink: #08201A;
      --accent-soft: #1B3A31;
      --danger: #FF9C92;
      --danger-soft: #3C1D1A;
      --warn: #F0BD73;
      --warn-soft: #3A2C12;
      --focus: #7DB0FF;
    }
  }
  :root[data-theme="dark"] {
    --bg: #0E1815;
    --surface: #15231F;
    --surface-2: #1B2D28;
    --ink: #E3EEEA;
    --muted: #97B0A8;
    --line: #2C423B;
    --accent: #4FB89A;
    --accent-ink: #08201A;
    --accent-soft: #1B3A31;
    --danger: #FF9C92;
    --danger-soft: #3C1D1A;
    --warn: #F0BD73;
    --warn-soft: #3A2C12;
    --focus: #7DB0FF;
  }

  * { box-sizing: border-box; }
  html { -webkit-text-size-adjust: 100%; }
  body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.5;
  }

  .page { max-width: 1100px; margin: 0 auto; padding: 20px 20px 56px; }

  header.top { margin-bottom: 22px; max-width: 62ch; }
  h1 {
    font-family: "Newsreader", Georgia, "Times New Roman", serif;
    font-weight: 600;
    font-size: clamp(1.7rem, 4.2vw, 2.4rem);
    line-height: 1.15;
    letter-spacing: -0.01em;
    margin: 0 0 8px;
  }
  header.top p { margin: 0; color: var(--muted); }

  .panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 24px;
  }
  .panel + .panel { margin-top: 20px; }
  h2 {
    font-family: "Newsreader", Georgia, serif;
    font-weight: 600;
    font-size: 1.3rem;
    margin: 0;
  }

  .grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 24px;
    margin-top: 18px;
  }
  .full { grid-column: 1 / -1; }
  @media (max-width: 640px) {
    .grid { grid-template-columns: 1fr; }
    .panel { padding: 18px; }
  }

  .field { display: flex; flex-direction: column; min-width: 0; }
  .label-row {
    display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
    margin-bottom: 6px;
  }
  label { font-weight: 600; font-size: 0.95rem; }
  .col {
    font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    font-size: 0.75rem;
    color: var(--muted);
  }

  input, select, textarea {
    width: 100%;
    font: inherit;
    color: var(--ink);
    background: var(--surface-2);
    border: 1.5px solid var(--line);
    border-radius: 6px;
    padding: 10px 12px;
    min-height: 44px;
  }
  textarea { resize: vertical; min-height: 84px; }
  input::placeholder, textarea::placeholder { color: var(--muted); opacity: .75; }
  input:hover, select:hover, textarea:hover { border-color: var(--muted); }
  input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
  }
  .field.invalid input, .field.invalid select, .field.invalid textarea {
    border-color: var(--danger);
    background: var(--danger-soft);
  }
  .field.valid input, .field.valid textarea { border-color: var(--accent); }

  .msg { min-height: 1.25rem; margin-top: 5px; font-size: 0.85rem; color: var(--muted); }
  .field.invalid .msg { color: var(--danger); font-weight: 500; }
  .msg.notice { color: var(--warn); font-weight: 500; }

  .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
  button {
    font: inherit; font-weight: 600;
    border-radius: 6px; min-height: 46px; padding: 0 22px;
    cursor: pointer; border: 1.5px solid transparent;
  }
  .btn-primary { background: var(--accent); color: var(--accent-ink); }
  .btn-primary:hover { filter: brightness(1.08); }
  .btn-secondary { background: transparent; color: var(--ink); border-color: var(--line); }
  .btn-secondary:hover { border-color: var(--muted); background: var(--surface-2); }
  .btn-danger { background: transparent; color: var(--danger); border-color: var(--danger); }
  .btn-danger:hover { background: var(--danger-soft); }
  button:disabled { opacity: .5; cursor: not-allowed; }
  .btn-small { min-height: 34px; padding: 0 12px; font-size: 0.85rem; }

  .status {
    margin-top: 18px;
    padding: 12px 14px;
    border-radius: 6px;
    border-left: 5px solid var(--accent);
    background: var(--accent-soft);
    font-weight: 500;
  }
  .status[hidden] { display: none; }
  .status.error { border-left-color: var(--danger); background: var(--danger-soft); }
  .status.info { border-left-color: var(--muted); background: var(--surface-2); }

  .list-head {
    display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px;
  }
  .list-head .sub { color: var(--muted); font-size: 0.9rem; margin-top: 2px; }
  .list-actions { display: flex; flex-wrap: wrap; gap: 10px; }

  .table-wrap { overflow-x: auto; margin-top: 16px; border: 1px solid var(--line); border-radius: 8px; }
  table { border-collapse: collapse; width: 100%; min-width: 860px; font-size: 0.9rem; }
  th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
  th { background: var(--surface-2); font-weight: 600; white-space: nowrap; }
  tbody tr:last-child td { border-bottom: 0; }
  td.motif { max-width: 260px; overflow-wrap: anywhere; }
  td.num { font-variant-numeric: tabular-nums; }
  .empty { padding: 28px 16px; text-align: center; color: var(--muted); }

  .foot-note { margin-top: 14px; font-size: 0.85rem; color: var(--muted); }

  @media (prefers-reduced-motion: no-preference) {
    input, select, textarea, button { transition: border-color .15s, background-color .15s, filter .15s; }
  }

  .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  a.btn { display: inline-flex; align-items: center; text-decoration: none; font-weight: 600;
    border-radius: 6px; min-height: 46px; padding: 0 22px; border: 1.5px solid transparent; }
  a.btn.btn-primary { background: var(--accent); color: var(--accent-ink); }
  a.btn.btn-primary:hover { filter: brightness(1.08); }

  .userbar {
    display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px;
    padding: 10px 0 18px; margin-bottom: 8px; border-bottom: 1px solid var(--line);
  }
  .userbar .who { color: var(--muted); font-size: 0.92rem; }
  .userbar .who strong { color: var(--ink); }
  .badge { display: inline-block; font-size: 0.75rem; font-weight: 600; padding: 1px 8px; border-radius: 999px;
    background: var(--accent-soft); color: var(--accent); margin-left: 6px; }

  .login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
  .login-card { width: 100%; max-width: 420px; }
  .login-card h1 { font-size: 1.7rem; }
  .login-card .field { margin-top: 16px; }
  .login-card .actions { margin-top: 22px; }
  .login-card .btn-primary { width: 100%; }

  .users-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; gap: 12px; align-items: end; margin-top: 14px; }
  @media (max-width: 800px) { .users-grid { grid-template-columns: 1fr 1fr; } }
  @media (max-width: 520px) { .users-grid { grid-template-columns: 1fr; } }
  .row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
  .tag-off { color: var(--danger); font-weight: 600; }
  [hidden] { display: none !important; }

  .filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-top: 14px; }
  .filters .field { flex: 1 1 150px; min-width: 140px; }
  .filters .btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
  .counters { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
  .counter { flex: 1 1 180px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; }
  .counter .n { font-family: "Newsreader", Georgia, serif; font-size: 1.9rem; font-weight: 600; line-height: 1.1; }
  .counter .l { color: var(--muted); font-size: 0.85rem; }
  h3.sub-title { font-family: "Newsreader", Georgia, serif; font-size: 1.1rem; margin: 24px 0 0; }
  .act-ENREGISTREMENT { color: var(--accent); font-weight: 600; }
  .act-TELECHARGEMENT { color: var(--warn); font-weight: 600; }
  .act-SUPPRESSION { color: var(--danger); font-weight: 600; }
  .head-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
  a.btn.btn-small { min-height: 34px; padding: 0 12px; font-size: 0.85rem; }
  a.btn.btn-secondary { background: transparent; color: var(--ink); border-color: var(--line); }
  a.btn.btn-secondary:hover { border-color: var(--muted); background: var(--surface-2); }
