/* ARGUS Cyber Watch - thème cockpit (sombre « Nuit SOC » par défaut, variante claire).
   Feuille livrée telle quelle : aucune compilation nécessaire sur l'hébergement. Préfixe ag- pour les composants ARGUS. */

:root {
  --ag-accent: #4f8cff;
  --ag-bg: #f4f6fb; --ag-panel: #ffffff; --ag-panel2: #f1f4fa; --ag-line: #e3e8f2;
  --ag-txt: #0f172a; --ag-mut: #64748b; --ag-track: #e5eaf3;
  --ag-p1: #ef4444; --ag-p2: #f97316; --ag-p3: #eab308; --ag-p4: #64748b; --ag-ok: #16a34a; --ag-warn: #d97706;
  --ag-radius: 14px; --ag-shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 8px 24px rgba(15, 23, 42, .06);
}
.dark {
  --ag-bg: #0b1020; --ag-panel: #121a2e; --ag-panel2: #16203a; --ag-line: #22304f;
  --ag-txt: #e6ebf5; --ag-mut: #8b97b3; --ag-track: #1e2a46; --ag-ok: #22c55e; --ag-warn: #f5b041;
  --ag-shadow: 0 1px 0 rgba(255, 255, 255, .02) inset, 0 10px 30px rgba(0, 0, 0, .25);
}

/* ---------- Habillage général de Filament ---------- */
.dark body, .dark .fi-body { background: var(--ag-bg); }
.dark .fi-sidebar, .dark .fi-sidebar-header { background: #0a0f1d; border-color: var(--ag-line); }
.dark .fi-topbar > nav, .dark .fi-topbar { background: rgba(11, 16, 32, .85); backdrop-filter: blur(8px); border-color: var(--ag-line); }
.fi-sidebar-item-active > a, .fi-sidebar-item.fi-active > a { box-shadow: inset 3px 0 0 var(--ag-accent); }
.fi-sidebar-group-label { letter-spacing: .08em; text-transform: uppercase; font-size: .7rem; }
.dark .fi-section, .dark .fi-ta-ctn, .dark .fi-wi-stats-overview-stat { background: var(--ag-panel); border-color: var(--ag-line); }
.fi-section, .fi-ta-ctn { border-radius: var(--ag-radius); }
.fi-header-heading { letter-spacing: -.01em; }

/* ---------- Indicateur d'activité (barre du haut) ---------- */
.ag-run { display: flex; align-items: center; margin-inline-end: .5rem; }
.ag-run-pill { position: relative; display: flex; align-items: center; gap: .6rem; padding: .35rem .8rem; border-radius: 999px;
  border: 1px solid var(--ag-line); background: var(--ag-panel); color: var(--ag-txt); text-decoration: none; overflow: hidden; min-width: 0; }
.ag-run-pill:hover { border-color: var(--ag-accent); }
.ag-run-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.ag-run-text strong { font-size: .78rem; font-weight: 600; }
.ag-run-text small { font-size: .7rem; color: var(--ag-mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 16rem; }
.ag-run-active { border-color: color-mix(in srgb, var(--ag-accent) 60%, transparent); }
.ag-run-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--ag-track); }
.ag-run-bar i { display: block; height: 100%; background: var(--ag-accent); transition: width .6s ease; }
.ag-spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--ag-track); border-top-color: var(--ag-accent); animation: ag-spin .8s linear infinite; flex: none; }
.ag-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--ag-mut); }
.ag-dot-ok { background: var(--ag-ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ag-ok) 20%, transparent); }
.ag-dot-warn { background: var(--ag-warn); }
.ag-dot-pulse { background: var(--ag-accent); animation: ag-pulse 1.4s ease-in-out infinite; }
@keyframes ag-spin { to { transform: rotate(360deg); } }
@keyframes ag-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .4; transform: scale(.8); } }
@media (max-width: 900px) { .ag-run-text small { display: none; } }

/* ---------- Cartes du cockpit ---------- */
.ag-card { background: var(--ag-panel); border: 1px solid var(--ag-line); border-radius: var(--ag-radius); box-shadow: var(--ag-shadow);
  padding: 1.15rem 1.25rem; color: var(--ag-txt); height: 100%; }
.ag-card-h { display: flex; justify-content: space-between; align-items: baseline; gap: .75rem; margin-bottom: .9rem; }
.ag-card-h h3 { margin: 0; font-size: .95rem; font-weight: 600; }
.ag-card-h small, .ag-mut { color: var(--ag-mut); font-size: .78rem; }
.ag-link { color: var(--ag-accent); font-size: .78rem; text-decoration: none; white-space: nowrap; }
.ag-link:hover { text-decoration: underline; }
.ag-mono { font-family: ui-monospace, Consolas, monospace; font-size: .78rem; color: color-mix(in srgb, var(--ag-accent) 55%, var(--ag-txt)); word-break: break-all; }
.ag-empty { color: var(--ag-mut); font-size: .85rem; padding: .75rem 0; }

/* Jauge de score */
.ag-score { display: flex; gap: 1.5rem; align-items: center; flex-wrap: wrap; }
.ag-ring { --v: 0; --c: var(--ag-accent); width: 148px; height: 148px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: conic-gradient(var(--c) calc(var(--v) * 1%), var(--ag-track) 0); transition: background .6s; }
.ag-ring > div { width: 116px; height: 116px; border-radius: 50%; background: var(--ag-panel); display: grid; place-items: center; text-align: center; }
.ag-ring b { display: block; font-size: 2.4rem; line-height: 1; font-weight: 700; letter-spacing: -.02em; }
.ag-ring span { color: var(--ag-mut); font-size: .75rem; }
.ag-grade { display: inline-grid; place-items: center; min-width: 1.8rem; padding: 0 .45rem; height: 1.6rem; border-radius: 7px; font-weight: 800; color: #111; margin-inline-start: .5rem; }
.ag-trend-up { color: var(--ag-ok); } .ag-trend-down { color: var(--ag-p1); }
.ag-facts { display: grid; gap: .3rem; margin-top: .6rem; font-size: .8rem; color: var(--ag-mut); }

/* Courbe */
.ag-chart svg { width: 100%; height: 160px; display: block; }
.ag-chart .ag-axis { stroke: var(--ag-line); stroke-width: 1; }
.ag-chart text { fill: var(--ag-mut); font-size: 10px; }

/* Compteurs P1-P4 */
.ag-prio { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.ag-pc { position: relative; display: block; text-decoration: none; color: var(--ag-txt); background: var(--ag-panel); border: 1px solid var(--ag-line);
  border-radius: var(--ag-radius); padding: 1rem 1.1rem; box-shadow: var(--ag-shadow); overflow: hidden; transition: transform .15s, border-color .15s; }
.ag-pc::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--c); }
.ag-pc:hover { transform: translateY(-2px); border-color: var(--c); }
.ag-pc .l { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ag-mut); }
.ag-pc b { display: block; font-size: 2rem; font-weight: 700; line-height: 1.15; margin: .15rem 0; }
.ag-pc small { color: var(--ag-accent); font-size: .75rem; }
.ag-pc.zero b { color: var(--ag-mut); }
@media (max-width: 1100px) { .ag-prio { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Tuiles par domaine */
.ag-domains { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; }
.ag-dom { display: block; text-decoration: none; color: var(--ag-txt); background: var(--ag-panel2); border: 1px solid transparent; border-radius: 11px; padding: .8rem .9rem; transition: border-color .15s; }
.ag-dom:hover { border-color: var(--ag-line); }
.ag-dom .n { font-size: .75rem; color: var(--ag-mut); display: flex; justify-content: space-between; }
.ag-dom b { font-size: 1.35rem; font-weight: 700; }
.ag-bar { height: 6px; border-radius: 4px; background: var(--ag-track); margin-top: .5rem; overflow: hidden; }
.ag-bar i { display: block; height: 100%; border-radius: 4px; transition: width .6s; }
@media (max-width: 1100px) { .ag-domains { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Liste « à traiter en priorité » */
.ag-items { display: grid; }
.ag-item { display: grid; grid-template-columns: 3rem minmax(0, 1fr) auto; gap: .8rem; padding: .7rem 0; border-top: 1px solid var(--ag-line); text-decoration: none; color: var(--ag-txt); }
.ag-item:first-child { border-top: 0; }
.ag-item:hover .ag-item-t { color: var(--ag-accent); }
.ag-item-t { font-weight: 600; font-size: .86rem; display: block; }
.ag-item-w { font-size: .75rem; color: var(--ag-mut); }
.ag-src { color: var(--ag-accent); }
.ag-sla { text-align: right; font-size: .75rem; color: var(--ag-mut); white-space: nowrap; }
.ag-sla b { color: var(--ag-txt); display: block; font-size: .8rem; }
.ag-sla .late { color: var(--ag-p1); }
.ag-tag { display: inline-grid; place-items: center; height: 1.4rem; border-radius: 6px; font-size: .7rem; font-weight: 800; color: #fff; }
.ag-t1 { background: var(--ag-p1); } .ag-t2 { background: var(--ag-p2); } .ag-t3 { background: var(--ag-p3); color: #111; } .ag-t4 { background: var(--ag-p4); }

/* État des modules */
.ag-mods { display: grid; }
.ag-mod { display: flex; justify-content: space-between; gap: .75rem; align-items: center; padding: .55rem 0; border-top: 1px solid var(--ag-line); }
.ag-mod:first-child { border-top: 0; }
.ag-mod b { font-size: .84rem; font-weight: 600; display: block; }
.ag-mod small { color: var(--ag-mut); font-size: .72rem; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 22rem; }
.ag-st { font-size: .68rem; font-weight: 700; border-radius: 6px; padding: .15rem .5rem; white-space: nowrap; }
.ag-st-ok { background: color-mix(in srgb, var(--ag-ok) 16%, transparent); color: var(--ag-ok); }
.ag-st-warn { background: color-mix(in srgb, var(--ag-warn) 18%, transparent); color: var(--ag-warn); }
.ag-st-err { background: color-mix(in srgb, var(--ag-p1) 18%, transparent); color: var(--ag-p1); }
.ag-st-run { background: color-mix(in srgb, var(--ag-accent) 18%, transparent); color: var(--ag-accent); }
.ag-st-idle { background: var(--ag-panel2); color: var(--ag-mut); }

/* Vue « analyses en cours » (page Modules) */
.ag-live { margin-bottom: 1rem; }
.ag-live-top { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.ag-live-big { font-size: 1.6rem; font-weight: 700; }
.ag-progress { height: 10px; border-radius: 6px; background: var(--ag-track); overflow: hidden; margin: .8rem 0 1rem; }
.ag-progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--ag-accent), color-mix(in srgb, var(--ag-accent) 60%, #a855f7)); transition: width .6s; }
.ag-steps { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .5rem; }
.ag-step { display: flex; align-items: center; gap: .55rem; padding: .5rem .65rem; border-radius: 9px; background: var(--ag-panel2); font-size: .8rem; }
.ag-step small { margin-inline-start: auto; color: var(--ag-mut); }
.ag-ico { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: .65rem; font-weight: 800; flex: none; color: #fff; background: var(--ag-track); }
.ag-ico.ok { background: var(--ag-ok); } .ag-ico.warn { background: var(--ag-warn); } .ag-ico.err { background: var(--ag-p1); }

/* Bandeau d'accueil du cockpit */
.ag-hero { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.ag-hero h2 { margin: 0; font-size: 1.35rem; font-weight: 700; letter-spacing: -.01em; }
.ag-hero p { margin: .15rem 0 0; color: var(--ag-mut); font-size: .85rem; }
.ag-btns { display: flex; gap: .5rem; flex-wrap: wrap; }
.ag-btn { display: inline-flex; align-items: center; gap: .4rem; border-radius: 9px; padding: .5rem .95rem; font-size: .82rem; font-weight: 600; text-decoration: none; cursor: pointer; border: 1px solid transparent; }
.ag-btn-p { background: var(--ag-accent); color: #fff; }
.ag-btn-p:hover { filter: brightness(1.08); }
.ag-btn-g { background: var(--ag-panel); border-color: var(--ag-line); color: var(--ag-txt); }
.ag-btn-g:hover { border-color: var(--ag-accent); }
.ag-btn[disabled] { opacity: .55; cursor: default; }

/* ---------- Liste des alertes ---------- */
.ag-col-title { min-width: 22rem; }
.fi-ta-row { transition: background-color .12s; }
.fi-ta-row:hover { background: color-mix(in srgb, var(--ag-accent) 7%, transparent); }
.dark .fi-ta-header-cell { background: var(--ag-panel2); }
.fi-ta-text-description { font-size: .75rem; }

/* ---------- Analyser un indicateur ---------- */
.ag-an-form { display: grid; gap: .6rem; }
.ag-an-input { width: 100%; background: var(--ag-panel2); color: var(--ag-txt); border: 1px solid var(--ag-line); border-radius: 10px; padding: .8rem 1rem;
  font-family: ui-monospace, Consolas, monospace; font-size: .85rem; resize: vertical; }
.ag-an-input:focus { outline: 2px solid color-mix(in srgb, var(--ag-accent) 50%, transparent); border-color: var(--ag-accent); }
.ag-an-actions { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.ag-an-result { border-left: 4px solid var(--vc); }
.ag-an-head { display: flex; justify-content: space-between; gap: 1rem; align-items: center; margin-bottom: 1rem; }
.ag-an-value { font-family: ui-monospace, Consolas, monospace; font-size: 1.05rem; font-weight: 600; word-break: break-all; }
.ag-an-verdict { text-align: right; flex: none; }
.ag-an-score { font-size: 1.9rem; font-weight: 800; color: var(--vc); line-height: 1; }
.ag-an-score small { font-size: .8rem; color: var(--ag-mut); font-weight: 500; }
.ag-an-badge { display: inline-block; margin-top: .3rem; padding: .2rem .65rem; border-radius: 7px; font-size: .78rem; font-weight: 700;
  background: color-mix(in srgb, var(--vc) 18%, transparent); color: var(--vc); }
.ag-an-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 1.5rem; }
@media (max-width: 1000px) { .ag-an-grid { grid-template-columns: 1fr; } }
.ag-an-grid h4 { margin: 0 0 .5rem; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ag-mut); }
.ag-an-sig { display: flex; gap: .55rem; align-items: baseline; padding: .4rem 0; font-size: .85rem; border-top: 1px solid var(--ag-line); }
.ag-an-sig:first-of-type { border-top: 0; }
.ag-an-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--ag-p4); transform: translateY(1px); }
.ag-an-bad .ag-an-dot { background: var(--ag-p1); } .ag-an-warn .ag-an-dot { background: var(--ag-p2); }
.ag-an-ok .ag-an-dot, .ag-an-own .ag-an-dot { background: var(--ag-ok); }
.ag-an-fact { display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: .5rem; padding: .35rem 0; font-size: .82rem; border-top: 1px solid var(--ag-line); }
.ag-an-fact:first-of-type { border-top: 0; }
.ag-an-fact span:first-child { color: var(--ag-mut); }
.ag-an-fact span:last-child { word-break: break-word; }
.ag-an-advice { margin: 0; padding-inline-start: 1.2rem; display: grid; gap: .3rem; font-size: .85rem; }
.ag-an-hist { width: 100%; border-collapse: collapse; font-size: .82rem; }
.ag-an-hist th { text-align: left; color: var(--ag-mut); font-weight: 500; padding: .45rem .6rem; border-bottom: 1px solid var(--ag-line); }
.ag-an-hist td { padding: .45rem .6rem; border-bottom: 1px solid var(--ag-line); }

/* ---------- Fiche d'une alerte ---------- */
.ag-fd { display: grid; gap: 1rem; color: var(--ag-txt); }
.ag-fd-hero { display: flex; gap: 1.25rem; align-items: stretch; padding: 1.25rem; border-radius: var(--ag-radius); border: 1px solid var(--ag-line);
  background: linear-gradient(120deg, color-mix(in srgb, var(--pc) 22%, var(--ag-panel)) 0%, var(--ag-panel) 55%); box-shadow: var(--ag-shadow); }
.ag-fd-prio { flex: none; width: 6.5rem; border-radius: 12px; background: var(--pc); color: #fff; display: grid; place-content: center; text-align: center; padding: .75rem .5rem; }
.ag-fd-prio span { font-size: 2.2rem; font-weight: 800; line-height: 1; }
.ag-fd-prio small { font-size: .72rem; opacity: .9; margin-top: .3rem; }
.ag-fd-main { min-width: 0; display: grid; gap: .45rem; align-content: center; }
.ag-fd-main h1 { margin: 0; font-size: 1.35rem; line-height: 1.3; font-weight: 700; letter-spacing: -.01em; }
.ag-fd-asset { font-family: ui-monospace, Consolas, monospace; font-size: .9rem; color: color-mix(in srgb, var(--ag-accent) 60%, var(--ag-txt)); word-break: break-all; }
.ag-fd-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.ag-chip { font-size: .72rem; padding: .2rem .6rem; border-radius: 999px; background: var(--ag-panel2); border: 1px solid var(--ag-line); color: var(--ag-mut); }
.ag-chip-acc { color: var(--ag-accent); border-color: color-mix(in srgb, var(--ag-accent) 40%, transparent); }
.ag-sev-critical { color: var(--ag-p1); border-color: color-mix(in srgb, var(--ag-p1) 45%, transparent); }
.ag-sev-high { color: var(--ag-p2); border-color: color-mix(in srgb, var(--ag-p2) 45%, transparent); }
.ag-sev-medium { color: var(--ag-p3); } .ag-sev-low, .ag-sev-info { color: var(--ag-mut); }
.ag-fd-alert { display: block; padding: .75rem 1rem; border-radius: 10px; background: color-mix(in srgb, var(--ag-p2) 14%, transparent); color: var(--ag-txt); text-decoration: none; font-size: .85rem; border: 1px solid color-mix(in srgb, var(--ag-p2) 40%, transparent); }
.ag-fd-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
@media (max-width: 1200px) { .ag-fd-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ag-fd-kpi { display: flex; gap: .9rem; align-items: center; padding: 1rem 1.1rem; }
.ag-fd-kv { font-size: 1.35rem; font-weight: 700; line-height: 1.2; }
.ag-fd-kv.late { color: var(--ag-p1); }
.ag-ring-sm { width: 64px; height: 64px; }
.ag-ring-sm > div { width: 48px; height: 48px; }
.ag-ring-sm b { font-size: 1.05rem; }
.ag-progress-sm { height: 6px; margin: .4rem 0; }
.ag-fd-ico { width: 44px; height: 44px; border-radius: 12px; flex: none; display: grid; place-items: center; font-size: 1.2rem; background: var(--ag-panel2); color: var(--ag-mut); }
.ag-fd-st-todo { color: var(--ag-mut); } .ag-fd-st-EnCours { color: var(--ag-accent); } .ag-fd-st-Traite { color: var(--ag-ok); }
.ag-fd-st-FauxPositif { color: var(--ag-p4); } .ag-fd-st-RisqueAccepte { color: var(--ag-warn); }
.ag-fd-stack { display: flex; height: 14px; border-radius: 8px; overflow: hidden; gap: 2px; background: var(--ag-track); }
.ag-fd-stack i { display: block; min-width: 6px; }
.ag-fd-legend { display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; margin-top: .75rem; font-size: .8rem; }
.ag-fd-legend span { display: inline-flex; align-items: center; gap: .4rem; }
.ag-fd-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.ag-fd-cols { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
@media (max-width: 1100px) { .ag-fd-cols { grid-template-columns: 1fr; } }
.ag-fd-col { display: grid; gap: 1rem; align-content: start; }
.ag-fd-text { font-size: .88rem; line-height: 1.6; white-space: pre-line; color: color-mix(in srgb, var(--ag-txt) 88%, var(--ag-mut)); margin: 0; }
.ag-fd-why { display: flex; gap: 1rem; align-items: flex-start; background: linear-gradient(120deg, color-mix(in srgb, var(--ag-accent) 12%, var(--ag-panel)), var(--ag-panel)); }
.ag-fd-why h3 { margin: 0 0 .3rem; font-size: .95rem; }
.ag-fd-why p { margin: 0; font-size: .88rem; line-height: 1.55; }
.ag-fd-why-ico { width: 36px; height: 36px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 800; background: var(--ag-accent); color: #fff; }
.ag-fd-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: .1rem; counter-reset: s; }
.ag-fd-steps li { display: grid; grid-template-columns: 2rem minmax(0, 1fr); gap: .75rem; padding: .55rem 0; font-size: .87rem; line-height: 1.5; position: relative; }
.ag-fd-steps li:not(:last-child)::after { content: ""; position: absolute; left: .95rem; top: 2.3rem; bottom: -.4rem; width: 2px; background: var(--ag-line); }
.ag-fd-num { width: 1.9rem; height: 1.9rem; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .8rem;
  background: color-mix(in srgb, var(--ag-accent) 18%, transparent); color: var(--ag-accent); border: 1px solid color-mix(in srgb, var(--ag-accent) 45%, transparent); }
.ag-fd-pair { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin-top: .9rem; }
@media (max-width: 700px) { .ag-fd-pair { grid-template-columns: 1fr; } }
.ag-fd-box { display: grid; gap: .3rem; padding: .8rem .9rem; border-radius: 10px; font-size: .82rem; line-height: 1.45; }
.ag-fd-ok { background: color-mix(in srgb, var(--ag-ok) 12%, transparent); border: 1px solid color-mix(in srgb, var(--ag-ok) 35%, transparent); }
.ag-fd-ok b { color: var(--ag-ok); }
.ag-fd-esc { background: color-mix(in srgb, var(--ag-p2) 12%, transparent); border: 1px solid color-mix(in srgb, var(--ag-p2) 35%, transparent); }
.ag-fd-esc b { color: var(--ag-p2); }
.ag-fd-action { border-left: 4px solid var(--pc); }
.ag-fd-action h3 { margin: 0 0 .5rem; font-size: .95rem; }
.ag-fd-action p { margin: 0; font-size: .87rem; line-height: 1.6; }
.ag-fd-dup { display: grid; gap: .1rem; padding: .55rem 0; border-top: 1px solid var(--ag-line); text-decoration: none; color: var(--ag-txt); font-size: .82rem; }
.ag-fd-dup:first-of-type { border-top: 0; }
.ag-fd-dup b { font-size: .75rem; color: var(--ag-accent); }
.ag-fd-next { margin: 0; padding-inline-start: 1.1rem; display: grid; gap: .35rem; font-size: .85rem; line-height: 1.5; }

/* ---------- Composants standard (filtres, KPI, pastilles, boutons) ---------- */
.ag-filters { display: flex; gap: .5rem; flex-wrap: wrap; }
.ag-fchip { display: inline-flex; align-items: center; gap: .45rem; padding: .4rem .85rem; border-radius: 999px; font-size: .8rem; cursor: pointer;
  background: var(--ag-panel); border: 1px solid var(--ag-line); color: var(--ag-txt); }
.ag-fchip span { font-size: .7rem; padding: 0 .4rem; border-radius: 999px; background: var(--ag-panel2); color: var(--ag-mut); }
.ag-fchip.on { border-color: var(--ag-accent); background: color-mix(in srgb, var(--ag-accent) 14%, var(--ag-panel)); }
.ag-fchip.on span { background: var(--ag-accent); color: #fff; }
.ag-pill { font-size: .72rem; font-weight: 600; padding: .15rem .55rem; border-radius: 6px; color: var(--c);
  background: color-mix(in srgb, var(--c) 15%, transparent); border: 1px solid color-mix(in srgb, var(--c) 35%, transparent); }
.ag-btn-sm { padding: .35rem .75rem; font-size: .76rem; }
.ag-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .75rem; }
.ag-kpi { position: relative; overflow: hidden; display: grid; gap: .1rem; padding: .85rem 1rem; border-radius: 12px; background: var(--ag-panel);
  border: 1px solid var(--ag-line); box-shadow: var(--ag-shadow); color: var(--ag-txt); }
.ag-kpi::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--c); }
.ag-kpi .l { font-size: .72rem; color: var(--ag-mut); text-transform: uppercase; letter-spacing: .05em; }
.ag-kpi b { font-size: 1.6rem; font-weight: 700; line-height: 1.2; color: var(--c); }
.ag-kpi small { font-size: .72rem; color: var(--ag-mut); }
.ag-journal-alert { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: .75rem; font-size: .82rem;
  border-left: 3px solid var(--ag-p1); }

/* ---------- Page Modules : cartes uniformes ---------- */
.ag-modgrid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); align-items: stretch; margin-top: .25rem; }
.ag-modcard { display: flex; flex-direction: column; gap: .75rem; padding: 1rem 1.1rem; border-radius: var(--ag-radius); background: var(--ag-panel);
  border: 1px solid var(--ag-line); box-shadow: var(--ag-shadow); color: var(--ag-txt); border-top: 3px solid var(--tone, var(--ag-line)); }
.ag-ms-ok { --tone: var(--ag-ok); } .ag-ms-warn { --tone: var(--ag-warn); } .ag-ms-err { --tone: var(--ag-p1); }
.ag-ms-run { --tone: var(--ag-accent); } .ag-ms-idle { --tone: var(--ag-line); }
.ag-modcard-h { display: flex; gap: .7rem; align-items: center; }
.ag-modcard-h h3 { margin: 0; font-size: .95rem; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-modcard-ico { width: 34px; height: 34px; border-radius: 9px; flex: none; display: grid; place-items: center; font-weight: 800; font-size: .9rem;
  color: var(--ag-accent); background: color-mix(in srgb, var(--ag-accent) 14%, transparent); }
.ag-modcard-meta { font-size: .72rem; color: var(--ag-mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-modcard-desc { margin: 0; font-size: .8rem; line-height: 1.45; color: var(--ag-mut); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.3rem; }
.ag-modcard-alerts { display: flex; flex-wrap: wrap; gap: .35rem; min-height: 1.5rem; }
.ag-modcard-stats { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem .9rem; padding: .7rem .8rem; border-radius: 10px; background: var(--ag-panel2); flex: 1; align-content: start; }
.ag-modcard-stats span { display: block; font-size: .7rem; color: var(--ag-mut); }
.ag-modcard-stats b { font-size: .9rem; font-weight: 650; }
.ag-modcard-err { font-size: .75rem; color: var(--ag-p1); background: color-mix(in srgb, var(--ag-p1) 10%, transparent); border-radius: 8px; padding: .45rem .6rem; }
.ag-modcard-f { display: flex; gap: .4rem; flex-wrap: wrap; padding-top: .7rem; border-top: 1px solid var(--ag-line); margin-top: auto; }

/* ---------- Bloc « État des modules » du cockpit ---------- */
.ag-modsum { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; margin-bottom: .75rem; }
.ag-modsum div { text-align: center; padding: .55rem .3rem; border-radius: 10px; background: var(--ag-panel2); }
.ag-modsum b { display: block; font-size: 1.25rem; color: var(--c); }
.ag-modsum span { font-size: .68rem; color: var(--ag-mut); }

/* ---------- Ambiance cockpit SOC : textures et animations ----------
   Légères (CSS seul), désactivées si le poste demande moins d'animations (accessibilité). */

/* Texture de fond : grille fine + halo d'accent + grain (thème sombre) */
.dark .fi-main-ctn, .dark .fi-body {
  background-color: var(--ag-bg);
  background-image:
    radial-gradient(1200px 600px at 85% -10%, color-mix(in srgb, var(--ag-accent) 10%, transparent), transparent 70%),
    radial-gradient(900px 500px at -10% 110%, rgba(124, 58, 237, .07), transparent 70%),
    linear-gradient(rgba(148, 163, 184, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, .035) 1px, transparent 1px);
  background-size: auto, auto, 32px 32px, 32px 32px;
  background-attachment: fixed;
}
.dark .fi-sidebar { background-image: linear-gradient(180deg, rgba(79, 140, 255, .05), transparent 30%); }

/* Cartes : liseré lumineux en haut et légère profondeur au survol */
.ag-card, .ag-modcard, .ag-pc, .ag-kpi { position: relative; }
.dark .ag-card::after, .dark .ag-modcard::after { content: ""; position: absolute; inset: 0 0 auto 0; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--ag-accent) 45%, transparent), transparent); opacity: .5; border-radius: inherit; }
.ag-modcard, .ag-kpi { transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.ag-modcard:hover, .ag-kpi:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(0, 0, 0, .28); }

@media (prefers-reduced-motion: no-preference) {
  /* Apparition en cascade des blocs */
  .fi-wi-widget, .ag-modcard, .ag-kpi, .ag-fd > * { animation: ag-rise .45s cubic-bezier(.2, .7, .2, 1) both; }
  .fi-wi-widget:nth-child(2), .ag-modcard:nth-child(2), .ag-kpi:nth-child(2) { animation-delay: .04s; }
  .fi-wi-widget:nth-child(3), .ag-modcard:nth-child(3), .ag-kpi:nth-child(3) { animation-delay: .08s; }
  .fi-wi-widget:nth-child(4), .ag-modcard:nth-child(4), .ag-kpi:nth-child(4) { animation-delay: .12s; }
  .fi-wi-widget:nth-child(5), .ag-modcard:nth-child(5), .ag-kpi:nth-child(5) { animation-delay: .16s; }
  .fi-wi-widget:nth-child(n+6), .ag-modcard:nth-child(n+6), .ag-kpi:nth-child(n+6) { animation-delay: .2s; }

  /* Jauge de score : balayage radar */
  .ag-ring { position: relative; }
  .ag-ring::before { content: ""; position: absolute; inset: -4px; border-radius: 50%; pointer-events: none;
    background: conic-gradient(from 0deg, transparent 0 80%, color-mix(in srgb, var(--c) 55%, transparent) 95%, transparent);
    mask: radial-gradient(circle, transparent 58%, #000 60%); -webkit-mask: radial-gradient(circle, transparent 58%, #000 60%);
    animation: ag-spin 4.5s linear infinite; opacity: .55; }

  /* P1 non nul : halo pulsé (urgence) */
  .ag-pc.hot { animation: ag-glow 2.2s ease-in-out infinite; }
  .ag-tag.ag-t1 { animation: ag-glow-sm 2.2s ease-in-out infinite; }

  /* Barres de progression : reflet qui défile pendant une analyse */
  .ag-progress i, .ag-run-bar i { position: relative; overflow: hidden; }
  .ag-progress i::after, .ag-run-bar i::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .35), transparent); animation: ag-shine 1.8s ease-in-out infinite; }

  /* Indicateur « Surveillance active » : onde radar */
  .ag-dot-ok { position: relative; }
  .ag-dot-ok::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--ag-ok); animation: ag-ping 2.4s ease-out infinite; }

  /* Bandeau de la fiche d'alerte : ligne de balayage */
  .ag-fd-hero { position: relative; overflow: hidden; }
  .ag-fd-hero::after { content: ""; position: absolute; top: 0; bottom: 0; width: 30%; left: -30%; pointer-events: none;
    background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--pc) 12%, transparent), transparent); animation: ag-sweep 6s ease-in-out infinite; }
}
@keyframes ag-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes ag-glow { 0%, 100% { box-shadow: var(--ag-shadow); } 50% { box-shadow: 0 0 0 1px color-mix(in srgb, var(--ag-p1) 50%, transparent), 0 0 26px color-mix(in srgb, var(--ag-p1) 35%, transparent); } }
@keyframes ag-glow-sm { 0%, 100% { box-shadow: none; } 50% { box-shadow: 0 0 12px color-mix(in srgb, var(--ag-p1) 60%, transparent); } }
@keyframes ag-shine { to { transform: translateX(100%); } }
@keyframes ag-ping { 0% { transform: scale(1); opacity: .7; } 100% { transform: scale(2.6); opacity: 0; } }
@keyframes ag-sweep { 0%, 60% { left: -30%; } 100% { left: 110%; } }

/* Chiffres clés : police à chiffres tabulaires (pas de « saut » quand les valeurs changent) */
.ag-pc b, .ag-kpi b, .ag-ring b, .ag-an-score, .ag-live-big, .ag-fd-kv, .ag-modsum b { font-variant-numeric: tabular-nums; }

/* Version installée (pied du menu latéral) */
.ag-version { padding: .75rem 1rem 1rem; font: 500 .68rem/1.4 ui-monospace, Consolas, monospace; color: var(--ag-mut); opacity: .7; letter-spacing: .02em; }
.ag-version:hover { opacity: 1; }

.ag-run-paused { border-color: color-mix(in srgb, var(--ag-warn) 55%, transparent); background: color-mix(in srgb, var(--ag-warn) 10%, var(--ag-panel)); }

/* Blocs côte à côte du cockpit (À traiter / État des modules) : même hauteur fixe, défilement interne */
.ag-fixed { height: 30rem; display: flex; flex-direction: column; }
.ag-fixed > .ag-card-h, .ag-fixed > .ag-modsum { flex: none; }
.ag-scroll { flex: 1; min-height: 0; overflow-y: auto; padding-right: .35rem; scrollbar-width: thin; scrollbar-color: var(--ag-line) transparent; }
.ag-scroll::-webkit-scrollbar { width: 6px; }
.ag-scroll::-webkit-scrollbar-thumb { background: var(--ag-line); border-radius: 6px; }
@media (max-width: 1023px) { .ag-fixed { height: auto; } .ag-scroll { max-height: 26rem; } }

/* =====================================================================================
   ÉVOLUTIONS VISUELLES : radar, cartes en verre, carte des menaces, fil d'activité, mur SOC
   ===================================================================================== */
:root { --ag-cyan: #0891b2; } .dark { --ag-cyan: #22d3ee; }

/* --- Radar de posture --- */
.ag-radar { --sz: 176px; position: relative; flex: none; width: var(--sz); height: var(--sz); border-radius: 50%;
  background: radial-gradient(circle, transparent 0 21%, color-mix(in srgb, var(--c) 22%, transparent) 21% 22%, transparent 22% 46%,
    color-mix(in srgb, var(--ag-accent) 16%, transparent) 46% 47%, transparent 47% 71%, color-mix(in srgb, var(--ag-accent) 12%, transparent) 71% 72%, transparent 72%);
  border: 1px solid var(--ag-line); box-shadow: 0 0 40px color-mix(in srgb, var(--c) 18%, transparent), inset 0 0 30px rgba(0, 0, 0, .25); }
.ag-radar::before, .ag-radar::after { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: var(--ag-line); opacity: .6; }
.ag-radar::after { left: 0; right: 0; top: 50%; bottom: auto; width: auto; height: 1px; }
.ag-radar-sweep { position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 0deg, color-mix(in srgb, var(--ag-cyan) 38%, transparent), transparent 22%); pointer-events: none; }
.ag-radar-core { position: absolute; inset: 30%; border-radius: 50%; display: grid; place-content: center; text-align: center; background: var(--ag-panel);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--c) 70%, transparent), 0 0 24px color-mix(in srgb, var(--c) 35%, transparent); z-index: 2; }
.ag-radar-core b { font-size: 1.9rem; font-weight: 800; line-height: 1; color: var(--c); font-variant-numeric: tabular-nums; }
.ag-radar-core span { font-size: .62rem; text-transform: uppercase; letter-spacing: .1em; color: var(--ag-mut); }
.ag-echo { position: absolute; width: 10px; height: 10px; margin: -5px; border-radius: 50%; z-index: 3; }
.ag-echo-p1 { background: var(--ag-p1); box-shadow: 0 0 10px var(--ag-p1); }
.ag-echo-p2 { background: var(--ag-p2); box-shadow: 0 0 8px var(--ag-p2); }
.ag-echo:hover { transform: scale(1.6); }
.ag-radar-big { --sz: min(46vh, 380px); }
.ag-radar-big .ag-radar-core b { font-size: 4rem; }
.ag-legend-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; vertical-align: 0; }

/* --- Composition du score et contrôles --- */
.ag-scoremix { display: grid; gap: .45rem; margin-top: .8rem; min-width: 210px; }
.ag-scoremix div { display: grid; grid-template-columns: 1fr auto; gap: .1rem .6rem; font-size: .76rem; color: var(--ag-mut); }
.ag-scoremix b { color: var(--ag-txt); font-variant-numeric: tabular-nums; }
.ag-scoremix i { grid-column: 1 / -1; height: 5px; border-radius: 4px; background: linear-gradient(90deg, var(--c) var(--w), var(--ag-track) var(--w)); }
.ag-controls { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: 1rem; padding-top: .8rem; border-top: 1px solid var(--ag-line); }
.ag-ctrl { font-size: .7rem; padding: .2rem .55rem; border-radius: 6px; border: 1px solid var(--ag-line); color: var(--ag-mut); white-space: nowrap; }
.ag-ctrl-ok { color: var(--ag-ok); border-color: color-mix(in srgb, var(--ag-ok) 35%, transparent); background: color-mix(in srgb, var(--ag-ok) 9%, transparent); }
.ag-ctrl-ko { color: var(--ag-p1); border-color: color-mix(in srgb, var(--ag-p1) 35%, transparent); background: color-mix(in srgb, var(--ag-p1) 9%, transparent); }

/* --- Cartes en verre, chiffres qui défilent, mini-courbes --- */
.ag-glass { background: linear-gradient(135deg, color-mix(in srgb, var(--ag-panel) 70%, rgba(255, 255, 255, .06)), var(--ag-panel)); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.dark .ag-glass { border-color: rgba(255, 255, 255, .09); }
.ag-glass::after { content: ""; position: absolute; top: -60%; left: -70%; width: 40%; height: 220%; transform: rotate(20deg); pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .09), transparent); }
.ag-spark { display: block; width: 100%; height: 26px; margin-top: .4rem; opacity: .9; }
@property --ag-n { syntax: "<integer>"; inherits: false; initial-value: 0; }

/* --- Carte des menaces --- */
.ag-map { position: relative; flex: 1; min-height: 220px; }
.ag-map svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.ag-map-hq, .ag-blip { position: absolute; transform: translate(-50%, -50%); border-radius: 50%; }
.ag-map-hq { width: 13px; height: 13px; border-radius: 4px; background: var(--ag-accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ag-accent) 25%, transparent), 0 0 18px var(--ag-accent); z-index: 2; }
.ag-blip { width: var(--s); height: var(--s); z-index: 3; cursor: help; }
.ag-blip-crit { background: var(--ag-p1); box-shadow: 0 0 12px var(--ag-p1); }
.ag-blip-warn { background: var(--ag-p2); box-shadow: 0 0 10px var(--ag-p2); }
.ag-blip::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--ag-p2); }
.ag-blip-crit::after { border-color: var(--ag-p1); }
.ag-map-empty { position: absolute; inset: auto 0 .5rem; text-align: center; font-size: .8rem; color: var(--ag-mut); }

/* --- Fil d'activité (terminal) --- */
.ag-terminal { background: linear-gradient(180deg, color-mix(in srgb, var(--ag-panel) 92%, #000), var(--ag-panel)); }
.ag-feed { font: 500 .76rem/1.65 ui-monospace, "JetBrains Mono", Consolas, monospace; }
.ag-feed-row { display: grid; grid-template-columns: 6.6rem 3.2rem minmax(0, 1fr); gap: .5rem; padding: .15rem 0; color: var(--ag-txt); text-decoration: none;
  border-bottom: 1px dashed color-mix(in srgb, var(--ag-line) 60%, transparent); }
a.ag-feed-row:hover .ag-feed-text { color: var(--ag-accent); }
.ag-feed-row time { color: var(--ag-mut); }
.ag-feed-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-feed-tag { font-weight: 800; text-align: center; border-radius: 4px; }
.ag-tone-crit { color: var(--ag-p1); } .ag-tone-warn { color: var(--ag-p2); } .ag-tone-p3 { color: var(--ag-p3); } .ag-tone-ok { color: var(--ag-ok); }
.ag-tone-cyan { color: var(--ag-cyan); } .ag-tone-violet { color: #a78bfa; } .ag-tone-mut { color: var(--ag-mut); }
.ag-caret { display: inline-block; width: 7px; height: 13px; background: var(--ag-cyan); vertical-align: -2px; }
.ag-live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ag-p1); margin-right: .35rem; vertical-align: 1px; }

/* --- Mur SOC (plein écran, menu masqué) --- */
body:has(.ag-wall) .fi-sidebar, body:has(.ag-wall) .fi-topbar, body:has(.ag-wall) .fi-header { display: none !important; }
body:has(.ag-wall) .fi-main { padding: 0 !important; max-width: none !important; }
body:has(.ag-wall) .fi-main-ctn { margin: 0 !important; }
.ag-wall { position: relative; min-height: 100vh; padding: 1.2rem 2rem 2rem; background: var(--ag-bg); color: var(--ag-txt); display: flex; flex-direction: column; gap: 1rem; }
.ag-wall:fullscreen { overflow: auto; }
.ag-wall-top { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.ag-wall-brand { font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: .9rem; }
.ag-wall-clock { font: 600 1rem ui-monospace, Consolas, monospace; color: var(--ag-mut); text-transform: capitalize; }
.ag-wall-nav { display: flex; gap: .4rem; }
.ag-wall-nav button, .ag-wall-nav a { font-weight: 600; font-size: .78rem; padding: .4rem .8rem; border-radius: 8px; border: 1px solid var(--ag-line); background: var(--ag-panel); color: var(--ag-txt); cursor: pointer; text-decoration: none; }
.ag-wall-nav .on { border-color: var(--ag-accent); background: color-mix(in srgb, var(--ag-accent) 18%, var(--ag-panel)); }
.ag-wall-view { flex: 1; display: flex; flex-direction: column; gap: 1.2rem; }
.ag-wall-h { margin: 0; font-size: 1.4rem; font-weight: 700; }
.ag-wall-grid { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2.5rem; align-items: center; }
.ag-wall-radar { display: grid; justify-items: center; gap: .6rem; }
.ag-wall-sub { font-size: .9rem; color: var(--ag-mut); }
.ag-wall-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.ag-wall-kpi { position: relative; padding: 1.2rem 1.4rem; border-radius: 16px; background: var(--ag-panel); border: 1px solid var(--ag-line); overflow: hidden; }
.ag-wall-kpi::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--c); }
.ag-wall-kpi span { font-size: .85rem; color: var(--ag-mut); text-transform: uppercase; letter-spacing: .06em; }
.ag-wall-kpi b { display: block; font-size: 3.4rem; font-weight: 800; color: var(--c); line-height: 1.1; font-variant-numeric: tabular-nums; }
.ag-wall-top5 { display: grid; gap: .5rem; }
.ag-wall-top5 div { display: flex; gap: .7rem; align-items: center; padding: .55rem .8rem; border-radius: 10px; background: var(--ag-panel); border: 1px solid var(--ag-line); font-size: 1rem; }
.ag-wall-top5 .ag-tag { width: 2.6rem; flex: none; }
.ag-wall-top5 em { margin-left: auto; font-style: normal; color: var(--ag-mut); font-size: .85rem; white-space: nowrap; }
.ag-wall .ag-map { min-height: 60vh; }
.ag-wall-feed { flex: 1; padding: 1rem 1.2rem; border-radius: 14px; border: 1px solid var(--ag-line); }
.ag-wall-feed .ag-feed { font-size: 1rem; }
.ag-wall-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--ag-track); }
.ag-wall-progress i { display: block; height: 100%; background: var(--ag-accent); width: 0; animation-duration: 20s; animation-timing-function: linear; animation-fill-mode: forwards; }
@keyframes agWallBarA { from { width: 0; } to { width: 100%; } }
@keyframes agWallBarB { from { width: 0; } to { width: 100%; } }
@media (max-width: 1000px) { .ag-wall-grid { grid-template-columns: 1fr; justify-items: center; } }

@media (prefers-reduced-motion: no-preference) {
  .ag-radar-sweep { animation: ag-spin 4s linear infinite; }
  .ag-echo { animation: ag-glow-sm 2s ease-in-out infinite; }
  .ag-glass::after { animation: ag-sheen 5s ease-in-out infinite; }
  .ag-blip::after { animation: ag-ping 2.4s ease-out infinite; }
  .ag-map-arc { animation: ag-dash 2.5s linear infinite; }
  .ag-feed-row { animation: ag-rise .4s both; animation-delay: calc(var(--i, 0) * 45ms); }
  .ag-caret, .ag-live-dot { animation: ag-blink 1.1s steps(1) infinite; }
  /* Compteur animé : le chiffre défile de 0 à sa valeur (navigateurs récents ; ailleurs, le chiffre reste affiché tel quel) */
  @supports (animation-timeline: auto) or (selector(:has(*))) {
    .ag-count { --ag-n: var(--n); counter-reset: agn var(--ag-n); font-size: 0 !important; animation: ag-count 1.1s cubic-bezier(.2, .7, .2, 1) both; }
    .ag-count::after { content: counter(agn); font-size: 2rem; }
    .ag-wall-kpi .ag-count::after { font-size: 3.4rem; }
  }
}
@keyframes ag-count { from { --ag-n: 0; } }
@keyframes ag-sheen { 0%, 65% { left: -70%; } 100% { left: 140%; } }
@keyframes ag-dash { to { stroke-dashoffset: -16; } }
@keyframes ag-blink { 50% { opacity: .15; } }

/* Tableaux ARGUS (registre, rapport) */
.ag-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.ag-table th { text-align: left; font-weight: 500; font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ag-mut); padding: .55rem .7rem; border-bottom: 1px solid var(--ag-line); }
.ag-table td { padding: .65rem .7rem; border-bottom: 1px solid var(--ag-line); vertical-align: top; }
.ag-table tr:hover td { background: color-mix(in srgb, var(--ag-accent) 5%, transparent); }

/* Rapport de direction (écran et impression) */
.ag-report { display: grid; gap: 1.6rem; max-width: 1100px; color: var(--ag-txt); }
.ag-report-tools { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.ag-report-head { display: flex; justify-content: space-between; gap: 1.5rem; align-items: center; padding: 1.4rem 1.6rem; border-radius: var(--ag-radius);
  background: linear-gradient(120deg, color-mix(in srgb, var(--ag-accent) 16%, var(--ag-panel)), var(--ag-panel) 60%); border: 1px solid var(--ag-line); }
.ag-report-kicker { font-size: .72rem; text-transform: uppercase; letter-spacing: .14em; color: var(--ag-accent); font-weight: 600; }
.ag-report-head h1 { margin: .3rem 0; font-size: 1.6rem; font-weight: 750; }
.ag-report-grade { text-align: right; flex: none; }
.ag-report-grade b { display: block; font-size: 3.2rem; line-height: 1; font-weight: 800; color: var(--c); }
.ag-report-grade span, .ag-report-grade small { display: block; color: var(--ag-mut); font-size: .8rem; }
.ag-report section h2 { margin: 0 0 .7rem; font-size: 1.05rem; font-weight: 700; padding-bottom: .35rem; border-bottom: 1px solid var(--ag-line); }
.ag-report-list { margin: 0; padding-left: 1.2rem; display: grid; gap: .35rem; font-size: .92rem; }
.ag-report-foot { font-size: .75rem; border-top: 1px solid var(--ag-line); padding-top: .8rem; }
@media print {
  .fi-sidebar, .fi-topbar, .fi-header, .ag-noprint, .ag-run, .ag-version { display: none !important; }
  .fi-main { padding: 0 !important; max-width: none !important; }
  body, .fi-body, .fi-main-ctn { background: #fff !important; background-image: none !important; }
  .ag-report { --ag-txt: #0f172a; --ag-mut: #475569; --ag-panel: #fff; --ag-panel2: #f1f5f9; --ag-line: #cbd5e1; --ag-track: #e2e8f0; color: #0f172a; max-width: none; }
  .ag-report * { box-shadow: none !important; animation: none !important; }
  .ag-report section { break-inside: avoid; }
}

/* Vérifier un mot de passe */
.ag-pwd { max-width: 820px; }
.ag-pwd-row { display: flex; gap: .5rem; flex-wrap: wrap; }
.ag-pwd-row .ag-an-input { flex: 1 1 280px; font-size: 1rem; }
.ag-pwd-result { display: flex; gap: 1.2rem; align-items: flex-start; margin-top: 1.2rem; padding: 1.1rem 1.2rem; border-radius: 12px; border: 1px solid var(--c); background: color-mix(in srgb, var(--c) 10%, transparent); }
.ag-pwd-result.bad { --c: var(--ag-p1); } .ag-pwd-result.ok { --c: var(--ag-ok); }
.ag-pwd-big { flex: none; min-width: 4.5rem; font-size: 2.2rem; font-weight: 800; color: var(--c); line-height: 1; font-variant-numeric: tabular-nums; }
.ag-pwd-result ul { margin: .5rem 0 0; padding-left: 1.1rem; display: grid; gap: .25rem; font-size: .88rem; }
[x-cloak] { display: none !important; }

/* Courbe de tendance : occupe toute la hauteur de sa carte (plus de vide sous le graphique) */
.ag-card.ag-chart { display: flex; flex-direction: column; }
.ag-chart svg { flex: 1; height: auto; min-height: 170px; }
.ag-chart .ag-empty { flex: 1; display: grid; place-items: center; }
/* Contrôles conformes repliés */
.ag-ctrl-more { width: 100%; font-size: .74rem; color: var(--ag-mut); }
.ag-ctrl-more summary { cursor: pointer; list-style: none; display: inline-flex; gap: .3rem; padding: .2rem .55rem; border-radius: 6px; border: 1px dashed var(--ag-line); }
.ag-ctrl-more summary::-webkit-details-marker { display: none; }
.ag-ctrl-more summary::before { content: "▸"; } .ag-ctrl-more[open] summary::before { content: "▾"; }

/* Référentiel */
.ag-ref-top { display: flex; justify-content: space-between; gap: .8rem; flex-wrap: wrap; align-items: center; }
.ag-ref-search { width: min(320px, 100%); font-family: inherit; }
.ag-fchip-alert span { background: var(--ag-p2) !important; color: #fff !important; }
.ag-ref-actions { white-space: nowrap; text-align: right; }
.ag-ref-actions button { font-size: .75rem; padding: .25rem .55rem; border-radius: 6px; border: 1px solid var(--ag-line); background: var(--ag-panel2); color: var(--ag-txt); cursor: pointer; margin-left: .25rem; }
.ag-ref-actions button:hover { border-color: var(--ag-accent); }
.ag-ref-edit { border-color: color-mix(in srgb, var(--ag-accent) 50%, var(--ag-line)); }
.ag-ref-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .8rem; }
.ag-ref-form label { display: grid; gap: .3rem; font-size: .78rem; color: var(--ag-mut); }
.ag-ref-form .ag-an-input { font-family: inherit; font-size: .85rem; padding: .5rem .7rem; }
.ag-ref-pending { display: flex; justify-content: space-between; gap: 1rem; align-items: center; flex-wrap: wrap; padding: .7rem 0; border-bottom: 1px solid var(--ag-line); }

.ag-btn-danger { color: var(--ag-p1); border-color: color-mix(in srgb, var(--ag-p1) 40%, var(--ag-line)); }
.ag-btn-danger:hover { background: color-mix(in srgb, var(--ag-p1) 12%, var(--ag-panel)); border-color: var(--ag-p1); }

/* Rapport : graphiques d'évolution vulgarisés */
.ag-rgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.ag-rpanel { padding: 1rem 1.1rem; border-radius: 12px; border: 1px solid var(--ag-line); background: var(--ag-panel); break-inside: avoid; }
.ag-rpanel h3 { margin: 0 0 .5rem; font-size: .92rem; font-weight: 650; }
.ag-rwide { grid-column: 1 / -1; }
.ag-rrow { display: flex; gap: 1rem; align-items: center; }
.ag-rchart { width: 100%; height: auto; display: block; }
.ag-rdonut { width: 130px; height: 130px; flex: none; }
.ag-rc-lbl { font-size: 11px; fill: var(--ag-mut); }
.ag-rc-val { font-size: 13px; font-weight: 700; fill: var(--ag-accent); }
.ag-rc-big { font-size: 22px; font-weight: 800; fill: var(--ag-txt); }
.ag-rplain { margin: .55rem 0 0; font-size: .84rem; line-height: 1.5; color: var(--ag-txt); }
.ag-rplain b:first-child { color: var(--ag-accent); }
.ag-rbars { display: grid; gap: .45rem; }
.ag-rbar { display: grid; grid-template-columns: minmax(0, 11rem) 1fr 3.4rem; gap: .6rem; align-items: center; font-size: .8rem; }
.ag-rbar span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-rbar i { height: 10px; border-radius: 6px; background: var(--ag-track); overflow: hidden; }
.ag-rbar i b { display: block; height: 100%; border-radius: 6px; }
.ag-rbar em { font-style: normal; text-align: right; color: var(--ag-mut); font-variant-numeric: tabular-nums; }
@media (max-width: 900px) { .ag-rgrid { grid-template-columns: 1fr; } }
@media print { .ag-rgrid { grid-template-columns: 1fr 1fr; } .ag-rpanel { background: #fff !important; } }

/* Carte des menaces : vrais contours (Natural Earth) */
.ag-country { fill: color-mix(in srgb, var(--ag-mut) 22%, var(--ag-panel)); stroke: var(--ag-panel); stroke-width: .5; transition: fill .2s; }
.ag-country:hover { fill: color-mix(in srgb, var(--ag-mut) 40%, var(--ag-panel)); }
.ag-country-hq { fill: color-mix(in srgb, var(--ag-accent) 55%, var(--ag-panel)); }
.ag-country-warn { fill: color-mix(in srgb, var(--ag-p2) 45%, var(--ag-panel)); }
.ag-country-crit { fill: color-mix(in srgb, var(--ag-p1) 50%, var(--ag-panel)); }
.ag-map-grid line { stroke: var(--ag-line); stroke-width: .5; opacity: .5; }
/* Le cadre garde les proportions de la carte (720 x 300) : les pastilles restent exactement sur leur pays */
.ag-map { flex: none; min-height: 0; width: 100%; aspect-ratio: 720 / 300; align-self: center; }
.ag-fixed .ag-map { margin-block: auto; }
.ag-wall .ag-map { min-height: 0; width: min(100%, calc(68vh * 2.4)); margin-inline: auto; }

/* Tableaux triables / filtrables */
.ag-table th.ag-sortable { cursor: pointer; user-select: none; }
.ag-table th.ag-sortable::after { content: ' ↕'; opacity: .35; font-size: .75em; }
.ag-table th[data-dir="asc"]::after { content: ' ▲'; opacity: .9; }
.ag-table th[data-dir="desc"]::after { content: ' ▼'; opacity: .9; }
.ag-table tr.ag-tfilter th { padding-top: 0; }
.ag-table tr.ag-tfilter input { width: 100%; min-width: 4.5rem; font-size: .75rem; padding: .2rem .4rem; border-radius: 6px; border: 1px solid rgba(148,163,184,.25); background: var(--ag-panel2); color: inherit; }

/* Arrêt d'une analyse */
.ag-run { display: flex; align-items: center; gap: .35rem; }
.ag-run-stop { width: 1.9rem; height: 1.9rem; border-radius: 999px; border: 1px solid rgba(239,68,68,.45); background: rgba(239,68,68,.12); color: #f87171; font-size: .7rem; cursor: pointer; }
.ag-run-stop:hover { background: rgba(239,68,68,.25); }
.ag-run-stop:disabled { opacity: .5; cursor: wait; }
.ag-btn-stop { border-color: rgba(239,68,68,.45) !important; color: #f87171 !important; }

/* Cellules éditables (référentiel façon tableur) */
.ag-cell { width: 100%; min-width: 7rem; background: transparent; border: 1px solid transparent; border-radius: 6px; padding: .25rem .4rem; color: inherit; font: inherit; font-size: .82rem; }
.ag-cell:hover { border-color: rgba(148,163,184,.3); }
.ag-cell:focus { outline: none; border-color: var(--ag-accent); background: var(--ag-panel2); }
select.ag-cell option { background: var(--ag-panel); color: var(--ag-txt); }
.ag-cell-check { width: 1rem; height: 1rem; cursor: pointer; accent-color: var(--ag-accent); }

/* Référentiel : tableau large défilant horizontalement, champs à la taille de leur contenu */
.ag-tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.ag-tablewrap .ag-table { min-width: max-content; }
.ag-tablewrap .ag-table td { vertical-align: middle; }
.ag-cell { field-sizing: content; min-width: 6rem; max-width: 22rem; width: auto; }
select.ag-cell { min-width: 8rem; max-width: 16rem; }
.ag-cell::placeholder { color: var(--ag-mut); opacity: .45; font-style: italic; }
.ag-cell:placeholder-shown { border-style: dashed; border-color: rgba(148,163,184,.18); }
.ag-table tr.ag-tfilter input { min-width: 5rem; max-width: 12rem; }
/* Colonne d'actions toujours visible à droite */
.ag-tablewrap .ag-ref-actions { position: sticky; right: 0; background: var(--ag-panel); white-space: nowrap; box-shadow: -8px 0 8px -8px rgba(0,0,0,.5); }
.ag-tablewrap thead th:last-child { position: sticky; right: 0; background: var(--ag-panel); }

/* Case à cocher du formulaire : sur la ligne des champs, case et libellé côte à côte */
.ag-ref-form label.ag-ref-check { display: flex; align-items: center; gap: .55rem; align-self: end; min-height: 2.45rem;
  padding: 0 .75rem; border: 1px solid var(--ag-line); border-radius: 10px; background: var(--ag-panel2); color: var(--ag-txt); font-size: .85rem; cursor: pointer; }
.ag-ref-form label.ag-ref-check input { width: 1.05rem; height: 1.05rem; margin: 0; accent-color: var(--ag-accent); cursor: pointer; }

/* À valider : bloc des familles de sous-domaines (traitement groupé) */
.ag-ref-families { margin-bottom: 1rem; padding: .8rem; border: 1px dashed color-mix(in srgb, var(--ag-accent) 45%, transparent); border-radius: 12px; background: color-mix(in srgb, var(--ag-accent) 6%, transparent); }

/* Exposition & impact */
.ag-h4 { margin: 1.1rem 0 .5rem; font-size: .82rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--ag-accent); }
.ag-list { margin: .3rem 0 .6rem; padding-left: 1.1rem; display: grid; gap: .3rem; font-size: .88rem; }

/* Module partiel : explication */
.ag-modcard-partial { margin: .5rem 0 .2rem; font-size: .78rem; border: 1px solid color-mix(in srgb, var(--ag-warn) 45%, transparent); background: color-mix(in srgb, var(--ag-warn) 8%, transparent); border-radius: 10px; padding: .4rem .6rem; }
.ag-modcard-partial summary { cursor: pointer; color: var(--ag-warn); font-weight: 600; }
.ag-modcard-partial ul { margin: .35rem 0 .2rem; padding-left: 1rem; }
.ag-modcard-partial p { margin: .2rem 0 0; color: var(--ag-mut); }

/* Règle de couverture d'un module (rotation) */
.ag-modcard-cov { margin: .35rem 0 0; font-size: .74rem; line-height: 1.35; color: var(--ag-mut); border-left: 2px solid var(--ag-accent); padding-left: .5rem; }

/* Cartes de modules de taille identique : grille à lignes égales, contenus variables bornés */
.ag-modgrid { grid-auto-rows: 1fr; }
.ag-modcard { height: 100%; min-height: 0; }
.ag-modcard-cov { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; min-height: 3.1rem; }
.ag-modcard-err { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ag-modcard-stats { min-height: 5.6rem; max-height: 5.6rem; overflow: hidden; }
.ag-modcard-partial:not([open]) { padding-block: .25rem; }

/* Barres de défilement « discrètes » : 4 px, visibles seulement au survol de la zone qui défile */
* { scrollbar-width: thin; scrollbar-color: transparent transparent; }
*:hover { scrollbar-color: rgba(148, 163, 184, .38) transparent; }
*::-webkit-scrollbar { width: 4px; height: 4px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: transparent; border-radius: 4px; }
*:hover::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, .38); }
*::-webkit-scrollbar-thumb:hover { background: rgba(148, 163, 184, .6); }
*::-webkit-scrollbar-button { display: none; height: 0; width: 0; }
html { scrollbar-color: rgba(148, 163, 184, .32) transparent; }

/* Menu latéral plus compact : tient à l'écran sans défilement sur un portable */
.fi-sidebar-nav { row-gap: .9rem; padding-block: .75rem; }
.fi-sidebar-group-label { font-size: .68rem; }
.fi-sidebar-item-button { padding-block: .38rem; }
.fi-sidebar-group-items { row-gap: .1rem; }

/* Cartes de modules : structure fixe et lisible (v2) */
.ag-modgrid { grid-auto-rows: auto; }
.ag-modcard { height: auto; }
.ag-modcard-desc { min-height: 2.35rem; }
.ag-modcard-cov { display: block; -webkit-line-clamp: unset; min-height: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-size: .76rem; color: var(--ag-txt); border-left: 2px solid var(--ag-accent); padding-left: .5rem; margin: 0; cursor: help; }
.ag-modcard-cov span { color: var(--ag-mut); margin-right: .25rem; }
.ag-modcard-alerts { min-height: 1.6rem; align-items: center; }
.ag-modcard-stats { min-height: 0; max-height: none; overflow: visible; grid-template-rows: auto auto; height: 5.4rem; align-content: start; }
.ag-modcard-stats > div { min-width: 0; }
.ag-modcard-stats span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-modcard-stats b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.35; }

/* Page Modules : familles */
.ag-modcat { display: flex; flex-wrap: wrap; align-items: baseline; gap: .35rem .8rem; margin: 1.6rem 0 .7rem; padding-bottom: .45rem; border-bottom: 1px solid var(--ag-line); }
.ag-modcat:first-child { margin-top: .4rem; }
.ag-modcat h3 { margin: 0; font-size: .95rem; font-weight: 650; color: var(--ag-txt); }
.ag-modcat span { font-size: .8rem; color: var(--ag-mut); flex: 1; min-width: 14rem; }
.ag-modcat em { font-style: normal; font-size: .75rem; color: var(--ag-mut); white-space: nowrap; }
.ag-modcat em b { color: var(--ag-p2); }

/* Fiche d'alerte : CVE */
.ag-fd-cve-k { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: .6rem; }
.ag-fd-cve-k span { display: block; font-size: .72rem; color: var(--ag-mut); }
.ag-fd-cve-k b { font-size: 1.15rem; }
.ag-fd-cve-k small { display: block; font-size: .7rem; color: var(--ag-mut); }
