/* OneTab — styles partagés (Activation / Suivi) */
*, *::before, *::after { box-sizing:border-box; margin:0; padding:0; }
:root {
  --bg:#f0f2f5; --surface:#fff; --border:#dde1e8;
  --accent:#1a5276; --accent2:#2980b9;
  --success:#27ae60; --danger:#e74c3c; --warn:#f59e0b; --muted-blue:#5b7a99;
  --text:#1a202c; --muted:#6b7280;
  --mono:'JetBrains Mono',monospace; --sans:'Inter',sans-serif;
}
body { background:var(--bg); color:var(--text); font-family:var(--sans); min-height:100vh; }

/* ── Barre supérieure + navigation */
.topbar { background:var(--accent); padding:0 24px; height:56px; display:flex; align-items:center; gap:18px; position:sticky; top:0; z-index:50; box-shadow:0 2px 8px rgba(0,0,0,.2); }
.topbar-brand { display:flex; align-items:center; gap:10px; }
.topbar-brand img { height:30px; width:auto; }
.topbar-brand .t { color:white; font-size:15px; font-weight:600; white-space:nowrap; }
.topnav { display:flex; align-items:center; gap:4px; margin-left:8px; }
.topnav a { color:rgba(255,255,255,.7); font-size:13px; font-weight:500; text-decoration:none; padding:7px 14px; border-radius:7px; transition:all .15s; }
.topnav a:hover { color:white; background:rgba(255,255,255,.1); }
.topnav a.active { color:white; background:rgba(255,255,255,.18); font-weight:600; }
.topbar-sub { margin-left:auto; color:rgba(255,255,255,.6); font-size:11px; font-family:var(--mono); white-space:nowrap; }

/* ── Layout */
.wrap { max-width:1080px; margin:28px auto; padding:0 20px 80px; }
.page-head { display:flex; align-items:flex-end; gap:14px; margin-bottom:20px; flex-wrap:wrap; }
.page-head h2 { font-size:20px; font-weight:700; }
.page-head p { color:var(--muted); font-size:13px; }
.page-head .actions { margin-left:auto; display:flex; gap:10px; }

/* ── Cartes / tableaux */
.card { background:var(--surface); border-radius:12px; border:1px solid var(--border); overflow:hidden; }
table { width:100%; border-collapse:collapse; font-size:13.5px; }
thead th { text-align:left; padding:12px 16px; background:#fafbfc; border-bottom:1px solid var(--border); font-size:11px; font-weight:600; color:var(--muted); text-transform:uppercase; letter-spacing:.4px; }
tbody td { padding:13px 16px; border-bottom:1px solid var(--border); vertical-align:middle; }
tbody tr:last-child td { border-bottom:none; }
tbody tr:hover { background:#f7fafd; }
.cell-strong { font-weight:600; }
.cell-sub { color:var(--muted); font-size:12px; margin-top:2px; }
.mono { font-family:var(--mono); font-size:12.5px; }

/* ── Badges d'état */
.badge { display:inline-flex; align-items:center; gap:6px; padding:4px 10px; border-radius:99px; font-size:11.5px; font-weight:600; white-space:nowrap; }
.badge::before { content:''; width:7px; height:7px; border-radius:50%; background:currentColor; }
.badge.genere { color:#5b7a99; background:#eef2f6; }
.badge.envoye { color:#b7791f; background:#fef3d7; }
.badge.signe  { color:#1e7a45; background:#dcf5e6; }
.badge.refuse { color:#b23b3b; background:#fbe3e3; }
.badge.annule { color:#6b7280; background:#eef0f2; }

/* ── Boutons */
.btn { height:36px; padding:0 16px; border:1px solid var(--border); border-radius:8px; background:white; color:var(--text); font-family:var(--sans); font-size:13px; font-weight:600; cursor:pointer; display:inline-flex; align-items:center; gap:7px; transition:all .15s; text-decoration:none; }
.btn:hover { border-color:var(--accent2); color:var(--accent2); }
.btn.primary { background:var(--accent); color:white; border-color:var(--accent); }
.btn.primary:hover { background:var(--accent2); border-color:var(--accent2); color:white; }
.btn.sm { height:30px; padding:0 11px; font-size:12px; }
.btn.danger:hover { border-color:var(--danger); color:var(--danger); }
.btn:disabled { opacity:.5; cursor:default; }
.btn-link { background:none; border:none; color:var(--accent2); cursor:pointer; font-size:12.5px; font-weight:600; padding:4px; }

/* ── États vides / bannières */
.empty { padding:56px 20px; text-align:center; color:var(--muted); }
.empty .ico { font-size:34px; margin-bottom:10px; }
.banner { padding:12px 16px; border-radius:10px; font-size:13px; display:flex; align-items:center; gap:10px; margin-bottom:18px; }
.banner.warn { background:#fef3d7; color:#8a5a12; border:1px solid #f5d78a; }
.banner.info { background:#e8f2fb; color:#1a5276; border:1px solid #bfdcf2; }

/* ── Toast */
.toast { position:fixed; bottom:24px; left:50%; transform:translateX(-50%) translateY(20px); background:var(--text); color:white; padding:12px 20px; border-radius:10px; font-size:13px; font-weight:500; opacity:0; pointer-events:none; transition:all .25s; z-index:200; box-shadow:0 8px 24px rgba(0,0,0,.25); }
.toast.show { opacity:1; transform:translateX(-50%) translateY(0); }
.toast.err { background:var(--danger); }
.toast.ok  { background:var(--success); }

/* ── Modale */
.modal-bg { position:fixed; inset:0; background:rgba(0,0,0,.45); display:none; align-items:center; justify-content:center; z-index:150; padding:20px; }
.modal-bg.show { display:flex; }
.modal { background:var(--surface); border-radius:14px; width:100%; max-width:440px; box-shadow:0 20px 60px rgba(0,0,0,.35); overflow:hidden; }
.modal-head { padding:18px 22px; border-bottom:1px solid var(--border); font-size:15px; font-weight:700; }
.modal-body { padding:22px; }
.modal-body label { display:block; font-size:11px; font-weight:600; color:var(--muted); text-transform:uppercase; letter-spacing:.4px; margin-bottom:5px; }
.modal-body input { width:100%; height:38px; padding:0 12px; background:#fafbfc; border:1px solid var(--border); border-radius:8px; font-family:var(--sans); font-size:13.5px; outline:none; margin-bottom:14px; }
.modal-body input:focus { border-color:var(--accent2); box-shadow:0 0 0 3px rgba(41,128,185,.12); }
.modal-foot { padding:14px 22px; border-top:1px solid var(--border); display:flex; justify-content:flex-end; gap:10px; background:#fafbfc; }

/* ── Porte d'accès */
.auth-gate { position:fixed; inset:0; z-index:1000; background:linear-gradient(135deg,#1a5276,#2980b9); display:flex; align-items:center; justify-content:center; padding:20px; }
.auth-gate.hidden { display:none; }
.auth-box { background:var(--surface); border-radius:14px; padding:36px 32px; width:100%; max-width:360px; box-shadow:0 20px 60px rgba(0,0,0,.35); text-align:center; }
.auth-logo { display:block; height:56px; width:auto; max-width:200px; margin:0 auto 18px; object-fit:contain; }
.auth-title { font-size:18px; font-weight:700; }
.auth-sub { font-size:12.5px; color:var(--muted); margin-top:4px; margin-bottom:22px; }
.auth-input { height:42px; width:100%; text-align:center; font-family:var(--mono); letter-spacing:2px; font-size:15px; margin-bottom:12px; padding:0 12px; background:#fafbfc; border:1px solid var(--border); border-radius:8px; outline:none; }
.auth-input:focus { border-color:var(--accent2); box-shadow:0 0 0 3px rgba(41,128,185,.12); }
.auth-err { color:var(--danger); font-size:12px; min-height:16px; margin-bottom:10px; }
.auth-btn { width:100%; height:42px; background:var(--accent); color:white; border:none; border-radius:8px; font-family:var(--sans); font-size:14px; font-weight:600; cursor:pointer; transition:background .15s; }
.auth-btn:hover { background:var(--accent2); }
.auth-btn:disabled { opacity:.6; cursor:default; }
