/* ==========================================================================
   NavOps — design system
   Direction « soft SaaS » : cartes arrondies, ombres douces, contrôles en pilules.
   Toute couleur sémantique passe par un token, pour que le thème sombre fonctionne
   partout. Seules les couleurs d'identité (logos fournisseurs) restent en hex.
   Référence : docs/05-design-system.md
   ========================================================================== */

:root {
  color-scheme: light;

  --bg: #f7faf9;
  --surface: #ffffff;
  --surface-2: #f1f6f4;
  --ink: #0f1b17;
  --ink-soft: #5c6b64;
  --ink-mute: #94a39b;
  --line: #e4ede9;
  --line-soft: #eef4f1;
  --accent: #10b981;
  --accent-2: #0ea5a4;
  --accent-soft: #d9f3e8;
  --accent-ink: #0a7d5a;
  --info: #6366f1;
  --info-soft: #e8e8fc;
  --warn: #f59e0b;
  --warn-soft: #fdf0d5;
  --neg: #f43f5e;
  --neg-soft: #fde3e9;
  --pos: #10b981;
  --pos-soft: #d9f3e8;
  --plum: #a855c7;
  --plum-soft: #f3e6fb;
  --neutral: #94a39b;
  --neutral-soft: #f1f6f4;

  --sans: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --sh: 0 1px 2px rgba(16, 40, 32, .05), 0 16px 32px -22px rgba(16, 40, 32, .28);
  --sh-rail: 0 0 0 1px var(--line), 24px 0 48px -24px rgba(16, 40, 32, .4);
  --sh-card: 0 1px 2px rgba(16, 40, 32, .04), 0 10px 20px -16px rgba(16, 40, 32, .4);
  --r: 20px;
  --rail-w: 84px;
  --rail-open-w: 256px;
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --bg: #0e1613;
  --surface: #151f1b;
  --surface-2: #1b2723;
  --ink: #eaf2ee;
  --ink-soft: #9fb0a8;
  --ink-mute: #6f8078;
  --line: #26332e;
  --line-soft: #1e2b26;
  --accent: #10b981;
  --accent-2: #2dd4bf;
  --accent-soft: #123528;
  --accent-ink: #4ade9f;
  --info: #818cf8;
  --info-soft: #23264a;
  --warn: #fbbf24;
  --warn-soft: #3a2f16;
  --neg: #fb7185;
  --neg-soft: #3a1f27;
  --pos: #34d399;
  --pos-soft: #123528;
  --plum: #c084fc;
  --plum-soft: #2c1f3a;
  --neutral: #6f8078;
  --neutral-soft: #1b2723;

  --sh: 0 1px 2px rgba(0, 0, 0, .3), 0 18px 34px -20px rgba(0, 0, 0, .65);
  --sh-rail: 0 0 0 1px var(--line), 24px 0 48px -20px rgba(0, 0, 0, .7);
  --sh-card: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 24px -18px rgba(0, 0, 0, .7);
}

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-ink); text-decoration: none; }
a:hover { color: var(--accent); }

:where(button, a, input, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.num { font-variant-numeric: tabular-nums; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}

/* --------------------------------------------------------------- coquille */

.app { display: grid; grid-template-columns: var(--rail-w) 1fr; position: relative; min-height: 100vh; }

.main { grid-column: 2; padding: 30px 36px 44px; min-width: 0; }

/* ------------------------------------------------- menu latéral (rail) */

.side {
  position: fixed; top: 0; left: 0; height: 100vh; width: var(--rail-w);
  overflow: hidden; z-index: 30;
  background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 22px 16px;
  transition: width .22s cubic-bezier(.4, 0, .2, 1), box-shadow .22s;
}
.side:hover, .side:focus-within { width: var(--rail-open-w); box-shadow: var(--sh-rail); }

.brand { display: flex; align-items: center; gap: 13px; padding: 4px 6px 22px; }
.bmark {
  width: 44px; height: 44px; border-radius: 13px; flex: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 18px -7px var(--accent);
}
.brand .bt { opacity: 0; white-space: nowrap; transition: opacity .16s; }
.side:hover .brand .bt, .side:focus-within .brand .bt { opacity: 1; }
.brand b { display: block; font-size: 18px; font-weight: 800; letter-spacing: -.3px; color: var(--ink); }
.brand span {
  font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-mute); font-weight: 700;
}

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a {
  display: flex; align-items: center; gap: 15px; padding: 12px; border-radius: 13px;
  color: var(--ink-soft); font-size: 14px; font-weight: 600; white-space: nowrap;
}
.nav a svg { flex: none; width: 22px; height: 22px; color: var(--ink-mute); }
.nav a .t { opacity: 0; transition: opacity .16s; }
.side:hover .nav a .t, .side:focus-within .nav a .t { opacity: 1; }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a.active { background: var(--accent-soft); color: var(--accent-ink); }
.nav a.active svg { color: var(--accent-ink); }

.navlab {
  font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-mute); margin: 18px 12px 7px; font-weight: 700;
  white-space: nowrap; opacity: 0; transition: opacity .16s;
}
.side:hover .navlab, .side:focus-within .navlab { opacity: 1; }

.side-foot {
  margin-top: auto; border-top: 1px solid var(--line); padding-top: 14px;
  display: flex; align-items: center; gap: 12px; white-space: nowrap;
}
.avatar {
  width: 44px; height: 44px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 14px;
}
.side-foot .ft { opacity: 0; transition: opacity .16s; }
.side:hover .side-foot .ft, .side:focus-within .side-foot .ft { opacity: 1; }
.side-foot b { display: block; color: var(--ink); font-size: 13.5px; font-weight: 700; }
.side-foot small { display: block; color: var(--ink-mute); font-size: 11px; }

/* ------------------------------------------------------------ en-tête */

.topbar {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 22px; flex-wrap: wrap;
}
.h-title { font-size: 28px; font-weight: 800; letter-spacing: -.7px; margin: 0; color: var(--ink); }
.h-sub { color: var(--ink-soft); font-size: 14px; margin: 5px 0 0; font-weight: 500; }
.h-sub strong { color: var(--ink); }
.ctrls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.ctrls.baseline { align-items: flex-end; }

.peri-lab {
  font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-mute); margin: 0 0 7px 4px; text-align: right;
}

/* ------------------------------------------------------- contrôles */

.seg, .seg2, .pillbar {
  display: inline-flex; background: var(--surface); border: 1px solid var(--line);
  border-radius: 100px; box-shadow: var(--sh);
}
.seg { gap: 5px; padding: 5px; }
.seg2 { padding: 4px; }
.pillbar { gap: 4px; padding: 5px; flex-wrap: wrap; }

.seg button, .seg2 button, .pillbar button {
  border: none; background: transparent; border-radius: 100px; cursor: pointer;
  font-family: var(--sans); color: var(--ink-soft);
}
.seg button { padding: 9px 15px; font-size: 13px; font-weight: 700; }
.seg button:hover, .pillbar button:hover { color: var(--ink); }
.seg button.on { background: var(--accent); color: #fff; box-shadow: 0 6px 14px -6px var(--accent); }
.seg button .yb { display: block; font-size: 9px; font-weight: 700; opacity: .7; margin-top: 1px; }

.seg2 button { padding: 8px 12px; font-size: 12px; font-weight: 800; }
.seg2 button.on { background: var(--accent); color: #fff; }

.pillbar button { padding: 10px 17px; font-size: 13.5px; font-weight: 700; }
.pillbar button.on { background: var(--accent-soft); color: var(--accent-ink); }

.chip {
  border: none; background: transparent; border-radius: 100px; padding: 9px 15px;
  font-size: 12.5px; font-weight: 700; color: var(--ink-soft); cursor: pointer; font-family: var(--sans);
}
.chip:hover { color: var(--ink); }
.chip.on { background: var(--accent); color: #fff; box-shadow: 0 6px 14px -6px var(--accent); }

.tbtn {
  width: 40px; height: 40px; border-radius: 100px; border: 1px solid var(--line);
  background: var(--surface); box-shadow: var(--sh); cursor: pointer;
  display: flex; align-items: center; justify-content: center; color: var(--ink-soft);
}
.tbtn:hover { color: var(--accent-ink); border-color: var(--accent); }

.btn-add {
  display: flex; align-items: center; gap: 8px; background: var(--accent); color: #fff;
  border: none; border-radius: 13px; padding: 12px 18px; font-size: 13.5px; font-weight: 700;
  cursor: pointer; font-family: var(--sans); box-shadow: 0 10px 22px -10px var(--accent);
}
.btn-add:hover { filter: brightness(.96); }

.fchip {
  border: 1px solid var(--line); background: var(--surface); border-radius: 100px;
  padding: 8px 15px; font-size: 12.5px; font-weight: 700; color: var(--ink-soft);
  cursor: pointer; font-family: var(--sans); display: inline-flex; align-items: center; gap: 7px;
}
.fchip:hover { border-color: var(--accent); }
.fchip.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.fchip .cnt {
  background: var(--surface-2); color: var(--ink-soft); border-radius: 100px;
  padding: 1px 8px; font-size: 11px;
}
.fchip.on .cnt { background: var(--accent); color: #fff; }

.search {
  display: flex; align-items: center; gap: 8px; border: 1px solid var(--line);
  background: var(--surface-2); border-radius: 11px; padding: 0 13px;
  color: var(--ink-mute); width: 250px;
}
.search svg { flex: none; }
.search input {
  border: none; background: transparent; outline: none; font-family: var(--sans);
  font-size: 13px; color: var(--ink); padding: 10px 0; width: 100%;
}
.search input::placeholder { color: var(--ink-mute); }

/* ----------------------------------------------------------- cartes */

.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 22px 24px; box-shadow: var(--sh);
}
.panel.table-panel { padding: 8px 26px 14px; }
.p-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.p-h h3 { font-size: 16.5px; font-weight: 800; letter-spacing: -.3px; margin: 0; color: var(--ink); }
.p-h .lnk { font-size: 12.5px; font-weight: 700; }
.p-h .meta { font-size: 12px; color: var(--ink-soft); font-weight: 600; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-bottom: 20px; }
.kpi {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 20px 22px; box-shadow: var(--sh);
}
.kpi .lab {
  display: flex; align-items: center; gap: 10px; color: var(--ink-soft);
  font-size: 12.5px; font-weight: 700; margin-bottom: 15px;
}
.kpi .ic { width: 34px; height: 34px; border-radius: 11px; flex: none; display: flex; align-items: center; justify-content: center; }
.kpi .val { font-size: 31px; font-weight: 800; letter-spacing: -1px; font-variant-numeric: tabular-nums; color: var(--ink); }
.kpi .foot { font-size: 12.5px; margin-top: 9px; display: flex; align-items: center; gap: 7px; color: var(--ink-soft); font-weight: 500; }

.stat3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-bottom: 22px; }
.stat4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-bottom: 22px; }
.st {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 18px 22px; box-shadow: var(--sh);
}
.st.inline { display: flex; align-items: center; gap: 16px; }
.st .ic { width: 44px; height: 44px; border-radius: 13px; flex: none; display: flex; align-items: center; justify-content: center; }
.st .v { font-size: 26px; font-weight: 800; letter-spacing: -.8px; font-variant-numeric: tabular-nums; line-height: 1; color: var(--ink); }
.st .l { font-size: 12.5px; color: var(--ink-soft); font-weight: 600; margin-top: 5px; }
.st .l.top { margin: 0 0 10px; font-weight: 700; font-size: 12px; }
.st .f { font-size: 12px; font-weight: 600; margin-top: 6px; }

.tag { font-weight: 700; padding: 3px 9px; border-radius: 100px; font-size: 11.5px; }
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px;
  border-radius: 100px; font-size: 11.5px; font-weight: 700;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.callout {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 16px;
  padding: 17px 19px; margin-top: 16px;
}
.callout .ct { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 800; color: var(--accent-ink); }
.callout p { margin: 8px 0 0; font-size: 13px; color: var(--ink-soft); line-height: 1.55; font-weight: 500; }

.grid2 { display: grid; grid-template-columns: 1.55fr 1fr; gap: 18px; }
.grid2.wide { grid-template-columns: 1.7fr 1fr; }
.grid-half { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.stack { margin-top: 18px; }

/* --------------------------------------------------------- tableaux */

table { width: 100%; border-collapse: collapse; }
th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--ink-mute); font-weight: 700; padding: 12px 0; border-bottom: 1px solid var(--line);
}
th.r, td.r { text-align: right; }
td {
  padding: 15px 0; border-bottom: 1px solid var(--line-soft); font-size: 13.5px;
  font-weight: 500; vertical-align: middle; color: var(--ink);
}
tbody tr:last-child td { border-bottom: none; }
.table-scroll { overflow-x: auto; }
.amt { font-weight: 700; font-variant-numeric: tabular-nums; }
.cat { display: flex; align-items: center; gap: 11px; font-weight: 700; }
.catdot { width: 11px; height: 11px; border-radius: 4px; flex: none; }
.delta-up { color: var(--neg); font-weight: 700; }
.delta-dn { color: var(--pos); font-weight: 700; }
.delta-flat { color: var(--ink-soft); font-weight: 700; }
.link { color: var(--accent-ink); font-weight: 700; font-size: 12.5px; }
.muted-cell { color: var(--ink-soft); font-weight: 600; font-size: 12.5px; }

.prov { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; font-size: 13px; }
.plogo {
  width: 28px; height: 28px; border-radius: 8px; flex: none; display: flex;
  align-items: center; justify-content: center; font-size: 10px; font-weight: 800; color: #fff;
}
.plogo.lg { width: 32px; height: 32px; border-radius: 9px; font-size: 11px; }
.peri {
  display: inline-flex; align-items: center; gap: 7px; font-weight: 600; font-size: 12px;
  color: var(--ink-soft); padding: 4px 10px; border-radius: 100px;
  background: var(--surface-2); border: 1px solid var(--line);
}
.peridot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.own { display: inline-flex; align-items: center; gap: 8px; }
.oav {
  width: 26px; height: 26px; border-radius: 50%; flex: none; display: flex;
  align-items: center; justify-content: center; color: #fff; font-size: 10px; font-weight: 800;
}
.due { font-variant-numeric: tabular-nums; font-weight: 700; }
.cname, .pname, .app-n { font-weight: 700; font-size: 14px; }
.csub, .psub, .app-e { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }
.app-c { display: flex; align-items: center; gap: 12px; }
.app-lo {
  width: 36px; height: 36px; border-radius: 10px; flex: none; display: flex;
  align-items: center; justify-content: center; font-size: 12px; font-weight: 800; color: #fff;
}

/* --------------------------------------------------------- graphiques */

.bars { display: flex; align-items: flex-end; gap: 16px; height: 184px; padding-top: 8px; }
.bcol { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 9px; height: 100%; justify-content: flex-end; }
.bstack { width: 30px; display: flex; flex-direction: column; justify-content: flex-end; }
.bfill { width: 100%; background: var(--accent); border-radius: 8px 8px 3px 3px; }
.bplan { width: 100%; background: var(--accent-soft); border-radius: 8px 8px 0 0; }
.blab { font-size: 11.5px; color: var(--ink-soft); font-weight: 700; }

.legend { display: flex; gap: 18px; font-size: 12px; color: var(--ink-soft); font-weight: 600; flex-wrap: wrap; }
.legend.below { margin-top: 16px; }
.lg { display: flex; align-items: center; gap: 7px; }
.sw { width: 12px; height: 12px; border-radius: 4px; }
/* Le budget est tracé en tirets sur la courbe : la pastille de légende reprend
   ce trait plutôt qu'un carré plein, pour que la lecture soit immédiate. */
.sw.dashed {
  width: 18px; height: 0; border-radius: 0; background: transparent;
  border-top: 2.5px dashed var(--accent-2);
}

.row { display: flex; align-items: center; gap: 13px; padding: 13px 0; border-top: 1px solid var(--line-soft); }
.row:first-of-type { border-top: none; padding-top: 0; }
.rdot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.row .rmain { flex: 1; min-width: 0; }
.row .rt { font-size: 13.5px; font-weight: 700; color: var(--ink); }
.row .rs { font-size: 12px; color: var(--ink-soft); margin-top: 2px; font-weight: 500; }
.row .rv { font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; padding: 4px 10px; border-radius: 100px; }
.row .ic { width: 36px; height: 36px; border-radius: 11px; flex: none; display: flex; align-items: center; justify-content: center; }

.rb { display: flex; gap: 10px; margin: 2px 0 18px; }
.rbseg {
  height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 12px; font-weight: 800;
}
.meter { height: 9px; background: var(--line-soft); border-radius: 6px; overflow: hidden; }
.meter > div { height: 100%; border-radius: 6px; }
.meter-row { margin-bottom: 14px; }
.meter-head { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 7px; }
.meter-head span:first-child { font-weight: 700; color: var(--ink); }
.meter-head span:last-child { color: var(--ink-soft); font-variant-numeric: tabular-nums; font-weight: 600; }
.rbbar { height: 9px; background: var(--line-soft); border-radius: 5px; overflow: hidden; display: flex; }
.barcell { width: 150px; }

.rbtiles { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
.rbtile { border-radius: 16px; padding: 20px 22px; color: #fff; }
.rbtile .t { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; opacity: .95; }
.rbtile .v { font-size: 34px; font-weight: 800; letter-spacing: -1px; margin-top: 8px; font-variant-numeric: tabular-nums; }
.rbtile .s { font-size: 12.5px; opacity: .92; margin-top: 4px; font-weight: 500; }
.rbtile.run { background: linear-gradient(135deg, var(--info), #4f46e5); }
.rbtile.build { background: linear-gradient(135deg, var(--accent), var(--accent-2)); }

.split-row { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 8px; color: var(--ink); }
.split-row .k { font-weight: 700; display: inline-flex; align-items: center; gap: 8px; }
.split-row .k i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.split-row .v { font-weight: 800; font-variant-numeric: tabular-nums; }

.grp { display: flex; align-items: flex-end; justify-content: space-around; height: 240px; padding: 10px 0 0; gap: 8px; }
.grpc { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 12px; height: 100%; justify-content: flex-end; }
.grpbars { display: flex; gap: 8px; align-items: flex-end; height: 100%; }
.gb { width: 38px; border-radius: 8px 8px 0 0; }
.gb.proj { border: 2px dashed var(--accent); background: transparent; }
.grplab { font-size: 12px; font-weight: 800; color: var(--ink); }
.grptag { font-size: 9.5px; font-weight: 700; color: var(--ink-mute); text-transform: uppercase; letter-spacing: .06em; }

.rec { display: flex; gap: 13px; padding: 15px 0; border-top: 1px solid var(--line-soft); align-items: center; }
.rec:first-of-type { border-top: none; padding-top: 2px; }
.rec .ri {
  width: 34px; height: 34px; border-radius: 11px; flex: none; background: var(--pos-soft);
  color: var(--pos); display: flex; align-items: center; justify-content: center;
}
.rec .rt { font-size: 13.5px; font-weight: 700; color: var(--ink); }
.rec .rs { font-size: 12.5px; color: var(--ink-soft); margin-top: 2px; line-height: 1.5; font-weight: 500; }
.rec .rgain { font-size: 13px; font-weight: 800; color: var(--pos); white-space: nowrap; }

/* ------------------------------------------------------------ kanban */

.board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; align-items: start; }
.col {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 18px;
  padding: 14px; display: flex; flex-direction: column; gap: 12px;
}
.col-h { display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 2px; }
.col-h .ct { display: flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 800; color: var(--ink); }
.col-h .cd { width: 9px; height: 9px; border-radius: 50%; }
.col-h .cnt {
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-soft);
  border-radius: 100px; font-size: 11px; font-weight: 700; padding: 2px 9px;
}
.kcard {
  background: var(--surface); border: 1px solid var(--line); border-radius: 15px;
  padding: 15px; box-shadow: var(--sh-card);
}
.ktag {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px;
  border-radius: 100px; font-size: 11px; font-weight: 700; margin-bottom: 11px;
}
.ktag .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.kt { font-size: 14px; font-weight: 700; line-height: 1.3; margin-bottom: 9px; letter-spacing: -.2px; color: var(--ink); }
.prog { height: 7px; background: var(--line-soft); border-radius: 5px; overflow: hidden; margin-bottom: 6px; }
.prog > div { height: 100%; border-radius: 5px; }
.kmeta {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11.5px; color: var(--ink-soft); font-weight: 600; margin-bottom: 12px;
}
.kfoot { display: flex; align-items: center; justify-content: space-between; }
.avs { display: flex; }
.av {
  width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--surface);
  display: flex; align-items: center; justify-content: center; color: #fff;
  font-size: 9.5px; font-weight: 800; margin-left: -7px;
}
.av:first-child { margin-left: 0; }
.kbudget { font-size: 11.5px; font-weight: 800; font-variant-numeric: tabular-nums; padding: 3px 9px; border-radius: 100px; }
.lbar {
  width: 120px; height: 8px; background: var(--line-soft); border-radius: 5px;
  overflow: hidden; display: inline-block; vertical-align: middle;
}
.lbar > div { height: 100%; border-radius: 5px; }

/* ------------------------------------------------------ fournisseurs */

.vcard {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 20px 20px 18px; box-shadow: var(--sh);
}
.c-h { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.c-lo {
  width: 44px; height: 44px; border-radius: 12px; flex: none; display: flex;
  align-items: center; justify-content: center; font-size: 14px; font-weight: 800; color: #fff;
}
.c-n { font-size: 16px; font-weight: 800; letter-spacing: -.3px; color: var(--ink); }
.c-cat { font-size: 11.5px; color: var(--ink-soft); font-weight: 600; margin-top: 2px; }
.dep { margin-left: auto; padding: 5px 10px; border-radius: 100px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.c-spend { font-size: 27px; font-weight: 800; letter-spacing: -1px; font-variant-numeric: tabular-nums; color: var(--ink); }
.c-spend span { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); letter-spacing: 0; }
.shbar { height: 7px; background: var(--line-soft); border-radius: 5px; overflow: hidden; margin: 12px 0 16px; }
.shbar > div { height: 100%; border-radius: 5px; background: var(--accent); }
.c-stats { display: flex; justify-content: space-between; border-top: 1px solid var(--line-soft); padding-top: 14px; }
.c-stat .sv { font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--ink); }
.c-stat .sl { font-size: 11px; color: var(--ink-soft); font-weight: 600; margin-top: 2px; }
.c-stat.right { text-align: right; }

.empty {
  padding: 44px 20px; text-align: center; color: var(--ink-soft);
  font-size: 13.5px; font-weight: 600;
}

/* --------------------------------------------------------- connexion */

.login { min-height: 100vh; position: relative; }
.login-wrap { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; padding: 20px; gap: 20px; }
.topctrls { position: absolute; top: 34px; right: 38px; display: flex; gap: 10px; align-items: center; z-index: 5; }

.brand-panel {
  background: linear-gradient(155deg, #0b1a15 0%, #0e3b2d 58%, #0a7d5a 100%);
  color: #eafaf3; border-radius: 28px; padding: 48px 46px;
  display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden;
}
.glow {
  position: absolute; width: 460px; height: 460px; border-radius: 50%; top: -120px; right: -140px;
  background: radial-gradient(circle, rgba(16, 185, 129, .5), rgba(16, 185, 129, 0));
}
.glow2 {
  position: absolute; width: 320px; height: 320px; border-radius: 50%; bottom: -120px; left: -100px;
  background: radial-gradient(circle, rgba(14, 165, 164, .32), rgba(14, 165, 164, 0));
}
.logo { display: flex; align-items: center; gap: 13px; position: relative; }
.mark {
  width: 46px; height: 46px; border-radius: 14px;
  background: linear-gradient(135deg, #10b981, #0ea5a4);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 24px -8px rgba(16, 185, 129, .9);
}
.logo b { font-size: 24px; font-weight: 800; letter-spacing: -.4px; }
.logo span {
  display: block; font-size: 11px; color: #93c9b5; letter-spacing: .16em;
  text-transform: uppercase; margin-top: 1px; font-weight: 600;
}
.lede { font-size: 40px; line-height: 1.14; font-weight: 800; letter-spacing: -1px; max-width: 440px; margin: 0 0 18px; }
.lede em { color: #5eead4; font-style: normal; }
.lede-sub { color: #a7d6c5; font-size: 15.5px; line-height: 1.6; max-width: 410px; margin: 0; }
.feats { display: flex; flex-direction: column; gap: 13px; margin-top: 32px; }
.feat { display: flex; gap: 13px; align-items: center; font-size: 14px; color: #cdeadd; }
.fic {
  width: 32px; height: 32px; border-radius: 10px; flex: none; color: #5eead4;
  background: rgba(255, 255, 255, .08); display: flex; align-items: center; justify-content: center;
}
.trust { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: #7fb3a0; position: relative; }

.auth { display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth-card {
  width: 100%; max-width: 430px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 24px; padding: 38px 38px 32px;
  box-shadow: 0 2px 6px rgba(16, 40, 32, .05), 0 30px 60px -30px rgba(16, 40, 32, .28);
}
.mode {
  display: inline-flex; align-items: center; gap: 8px; background: var(--surface-2);
  border: 1px solid var(--line); color: var(--ink-soft); font-size: 12px; font-weight: 700;
  padding: 6px 13px; border-radius: 100px; margin-bottom: 22px;
}
.mode .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--pos); }
.auth-card h1 { font-size: 28px; font-weight: 800; letter-spacing: -.6px; margin: 0 0 5px; color: var(--ink); }
.auth-card .muted { color: var(--ink-soft); font-size: 14.5px; margin: 0 0 24px; }
.auth-card label { display: block; font-size: 12.5px; font-weight: 700; color: var(--ink-soft); margin: 0 0 8px; }
.field {
  width: 100%; height: 48px; border: 1px solid var(--line); background: var(--surface-2);
  border-radius: 13px; padding: 0 15px; font-family: var(--sans); font-size: 15px;
  color: var(--ink); font-weight: 500;
}
.field:focus { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 4px var(--accent-soft); }
.methods { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin: 20px 0 18px; }
.method {
  border: 1.5px solid var(--line); background: var(--surface); border-radius: 15px;
  padding: 14px 8px; cursor: pointer; text-align: center; display: flex;
  flex-direction: column; align-items: center; gap: 8px; transition: all .13s;
  font-family: var(--sans); color: var(--ink-mute);
}
.method:hover { border-color: var(--accent); transform: translateY(-1px); }
.method small { font-size: 11.5px; font-weight: 700; color: var(--ink-soft); }
.method.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px rgba(16, 185, 129, .12); color: var(--accent-ink); }
.method.on small { color: var(--accent-ink); }
.auth-panel {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 17px;
  padding: 20px; min-height: 138px; display: flex; flex-direction: column; gap: 14px;
}
.auth-panel p { margin: 0; font-size: 13.5px; color: var(--ink-soft); line-height: 1.55; }
.auth-panel p strong { color: var(--ink); }
.btn {
  height: 50px; border-radius: 14px; border: none; background: var(--accent); color: #fff;
  font-family: var(--sans); font-size: 15px; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%;
  box-shadow: 0 10px 22px -10px var(--accent);
}
.btn:hover { filter: brightness(.96); }
.btn.ms { background: #2f2f2f; box-shadow: 0 10px 22px -12px rgba(0, 0, 0, .6); }
.otp { display: flex; gap: 9px; }
.otp input {
  flex: 1; height: 54px; text-align: center; font-size: 22px; font-weight: 700;
  border: 1.5px solid var(--line); border-radius: 13px; background: var(--surface);
  color: var(--ink); font-family: var(--sans);
}
.otp input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.auth-foot { margin-top: 22px; font-size: 13px; color: var(--ink-soft); text-align: center; }

/* -------------------------------------------------------- responsive */

@media (max-width: 1180px) {
  .kpis, .stat4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid2, .grid2.wide, .grid-half { grid-template-columns: 1fr; }
  .grid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .login-wrap { grid-template-columns: 1fr; }
  .brand-panel { display: none; }
}

@media (max-width: 720px) {
  .app { grid-template-columns: var(--rail-w); }
  .main { padding: 22px 18px 32px; }
  .kpis, .stat3, .stat4, .grid3, .board, .rbtiles { grid-template-columns: 1fr; }
  .topbar { flex-direction: column; align-items: stretch; }
  .ctrls { justify-content: flex-start; }
  .peri-lab { text-align: left; }
  .search { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .side, .brand .bt, .nav a .t, .navlab, .side-foot .ft, .method { transition: none; }
}

/* Bascule de thème : les deux icônes sont dans le DOM, le thème courant décide
   laquelle s'affiche — donc pas d'état côté serveur ni de clignotement. */
.tbtn .i-sun { display: none; }
:root[data-theme="dark"] .tbtn .i-sun { display: block; }
:root[data-theme="dark"] .tbtn .i-moon { display: none; }

/* Les bascules de langue sont des liens : on leur donne l'allure des boutons du segment. */
.seg2 a {
  display: inline-flex; align-items: center; border-radius: 100px; padding: 8px 12px;
  font-size: 12px; font-weight: 800; color: var(--ink-soft); text-decoration: none;
}
.seg2 a:hover { color: var(--ink); }
.seg2 a.on, .seg2 a.on:hover { background: var(--accent); color: #fff; }

/* FocusOnNavigate donne le focus au titre à chaque navigation : c'est utile au
   lecteur d'écran, mais l'anneau de focus n'a pas de sens sur un titre non cliquable. */
[tabindex="-1"]:focus, [tabindex="-1"]:focus-visible { outline: none; }

.footnote { margin: 14px 0 0; font-size: 11.5px; color: var(--ink-mute); font-weight: 600; }
