
  :root {
    --bg: #05070a;
    --panel: rgba(14, 16, 20, .82);
    --panel2: rgba(30, 24, 22, .9);
    --line: rgba(226, 86, 43, .22);
    --text: #e9dfd6;
    --muted: #8d8179;
    --gold: #f08a5d;
    --ember: #e2562b;
    --green: #8fbf9a;
    --red: #d9534f;
    --orange: #f0a35d;
    --enemy: #e2562b;
    --us: #7fd0c0;
  }
  * { box-sizing: border-box; }
  html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
  body::before { content: ""; position: fixed; inset: 0; z-index: -2;
    background: radial-gradient(ellipse at 50% -10%, rgba(226,86,43,.20) 0%, rgba(120,40,20,.10) 38%, rgba(5,7,10,0) 70%); }
  body::after { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
    background: radial-gradient(ellipse at 50% 30%, rgba(0,0,0,0) 0%, rgba(3,5,8,.55) 62%, rgba(3,5,8,.92) 100%); }
  h1, .brand, .kpi .v, .threat b { font-family: Georgia, "Times New Roman", serif; }
  a { color: var(--gold); text-decoration: none; }
  .wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px 48px; }

  .top { background: rgba(4,6,9,.88); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
  .top .wrap { display: flex; align-items: center; gap: 16px; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; }
  .brand { font-weight: 400; letter-spacing: .28em; text-transform: uppercase; font-size: 15px; }
  .brand span { color: var(--ember); }
  .top nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
  .top nav a { color: var(--muted); padding: 6px 10px; border-radius: 8px; font-size: 14px; }
  .top nav a.on { background: var(--panel2); color: var(--text); }
  .user { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
  .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); display: inline-block; }

  .banner { background: rgba(40,20,12,.7); border: 1px solid rgba(226,86,43,.35); color: #f0b99c; border-radius: 10px; padding: 8px 12px; margin: 14px 0; font-size: 13px; }

  .head { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; margin: 18px 0 10px; }
  .logo { width: 72px; height: 72px; border-radius: 14px; background: radial-gradient(circle at 50% 35%, #4a1d10, #0b0d11 75%); box-shadow: 0 0 28px rgba(226,86,43,.25); display: grid; place-items: center; font-size: 32px; border: 1px solid var(--line); }
  .head h1 { margin: 0; font-size: 30px; line-height: 1.15; font-weight: 400; letter-spacing: .1em; text-transform: uppercase; color: #fbeee4; text-shadow: 0 0 24px rgba(226,86,43,.55), 0 2px 14px rgba(0,0,0,.9); }
  .head .sub { color: var(--muted); font-size: 14px; margin-top: 2px; }
  .badges { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
  .badge { font-size: 12px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); }
  .badge.good { color: var(--green); border-color: rgba(143,191,154,.35); }
  .badge.warn { color: var(--orange); border-color: rgba(240,163,93,.4); }
  .badge.bad { color: var(--ember); border-color: rgba(226,86,43,.5); }
  .threat { margin-left: auto; text-align: center; padding: 10px 16px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); min-width: 130px; }
  .threat b { font-size: 34px; display: block; line-height: 1; font-weight: 400; color: var(--ember); text-shadow: 0 0 18px rgba(226,86,43,.6); }
  .threat small { color: var(--muted); }

  .controls { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin: 14px 0; position: sticky; top: 54px; z-index: 4; }
  .seg { display: inline-flex; background: var(--bg); border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
  .seg button { background: none; border: 0; color: var(--muted); padding: 6px 12px; cursor: pointer; font: inherit; font-size: 13px; }
  .seg button.on { background: var(--panel2); color: var(--text); }
  .switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; font-size: 14px; }
  .switch input { display: none; }
  .track { width: 40px; height: 22px; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; position: relative; transition: .15s; }
  .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: .15s; }
  .switch input:checked + .track { background: rgba(127,208,192,.18); border-color: rgba(127,208,192,.6); }
  .switch input:checked + .track::after { left: 20px; background: var(--us); }
  .legend { margin-left: auto; display: flex; gap: 14px; font-size: 13px; color: var(--muted); }
  .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

  .grid { display: grid; gap: 14px; }
  .kpis { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
  .cols2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); margin-top: 14px; }
  .card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 0 0 1px rgba(0,0,0,.4), 0 10px 30px rgba(0,0,0,.35); backdrop-filter: blur(3px); padding: 14px 16px; min-width: 0; }
  .card h3 { margin: 0 0 2px; font-size: 12px; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
  .card .hint { color: var(--muted); font-size: 12.5px; margin-bottom: 8px; }
  .kpi .v { font-size: 30px; font-weight: 400; line-height: 1.15; color: #fbeee4; }
  .kpi .d { font-size: 12.5px; color: var(--muted); }
  .kpi .us { font-size: 12.5px; color: var(--us); display: none; }
  body.cmp .kpi .us { display: block; }
  .up { color: var(--green) !important; }

  svg { width: 100%; height: auto; display: block; overflow: visible; }
  svg text { fill: var(--muted); font-size: 11px; font-family: inherit; }
  .gridline { stroke: var(--line); stroke-width: 1; fill: none; }
  .overlap { display: none; margin-top: 8px; padding: 8px 10px; border-radius: 10px; background: var(--panel2); font-size: 13.5px; }
  body.cmp .overlap { display: block; }
  .overlap b { color: var(--gold); }

  table { width: 100%; border-collapse: collapse; font-size: 14px; }
  th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; padding: 4px 6px 6px 0; }
  td { padding: 7px 6px 7px 0; border-top: 1px solid var(--line); }
  td.n, th.n { text-align: right; padding-right: 0; }
  .pill { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--panel2); color: var(--text); white-space: nowrap; }
  .doctrine { padding: 10px 0; border-top: 1px solid var(--line); }
  .doctrine.first { border-top: 0; padding-top: 2px; }
  .doctrine b { display: block; }
  .doctrine span { color: var(--muted); font-size: 13px; }
  .bar { height: 6px; background: var(--bg); border-radius: 4px; overflow: hidden; margin-top: 6px; }
  .bar > i { display: block; height: 100%; background: linear-gradient(90deg, #7a2a12, var(--ember)); }
  .battle { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
  .battle .r { width: 10px; height: 10px; border-radius: 50%; flex: none; }
  .battle small { color: var(--muted); display: block; font-size: 12.5px; }
  footer { color: var(--muted); font-size: 12.5px; margin-top: 26px; border-top: 1px solid var(--line); padding-top: 12px; }
  #tip { position: fixed; pointer-events: none; background: #07090c; border: 1px solid var(--line); padding: 6px 9px; border-radius: 8px; font-size: 12.5px; display: none; z-index: 9; max-width: 240px; }
  @media (max-width: 560px) { .threat { margin-left: 0; } .legend { margin-left: 0; } .controls { top: 96px; } }

  /* page de connexion / refus */
  body.gate { display: grid; place-items: center; min-height: 100vh; }
  .gate-box { text-align: center; max-width: 440px; padding: 36px 28px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 0 60px rgba(226,86,43,.12); margin: 16px; }
  .gate-box h1 { font-family: Georgia, serif; font-weight: 400; letter-spacing: .22em; text-transform: uppercase; margin: 6px 0 4px; text-shadow: 0 0 24px rgba(226,86,43,.55); }
  .sigil { font-size: 44px; }
  .muted { color: var(--muted); }
  .denied { color: #f0b99c; background: rgba(40,20,12,.7); border: 1px solid rgba(226,86,43,.35); padding: 10px 12px; border-radius: 10px; }
  .btn { display: inline-block; margin-top: 10px; padding: 10px 18px; border-radius: 10px; background: linear-gradient(180deg, #8a2f14, #5a1d0c); color: #fbeee4; border: 1px solid rgba(226,86,43,.6); letter-spacing: .06em; }
  .btn:hover { filter: brightness(1.15); }
  .tiny { color: var(--muted); font-size: 12px; margin-top: 16px; }
  .empty { color: var(--muted); font-size: 13.5px; padding: 6px 0; }
  .list { display: grid; gap: 0; }
  .row { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 14px; }
  .row:first-child { border-top: 0; }
  .row small { color: var(--muted); }
  .sub2 { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .12em; margin: 10px 0 2px; }
  .pending { text-align: center; padding: 80px 16px; color: var(--muted); }
  .logo img { width: 100%; height: 100%; border-radius: 14px; object-fit: cover; }
  .userbar a { color: var(--muted); margin-left: 8px; font-size: 12px; text-decoration: underline; }
  .ornament { display: flex; align-items: center; justify-content: center; gap: 14px; color: var(--ember); margin: 6px 0 2px; }
  .ornament span { height: 1px; flex: 1; background: linear-gradient(to right, transparent, rgba(226,86,43,.4), transparent); }
  .controls input[type=search] { flex: 1; min-width: 220px; background: var(--bg); border: 1px solid var(--line); border-radius: 9px; color: var(--text); padding: 8px 12px; font: inherit; }
  .controls input[type=search]:focus { outline: 1px solid var(--ember); }
  #tbl th, #tbl td { white-space: nowrap; }
  #tbl a { color: var(--text); }
  #tbl a:hover { color: var(--ember); }
  .pill.good { color: var(--green); }
  .head .notes { margin-left: auto; display: grid; gap: 8px; width: min(420px, 100%); }
  .note-field { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; }
  .note-field > span { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .12em; min-width: 92px; }
  .note-field input { flex: 1; min-width: 120px; background: transparent; border: 0; color: var(--text); font: inherit; padding: 4px 2px; }
  .note-field input:focus { outline: none; }
  .note-field:focus-within { border-color: var(--ember); }
  .chips { display: contents; }
  .chip { display: inline-flex; align-items: center; gap: 4px; background: rgba(226,86,43,.16); border: 1px solid rgba(226,86,43,.4); color: #f6d3c3; border-radius: 999px; padding: 1px 9px; font-size: 12.5px; }
  .chip button { background: none; border: 0; color: inherit; cursor: pointer; padding: 0 0 0 2px; font-size: 14px; line-height: 1; }
  .suggest { background: none; border: 1px dashed var(--line); color: var(--muted); border-radius: 999px; padding: 1px 9px; font-size: 12px; cursor: pointer; }
  .suggest:hover { color: var(--text); border-color: var(--ember); }
  .hidden { display: none !important; }
  .notes small { padding-left: 4px; }
  @media (max-width: 760px) { .head .notes { margin-left: 0; } }
