:root { --daf: #1f3864; }
body { background: #f5f7fb; }
.bg-daf { background: var(--daf); }
.login-wrap { min-height: 90vh; display: flex; align-items: center; }
.login-card { width: 100%; max-width: 420px; }
.att-grid td { min-width: 165px; vertical-align: top; }
.att-grid th:first-child { position: sticky; left: 0; background: #fff; z-index: 1; }
.num { max-width: 80px; }
.changes { padding-left: 1rem; font-size: .85em; color: #555; }
.sheet-head { display: flex; justify-content: space-between; margin-bottom: 1rem; }
.decision { max-width: 800px; margin: 0 auto; background: #fff; padding: 2rem; font-size: 1.05rem; }
.print-only { display: none; }
@media print {
  .no-print, nav.navbar { display: none !important; }
  .print-only { display: block; }
  body { background: #fff; }
  main { padding: 0 !important; }
  .card { border: none; }
  table { font-size: 10pt; }
  a { color: inherit; text-decoration: none; }
}

/* Barre de navigation : libellés sur une ligne, plus compacts quand le menu est complet. */
@media (min-width: 1200px) {
  nav.navbar .nav-link, nav.navbar .navbar-brand { white-space: nowrap; }
  nav.navbar .nav-link { padding-left: .45rem !important; padding-right: .45rem !important; font-size: .92rem; }
}
.nav-narrow { display: none; }
@media (min-width: 1200px) and (max-width: 1699.98px) {
  .nav-wide { display: none; }
  .nav-narrow { display: inline; }
}

/* Version 1.5 : couleurs, icônes, logo. */
:root { --daf: #1f3864; --daf2: #2e75b6; --gold: #c9a227; }
body { background: linear-gradient(180deg, #eef2f9 0, #f5f7fb 260px); }
.bg-daf { background: linear-gradient(90deg, #1a2f55, #1f3864 40%, #24508f); }
.btn-daf { background: linear-gradient(90deg, #1f3864, #2e75b6); color: #fff; border: none; }
.btn-daf:hover { color: #fff; filter: brightness(1.08); }
.navbar .nav-link.active { color: #fff !important; box-shadow: inset 0 -3px 0 var(--gold); }
.nav-logo { height: 34px; width: auto; background: #fff; border-radius: 6px; padding: 2px; }
.navbar .bi-bank2 { color: var(--gold); font-size: 1.35rem; }
@media (min-width: 1200px) and (max-width: 1499.98px) { nav.navbar .nav-link .bi { display: none; } }

/* Connexion */
.login-wrap { min-height: 100vh; background: radial-gradient(circle at 15% 20%, #2e75b6 0, transparent 45%), radial-gradient(circle at 85% 80%, #c9a227 0, transparent 40%), linear-gradient(135deg, #14264a, #1f3864 55%, #234a85); }
.login-shell { display: flex; max-width: 920px; width: 100%; border-radius: 18px; overflow: hidden; background: #fff; }
.login-side { flex: 1 1 50%; padding: 2.5rem; color: #fff; background: linear-gradient(160deg, rgba(31,56,100,.96), rgba(46,117,182,.92)); position: relative; }
.login-side::after { content: ""; position: absolute; right: -60px; bottom: -60px; width: 220px; height: 220px; border-radius: 50%; border: 28px solid rgba(201,162,39,.25); }
.login-emblem { width: 84px; height: 84px; border-radius: 50%; background: rgba(255,255,255,.15); display: flex; align-items: center; justify-content: center; font-size: 2.6rem; color: var(--gold); border: 2px solid rgba(201,162,39,.6); }
.login-logo { max-height: 96px; max-width: 220px; background: #fff; border-radius: 12px; padding: 6px; }
.login-features li { margin: .55rem 0; opacity: .95; }
.login-features .bi { color: var(--gold); margin-right: .5rem; }
.login-form { flex: 1 1 50%; padding: 2.5rem; }
@media (max-width: 767.98px) { .login-shell { flex-direction: column; } .login-side { padding: 1.5rem; } .login-side ul { display: none; } }

/* Tableau de bord */
.hero { border-radius: 16px; padding: 1.4rem 1.6rem; color: #fff; background: linear-gradient(120deg, #1f3864, #2e75b6 70%, #3d8bd0); position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -40px; top: -40px; width: 200px; height: 200px; border-radius: 50%; border: 24px solid rgba(201,162,39,.28); }
.hero .hero-logo { max-height: 64px; background: #fff; border-radius: 10px; padding: 4px; }
.stat { border: none; border-radius: 14px; box-shadow: 0 2px 10px rgba(31,56,100,.08); transition: transform .12s, box-shadow .12s; }
.stat:hover, .tile:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(31,56,100,.15); }
.stat .stat-icon { width: 52px; height: 52px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.6rem; color: #fff; flex: 0 0 52px; }
.stat-primary .stat-icon, .ic-primary { background: linear-gradient(135deg, #2e75b6, #1f3864); }
.stat-success .stat-icon, .ic-success { background: linear-gradient(135deg, #34c38f, #198754); }
.stat-warning .stat-icon, .ic-warning { background: linear-gradient(135deg, #f7b84b, #e08e0b); }
.stat-danger .stat-icon, .ic-danger { background: linear-gradient(135deg, #f46a6a, #c0392b); }
.stat-info .stat-icon, .ic-info { background: linear-gradient(135deg, #50c3e6, #0d8ab3); }
.stat-purple .stat-icon, .ic-purple { background: linear-gradient(135deg, #a77ddb, #6f42c1); }
.stat-teal .stat-icon, .ic-teal { background: linear-gradient(135deg, #3ccfbf, #138d75); }
.stat-secondary .stat-icon, .ic-secondary { background: linear-gradient(135deg, #8e9aaf, #5a6475); }
.stat .stat-value { font-size: 1.7rem; font-weight: 700; color: #1f3864; line-height: 1.1; }
.stat .stat-label { font-size: .85rem; color: #6c757d; }
.tile { border: none; border-radius: 14px; box-shadow: 0 2px 10px rgba(31,56,100,.07); transition: transform .12s, box-shadow .12s; color: #1f3864; }
.tile .tile-icon { width: 46px; height: 46px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 1.35rem; color: #fff; }
.tile .tile-label { font-size: .88rem; font-weight: 600; margin-top: .45rem; }
.section-title { font-size: 1.05rem; font-weight: 700; color: #1f3864; display: flex; align-items: center; gap: .5rem; margin: 1.2rem 0 .7rem; }
.section-title .bi { color: var(--daf2); }
.card { border-radius: 12px; }
.card-header { background: #f8fafd; font-weight: 600; color: #1f3864; }
.doc-steps { list-style: none; padding: 0; display: flex; gap: .5rem; flex-wrap: wrap; }
.doc-steps li { flex: 1 1 120px; border-top: 4px solid #dee2e6; padding-top: .35rem; color: #6c757d; display: flex; flex-direction: column; font-size: .9rem; }
.doc-steps li.done { border-color: #198754; color: #198754; font-weight: 600; }
.doc-steps li small { font-weight: normal; color: #6c757d; }
.logo-sheet { max-height: 50px; }
.time24 { min-width: 64px; text-align: center; }
.flatpickr-input[readonly].form-control:not([disabled]) { background-color: #fff; }
@media (min-width: 1200px) and (max-width: 1499.98px) {
  nav.navbar .nav-link { padding-left: .32rem !important; padding-right: .32rem !important; font-size: .86rem; }
  nav.navbar .navbar-brand { margin-right: .5rem; }
}
.nav-logo { height: 36px; width: auto; background: rgba(255,255,255,.92); border-radius: 50%; padding: 3px; }
.login-logo { max-height: 120px; max-width: 220px; background: rgba(255,255,255,.95); border-radius: 50%; padding: 10px; }
.hero .hero-logo { max-height: 72px; background: rgba(255,255,255,.95); border-radius: 50%; padding: 6px; }
table.order-lines tr.ligne-intitule textarea { font-weight: 600; background: #eef3fb; }

/* Version 1.7.1 : menu regroupé en rubriques à sections, tableau de bord allégé, connexion. */
@media (min-width: 1200px) {
  nav.navbar .nav-link { padding-left: .7rem !important; padding-right: .7rem !important; font-size: .95rem; }
  nav.navbar .nav-link .bi { display: inline-block !important; }
  .menu-sections { padding: .6rem .4rem; border: none; border-radius: 12px; box-shadow: 0 12px 32px rgba(20,38,74,.22); }
  .menu-sections.cols-2 { display: none; grid-template-columns: repeat(2, minmax(220px, 1fr)); min-width: 500px; }
  .menu-sections.cols-3 { display: none; grid-template-columns: repeat(3, minmax(210px, 1fr)); min-width: 680px; }
  .menu-sections.cols-2.show, .menu-sections.cols-3.show { display: grid; }
  .menu-sections .menu-section { padding: 0 .3rem .4rem; }
}
.menu-sections .dropdown-header { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--daf2); font-weight: 700; padding-top: .35rem; }
.menu-sections .dropdown-item { border-radius: 6px; font-size: .92rem; padding: .3rem .75rem; }
.menu-sections .dropdown-item:hover { background: #eef3fb; color: #1f3864; }
.nav-bell { position: relative; }
.nav-bell .bi { font-size: 1.15rem; }
.nav-bell .badge { position: absolute; top: 2px; right: -4px; font-size: .65rem; }
@media (max-width: 1199.98px) { .nav-bell .badge { position: static; margin-left: .3rem; } }
/* Tableau de bord : demandes regroupées par thème */
.req-group { border: none; border-radius: 14px; box-shadow: 0 2px 10px rgba(31,56,100,.07); }
.req-group .req-title { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; font-weight: 700; color: #6c7a91; margin-bottom: .4rem; }
.req-link { display: flex; align-items: center; gap: .6rem; padding: .38rem .4rem; border-radius: 8px; color: #1f3864; text-decoration: none; font-weight: 500; font-size: .93rem; }
.req-link:hover { background: #eef3fb; }
.req-link .tile-icon { width: 32px; height: 32px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; font-size: 1rem; color: #fff; flex: 0 0 32px; }
.hero { padding: 1.1rem 1.4rem; }
.hero .hero-actions .btn { margin-left: .4rem; }
/* Connexion : texte de présentation */
.login-side::after { right: -90px; bottom: -90px; border-color: rgba(201,162,39,.18); }
.login-lead { font-size: 1.05rem; line-height: 1.55; opacity: .95; }
.login-domains { display: flex; flex-wrap: wrap; gap: .45rem; }
.login-domains span { border: 1px solid rgba(255,255,255,.35); border-radius: 999px; padding: .2rem .7rem; font-size: .85rem; background: rgba(255,255,255,.08); }
.login-motto { font-size: .82rem; opacity: .75; border-top: 1px solid rgba(255,255,255,.2); padding-top: .8rem; }
@media (min-width: 1200px) {
  .menu-sections.cols-3 { grid-template-columns: repeat(3, minmax(235px, 1fr)); min-width: 740px; }
  .navbar .dropdown-menu-end.menu-sections { right: 0; left: auto; }
}
.login-side { overflow: hidden; }

/* Version 1.8 : rubrique Budget dans le menu ; menu plus serré sur les écrans de 1200 à 1500 px. */
@media (min-width: 1200px) and (max-width: 1499.98px) {
  nav.navbar .nav-link { padding-left: .4rem !important; padding-right: .4rem !important; font-size: .9rem; }
  nav.navbar .nav-home .nav-txt { display: none; }
  nav.navbar .nav-link .bi { margin-right: .15rem !important; }
}
@media (min-width: 1200px) {
  .menu-sections.cols-2 { grid-template-columns: repeat(2, minmax(270px, 1fr)); min-width: 580px; }
}
@media print {
  .budget-obs input { border: none; padding: 0; background: transparent; }
}

/* Version 1.9 : listes du menu plus lisibles sur PC (icônes, titres de section, espacement, colonnes séparées). */
.menu-sections .dropdown-header { display: flex; align-items: center; gap: .45rem; white-space: normal; line-height: 1.25; font-size: .76rem; color: #1f3864; border-bottom: 2px solid #e6ecf5; margin: 0 .5rem .35rem; padding: .45rem .1rem .4rem; }
.menu-sections .dropdown-header .bi { color: #c9a227; font-size: .95rem; }
.menu-sections .dropdown-item { display: flex; align-items: flex-start; gap: .55rem; white-space: normal; line-height: 1.3; padding: .42rem .7rem; color: #24324a; }
.menu-sections .dropdown-item .bi { flex: 0 0 1.1rem; color: #5b7bb0; font-size: .95rem; margin-top: .05rem; }
.menu-sections .dropdown-item:hover .bi, .menu-sections .dropdown-item.current .bi { color: #1f3864; }
.menu-sections .dropdown-item.current { background: #e3ebf7; font-weight: 600; color: #1f3864; }
@media (min-width: 1200px) {
  .menu-sections { padding: .8rem .6rem; }
  .menu-sections .menu-section { padding: 0 .45rem .5rem; }
  .menu-sections.cols-2 .menu-section + .menu-section, .menu-sections.cols-3 .menu-section:not(:nth-child(3n+1)) { border-left: 1px solid #eef1f6; }
  .menu-sections.cols-1 { min-width: 290px; }
  .menu-sections.cols-2 { grid-template-columns: repeat(2, minmax(280px, 1fr)); min-width: 600px; }
  .menu-sections.cols-3 { grid-template-columns: repeat(3, minmax(240px, 1fr)); min-width: 760px; max-width: calc(100vw - 2rem); }
  .menu-sections.cols-2 .menu-section:nth-child(odd) { border-left: none; }
}

/* Version 1.9.2 : la liste déroulante ne dépasse plus de l'écran (position corrigée dans app.js). */
@media (min-width: 1200px) {
  .menu-sections.cols-3 { min-width: 0; width: min(760px, calc(100vw - 1rem)); grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Pilotage de l'activité (1.11) : graphiques SVG cliquables */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart-card .card-body { padding: .75rem 1rem; }
.chart-donut { width: 190px; max-width: 55%; flex: 0 0 auto; }
.chart .ch-el { cursor: pointer; transition: opacity .12s; }
.chart:hover .ch-el { opacity: .55; }
.chart .ch-el:hover { opacity: 1; filter: brightness(1.08); }
.chart text { font-family: inherit; fill: #3d4a5c; pointer-events: none; }
.chart .ch-big { font-size: 34px; font-weight: 700; fill: #1f3864; }
.chart .ch-small { font-size: 11px; fill: #6c7a8d; }
.chart .ch-lbl { font-size: 13px; }
.chart .ch-val { font-size: 13px; font-weight: 600; }
.chart .ch-grid { stroke: #e6eaf0; stroke-dasharray: 3 3; }
.chart .ch-axis { stroke: #c4ccd8; }
.ch-legend { list-style: none; padding: 0; margin: 0; font-size: .9rem; flex: 1 1 auto; }
.ch-legend li { margin: .2rem 0; }
.ch-legend a { color: inherit; text-decoration: none; display: flex; align-items: center; gap: .45rem; padding: .15rem .4rem; border-radius: 6px; }
.ch-legend a:hover { background: #f0f4fa; }
.ch-legend b { margin-left: auto; }
.dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; flex: 0 0 11px; }
.ch-key { font-size: .8rem; color: #6c7a8d; display: flex; gap: 1rem; margin-top: .3rem; }
.ch-key i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: .3rem; vertical-align: -1px; }
.late-list li { padding: .2rem 0; border-bottom: 1px dashed #e6eaf0; }
.late-list a { text-decoration: none; }
.kpis .stat-value { font-size: 1.6rem; }
.hb-row { display: flex; align-items: center; gap: .6rem; margin: .45rem 0; font-size: .9rem; }
.hb-lbl { flex: 0 0 var(--hb-lbl); max-width: 45%; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #3d4a5c; }
.hb-track { flex: 1 1 auto; display: flex; align-items: center; min-width: 0; }
.hb-seg { display: block; height: 20px; min-width: 4px; transition: opacity .12s, filter .12s; }
.hb-seg:first-child { border-radius: 4px 0 0 4px; }
.hb-seg:last-of-type { border-radius: 0 4px 4px 0; }
.hb-seg:only-of-type { border-radius: 4px; }
.hb:hover .hb-seg { opacity: .55; }
.hb .hb-seg:hover { opacity: 1; filter: brightness(1.08); }
.hb-val { margin-left: .5rem; font-size: .85rem; }
.chart-scroll { overflow-x: auto; } .chart-scroll .chart { min-width: 560px; }
.hb-val { white-space: nowrap; } .gauge-box { max-width: 260px; margin: 0 auto; }

/* ===== Version 1.14 : thèmes de couleurs et design à menu latéral ===== */
/* Couleurs de chaque thème. Le thème « Académie » garde les couleurs d'origine. */
:root, .theme-academie { --t-900: #14264a; --t-800: #1f3864; --t-700: #24508f; --t-600: #2e75b6; --t-600-rgb: 46,117,182; --t-100: #eef3fb; --t-50: #f5f8fd; --t-accent: #c9a227; --t-bg1: #eef2f9; --t-bg2: #f5f7fb; }
.theme-emeraude { --t-900: #08321f; --t-800: #0f5132; --t-700: #146c43; --t-600: #1e8a5f; --t-600-rgb: 30,138,95; --t-100: #e7f3ec; --t-50: #f3f9f5; --t-accent: #c9a227; --t-bg1: #e9f2ed; --t-bg2: #f4f8f5; }
.theme-bordeaux { --t-900: #3d0f1c; --t-800: #6b1d2f; --t-700: #852639; --t-600: #a33a4f; --t-600-rgb: 163,58,79; --t-100: #f6eaed; --t-50: #fbf5f6; --t-accent: #c9a227; --t-bg1: #f4ecee; --t-bg2: #f9f6f7; }
.theme-ardoise { --t-900: #1b222b; --t-800: #2f3a48; --t-700: #3e4c5e; --t-600: #4f6d8c; --t-600-rgb: 79,109,140; --t-100: #eceff3; --t-50: #f5f7f9; --t-accent: #d39e3a; --t-bg1: #eceff3; --t-bg2: #f4f5f7; }
.theme-sombre { --t-900: #070c16; --t-800: #111a2e; --t-700: #18243d; --t-600: #4c8fd6; --t-600-rgb: 76,143,214; --t-100: #1b2740; --t-50: #162036; --t-accent: #d4b14a; --t-bg1: #0d1424; --t-bg2: #0f1729; }

/* Thèmes autres que « Académie » : bandeau, boutons, liens et titres prennent les couleurs du thème. */
.themed { --bs-primary: var(--t-600); --bs-primary-rgb: var(--t-600-rgb); --bs-link-color: var(--t-600); --bs-link-color-rgb: var(--t-600-rgb); --bs-link-hover-color: var(--t-700); --daf: var(--t-800); --daf2: var(--t-600); --gold: var(--t-accent);
  background: linear-gradient(180deg, var(--t-bg1) 0, var(--t-bg2) 260px); }
.themed .bg-daf { background: linear-gradient(90deg, var(--t-900), var(--t-800) 40%, var(--t-700)); }
.themed .btn-primary { --bs-btn-bg: var(--t-600); --bs-btn-border-color: var(--t-600); --bs-btn-hover-bg: var(--t-700); --bs-btn-hover-border-color: var(--t-700); --bs-btn-active-bg: var(--t-800); --bs-btn-active-border-color: var(--t-800); --bs-btn-disabled-bg: var(--t-600); --bs-btn-disabled-border-color: var(--t-600); }
.themed .btn-outline-primary { --bs-btn-color: var(--t-600); --bs-btn-border-color: var(--t-600); --bs-btn-hover-bg: var(--t-600); --bs-btn-hover-border-color: var(--t-600); --bs-btn-active-bg: var(--t-700); --bs-btn-active-border-color: var(--t-700); --bs-btn-disabled-color: var(--t-600); --bs-btn-disabled-border-color: var(--t-600); }
.themed .btn-daf { background: linear-gradient(90deg, var(--t-800), var(--t-600)); }
.themed .nav-pills { --bs-nav-pills-link-active-bg: var(--t-600); }
.themed .nav { --bs-nav-link-color: var(--t-600); --bs-nav-link-hover-color: var(--t-700); }
.themed .form-check-input:checked { background-color: var(--t-600); border-color: var(--t-600); }
.themed .form-control:focus, .themed .form-select:focus { border-color: rgba(var(--t-600-rgb), .6); box-shadow: 0 0 0 .2rem rgba(var(--t-600-rgb), .2); }
.themed .text-bg-primary { background-color: var(--t-600) !important; }
.themed .hero { background: linear-gradient(120deg, var(--t-800), var(--t-600) 70%, var(--t-600)); }
.themed .stat-primary .stat-icon, .themed .ic-primary { background: linear-gradient(135deg, var(--t-600), var(--t-800)); }
.themed .stat .stat-value, .themed .tile, .themed .section-title, .themed .card-header, .themed .req-link, .themed .chart .ch-big { color: var(--t-800); fill: var(--t-800); }
.themed .card-header { background: var(--t-50); }
.themed .menu-sections .dropdown-header { color: var(--t-800); }
.themed .menu-sections .dropdown-item .bi { color: var(--t-600); }
.themed .menu-sections .dropdown-item:hover, .themed .req-link:hover { background: var(--t-100); color: var(--t-800); }
.themed .menu-sections .dropdown-item.current { background: var(--t-100); color: var(--t-800); }
.themed .table-primary { --bs-table-bg: var(--t-100); }

/* Thème sombre : surfaces et textes clairs sur fond foncé. */
.theme-sombre { --bs-body-bg: #0f1729; --bs-body-color: #dce3ee; --bs-secondary-bg: #18243d; --bs-tertiary-bg: #141e33; --bs-border-color: #2a3956; --bs-emphasis-color: #f1f5fb; --bs-secondary-color: rgba(220,227,238,.7); }
.theme-sombre .card, .theme-sombre .dropdown-menu, .theme-sombre .modal-content, .theme-sombre .list-group-item { background-color: #141e33; border-color: #2a3956; }
.theme-sombre .card-header { background: #18243d; color: #e6edf7; }
.theme-sombre .table { --bs-table-bg: transparent; --bs-table-color: #dce3ee; --bs-table-border-color: #2a3956; --bs-table-striped-bg: rgba(255,255,255,.03); --bs-table-hover-bg: rgba(255,255,255,.05); }
.theme-sombre .table-light { --bs-table-bg: #18243d; --bs-table-color: #e6edf7; }
.theme-sombre .stat .stat-value, .theme-sombre .tile, .theme-sombre .section-title, .theme-sombre .card-header, .theme-sombre .req-link { color: #e6edf7; }
.theme-sombre .chart text, .theme-sombre .hb-lbl { fill: #c8d2e0; color: #c8d2e0; }
.theme-sombre .chart .ch-big { fill: #f1f5fb; }
.theme-sombre .chart .ch-grid { stroke: #2a3956; }
.theme-sombre .menu-sections .dropdown-header { color: #e6edf7; border-color: #2a3956; }
.theme-sombre .menu-sections .dropdown-item { color: #dce3ee; }
.theme-sombre .menu-sections .dropdown-item:hover, .theme-sombre .menu-sections .dropdown-item.current, .theme-sombre .req-link:hover, .theme-sombre .ch-legend a:hover { background: #1f2d4a; color: #fff; }
.theme-sombre .att-grid th:first-child, .theme-sombre .decision { background: #141e33; }
.theme-sombre .flatpickr-input[readonly].form-control:not([disabled]) { background-color: var(--bs-body-bg); }
.theme-sombre .text-muted { color: rgba(220,227,238,.62) !important; }
.theme-sombre .bg-white, .theme-sombre .bg-light { background-color: #141e33 !important; }
.theme-sombre .alert-light { --bs-alert-bg: #18243d; --bs-alert-color: #dce3ee; }
.theme-sombre .changes { color: #b6c1d1; }

/* Design à menu latéral */
.design-lateral { --sb-w: 268px; }
.app-shell { display: flex; min-height: 100vh; }
.app-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.sidebar { --bs-offcanvas-width: var(--sb-w); --bs-offcanvas-bg: var(--t-800); background: linear-gradient(180deg, var(--t-800), var(--t-900)); color: #dfe6f2; }
@media (min-width: 1200px) {
  .sidebar { position: sticky; top: 0; height: 100vh; width: var(--sb-w); flex: 0 0 var(--sb-w); display: flex; flex-direction: column; }
}
.sidebar.offcanvas-xl.show, .sidebar.offcanvas-xl.showing { display: flex; flex-direction: column; }
.sb-brand { display: flex; align-items: center; gap: .6rem; padding: 1rem 1rem .8rem; border-bottom: 1px solid rgba(255,255,255,.08); }
.sb-logo { height: 42px; width: 42px; object-fit: contain; background: rgba(255,255,255,.95); border-radius: 50%; padding: 3px; flex: 0 0 42px; }
.sb-title { color: #fff; font-weight: 700; font-size: 1.15rem; line-height: 1.1; letter-spacing: .03em; }
.sb-title small { display: block; font-weight: 400; font-size: .68rem; letter-spacing: 0; color: rgba(255,255,255,.65); margin-top: .15rem; }
.sb-search { position: relative; padding: .75rem .9rem .5rem; }
.sb-search .bi { position: absolute; left: 1.55rem; top: 1.28rem; color: rgba(255,255,255,.5); font-size: .85rem; }
.sb-search input { width: 100%; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); border-radius: 8px; color: #fff; padding: .4rem .6rem .4rem 2rem; font-size: .88rem; outline: none; }
.sb-search input::placeholder { color: rgba(255,255,255,.5); }
.sb-search input:focus { border-color: var(--t-accent); background: rgba(255,255,255,.12); }
.sb-nav { flex: 1 1 auto; overflow-y: auto; padding: .3rem .6rem 1rem; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.2) transparent; }
.sb-link { display: flex; align-items: center; gap: .7rem; width: 100%; padding: .55rem .75rem; margin: .1rem 0; border: 0; border-radius: 8px; background: none; color: #dfe6f2; text-decoration: none; font-size: .95rem; font-weight: 500; text-align: left; }
.sb-link > .bi:first-child { font-size: 1.1rem; width: 1.2rem; color: rgba(255,255,255,.7); }
.sb-link:hover { background: rgba(255,255,255,.07); color: #fff; }
.sb-link.active { background: rgba(255,255,255,.1); color: #fff; box-shadow: inset 3px 0 0 var(--t-accent); }
.sb-link.active > .bi:first-child { color: var(--t-accent); }
.sb-chev { margin-left: auto; font-size: .75rem; transition: transform .15s; opacity: .7; }
.sb-toggle:not(.collapsed) .sb-chev { transform: rotate(180deg); }
.sb-sub { padding: .15rem 0 .4rem 1.1rem; margin-left: .85rem; border-left: 1px solid rgba(255,255,255,.1); }
.sb-sec-title { font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: var(--t-accent); font-weight: 700; padding: .55rem .5rem .2rem; opacity: .9; }
.sb-item { display: flex; align-items: flex-start; gap: .5rem; padding: .32rem .5rem; border-radius: 6px; color: rgba(223,230,242,.85); text-decoration: none; font-size: .86rem; line-height: 1.3; }
.sb-item .bi { font-size: .82rem; margin-top: .12rem; opacity: .65; flex: 0 0 .9rem; }
.sb-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.sb-item.current { background: var(--t-accent); color: var(--t-900); font-weight: 600; }
.sb-item.current .bi { opacity: 1; }
.sb-empty { color: rgba(255,255,255,.55); font-size: .85rem; padding: .5rem .75rem; }
.sb-foot { display: flex; justify-content: space-between; align-items: center; padding: .6rem 1rem; font-size: .75rem; color: rgba(255,255,255,.5); border-top: 1px solid rgba(255,255,255,.08); }
.sb-foot a { color: rgba(255,255,255,.75); text-decoration: none; }
.sb-foot a:hover { color: #fff; }
.topbar { position: sticky; top: 0; z-index: 1020; display: flex; align-items: center; gap: .75rem; padding: .55rem 1.25rem; background: var(--bs-body-bg, #fff); border-bottom: 1px solid var(--bs-border-color, #e5e9f0); box-shadow: 0 1px 6px rgba(20,38,74,.05); }
.design-lateral:not(.theme-sombre) .topbar { background: #fff; }
.topbar-burger { font-size: 1.5rem; padding: 0 .25rem; color: var(--t-800); }
.theme-sombre .topbar-burger { color: #e6edf7; }
.topbar-crumb { font-size: .88rem; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: .35rem; }
.topbar-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 50%; color: var(--t-800); text-decoration: none; font-size: 1.15rem; }
.theme-sombre .topbar-btn, .theme-sombre .topbar-user { color: #e6edf7; }
.topbar-btn:hover { background: var(--t-100); }
.topbar-btn .badge { position: absolute; top: 0; right: -2px; font-size: .62rem; }
.topbar-user { display: inline-flex; align-items: center; gap: .5rem; padding: .25rem .5rem; border-radius: 999px; color: var(--t-800); text-decoration: none; font-size: .9rem; font-weight: 500; }
.topbar-user:hover { background: var(--t-100); }
.topbar-avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, var(--t-600), var(--t-800)); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: .78rem; font-weight: 700; letter-spacing: .02em; }
.design-lateral main { padding-left: 1.5rem !important; padding-right: 1.5rem !important; }
.design-lateral .page-head h1 { font-weight: 600; color: var(--t-800); }
.theme-sombre.design-lateral .page-head h1 { color: #f1f5fb; }
.design-lateral .card { border: 1px solid var(--bs-border-color, #e6eaf0); box-shadow: 0 1px 3px rgba(20,38,74,.04); }
@media print { .sidebar, .topbar { display: none !important; } .app-shell { display: block; } }

/* Page « Apparence » : aperçus des designs et des thèmes */
.ui-choice { cursor: pointer; display: block; height: 100%; }
.ui-choice input { position: absolute; opacity: 0; }
.ui-choice .card { height: 100%; transition: box-shadow .12s, border-color .12s; border: 2px solid var(--bs-border-color, #e1e6ee); }
.ui-choice input:checked + .card { border-color: var(--t-600); box-shadow: 0 0 0 3px rgba(var(--t-600-rgb), .2); }
.ui-choice input:focus-visible + .card { outline: 2px solid var(--t-600); }
.ui-mock { width: 100%; height: auto; display: block; border-radius: 6px; }
.ui-swatch { display: flex; height: 38px; border-radius: 8px; overflow: hidden; }
.ui-swatch span { flex: 1; }
/* 1.20 : grille des versements par boursier et par mois */
.cg-grille td.cg { min-width: 3.6rem; white-space: nowrap; text-align: center; cursor: pointer; position: relative; line-height: 1.15; padding: .25rem .2rem; }
.cg-grille td.cg .cg-box { position: absolute; top: 2px; left: 3px; margin: 0; width: .8rem; height: .8rem; }
.cg-grille td.cg small { opacity: .8; }
td.cg-paye, .cg-leg.cg-paye { background: rgba(25,135,84,.16) !important; color: #146c43; }
td.cg-partiel, .cg-leg.cg-partiel { background: rgba(255,193,7,.25) !important; color: #7a5a00; }
td.cg-du, .cg-leg.cg-du { background: rgba(220,53,69,.13) !important; color: #b02a37; }
td.cg-avenir, .cg-leg.cg-avenir { background: rgba(108,117,125,.08) !important; color: #6c757d; }
td.cg-trou, .cg-leg.cg-trou { background: rgba(255,193,7,.10) !important; outline: 2px dashed rgba(204,150,0,.7); outline-offset: -3px; color: #7a5a00; font-weight: 600; }
td.cg-vide { color: #adb5bd; }
td.cg.cg-sel { box-shadow: inset 0 0 0 3px var(--t-600, #2e75b6); }
.cg-leg { display: inline-block; width: 1rem; height: .8rem; border-radius: 2px; vertical-align: -1px; margin-right: .2rem; border: 1px solid rgba(0,0,0,.1); }
.cg-actions { position: sticky; top: .5rem; z-index: 5; }
[data-bs-theme="dark"] td.cg-paye { color: #75b798; } [data-bs-theme="dark"] td.cg-du { color: #ea868f; }
[data-bs-theme="dark"] td.cg-partiel, [data-bs-theme="dark"] td.cg-trou { color: #ffda6a; }
/* 1.20 : 11 rubriques ; libellés courts dans le menu du haut (nom complet en infobulle) */
.nav-short { display: none; }
@media (min-width: 1200px) { nav.navbar .nav-long { display: none; } nav.navbar .nav-short { display: inline; } nav.navbar .navbar-brand small { display: none; } }
@media (min-width: 1200px) and (max-width: 1799.98px) { nav.navbar .nav-home .nav-txt { display: none; } nav.navbar .d-xxl-inline { display: none !important; } }
.cg-grille th, .cg-grille td.text-end { white-space: nowrap; }
.nav-portail { height: 36px; width: 36px; border-radius: 9px; box-shadow: 0 0 0 1px rgba(255,255,255,.25); }
