/* ============================================================
   ADMIN - couche Nocturne
   ------------------------------------------------------------
   Habillage des 12 pages admin, d apres la maquette
   handoff-admin-console/"Admin Console.dc.html".

   Chargee APRES css/nocturne-base.css, qui porte les tokens
   (--color-*, --space-*, --radius-*, --shadow-*) et les classes
   .pd-* du chrome. Aucune valeur de couleur, de typo ou d espace
   n est reecrite ici : tout passe par ces variables.

   Les pages admin converties ne chargent plus style.css ni
   theme-meridian.css : cette derniere posait des !important sur
   body et header, et il vaut mieux la retirer que de lui repondre
   avec d autres !important.

   Le theme suit le reste du site : classe .pd-dark sur <html>,
   cle localStorage 'pd-theme'. Seul le DEFAUT change - l admin
   s ouvre en sombre, le bootstrap est dans le <head> des pages.
   ============================================================ */


/* ============================================================
   1. TOKENS PROPRES A L ADMIN
   ------------------------------------------------------------
   §5 du handoff : les fonds en creux passent par des tokens, pas
   par --color-neutral-900, parce que la ramp neutre s INVERSE
   entre les deux themes. Idem pour les trois encres semantiques :
   accent-200/300 restent clairs et disparaissent sur blanc.
   Valeurs claires sur :root, valeurs sombres sous .pd-dark -
   meme specificite, declaree apres, donc elle l emporte.
   ============================================================ */
:root {
  --ad-strip: #f1f0f6;
  --ad-field: #f5f4f9;
  --ad-thumb: #e6e5ee;

  --ad-ok:   #12643a;
  --ad-warn: #7a5310;
  --ad-bad:  #9c2b25;
  --ad-ok-bg:   #dff0e6;
  --ad-warn-bg: #fdf0d8;
  --ad-bad-bg:  #fbe3e1;

}

.pd-dark {
  --ad-strip: color-mix(in srgb, var(--color-neutral-900) 55%, transparent);
  --ad-field: color-mix(in srgb, var(--color-neutral-900) 55%, transparent);
  --ad-thumb: color-mix(in srgb, var(--color-neutral-900) 60%, transparent);

  --ad-ok:   #3fa877;
  --ad-warn: #d8a23f;
  --ad-bad:  #e0736d;
  --ad-ok-bg:   color-mix(in srgb, #3fa877 16%, transparent);
  --ad-warn-bg: color-mix(in srgb, #d8a23f 16%, transparent);
  --ad-bad-bg:  color-mix(in srgb, #e0736d 16%, transparent);
}


/* ============================================================
   2. PAGE
   ============================================================ */
body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
}

.ad-main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px clamp(14px, 4vw, 40px) 64px;
}

/* En-tete de section : kicker, titre, phrase d aide. */
.ad-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 22px;
}
.ad-kicker {
  display: block; margin-bottom: 6px;
  font-family: var(--font-heading); font-size: 11px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--color-accent);
}
.pd-dark .ad-kicker { color: var(--color-accent-300); }
.ad-title {
  display: flex; align-items: center; gap: 11px;
  margin: 0; font-size: 31px; letter-spacing: -0.02em;
}
.ad-title svg { color: var(--color-accent); flex: 0 0 auto; }
.pd-dark .ad-title svg { color: var(--color-accent-300); }
.ad-lede {
  margin: 8px 0 0; max-width: 68ch; font-size: 13.5px;
  color: var(--color-neutral-500);
}


/* ============================================================
   3. EN-TETE ET BARRE D ONGLETS
   ============================================================ */
/* L en-tete admin est le meme que sur tout le site (.pd-header de
   nocturne-base.css : fond, encres et bordure suivent le theme). Il ne
   garde que sa pastille "Admin" et le bouton de la page courante
   rempli, comme la barre fixe des clients et des pros. */
.ad-header .ad-navon {
  background: var(--color-accent);
  color: var(--color-bg);
  font-weight: 600;
}
.ad-header .ad-navon:hover { background: var(--color-accent-500); color: var(--color-bg); }

/* La pastille Admin de la marque. */
.ad-admin {
  padding: 3px 9px; border-radius: 999px;
  background: color-mix(in srgb, var(--color-accent) 22%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-accent) 45%, transparent);
  color: var(--color-accent-300);
  font-family: var(--font-heading); font-size: 10.5px;
  letter-spacing: 0.1em; text-transform: uppercase;
}

/* Barre d onglets : UNE rangee defilante a toutes les largeurs.
   Pas de menu hamburger pour elle - une section reste a un tap. */
.ad-tabs {
  position: sticky; top: 63px; z-index: 30;
  display: flex; gap: 3px; overflow-x: auto;
  padding: 9px clamp(14px, 4vw, 40px);
  background: color-mix(in srgb, var(--color-bg) 92%, var(--color-neutral-900));
  backdrop-filter: blur(6px);
  box-shadow: inset 0 -1px 0 var(--color-divider);
  scrollbar-width: none;
}
.ad-tabs::-webkit-scrollbar { display: none; }
.ad-tab {
  flex: 0 0 auto; display: flex; align-items: center; gap: 7px;
  min-height: 40px; padding: 8px 13px; border-radius: 9px;
  font-family: var(--font-heading); font-size: 13px;
  color: var(--color-neutral-400); background: transparent;
  white-space: nowrap;
}
.ad-tab:hover {
  color: var(--color-text);
  background: color-mix(in srgb, var(--color-text) 7%, transparent);
}
.ad-tab.ad-on {
  color: var(--color-accent-200);
  background: color-mix(in srgb, var(--color-accent) 20%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--color-accent) 40%, transparent);
}
.ad-tab.ad-on:hover { color: var(--color-accent-200); }
.ad-tabcount {
  background: var(--ad-warn-bg); color: var(--ad-warn);
  font-variant-numeric: tabular-nums;
}
/* Alerte : un demandeur a envoye les pieces demandees (admin-chrome.js).
   Pastille verte sur l onglet Claimers, bandeau sous les onglets. */
.ad-tabcount.ad-tabnew { background: var(--ad-ok-bg); color: var(--ad-ok); }
.ad-alert {
  max-width: 1280px; margin: 14px auto 0;
  padding: 0 clamp(14px, 4vw, 40px);
}
.ad-alert-in {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px;
  padding: 11px 16px; border-radius: var(--radius-lg);
  background: var(--ad-ok-bg); color: var(--ad-ok);
  box-shadow: inset 3px 0 0 var(--ad-ok);
  font-size: 13.5px; line-height: 1.5; overflow-wrap: anywhere;
}
.ad-alert-in b { font-weight: 600; }
.ad-alert-in a { color: inherit; text-decoration: underline; text-underline-offset: 2px; font-weight: 600; }
.ad-alert-dot {
  width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto;
  background: var(--ad-ok); animation: ad-pulse 1.6s ease-in-out infinite;
}
@keyframes ad-pulse { 50% { opacity: .35; } }
/* Bandeau de la carte, et etiquette NEW sur les pieces arrivees. */
.ad-newdocs {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px;
  margin: 10px 0 0; padding: 9px 12px; border-radius: 10px;
  background: var(--ad-ok-bg); color: var(--ad-ok); font-size: 13px;
  box-shadow: inset 3px 0 0 var(--ad-ok);
}
.ad-newdocs .ad-act { margin-left: auto; }
.ad-newtag {
  display: inline-block; margin-left: 4px; padding: 0 5px; border-radius: 5px;
  background: var(--ad-ok); color: var(--color-surface);
  font-size: 9.5px; font-weight: 700; letter-spacing: .06em; vertical-align: 1px;
}
/* Pieces d une revendication, regroupees par envoi (le plus recent en haut). */
.ad-docs { margin: 12px 0 0; }
.ad-docs h4 {
  margin: 0 0 6px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--color-neutral-500); font-weight: 600;
}
.ad-docgroup {
  padding: 9px 12px; border-radius: 10px; margin-top: 6px;
  background: var(--color-surface); box-shadow: inset 0 0 0 1px var(--color-divider);
}
.ad-docgroup-new { box-shadow: inset 3px 0 0 var(--ad-ok), inset 0 0 0 1px color-mix(in srgb, var(--ad-ok) 45%, transparent); }
.ad-docgroup-head { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; font-size: 13px; font-weight: 600; }
.ad-docgroup-head .ad-newtag { margin-left: 0; }
.ad-doclist {
  list-style: none; margin: 6px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 14px;
}
.ad-doclist li { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; }
.ad-doclist .ad-doclink { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ad-dockind {
  flex: 0 0 auto; min-width: 34px; text-align: center; padding: 1px 5px; border-radius: 5px;
  font-size: 9.5px; font-weight: 700; letter-spacing: .05em;
  background: color-mix(in srgb, var(--color-accent) 16%, transparent); color: var(--color-accent-300);
}
.ad-flash { animation: ad-flash 1.6s ease-out 1; }
/* La carte visee par #claim-<id> s arrete sous l en-tete et les onglets collants. */
.ad-card[id^="claim-"] { scroll-margin-top: 130px; }
@keyframes ad-flash { 0%, 30% { box-shadow: 0 0 0 3px var(--ad-ok); } 100% { box-shadow: var(--shadow-sm); } }
@media (prefers-reduced-motion: reduce) { .ad-alert-dot, .ad-flash { animation: none; } }
.ad-drawer .pd-drawerlink { display: flex; align-items: center; gap: 11px; }
.ad-drawer .pd-drawerlink.ad-on {
  color: var(--color-accent-200);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--color-accent) 40%, transparent);
}


/* ============================================================
   4. SURFACES
   ============================================================ */
.ad-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 18px 20px;
  animation: ad-rise .4s cubic-bezier(.33,1,.68,1) both;
  animation-delay: var(--d, 0ms);
}
.ad-card.ad-flush { padding: 0; overflow: hidden; }
@keyframes ad-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .ad-card { animation: none !important; } }

.ad-strip { background: var(--ad-strip); }
.ad-thumb { background: var(--ad-thumb); }

/* Bandeau de message : meme role que l ancien #message. */
.ad-msg {
  display: none; margin-bottom: 16px; padding: 11px 14px;
  border-radius: var(--radius-md); font-size: 13.5px;
}
.ad-msg.success { display: block; background: var(--ad-ok-bg);  color: var(--ad-ok);  }
.ad-msg.error   { display: block; background: var(--ad-bad-bg); color: var(--ad-bad); }
.ad-msg b { font-weight: 600; }
.ad-code {
  display: block; margin-top: 6px;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 1.05rem; letter-spacing: 3px; color: var(--ad-ok);
}


/* ============================================================
   5. CHAMPS
   ============================================================ */
.ad-in {
  width: 100%; box-sizing: border-box;
  font-family: var(--font-body); font-size: 13.5px;
  color: var(--color-text); background: var(--ad-field);
  border: 1px solid var(--color-neutral-800); border-radius: 9px;
  padding: 10px 12px;
  transition: border-color .16s ease, box-shadow .18s ease;
}
.ad-in:focus {
  outline: none; border-color: var(--color-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-accent) 20%, transparent);
}
.ad-in::placeholder { color: var(--color-neutral-600); }
select.ad-in { appearance: none; cursor: pointer; padding-right: 30px;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
                    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
textarea.ad-in { resize: vertical; line-height: 1.55; min-height: 96px; }

/* Barre de recherche et filtres. */
.ad-filters {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  margin-bottom: 16px;
}
.ad-filters .ad-in { width: auto; }
.ad-filters .ad-search { flex: 1 1 260px; min-width: 200px; }
.ad-count {
  margin-left: auto; font-size: 12.5px; color: var(--color-neutral-500);
  white-space: nowrap;
}
.ad-count strong { color: var(--color-text); font-variant-numeric: tabular-nums; }


/* ============================================================
   6. TABLE
   ------------------------------------------------------------
   Reprise du .table du design system : en-tete en capitales 11px
   et regles de ligne qui s effacent aux extremites sur 48px.
   ============================================================ */
.ad-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ad-table th {
  text-align: left; padding: 10px 12px;
  font-family: var(--font-heading); font-size: 11px;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: color-mix(in srgb, var(--color-text) 60%, transparent);
  white-space: nowrap;
}
.ad-table td { padding: 12px; vertical-align: middle; }
.ad-table thead tr {
  background: linear-gradient(to right,
    transparent, var(--color-divider) 48px,
    var(--color-divider) calc(100% - 48px), transparent) no-repeat bottom / 100% 1px;
}
.ad-table tbody tr {
  background: linear-gradient(to right,
    transparent, color-mix(in srgb, var(--color-text) 8%, transparent) 48px,
    color-mix(in srgb, var(--color-text) 8%, transparent) calc(100% - 48px), transparent) no-repeat bottom / 100% 1px;
}
.ad-table tbody tr:hover {
  background:
    linear-gradient(color-mix(in srgb, var(--color-accent) 7%, transparent),
                    color-mix(in srgb, var(--color-accent) 7%, transparent)) no-repeat 0 0 / 100% 100%,
    linear-gradient(to right,
      transparent, color-mix(in srgb, var(--color-text) 8%, transparent) 48px,
      color-mix(in srgb, var(--color-text) 8%, transparent) calc(100% - 48px), transparent) no-repeat bottom / 100% 1px;
}
.ad-num { font-variant-numeric: tabular-nums; color: var(--color-neutral-500); }
.ad-sub { display: block; font-size: 12px; color: var(--color-neutral-500); }
.ad-empty { padding: 34px 12px; text-align: center; color: var(--color-neutral-500); }
.ad-loading { padding: 34px 12px; text-align: center; color: var(--color-neutral-500); }
.ad-error { padding: 34px 12px; text-align: center; color: var(--ad-bad); }


/* ============================================================
   7. PASTILLES
   ============================================================ */
.ad-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 600; letter-spacing: .02em;
  white-space: nowrap;
}
.ad-pill-ok   { background: var(--ad-ok-bg);   color: var(--ad-ok);   }
.ad-pill-warn { background: var(--ad-warn-bg); color: var(--ad-warn); }
.ad-pill-bad  { background: var(--ad-bad-bg);  color: var(--ad-bad);  }
.ad-pill-mute { background: var(--ad-strip);   color: var(--color-neutral-500); }
.ad-pill-accent {
  background: color-mix(in srgb, var(--color-accent) 18%, transparent);
  color: var(--color-accent);
}
.pd-dark .ad-pill-accent { color: var(--color-accent-300); }
.ad-pill-up { text-transform: uppercase; font-size: 10px; letter-spacing: .06em; }


/* ============================================================
   8. BOUTONS D ACTION
   ------------------------------------------------------------
   §2 du handoff : des boutons TEXTE, jamais des pictogrammes
   seuls, poses sur leur propre fond en creux. Deux emoji cote a
   cote (le code de reset et la fin des sessions) etaient
   indistinguables.
   ============================================================ */
.ad-acts {
  display: flex; align-items: center; gap: 5px; flex-wrap: wrap;
  padding: 5px; border-radius: 10px; background: var(--ad-strip);
}
.ad-act {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 10px; border: 1px solid transparent; border-radius: 7px;
  font-family: var(--font-heading); font-size: 12px; line-height: 1.2;
  color: var(--color-neutral-400); background: transparent;
  cursor: pointer; white-space: nowrap;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.ad-act:hover {
  color: var(--color-text);
  background: color-mix(in srgb, var(--color-text) 9%, transparent);
}
.ad-act:disabled { opacity: .4; cursor: not-allowed; }
.ad-act:disabled:hover { background: transparent; color: var(--color-neutral-400); }
/* Etat "deja verifie" : la bascule se lit sans infobulle. */
.ad-act.ad-on { color: var(--ad-ok); background: var(--ad-ok-bg); }
.ad-act-primary { color: var(--color-accent); border-color: color-mix(in srgb, var(--color-accent) 55%, transparent); }
.pd-dark .ad-act-primary { color: var(--color-accent-300); }
.ad-act-primary:hover { background: color-mix(in srgb, var(--color-accent) 14%, transparent); color: var(--color-accent); }
.ad-act-warn { color: var(--ad-warn); border-color: color-mix(in srgb, #d8a23f 50%, transparent); }
.ad-act-warn:hover { background: var(--ad-warn-bg); color: var(--ad-warn); }
.ad-act-ok { color: var(--ad-ok); border-color: color-mix(in srgb, #3fa877 50%, transparent); }
.ad-act-ok:hover { background: var(--ad-ok-bg); color: var(--ad-ok); }
/* Le seul bouton rouge plein, en dernier, derriere un filet. */
.ad-act-danger { background: var(--ad-bad); color: #ffffff; border-color: transparent; }
.ad-act-danger:hover { background: color-mix(in srgb, var(--ad-bad) 82%, #000); color: #ffffff; }
.ad-act-danger:disabled:hover { background: var(--ad-bad); color: #ffffff; }
.ad-sep {
  width: 1px; align-self: stretch; margin: 2px 4px;
  background: var(--color-divider);
}
.ad-spin {
  display: inline-block; width: 12px; height: 12px; vertical-align: -1px;
  border: 2px solid currentColor; border-top-color: transparent;
  border-radius: 50%; animation: ad-spin 1s linear infinite;
}
@keyframes ad-spin { to { transform: rotate(360deg); } }


/* ============================================================
   9. PAGINATION
   ============================================================ */
.ad-pager {
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  margin-bottom: 12px; font-size: 12.5px; color: var(--color-neutral-500);
}
.ad-page {
  padding: 6px 12px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--color-neutral-800); background: var(--ad-field);
  color: var(--color-text); font-family: var(--font-heading); font-size: 12.5px;
}
.ad-page:hover:not(:disabled) { border-color: var(--color-accent); color: var(--color-accent); }
.ad-page:disabled { opacity: .4; cursor: not-allowed; }


/* ============================================================
   10. COMPTES - table (>=1240px) et cartes (en dessous)
   ------------------------------------------------------------
   Chaque compte est une bande distincte, avec un rail de 3px a
   gauche qui code son etat : vert (email + telephone verifies),
   ambre (une verification manque), rouge (suspendu).
   ============================================================ */
.ad-ulist { display: none; flex-direction: column; }

.ad-urow {
  position: relative; padding: 15px 18px 15px 21px;
  border-bottom: 1px solid var(--color-divider);
}
.ad-urow:last-child { border-bottom: 0; }
.ad-urow:nth-child(even) { background: color-mix(in srgb, var(--color-text) 3%, transparent); }
.ad-urow::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--ad-rail, var(--color-neutral-700));
}
.ad-urow.ad-st-ok   { --ad-rail: var(--ad-ok); }
.ad-urow.ad-st-warn { --ad-rail: var(--ad-warn); }
.ad-urow.ad-st-bad  { --ad-rail: var(--ad-bad); }

.ad-uname { font-family: var(--font-heading); font-size: 15px; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.ad-umeta { margin-top: 3px; font-size: 12.5px; color: var(--color-neutral-500); }
.ad-ustate { margin-top: 2px; font-size: 12px; color: var(--color-neutral-500); }
.ad-urow .ad-acts { margin-top: 11px; }

/* Le meme rail, dans la table. */
.ad-table tbody tr.ad-st-ok   td:first-child { box-shadow: inset 3px 0 0 var(--ad-ok); }
.ad-table tbody tr.ad-st-warn td:first-child { box-shadow: inset 3px 0 0 var(--ad-warn); }
.ad-table tbody tr.ad-st-bad  td:first-child { box-shadow: inset 3px 0 0 var(--ad-bad); }
.ad-table tbody tr.ad-banned td { color: var(--ad-bad); }


/* ============================================================
   11. MODALE
   ============================================================ */
.ad-backdrop {
  position: fixed; inset: 0; z-index: 2000; display: none;
  align-items: flex-start; justify-content: center;
  padding: 48px 16px; overflow-y: auto;
  background: color-mix(in srgb, #0b0c14 66%, transparent);
  backdrop-filter: blur(3px);
}
.ad-backdrop.ad-open { display: flex; }
.ad-dialog {
  width: min(760px, 100%); border-radius: var(--radius-lg);
  background: var(--color-surface); box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.ad-dialog-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 15px 18px; border-bottom: 1px solid var(--color-divider);
}
.ad-dialog-head h2 { margin: 0; font-size: 18px; }
.ad-dialog-close {
  width: 34px; height: 34px; display: grid; place-items: center;
  border: 1px solid var(--color-neutral-800); border-radius: 9px;
  background: var(--ad-field); color: var(--color-neutral-400);
  font-size: 19px; line-height: 1; cursor: pointer;
}
.ad-dialog-close:hover { color: var(--color-text); border-color: var(--color-accent); }
.ad-dialog-body { padding: 18px; }

.ad-tiles {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 8px; margin-bottom: 18px;
}
.ad-tile { padding: 11px 13px; border-radius: var(--radius-md); background: var(--ad-strip); }
.ad-tile .n { font-family: var(--font-heading); font-size: 23px; line-height: 1.1; }
.ad-tile .l { font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--color-neutral-500); }
.ad-sec { margin-top: 18px; }
.ad-sec h3 {
  margin: 0 0 7px; font-size: 11px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--color-neutral-500);
}
.ad-line { padding: 8px 0; border-bottom: 1px solid var(--color-divider); font-size: 13.5px; }
.ad-line:last-child { border-bottom: 0; }
.ad-none { font-size: 13px; font-style: italic; color: var(--color-neutral-500); }


/* ============================================================
   12. PALIERS
   ------------------------------------------------------------
   Repris de la maquette (l. 43-90). Les cibles tactiles montent a
   44px au point de bascule de CHAQUE bloc, pas a 620px : c est ce
   qui fait que la tablette les a aussi. Les !important battent les
   tailles heritees de la densite desktop.
   ============================================================ */
@media (max-width: 1240px) {
  .ad-utable { display: none !important; }
  .ad-ulist  { display: flex !important; }
  .ad-ulist .ad-act { min-height: 44px !important; padding-inline: 13px !important; }
  .ad-ulist select, .ad-ulist .ad-in { min-height: 44px !important; }
}

@media (max-width: 1080px) {
  .ad-header .pd-nav > a { display: none !important; }
}

@media (max-width: 900px) {
  .ad-two { grid-template-columns: minmax(0, 1fr) !important; }
  .ad-formgrid { grid-template-columns: minmax(0, 1fr) !important; }
  .ad-utable { display: none !important; }
  .ad-ulist  { display: flex !important; }
}

@media (max-width: 760px) {
  /* .pd-nav disparait et le tiroir prend le relais (regle de
     nocturne-base.css). La barre d onglets, elle, reste. */
  .ad-tabs { top: 59px; }
}

@media (max-width: 620px) {
  .ad-title { font-size: 26px !important; }
  .ad-head { flex-direction: column !important; align-items: flex-start !important; }
  .ad-main { padding-top: 18px !important; }
  .ad-filters .ad-in { width: 100%; }
  .ad-filters .ad-search { flex: 1 1 100%; }
  .ad-count { margin-left: 0; }
  .ad-urow .ad-act { flex: 1 1 0; justify-content: center; }
  .ad-sep { display: none; }
}


/* Le select de role vit DANS la barre d actions : il doit tenir la meme
   hauteur que les boutons texte qui l entourent, pas celle d un champ de
   formulaire. */
.ad-rolesel { width: auto; padding: 6px 26px 6px 9px; font-size: 12px; }
/* Compte admin : le role est affiche, jamais modifiable depuis la page. */
.ad-rolefixed {
  display: inline-flex; align-items: center; padding: 6px 10px;
  cursor: default; color: var(--color-accent-200);
  background: color-mix(in srgb, var(--color-accent) 14%, transparent);
  border-color: color-mix(in srgb, var(--color-accent) 40%, transparent);
}
.ad-table .ad-uname { font-size: 14px; }

/* Le bouton "page precedente" etait cale en haut a gauche, sous une
   navbar seule (top: 92px). L admin empile maintenant l en-tete ET la
   barre d onglets : la ou il tombe, il couvre le kicker et le titre.
   Sur les pages admin il passe donc en bas a gauche - meme bouton, meme
   comportement, juste hors du chemin. Cette feuille est chargee apres
   back-to-prev.css, sinon le top d origine l emporterait. */
.back-to-prev { top: auto; bottom: 24px; left: 24px; }
@media (max-width: 760px) { .back-to-prev { bottom: 18px; left: 14px; } }

/* Le menu de compte, lui, retombe sur la page : tokens habituels. */
.ad-header .pd-menu a { color: var(--color-text); }


/* ============================================================
   13. COMPOSANTS DES AUTRES ONGLETS
   ------------------------------------------------------------
   Leurs paliers responsive sont deja ecrits au §12 (repris de la
   maquette) ; voici leurs regles de base.
   ============================================================ */

/* ---------- Dashboard : les trois grilles ---------- */
.ad-kpis, .ad-queue, .ad-week {
  display: grid; gap: 10px; margin-bottom: 26px;
}
.ad-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ad-queue { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ad-week { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.ad-kpi {
  display: block; padding: 16px 18px;
  background: var(--color-surface); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); color: var(--color-text);
}
.ad-kpi .n {
  font-family: var(--font-heading); font-size: 29px; line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.ad-kpi .l {
  display: flex; align-items: center; gap: 6px; margin-top: 4px;
  font-size: 11.5px; letter-spacing: .05em; text-transform: uppercase;
  color: var(--color-neutral-500);
}
.ad-kpi .l svg { flex: 0 0 auto; }
/* Une tuile de file est cliquable : elle doit le montrer. */
a.ad-kpi { transition: box-shadow .18s ease, transform .18s ease; }
a.ad-kpi:hover {
  color: var(--color-text); transform: translateY(-1px);
  box-shadow: var(--shadow-md), inset 0 0 0 1px color-mix(in srgb, var(--color-accent) 45%, transparent);
}
/* Zero = rien a faire ; des qu il y a du monde dans la file, la tuile passe
   en ambre. Le chiffre seul ne se remarque pas. */
a.ad-kpi.ad-waiting .n { color: var(--ad-warn); }
.ad-week .ad-kpi .sub {
  margin-top: 6px; font-size: 11.5px; color: var(--color-neutral-600);
}
.ad-secline {
  display: flex; align-items: center; gap: 9px; margin: 30px 0 12px;
  font-family: var(--font-heading); font-size: 17px;
}
.ad-secline svg { color: var(--color-accent); }
.pd-dark .ad-secline svg { color: var(--color-accent-300); }

/* ---------- Carte a filet colore (reports, reviews, corbeille, claims) ---------- */
.ad-rail { position: relative; padding-left: 22px; }
.ad-rail::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
  background: var(--ad-rail-c, var(--color-neutral-700));
}
.ad-rail.ad-r-ok     { --ad-rail-c: var(--ad-ok); }
.ad-rail.ad-r-warn   { --ad-rail-c: var(--ad-warn); }
.ad-rail.ad-r-bad    { --ad-rail-c: var(--ad-bad); }
.ad-rail.ad-r-accent { --ad-rail-c: var(--color-accent); }
.ad-rail.ad-r-mute   { --ad-rail-c: var(--color-neutral-700); }
.ad-stack { display: flex; flex-direction: column; gap: 10px; }
.ad-when { font-size: 12px; color: var(--color-neutral-500); white-space: nowrap; }
.ad-body { margin: 8px 0 0; white-space: pre-wrap; font-size: 13.5px; }
.ad-quote {
  margin-top: 9px; padding: 9px 12px; border-radius: var(--radius-md);
  background: var(--ad-strip); font-size: 13px; color: var(--color-neutral-400);
}
.ad-meta { margin-top: 9px; font-size: 12px; color: var(--color-neutral-500); }
.ad-rowtop {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
}

/* ---------- Onglets internes (Reports) ---------- */
.ad-subtabs { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 16px; }
.ad-subtab {
  padding: 7px 13px; border-radius: 9px; cursor: pointer;
  border: 1px solid var(--color-neutral-800); background: var(--ad-field);
  color: var(--color-neutral-400);
  font-family: var(--font-heading); font-size: 12.5px;
}
.ad-subtab:hover { color: var(--color-text); border-color: var(--color-neutral-700); }
.ad-subtab.ad-on {
  color: var(--color-accent-200);
  border-color: color-mix(in srgb, var(--color-accent) 55%, transparent);
  background: color-mix(in srgb, var(--color-accent) 20%, transparent);
}

/* ---------- Chips (contenu de la corbeille, recoupements de claim) ---------- */
.ad-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; margin: 0 5px 5px 0; border-radius: 8px;
  background: var(--ad-strip); color: var(--color-neutral-400); font-size: 11.5px;
}
.ad-chip.ad-c-ok   { background: var(--ad-ok-bg);   color: var(--ad-ok); }
.ad-chip.ad-c-warn { background: var(--ad-warn-bg); color: var(--ad-warn); }
.ad-chip.ad-c-bad  { background: var(--ad-bad-bg);  color: var(--ad-bad); }

/* ---------- Journal d audit : la colonne Details ---------- */
.ad-mono {
  max-width: 340px; font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 11.8px; word-break: break-word; color: var(--color-neutral-400);
}

/* ---------- Businesses : lignes empilees sous 1080px ---------- */
.ad-blist { display: none; flex-direction: column; }
.ad-brow {
  display: grid; grid-template-columns: 34px minmax(0, 1fr);
  gap: 4px 12px; align-items: center;
  padding: 15px 18px; border-bottom: 1px solid var(--color-divider);
}
.ad-brow:last-child { border-bottom: 0; }
.ad-brow:nth-child(even) { background: color-mix(in srgb, var(--color-text) 3%, transparent); }
.ad-bname { font-family: var(--font-heading); font-size: 15px; }
@media (max-width: 1080px) {
  .ad-btable { display: none !important; }
  .ad-blist  { display: flex !important; }
  .ad-blist .ad-act { min-height: 44px !important; padding-inline: 13px !important; }
}

/* ---------- Categories ---------- */
.ad-catrow {
  display: grid; grid-template-columns: 74px minmax(0, 1fr) auto;
  gap: 12px; align-items: center;
  padding: 13px 18px; border-bottom: 1px solid var(--color-divider);
}
.ad-catrow:last-child { border-bottom: 0; }
/* Meme rapport que la tuile 168x104 de la page d accueil. */
.ad-catthumb {
  width: 74px; height: 46px; border-radius: var(--radius-md);
  object-fit: cover; background: var(--ad-thumb);
}
.ad-catacts { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; }
.ad-filepick {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 12px; border-radius: 9px; cursor: pointer;
  border: 1px dashed var(--color-neutral-700); background: transparent;
  color: var(--color-neutral-400); font-family: var(--font-heading); font-size: 12.5px;
}
.ad-filepick:hover { border-color: var(--color-accent); color: var(--color-accent); }
.ad-filepick input[type="file"] { display: none; }
.ad-upstate { font-size: 11.5px; color: var(--color-neutral-500); }

/* ---------- Platform : les interrupteurs ---------- */
.ad-switch {
  position: relative; width: 52px; height: 30px; flex: 0 0 auto;
  padding: 0; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--color-neutral-700);
  transition: background .2s ease;
}
.ad-switch > span {
  position: absolute; top: 4px; left: 4px; width: 22px; height: 22px;
  border-radius: 999px; background: #ffffff;
  box-shadow: 0 1px 3px rgba(0,0,0,.35);
  transition: left .2s cubic-bezier(.33,1,.68,1);
}
.ad-switch[aria-pressed="true"] { background: var(--ad-ok); }
.ad-switch[aria-pressed="true"] > span { left: 26px; }
/* Un reglage dangereux allume en rouge, jamais en vert. */
.ad-switch.ad-danger[aria-pressed="true"] { background: var(--ad-bad); }
.ad-switch:disabled { opacity: .5; cursor: progress; }
.ad-setrow {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px;
  align-items: start;
}
.ad-effect {
  margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--color-divider);
  font-size: 12.5px; color: var(--color-neutral-500);
}
.ad-effect b { color: var(--color-text); font-weight: 600; }

/* ---------- Formulaires (Add business) ---------- */
.ad-formgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.ad-two { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.ad-field { display: flex; flex-direction: column; gap: 5px; }
.ad-field.ad-wide { grid-column: 1 / -1; }
.ad-field label {
  font-family: var(--font-heading); font-size: 12px;
  color: var(--color-neutral-400);
}
.ad-req { color: var(--ad-bad); }
.ad-hint { font-size: 11.5px; color: var(--color-neutral-600); }
/* Les deux options a bascule sont des cartes, pas des cases perdues. */
.ad-opt {
  display: flex; gap: 11px; align-items: flex-start;
  padding: 13px 15px; border-radius: var(--radius-md); cursor: pointer;
  background: var(--ad-strip); border: 1px solid transparent;
}
.ad-opt:hover { border-color: color-mix(in srgb, var(--color-accent) 40%, transparent); }
.ad-opt input { margin-top: 3px; accent-color: var(--color-accent); }
.ad-opt .t { font-family: var(--font-heading); font-size: 13.5px; }
/* Choix adresse fixe / zone de service (admin-add-business) : deux cartes
   .ad-opt cote a cote, la cochee prend le contour accent. */
.ad-locpick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ad-locpick .ad-opt:has(input:checked) {
  border-color: color-mix(in srgb, var(--color-accent) 60%, transparent);
  background: color-mix(in srgb, var(--color-accent) 10%, var(--ad-strip));
}
@media (max-width: 560px) { .ad-locpick { grid-template-columns: 1fr; } }


/* ============================================================
   14. PALIERS DES COMPOSANTS DU §13
   ------------------------------------------------------------
   Le §12 n avait recopie de la maquette que les paliers exerces
   par la page pilote. Voici les autres, aux memes points de
   bascule : les grilles du dashboard, les interrupteurs Platform
   et les lignes de categories.
   ============================================================ */

@media (max-width: 1080px) {
  .ad-catacts > button { min-height: 44px !important; height: auto !important; }
  .ad-switch { width: 62px !important; height: 44px !important; }
  .ad-switch > span { top: 10px !important; width: 24px !important; height: 24px !important; left: 5px !important; }
  .ad-switch[aria-pressed="true"] > span { left: 31px !important; }
}

@media (max-width: 900px) {
  .ad-kpis  { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .ad-queue { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .ad-week  { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  .ad-panels { grid-template-columns: minmax(0, 1fr) !important; }
}

@media (max-width: 620px) {
  .ad-kpis  { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .ad-queue { grid-template-columns: minmax(0, 1fr) !important; }
  .ad-week  { grid-template-columns: minmax(0, 1fr) !important; }
  .ad-catrow { grid-template-columns: 46px minmax(0, 1fr) !important; padding: 12px 15px !important; }
  .ad-catthumb { width: 46px; height: 32px; }
  .ad-catacts { grid-column: 1 / -1; }
  .ad-catacts > button { flex: 1 1 0; justify-content: center; }
  .ad-brow { padding: 13px 15px !important; }
  .ad-brow > .ad-num { display: none !important; }
  .ad-brow { grid-template-columns: minmax(0, 1fr) !important; }
  .ad-acts .ad-act { flex: 1 1 0; justify-content: center; }
  .ad-setrow { grid-template-columns: minmax(0, 1fr) auto !important; }
}
