/* Activo Connect — outil interne, direction sobre & professionnelle (consulting/data) */
:root {
  --bg:        #f3f5fa;   /* off-white teinté bleu, jamais blanc pur */
  --surface:   #ffffff;
  --ink:       #1b2540;   /* navy profond, jamais noir pur */
  --navy:      #141d36;
  --muted:     #6a7490;
  --line:      #e3e7f1;   /* filet */
  --line-soft: #eef1f7;
  --accent:    #2f56b0;   /* bleu affirmé (pas de cyan-glow) */
  --accent-d:  #24468f;
  --ok:   #1c7c4a; --warn: #9a6800; --bad: #c0392b; --info: #2f56b0;
  --cat-taxo: #2f56b0; --cat-auto: #2a8a8a; --cat-qual: #b07515; --cat-gouv: #6a4fbf;
  --shadow: 0 1px 2px rgba(20,29,60,.05), 0 1px 1px rgba(20,29,60,.03);
  --shadow-lg: 0 10px 30px rgba(20,29,60,.08);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100vh; }
body {
  font: 15px/1.6 "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg); color: var(--ink); display: flex; flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
::selection { background: #d6e0f7; }

/* Barre haute */
.topbar {
  display: flex; align-items: center; gap: 30px;
  background: var(--surface); border-bottom: 1px solid var(--line);
  padding: 0 28px; min-height: 58px;
}
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; }
.brand img { height: 26px; width: auto; display: block; }
.brand .word { font-size: 17px; font-weight: 700; color: var(--navy); letter-spacing: -.01em; }
.brand .word b { font-weight: 700; color: var(--navy); }   /* wordmark plein, pas de dégradé */
.topbar nav { display: flex; gap: 2px; flex: 1; }
.topbar nav a {
  color: var(--ink); text-decoration: none; padding: 7px 12px; border-radius: 7px;
  font-size: 14px; font-weight: 500;
}
.topbar nav a:hover { background: var(--line-soft); color: var(--accent-d); }
.logout { display: flex; align-items: center; gap: 13px; margin: 0; }
.logout .who { color: var(--muted); font-size: 13px; }

/* Page & rythme */
.page { flex: 1; width: 100%; max-width: 1160px; margin: 0 auto; padding: 34px 26px 60px; }
.page.centered { display: flex; align-items: center; justify-content: center; }
.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 18px; letter-spacing: .01em; }
h1 { font-size: clamp(23px, 2.4vw, 29px); margin: 4px 0 6px; color: var(--navy); font-weight: 700; letter-spacing: -.02em; }
h2 { font-size: 16px; margin: 34px 0 14px; color: var(--navy); font-weight: 650;
     text-transform: uppercase; letter-spacing: .06em; }
h2 .muted { text-transform: none; letter-spacing: 0; font-weight: 400; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
a { color: var(--accent-d); text-underline-offset: 2px; }
.crumb { margin: 0 0 10px; font-size: 13px; }
.crumb a { text-decoration: none; color: var(--muted); }
.crumb a:hover { color: var(--accent-d); }

/* Surfaces */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 22px 24px; box-shadow: var(--shadow);
}
.cards { display: flex; gap: 20px; margin: 20px 0 4px; flex-wrap: wrap; }
.card.stat { min-width: 180px; padding: 20px 22px; }
.card.stat .big { font-size: 30px; font-weight: 700; color: var(--navy); letter-spacing: -.02em; }
.card.stat > div:last-child { color: var(--muted); font-size: 13px; margin-top: 2px; }
.card.stat.soon .big { color: var(--muted); font-size: 18px; font-weight: 600; }

/* Bandeau génération */
.genbar {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  margin: 22px 0; flex-wrap: wrap; background: var(--surface); border-color: var(--line);
}
.genbar strong { color: var(--navy); font-size: 15px; font-weight: 650; }
.genbar p { margin: 3px 0 0; }

/* Auth */
.card.auth { width: 384px; max-width: 94vw; padding: 30px 30px 28px; box-shadow: var(--shadow-lg); }
.card.auth.wide-card { width: 560px; }
.auth-logo { display: block; height: 40px; margin: 0 0 20px; }
.card.auth h1 { margin-top: 0; font-size: 22px; }
.enroll { display: flex; gap: 24px; align-items: center; margin: 16px 0; flex-wrap: wrap; }
.qr { background: #fff; padding: 10px; border: 1px solid var(--line); border-radius: 8px; }
.manual { flex: 1; min-width: 220px; }
.secret {
  display: block; background: var(--line-soft); border: 1px solid var(--line); border-radius: 7px;
  padding: 9px 11px; font-size: 14.5px; letter-spacing: 1px; word-break: break-all; color: var(--navy);
}
.totp-input { font-size: 23px; letter-spacing: 9px; text-align: center; font-weight: 600; }

/* Formulaires */
label { display: block; margin: 14px 0 5px; font-weight: 600; font-size: 12.5px; color: var(--navy);
        letter-spacing: .01em; }
input, select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  font: inherit; background: #fff; color: var(--ink);
}
input::placeholder { color: #a6adc2; }
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
.btn {
  display: inline-block; border: 1px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 8px; padding: 9px 15px; font: inherit; font-size: 14px; font-weight: 550;
  cursor: pointer; text-decoration: none; transition: background .12s, border-color .12s, color .12s;
}
.btn:hover { border-color: #c9d2e6; background: #fbfcfe; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn.primary:hover { background: var(--accent-d); border-color: var(--accent-d); color: #fff; }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--muted); }
.btn.small { padding: 5px 11px; font-size: 12.5px; }
.btn.wide { width: 100%; margin-top: 18px; padding: 11px; }
button:disabled, .btn[disabled] { opacity: .5; cursor: not-allowed; }
form.inline { display: inline; }

/* Tables */
.tablewrap { overflow-x: auto; }   /* une table large défile dans son cadre, jamais la page */
table.list { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
table.list td { vertical-align: top; }
/* la césure agressive UNIQUEMENT sur les contenus libres (tracebacks, chemins) —
   jamais sur les emails/badges, sinon ils se coupent lettre à lettre */
table.list td.detail { max-width: 460px; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }

/* Filtre rapide côté client (tables admin) */
.quickfilter { max-width: 300px; margin: 0 0 10px; padding: 8px 12px; }

/* Barre de filtres (audit) */
.filterbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 0 0 14px; }
.filterbar input, .filterbar select { width: auto; min-width: 160px; padding: 8px 11px; font-size: 13.5px; }

/* Pagination */
.pager { display: flex; align-items: center; gap: 14px; margin: 14px 0 0; font-size: 13.5px; }
.pager .count { color: var(--muted); margin-left: auto; }
table.list th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--muted); background: #f7f9fd; padding: 11px 14px; border-bottom: 1px solid var(--line); font-weight: 650;
}
table.list td { padding: 12px 14px; border-bottom: 1px solid var(--line-soft); }
table.list tr:last-child td { border-bottom: none; }
table.list tr:hover td { background: #fafbfe; }
td.actions { white-space: nowrap; }
td.actions form, td.actions a { margin-right: 5px; }
code { background: var(--line-soft); padding: 1px 6px; border-radius: 5px; font-size: 12.5px; color: var(--navy); }

/* Badges & flashes */
.ok-badge, .off-badge, .warn-badge {
  font-size: 11.5px; padding: 2px 9px; border-radius: 5px; font-weight: 600; letter-spacing: .01em;
  white-space: nowrap;
}
.ok-badge { background: #e3f2e9; color: var(--ok); }
.off-badge { background: #f7e5e2; color: var(--bad); }
.warn-badge { background: #f6efd8; color: var(--warn); }
.flash { border-radius: 8px; padding: 12px 15px; margin: 0 0 18px; font-size: 14px; border: 1px solid; }
.flash.error { background: #fbeae7; color: var(--bad); border-color: #f0d4cf; }
.flash.ok { background: #e6f3ec; color: var(--ok); border-color: #cde7d7; }

/* KPI santé — chiffre plein, couleur sémantique (pas de dégradé, pas de bord latéral) */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(184px, 1fr)); gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.kpi { background: var(--surface); padding: 18px 18px 16px; }
.kpi-val { font-size: 25px; font-weight: 700; color: var(--navy); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi-label { font-size: 13px; font-weight: 600; color: var(--ink); margin-top: 3px; }
.kpi-note { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.kpi-good .kpi-val { color: var(--ok); }
.kpi-warn .kpi-val { color: var(--warn); }
.kpi-bad  .kpi-val { color: var(--bad); }
.kpi-info .kpi-val { color: var(--info); }
.kpi-na .kpi-val { color: var(--muted); }
.kpi-soon { background: #f7f9fd; }
.kpi-soon .kpi-val { color: var(--muted); font-size: 15px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.kpi-off { background: #fbf5f2; }
.kpi-off .kpi-val { color: var(--bad); font-size: 15px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; }

/* Bandeau « module manquant » (ex. Advanced Analytics non détenu) — visible, sobre */
.modband { background: #fdf6ec; border: 1px solid #ecd9b4; border-radius: 10px;
  padding: 16px 20px; margin: 4px 0 20px; }
.modband .kicker { display: inline-block; font-size: 11px; font-weight: 700;
  letter-spacing: .09em; text-transform: uppercase; color: var(--warn); margin-bottom: 6px; }
.modband strong { display: block; color: var(--navy); font-size: 15.5px; margin-bottom: 4px; }
.modband p { margin: 0; color: #7a6c4e; font-size: 13.5px; line-height: 1.55; }

/* Livrables : classeur maître (accent typographique, pas d'emoji) */
.master-card { display: flex; align-items: center; gap: 20px; margin: 6px 0 22px; }
.master-card .mc-icon {
  flex: none; width: 44px; height: 44px; border-radius: 9px; background: var(--navy); color: #fff;
  display: grid; place-items: center; font-size: 12px; font-weight: 700; letter-spacing: .06em;
}
.master-card .mc-body { flex: 1; }
.master-card strong { color: var(--navy); font-size: 16px; font-weight: 650; }

/* Cartes catégories — filet de tête coloré, libellé, pas d'emoji */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(244px, 1fr)); gap: 16px; }
.cat-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px 18px;
  box-shadow: var(--shadow); display: flex; flex-direction: column; border-top: 2px solid var(--accent);
}
.cat-taxonomie { border-top-color: var(--cat-taxo); }
.cat-automatisations { border-top-color: var(--cat-auto); }
.cat-qualite { border-top-color: var(--cat-qual); }
.cat-gouvernance { border-top-color: var(--cat-gouv); }
.cat-head { font-weight: 650; color: var(--navy); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; display: flex; align-items: center; gap: 8px; }
.cat-head::before { content: ""; width: 7px; height: 7px; border-radius: 2px; background: var(--accent); }
.cat-taxonomie .cat-head::before { background: var(--cat-taxo); }
.cat-automatisations .cat-head::before { background: var(--cat-auto); }
.cat-qualite .cat-head::before { background: var(--cat-qual); }
.cat-gouvernance .cat-head::before { background: var(--cat-gouv); }
.cat-sheets { list-style: none; padding: 0; margin: 13px 0 16px; flex: 1; }
.cat-sheets li { font-size: 13px; color: var(--ink); padding: 5px 0; border-bottom: 1px solid var(--line-soft); }
.cat-sheets li:last-child { border-bottom: none; }
.cat-card .btn { align-self: flex-start; }

/* Fil d'Ariane / crumb déjà défini plus haut */

/* Hub clients */
.hub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(288px, 1fr)); gap: 16px; margin-top: 12px; }
.hub-card {
  display: flex; flex-direction: column; gap: 9px; text-decoration: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 20px 22px;
  box-shadow: var(--shadow); transition: border-color .12s, box-shadow .12s;
}
.hub-card:hover { border-color: #c9d2e6; box-shadow: var(--shadow-lg); }
.hub-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.hub-name { font-weight: 650; color: var(--navy); font-size: 16.5px; letter-spacing: -.01em; }
.hub-meta { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12.5px; color: var(--muted); }
.hub-cta { display: flex; align-items: center; justify-content: space-between; margin-top: 3px; }
.hub-arrow { color: var(--accent-d); font-weight: 600; font-size: 13px; }

/* Sélection d'analyses (generer) */
.sel-actions { display: flex; align-items: center; gap: 10px; margin: 18px 0 10px; }
.sel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(228px, 1fr)); gap: 14px; margin-bottom: 6px; }
.sel-cat { border: 1px solid var(--line); border-radius: 9px; padding: 8px 14px 12px; border-top: 2px solid var(--accent); }
.sel-cat.cat-taxonomie { border-top-color: var(--cat-taxo); }
.sel-cat.cat-automatisations { border-top-color: var(--cat-auto); }
.sel-cat.cat-qualite { border-top-color: var(--cat-qual); }
.sel-cat.cat-gouvernance { border-top-color: var(--cat-gouv); }
.sel-cat legend { font-weight: 650; color: var(--navy); font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; padding: 0 4px; }
.chk { display: flex; align-items: center; gap: 8px; margin: 7px 0; font-weight: 450; font-size: 13.5px; color: var(--ink); cursor: pointer; }
.chk input { width: auto; }
.chk .dep { color: var(--muted); font-style: normal; font-size: 11.5px; }
.chk.locked { color: var(--muted); }

/* Progression */
.jobstate { display: flex; align-items: center; gap: 12px; font-size: 15.5px; margin: 18px 0 10px; color: var(--navy); }
.jobpct { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13.5px; font-weight: 600; }
.spinner { width: 20px; height: 20px; border: 2.5px solid var(--line); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
/* Barre de progression — % réel, avec un reflet animé pour ne jamais paraître figée */
.progressbar { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; }
.progressbar > span { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 999px;
  transition: width .55s cubic-bezier(.22,.61,.36,1); position: relative; }
.progressbar > span::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.4), transparent);
  background-size: 45% 100%; background-repeat: no-repeat; animation: barsheen 1.15s linear infinite; }
@keyframes barsheen { from { background-position: -45% 0; } to { background-position: 145% 0; } }

/* Deux colonnes admin */
.two-col { display: grid; grid-template-columns: 1fr 344px; gap: 24px; align-items: start; }
.two-col > section { min-width: 0; }  /* la table défile dans son cadre au lieu d'écraser les colonnes */
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }
@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; padding: 9px 16px; min-height: 0; gap: 8px 16px; }
  .topbar nav { order: 3; flex-basis: 100%; overflow-x: auto; gap: 0; }
  .topbar nav a { padding: 6px 10px; white-space: nowrap; }
  .logout { margin-left: auto; }
  .page { padding: 22px 16px 48px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
