/* Global ADC Veille – charte sobre et institutionnelle */
:root {
  --encre: #142033;
  --marine: #1b2c4a;
  --acier: #2d5b8c;
  --acier-clair: #e8eef6;
  --ardoise: #5b6676;
  --filet: #d6dce4;
  --filet-fort: #b9c3cf;
  --fond: #f3f5f8;
  --blanc: #ffffff;
  --ok: #24663f;
  --ok-fond: #e6f1ea;
  --warn: #8a5a00;
  --warn-fond: #fbf1dc;
  --info: #2d5b8c;
  --info-fond: #e8eef6;
  --off: #6b7280;
  --off-fond: #eef0f3;
  --err: #9b1c1c;
  --err-fond: #fbe9e9;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--fond); color: var(--encre); font: 14px/1.5 var(--sans); }
a { color: var(--acier); }
.wide { max-width: none; padding: 0 24px; }
.narrow { max-width: 640px; margin: 0 auto; padding: 0 16px; }
main { padding-top: 24px; padding-bottom: 40px; min-height: calc(100vh - 170px); }

/* En-tête */
.top { background: var(--marine); color: #fff; border-bottom: 3px solid var(--acier); }
.top-in { display: flex; align-items: center; gap: 28px; padding: 14px 24px; flex-wrap: wrap; }
.top-in:not(.wide) { max-width: 640px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 14px; color: #fff; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 44px; height: 44px; border: 1.5px solid rgba(255,255,255,.55);
  font: 600 26px/1 var(--serif); color: #fff; }
.brand-txt { display: flex; flex-direction: column; }
.brand-tag { font-size: 11.5px; letter-spacing: .02em; color: #b9c9de; font-style: italic; }
.brand-name { font: 600 21px/1.2 var(--serif); letter-spacing: .01em; }
.brand-name b { font-weight: 600; color: #cfe0f5; }
.brand-sub { font-size: 11.5px; color: #9fb3cc; letter-spacing: .03em; text-transform: uppercase; }
.nav { display: flex; gap: 2px; margin-left: auto; flex-wrap: wrap; }
.nav a, .nav-soon { padding: 7px 12px; color: #dbe5f1; text-decoration: none; font-size: 13.5px; border-bottom: 2px solid transparent; }
.nav a:hover { color: #fff; border-bottom-color: rgba(255,255,255,.4); }
.nav a.on { color: #fff; border-bottom-color: #fff; }
.nav-soon { color: #7e93ad; cursor: default; }
.nav-soon::after { content: " · bientôt"; font-size: 11px; }
.who { display: flex; gap: 14px; align-items: center; font-size: 13px; color: #c3d1e2; }
.who em { color: #8fa6c2; font-style: normal; }
.who a { color: #fff; }

/* Titres de page */
.pagehead { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--filet); padding-bottom: 14px; }
.eyebrow { margin: 0 0 4px; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ardoise); }
.eyebrow a { color: var(--ardoise); }
h1 { font: 600 24px/1.25 var(--serif); margin: 0 0 4px; color: var(--marine); }
h2 { font: 600 17px/1.3 var(--serif); margin: 0 0 8px; color: var(--marine); }
.muted { color: var(--ardoise); }
.small { font-size: 12.5px; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.center { text-align: center; }

/* Cartes et formulaires */
.card { background: var(--blanc); border: 1px solid var(--filet); padding: 24px; margin-bottom: 16px; }
.form { display: flex; flex-direction: column; gap: 14px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; }
.form-grid .span2 { grid-column: span 2; }
label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--marine); }
input, select, textarea { font: 14px var(--sans); color: var(--encre); padding: 8px 10px; border: 1px solid var(--filet-fort); background: #fff; border-radius: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--acier); outline-offset: -1px; border-color: var(--acier); }
input[type=file] { padding: 6px; background: var(--fond); }
.formactions { display: flex; justify-content: flex-end; gap: 10px; }
.btn { display: inline-block; background: var(--acier); color: #fff; border: 1px solid var(--acier); padding: 9px 18px; font: 600 13.5px var(--sans);
  text-decoration: none; cursor: pointer; border-radius: 0; white-space: nowrap; }
.btn:hover { background: var(--marine); border-color: var(--marine); }
.btn-ghost { background: #fff; color: var(--acier); }
.btn-ghost:hover { background: var(--acier-clair); color: var(--marine); }
.btn-danger { background: #fff; color: var(--err); border-color: #d9a3a3; }
.btn-danger:hover { background: var(--err-fond); color: var(--err); border-color: var(--err); }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.danger { margin-top: 8px; text-align: right; }
.lnk { background: none; border: 0; padding: 0; color: var(--acier); font: inherit; font-size: 13px; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.secret { display: flex; gap: 8px; align-items: center; margin: 10px 0 14px; flex-wrap: wrap; }
.secret code { font-family: var(--mono); background: var(--fond); border: 1px solid var(--filet); padding: 8px 10px; flex: 1; min-width: 280px; overflow-wrap: anywhere; }

/* Messages */
.msg { padding: 10px 14px; margin: 0 0 14px; border-left: 4px solid; font-size: 13.5px; }
.msg-ok { background: var(--ok-fond); border-color: var(--ok); color: var(--ok); }
.msg-err { background: var(--err-fond); border-color: var(--err); color: var(--err); }
.msg-warn { background: var(--warn-fond); border-color: var(--warn); color: var(--warn); text-align: left; }

/* Statuts */
.badge { display: inline-block; padding: 2px 8px; font-size: 11.5px; font-weight: 600; letter-spacing: .02em; border: 1px solid; }
.b-ok { color: var(--ok); background: var(--ok-fond); border-color: #b9d8c4; }
.b-warn { color: var(--warn); background: var(--warn-fond); border-color: #ecd29b; }
.b-info { color: var(--info); background: var(--info-fond); border-color: #bccde2; }
.b-off { color: var(--off); background: var(--off-fond); border-color: #d3d7de; }

/* Tableaux : une ligne par enregistrement, filtres et tri en en-tête */
.tablewrap { background: var(--blanc); border: 1px solid var(--filet); overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; table-layout: fixed; min-width: 1100px; }
.grid th, .grid td { padding: 7px 10px; border-bottom: 1px solid var(--filet); text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.grid thead th { background: #eef1f5; position: sticky; top: 0; z-index: 1; }
.grid thead tr:first-child th { border-bottom: 0; padding-bottom: 2px; }
.grid thead button[data-sort] { all: unset; cursor: pointer; font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--marine); }
.grid thead button[data-sort] i { font-style: normal; margin-left: 4px; color: var(--acier); }
.grid .filters th { padding-top: 4px; border-bottom: 1px solid var(--filet-fort); }
.grid .filters input, .grid .filters select { width: 100%; padding: 4px 6px; font-size: 12.5px; }
.grid tbody tr:hover td { background: #f7f9fc; }
.grid td.num { font-variant-numeric: tabular-nums; }
.grid td.actions > * { margin-right: 12px; }
col.c-titre { width: auto; } col.c-cat { width: 160px; } col.c-ref { width: 170px; } col.c-portee { width: 22%; }
col.c-date { width: 108px; } col.c-statut { width: 170px; } col.c-act { width: 170px; }

/* Pied de page */
.foot { border-top: 1px solid var(--filet); background: #fff; color: var(--ardoise); font-size: 12px; padding: 14px 0; }

/* Bandeau d'installation (PWA) */
.installer { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 50; width: min(560px, calc(100vw - 24px));
  display: flex; align-items: center; gap: 12px; background: var(--marine); color: #fff; padding: 12px 14px; box-shadow: 0 10px 30px rgba(20,32,51,.35);
  padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
.installer[hidden] { display: none; }
.installer-ico { display: grid; place-items: center; width: 38px; height: 38px; flex: none; border: 1.5px solid rgba(255,255,255,.6); font: 600 22px/1 var(--serif); }
.brand-mark .balance { width: 36px; height: 36px; }
.brand-devise { margin-left: 14px; padding-left: 14px; border-left: 1px solid rgba(255,255,255,.35); font: italic 400 15px/1 var(--serif); color: #c9d6e6; letter-spacing: .03em; white-space: nowrap; }
.installer-ico .balance { width: 26px; height: 26px; }
.installer-txt { flex: 1; display: flex; flex-direction: column; font-size: 13px; color: #c9d6e6; }
.installer-txt b { color: #fff; font-size: 14px; }
.installer .btn { background: #fff; color: var(--marine); border-color: #fff; }
.installer-x { background: none; border: 0; color: #c9d6e6; font-size: 24px; line-height: 1; cursor: pointer; padding: 0 4px; }


/* ---------- Poser une question */
.masque { -webkit-text-security: disc; }
.btn-lg { padding: 12px 26px; font-size: 15px; }
.ask { background: var(--blanc); border: 1px solid var(--filet); border-top: 4px solid var(--marine); padding: 26px 28px; margin-bottom: 18px; max-width: 980px; }
.ask h1 { font-size: 26px; }
.askform { margin-top: 16px; }
.askbox { position: relative; }
.askbox textarea { width: 100%; font-size: 16px; line-height: 1.5; padding: 14px 64px 14px 14px; resize: vertical; min-height: 96px; }
.micro { position: absolute; right: 10px; top: 10px; width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--filet-fort); background: #fff; color: var(--marine); cursor: pointer; display: grid; place-items: center; }
.micro:hover { border-color: var(--acier); color: var(--acier); }
.micro.on { background: #b3261e; border-color: #b3261e; color: #fff; animation: pulse 1.2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(179,38,30,.45); } 70% { box-shadow: 0 0 0 12px rgba(179,38,30,0); } 100% { box-shadow: 0 0 0 0 rgba(179,38,30,0); } }
.askactions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.exemples { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 16px; }
.chip { background: #fff; border: 1px solid var(--filet-fort); color: var(--marine); padding: 6px 12px; font: 13px var(--sans); cursor: pointer; text-align: left; }
.chip:hover { border-color: var(--acier); background: var(--acier-clair); }
.hist { max-width: 980px; }
.hist ul { margin: 0; padding-left: 18px; }
.hist li { padding: 4px 0; }

dialog#rdialog { border: 0; padding: 0; width: min(920px, calc(100vw - 32px)); max-height: calc(100vh - 48px); box-shadow: 0 20px 60px rgba(20,32,51,.35); }
dialog#rdialog::backdrop { background: rgba(20,32,51,.6); }
.rdlg { max-height: calc(100vh - 50px); overflow-y: auto; padding: 0 30px 24px; }
.rdlg-barre { position: sticky; top: 0; background: #fff; display: flex; justify-content: flex-end; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--filet); margin-bottom: 14px; z-index: 2; }
.rclose { background: none; border: 0; font-size: 30px; line-height: 1; color: var(--ardoise); cursor: pointer; }
.r-question { font-size: 20px; margin: 0 0 14px; }
.r-bloc { margin: 0 0 16px; }
.r-bloc h3 { font: 700 12px var(--sans); letter-spacing: .07em; text-transform: uppercase; color: var(--ardoise); margin: 0 0 8px; }
.r-texte { font-size: 15px; line-height: 1.65; }
.r-texte p { margin: 0 0 10px; }
.r-texte ul, .r-alerte ul { margin: 0 0 10px; padding-left: 20px; }
.r-compare { background: var(--acier-clair); border-left: 4px solid var(--acier); padding: 12px 16px; }
.r-alerte { background: var(--warn-fond); border-left: 4px solid #c98a00; padding: 12px 16px; }
.r-alerte h3 { color: var(--warn); }
.r-verif { border-left: 4px solid var(--filet-fort); padding: 6px 16px; }
a.ref { display: inline-block; min-width: 18px; padding: 0 4px; margin: 0 1px; font-size: 11px; font-weight: 700; line-height: 17px; text-align: center; color: #fff; background: var(--acier); text-decoration: none; vertical-align: super; }
a.ref:hover { background: var(--marine); }
ol.srcs { list-style: none; margin: 0; padding: 0; }
.src { border: 1px solid var(--filet); padding: 10px 14px; margin-bottom: 8px; border-left-width: 4px; transition: background .4s; }
.src.flash { background: #fff6d5; }
.fam-UE { border-left-color: #2d5b8c; } .fam-FR { border-left-color: #1b2c4a; } .fam-FAQ { border-left-color: #8a5a00; } .fam-Projet { border-left-color: #7a7f8a; }
.src-tete { display: flex; gap: 8px; align-items: center; margin-bottom: 4px; }
.src-n { background: var(--acier); color: #fff; font-weight: 700; font-size: 12px; padding: 1px 7px; }
.fam { font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ardoise); }
.src-titre { font-weight: 600; color: var(--marine); }
.src-ref { font-size: 13px; color: var(--ardoise); margin: 2px 0 6px; }
.src-liens { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.src details { margin-top: 6px; } .src summary { cursor: pointer; font-size: 13px; color: var(--acier); }
pre.extrait { white-space: pre-wrap; font: 12.5px/1.5 var(--mono); background: var(--fond); padding: 10px; margin: 6px 0 0; max-height: 260px; overflow: auto; }
.r-autres { margin: 6px 0 14px; } .r-autres summary { cursor: pointer; color: var(--acier); font-size: 13px; }
.attente { display: flex; gap: 14px; align-items: center; padding: 26px 0; }
.roue { width: 34px; height: 34px; border: 3px solid var(--filet); border-top-color: var(--acier); border-radius: 50%; animation: tourne 0.9s linear infinite; flex: none; }
@keyframes tourne { to { transform: rotate(360deg); } }
#impression { display: none; }
@media print {
  body.impr > *:not(#impression) { display: none !important; }
  body.impr #impression { display: block; padding: 0 6mm; }
  .imp-tete { border-bottom: 2px solid #1b2c4a; padding-bottom: 6px; margin-bottom: 12px; font-size: 12px; }
  .src { break-inside: avoid; }
  pre.extrait { max-height: none; overflow: visible; }
  a.ref { color: #000; background: none; border: 1px solid #555; }
}

@media (max-width: 760px) {
  .top-in { padding: 12px 16px; gap: 12px; }
  .wide { padding: 0 16px; }
  .nav { margin-left: 0; }
  .pagehead { flex-direction: column; align-items: flex-start; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span2 { grid-column: auto; }
  body { font-size: 15px; }
  .top-in { padding-top: calc(10px + env(safe-area-inset-top)); }
  .brand-mark { width: 36px; height: 36px; font-size: 21px; }
  .brand-mark .balance { width: 29px; height: 29px; }
  .brand-devise { margin-left: 8px; padding-left: 8px; font-size: 12.5px; }
  .brand-name { font-size: 18px; }
  .brand-sub { display: none; }
  .brand-tag { font-size: 11px; }
  .nav { width: 100%; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .nav a, .nav-soon { white-space: nowrap; padding: 8px 10px; }
  .who { width: 100%; justify-content: space-between; }
  h1 { font-size: 20px; }
  input, select, textarea { font-size: 16px; } /* évite le zoom automatique sur iPhone */
  .btn { padding: 11px 18px; }
  /* Tableaux en fiches lisibles sur téléphone */
  .tablewrap { border: 0; background: none; overflow: visible; }
  table.grid, .grid tbody, .grid tr, .grid td { display: block; width: 100%; min-width: 0; }
  .grid colgroup, .grid thead tr:first-child { display: none; }
  .grid thead { display: block; }
  .grid .filters { display: block; background: #fff; border: 1px solid var(--filet); padding: 8px; margin-bottom: 10px; }
  .grid .filters th { display: none; }
  .grid .filters th:first-child { display: block; padding: 0; border: 0; }
  .grid tbody tr { background: #fff; border: 1px solid var(--filet); margin-bottom: 10px; padding: 10px 12px; }
  .grid tbody tr[hidden] { display: none; }
  .grid td { border: 0; padding: 2px 0; white-space: normal; overflow: visible; }
  .grid td:first-child { font-weight: 600; color: var(--marine); margin-bottom: 4px; }
  .grid td.num:empty, .grid td:empty { display: none; }
  .grid td.actions { padding-top: 8px; }
  .grid td.actions > * { display: inline-block; padding: 6px 0; }
  .ask { padding: 18px 16px; }
  .ask h1 { font-size: 22px; }
  .askactions .btn { width: 100%; }
  dialog#rdialog { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; }
  .rdlg { max-height: 100dvh; padding: 0 16px 20px; }
}
