/* =========================================================
   Pointage Tunnel — DA TSO
   Bleu marine #002C77 · Jaune #F6BE00
   ========================================================= */
:root {
  --navy: #002C77;
  --navy-700: #00215a;
  --navy-900: #00163d;
  --yellow: #F6BE00;
  --yellow-600: #d9a700;

  --bg: #f3f5f9;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --border: #dde3ee;
  --text: #0f1a2e;
  --muted: #5b6780;
  --primary: var(--navy);
  --primary-text: #ffffff;
  --accent: var(--yellow);
  --accent-text: var(--navy-900);
  --focus: #F6BE00;

  --ok: #13804b;   --ok-bg: #e3f5ec;
  --warn: #b25e00; --warn-bg: #fff1dc;
  --danger: #c4231b; --danger-bg: #fde8e6;
  --info: #2a5bd7; --info-bg: #e7eeff;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(0, 22, 61, .06), 0 6px 20px rgba(0, 22, 61, .06);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a1222;
    --surface: #111c33;
    --surface-2: #0e1830;
    --border: #22314f;
    --text: #e8edf7;
    --muted: #9aa7c2;
    --primary: #F6BE00;
    --primary-text: #00163d;
    --ok: #4cd394;   --ok-bg: rgba(76, 211, 148, .12);
    --warn: #ffb44d; --warn-bg: rgba(255, 180, 77, .13);
    --danger: #ff6b61; --danger-bg: rgba(255, 107, 97, .13);
    --info: #8fb0ff; --info-bg: rgba(143, 176, 255, .13);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.5 var(--font); min-height: 100vh;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.2; margin: 0; }
h1 { font-size: clamp(1.4rem, 3vw, 1.8rem); letter-spacing: -.01em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--yellow); color: var(--navy-900); padding: 8px 12px; border-radius: 8px; z-index: 50; }
.skip:focus { left: 8px; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- En-tête ---------- */
.topbar { background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 20; box-shadow: 0 2px 0 var(--yellow); }
.topbar-in { max-width: 1240px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: #fff; }
.brand-logo { background: #fff; border-radius: 8px; padding: 4px 8px; }
.brand-logo img { height: 26px; width: auto; }
.brand-txt { font-size: 1.05rem; letter-spacing: .01em; }
.brand-txt b { color: var(--yellow); }
.btn-ghost { background: transparent; border: 1px solid rgba(255,255,255,.35); color: #fff; border-radius: 999px; padding: 6px 14px; font: inherit; font-size: .85rem; cursor: pointer; text-decoration: none; }
.btn-ghost:hover { background: rgba(255,255,255,.1); }
.logout { margin: 0; }
.tabs { max-width: 1240px; margin: 0 auto; padding: 0 8px; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { color: rgba(255,255,255,.78); text-decoration: none; padding: 10px 14px 12px; font-weight: 600; font-size: .95rem; border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs a:hover { color: #fff; }
.tabs a[aria-current="page"] { color: #fff; border-bottom-color: var(--yellow); }

/* ---------- Mise en page ---------- */
.wrap { max-width: 1240px; margin: 0 auto; padding: 20px 16px 64px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card-titre { font-size: 1.05rem; font-weight: 700; display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.card-head .card-titre { margin: 0; }
.section-titre { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 10px; }
.num { width: 26px; height: 26px; border-radius: 50%; background: var(--yellow); color: var(--navy-900); display: inline-grid; place-items: center; font-size: .85rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.admin-cols { display: grid; grid-template-columns: minmax(300px, 420px) 1fr; gap: 20px; align-items: start; }
@media (max-width: 900px) { .admin-cols { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .grid-2 { grid-template-columns: 1fr; } }

/* ---------- Formulaires ---------- */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; min-width: 0; }
.field label, .field legend { font-weight: 600; font-size: .9rem; }
.req { color: var(--danger); }
.input { width: 100%; font: inherit; color: var(--text); background: var(--surface-2); border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: 11px 12px; min-height: 46px; transition: border-color .15s, box-shadow .15s; }
.input:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(246,190,0,.45); }
@media (prefers-color-scheme: dark) { .input:focus { border-color: var(--yellow); } }
.input-lg { font-size: 1.15rem; min-height: 52px; }
.input-sm { min-height: 36px; padding: 6px 10px; width: auto; font-size: .9rem; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.hint { color: var(--muted); font-size: .82rem; }
.err { color: var(--danger); font-size: .85rem; font-weight: 600; }
.has-error .input { border-color: var(--danger); }
.radios { border: 0; padding: 0; }
.radio { display: flex; align-items: center; gap: 8px; font-weight: 500; padding: 4px 0; cursor: pointer; }
.radio input { accent-color: var(--navy); width: 18px; height: 18px; }
.filtre { display: inline-flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--muted); margin: 0; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }

/* ---------- Boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 600; font-size: .92rem; padding: 9px 16px; border-radius: 999px; border: 1.5px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; text-decoration: none; min-height: 40px; transition: background .15s, border-color .15s, transform .05s; }
.btn:hover { border-color: var(--navy); }
.btn:active { transform: translateY(1px); }
.btn-sm { padding: 5px 12px; min-height: 32px; font-size: .84rem; }
.btn-block { width: 100%; }
.btn-primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-700); }
@media (prefers-color-scheme: dark) { .btn-primary { background: var(--yellow); border-color: var(--yellow); color: var(--navy-900); } .btn-primary:hover { background: var(--yellow-600); } }
.btn-accent { background: var(--yellow); border-color: var(--yellow); color: var(--navy-900); }
.btn-outline { border-color: var(--navy); color: var(--navy); background: transparent; }
@media (prefers-color-scheme: dark) { .btn-outline { border-color: var(--yellow); color: var(--yellow); } }
.btn-outline[aria-pressed="true"] { background: var(--yellow); border-color: var(--yellow); color: var(--navy-900); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-outline-danger { border-color: var(--danger); color: var(--danger); background: transparent; }
.btn-outline-danger:hover { background: var(--danger-bg); border-color: var(--danger); }
.btn.is-armed { background: var(--danger) !important; border-color: var(--danger) !important; color: #fff !important; }
.btn-mini { font: inherit; font-size: .75rem; font-weight: 600; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); border-radius: 6px; padding: 2px 8px; cursor: pointer; }
.btn-mini:hover { border-color: var(--navy); }

/* ---------- Tags ---------- */
.tag { display: inline-block; font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); white-space: nowrap; vertical-align: middle; }
.tag-rouge, .tag-sortie-np { background: var(--danger-bg); color: var(--danger); border-color: transparent; }
.tag-orange { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.tag-info { background: var(--info-bg); color: var(--info); border-color: transparent; }
.tag-entree { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.tag-sortie { background: var(--info-bg); color: var(--info); border-color: transparent; }
.tag-admin { background: var(--yellow); color: var(--navy-900); border-color: transparent; }
.tag-fond { background: var(--navy); color: #fff; border-color: transparent; }
@media (prefers-color-scheme: dark) { .tag-fond { background: var(--yellow); color: var(--navy-900); } }
.tag-etat-en_cours { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.tag-etat-a_venir { background: var(--info-bg); color: var(--info); border-color: transparent; }
.tag-etat-termine { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.tag-etat-cloture { background: var(--surface-2); color: var(--muted); }
.badge { background: currentColor; border-radius: 999px; padding: 0 8px; font-size: .8rem; }
.badge { color: inherit; background: rgba(0,0,0,.08); }

/* ---------- Flash / toast ---------- */
.flash-zone { display: grid; gap: 8px; margin-bottom: 16px; }
.flash { padding: 12px 14px; border-radius: var(--radius-sm); font-weight: 600; border-left: 4px solid; }
.flash-success { background: var(--ok-bg); color: var(--ok); }
.flash-error { background: var(--danger-bg); color: var(--danger); }
.flash-info, .flash-warning { background: var(--warn-bg); color: var(--warn); }
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--navy-900); color: #fff; padding: 12px 18px; border-radius: 999px; font-weight: 600; box-shadow: var(--shadow); z-index: 100; max-width: calc(100% - 32px); border: 2px solid var(--yellow); }

/* =========================================================
   Onglet Pointage
   ========================================================= */
.pointage-layout { max-width: 1040px; margin: 0 auto; }
.pointage-cols { display: grid; grid-template-columns: 1.1fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 820px) { .pointage-cols { grid-template-columns: 1fr; } }
.card-action { position: static; } /* plus de carte « collante » qui recouvrait les cartes suivantes */

.docs { margin-bottom: 16px; }
.docs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.doc-btn { display: flex; align-items: center; gap: 12px; text-align: left; width: 100%; background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius); padding: 12px; font: inherit; color: var(--text); cursor: pointer; box-shadow: var(--shadow); transition: border-color .15s, transform .1s; }
.doc-btn:hover { border-color: var(--yellow); transform: translateY(-1px); }
.doc-ico { flex: none; width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-size: .78rem; background: var(--navy); color: var(--yellow); }
.doc-ico-video { background: var(--yellow); color: var(--navy-900); font-size: 1.1rem; }
.doc-txt { display: flex; flex-direction: column; min-width: 0; }
.doc-txt strong { font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-txt span { font-size: .78rem; color: var(--muted); }

.statut { display: flex; gap: 14px; align-items: flex-start; padding: 14px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); margin-bottom: 14px; }
.statut > div { display: flex; flex-direction: column; gap: 2px; }
.statut strong { font-size: 1.15rem; }
.statut span { font-size: .9rem; }
.statut-pastille { flex: none; width: 14px; height: 14px; border-radius: 50%; margin-top: 6px; background: var(--muted); }
.statut-in { background: var(--ok-bg); border-color: transparent; }
.statut-in .statut-pastille { background: var(--ok); box-shadow: 0 0 0 5px rgba(19, 128, 75, .18); }
.statut-in strong { color: var(--ok); }

.btn-pointer { width: 100%; min-height: 84px; font: inherit; font-size: 1.35rem; font-weight: 800; letter-spacing: .01em; border-radius: 18px; border: 0; cursor: pointer; background: var(--navy); color: #fff; box-shadow: inset 0 -5px 0 var(--yellow), var(--shadow); transition: transform .06s, filter .15s; }
.btn-pointer:hover:not(:disabled) { filter: brightness(1.1); }
.btn-pointer:active:not(:disabled) { transform: translateY(2px); }
.btn-pointer.is-sortie { background: var(--yellow); color: var(--navy-900); box-shadow: inset 0 -5px 0 var(--navy), var(--shadow); }
.btn-pointer:disabled { background: var(--surface-2); color: var(--muted); box-shadow: inset 0 0 0 1.5px var(--border); cursor: not-allowed; font-size: 1.05rem; }
.msg { min-height: 1.5em; margin: 12px 0 0; font-weight: 700; text-align: center; }
.msg.ok { color: var(--ok); }
.msg.ko { color: var(--danger); }

.histo { list-style: none; margin: 0; padding: 0; }
.histo li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: .9rem; flex-wrap: wrap; }
.histo li:last-child { border-bottom: 0; }
.histo .h-date { font-variant-numeric: tabular-nums; font-weight: 600; }

/* Visionneuse */
.viewer { width: min(960px, 100vw - 16px); height: min(92vh, 100dvh - 16px); padding: 0; border: 0; border-radius: var(--radius); background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgba(0,0,0,.4); }
.viewer::backdrop { background: rgba(0, 22, 61, .7); }
.viewer[open] { display: flex; flex-direction: column; }
.viewer-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; background: var(--navy); color: #fff; border-bottom: 3px solid var(--yellow); }
.viewer-head strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-actions { display: flex; gap: 8px; flex: none; }
.viewer-body { flex: 1; overflow: auto; background: #525659; padding: 8px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.viewer-body canvas { background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.4); max-width: 100%; height: auto; }
.viewer-body video { width: 100%; max-height: 100%; background: #000; }
.viewer-body iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.viewer-body .muted { color: #ddd; padding: 20px; }

/* =========================================================
   Supervision
   ========================================================= */
.live { margin: 4px 0 0; color: var(--muted); font-size: .88rem; display: flex; align-items: center; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); animation: pulse 1.6s infinite; }
.live.is-off .dot { background: var(--danger); animation: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(19,128,75,.5); } 70% { box-shadow: 0 0 0 8px rgba(19,128,75,0); } 100% { box-shadow: 0 0 0 0 rgba(19,128,75,0); } }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
@media (max-width: 760px) { .kpis { grid-template-columns: 1fr 1fr; } }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow); }
.kpi-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.kpi-val { font-size: 2rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpi-val small { font-size: 1rem; color: var(--muted); font-weight: 600; }
.kpi-main { background: var(--navy); border-color: var(--navy); color: #fff; }
.kpi-main .kpi-label, .kpi-main small { color: rgba(255,255,255,.75) !important; }
.kpi-main .kpi-val { color: var(--yellow); }
.kpi-danger { background: var(--danger-bg); border-color: var(--danger); }
.kpi-danger .kpi-val, .kpi-danger .kpi-label { color: var(--danger); }

.alertes { border: 2px solid var(--warn); background: var(--surface); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 16px; box-shadow: var(--shadow); }
.alertes-rouge { border-color: var(--danger); background: linear-gradient(var(--danger-bg), var(--danger-bg)), var(--surface); }
.alertes-orange { background: linear-gradient(var(--warn-bg), var(--warn-bg)), var(--surface); }
.alertes-titre { font-size: 1.05rem; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.alertes-rouge .alertes-titre { color: var(--danger); }
.alertes-orange .alertes-titre { color: var(--warn); }
.alertes-liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.alerte { display: grid; grid-template-columns: auto 1.2fr auto 2fr auto; gap: 6px 14px; align-items: center; background: var(--surface); border-radius: var(--radius-sm); padding: 10px 12px; border-left: 5px solid var(--warn); }
.alerte-rouge { border-left-color: var(--danger); }
.alerte-info { font-size: .85rem; }
@media (max-width: 1000px) { .alerte { grid-template-columns: 1fr auto; } .alerte-type, .alerte-info { grid-column: 1 / -1; } }
.tel { font-variant-numeric: tabular-nums; font-weight: 700; text-decoration: none; white-space: nowrap; }
.tel:hover { text-decoration: underline; }

.chips-zone { margin-bottom: 16px; }
.chips { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; scroll-snap-type: x proximity; }
.chip { flex: none; scroll-snap-align: start; text-align: left; font: inherit; color: var(--text); background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius); padding: 10px 14px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; min-width: 150px; box-shadow: var(--shadow); }
.chip:hover { border-color: var(--navy); }
.chip.is-active { border-color: var(--yellow); box-shadow: 0 0 0 2px var(--yellow), var(--shadow); }
.chip:first-child { justify-content: center; font-weight: 700; }
.chip-nom { font-weight: 700; }
.chip-meta { display: flex; gap: 8px; align-items: center; font-size: .8rem; color: var(--muted); }
.jauge { display: block; height: 6px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; overflow: hidden; min-width: 80px; margin-top: 4px; }
.jauge > span { display: block; height: 100%; background: var(--ok); border-radius: inherit; }
.jauge > span.high { background: var(--warn); }
.jauge > span.full { background: var(--danger); }

.compte { margin: 0 0 8px; color: var(--muted); font-size: .88rem; font-weight: 600; }
.vide { color: var(--muted); padding: 18px; text-align: center; background: var(--surface-2); border-radius: var(--radius-sm); margin: 0; list-style: none; }
.duree { font-weight: 800; font-variant-numeric: tabular-nums; padding: 2px 8px; border-radius: 6px; white-space: nowrap; }
.duree-vert { color: var(--ok); background: var(--ok-bg); }
.duree-orange { color: var(--warn); background: var(--warn-bg); }
.duree-rouge { color: #fff; background: var(--danger); }

/* Tableaux -> cartes sur mobile */
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 8px 10px; border-bottom: 2px solid var(--border); white-space: nowrap; }
.tbl td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl-compact td { padding: 7px 10px; }
.td-action { text-align: right; }
@media (max-width: 860px) {
  .tbl-cards thead { display: none; }
  .tbl-cards, .tbl-cards tbody, .tbl-cards tr, .tbl-cards td { display: block; width: 100%; }
  .tbl-cards tr { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 12px; margin-bottom: 10px; background: var(--surface); }
  .tbl-cards td { border: 0; padding: 4px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .tbl-cards td::before { content: attr(data-label); color: var(--muted); font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; text-align: left; }
  .tbl-cards td.td-action { justify-content: stretch; padding-top: 8px; }
  .tbl-cards td.td-action .btn { width: 100%; }
}

/* =========================================================
   Chantiers / Documents / Export
   ========================================================= */
.liste-chantiers { display: grid; gap: 12px; }
.chantier-card { background: var(--surface); border: 1px solid var(--border); border-left: 5px solid var(--ok); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.chantier-card.etat-a_venir { border-left-color: var(--info); }
.chantier-card.etat-termine { border-left-color: var(--warn); }
.chantier-card.etat-cloture { border-left-color: var(--border); opacity: .85; }
.chantier-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 16px 6px; flex-wrap: wrap; }
.chantier-head h3 { font-size: 1.1rem; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.chantier-body { display: grid; grid-template-columns: 1fr; gap: 16px; padding: 8px 16px 12px; align-items: start; }
@media (max-width: 560px) { .chantier-body { grid-template-columns: 1fr; } }
.meta { margin: 0; display: grid; gap: 4px; font-size: .88rem; }
.meta div { display: grid; grid-template-columns: 80px 1fr; gap: 8px; }
.meta dt { color: var(--muted); font-weight: 600; }
.meta dd { margin: 0; }
.chantier-actions { display: flex; gap: 6px; flex-wrap: wrap; padding: 10px 16px; background: var(--surface-2); border-top: 1px solid var(--border); }
.chantier-actions form { margin: 0; }
.replier-btn { margin-top: 4px; justify-self: center; }

.doc-admin-liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.doc-admin { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow); flex-wrap: wrap; }
.doc-admin-txt { display: flex; flex-direction: column; flex: 1; min-width: 180px; }
.doc-admin-txt span { font-size: .82rem; }
.doc-admin-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.doc-admin-actions form { margin: 0; }

.compte-export { background: var(--surface-2); border: 1px dashed var(--border); border-radius: var(--radius-sm); padding: 10px 14px; }
.compte-export strong { font-size: 1.3rem; color: var(--navy); }
@media (prefers-color-scheme: dark) { .compte-export strong { color: var(--yellow); } }
.note { font-size: .85rem; color: var(--muted); margin-top: 16px; }

.card-login { max-width: 420px; margin: 40px auto; }

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

/* Petits écrans */
.btn-ghost { white-space: nowrap; }
@media (max-width: 480px) {
  .hide-sm { display: none; }
  .brand { gap: 8px; }
  .brand-txt { font-size: .95rem; }
  .brand-logo img { height: 22px; }
}

.memo-ligne { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: -4px; }

/* Personnes sans téléphone (équipe) */
.equipe { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 8px; }
.eq-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.eq-item.is-in { background: var(--ok-bg); border-color: transparent; }
.eq-item .statut-pastille { margin-top: 0; }
.eq-item.is-in .statut-pastille { background: var(--ok); }
.eq-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.eq-txt span { font-size: .82rem; }
.eq-item .btn { min-width: 84px; }
.equipe-groupe { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.equipe-ajout summary { list-style: none; cursor: pointer; display: inline-flex; }
.equipe-ajout summary::-webkit-details-marker { display: none; }
.equipe-ajout[open] summary { margin-bottom: 12px; }
.tag-sans-tel { background: var(--warn-bg); color: var(--warn); border-color: transparent; }

/* RGPD */
.mention-rgpd { margin: 12px 0 0; font-size: .8rem; color: var(--muted); text-align: center; line-height: 1.5; }
.mention-rgpd a, .pied a { color: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.pied { max-width: 1240px; margin: 0 auto; padding: 0 16px 32px; text-align: center; font-size: .82rem; color: var(--muted); }
.doc-legal { max-width: 820px; margin: 0 auto; }
.doc-legal h1 { margin-bottom: 6px; }
.doc-legal h2 { font-size: 1.1rem; margin: 26px 0 8px; color: var(--navy); scroll-margin-top: 120px; }
@media (prefers-color-scheme: dark) { .doc-legal h2 { color: var(--yellow); } }
.doc-legal p, .doc-legal li { line-height: 1.6; }
.doc-legal ul { padding-left: 20px; margin: 6px 0; }
.doc-legal .resume { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin: 16px 0 6px; }
.doc-legal .resume div { background: var(--surface-2); border: 1px solid var(--border); border-left: 4px solid var(--yellow); border-radius: var(--radius-sm); padding: 10px 12px; font-size: .9rem; }
.doc-legal .resume strong { display: block; color: var(--text); }
.doc-legal table { width: 100%; border-collapse: collapse; font-size: .9rem; margin: 8px 0; }
.doc-legal th, .doc-legal td { text-align: left; padding: 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.doc-legal th { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
