:root {
  --bg-color: #f4f6f8; --text-color: #333; --card-bg: white;
  --header-bg: #1565c0; --border-color: #ddd; --section-bg: #f9f9f9;
}
body.dark-mode {
  --bg-color: #121212; --text-color: #e0e0e0; --card-bg: #1e1e1e;
  --header-bg: #0d47a1; --border-color: #333; --section-bg: #252525;
}
* { box-sizing: border-box; }
body { font-family: 'Roboto', 'Segoe UI', sans-serif; background: var(--bg-color); color: var(--text-color); margin: 0; display: flex; min-height: 100vh; }

.sidebar { width: 220px; flex-shrink: 0; background: linear-gradient(180deg,#1b2a4a,#162240); color: #e0e8f0; padding: 16px 12px; display: flex; flex-direction: column; gap: 8px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side-logo { font-weight: 800; font-size: 0.95rem; margin-bottom: 10px; padding: 0 4px; }
.sideBtn { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); color: #e0e8f0; padding: 12px 10px; border-radius: 8px; cursor: pointer; text-align: left; font-size: 0.85rem; font-weight: 600; display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.sideBtn:hover { background: rgba(255,255,255,0.14); }
.sideBtn.primary { background: #1565c0; }
.sideBtn.active { outline: 2px solid #42a5f5; }
.badgeBtn { background: #4caf50; color: white; border-radius: 10px; padding: 1px 8px; font-size: 0.72rem; font-weight: 700; }
.badgeBtn.orange { background: #ff9800; color: #000; }
.badgeBtn.red { background: #f44336; }

.main { flex: 1; min-width: 0; }
.view { display: none; padding: 20px; max-width: 1300px; margin: 0 auto; }
.view.active { display: block; }

/* Pages "autonomes" ouvertes via un lien à token (fiches non traitées, etc.) — pas besoin de
   la barre latérale de l'appli complète, surtout gênante à l'impression. */
body.standalone-view .sidebar { display: none; }
body.standalone-view #global-loader { display: none !important; }
body.standalone-view .view { max-width: none; padding: 0; }

.fnt-header { background:#1b2a4a; color:#fff; padding:14px 20px; display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.fnt-header h1 { margin:0; font-size:16px; font-weight:800; }
.fnt-header-right { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.fnt-badge { background:rgba(255,255,255,.15); padding:3px 10px; border-radius:20px; font-size:11px; }
.fnt-btn { padding:8px 16px; border-radius:8px; font-size:12px; font-weight:700; cursor:pointer; border:1px solid rgba(255,255,255,.3); background:rgba(255,255,255,.15); color:#fff; }
.fnt-btn:hover { background:rgba(255,255,255,.25); }
.fnt-btn.danger { background:rgba(231,76,60,.85); border-color:rgba(231,76,60,.5); }
.fnt-btn.danger:hover { background:#c0392b; }
.fnt-container { max-width:1200px; margin:24px auto; padding:0 16px 60px; }
.fnt-intro { background:rgba(33,150,243,.07); border:1px solid rgba(33,150,243,.2); border-radius:10px; padding:12px 16px; margin-bottom:20px; font-size:12px; color:var(--text-color); opacity:.8; }
.fnt-empty { text-align:center; padding:60px; opacity:.6; font-size:14px; }
.fnt-section-block { margin-bottom:28px; }
.fnt-section-title { font-size:14px; font-weight:800; margin:0 0 10px; padding-bottom:6px; border-bottom:2px solid var(--border-color); display:flex; align-items:center; gap:8px; }
.fnt-isp-block { margin-bottom:14px; }
.fnt-isp-name { font-size:12px; font-weight:700; opacity:.65; text-transform:uppercase; letter-spacing:.4px; margin-bottom:6px; padding:4px 0; }
.fnt-fiche-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(260px,1fr)); gap:8px; }
.fnt-fiche-card { background:var(--card-bg); border:1px solid var(--border-color); border-radius:8px; padding:12px; cursor:pointer; transition:.15s; }
.fnt-fiche-card:hover { border-color:#2196F3; box-shadow:0 2px 10px rgba(33,150,243,.15); }
.fnt-fiche-card.grave { border-left:4px solid #e74c3c; }
.fnt-fiche-card.bilan_leger, .fnt-fiche-card.pisu_leger { border-left:4px solid #e67e22; }
.fnt-fiche-top { display:flex; justify-content:space-between; align-items:flex-start; margin-bottom:6px; gap:6px; }
.fnt-fiche-id { font-weight:800; font-size:12px; }
.fnt-fiche-nom { font-size:11px; opacity:.65; margin-bottom:2px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.fnt-fiche-date { font-size:11px; font-weight:600; }
.fnt-fiche-motif { font-size:11px; opacity:.65; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.fnt-tag { display:inline-block; padding:3px 9px; border-radius:4px; font-size:10.5px; font-weight:700; text-transform:uppercase; flex-shrink:0; }
.fnt-tag.grave { background:rgba(231,76,60,.12); color:#e74c3c; border:1px solid rgba(231,76,60,.3); }
.fnt-tag.leger { background:rgba(230,126,34,.12); color:#e67e22; border:1px solid rgba(230,126,34,.3); }
.fnt-tip { position:fixed; z-index:8000; background:var(--card-bg); border:1px solid var(--border-color); border-radius:9px; padding:11px 14px; box-shadow:0 6px 24px rgba(0,0,0,.25); max-width:320px; font-size:12px; pointer-events:none; display:none; line-height:1.5; }
.fnt-tip .tip-lbl { font-size:10px; font-weight:700; text-transform:uppercase; opacity:.55; margin-bottom:2px; margin-top:8px; }
.fnt-tip .tip-lbl:first-child { margin-top:0; }
.fnt-tip .tip-val { white-space:pre-wrap; }
.fnt-tip .tip-val.chef { background:var(--section-bg); padding:5px 7px; border-radius:5px; }
.fnt-tip .tip-val.med { background:#fff3e0; color:#3a2a00; padding:5px 7px; border-radius:5px; }
.fnt-tip .tip-val.req { background:#fce4ec; color:#4a0d20; padding:5px 7px; border-radius:5px; }
.fnt-tip .tip-none { opacity:.5; font-style:italic; }
.fnt-field-label { font-size:10px; font-weight:700; text-transform:uppercase; opacity:.6; margin-bottom:4px; letter-spacing:.3px; }
.fnt-field-box { background:var(--section-bg); padding:9px 11px; border-radius:6px; font-size:12px; white-space:pre-wrap; line-height:1.5; margin-bottom:8px; }
.fnt-field-box.med { background:#fff3e0; color:#3a2a00; }
.fnt-field-box.req { background:#fce4ec; color:#4a0d20; }
.fnt-field-none { opacity:.5; font-style:italic; font-size:12px; margin-bottom:8px; }
.fnt-drive-link { font-size:11.5px; color:#2196F3; text-decoration:none; }
.fnt-dl-progress { font-size:11px; opacity:.8; }

@media print {
  .fnt-header, .fnt-btn, .fnt-tip { display:none !important; }
  body.standalone-view { background:#fff; }
  .fnt-container { max-width:none; margin:0; padding:0; }
  .fnt-intro { display:none; }
  .fnt-fiche-grid { grid-template-columns:repeat(2,1fr); }
  .fnt-fiche-card { break-inside:avoid; }
  .fnt-section-block { break-inside:avoid-page; }
}

.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 20px; }
.kpi-tile { background: var(--card-bg); border-radius: 10px; padding: 18px; box-shadow: 0 2px 6px rgba(0,0,0,0.08); }
.kpi-tile h3 { margin: 0 0 8px 0; font-size: 0.85rem; text-transform: uppercase; opacity: 0.7; }
.kpi-tile .kpi-val { font-size: 1.8rem; font-weight: 700; color: #1565c0; }
.kpi-tile .kpi-sub { font-size: 0.8rem; opacity: 0.65; margin-top: 4px; }

.section-card { background: var(--card-bg); border-radius: 10px; padding: 18px; margin-bottom: 20px; box-shadow: 0 2px 6px rgba(0,0,0,0.08); }
.section-card h3 { margin-top: 0; }
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
th { text-align: left; background: var(--section-bg); padding: 8px; border-bottom: 2px solid var(--border-color); cursor: pointer; }
td { padding: 7px 8px; border-bottom: 1px solid var(--border-color); }

.btn { padding: 8px 16px; border: none; border-radius: 6px; cursor: pointer; font-weight: 600; font-size: 0.9rem; background: #1565c0; color: white; }
.btn.secondary { background: #78909c; } .btn.success { background: #43a047; } .btn.danger { background: #d32f2f; }
input, select, textarea { padding: 8px; border: 1px solid var(--border-color); border-radius: 6px; background: var(--card-bg); color: var(--text-color); font-size: 0.9rem; }

.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 1000; justify-content: center; align-items: center; }
.modal { background: var(--card-bg); border-radius: 8px; width: 95%; max-width: 900px; max-height: 90vh; display: flex; flex-direction: column; }
.modal.wide { max-width: 1200px; }
.modal-header { padding: 12px 16px; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; }
.modal-body { padding: 16px; overflow-y: auto; }
.pdf-frame { width: 100%; height: 60vh; border: none; border-radius: 6px; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 0.78rem; font-weight: 700; color: white; }
.badge.green { background: #4caf50; } .badge.orange { background: #ff9800; } .badge.red { background: #f44336; }

.chef-subnav { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.c-btn { flex: 1; min-width: 150px; background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 8px; padding: 12px; cursor: pointer; text-align: left; }
.c-btn.active { border-color: #1565c0; box-shadow: 0 0 0 2px rgba(21,101,192,0.3); }
.c-btn h4 { margin: 0 0 4px 0; font-size: 0.85rem; }
.c-btn p { margin: 0; font-size: 0.72rem; opacity: 0.7; }

.form-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border-color); gap: 10px; }
.proto-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px; }
.proto-chip { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 6px; background: var(--section-bg); font-size: 0.82rem; }

#global-loader { position: fixed; inset: 0; background: linear-gradient(160deg, #0d47a1 0%, #1565c0 55%, #1a237e 100%); display: flex; flex-direction: column; align-items: center; justify-content: center; color: white; z-index: 2000; }

/* Accès APP (Pass 0) — mise en page compacte fidèle à l'originale : 2 colonnes hauteur fixe */
#viewApp.active { display: flex !important; flex-direction: column; height: 100vh; padding: 10px; box-sizing: border-box; }
.pz-wrap { display: flex; gap: 10px; height: 100%; min-height: 0; }
.pz-left { flex: 2.5; min-width: 0; display: flex; flex-direction: column; }
.pz-right { flex: 2.2; min-width: 400px; display: flex; flex-direction: column; }
.pz-card { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 8px; overflow: hidden; display: flex; flex-direction: column; flex: 1; }
.pz-cardHead { padding: 6px 10px; border-bottom: 1px solid var(--border-color); background: var(--section-bg); flex-shrink: 0; }
.pz-interInfos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; font-size: 0.75rem; }
.pz-interItem { display: flex; flex-direction: column; overflow: hidden; }
.pz-interLabel { color: #888; font-size: 0.65rem; text-transform: uppercase; }
.pz-interVal { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pz-pdfBox { flex: 1; position: relative; background: rgba(0,0,0,.15); }
.pz-pdfBox iframe { width: 100%; height: 100%; border: 0; position: absolute; inset: 0; }
.pz-form { padding: 8px; display: flex; flex-direction: column; gap: 6px; overflow-y: auto; flex: 1; min-height: 0; }
.pz-group { padding: 6px 8px; border-radius: 8px; border: 1px solid var(--border-color); background: var(--section-bg); }
.pz-groupTitle { font-size: 0.7rem; font-weight: 800; text-transform: uppercase; opacity: 0.7; margin-bottom: 4px; }
.pz-grid-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 3px; }
.pz-grid-selects { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; font-size: 0.75rem; }
.pz-grid-selects select, .pz-grid-selects input, .pz-grid-selects label { font-size: 0.72rem; }
.pz-cb { display: flex; align-items: flex-start; gap: 5px; padding: 3px 6px; border-radius: 5px; background: var(--card-bg); border: 1px solid var(--border-color); font-size: 0.72rem; cursor: pointer; }
.pz-actions { margin-top: auto; padding-top: 6px; display: flex; gap: 8px; flex-shrink: 0; }

/* Page agent ISP dédiée */
.isp-kpi-row { display: flex; gap: 12px; flex-wrap: wrap; }
.isp-kpi { background: var(--card-bg); border: 1px solid var(--border-color); border-top: 3px solid #1565c0; border-radius: 10px; padding: 12px 16px; min-width: 150px; flex: 1; }
.isp-kpi.green { border-top-color: #4caf50; }
.isp-kpi-lbl { font-size: 0.68rem; text-transform: uppercase; opacity: 0.6; letter-spacing: 0.3px; }
.isp-kpi-val { font-size: 1.4rem; font-weight: 700; margin-top: 3px; }
.isp-kpi-sub { font-size: 0.72rem; opacity: 0.6; margin-top: 2px; }
.isp-header { display: flex; justify-content: space-between; align-items: center; background: linear-gradient(135deg,#1b2a4a,#162240); color: #fff; padding: 16px 20px; border-radius: 10px; }
.isp-hdr-name { font-size: 1.3rem; font-weight: 800; }
.isp-taux-badge { background: rgba(33,150,243,.2); border: 1px solid rgba(33,150,243,.5); border-radius: 10px; padding: 8px 16px; text-align: center; }
.cell-hi { background: rgba(33,150,243,.12); font-weight: 700; }
.cell-zero { color: #ccc; }
.num { text-align: center; font-family: monospace; }
.bilan-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 14px; }
.bc { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 10px; padding: 14px; text-align: center; }
.bc.vert { border-top: 4px solid #4caf50; } .bc.orange { border-top: 4px solid #ff9800; } .bc.rouge { border-top: 4px solid #f44336; }
.bc-num { font-size: 1.8rem; font-weight: 800; } .bc-num.vert { color: #4caf50; } .bc-num.orange { color: #ff9800; } .bc-num.rouge { color: #f44336; }
.bc-lbl { font-size: 0.75rem; opacity: 0.7; margin-top: 4px; }
.tag { display: inline-block; padding: 2px 7px; border-radius: 12px; font-size: 0.68rem; font-weight: 600; }
.tag-ok { color: #4caf50; background: rgba(76,175,80,.1); } .tag-orange { color: #ff9800; background: rgba(255,152,0,.1); } .tag-red { color: #f44336; background: rgba(244,67,54,.1); }
.comm-box { background: var(--section-bg); border: 1px solid var(--border-color); border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; font-size: 0.85rem; }
.comm-lbl { font-size: 0.68rem; text-transform: uppercase; opacity: 0.6; font-weight: 700; margin-bottom: 4px; }
.entretien-tile { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 10px; padding: 12px 14px; cursor: pointer; }
.entretien-tile:hover { border-color: #1565c0; }
.entretien-type-badge { display: inline-block; font-size: 0.7rem; font-weight: 700; padding: 2px 10px; border-radius: 10px; }
.entretien-type-badge.annual { background: #dbeafe; color: #1d4ed8; }
.entretien-type-badge.manual { background: #fef3c7; color: #92400e; }

/* ==================== Dashboard viz (accueil) ==================== */
.viz-root {
  --v-surface: #fcfcfb; --v-page: #f9f9f7; --v-ink: #0b0b0b; --v-ink-2: #52514e;
  --v-muted: #898781; --v-grid: #e1e0d9; --v-axis: #c3c2b7;
  --v-series-cur: #2a78d6; --v-series-prior: #b6b4ac;
  --v-good: #006300; --v-critical: #d03b3b; --v-border: rgba(11,11,11,0.10);
}
body.dark-mode .viz-root {
  --v-surface: #1a1a19; --v-page: #0d0d0d; --v-ink: #ffffff; --v-ink-2: #c3c2b7;
  --v-muted: #898781; --v-grid: #2c2c2a; --v-axis: #383835;
  --v-series-cur: #3987e5; --v-series-prior: #58564f;
  --v-good: #0ca30c; --v-critical: #e66767; --v-border: rgba(255,255,255,0.10);
}

.home-subnav { display: flex; gap: 8px; margin-bottom: 16px; }
.home-subnav button { padding: 8px 16px; border: 1px solid var(--border-color); border-radius: 20px; background: var(--card-bg); color: var(--text-color); cursor: pointer; font-size: 0.82rem; font-weight: 600; }
.home-subnav button.active { background: #1565c0; color: #fff; border-color: #1565c0; }
.home-pane { display: none; } .home-pane.active { display: block; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.stat-tile { background: var(--v-surface); border: 1px solid var(--v-border); border-radius: 8px; padding: 8px 12px; }
.stat-tile .st-label { font-size: 0.64rem; text-transform: uppercase; letter-spacing: .3px; color: var(--v-muted); }
.stat-tile .st-value { font-size: 1.25rem; font-weight: 700; color: var(--v-ink); margin-top: 1px; font-variant-numeric: tabular-nums; }
.stat-tile .st-delta { font-size: 0.66rem; color: var(--v-ink-2); margin-top: 1px; display: flex; align-items: center; gap: 4px; }
.stat-tile .st-delta .arrow-up { color: var(--v-good); font-weight: 700; }
.stat-tile .st-delta .arrow-down { color: var(--v-critical); font-weight: 700; }

.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; margin-bottom: 18px; }
.chart-card { background: var(--v-surface); border: 1px solid var(--v-border); border-radius: 10px; padding: 14px; position: relative; }
.chart-card .cc-title { font-size: 0.78rem; font-weight: 700; color: var(--v-ink); margin-bottom: 2px; }
.chart-legend { display: flex; gap: 12px; font-size: 0.68rem; color: var(--v-ink-2); margin-bottom: 6px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 4px; }
.chart-legend .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.chart-tip { position: absolute; pointer-events: none; background: var(--v-ink); color: var(--v-surface); font-size: 0.68rem; padding: 4px 8px; border-radius: 5px; opacity: 0; transform: translate(-50%,-115%); white-space: nowrap; transition: opacity .1s; z-index: 5; }
.chart-tip.show { opacity: 0.95; }
.chart-compare-table { width: 100%; margin-top: 14px; font-size: 0.78rem; }
.chart-compare-table th, .chart-compare-table td { text-align: center; padding: 6px 8px; font-variant-numeric: tabular-nums; }
.chart-compare-table thead th { color: var(--muted, #8b95a3); font-weight: 600; border-bottom: 1px solid var(--border-color); }
.chart-compare-table td:first-child { text-align: left; font-weight: 700; }

.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; align-items: start; margin-bottom: 20px; }
.detail-grid .section-card { margin-bottom: 0; }
.mini-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 20px; font-size: 0.8rem; }
.mini-grid .section-card { padding: 12px 14px; margin-bottom: 0; }
.mini-grid h4 { margin: 0 0 8px 0; font-size: 0.72rem; text-transform: uppercase; letter-spacing: .2px; opacity: 0.7; }
.compact-table-wrap { max-height: 340px; overflow-y: auto; overflow-x: auto; }
.compact-table-wrap thead th { position: sticky; top: 0; z-index: 2; box-shadow: 0 1px 0 var(--border-color); }
.tbl-clean { width: 100%; table-layout: auto; }
.tbl-clean th { white-space: normal; overflow-wrap: normal; word-break: normal; user-select: none; line-height: 1.25; vertical-align: bottom; }
.tbl-clean th, .tbl-clean td { text-align: center; }
.tbl-clean th:first-child, .tbl-clean td:first-child { text-align: left; }
.tbl-clean td.num, .tbl-clean th.num { font-family: monospace; }
.tbl-clean th:hover { background: rgba(21,101,192,.12); }
.tbl-clean .sort-arrow { font-size: 0.7em; opacity: 0.65; margin-left: 4px; }
.tbl-clean tbody tr:nth-child(even) td { background: var(--section-bg); }
.tbl-clean tbody tr.row-objectif-ok td { background: rgba(67,160,71,.16); }
.tbl-clean tbody tr.row-objectif-ko td { background: rgba(211,47,47,.14); }

/* Tableaux de données denses (admin + tableaux d'accueil) — resserré pour tenir sur l'écran
   comme sur l'ancienne webapp Google, au lieu du padding généreux des cartes normales. */
.tbl-dense .section-card { padding: 10px 12px; margin-bottom: 10px; }
.tbl-dense h3, .tbl-dense h4 { font-size: 0.82rem; margin: 0 0 6px; }
.tbl-dense table { font-size: 0.74rem; }
.tbl-dense th { padding: 4px 6px; }
.tbl-dense td { padding: 2px 6px; }
.tbl-dense .compact-table-wrap { max-height: 280px; }
.tbl-dense details.section-card summary { font-size: 0.82rem; }
.tbl-dense input, .tbl-dense select { font-size: 0.78rem; padding: 4px 6px; }

/* Frise chronologique — "Stats pratique analyse" (chefferie.js) : séquence d'étapes reliées,
   n'affiche que la moyenne entre chaque étape. */
.frise { display: flex; align-items: flex-start; padding: 10px 6px 4px; overflow-x: auto; }
.frise .step { flex: 1; min-width: 90px; display: flex; flex-direction: column; align-items: center; position: relative; text-align: center; padding: 0 4px; }
.frise .step:not(:last-child)::after { content: ""; position: absolute; top: 6px; left: 50%; width: 100%; height: 2px; background: var(--border-color); z-index: 0; }
.frise .step .dot { width: 13px; height: 13px; border-radius: 50%; background: #1565c0; z-index: 1; }
.frise .step .lbl { font-size: 0.72rem; font-weight: 700; margin-top: 6px; }
.frise .step .val { font-size: 0.72rem; opacity: 0.7; margin-top: 2px; font-variant-numeric: tabular-nums; }

/* ==================== Mobile (barre latérale en tiroir + mise en page empilée) ==================== */
.mobile-nav-toggle { display: none; }
.mobile-nav-overlay { display: none; }
body.standalone-view .mobile-nav-toggle { display: none !important; }

@media (max-width: 860px) {
  body { display: block; }

  .mobile-nav-toggle {
    display: flex; align-items: center; justify-content: center;
    position: fixed; top: 10px; left: 10px; z-index: 1600;
    width: 42px; height: 42px; border-radius: 8px; border: none;
    background: #1b2a4a; color: #fff; font-size: 1.3rem; cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,.35);
  }
  .mobile-nav-overlay.show { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 1400; }

  .sidebar {
    position: fixed; top: 0; left: 0; height: 100vh; width: 260px; max-width: 82vw;
    z-index: 1500; transform: translateX(-100%); transition: transform .22s ease;
    box-shadow: 4px 0 20px rgba(0,0,0,.35);
  }
  .sidebar.open { transform: translateX(0); }

  .main { width: 100%; }
  .view { padding: 12px; max-width: 100%; }
  .view.active { padding-top: 58px; }
  body.standalone-view .view.active { padding-top: 0; }

  /* grilles à colonnes fixes -> empilées ou réduites (les grilles auto-fit/auto-fill
     s'adaptent déjà toutes seules, seules celles à repeat(N, 1fr) ont besoin d'un correctif) */
  .bilan-grid { grid-template-columns: 1fr; }
  .pz-grid-selects { grid-template-columns: repeat(2, 1fr); }
  .pz-interInfos { grid-template-columns: repeat(2, 1fr); }
  .isp-header { flex-direction: column; align-items: flex-start; gap: 10px; }

  /* Accès APP (Pass 0) : PDF et formulaire empilés au lieu de côte à côte, plutôt que la
     largeur minimale de 400px imposée pour un affichage côte-à-côte desktop. */
  #viewApp.active { height: auto; }
  .pz-wrap { flex-direction: column; height: auto; }
  .pz-left, .pz-right { min-width: 0; }
  .pz-pdfBox { height: 55vh; }

  /* Modales plein écran : plus lisible qu'une fenêtre centrée trop petite sur mobile */
  .modal { width: 100%; max-width: 100%; height: 100%; max-height: 100%; border-radius: 0; }
}
