/* ============================================================
   Plateforme GEM — Design system (bleu DCIP)
   Réplique du design de référence, vert → bleu
   ============================================================ */
:root {
  --navy-950: #071D46;          /* rail sombre */
  --navy-900: #0A2557;
  --navy-800: #0F2E66;
  --primary: #1E4FB8;           /* bleu DCIP */
  --primary-600: #2563EB;
  --accent: #2F6FED;            /* éléments actifs */
  --accent-soft: #E7EEFC;
  --gold: #EFB034;              /* or DCIP */
  --bg: #FDFDFE;
  --card: #FFFFFF;
  --border: #E8EDF5;
  --text: #232B3A;
  --muted: #8A94A6;
  --green: #16A34A;
  --green-soft: #DCF5E5;
  --pink: #E0447C;
  --pink-soft: #FBE3ED;
  --amber: #B45309;
  --amber-soft: #FDEDD0;
  --radius: 16px;
  --shadow: 0 4px 18px rgba(16, 42, 96, .06);
  --font: 'Poppins', 'Segoe UI', system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 15px; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; font-size: .88rem; color: var(--text); }
a { text-decoration: none; color: inherit; }

/* ---------- Rail d'icônes sombre ---------- */
.iconbar {
  position: fixed; inset: 0 auto 0 0; width: 66px; z-index: 40;
  background: var(--navy-950);
  display: flex; flex-direction: column; align-items: center;
  padding: 16px 0 14px; gap: 6px;
  border-radius: 0 18px 18px 0;
}
.brand {
  color: #fff; font-weight: 700; font-size: 1.02rem; letter-spacing: .2px;
  margin-bottom: 20px;
}
.brand .dot { color: var(--gold); }
.iconbar-items { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow: hidden auto; scrollbar-width: none; }
.iconbar-items::-webkit-scrollbar { display: none; }
.iconbar .nav-ico {
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center; color: #93A6CD;
  transition: background .15s, color .15s;
}
.iconbar .nav-ico:hover { color: #fff; background: rgba(255,255,255,.08); }
.iconbar .nav-ico.active { color: #fff; background: var(--accent); }
.iconbar .nav-ico svg { width: 19px; height: 19px; }
.iconbar-bottom { margin-top: auto; }
.iconbar-bottom .ico-btn { color: #93A6CD; }
.iconbar-bottom .ico-btn:hover { color: #fff; }

/* ---------- Sidebar secondaire (repliable) ---------- */
.sidebar {
  position: fixed; inset: 0 auto 0 66px; width: 246px; z-index: 30;
  background: #FDFEFF; border-right: 1px solid var(--border);
  padding: 10px 14px 16px; display: flex; flex-direction: column; gap: 10px;
  overflow-y: auto;
  transform: translateX(-115%); visibility: hidden;
  transition: transform .22s ease, visibility .22s;
}
body.side-open .sidebar { transform: none; visibility: visible; }
.side-toggle {
  position: fixed; left: 54px; top: 78px; z-index: 45;
  width: 25px; height: 25px; border-radius: 50%;
  background: #fff; border: 1px solid var(--border);
  display: grid; place-items: center; color: var(--primary);
  box-shadow: 0 3px 10px rgba(16,42,96,.18); cursor: pointer;
  transition: left .22s ease;
}
.side-toggle svg { width: 13px; height: 13px; }
body.side-open .side-toggle { left: 300px; }
.sidebar-head { text-align: center; }
.side-logo {
  display: block; width: 118px; height: auto; margin: 0 auto 14px;
  /* Le fond quasi blanc de la vidéo se fond dans le panneau */
  mix-blend-mode: multiply;
  pointer-events: none;
}
/* Si l'animation ne peut pas être lue, le logo vectoriel prend le relais */
.side-logo img { width: 100%; height: auto; display: block; }
@media (prefers-reduced-motion: reduce) {
  .side-logo { animation: none; }
}
.sidebar-head h2 { font-size: 1rem; font-weight: 600; }
.sidebar-head .underline {
  display: block; width: 42px; height: 3px; border-radius: 2px;
  background: var(--accent); margin: 7px auto 0;
}
.side-group {
  border: 1px solid var(--border); border-radius: 14px;
  padding: 10px; display: flex; flex-direction: column; gap: 2px;
  background: #fff;
}
.side-group .group-title {
  display: flex; align-items: center; gap: 8px;
  font-size: .82rem; font-weight: 600; color: var(--text);
  padding: 6px 8px 8px;
}
.side-group .group-title svg { width: 15px; height: 15px; color: var(--accent); }
.side-link {
  display: flex; align-items: center; gap: 9px;
  font-size: .8rem; color: #5A6478; padding: 7px 8px;
  border-radius: 9px; transition: background .15s, color .15s;
}
.side-link svg { width: 15px; height: 15px; flex: none; }
.side-link:hover { background: var(--accent-soft); color: var(--primary); }
.side-link.active { color: var(--accent); font-weight: 500; }

/* ---------- Coquille principale ---------- */
.shell {
  margin-left: 92px; padding: 14px 22px 30px; position: relative; z-index: 1;
  transition: margin-left .22s ease;
}
body.side-open .shell { margin-left: 290px; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 0 14px;
}
.crumb {
  display: inline-flex; align-items: center; gap: 7px;
  background: transparent; color: var(--text);
  font-size: .8rem; font-weight: 600;
  padding: 8px 2px; border-radius: 10px;
}
.crumb svg { width: 14px; height: 14px; }
.crumb .crumb-home {
  display: grid; place-items: center; border-radius: 6px; padding: 2px;
  color: var(--muted); transition: color .15s;
}
.crumb .crumb-home:hover { color: var(--primary); }
.crumb .crumb-sep { display: grid; place-items: center; color: #C2CBDA; }
.crumb .crumb-sep svg { width: 11px; height: 11px; }
.crumb a.crumb-lien:hover { color: var(--primary); }
.crumb .crumb-sub { color: var(--muted); font-weight: 400; }

/* Couverture territoriale interactive */
.region-row { cursor: pointer; }
.cell-bar { display: grid; grid-template-columns: minmax(40px, 1fr) 52px; gap: 10px; align-items: center; }
.cell-bar .bar-track { height: 7px; }
.cell-bar b { font-weight: 600; text-align: right; }
.top-actions { display: flex; align-items: center; gap: 4px; }
.ico-btn {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  color: #6B7689; position: relative; transition: background .15s;
}
.ico-btn:hover { background: #EDF1F8; }
.ico-btn svg { width: 17px; height: 17px; }
.ico-btn.has-dot::after {
  content: ''; position: absolute; top: 8px; right: 9px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--pink);
}
.avatar {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--navy-950); color: #fff;
  width: auto; padding: 8px 10px; border-radius: 50px;
  font-size: .72rem; font-weight: 600; margin-left: 6px;
}

/* ---------- Page ---------- */
.page-grid { display: grid; grid-template-columns: minmax(0,1fr) 300px; gap: 20px; }
.page-grid.full { grid-template-columns: minmax(0,1fr); }
.greeting { margin: 6px 0 20px; }
.greeting h1 { font-size: 1.55rem; font-weight: 600; }
.greeting .underline {
  display: block; width: 46px; height: 4px; border-radius: 2px;
  background: var(--accent); margin-top: 8px;
}
.row-head { display: flex; align-items: center; justify-content: space-between; margin: 0 0 12px; }
.row-head .arrows { display: flex; gap: 8px; }
.arrow-btn {
  width: 26px; height: 26px; border-radius: 50%;
  border: 1px solid var(--border); background: #fff;
  display: grid; place-items: center; color: #6B7689;
}
.arrow-btn svg { width: 13px; height: 13px; }

/* KPI */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.kpi {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px; display: flex; flex-direction: column; gap: 14px; min-height: 118px;
}
.kpi-top { display: flex; justify-content: space-between; align-items: flex-start; }
.kpi-ico {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--primary);
}
.kpi-ico svg { width: 17px; height: 17px; }
.kpi-menu { color: #A6AFC0; }
.kpi-menu.pill {
  background: var(--navy-950); color: #fff; width: 26px; height: 26px;
  border-radius: 50%; display: grid; place-items: center; font-size: .68rem; font-weight: 600;
}
.kpi-val { font-size: 1.5rem; font-weight: 600; line-height: 1; }
.kpi-label { font-size: .74rem; color: var(--muted); margin-top: 5px; }

/* Cartes génériques */
.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 18px;
}
.kpi { border: 1px solid var(--border); color: inherit; }
a.kpi { cursor: pointer; }

/* Titres de sections hors cadre, avec icône */
.sec-head {
  display: flex; align-items: center; gap: 9px;
  font-size: .92rem; font-weight: 600; margin: 0 0 10px 4px;
}
.sec-head svg { width: 16px; height: 16px; color: var(--primary); flex: none; }
.col-block { display: flex; flex-direction: column; min-width: 0; }
.col-block .card { flex: 1; }
/* Blocs de graphes sans fond ni cadre, hauteurs égales dans la rangée */
.col-block > .card { background: transparent; border: none; box-shadow: none; padding: 10px 6px; }
.col-block > .card.map-card { padding: 10px 0; }
.score-top { display: flex; align-items: center; gap: 12px; }
.score-top .val { font-size: 1.6rem; font-weight: 600; color: var(--primary); }

/* Palmarès */
.rank-row {
  display: grid; grid-template-columns: 30px 1fr auto; gap: 12px;
  align-items: center; padding: 9px 4px; border-bottom: 1px solid #F1F4FA;
  font-size: .78rem;
}
.rank-row:last-of-type { border-bottom: none; }
.rank {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  font-size: .7rem; font-weight: 700; background: #EEF2F9; color: #5A6478;
}
.rank.r1 { background: #FDEDD0; color: #B45309; }
.rank.r2 { background: #EEF2F9; color: #475569; }
.rank.r3 { background: #F6E7D8; color: #92400E; }
.rank.alerte { background: var(--pink-soft); color: var(--pink); }
.rank-t { font-weight: 500; }
.rank-row small { color: var(--muted); font-size: .64rem; }

/* Abrégé du niveau : cercle bleu */
.niv-chip {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  display: inline-grid; place-items: center;
  background: linear-gradient(145deg, #E7EEFC, #C9D8F5); color: var(--primary);
  border: 1.5px solid #fff;
  box-shadow: 0 2px 6px rgba(30, 79, 184, .18);
  font-size: .62rem; font-weight: 800; letter-spacing: .3px;
  transition: transform .15s;
}
tr:hover .niv-chip { transform: scale(1.12); }
.niv-chip.niv-BT { background: linear-gradient(145deg, #FDEDD0, #F3D9A4); color: var(--amber); box-shadow: 0 2px 6px rgba(180, 83, 9, .2); }
.niv-chip.niv-BTS { background: linear-gradient(145deg, #EDE9FE, #DDD3FB); color: #7C3AED; box-shadow: 0 2px 6px rgba(124, 58, 237, .2); }
.niv-chip.niv-Titrepro { background: linear-gradient(145deg, #CCFBF1, #99EFE0); color: #0E7490; box-shadow: 0 2px 6px rgba(14, 116, 144, .2); }

/* Compteurs de sous-menu */
.side-count {
  margin-left: auto; background: #EEF2F9; color: #5A6478;
  font-size: .58rem; font-weight: 600; padding: 2px 7px; border-radius: 10px;
}
.side-link.active .side-count { background: var(--accent-soft); color: var(--primary); }

/* Machine à écrire */
.stat-note.typing::after {
  content: '▍'; color: var(--primary);
  animation: blink .9s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* Polygones auto-construits : le contour se dessine, puis le remplissage apparaît */
.map-wrap .region {
  stroke-dasharray: 100; stroke-dashoffset: 100; fill-opacity: 0;
  animation: regiondraw .9s ease forwards, regionfill .5s ease .5s forwards;
}
@keyframes regiondraw { to { stroke-dashoffset: 0; } }
@keyframes regionfill { to { fill-opacity: 1; } }
.map-wrap .region { stroke: #64748B; }
.map-wrap svg .region[style] { stroke: #fff; }

/* Éditeur riche de la fenêtre de composition */
.cp-toolbar {
  display: flex; gap: 2px; align-items: center;
  padding: 6px 10px; border-bottom: 1px solid var(--border); background: #FAFBFE;
}
.cp-toolbar button {
  min-width: 28px; height: 26px; border-radius: 6px; font-size: .74rem;
  color: #5A6478; display: grid; place-items: center; padding: 0 6px;
}
.cp-toolbar button:hover { background: #EDF1F8; }
.cp-toolbar .sep { width: 1px; height: 16px; background: var(--border); margin: 0 6px; }
.cp-editor {
  flex: 1 1 auto; min-height: 120px; overflow-y: auto; padding: 12px 14px; outline: none;
  font-size: .82rem; line-height: 1.6;
}
.compose-row select#c-cc { flex: 0 0 auto; width: auto; max-width: 45%; color: var(--muted); }
.cp-toolbar button b, .cp-toolbar button i, .cp-toolbar button u, .cp-toolbar button s {
  font-size: .78rem;
}
.cp-editor:empty::before { content: attr(data-placeholder); color: #A6AFC0; }
.cp-resize {
  position: absolute; top: -4px; left: -4px; width: 16px; height: 16px;
  cursor: nwse-resize; z-index: 2;
  border-top: 3px solid #C9D4E8; border-left: 3px solid #C9D4E8; border-radius: 4px 0 0 0;
}
.cp-cc-btn { font-size: .7rem; color: var(--primary); font-weight: 600; }
.cc-chips { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.cc-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent-soft); color: var(--primary);
  font-size: .68rem; font-weight: 500; padding: 4px 9px; border-radius: 14px;
}
.cc-chip b { cursor: pointer; font-weight: 700; }
.cc-chip.fixe { background: #EEF2F9; color: #5A6478; }
.cp-pj { display: flex; gap: 6px; flex-wrap: wrap; padding: 8px 14px; }
.cp-pj:empty { display: none; }
.pj-chip {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--border); border-radius: 10px;
  font-size: .68rem; padding: 5px 10px; color: var(--text);
}
.pj-chip svg { width: 12px; height: 12px; color: var(--primary); }
.pj-chip small { color: var(--muted); }
.pj-chip b { cursor: pointer; color: var(--muted); }
.mail-msg svg { width: 13px; height: 13px; vertical-align: -2px; }
.mail-msg .msg-avatar { width: 32px; height: 32px; }

/* Menu de langue */
.lang-menu {
  position: fixed; z-index: 95; background: #fff; border: 1px solid var(--border);
  border-radius: 12px; box-shadow: 0 12px 30px rgba(7,29,70,.18);
  display: flex; flex-direction: column; padding: 6px; min-width: 140px;
  animation: fadeUp .15s ease;
}
.lang-menu button {
  text-align: left; padding: 8px 12px; border-radius: 8px; font-size: .78rem;
}
.lang-menu button:hover { background: #F1F5FC; }
.lang-menu button.on { background: var(--accent-soft); color: var(--primary); font-weight: 600; }

/* Cartographie SIG */
.gis-wrap {
  display: grid; grid-template-columns: 205px minmax(0,1fr); gap: 14px;
  padding: 0; border: none; box-shadow: none; background: transparent;
}
.gis-panel { background: #fff; }
.gis-panel {
  border: 1px solid var(--border); border-radius: 12px; padding: 12px;
  display: flex; flex-direction: column; gap: 4px; align-self: start;
}
.gis-title {
  display: flex; gap: 8px; align-items: center;
  font-size: .8rem; font-weight: 600; margin-bottom: 8px;
}
.gis-title svg { width: 15px; height: 15px; color: var(--primary); }
.gis-layer {
  display: flex; gap: 8px; align-items: center; font-size: .74rem; color: #5A6478;
  padding: 5px 4px; cursor: pointer; border-radius: 7px;
}
.gis-layer:hover { background: #F4F7FC; }
.gis-layer input { accent-color: var(--primary-600); }
.gis-layer svg { width: 15px; height: 15px; flex: none; color: var(--primary); }
.gis-legend { margin-top: 10px; display: flex; flex-direction: column; gap: 5px; font-size: .66rem; color: var(--muted); }
.gis-legend span { display: inline-flex; gap: 7px; align-items: center; }
.gis-legend i { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.gis-map { position: relative; min-width: 0; }
.map-wrap.gis { max-width: none; border: none; background: transparent; }
/* Carte SIG plein espace : ni cadre ni marge */
.gis-full {
  position: fixed; top: 56px; right: 0; bottom: 0; left: 66px;
  z-index: 5; transition: left .22s ease;
}
body.side-open .gis-full { left: 290px; }
#gis-leaflet { width: 100%; height: 100%; border-radius: 0; z-index: 1; }
.gis-full .gis-panel {
  position: absolute; top: 14px; left: 14px; z-index: 800;
  width: 205px; max-height: calc(100% - 28px); overflow-y: auto;
  box-shadow: 0 10px 30px rgba(7, 29, 70, .16);
}
.gis-full .gis-coords { position: absolute; }
.leaflet-container { font-family: var(--font); }
/* Pas de rectangle de sélection au clic : seul le rebord du polygone est mis en valeur */
.leaflet-interactive, .leaflet-interactive:focus, .leaflet-container:focus,
.leaflet-container *:focus { outline: none !important; }
.gis-lbl {
  font-size: 10.5px; font-weight: 500; color: #33415C; text-align: center;
  text-shadow: 0 1px 3px #fff, 0 0 5px #fff; pointer-events: none;
}
.gis-count {
  background: #0F2E66; color: #fff; border-radius: 50%;
  display: grid; place-items: center; font-size: 10px; font-weight: 700;
  border: 2px solid #fff; box-shadow: 0 2px 8px rgba(7, 29, 70, .35);
}
.gis-coords {
  z-index: 500;
  position: absolute; right: 10px; bottom: 8px;
  background: rgba(255,255,255,.9); border: 1px solid var(--border); border-radius: 8px;
  font-size: .64rem; color: #5A6478; padding: 4px 10px; font-variant-numeric: tabular-nums;
}
.linknet { stroke-dasharray: 4 6; animation: dashmove 1.1s linear infinite; }
@keyframes dashmove { to { stroke-dashoffset: -10; } }
.etab-pt { cursor: pointer; transition: r .15s; }
.etab-pt:hover { r: 7; }
tr.inactif { opacity: .5; }
@media (max-width: 1100px) { .gis-wrap { grid-template-columns: 1fr; } }
.card h3 { font-size: .95rem; font-weight: 600; }
.card .sub { font-size: .68rem; color: var(--muted); }

/* Colonne stats + graphe */
.mid-grid { display: grid; grid-template-columns: 200px minmax(0,1fr); gap: 14px; margin-bottom: 20px; }
.mini-cards { display: flex; flex-direction: column; gap: 14px; }
.mini-card { flex: 1; display: flex; flex-direction: column; justify-content: space-between; }
.mini-card .big { font-size: 2rem; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.pill { font-size: .64rem; font-weight: 600; padding: 4px 8px; border-radius: 30px; }
.pill.up { background: var(--green-soft); color: var(--green); }
.pill.down { background: var(--pink-soft); color: var(--pink); }
.pill.neutral { background: var(--accent-soft); color: var(--primary); }

/* Graphe */
.chart-card { position: relative; }
.chart-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.chart-wrap { position: relative; }
.chart-wrap svg { width: 100%; height: 240px; display: block; }
.chart-tip {
  position: absolute; transform: translate(-50%, -115%);
  background: var(--navy-800); color: #fff; border-radius: 12px;
  padding: 9px 14px; font-size: .74rem; white-space: nowrap;
  pointer-events: none; box-shadow: 0 8px 20px rgba(7,29,70,.35);
}
.chart-tip .t1 { font-weight: 600; }
.chart-tip .t2 { color: #A9BEE8; font-size: .68rem; }

/* Messages */
.msg-row {
  display: grid; grid-template-columns: 34px 150px 1fr auto; gap: 12px;
  align-items: center; padding: 10px 4px; font-size: .78rem;
  border-radius: 10px;
}
.msg-row:hover { background: #F4F7FC; }
.msg-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; color: #fff;
  font-size: .64rem; font-weight: 600;
}
.msg-name { font-weight: 500; }
.msg-obj { color: #5A6478; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-time { color: var(--muted); font-size: .68rem; }

/* Rail droit */
.rail { display: flex; flex-direction: column; gap: 16px; }
.promo {
  background: linear-gradient(155deg, #1A4CB2 0%, var(--navy-800) 90%);
  color: #fff; border-radius: var(--radius); padding: 18px;
  box-shadow: 0 10px 26px rgba(15,46,102,.28);
}
.promo h3 { font-size: .92rem; font-weight: 600; }
.promo .state { font-size: .68rem; color: #BDD0F2; margin-top: 4px; }
.progress {
  height: 6px; border-radius: 4px; background: rgba(255,255,255,.22); margin: 12px 0 14px;
  overflow: hidden;
}
.progress i { display: block; height: 100%; border-radius: 4px; background: #9DC1FF; }
.promo .eta-label { font-size: .8rem; font-weight: 600; }
.promo .eta { font-size: .7rem; color: #BDD0F2; margin: 3px 0 14px; }
.btn-white {
  width: 100%; background: #fff; color: var(--navy-800);
  font-weight: 600; font-size: .78rem; padding: 10px; border-radius: 24px;
}
.rail h4 { font-size: .88rem; font-weight: 600; margin-bottom: 2px; }
.task-row { display: flex; gap: 11px; align-items: center; padding: 8px 2px; }
.task-ico {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  background: var(--accent-soft); color: var(--primary);
  display: grid; place-items: center;
}
.task-ico svg { width: 15px; height: 15px; }
.task-row .t { font-size: .76rem; font-weight: 500; line-height: 1.25; }
.task-row .d { font-size: .64rem; color: var(--muted); }
.task-row.done .t { text-decoration: line-through; color: var(--muted); }
.meeting {
  background: linear-gradient(155deg, #123C8C 0%, #0A2557 100%);
  color: #fff; border-radius: var(--radius); padding: 16px;
}
.meeting h4 { font-size: .85rem; margin-bottom: 6px; }
.meeting .when { display: flex; align-items: center; gap: 7px; font-size: .72rem; font-weight: 600; }
.meeting .when::before {
  content: ''; width: 8px; height: 8px; border-radius: 50%;
  background: #57E39A;
}
.meeting p { font-size: .68rem; color: #BDD0F2; margin-top: 8px; line-height: 1.45; }

/* ---------- Tables ---------- */
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.search {
  display: flex; align-items: center; gap: 8px; background: #fff;
  border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; flex: 1; min-width: 180px;
}
.search svg { width: 15px; height: 15px; color: var(--muted); }
.search input { border: none; outline: none; flex: 1; background: transparent; }
.select {
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  padding: 9px 12px; font-size: .8rem; color: #5A6478; outline: none;
}
.btn-primary {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--primary-600); color: #fff; font-weight: 600; font-size: .8rem;
  padding: 10px 18px; border-radius: 24px; transition: background .15s;
  box-shadow: 0 6px 16px rgba(37,99,235,.3);
}
.btn-primary:hover { background: var(--primary); }
.btn-primary svg { width: 15px; height: 15px; }
.btn-ghost {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--border); background: #fff; color: #5A6478;
  font-weight: 500; font-size: .8rem; padding: 10px 18px; border-radius: 24px;
}
.btn-ghost svg { width: 15px; height: 15px; }
.btn-ghost:hover { background: #F4F7FC; }
.table-card { padding: 8px 14px; }
table { width: 100%; border-collapse: collapse; font-size: .78rem; }
th {
  text-align: left; color: var(--muted); font-weight: 500; font-size: .68rem;
  text-transform: uppercase; letter-spacing: .4px;
  padding: 12px 10px; border-bottom: 1px solid var(--border);
}
td { padding: 12px 10px; border-bottom: 1px solid #F1F4FA; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: #F7FAFE; }
.status {
  display: inline-block; font-size: .64rem; font-weight: 600;
  padding: 4px 10px; border-radius: 30px; white-space: nowrap;
}
.status.en_vigueur   { background: var(--green-soft); color: var(--green); }
.status.en_revision  { background: #FDEDD0; color: var(--amber); }
.status.en_validation{ background: var(--accent-soft); color: var(--primary); }
.status.brouillon    { background: #EEF1F6; color: #6B7689; }
.status.archive      { background: #F3F4F6; color: #9CA3AF; }
.status.terminee     { background: var(--green-soft); color: var(--green); }
.status.en_cours     { background: var(--accent-soft); color: var(--primary); }
.status.planifiee    { background: #FDEDD0; color: var(--amber); }
.status.publie       { background: var(--green-soft); color: var(--green); }
.status.en_attente   { background: #FDEDD0; color: var(--amber); }
.note-chip { font-weight: 600; color: var(--primary); }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; }
.row-actions .ico-btn { width: 30px; height: 30px; }
.row-actions .ico-btn svg { width: 14px; height: 14px; }

/* Cartes ressources */
.res-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.res-card { display: flex; flex-direction: column; gap: 10px; }
.res-type {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--primary);
}
.res-type.video { background: var(--pink-soft); color: var(--pink); }
.res-type.guide { background: var(--green-soft); color: var(--green); }
.res-type.referentiel { background: #FDEDD0; color: var(--amber); }
.res-type svg { width: 17px; height: 17px; }
.res-card h4 { font-size: .82rem; font-weight: 600; line-height: 1.35; flex: 1; }
.res-meta { font-size: .66rem; color: var(--muted); }
.res-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 2px; }
.btn-dl {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .7rem; font-weight: 600; color: var(--primary);
  background: var(--accent-soft); padding: 7px 12px; border-radius: 18px;
}
.btn-dl svg { width: 13px; height: 13px; }

/* Statistiques */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.score-card { text-align: left; }
.score-card .val { font-size: 1.7rem; font-weight: 600; color: var(--primary); }
.score-card .lbl { font-size: .7rem; color: var(--muted); margin-top: 4px; }
.two-col { display: grid; grid-template-columns: 1.35fr 1fr; gap: 14px; margin-bottom: 18px; }
.bar-row { display: grid; grid-template-columns: 170px 1fr 30px; gap: 10px; align-items: center; font-size: .74rem; padding: 6px 0; }
.bar-row .lbl { color: #5A6478; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 9px; border-radius: 6px; background: #EEF2F9; overflow: hidden; }
.bar-track i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--accent), var(--primary)); }
.bar-row .n { font-weight: 600; text-align: right; }
.legend-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 7px; }

/* ---------- Slide-over ---------- */
.overlay {
  position: fixed; inset: 0; background: rgba(10,30,70,.35); z-index: 60;
  backdrop-filter: blur(1px);
}
.slideover {
  position: fixed; top: 10px; right: 10px; bottom: 10px; width: 430px; max-width: calc(100vw - 20px);
  background: #fff; border-radius: 18px; z-index: 70;
  box-shadow: -18px 0 50px rgba(7,29,70,.25);
  display: flex; flex-direction: column;
  animation: slidein .22s ease;
}
@keyframes slidein { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.so-head {
  padding: 22px 24px 14px; position: relative;
  background: linear-gradient(180deg, #F4F8FF, #fff);
  border-radius: 18px 18px 0 0;
}
.so-head h2 { font-size: 1.12rem; font-weight: 700; letter-spacing: -.2px; }
.so-head .underline { display: block; width: 44px; height: 3px; background: var(--accent); border-radius: 2px; margin-top: 7px; }
.so-head .desc { font-size: .7rem; color: var(--muted); margin-top: 10px; line-height: 1.5; }
.so-close {
  position: absolute; top: 18px; right: 18px;
  width: 30px; height: 30px; border-radius: 9px; border: 1px solid var(--border);
  display: grid; place-items: center; color: #6B7689;
}
.so-close svg { width: 14px; height: 14px; }
.so-body { flex: 1; overflow-y: auto; padding: 8px 24px 16px; }
.so-section { margin-top: 20px; }
.so-section .sec-title {
  display: flex; align-items: center; gap: 9px;
  font-size: .72rem; font-weight: 700; color: #33415C;
  text-transform: uppercase; letter-spacing: 1.2px; margin-bottom: 12px;
}
.sec-title svg { width: 15px; height: 15px; color: #fff; }
.sec-title svg {
  width: 26px; height: 26px; padding: 5.5px; border-radius: 8px;
  background: linear-gradient(145deg, var(--accent), var(--primary));
  box-shadow: 0 3px 8px rgba(30, 79, 184, .25);
}
.sec-box {
  border: 1px solid var(--border); border-radius: 14px; padding: 16px;
  background: #EEF1F6;
}
.f-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.f-grid .wide { grid-column: 1 / -1; }
.field label {
  display: block; font-size: .74rem; font-weight: 600; color: #33415C;
  margin-bottom: 6px; letter-spacing: .1px;
}
.field label .req { color: var(--pink); }
.field input, .field select, .field textarea {
  width: 100%; border: 1.5px solid var(--border); border-radius: 10px;
  padding: 10px 12px; outline: none; background: #fff; font-size: .86rem;
  transition: border .15s, box-shadow .15s;
}
.field input:hover, .field select:hover, .field textarea:hover { border-color: #C9D4E8; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(47, 111, 237, .13);
}
.field .hint { font-size: .62rem; color: var(--muted); margin-top: 5px; }
.field textarea { resize: vertical; min-height: 70px; }
.dashed-btn {
  width: 100%; border: 1.5px dashed #C9D4E8; border-radius: 12px;
  padding: 12px; font-size: .78rem; font-weight: 600; color: #5A6478;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: border-color .15s, color .15s, background .15s;
}
.dashed-btn:hover { border-color: var(--accent); color: var(--primary); background: var(--accent-soft); }
.dashed-btn svg { width: 14px; height: 14px; }
.so-foot {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 14px 24px 18px; border-top: 1px solid var(--border);
}
.so-foot .btn-primary { flex: 1; justify-content: center; }

/* Détail programme dans slide-over */
.detail-list { display: flex; flex-direction: column; gap: 8px; }
.detail-item {
  display: flex; justify-content: space-between; gap: 10px;
  font-size: .76rem; padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px;
}
.detail-item .k { color: var(--muted); }
.detail-item .v { font-weight: 500; text-align: right; }

.slideover[hidden], .overlay[hidden], .toast[hidden] { display: none; }

/* Toast */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--navy-800); color: #fff; font-size: .8rem;
  padding: 12px 22px; border-radius: 30px; z-index: 90;
  box-shadow: 0 10px 30px rgba(7,29,70,.35);
  animation: slidein .2s ease;
}

/* Décor */
.deco {
  position: fixed; border-radius: 50%; z-index: 0; pointer-events: none;
  background: radial-gradient(circle, rgba(47,111,237,.10), rgba(47,111,237,.04));
}
/* Décor désactivé : le contenu reste sur fond blanc uni */
.deco { display: none; }
.deco-1 { width: 340px; height: 340px; left: 220px; bottom: -140px; }
.deco-2 { width: 420px; height: 420px; right: -140px; top: 40%; }

/* Empty state */
.empty { text-align: center; color: var(--muted); font-size: .8rem; padding: 40px 0; }

/* ---------- Messagerie ---------- */
.mail-row {
  display: grid; grid-template-columns: 34px 175px minmax(0,1fr) auto auto;
  gap: 12px; align-items: center; padding: 11px 10px;
  border-bottom: 1px solid #F1F4FA; cursor: pointer; font-size: .8rem;
  border-radius: 8px;
}
.mail-row:hover { background: #F7FAFE; }
.mail-row.nonlu { background: #F1F6FF; }
.mail-row.nonlu .mail-sender, .mail-row.nonlu .mail-obj { font-weight: 600; }
.mail-sender { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-obj { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-obj .snippet { color: var(--muted); font-weight: 400; }
.mail-time { font-size: .68rem; color: var(--muted); white-space: nowrap; }
.mail-star { color: #C9D2E2; display: grid; place-items: center; }
.mail-star svg { width: 15px; height: 15px; }
.mail-star.on { color: var(--gold); }
.mail-star.on svg { fill: var(--gold); }
.mail-read-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 6px; border-bottom: 1px solid var(--border);
}
.mail-read-head h3 { font-size: .95rem; }
.mail-msg { border: 1px solid var(--border); border-radius: 12px; padding: 14px; margin-bottom: 12px; }
.mail-msg.de-moi { background: #F7FAFF; }
.mail-msg-head { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.mail-from { font-weight: 600; font-size: .8rem; }
.mail-email { color: var(--muted); font-weight: 400; font-size: .7rem; }
.mail-meta { font-size: .66rem; color: var(--muted); }
.mail-body { white-space: pre-wrap; font-family: inherit; font-size: .8rem; line-height: 1.65; margin: 0; }
.nav-ico { position: relative; }
.nav-badge {
  position: absolute; top: 1px; right: 1px;
  background: var(--pink); color: #fff; font-size: .56rem; font-weight: 700;
  min-width: 15px; height: 15px; border-radius: 8px;
  display: grid; place-items: center; padding: 0 3px;
  border: 2px solid var(--navy-950);
}

/* ---------- Carte du Sénégal ---------- */
.map-card { margin-bottom: 18px; }
.map-wrap { position: relative; max-width: 100%; margin: 0 auto; overflow: hidden; border-radius: 12px; }
.sec-head .seg { margin-left: auto; }
.seg.seg-mini {
  border: none; background: transparent; padding: 0; border-radius: 0;
  gap: 3px; overflow: visible;
}
.seg-mini button { border: none; border-radius: 9px; padding: 4px 9px; color: #A6AFC0; }
.seg-mini button:hover { background: #EDF1F8; color: #5A6478; }
.seg.seg-mini button.on, .map-tools .seg button.on {
  background: transparent; color: var(--primary);
}
.seg-mini svg { width: 13px; height: 13px; }
.donut-wrap { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; padding: 6px 0; }
.donut-wrap svg { width: 180px; flex: none; }
.donut-legend { display: flex; flex-direction: column; gap: 7px; font-size: .72rem; color: #5A6478; }
.donut-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: 7px; }
.donut-legend b { color: var(--text); margin-left: 4px; }
.mini-line { width: 100%; height: auto; }
.donut-wrap svg { animation: donutspin .8s ease backwards; transform-origin: center; }
@keyframes donutspin { from { transform: rotate(-80deg) scale(.85); opacity: 0; } }
.donut-legend span { animation: fadeUp .4s ease backwards; }
.donut-legend span:nth-child(2) { animation-delay: .08s; }
.donut-legend span:nth-child(3) { animation-delay: .16s; }
.donut-legend span:nth-child(4) { animation-delay: .24s; }
.donut-legend span:nth-child(5) { animation-delay: .32s; }
.rank-row { animation: fadeUp .4s ease backwards; }
.rank-row:nth-child(2) { animation-delay: .07s; }
.rank-row:nth-child(3) { animation-delay: .14s; }
.rank-row:nth-child(4) { animation-delay: .21s; }
.rank-row:nth-child(5) { animation-delay: .28s; }
.mini-line .line {
  stroke-dasharray: 1500; stroke-dashoffset: 1500;
  animation: drawline 1.2s ease-out forwards;
}
.map-wrap svg { width: 100%; height: auto; display: block; cursor: grab; touch-action: none; }
.map-wrap svg:active { cursor: grabbing; }
.map-wrap .region { cursor: pointer; transition: filter .15s, opacity .15s; }
.map-wrap .region:hover { filter: brightness(.94); }
.map-wrap .mk, .map-wrap .heatpt { cursor: pointer; }
.map-wrap .mk .halo {
  transform-box: fill-box; transform-origin: center;
  animation: halo 1.9s ease-out infinite;
}
@keyframes halo { from { transform: scale(.7); opacity: .5; } to { transform: scale(2.4); opacity: 0; } }
.map-tools { display: flex; gap: 8px; align-items: center; margin: 0 0 8px; flex-wrap: wrap; }
.map-tools .seg { border: none; background: transparent; gap: 2px; overflow: visible; }
.map-tools .seg button { padding: 4px 9px; border: none; border-radius: 9px; }
.map-tools .seg button:hover { background: #EDF1F8; }
.map-tools .seg button.on { background: transparent; color: var(--primary); }
.map-tools .seg svg { width: 13px; height: 13px; }
.map-tools .seg-zoom button { padding: 3px 9px; font-size: .78rem; color: #6B7689; }
.seg {
  display: inline-flex; border: 1px solid var(--border); border-radius: 20px;
  overflow: hidden; background: #fff;
}
.seg button {
  padding: 6px 13px; font-size: .7rem; font-weight: 500; color: #5A6478;
  border-right: 1px solid var(--border);
}
.seg button:last-child { border-right: none; }
.seg button:hover { background: #F1F5FC; }
.seg button.on { background: var(--primary-600); color: #fff; }
.seg-zoom button { font-size: .85rem; padding: 5px 12px; }
.map-legend {
  display: flex; gap: 10px; align-items: center; font-size: .66rem; color: var(--muted);
  margin: 0 0 8px;
}
.map-legend i.grad {
  width: 110px; height: 9px; border-radius: 5px; display: inline-block;
  background: linear-gradient(90deg, #E8EEF8, #2F6FED);
}
.map-legend i.grad.heat {
  background: linear-gradient(90deg, #FEF3C7, #F59E0B, #EF4444);
}
.map-legend em { font-style: normal; margin-left: 8px; color: #A6AFC0; }

/* ---------- Notes explicatives dynamiques ---------- */
.stat-note {
  font-size: .7rem; color: var(--muted); line-height: 1.6;
  margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border);
  animation: fadeUp .5s ease .4s backwards;
}
.stat-note strong { color: var(--primary); font-weight: 600; }

/* ---------- Fenêtre flottante de composition (style webmail) ---------- */
.compose {
  position: fixed; right: 26px; bottom: 0; width: 480px; max-width: calc(100vw - 40px);
  height: 520px; max-height: 82vh; z-index: 85;
  background: #fff; border-radius: 12px 12px 0 0;
  box-shadow: 0 -4px 44px rgba(7, 29, 70, .32);
  display: flex; flex-direction: column;
  animation: composeup .2s ease;
}
@keyframes composeup { from { transform: translateY(30px); opacity: 0; } }
.compose-head {
  background: var(--navy-950); color: #fff; border-radius: 12px 12px 0 0;
  padding: 10px 14px; display: flex; align-items: center; gap: 8px;
  font-size: .8rem; font-weight: 600; cursor: pointer; user-select: none;
}
.compose-head svg { width: 14px; height: 14px; }
.compose-head .sp { flex: 1; }
.compose-head button {
  color: #B9C7E4; width: 24px; height: 24px;
  display: grid; place-items: center; border-radius: 6px;
}
.compose-head button:hover { background: rgba(255,255,255,.14); color: #fff; }
.compose.min { height: 44px; }
.compose.min .compose-body, .compose.min .compose-foot { display: none; }
.compose-body { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.compose-row {
  display: flex; align-items: center; gap: 8px; padding: 9px 14px;
  border-bottom: 1px solid var(--border); font-size: .8rem;
}
.compose-row label { color: var(--muted); font-size: .72rem; }
.compose-row select, .compose-row input {
  border: none; outline: none; flex: 1; background: transparent; font-size: .8rem;
}
.compose-body textarea {
  flex: 1; border: none; outline: none; resize: none; padding: 12px 14px;
  font-size: .82rem; line-height: 1.6; font-family: inherit;
}
.compose-foot {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-top: 1px solid var(--border);
}

/* ---------- Messagerie en deux colonnes (type Gmail) ---------- */
.mail-split {
  display: grid; grid-template-columns: minmax(260px, 330px) minmax(0, 1fr);
  gap: 14px; height: calc(100vh - 200px); min-height: 420px;
}
.card.mail-list, .card.mail-read { background: transparent; border: none; box-shadow: none; }
.mail-list { overflow-y: auto; padding: 8px 6px; }
.mail-read { overflow-y: auto; padding: 8px 10px; border-left: 1px solid var(--border); border-radius: 0; }
.mail-split.solo { grid-template-columns: 1fr; }
.mail-split.solo .mail-list { display: none; }
.mail-split.solo .mail-read { border-left: none; }
.mail-vide {
  height: 100%; display: flex; flex-direction: column; gap: 12px;
  align-items: center; justify-content: center; color: #C2CBDA;
}
.mail-vide svg { width: 42px; height: 42px; }
.mail-vide p { font-size: .8rem; }
.mail-row2 {
  display: grid; grid-template-columns: 34px minmax(0, 1fr) 22px;
  gap: 10px; padding: 10px; border-radius: 12px; cursor: pointer;
  border-bottom: 1px solid #F1F4FA; align-items: start;
}
.mail-row2:hover { background: #F7FAFE; }
.mail-row2.sel { background: var(--accent-soft); }
.mail-row2.nonlu .mr2-sender, .mail-row2.nonlu .mr2-obj { font-weight: 600; }
.mail-row2.nonlu { background: #F1F6FF; }
.mail-row2.nonlu.sel { background: var(--accent-soft); }
.mr2-main { min-width: 0; }
.mr2-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.mr2-sender { font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mr2-obj { font-size: .76rem; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mr2-snip {
  font-size: .68rem; color: var(--muted); margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
@media (max-width: 1100px) {
  .mail-split { grid-template-columns: 1fr; height: auto; }
  .mail-read { min-height: 300px; }
}

/* ---------- Messagerie avancée ---------- */
.mail-tag {
  display: inline-block; font-size: .58rem; font-weight: 600;
  padding: 2px 8px; border-radius: 20px; margin-right: 7px; vertical-align: 1px;
}
.mail-check { accent-color: var(--primary-600); width: 14px; height: 14px; cursor: pointer; }
.bulkbar {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-bottom: 1px solid var(--border);
  background: var(--accent-soft); border-radius: 10px 10px 0 0;
  font-size: .74rem; animation: fadeUp .2s ease;
}
.bulkbar .btn-ghost { padding: 6px 12px; font-size: .7rem; }
.receipt { font-size: .62rem; font-weight: 700; letter-spacing: -1px; }
.receipt.lu { color: var(--primary-600); }
.receipt.pas-lu { color: #A6AFC0; }
.quick-replies { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.quick-replies button {
  border: 1px solid var(--border); border-radius: 18px; padding: 6px 12px;
  font-size: .7rem; color: var(--primary); background: #fff;
}
.quick-replies button:hover { background: var(--accent-soft); }
.side-badge {
  display: inline-grid; place-items: center; min-width: 17px; height: 17px;
  padding: 0 4px; margin-left: auto; border-radius: 9px;
  background: var(--pink); color: #fff; font-size: .58rem; font-weight: 700;
}

/* ---------- Anti-ascenseurs : défilement interne selon l'écran ---------- */
.table-card { max-height: calc(100vh - 235px); overflow: auto; }
/* Tableaux sans fond ni cadre : ils se fondent dans la page */
.card.table-card { background: transparent; border: none; box-shadow: none; padding: 0 6px; }
.table-card thead th { position: sticky; top: 0; background: var(--bg); z-index: 2; }
.res-grid { max-height: calc(100vh - 235px); overflow-y: auto; padding: 2px; }
@media (max-width: 1500px) { html { font-size: 14px; } }
@media (max-width: 1240px) { html { font-size: 13.5px; } }
@media (max-height: 820px) {
  .greeting { margin: 2px 0 12px; }
  .greeting h1 { font-size: 1.3rem; }
  .kpi { min-height: 96px; padding: 12px; gap: 8px; }
  .chart-wrap svg { height: 185px; }
  .table-card, .res-grid { max-height: calc(100vh - 195px); }
  .map-wrap { max-width: 440px; }
}

/* ---------- Animations ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes growBar { from { width: 0; } }
@keyframes drawline { to { stroke-dashoffset: 0; } }
.kpi, .card, .promo, .meeting { animation: fadeUp .45s ease backwards; }
.kpi, .res-card, .mini-card { transition: transform .18s ease, box-shadow .18s ease; }
.kpi:hover, .res-card:hover { transform: translateY(-3px); box-shadow: 0 12px 26px rgba(16,42,96,.12); }
.progress i, .bar-track i { animation: growBar .9s ease .25s backwards; }
.chart-wrap path.line { stroke-dasharray: 2000; stroke-dashoffset: 2000; animation: drawline 1.3s ease-out forwards; }
.chart-wrap path.line-prev { animation-delay: .25s; }

@media (max-width: 1200px) {
  .page-grid { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .mid-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .two-col { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  body.side-open .shell { margin-left: 92px; }
  body.side-open .sidebar { box-shadow: 20px 0 40px rgba(7,29,70,.18); }
}
