/* ══════════════════════════════════════════════════════════════════════════
   Écrans de Notion'Perso (07/10/2026) : la charte de Gestion et du site.
   Valeurs relevées sur les pages de Gestion rendues (vendor/gestion_assets,
   gestion.css du 06/10) : titre à filet rouge, boutons 6 px, champs 8 px,
   tableaux à en-tête papier foncé, pastilles 7 px, deux graisses (400 et 500).
   La coque (menu, recherche, tiroir) est dans np/coque.css.
   ══════════════════════════════════════════════════════════════════════════ */

:root {
  --ink: #1e2a4a;
  --ink-70: rgba(30, 42, 74, 0.72);
  --ink-60: rgba(30, 42, 74, 0.55);
  --ink-24: rgba(30, 42, 74, 0.24);
  --ink-15: rgba(30, 42, 74, 0.15);
  --paper: #faf6f0;
  --paper-deep: #f0ebe3;
  --rouge: #c8302a;
  --rouge-ink: #a8261f;
  --muted: #4a5568;
  --ok: #2d5a3d;
  --warn: #8a5a14;
  --ring: 0 0 0 2px var(--rouge);
  --ease: cubic-bezier(0.2, 0, 0, 1);
}

* { box-sizing: border-box; }
html { background: var(--paper-deep); }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper-deep);
  color: var(--ink);
  font: 400 15px/1.55 "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  letter-spacing: 0.003em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
body.has-shell { padding-top: var(--np-header-height); }
b, strong { font-weight: 500; }
small { font-size: 12.5px; color: var(--muted); }
code, kbd { font: 400 13px/1.4 ui-monospace, "SF Mono", Menlo, monospace; }
a { color: inherit; text-decoration: none; transition: color 0.18s ease; }
.np-main a:hover { color: var(--rouge-ink); }
.np-main a:focus-visible { outline: 2px solid var(--rouge); outline-offset: 2px; border-radius: 2px; }
.muted { color: var(--muted); }

/* ── Zone principale ─────────────────────────────────────────────────────── */
.np-main {
  max-width: 1280px;
  min-height: calc(100vh - var(--np-header-height));
  padding: clamp(1.5rem, 3.5vh, 2.5rem) 16px 64px; /* marges de main.container de Gestion */
}
.np-main:focus { outline: none; }
.np-main > p, .np-main section > p { max-width: 78ch; }

/* Titre de page : celui de Gestion (.h1), filet rouge au-dessus. */
h1 {
  position: relative;
  margin: 0 0 6px;
  padding-top: 0.85rem;
  font-size: clamp(1.7rem, 2.6vw, 2.4rem);
  font-weight: 500;
  line-height: 1.06;
  letter-spacing: -0.025em;
  color: var(--ink);
}
h1::before { content: ""; position: absolute; top: 0; left: 0; width: 34px; height: 3px; background: var(--rouge); }
/* Surtitre (.eyebrow de Gestion) : un seul trait rouge par en-tête, le titre qui le suit perd son filet. */
.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 0.5rem;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-70);
}
.eyebrow::before { content: ""; flex: 0 0 auto; width: 22px; height: 2px; background: var(--rouge); }
.eyebrow + h1 { padding-top: 0; }
.eyebrow + h1::before { display: none; }
h1 + p { margin-top: 8px; color: var(--muted); font-size: 14px; }
h2 { margin: 28px 0 10px; font-size: 18px; font-weight: 500; line-height: 1.25; letter-spacing: -0.01em; }
h3 { margin: 18px 0 8px; font-size: 15px; font-weight: 500; line-height: 1.3; }
p { margin: 10px 0; }

/* ── Boutons : .btn et .btn--primary de Gestion ──────────────────────────── */
.np-main button, .button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  margin: 0;
  padding: 7px 11px;
  border: 1px solid var(--ink-15);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.004em;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.np-main button:hover, .button:hover { background: var(--paper-deep); border-color: var(--ink-60); color: var(--ink); }
.np-main button:focus-visible, .button:focus-visible { outline: 2px solid var(--rouge); outline-offset: 2px; }
.np-main button:disabled, fieldset:disabled button { opacity: 0.55; cursor: not-allowed; }
/* Retour au clic (static/np/retour-clic.js) : le bouton qui travaille se grise aussitôt et dit « … en cours ». */
.is-busy { opacity: 0.55; pointer-events: none; cursor: progress; }
@media (pointer: coarse) { .np-main button, .button { min-height: 40px; } } /* au doigt : 40 px (DESIGN.md) */
.np-main button.primary, .button.primary { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.np-main button.primary:hover, .button.primary:hover { background: #16223d; border-color: #16223d; color: var(--paper); }

/* ── Champs : .input de Gestion ──────────────────────────────────────────── */
.np-main input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.np-main select,
.np-main textarea {
  max-width: 100%;
  margin: 0;
  padding: 9px 10px;
  border: 1.5px solid var(--ink-15);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.3;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.np-main select {
  appearance: none;
  padding-right: 30px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) 52%, calc(100% - 11px) 52%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
.np-main input:focus, .np-main select:focus, .np-main textarea:focus {
  outline: none;
  border-color: rgba(30, 42, 74, 0.42);
  box-shadow: var(--ring);
}
.np-main input::placeholder, .np-main textarea::placeholder { color: var(--ink-70); }
.np-main input[type="checkbox"], .np-main input[type="radio"] { accent-color: var(--ink); width: 15px; height: 15px; margin: 0 6px 0 0; vertical-align: -2px; }
.np-main label { font-size: 13px; font-weight: 500; }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
legend { padding: 0; margin: 14px 0 6px; font-size: 11px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-70); }

/* ── Tableaux : .table-wrap de Gestion ───────────────────────────────────── */
.scroll { overflow-x: auto; border: 1px solid var(--ink-15); border-radius: 14px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 9px 10px; border-top: 1px solid var(--ink-24); text-align: left; vertical-align: top; }
thead th { border-top: 0; background: var(--paper-deep); font-size: 12px; font-weight: 500; letter-spacing: 0.01em; white-space: nowrap; }
td a, .result-row > a:first-child { font-weight: 500; }
td form { margin: 0; }

/* ── Pastilles : .badge de Gestion ───────────────────────────────────────── */
.tag {
  display: inline-block;
  padding: 2px 8px;
  border: 1px solid rgba(30, 42, 74, 0.26);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.56);
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.002em;
  white-space: nowrap;
}

/* Relances d'une demande (écran Demandes et fiche) : un point par relance de sa suite, plein quand elle est partie ; la phrase à côté
   dit la même chose (points aria-hidden). */
.points-relance { display: inline-flex; gap: 4px; margin: 0 6px 2px 0; vertical-align: middle; }
.points-relance span { width: 8px; height: 8px; border: 1px solid var(--ink-60); border-radius: 50%; }
.points-relance span.plein { background: var(--ink-60); }

/* ── Messages : .alert de Gestion, et encart d'information papier ────────── */
.form-error, .error {
  margin: 14px 0;
  padding: 10px 12px;
  border: 1px solid rgba(185, 28, 28, 0.26);
  border-radius: 12px;
  background: rgba(254, 242, 242, 0.72);
  color: var(--rouge);
  font-size: 13px;
}
.source-note {
  margin: 14px 0;
  padding: 12px 14px;
  border: 1px solid var(--ink-15);
  border-radius: 12px;
  background: var(--paper);
  font-size: 13.5px;
  line-height: 1.6;
}
.source-note small { display: block; margin-top: 2px; }
.note { margin-top: 18px; font-size: 13px; color: var(--muted); }

/* Message de réussite (à usage unique, posé en session) : texte vert de la charte sur papier clair. */
.alerte-ok {
  margin: 14px 0; padding: 10px 12px; border: 1px solid rgba(45, 90, 61, 0.35); border-radius: 12px;
  background: var(--paper); color: var(--ok); font-size: 13.5px; font-weight: 500;
}

/* ── Navigation interne : vues, pages, retour ───────────────────────────── */
.tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 16px 0 18px; }
.tabs a { padding: 6px 12px; border-radius: 8px; color: var(--muted); font-size: 13px; font-weight: 500; }
.tabs a:hover { background: var(--paper); color: var(--ink); }
.tabs a[aria-current="page"] { background: var(--ink); color: var(--paper); }
.pagination, .pager { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin: 22px 0; font-size: 13px; }
.pagination a, .pager a { font-weight: 500; }
.back { display: inline-block; margin-bottom: 20px; color: var(--muted); font-size: 13px; }
.back:hover { color: var(--ink); }

/* ── Listes et blocs ─────────────────────────────────────────────────────── */
.section { margin-top: 32px; }
.section > h2:first-child { margin-top: 0; }
.result-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 14px;
  padding: 11px 0;
  border-bottom: 1px solid var(--ink-15);
  font-size: 14px;
}
.result-row small { color: var(--muted); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin: 24px 0; }
.card-box { padding: 18px 20px; border: 1px solid var(--ink-15); border-radius: 14px; background: var(--paper); }
.card-box h2 { margin: 0 0 10px; font-size: 15px; }
.card-box > a { font-size: 13px; font-weight: 500; }
.big { margin: 0; font-size: 30px; font-weight: 500; line-height: 1.1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.big + p { margin-top: 2px; color: var(--muted); font-size: 13px; }
.stat-list { list-style: none; margin: 0 0 12px; padding: 0; }
.stat-list li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--ink-15); font-size: 14px; }
.stat-list strong { font-variant-numeric: tabular-nums; }
.account { display: flex; justify-content: space-between; align-items: center; gap: 15px; padding: 12px 0; border-bottom: 1px solid var(--ink-15); font-size: 14px; }
.account form { margin: 0; }

/* ── À traiter ───────────────────────────────────────────────────────────── */
.review-list { border-top: 1px solid var(--ink-15); }
.review-row { display: flex; align-items: center; gap: 12px; padding: 16px 4px; border-bottom: 1px solid var(--ink-15); }
.review-row > div { flex: 1; min-width: 0; }
.review-row h2, .review-row h3 { margin: 0 0 4px; font-size: 16px; }
.review-row p { margin: 0; color: var(--muted); font-size: 13px; }
.np-main a.review-row:hover { color: var(--ink); }
.review-row:hover h2, .review-row:hover h3 { color: var(--rouge-ink); }
.review-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px 20px; margin: 20px 0; padding: 18px 0; border-block: 1px solid var(--ink-15); }
.review-facts small { display: block; margin-bottom: 4px; font-size: 12px; }
.review-facts strong { font-size: 14px; }
.review-content { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 36px; }
.review-content h2 { font-size: 17px; }
.review-content section > p { font-size: 14px; }
.decision-panel { align-self: start; padding: 20px; border: 1px solid var(--ink-15); border-radius: 14px; background: var(--paper); }
.decision-panel h2:first-child { margin-top: 0; }
.decision-panel label { display: block; margin: 16px 0 6px; font-size: 12px; }
.decision-panel input:not([type="hidden"]), .decision-panel select, .decision-panel button { width: 100%; }
.decision-panel button { justify-content: center; margin-top: 18px; }
.decision-panel fieldset label { display: flex; align-items: baseline; margin: 0; padding: 7px 0; font-size: 14px; }
.decision-panel legend { color: var(--muted); }
.review-content .scroll { margin-bottom: 14px; }
.decision-panel input[type="radio"], .decision-panel input[type="checkbox"] { width: 15px; flex: none; }
.history-item { padding: 10px 0; border-bottom: 1px solid var(--ink-15); font-size: 13px; }

/* ── Connexion (sans coque) ──────────────────────────────────────────────── */
.np-plain {
  display: flex;
  align-items: center;
  height: var(--np-header-height);
  padding: 0 20px;
  border-bottom: 1px solid var(--ink-15);
  background: var(--paper);
}
.is-plain .np-main { min-height: 0; }

/* ── Kanban fictif du socle local (aucune donnée réelle) ─────────────────── */
.filter { margin: 18px 0; }
.filter label { display: block; margin-bottom: 6px; }
.filter div { display: flex; gap: 8px; }
.filter input { width: 320px; }
.board { min-width: 840px; }
.columns, .lanes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.columns strong { padding: 10px 14px; background: var(--paper); border-bottom: 1px solid var(--ink-15); font-size: 12px; }
.board h2 { margin: 0; padding: 9px 14px; background: var(--paper-deep); font-size: 12px; letter-spacing: 0.01em; }
.lane { padding: 10px; border-right: 1px solid var(--ink-15); }
.lane:last-child { border-right: 0; }
.card { display: block; padding: 12px 14px; border: 1px solid var(--ink-15); border-radius: 12px; background: var(--paper); font-size: 13px; transition: border-color 0.25s ease; }
.np-main a.card:hover { border-color: var(--ink-60); color: var(--ink); }
.card h3 { margin: 6px 0 8px; font-size: 15px; }
.card p { display: flex; justify-content: space-between; gap: 8px; margin: 12px 0 6px; }
.empty { padding: 22px 0; text-align: center; font-size: 12px; color: var(--muted); }

/* ── Outil affiché dans la coque (Gestion, catalogue, Grist…) ────────────── */
.is-outil .np-main { max-width: none; min-height: 0; padding: 0; }
iframe.outil { display: block; width: 100%; height: 100vh; border: 0; background: var(--paper-deep); }
.outil-onglets { margin: 0; padding: 10px 16px; border-bottom: 1px solid var(--ink-15); }
.outil-onglets + iframe.outil { height: calc(100vh - 49px); }
@media (min-width: 981px) {
  body.is-outil { padding-top: 0; }
  .is-outil .np-topbar { display: none; }
}
@media (max-width: 980px) {
  .is-outil .np-topbar__search { visibility: hidden; }
  iframe.outil { height: calc(100vh - var(--np-header-height)); }
  .outil-onglets + iframe.outil { height: calc(100vh - var(--np-header-height) - 49px); }
}

/* ── Petit écran ─────────────────────────────────────────────────────────── */
@media (max-width: 980px) {
  .np-main { padding: 20px 16px 48px; }
  .review-content { grid-template-columns: 1fr; }
  .account { flex-direction: column; align-items: flex-start; }
  .filter input { width: auto; flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

/* ── Recherche : le périmètre se choisit sur la page des résultats ───────── */
.perimetre { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 8px; }
.perimetre input[type="search"] { flex: 1 1 320px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ── Bandeau « voir comme » (plan 12a) ; l'espace Comptes est dans comptes.css ───────────────────────── */
.np-voir-comme { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between;
  margin: 0 0 18px; padding: 10px 14px; border: 1px solid var(--rouge); border-radius: 6px; background: var(--paper-deep); }
.np-voir-comme form { margin: 0; }
