/* QuaiZéro — qz-core.css : tokens, layout, composants partagés.
   Classes préfixées « qz- ». Les pages ajoutent leurs styles propres dans leur JS
   (QZ.css(id, text)) ou réutilisent ces classes. */

:root{
  color-scheme: light;
  --qz-navy:#0B1220; --qz-navy-2:#111a2e; --qz-navy-3:#1a2540; --qz-navy-line:rgba(255,255,255,.08);
  --qz-side-text:#AEB7C8; --qz-side-muted:#6B7690;
  --qz-gold:#C9A24A; --qz-gold-soft:rgba(201,162,74,.12);
  --qz-bronze:#B8893A; --qz-bronze-600:#9E7430; --qz-bronze-pale:#E4D3AE; --qz-bronze-50:#FBF6EC;
  --qz-bg:#F5F6F8; --qz-card:#FFFFFF; --qz-border:#E6E8EC; --qz-border-2:#D5D9E0; --qz-hover:#F8F9FB;
  --qz-text:#0F172A; --qz-text-2:#334155; --qz-muted:#64748B; --qz-muted-2:#94A3B8;
  --qz-green:#15803D; --qz-green-50:#ECFDF3; --qz-red:#DC2626; --qz-red-50:#FEF2F2;
  --qz-orange:#C2410C; --qz-orange-50:#FFF4EB; --qz-blue:#2563EB; --qz-blue-50:#EFF5FF;
  --qz-purple:#7E22CE; --qz-purple-50:#F6EEFF; --qz-cyan:#0E7490; --qz-cyan-50:#EAFAFD;
  --qz-pink:#DB2777; --qz-pink-50:#FDEEF6; --qz-indigo:#4338CA; --qz-indigo-50:#EEF0FF;
  --qz-yellow:#A16207; --qz-yellow-50:#FEF9E7; --qz-slate:#475569; --qz-slate-50:#F1F5F9;
  --qz-gold-50:#FBF4E4;
  /* 9 contrôles */
  --qz-c1:#64748B; --qz-c2:#16A34A; --qz-c3:#EA580C; --qz-c4:#9333EA; --qz-c5:#E11D48;
  --qz-c6:#0891B2; --qz-c7:#4F46E5; --qz-c8:#DC2626; --qz-c9:#EAB308;
  --qz-radius:12px; --qz-radius-sm:8px;
  --qz-shadow:0 1px 2px rgba(15,23,42,.04);
  --qz-shadow-lg:0 12px 40px rgba(15,23,42,.18);
  --qz-side-w:268px; --qz-top-h:68px;
  --qz-font:'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

*,*::before,*::after{ box-sizing:border-box; }
html,body{ margin:0; padding:0; }
/* Barre du haut collante : un champ atteint au clavier (Tab, focus) ou par scrollIntoView ne passe jamais dessous. */
html{ scroll-padding-top:calc(var(--qz-top-h) + 12px); }
body{ background:var(--qz-bg); color:var(--qz-text); font-family:var(--qz-font); font-size:14px; line-height:1.45;
  -webkit-font-smoothing:antialiased; -webkit-text-size-adjust:100%; overflow-x:hidden; }
body.qz-noscroll{ overflow:hidden; }
button,input,select,textarea{ font:inherit; color:inherit; }
a{ color:var(--qz-bronze-600); }
[hidden]{ display:none !important; }
.qz-num,.qz-tnum{ font-variant-numeric:tabular-nums; }
.qz-sr{ position:absolute !important; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
.qz-muted{ color:var(--qz-muted); }
.qz-ico{ flex:none; display:inline-block; vertical-align:middle; }

/* ------------------------------------------------------------------ Shell */
.qz-shell{ display:flex; min-height:100vh; }
.qz-side{ position:fixed; inset:0 auto 0 0; width:var(--qz-side-w); background:var(--qz-navy); color:var(--qz-side-text);
  display:flex; flex-direction:column; z-index:40; }
.qz-brand{ display:flex; align-items:center; gap:12px; padding:20px 20px 18px; text-decoration:none; }
.qz-brand img{ width:40px; height:40px; object-fit:contain; border-radius:10px; background:#fff; padding:3px; }
.qz-brand-mono{ width:40px; height:40px; border-radius:10px; background:var(--qz-gold); color:var(--qz-navy); font-weight:800;
  display:flex; align-items:center; justify-content:center; font-size:18px; }
.qz-word{ font-weight:800; font-size:21px; letter-spacing:.06em; line-height:1; white-space:nowrap; }
.qz-word .w1{ color:#fff; } .qz-word .w2{ color:var(--qz-gold); }
.qz-word-sub{ display:block; font-size:10.5px; font-weight:500; letter-spacing:.04em; color:var(--qz-side-muted); margin-top:5px; }
.qz-nav{ flex:1; overflow-y:auto; padding:6px 12px 12px; scrollbar-width:thin; scrollbar-color:#27324a transparent; }
.qz-nav::-webkit-scrollbar{ width:6px; } .qz-nav::-webkit-scrollbar-thumb{ background:#27324a; border-radius:3px; }
.qz-nav-item{ display:flex; align-items:center; gap:12px; padding:8px 12px; margin:1px 0; white-space:nowrap; border-radius:10px; color:var(--qz-side-text);
  text-decoration:none; font-size:13.5px; font-weight:500; border:1px solid transparent; transition:background .15s, color .15s; }
.qz-nav-item .qz-ico{ opacity:.9; }
.qz-nav-item span{ overflow:hidden; text-overflow:ellipsis; }
.qz-nav-item:hover{ background:rgba(255,255,255,.05); color:#fff; }
.qz-nav-item.active{ color:var(--qz-gold); border-color:rgba(201,162,74,.75); background:var(--qz-gold-soft); font-weight:600; }
.qz-nav-item:focus-visible{ outline:2px solid var(--qz-gold); outline-offset:1px; }
.qz-nav-badge{ margin-left:auto; min-width:20px; height:20px; padding:0 6px; border-radius:10px; background:var(--qz-red); color:#fff;
  font-size:11px; font-weight:700; display:inline-flex; align-items:center; justify-content:center; }
.qz-side-foot{ padding:12px 16px 12px; border-top:1px solid var(--qz-navy-line); }
.qz-side-card{ background:linear-gradient(135deg, #1B2742 0%, #131C31 100%); border:1px solid rgba(201,162,74,.25); border-radius:12px;
  padding:12px 14px; color:#fff; }
.qz-side-card .t{ display:flex; align-items:center; gap:8px; font-weight:800; letter-spacing:.06em; font-size:13px; color:var(--qz-gold); }
.qz-side-card .t .arrow{ width:24px; height:24px; border-radius:7px; background:rgba(201,162,74,.16); display:flex; align-items:center; justify-content:center; }
.qz-side-card p{ margin:6px 0 0; font-size:12px; line-height:1.45; color:#C7CEDB; }
.qz-back{ display:flex; align-items:center; gap:8px; margin-top:8px; padding:6px 4px; color:var(--qz-side-muted); font-size:12.5px; text-decoration:none; }
.qz-back:hover{ color:#fff; }

.qz-main{ flex:1; min-width:0; margin-left:var(--qz-side-w); display:flex; flex-direction:column; min-height:100vh; }
.qz-top{ position:sticky; top:0; z-index:30; height:var(--qz-top-h); background:#fff; border-bottom:1px solid var(--qz-border);
  display:flex; align-items:center; gap:14px; padding:0 24px; }
.qz-iconbtn.qz-burger{ display:none; }
.qz-search{ position:relative; flex:1; max-width:460px; min-width:0; }
.qz-search-box{ display:flex; align-items:center; gap:8px; height:40px; padding:0 12px; border:1px solid var(--qz-border); border-radius:10px;
  background:var(--qz-bg); color:var(--qz-muted); transition:border-color .15s, background .15s; }
.qz-search-box:focus-within{ border-color:var(--qz-bronze); background:#fff; box-shadow:0 0 0 3px rgba(184,137,58,.14); }
.qz-search-box input{ border:0; outline:0; background:transparent; flex:1; min-width:0; height:100%; font-size:13.5px; color:var(--qz-text); }
.qz-search-box input::placeholder{ color:var(--qz-muted-2); }
.qz-iconbtn.qz-search-toggle{ display:none; }
.qz-search-drop{ position:absolute; left:0; right:0; top:46px; background:#fff; border:1px solid var(--qz-border); border-radius:12px;
  box-shadow:var(--qz-shadow-lg); max-height:420px; overflow-y:auto; padding:6px; z-index:60; }
.qz-search-item{ display:flex; align-items:center; gap:10px; padding:9px 10px; border-radius:8px; cursor:pointer; }
.qz-search-item .ic{ width:30px; height:30px; border-radius:8px; background:var(--qz-bg); color:var(--qz-muted); display:flex; align-items:center; justify-content:center; flex:none; }
.qz-search-item .l{ font-weight:600; font-size:13.5px; color:var(--qz-text); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.qz-search-item .s{ font-size:12px; color:var(--qz-muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.qz-search-item .tx{ min-width:0; flex:1; }
.qz-search-item.active,.qz-search-item:hover{ background:var(--qz-bronze-50); }
.qz-search-item.active .ic{ background:#fff; color:var(--qz-bronze); }
.qz-search-empty{ padding:14px; color:var(--qz-muted); font-size:13px; text-align:center; }
.qz-search-group{ padding:8px 10px 4px; font-size:11px; font-weight:600; letter-spacing:.05em; text-transform:uppercase; color:var(--qz-muted-2); }

.qz-top-right{ margin-left:auto; display:flex; align-items:center; gap:14px; min-width:0; }
.qz-soc{ display:flex; align-items:center; gap:6px; }
.qz-soc-box{ position:relative; display:flex; align-items:center; gap:8px; height:40px; padding:0 10px 0 12px; border:1px solid var(--qz-border);
  border-radius:10px; background:#fff; color:var(--qz-muted); }
.qz-soc-box:focus-within{ border-color:var(--qz-bronze); box-shadow:0 0 0 3px rgba(184,137,58,.14); }
.qz-soc-box select{ appearance:none; -webkit-appearance:none; border:0; outline:0; background:transparent; color:var(--qz-text); font-weight:600;
  font-size:13.5px; padding-right:20px; max-width:200px; cursor:pointer; text-overflow:ellipsis; }
.qz-soc-box .chev{ position:absolute; right:9px; pointer-events:none; color:var(--qz-muted); }
.qz-iconbtn{ position:relative; width:40px; height:40px; border-radius:10px; border:1px solid var(--qz-border); background:#fff; color:var(--qz-text-2);
  display:inline-flex; align-items:center; justify-content:center; cursor:pointer; flex:none; padding:0; transition:background .15s,border-color .15s; }
.qz-iconbtn:hover{ background:var(--qz-hover); border-color:var(--qz-border-2); }
.qz-iconbtn:focus-visible{ outline:2px solid var(--qz-bronze); outline-offset:2px; }
.qz-iconbtn.gold{ background:var(--qz-bronze); border-color:var(--qz-bronze); color:#fff; }
.qz-iconbtn.gold:hover{ background:var(--qz-bronze-600); }
.qz-iconbtn.locked{ background:#F3F4F6; color:var(--qz-muted-2); border-color:var(--qz-border); cursor:not-allowed; }
.qz-iconbtn.ghost{ border-color:transparent; }
.qz-badge-dot{ position:absolute; top:-6px; right:-6px; min-width:19px; height:19px; padding:0 5px; border-radius:10px; background:var(--qz-red);
  color:#fff; font-size:10.5px; font-weight:700; display:flex; align-items:center; justify-content:center; border:2px solid #fff; font-variant-numeric:tabular-nums; }
.qz-today{ font-size:13px; color:var(--qz-muted); white-space:nowrap; }
.qz-today::first-letter{ text-transform:uppercase; }
.qz-me{ display:flex; align-items:center; gap:10px; padding:4px 6px 4px 4px; border-radius:12px; border:0; background:transparent; cursor:pointer; text-align:left; }
.qz-me:hover{ background:var(--qz-hover); }
.qz-avatar{ width:38px; height:38px; border-radius:50%; background:var(--qz-navy); color:var(--qz-gold); font-weight:700; font-size:13.5px;
  display:flex; align-items:center; justify-content:center; flex:none; letter-spacing:.02em; text-transform:uppercase; }
.qz-me .n{ font-weight:600; font-size:13.5px; line-height:1.2; white-space:nowrap; max-width:160px; overflow:hidden; text-overflow:ellipsis; }
.qz-me .r{ font-size:12px; color:var(--qz-muted); line-height:1.2; }
.qz-tip{ position:relative; }
.qz-tip[data-tip]:hover::after,.qz-tip[data-tip]:focus-visible::after{ content:attr(data-tip); position:absolute; top:calc(100% + 8px); right:0; width:220px;
  background:var(--qz-navy); color:#fff; font-size:12px; font-weight:500; line-height:1.4; padding:8px 10px; border-radius:8px; z-index:70; white-space:normal; text-align:left; }
.qz-menu{ position:absolute; top:calc(100% + 8px); right:0; background:#fff; border:1px solid var(--qz-border); border-radius:12px; box-shadow:var(--qz-shadow-lg);
  min-width:220px; padding:6px; z-index:70; }
.qz-menu a,.qz-menu button{ display:flex; align-items:center; gap:10px; width:100%; padding:9px 10px; border-radius:8px; border:0; background:transparent;
  color:var(--qz-text); text-decoration:none; cursor:pointer; font-size:13.5px; text-align:left; }
.qz-menu a:hover,.qz-menu button:hover{ background:var(--qz-hover); }
.qz-menu .hd{ padding:8px 10px 10px; border-bottom:1px solid var(--qz-border); margin-bottom:4px; }
.qz-menu .hd b{ display:block; font-size:13.5px; } .qz-menu .hd span{ font-size:12px; color:var(--qz-muted); word-break:break-all; }

.qz-content{ flex:1; padding:28px 32px 48px; }
.qz-container{ max-width:1350px; margin:0 auto; }
.qz-page-head{ display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin-bottom:22px; flex-wrap:wrap; }
.qz-page-head h1{ margin:0; font-size:26px; font-weight:800; letter-spacing:-.015em; line-height:1.2; color:var(--qz-text); }
.qz-page-head p{ margin:6px 0 0; color:var(--qz-muted); font-size:14px; }
.qz-page-actions{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.qz-page-actions:empty{ display:none; }
.qz-page-body{ min-width:0; }
.qz-scrim{ display:none; }

/* ------------------------------------------------------------------ Cards & grids */
.qz-card{ background:var(--qz-card); border:1px solid var(--qz-border); border-radius:var(--qz-radius); box-shadow:var(--qz-shadow); padding:20px; min-width:0; }
.qz-card + .qz-card{ margin-top:16px; }
.qz-grid .qz-card + .qz-card, .qz-kpis .qz-card + .qz-card{ margin-top:0; }
.qz-card-head{ display:flex; align-items:flex-start; justify-content:space-between; gap:12px; margin-bottom:14px; }
.qz-card-title{ margin:0; font-size:16px; font-weight:700; color:var(--qz-text); display:flex; align-items:center; gap:8px; }
.qz-card-sub{ margin:3px 0 0; font-size:13px; color:var(--qz-muted); }
.qz-card.flush{ padding:0; overflow:hidden; }
.qz-card.accent{ border-left:4px solid var(--qz-accent, var(--qz-bronze)); }
.qz-card.accent-top{ border-top:4px solid var(--qz-accent, var(--qz-bronze)); }
.qz-card.outline{ border-color:var(--qz-accent, var(--qz-border)); }
.qz-ctl-1{ --qz-accent:var(--qz-c1); --qz-accent-50:#F1F5F9; } .qz-ctl-2{ --qz-accent:var(--qz-c2); --qz-accent-50:#ECFDF3; }
.qz-ctl-3{ --qz-accent:var(--qz-c3); --qz-accent-50:#FFF4EB; } .qz-ctl-4{ --qz-accent:var(--qz-c4); --qz-accent-50:#F6EEFF; }
.qz-ctl-5{ --qz-accent:var(--qz-c5); --qz-accent-50:#FFF0F3; } .qz-ctl-6{ --qz-accent:var(--qz-c6); --qz-accent-50:#EAFAFD; }
.qz-ctl-7{ --qz-accent:var(--qz-c7); --qz-accent-50:#EEF0FF; } .qz-ctl-8{ --qz-accent:var(--qz-c8); --qz-accent-50:#FEF2F2; }
.qz-ctl-9{ --qz-accent:var(--qz-c9); --qz-accent-50:#FEF9E7; }
.qz-ctl-num{ display:inline-flex; align-items:center; justify-content:center; min-width:34px; height:28px; padding:0 8px; border-radius:8px;
  background:var(--qz-accent-50, var(--qz-bronze-50)); color:var(--qz-accent, var(--qz-bronze)); font-weight:800; font-size:13px; font-variant-numeric:tabular-nums; }
.qz-grid{ display:grid; gap:16px; grid-template-columns:repeat(var(--cols, 2), minmax(0,1fr)); }
.qz-grid.c2{ --cols:2; } .qz-grid.c3{ --cols:3; } .qz-grid.c4{ --cols:4; }
.qz-kpis{ display:grid; gap:16px; grid-template-columns:repeat(auto-fit, minmax(210px,1fr)); margin-bottom:16px; }
.qz-stack > * + *{ margin-top:16px; }
.qz-row{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.qz-spacer{ flex:1; }
.qz-divider{ height:1px; background:var(--qz-border); margin:16px 0; border:0; }

/* KPI */
.qz-kpi{ position:relative; display:flex; flex-direction:column; gap:6px; padding:18px 20px; }
.qz-kpi-label{ font-size:13px; color:var(--qz-muted); font-weight:500; padding-right:48px; }
.qz-kpi-value{ font-size:26px; font-weight:800; letter-spacing:-.01em; color:var(--qz-text); line-height:1.15; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.qz-kpi-sub{ font-size:12.5px; color:var(--qz-muted); display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.qz-kpi-ic{ position:absolute; top:16px; right:16px; width:40px; height:40px; border-radius:11px; display:flex; align-items:center; justify-content:center; }
.qz-trend{ display:inline-flex; align-items:center; gap:3px; font-weight:600; font-variant-numeric:tabular-nums; }
.qz-trend.up{ color:var(--qz-green); } .qz-trend.down{ color:var(--qz-red); } .qz-trend.flat{ color:var(--qz-muted); }
.tone-gold{ background:var(--qz-gold-50); color:var(--qz-bronze); } .tone-green{ background:var(--qz-green-50); color:var(--qz-green); }
.tone-red{ background:var(--qz-red-50); color:var(--qz-red); } .tone-orange{ background:var(--qz-orange-50); color:var(--qz-orange); }
.tone-blue{ background:var(--qz-blue-50); color:var(--qz-blue); } .tone-purple{ background:var(--qz-purple-50); color:var(--qz-purple); }
.tone-cyan{ background:var(--qz-cyan-50); color:var(--qz-cyan); } .tone-pink{ background:var(--qz-pink-50); color:var(--qz-pink); }
.tone-indigo{ background:var(--qz-indigo-50); color:var(--qz-indigo); } .tone-yellow{ background:var(--qz-yellow-50); color:var(--qz-yellow); }
.tone-slate{ background:var(--qz-slate-50); color:var(--qz-slate); }

/* ------------------------------------------------------------------ Buttons & forms */
.qz-btn{ display:inline-flex; align-items:center; justify-content:center; gap:8px; height:40px; padding:0 16px; border-radius:10px; border:1px solid transparent;
  font-weight:600; font-size:13.5px; cursor:pointer; text-decoration:none; white-space:nowrap; transition:background .15s, border-color .15s, color .15s; user-select:none; }
.qz-btn:focus-visible{ outline:2px solid var(--qz-bronze); outline-offset:2px; }
.qz-btn.primary,.qz-btn:not(.secondary):not(.ghost):not(.danger):not(.dashed):not(.light){ background:var(--qz-bronze); color:#fff; }
.qz-btn.primary:hover:not(:disabled){ background:var(--qz-bronze-600); }
.qz-btn:not(.secondary):not(.ghost):not(.danger):not(.dashed):not(.light):hover:not(:disabled){ background:var(--qz-bronze-600); }
.qz-btn:disabled,.qz-btn[aria-disabled="true"]{ cursor:not-allowed; }
.qz-btn.primary:disabled,.qz-btn:not(.secondary):not(.ghost):not(.danger):not(.dashed):not(.light):disabled{ background:var(--qz-bronze-pale); color:#fff; }
.qz-btn.secondary{ background:#fff; color:var(--qz-text); border-color:var(--qz-border-2); }
.qz-btn.secondary:hover:not(:disabled){ background:var(--qz-hover); }
.qz-btn.light{ background:var(--qz-bronze-50); color:var(--qz-bronze-600); border-color:rgba(184,137,58,.25); }
.qz-btn.light:hover:not(:disabled){ background:#F5EBD5; }
.qz-btn.ghost{ background:transparent; color:var(--qz-text-2); }
.qz-btn.ghost:hover:not(:disabled){ background:rgba(15,23,42,.05); }
.qz-btn.danger{ background:var(--qz-red); color:#fff; } .qz-btn.danger:hover:not(:disabled){ background:#B91C1C; }
.qz-btn.dashed{ background:#fff; color:var(--qz-text-2); border:1.5px dashed var(--qz-border-2); }
.qz-btn.dashed:hover:not(:disabled){ border-color:var(--qz-bronze); color:var(--qz-bronze-600); background:var(--qz-bronze-50); }
.qz-btn:disabled.secondary,.qz-btn:disabled.ghost,.qz-btn:disabled.dashed,.qz-btn:disabled.light{ opacity:.55; }
.qz-btn.sm{ height:32px; padding:0 11px; font-size:12.5px; border-radius:8px; gap:6px; }
.qz-btn.lg{ height:46px; padding:0 22px; font-size:14.5px; }
.qz-btn.block{ width:100%; }
.qz-btn.icon{ width:40px; padding:0; } .qz-btn.sm.icon{ width:32px; }
.qz-spin{ width:16px; height:16px; border-radius:50%; border:2px solid currentColor; border-right-color:transparent; animation:qzspin .7s linear infinite; flex:none; }
.qz-spin.lg{ width:28px; height:28px; border-width:3px; color:var(--qz-bronze); }
@keyframes qzspin{ to{ transform:rotate(360deg); } }

.qz-field{ display:flex; flex-direction:column; gap:6px; min-width:0; }
.qz-field > label,.qz-label{ font-size:12.5px; font-weight:600; color:var(--qz-text-2); }
.qz-hint{ font-size:12px; color:var(--qz-muted); }
.qz-input,.qz-select,.qz-textarea{ width:100%; min-width:0; height:40px; padding:0 12px; border:1px solid var(--qz-border-2); border-radius:10px; background:#fff;
  color:var(--qz-text); font-size:13.5px; outline:0; transition:border-color .15s, box-shadow .15s; }
.qz-textarea{ height:auto; min-height:90px; padding:10px 12px; resize:vertical; line-height:1.45; }
.qz-select{ appearance:none; -webkit-appearance:none; padding-right:34px; cursor:pointer;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right 10px center; }
.qz-input:focus,.qz-select:focus,.qz-textarea:focus{ border-color:var(--qz-bronze); box-shadow:0 0 0 3px rgba(184,137,58,.15); }
.qz-input.num{ text-align:right; font-variant-numeric:tabular-nums; }
.qz-input.sm,.qz-select.sm{ height:32px; font-size:12.5px; border-radius:8px; }
.qz-form{ display:grid; gap:14px; grid-template-columns:repeat(2, minmax(0,1fr)); }
.qz-form .full{ grid-column:1 / -1; }
.qz-check{ display:inline-flex; align-items:center; gap:8px; font-size:13.5px; cursor:pointer; }
.qz-check input{ width:16px; height:16px; accent-color:var(--qz-bronze); }
.qz-drop{ border:1.5px dashed var(--qz-border-2); border-radius:12px; padding:22px; text-align:center; color:var(--qz-muted); background:#FCFCFD;
  transition:border-color .15s, background .15s; }
.qz-drop.over{ border-color:var(--qz-bronze); background:var(--qz-bronze-50); }

/* Chips / status */
.qz-chip{ display:inline-flex; align-items:center; gap:5px; height:24px; padding:0 9px; border-radius:999px; font-size:12px; font-weight:600; white-space:nowrap;
  background:var(--qz-slate-50); color:var(--qz-slate); }
.qz-chip.ok,.qz-chip.green{ background:var(--qz-green-50); color:var(--qz-green); }
.qz-chip.warn,.qz-chip.orange{ background:var(--qz-orange-50); color:var(--qz-orange); }
.qz-chip.danger,.qz-chip.red{ background:var(--qz-red-50); color:var(--qz-red); }
.qz-chip.info,.qz-chip.blue{ background:var(--qz-blue-50); color:var(--qz-blue); }
.qz-chip.gold{ background:var(--qz-gold-50); color:var(--qz-bronze-600); }
.qz-chip.purple{ background:var(--qz-purple-50); color:var(--qz-purple); }
.qz-dot{ width:8px; height:8px; border-radius:50%; display:inline-block; flex:none; background:currentColor; }
.qz-notice{ display:flex; gap:10px; align-items:flex-start; padding:12px 14px; border-radius:10px; font-size:13px; border:1px solid; }
.qz-notice.info{ background:var(--qz-blue-50); border-color:#CFE0FF; color:#1E40AF; }
.qz-notice.warn{ background:var(--qz-orange-50); border-color:#FBD5B5; color:#9A3412; }
.qz-notice.danger{ background:var(--qz-red-50); border-color:#FECACA; color:#991B1B; }
.qz-notice.ok{ background:var(--qz-green-50); border-color:#BBF7D0; color:#166534; }

/* Period bar */
.qz-period{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; background:#fff; border:1px solid var(--qz-border); border-radius:var(--qz-radius);
  padding:10px 12px; margin-bottom:18px; }
.qz-seg{ display:flex; gap:3px; flex-wrap:wrap; }
.qz-seg button{ height:34px; padding:0 10px; border-radius:999px; border:1px solid var(--qz-border); background:#fff; color:var(--qz-text-2); font-weight:500;
  font-size:12.5px; cursor:pointer; transition:background-color .15s, border-color .15s, color .15s; }
.qz-seg button:focus-visible{ outline:2px solid var(--qz-bronze); outline-offset:2px; }
.qz-seg button:hover{ border-color:var(--qz-border-2); background:var(--qz-hover); }
.qz-seg button.active{ background:var(--qz-navy); border-color:var(--qz-navy); color:#fff; font-weight:600; }
.qz-period-nav{ display:flex; align-items:center; gap:6px; }
.qz-period-nav .qz-input{ width:162px; height:34px; min-width:0; padding:0 8px 0 10px; }
.qz-period-nav .qz-iconbtn{ width:34px; height:34px; border-radius:9px; }
.qz-period-range{ margin-left:auto; display:flex; align-items:center; gap:8px; font-size:12.5px; color:var(--qz-text-2); font-weight:600;
  font-variant-numeric:tabular-nums; white-space:nowrap; }
.qz-period-range .lbl{ color:var(--qz-muted); font-weight:500; }
.qz-period-range .rg{ display:inline-flex; align-items:center; gap:7px; background:var(--qz-bg); border-radius:8px; padding:6px 9px; }
.qz-period-range .rg .qz-ico{ color:var(--qz-muted); }

/* ------------------------------------------------------------------ Table */
.qz-table-wrap{ width:100%; overflow-x:auto; -webkit-overflow-scrolling:touch; }
.qz-table{ width:100%; border-collapse:separate; border-spacing:0; font-size:13.5px; }
.qz-table th{ text-align:left; font-size:12px; font-weight:600; color:var(--qz-muted); background:#FAFBFC; padding:10px 14px; border-bottom:1px solid var(--qz-border);
  white-space:nowrap; position:sticky; top:0; }
.qz-table th.sortable{ cursor:pointer; user-select:none; } .qz-table th.sortable:hover{ color:var(--qz-text); }
.qz-table th .sort{ opacity:.35; margin-left:4px; } .qz-table th.sorted .sort{ opacity:1; color:var(--qz-bronze); }
.qz-table td{ padding:11px 14px; border-bottom:1px solid #EEF0F3; vertical-align:middle; color:var(--qz-text); }
.qz-table tr:last-child td{ border-bottom:0; }
.qz-table tbody tr.click{ cursor:pointer; } .qz-table tbody tr.click:hover td{ background:var(--qz-hover); }
.qz-table .r,.qz-table td.num,.qz-table th.num{ text-align:right; font-variant-numeric:tabular-nums; }
.qz-table .c{ text-align:center; }
.qz-table tfoot td{ font-weight:700; background:#FAFBFC; border-top:1px solid var(--qz-border); border-bottom:0; }
.qz-table-empty{ padding:36px 16px; text-align:center; color:var(--qz-muted); }
.qz-card.flush .qz-table th:first-child,.qz-card.flush .qz-table td:first-child{ padding-left:20px; }
.qz-card.flush .qz-table th:last-child,.qz-card.flush .qz-table td:last-child{ padding-right:20px; }

/* Empty / placeholder / loading */
.qz-empty{ display:flex; flex-direction:column; align-items:center; text-align:center; gap:8px; padding:40px 20px; color:var(--qz-muted); }
.qz-empty .ic{ width:52px; height:52px; border-radius:14px; background:var(--qz-bg); color:var(--qz-muted-2); display:flex; align-items:center; justify-content:center; margin-bottom:4px; }
.qz-empty b{ color:var(--qz-text); font-size:15px; }
.qz-empty p{ margin:0; max-width:440px; font-size:13.5px; }
.qz-loading{ display:flex; align-items:center; justify-content:center; gap:12px; padding:48px 16px; color:var(--qz-muted); font-size:13.5px; }
.qz-skel{ background:linear-gradient(90deg,#EEF0F3 25%,#F6F7F9 50%,#EEF0F3 75%); background-size:200% 100%; animation:qzsk 1.2s infinite; border-radius:8px; }
@keyframes qzsk{ to{ background-position:-200% 0; } }
.qz-construct{ text-align:center; padding:56px 24px; }
.qz-construct .ic{ width:64px; height:64px; margin:0 auto 16px; border-radius:18px; display:flex; align-items:center; justify-content:center; background:var(--qz-gold-50); color:var(--qz-bronze); }
.qz-construct h2{ margin:0 0 8px; font-size:19px; }
.qz-construct p{ margin:0 auto; max-width:480px; color:var(--qz-muted); }
.qz-construct .tag{ display:inline-block; margin-top:16px; font-size:12px; font-weight:600; color:var(--qz-bronze-600); background:var(--qz-bronze-50); border:1px solid rgba(184,137,58,.25); padding:4px 10px; border-radius:999px; }

/* ------------------------------------------------------------------ Modal & toasts */
.qz-modal-bg{ position:fixed; inset:0; background:rgba(11,18,32,.55); z-index:100; display:flex; align-items:center; justify-content:center; padding:20px;
  animation:qzfade .15s ease-out; }
.qz-modal{ background:#fff; border-radius:16px; box-shadow:var(--qz-shadow-lg); width:100%; max-width:560px; max-height:calc(100vh - 40px); display:flex; flex-direction:column;
  animation:qzpop .18s ease-out; }
.qz-modal.sm{ max-width:420px; } .qz-modal.lg{ max-width:820px; } .qz-modal.xl{ max-width:1100px; }
.qz-modal-head{ display:flex; align-items:center; justify-content:space-between; gap:12px; padding:18px 20px 12px; }
.qz-modal-head h2{ margin:0; font-size:17px; font-weight:700; min-width:0; overflow-wrap:anywhere; }
.qz-modal-body{ padding:4px 20px 18px; overflow-y:auto; color:var(--qz-text-2); }
.qz-modal-body > p:first-child{ margin-top:0; }
.qz-modal-foot{ display:flex; justify-content:flex-end; gap:10px; padding:14px 20px; border-top:1px solid var(--qz-border); flex-wrap:wrap; }
@keyframes qzfade{ from{ opacity:0; } } @keyframes qzpop{ from{ opacity:0; transform:translateY(8px) scale(.98); } }
.qz-toasts{ position:fixed; right:20px; bottom:20px; z-index:200; display:flex; flex-direction:column; gap:10px; max-width:min(420px, calc(100vw - 32px)); pointer-events:none; }
.qz-toast{ pointer-events:auto; display:flex; align-items:flex-start; gap:10px; padding:12px 14px; background:var(--qz-navy); color:#fff; border-radius:12px;
  box-shadow:var(--qz-shadow-lg); font-size:13.5px; animation:qzpop .2s ease-out; border-left:4px solid var(--qz-gold); }
.qz-toast .x{ margin-left:auto; background:none; border:0; color:#9AA4B8; cursor:pointer; padding:0 0 0 6px; font-size:18px; line-height:1; }
.qz-toast.success{ border-left-color:#22C55E; } .qz-toast.error{ border-left-color:#F87171; } .qz-toast.warning{ border-left-color:#F59E0B; }
.qz-toast .ti{ flex:none; margin-top:1px; }
.qz-toast > div{ flex:1; min-width:0; overflow-wrap:anywhere; }   /* nom de 200 caractères sans espace : retour à la ligne, bouton × visible */
.qz-toast.success .ti{ color:#4ADE80; } .qz-toast.error .ti{ color:#F87171; } .qz-toast.warning .ti{ color:#FBBF24; } .qz-toast.info .ti{ color:var(--qz-gold); }
.qz-toast.out{ opacity:0; transform:translateY(6px); transition:all .2s; }

/* ------------------------------------------------------------------ Charts */
.qz-chart{ position:relative; width:100%; min-width:0; }
.qz-chart > svg{ display:block; width:100%; height:auto; overflow:visible; }
.qz-chart-empty svg{ width:26px; height:26px; }
.qz-chart .axis{ fill:var(--qz-muted); font-size:11px; font-variant-numeric:tabular-nums; }
.qz-chart .grid{ stroke:#EDEFF2; stroke-width:1; }
.qz-chart .base{ stroke:#D5D9E0; stroke-width:1; }
.qz-chart .vlabel{ fill:var(--qz-text-2); font-size:11px; font-weight:600; font-variant-numeric:tabular-nums; }
.qz-chart .mark{ transition:opacity .15s; }
.qz-chart .hit{ fill:transparent; cursor:default; }
.qz-chart:hover .mark.dim{ opacity:.45; }
.qz-legend{ display:flex; flex-wrap:wrap; gap:6px 16px; margin-top:10px; font-size:12.5px; color:var(--qz-text-2); }
.qz-legend span{ display:inline-flex; align-items:center; gap:6px; }
.qz-legend i{ width:10px; height:10px; border-radius:3px; display:inline-block; flex:none; }
.qz-legend .v{ color:var(--qz-muted); font-variant-numeric:tabular-nums; }
.qz-chart-tip{ position:absolute; pointer-events:none; background:var(--qz-navy); color:#fff; font-size:12px; line-height:1.4; padding:7px 10px; border-radius:8px;
  white-space:nowrap; z-index:5; transform:translate(-50%, calc(-100% - 10px)); box-shadow:0 6px 18px rgba(0,0,0,.18); font-variant-numeric:tabular-nums; }
.qz-chart-tip b{ font-weight:700; }
.qz-chart-empty{ display:flex; align-items:center; justify-content:center; flex-direction:column; gap:6px; min-height:160px; color:var(--qz-muted-2); font-size:13px;
  border:1px dashed var(--qz-border); border-radius:10px; background:#FCFCFD; }
.qz-donut-wrap{ display:flex; align-items:center; gap:20px; flex-wrap:wrap; }
.qz-donut-wrap svg{ width:180px; flex:none; }
.qz-donut-wrap .qz-legend{ flex-direction:column; flex:1; min-width:160px; margin-top:0; }
.qz-donut-wrap .qz-legend span{ display:grid; grid-template-columns:minmax(0,1fr) auto; gap:12px; align-items:center; }
.qz-donut-wrap .qz-legend span > em{ font-style:normal; display:inline-flex; align-items:center; gap:6px; min-width:0; }
.qz-donut-c1{ font-size:17px; font-weight:800; fill:var(--qz-text); font-variant-numeric:tabular-nums; }
.qz-donut-c2{ font-size:11px; fill:var(--qz-muted); }

/* ------------------------------------------------------------------ Gate & boot */
.qz-gate{ min-height:100vh; display:flex; align-items:center; justify-content:center; padding:24px;
  background:radial-gradient(1200px 600px at 20% -10%, #1C2A48 0%, var(--qz-navy) 55%); }
.qz-gate-card{ width:100%; max-width:460px; background:#fff; border-radius:18px; padding:32px 28px; text-align:center; box-shadow:0 30px 80px rgba(0,0,0,.35); }
.qz-gate-card .qz-brand{ justify-content:center; padding:0 0 22px; }
.qz-gate-card .qz-word .w1{ color:var(--qz-navy); }
.qz-gate-card .qz-word-sub{ color:var(--qz-muted); }
.qz-gate-ic{ width:56px; height:56px; margin:0 auto 14px; border-radius:16px; display:flex; align-items:center; justify-content:center; }
.qz-gate-card h1{ margin:0 0 8px; font-size:20px; font-weight:800; }
.qz-gate-card p{ margin:0 0 20px; color:var(--qz-muted); font-size:14px; }
.qz-gate-card .qz-btn{ width:100%; } .qz-gate-card .qz-btn + .qz-btn{ margin-top:10px; }
.qz-gate-err{ font-size:12px; color:var(--qz-red); margin-top:12px; word-break:break-word; }
.qz-boot{ min-height:100vh; display:flex; align-items:center; justify-content:center; flex-direction:column; gap:14px; background:var(--qz-navy); color:#AEB7C8; font-size:13px; }
.qz-boot .qz-spin{ color:var(--qz-gold); width:26px; height:26px; border-width:3px; }

/* ------------------------------------------------------------------ Responsive */
@media (max-width: 1440px){
  .qz-period-range .lbl{ display:none; }
}
@media (max-width: 1200px){
  .qz-today{ display:none; }
  .qz-grid.c4{ --cols:2; }
}
@media (max-width: 1024px){
  .qz-me .tx{ display:none; }
  .qz-grid.c3{ --cols:2; }
  .qz-content{ padding:24px 20px 40px; }
  .qz-top{ padding:0 16px; }
}
@media (max-width: 700px){
  :root{ --qz-top-h:58px; }
  .qz-side{ transform:translateX(-100%); transition:transform .22s ease; width:min(84vw, 290px); box-shadow:none; }
  body.qz-drawer .qz-side{ transform:none; box-shadow:0 0 40px rgba(0,0,0,.4); }
  .qz-scrim{ display:block; position:fixed; inset:0; background:rgba(11,18,32,.5); z-index:35; opacity:0; pointer-events:none; transition:opacity .2s; }
  body.qz-drawer .qz-scrim{ opacity:1; pointer-events:auto; }
  .qz-main{ margin-left:0; }
  .qz-top{ gap:8px; padding:0 12px; }
  .qz-iconbtn.qz-burger{ display:inline-flex; }
  .qz-search{ position:static; flex:0 0 auto; max-width:none; }
  .qz-iconbtn.qz-search-toggle{ display:inline-flex; }
  .qz-search-box{ display:none; }
  .qz-top.search-open .qz-search-box{ display:flex; position:absolute; left:10px; right:10px; top:9px; z-index:61; background:#fff; border-color:var(--qz-bronze); }
  .qz-top.search-open .qz-search-drop{ left:10px; right:10px; top:54px; }
  .qz-top-right{ gap:8px; margin-left:auto; }
  .qz-soc-box{ padding:0 8px; height:38px; }
  .qz-soc-box > .qz-ico:first-child{ display:none; }
  .qz-soc-box select{ max-width:32vw; font-size:13px; }
  .qz-iconbtn{ width:38px; height:38px; }
  .qz-me{ padding:0; } .qz-avatar{ width:36px; height:36px; font-size:12.5px; }
  .qz-content{ padding:18px 14px 36px; }
  .qz-page-head{ margin-bottom:16px; }
  .qz-page-head h1{ font-size:22px; }
  .qz-page-head p{ font-size:13.5px; }
  .qz-grid,.qz-grid.c2,.qz-grid.c3,.qz-grid.c4{ --cols:1; }
  .qz-kpis{ grid-template-columns:1fr 1fr; gap:10px; }
  .qz-kpi{ padding:14px; } .qz-kpi-value{ font-size:20px; } .qz-kpi-ic{ width:32px; height:32px; top:12px; right:12px; border-radius:9px; }
  .qz-kpi-label{ padding-right:36px; font-size:12px; }
  .qz-card{ padding:16px; }
  .qz-form{ grid-template-columns:1fr; }
  .qz-period{ gap:10px; padding:10px; }
  .qz-seg{ width:100%; flex-wrap:nowrap; overflow-x:auto; scrollbar-width:none; }
  .qz-seg::-webkit-scrollbar{ display:none; }
  .qz-seg button{ flex:none; padding:0 12px; }
  .qz-period-nav{ flex:1; } .qz-period-nav .qz-input{ flex:1; min-width:0; }
  .qz-period-range{ margin-left:0; width:100%; justify-content:space-between; }
  /* Tables → cartes */
  .qz-table-wrap{ overflow:visible; }
  .qz-table.qz-resp thead{ display:none; }
  .qz-table.qz-resp, .qz-table.qz-resp tbody, .qz-table.qz-resp tr, .qz-table.qz-resp td{ display:block; width:100%; }
  .qz-table.qz-resp tbody tr{ border:1px solid var(--qz-border); border-radius:12px; padding:6px 12px; margin:0 0 10px; background:#fff; }
  .qz-card.flush .qz-table.qz-resp tbody{ padding:10px; }
  .qz-table.qz-resp td{ display:flex; justify-content:space-between; align-items:center; gap:12px; padding:7px 0 !important; border-bottom:1px solid #F1F2F5; text-align:right; }
  .qz-table.qz-resp td:last-child{ border-bottom:0; }
  .qz-table.qz-resp td::before{ content:attr(data-label); color:var(--qz-muted); font-size:12px; font-weight:500; text-align:left; flex:none; max-width:45%; }
  .qz-table.qz-resp td.primary{ font-weight:700; font-size:14px; text-align:left; justify-content:flex-start; }
  .qz-table.qz-resp td.primary::before{ display:none; }
  .qz-table.qz-resp td.mhide{ display:none !important; }
  .qz-table.qz-resp td[data-label=""]::before{ display:none; }
  .qz-table.qz-resp tfoot{ display:block; } .qz-table.qz-resp tfoot tr{ display:block; }
  .qz-table.qz-resp tfoot td{ display:flex; justify-content:space-between; }
  .qz-table.qz-resp tfoot td::before{ content:attr(data-label); }
  .qz-toasts{ left:16px; right:16px; bottom:16px; max-width:none; }
  .qz-modal-bg{ padding:0; align-items:flex-end; }
  .qz-modal,.qz-modal.lg,.qz-modal.xl,.qz-modal.sm{ max-width:none; border-radius:16px 16px 0 0; max-height:92vh; }
  .qz-modal-foot .qz-btn{ flex:1; }
  .qz-donut-wrap svg{ width:150px; margin:0 auto; }
}
@media (max-width: 380px){
  .qz-kpis{ grid-template-columns:1fr; }
  .qz-soc-box select{ max-width:28vw; }
}
@media print{
  .qz-side,.qz-top,.qz-period,.qz-toasts,.qz-page-actions{ display:none !important; }
  .qz-main{ margin-left:0; } .qz-content{ padding:0; } body{ background:#fff; }
}
