/* Pilotage des risques : feuille de style commune (connexion et application). Inspiration Apple, comme « Mes Finances ». */
:root {
  color-scheme: light;
  --bg: #f5f5f7; --card: #ffffff; --side: #f9f9fb; --ink: #1d1d1f; --ink-2: #6e6e73; --ink-3: #86868b;
  --hair: rgba(0,0,0,.08); --hair-strong: rgba(0,0,0,.14); --fill: rgba(118,118,128,.12); --fill-2: rgba(118,118,128,.07);
  --accent: #0071e3; --bad-text: #c9302c; --good-text: #1a7f37; --warn-text: #b45f00;
  --t1: #34c759; --t2: #ffcc00; --t3: #ff9500; --t4: #ff3b30;
  --t1-text: #1a7f37; --t2-text: #8a6d00; --t3-text: #b45f00; --t4-text: #c9302c;
  --o1: #5ac8fa; --o2: #32ade6; --o3: #0a84ff; --o4: #5e5ce6;
  --o1-text: #0a6c96; --o2-text: #0a6c96; --o3-text: #0066cc; --o4-text: #4a48c9;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 32px rgba(0,0,0,.06);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #000; --card: #1c1c1e; --side: #111113; --ink: #f5f5f7; --ink-2: #a1a1a6; --ink-3: #8e8e93;
    --hair: rgba(255,255,255,.09); --hair-strong: rgba(255,255,255,.16); --fill: rgba(118,118,128,.24); --fill-2: rgba(118,118,128,.14);
    --accent: #0a84ff; --bad-text: #ff6961; --good-text: #30d158; --warn-text: #ff9f0a;
    --t1-text: #30d158; --t2-text: #ffd60a; --t3-text: #ff9f0a; --t4-text: #ff6961;
    --o1-text: #64d2ff; --o2-text: #64d2ff; --o3-text: #409cff; --o4-text: #8e8cf5;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 32px rgba(0,0,0,.4);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000; --card: #1c1c1e; --side: #111113; --ink: #f5f5f7; --ink-2: #a1a1a6; --ink-3: #8e8e93;
  --hair: rgba(255,255,255,.09); --hair-strong: rgba(255,255,255,.16); --fill: rgba(118,118,128,.24); --fill-2: rgba(118,118,128,.14);
  --accent: #0a84ff; --bad-text: #ff6961; --good-text: #30d158; --warn-text: #ff9f0a;
  --t1-text: #30d158; --t2-text: #ffd60a; --t3-text: #ff9f0a; --t4-text: #ff6961;
  --o1-text: #64d2ff; --o2-text: #64d2ff; --o3-text: #409cff; --o4-text: #8e8cf5;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 32px rgba(0,0,0,.4);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", system-ui, "Segoe UI", sans-serif;
  font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 40%, transparent); outline-offset: 2px; }
h1, h2, h3 { margin: 0; letter-spacing: -0.01em; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--ink-2); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }

/* ---------- Champs et boutons ---------- */
input, select, textarea {
  width: 100%; border-radius: 10px; border: 1px solid var(--hair-strong); background: var(--card); padding: 0 12px; height: 38px; outline: none;
}
textarea { height: auto; min-height: 76px; padding: 9px 12px; resize: vertical; line-height: 1.4; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; padding: 0; accent-color: var(--accent); }
label.f { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 500; color: var(--ink-2); }
label.f > span.hint { font-weight: 400; color: var(--ink-3); }
/* Champs d'une même ligne : les libellés (avec ou sans aide, sur une ou deux lignes) occupent toute la hauteur de la ligne et les champs s'alignent en bas */
label.f > :is(input, select, textarea, span:has(> :is(input, select, textarea))) { margin-top: auto; }
label.f > datalist, label.f > span:empty { display: none; }   /* zones d'aide vides : ni espace ni décalage */
input, select { min-height: 38px; flex: none; }
input[type="date"], input[type="month"], input[type="time"] { min-height: 38px; line-height: 1; }
.btn {
  height: 36px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--hair-strong); background: var(--card); cursor: pointer;
  font-weight: 500; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.btn:hover { background: var(--fill-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { color: var(--bad-text); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--fill); }
.btn.sm { height: 30px; padding: 0 10px; border-radius: 8px; font-size: 13px; }
.btn[disabled] { opacity: .55; cursor: default; }
.icon-btn { width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; color: var(--ink-3); display: grid; place-items: center; }
.icon-btn:hover { background: var(--fill); color: var(--ink); }
.seg { display: inline-flex; background: var(--fill); border-radius: 9px; padding: 2px; gap: 2px; }
.seg button { border: 0; background: transparent; height: 30px; padding: 0 12px; border-radius: 7px; cursor: pointer; font-weight: 500; color: var(--ink-2); }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.msg { font-size: 13px; line-height: 1.45; border-radius: 10px; padding: 10px 12px; }
.msg:empty { display: none; }
.msg.err { color: var(--bad-text); background: color-mix(in srgb, var(--bad-text) 10%, transparent); }
.msg.info { color: var(--ink-2); background: var(--fill); }
.spin { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Connexion ---------- */
body.login { display: grid; place-items: center; padding: 24px 16px; }
.wrap { width: 100%; max-width: 380px; }
.brand { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-bottom: 26px; text-align: center; }
.mark { width: 64px; height: 64px; border-radius: 16px; display: grid; place-items: center; background: linear-gradient(135deg, #ff9f0a, #ff375f 55%, #5e5ce6); box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 8px 24px rgba(255,55,95,.25); }
.brand h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.brand p { color: var(--ink-2); margin: 4px 0 0; }
.login .card { background: var(--card); border: 1px solid var(--hair); border-radius: 20px; padding: 22px; box-shadow: var(--shadow); }
.login form { display: flex; flex-direction: column; gap: 14px; }
.login input { height: 44px; border-radius: 11px; font-size: 15px; }
.login .btn.primary { height: 44px; justify-content: center; font-size: 15px; margin-top: 4px; }
.foot { margin-top: 18px; text-align: center; font-size: 12px; color: var(--ink-3); line-height: 1.5; }

/* ---------- Mise en page de l'application ---------- */
.app { display: grid; grid-template-columns: 244px 1fr; min-height: 100vh; }
.side { background: var(--side); border-right: 1px solid var(--hair); padding: 18px 12px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.logo { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; font-weight: 700; font-size: 15px; letter-spacing: -.01em; }
.logo .mk { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: linear-gradient(135deg, #ff9f0a, #ff375f 55%, #5e5ce6); }
.nav-title { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); padding: 10px 10px 4px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; color: var(--ink); font-weight: 500; }
.nav a:hover { background: var(--fill); text-decoration: none; }
.nav a.on { background: var(--accent); color: #fff; }
.nav a svg { width: 17px; height: 17px; flex: none; opacity: .85; }
.nav .badge { margin-left: auto; background: var(--t4); color: #fff; font-size: 11px; font-weight: 600; border-radius: 99px; padding: 1px 7px; }
.nav a.on .badge { background: #fff; color: var(--accent); }
.side .spacer { flex: 1; }
.me { display: flex; align-items: center; gap: 8px; padding: 10px 6px 2px; border-top: 1px solid var(--hair); margin-top: 8px; }
.me .av { width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(135deg, #5e5ce6, #0a84ff); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 12px; text-transform: uppercase; }
.me button.who { flex: 1; text-align: left; border: 0; background: none; cursor: pointer; padding: 2px 4px; border-radius: 8px; min-width: 0; }
.me button.who:hover { background: var(--fill); }
.me .who b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me .who span { font-size: 12px; color: var(--ink-3); }
main { padding: 28px 32px 60px; max-width: 1280px; width: 100%; min-width: 0; }
.head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.head h1 { font-size: 28px; font-weight: 700; letter-spacing: -.02em; }
.head .sub { color: var(--ink-2); margin-top: 2px; }
.tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tools select { width: auto; min-width: 150px; }

/* ---------- Cartes ---------- */
.card { background: var(--card); border: 1px solid var(--hair); border-radius: 18px; box-shadow: var(--shadow); }
.pad { padding: 18px 20px; }
.card h2 { font-size: 16px; font-weight: 650; }
.card .ch { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.grid { display: grid; gap: 16px; }
.g4 { grid-template-columns: repeat(4, 1fr); }
.g2 { grid-template-columns: 1fr 1fr; }
.g-main { grid-template-columns: 1fr 340px; align-items: start; }
.kpi { padding: 16px 18px; cursor: pointer; transition: transform .12s; }
.kpi:hover { transform: translateY(-1px); }
.kpi .l { font-size: 12.5px; color: var(--ink-2); font-weight: 500; display: flex; align-items: center; gap: 6px; }
.kpi .v { font-size: 32px; font-weight: 700; letter-spacing: -.02em; margin: 4px 0 2px; }
.kpi .s { font-size: 12.5px; color: var(--ink-3); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.bad-text { color: var(--bad-text); } .good-text { color: var(--good-text); } .warn-text { color: var(--warn-text); }

/* ---------- Pastilles de criticité ---------- */
.pill { display: inline-flex; align-items: center; gap: 5px; border-radius: 99px; padding: 2px 9px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill.t1 { background: color-mix(in srgb, var(--t1) 18%, transparent); color: var(--t1-text); }
.pill.t2 { background: color-mix(in srgb, var(--t2) 22%, transparent); color: var(--t2-text); }
.pill.t3 { background: color-mix(in srgb, var(--t3) 20%, transparent); color: var(--t3-text); }
.pill.t4 { background: color-mix(in srgb, var(--t4) 16%, transparent); color: var(--t4-text); }
.pill.o1 { background: color-mix(in srgb, var(--o1) 20%, transparent); color: var(--o1-text); }
.pill.o2 { background: color-mix(in srgb, var(--o2) 20%, transparent); color: var(--o2-text); }
.pill.o3 { background: color-mix(in srgb, var(--o3) 16%, transparent); color: var(--o3-text); }
.pill.o4 { background: color-mix(in srgb, var(--o4) 16%, transparent); color: var(--o4-text); }
.pill.n { background: var(--fill); color: var(--ink-2); }
.pill .sc { opacity: .75; font-weight: 500; }
.kind { font-size: 11.5px; font-weight: 600; border-radius: 6px; padding: 1px 6px; }
.kind.threat { background: color-mix(in srgb, var(--t4) 12%, transparent); color: var(--t4-text); }
.kind.opportunity { background: color-mix(in srgb, var(--o3) 14%, transparent); color: var(--o3-text); }
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--ink-2); }

/* ---------- Matrice 5×5 ---------- */
.matrix { display: grid; grid-template-columns: 22px 1fr; grid-template-rows: 1fr 24px; gap: 4px 6px; }
.matrix .ylab { writing-mode: vertical-rl; transform: rotate(180deg); text-align: center; font-size: 11.5px; color: var(--ink-3); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.matrix .xlab { grid-column: 2; text-align: center; font-size: 11.5px; color: var(--ink-3); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; padding-top: 4px; }
.mgrid { display: grid; grid-template-columns: 20px repeat(5, minmax(0, 1fr)); grid-template-rows: repeat(5, 1fr) 18px; gap: 4px; min-width: 0; }
.matrix { min-width: 0; }
@media (max-width: 1100px) { .mx2 { grid-template-columns: 1fr; } }
.mgrid .ax { font-size: 11px; color: var(--ink-3); display: grid; place-items: center; }
.mcell { aspect-ratio: 1.15; border-radius: 9px; border: 0; display: flex; flex-wrap: wrap; align-content: center; justify-content: center; gap: 3px; padding: 3px; cursor: default; min-height: 38px; font-weight: 700; font-size: 15px; }
.mcell[data-n] { cursor: pointer; }
.mcell:not([data-n]) { opacity: .75; }
.mcell.t1 { background: color-mix(in srgb, var(--t1) 30%, var(--card)); color: var(--t1-text); }
.mcell.t2 { background: color-mix(in srgb, var(--t2) 38%, var(--card)); color: var(--t2-text); }
.mcell.t3 { background: color-mix(in srgb, var(--t3) 36%, var(--card)); color: var(--t3-text); }
.mcell.t4 { background: color-mix(in srgb, var(--t4) 34%, var(--card)); color: var(--t4-text); }
.mcell.o1 { background: color-mix(in srgb, var(--o1) 22%, var(--card)); color: var(--o1-text); }
.mcell.o2 { background: color-mix(in srgb, var(--o2) 28%, var(--card)); color: var(--o2-text); }
.mcell.o3 { background: color-mix(in srgb, var(--o3) 30%, var(--card)); color: var(--o3-text); }
.mcell.o4 { background: color-mix(in srgb, var(--o4) 34%, var(--card)); color: var(--o4-text); }
.mcell[data-n]:hover { box-shadow: 0 0 0 2px var(--accent); }
.mcell .chip { font-size: 10.5px; font-weight: 700; background: var(--card); color: var(--ink); border-radius: 5px; padding: 0 4px; line-height: 17px; box-shadow: 0 0 0 1px var(--hair); }
.big .mcell { min-height: 64px; aspect-ratio: auto; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 10px; font-size: 12px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* ---------- Tableaux et listes ---------- */
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; font-weight: 600; color: var(--ink-3); padding: 9px 12px; border-bottom: 1px solid var(--hair); white-space: nowrap; user-select: none; }
th.sort { cursor: pointer; } th.sort:hover { color: var(--ink); }
td { padding: 11px 12px; border-bottom: 1px solid var(--hair); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; } tr.click:hover td { background: var(--fill-2); }
td.ttl { min-width: 230px; max-width: 380px; }
td.ttl b { font-weight: 600; display: block; }
td.ttl .ref { font-size: 12px; color: var(--ink-3); }
.empty { text-align: center; color: var(--ink-3); padding: 36px 16px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; align-items: center; }
.filters select, .filters input[type="search"] { width: auto; height: 34px; }
.filters input[type="search"] { min-width: 220px; }
.count { color: var(--ink-3); font-size: 12.5px; margin-left: auto; }
.todo { display: flex; align-items: center; gap: 12px; padding: 10px 6px; border-radius: 10px; cursor: pointer; border: 0; background: none; width: 100%; text-align: left; }
.todo:hover { background: var(--fill-2); }
.todo .ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.todo .ic svg { width: 17px; height: 17px; }
.todo .tx { flex: 1; min-width: 0; }
.todo .tx b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.todo .tx span { font-size: 12.5px; color: var(--ink-3); }
.ic.red { background: color-mix(in srgb, var(--t4) 14%, transparent); color: var(--t4-text); }
.ic.orange { background: color-mix(in srgb, var(--t3) 16%, transparent); color: var(--t3-text); }
.ic.blue { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.ic.grey { background: var(--fill); color: var(--ink-2); }
.bars .row { display: grid; grid-template-columns: 150px 1fr 34px; gap: 10px; align-items: center; padding: 5px 0; font-size: 13px; }
.bars .track { height: 8px; background: var(--fill); border-radius: 99px; overflow: hidden; }
.bars .fill { height: 100%; border-radius: 99px; }
.bars .n { text-align: right; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.stack { display: flex; height: 12px; border-radius: 99px; overflow: hidden; background: var(--fill); }
.stack i { display: block; height: 100%; }
.pcard { padding: 18px 20px; cursor: pointer; display: flex; flex-direction: column; gap: 10px; }
.pcard:hover { box-shadow: 0 0 0 2px var(--accent), var(--shadow); }
.pcard .code { font-size: 12px; font-weight: 700; color: var(--ink-3); letter-spacing: .04em; }
.pcard h3 { font-size: 16px; }
.nums { display: flex; gap: 14px; font-size: 12.5px; color: var(--ink-2); flex-wrap: wrap; }
.nums b { color: var(--ink); font-size: 15px; display: block; }

/* ---------- Fenêtres et tiroir ---------- */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.38); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding: 5vh 16px; overflow-y: auto; }
.overlay.right { justify-content: flex-end; padding: 0; align-items: stretch; }
.modal { background: var(--card); border-radius: 20px; box-shadow: 0 20px 60px rgba(0,0,0,.3); width: 100%; max-width: 640px; border: 1px solid var(--hair); }
.modal.wide { max-width: 780px; }
.modal.narrow { max-width: 420px; }
.modal .mh { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px 8px; }
.modal .mh h2 { font-size: 19px; }
.modal .mb { padding: 8px 22px 18px; display: flex; flex-direction: column; gap: 14px; }
.modal .mf { padding: 14px 22px 18px; display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--hair); flex-wrap: wrap; align-items: center; }
.drawer { background: var(--card); width: 100%; max-width: 600px; height: 100%; overflow-y: auto; border-left: 1px solid var(--hair); box-shadow: -20px 0 60px rgba(0,0,0,.2); }
.drawer .dh { padding: 20px 24px 12px; position: sticky; top: 0; background: var(--card); z-index: 2; border-bottom: 1px solid var(--hair); }
.drawer .db { padding: 16px 24px 40px; display: flex; flex-direction: column; gap: 20px; }
.sec h3 { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin-bottom: 8px; }
.sec p { margin: 0 0 6px; white-space: pre-wrap; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 6px 12px; }
.kv dt { color: var(--ink-3); } .kv dd { margin: 0; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.fieldset { border: 1px solid var(--hair); border-radius: 14px; padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 10px; }
.fieldset > legend { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); padding: 0 6px; }
.act { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--hair); }
.act:last-child { border-bottom: 0; }
.act .tx { flex: 1; min-width: 0; }
.act .tx b { font-weight: 500; }
.act.done .tx b { text-decoration: line-through; color: var(--ink-3); }
.act .meta { font-size: 12.5px; color: var(--ink-3); }
.hist { display: flex; flex-direction: column; gap: 10px; }
.hist .ev { border-left: 2px solid var(--hair-strong); padding: 0 0 0 12px; font-size: 13px; }
.hist .ev .when { font-size: 12px; color: var(--ink-3); }
.hist .ev ul { margin: 4px 0 0; padding-left: 16px; color: var(--ink-2); }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: #1d1d1f; color: #fff; padding: 10px 18px; border-radius: 99px; font-weight: 500; z-index: 100; box-shadow: 0 8px 28px rgba(0,0,0,.3); }
.toast.err { background: #c9302c; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--hair); margin-bottom: 18px; flex-wrap: wrap; }
.tabs a { padding: 8px 14px; color: var(--ink-2); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.on { color: var(--accent); border-bottom-color: var(--accent); }
.tabs a:hover { text-decoration: none; color: var(--ink); }
.swatch { width: 22px; height: 22px; border-radius: 6px; border: 0; padding: 0; cursor: pointer; }
input[type="color"] { width: 34px; height: 30px; padding: 2px; border-radius: 8px; }
.scale-grid { display: grid; grid-template-columns: 30px 1fr 1.6fr; gap: 8px; align-items: center; }
.switch-row { display: flex; align-items: center; gap: 8px; }

.ganttrow:hover { background: var(--fill-2); }

/* ---------- Rapport mensuel ---------- */
.report h2 { margin: 22px 0 10px; font-size: 17px; }
.report .kp { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.report .kp div { background: var(--fill-2); border-radius: 12px; padding: 12px 14px; }
.report .kp b { font-size: 24px; display: block; letter-spacing: -.02em; }
.report .kp span { color: var(--ink-2); font-size: 12.5px; }
.report .kp b { white-space: nowrap; }
.report .grid .kp b, .report .kp[style*="repeat(4"] b { font-size: 19px; }

@media (max-width: 1080px) {
  .g4 { grid-template-columns: repeat(2, 1fr); }
  .g-main { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px; border-right: 0; border-bottom: 1px solid var(--hair); }
  .logo { padding: 0 8px 0 4px; }
  .nav-title, .side .spacer { display: none; }
  .nav { display: flex; flex-wrap: wrap; gap: 2px; }
  .me { border: 0; margin: 0 0 0 auto; padding: 0; }
  main { padding: 18px 14px 40px; }
  .g2, .row2, .row3, .report .kp { grid-template-columns: 1fr; }
  .drawer { max-width: 100%; }
}
@media print {
  .side, .head .tools, .no-print, .toast, .overlay { display: none !important; }
  .app { display: block; } main { padding: 0; max-width: none; }
  body { background: #fff; color: #000; }
  .card { box-shadow: none; break-inside: avoid; }
  :root { --card: #fff; }
}
