/* =====================================================================
   M² Manager - feuille de style
   Aucune dependance externe : s'affiche meme avec une connexion faible.
   ===================================================================== */
:root {
  --bg: #f4f6fb; --surface: #ffffff; --surface-2: #f8fafc; --text: #0f172a; --muted: #64748b;
  --border: #e5e9f2; --border-strong: #d5dbe7;
  --primary: #4f46e5; --primary-2: #7c3aed; --primary-soft: #eef0ff; --primary-text: #ffffff;
  --ring: rgba(79, 70, 229, .22);
  --ok: #059669; --ok-bg: #e7f8f0; --bad: #dc2626; --bad-bg: #fdecec; --warn: #b45309; --warn-bg: #fff6e0;
  --info: #0284c7; --info-bg: #e6f4fd;
  --side: #0b1020; --side-2: #121a36; --side-text: #c3cbe0; --side-muted: #6f7a98;
  --c-new: #06b6d4; --c-active: #4f46e5; --c-expired: #f59e0b; --c-disabled: #ef4444;
  --radius: 14px; --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 10px 30px -14px rgba(15, 23, 42, .16);
  --shadow-lg: 0 18px 40px -18px rgba(49, 46, 129, .45);
  --font: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0e18; --surface: #111827; --surface-2: #0e1422; --text: #e6e9f2; --muted: #96a0b8;
    --border: #1f2a3d; --border-strong: #2a364c;
    --primary: #818cf8; --primary-2: #a78bfa; --primary-soft: rgba(129, 140, 248, .13); --primary-text: #0b1020;
    --ring: rgba(129, 140, 248, .3);
    --ok: #34d399; --ok-bg: rgba(52, 211, 153, .12); --bad: #f87171; --bad-bg: rgba(248, 113, 113, .12);
    --warn: #fbbf24; --warn-bg: rgba(251, 191, 36, .12); --info: #38bdf8; --info-bg: rgba(56, 189, 248, .12);
    --side: #070a12; --side-2: #0d1326;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px -14px rgba(0, 0, 0, .6);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 15px; background: var(--bg); color: var(--text);
       line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: var(--ring); }

.container { max-width: 1240px; margin: 0 auto; padding: 26px 28px 40px; }
h1 { font-size: 1.55rem; font-weight: 750; letter-spacing: -.02em; margin: 0 0 14px; }
h2 { font-size: 1.05rem; font-weight: 700; letter-spacing: -.01em; margin: 0 0 12px; }
h1 .badge { margin-left: 6px; font-size: .75rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .86em; word-break: break-all;
       background: var(--surface-2); border: 1px solid var(--border); padding: 1px 6px; border-radius: 6px; }
pre code { background: none; border: 0; padding: 0; }
hr { border: 0; border-top: 1px solid var(--border); margin: 18px 0; }

/* ------------------------------------------------------------- cartes */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
        padding: 20px 22px; margin-bottom: 18px; box-shadow: var(--shadow); }
.card > h2 { display: flex; align-items: center; gap: 10px; }
.card > h2 .ico { color: var(--primary); background: var(--primary-soft); padding: 6px; width: 32px; height: 32px;
                  border-radius: 10px; }
.card.narrow { max-width: 480px; margin: 24px auto; }
.card.empty { text-align: center; padding: 44px 22px; }
.card.empty p { color: var(--muted); margin-top: 0; }

.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
             margin-bottom: 18px; }
.page-head h1 { margin: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
form.inline { display: inline; margin: 0; }

.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.grid2 > .card, .grid3 > .card { margin-bottom: 0; }
.grid2, .grid3 { margin-bottom: 18px; }

dl { display: grid; grid-template-columns: max-content 1fr; gap: 0; margin: 0; }
dt, dd { padding: 9px 0; border-bottom: 1px dashed var(--border); }
dt { color: var(--muted); padding-right: 18px; }
dd { margin: 0; font-weight: 550; }
dl > :nth-last-child(-n+2) { border-bottom: 0; }

/* ---------------------------------------------------------- formulaires */
label { display: block; margin-bottom: 14px; font-weight: 600; font-size: .9rem; }
input, textarea, select { width: 100%; margin-top: 6px; padding: 10px 12px; font: inherit; font-weight: 400;
                          color: var(--text); background: var(--surface); border: 1px solid var(--border-strong);
                          border-radius: var(--radius-sm); transition: border-color .15s, box-shadow .15s; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--ring); }
input::placeholder { color: var(--muted); opacity: .7; }
label.check { display: flex; gap: 10px; align-items: center; font-weight: 500; }
label.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--primary); }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row .grow { flex: 1 1 180px; }
.row .port { width: 120px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 14px 16px; }
.filters select, .filters input { width: auto; flex: 1 1 160px; margin: 0; }
.filters .custom { display: flex; gap: 8px; align-items: center; flex: 2 1 280px; }
.filters input[type=date] { flex: 1; }

/* -------------------------------------------------------------- boutons */
button, .button { display: inline-flex; align-items: center; justify-content: center; gap: 7px;
                  padding: 9px 15px; font: inherit; font-size: .9rem; font-weight: 600; line-height: 1.2;
                  cursor: pointer; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
                  background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm);
                  transition: background .15s, border-color .15s, transform .1s, box-shadow .15s; white-space: nowrap; }
button:hover, .button:hover { background: var(--surface-2); border-color: var(--muted); text-decoration: none; }
button:active, .button:active { transform: translateY(1px); }
button:focus-visible, .button:focus-visible, a:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--ring); }
button.primary, .button.primary { color: #fff; border-color: transparent;
  background: linear-gradient(135deg, var(--primary), var(--primary-2)); box-shadow: 0 6px 16px -8px var(--primary); }
button.primary:hover, .button.primary:hover { filter: brightness(1.07); background: linear-gradient(135deg, var(--primary), var(--primary-2)); }
button.danger { color: var(--bad); }
button.danger:hover { background: var(--bad-bg); border-color: var(--bad); }
button.link { border: none; background: none; box-shadow: none; padding: 0; color: var(--primary); font-weight: 600; }
button.link:hover { background: none; text-decoration: underline; }
.small-btn { padding: 5px 10px; font-size: .78rem; border-radius: 8px; }

/* ------------------------------------------------------------- messages */
.flash { position: relative; display: block; padding: 12px 16px 12px 34px; border-radius: 12px; margin-bottom: 16px;
         background: var(--ok-bg); color: var(--ok); border: 1px solid color-mix(in srgb, var(--ok) 25%, transparent);
         font-weight: 500; }
.flash::before { content: ""; position: absolute; left: 16px; top: 19px; width: 8px; height: 8px; border-radius: 50%;
                 background: currentColor; }
.flash.warn { background: var(--warn-bg); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.flash.error { background: var(--bad-bg); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 25%, transparent); }

/* --------------------------------------------------------------- badges */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px;
         font-size: .75rem; font-weight: 650; background: var(--surface-2); color: var(--muted);
         border: 1px solid var(--border); vertical-align: middle; letter-spacing: .01em; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.badge.bad { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.badge.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }

/* -------------------------------------------------------------- tableaux */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
              box-shadow: var(--shadow); margin-bottom: 18px; }
.card .table-wrap { border: 0; box-shadow: none; border-radius: 0; margin: 0 -22px -20px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
     background: var(--surface-2); position: sticky; top: 0; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: 0; }
td a strong { color: var(--text); }
td a:hover strong { color: var(--primary); }
tr.inactive td { opacity: .55; }
table.compact td { padding: 8px 10px; white-space: normal; }
table.compact th { padding: 8px 10px; }
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin: 16px 0; }

/* -------------------------------------------------------- petits chiffres */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin: 0 0 18px; }
.stat { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
        padding: 16px 18px 14px 22px; display: flex; flex-direction: column; color: var(--muted); font-size: .88rem;
        box-shadow: var(--shadow); overflow: hidden; }
.stat::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 4px; border-radius: 0 4px 4px 0;
                background: var(--primary); opacity: .8; }
.stat .num { font-size: 1.75rem; font-weight: 800; letter-spacing: -.02em; color: var(--text);
             font-variant-numeric: tabular-nums; }
.stat.ok::before { background: var(--ok); } .stat.ok .num { color: var(--ok); }
.stat.bad::before { background: var(--bad); } .stat.bad .num { color: var(--bad); }

/* ------------------------------------------------------- jauges / barres */
.meter { height: 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 99px;
         overflow: hidden; margin: 6px 0; }
.meter span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #10b981, #34d399); }
.meter.lvl1 span { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.meter.lvl2 span, .meter.lvl3 span { background: linear-gradient(90deg, #dc2626, #f87171); }
.meter.mini { height: 7px; min-width: 90px; }

.bars { display: flex; align-items: flex-end; gap: 4px; height: 130px; padding-top: 6px; }
.bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.bar span { width: 100%; min-height: 3px; border-radius: 6px 6px 2px 2px;
            background: linear-gradient(180deg, var(--primary-2), var(--primary)); opacity: .9; transition: opacity .15s; }
.bar:hover span { opacity: 1; }
.bar small { font-size: .7rem; color: var(--muted); height: 1.3em; margin-top: 4px; }

/* -------------------------------------------------------------- scripts */
.script-box { position: relative; }
.script-box pre { margin: 0; padding: 16px; padding-top: 44px; overflow-x: auto; font-size: .8rem; line-height: 1.55;
                  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
                  background: #0b1020; color: #d6dcf0; border: 1px solid var(--border); border-radius: 12px; }
.script-box .copy { position: absolute; top: 9px; right: 9px; }
pre { white-space: pre-wrap; }

/* ===================================================== mise en page */
body.with-nav { padding-left: 264px; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 264px; color: var(--side-text); overflow-y: auto;
           padding: 18px 14px 24px; z-index: 30; display: flex; flex-direction: column;
           background: radial-gradient(120% 60% at 0% 0%, rgba(99, 102, 241, .22), transparent 60%),
                       linear-gradient(180deg, var(--side-2), var(--side)); border-right: 1px solid rgba(255,255,255,.04); }
.sidebar .brand { display: flex; align-items: center; gap: 12px; color: #fff; font-weight: 800; font-size: 1.02rem;
                  letter-spacing: -.01em; padding: 4px 8px 22px; text-decoration: none; }
.sidebar .brand small { display: block; font-weight: 500; font-size: .72rem; color: var(--side-muted); letter-spacing: .02em; }
.sidebar .logo, .auth-logo { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
                 background: linear-gradient(135deg, #6366f1, #a855f7 60%, #ec4899); color: #fff; font-size: .95rem;
                 font-weight: 800; box-shadow: 0 8px 20px -8px rgba(168, 85, 247, .8); flex-shrink: 0; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar nav a, .sidebar nav .soon { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px;
                 border-radius: 10px; color: var(--side-text); font-weight: 500; font-size: .92rem; text-decoration: none;
                 transition: background .15s, color .15s; }
.sidebar nav a .ico { opacity: .75; }
.sidebar nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.sidebar nav a.active { background: linear-gradient(90deg, rgba(99, 102, 241, .32), rgba(99, 102, 241, .08)); color: #fff; }
.sidebar nav a.active .ico { opacity: 1; color: #a5b4fc; }
.sidebar nav a.active::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 4px;
                                border-radius: 0 4px 4px 0; background: #818cf8; }
.sidebar nav .soon { color: var(--side-muted); cursor: default; }
.sidebar nav .soon em { margin-left: auto; font-style: normal; font-size: .66rem; font-weight: 600; padding: 2px 8px;
                        border-radius: 99px; background: rgba(255, 255, 255, .07); letter-spacing: .02em; }
.sidebar .group { margin: 20px 12px 6px; font-size: .68rem; font-weight: 700; letter-spacing: .12em;
                  text-transform: uppercase; color: var(--side-muted); }
.sidebar .side-foot { margin-top: auto; padding: 18px 10px 0; font-size: .75rem; color: var(--side-muted); }
.sidebar .side-foot .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #34d399;
                           margin-right: 6px; box-shadow: 0 0 0 3px rgba(52, 211, 153, .18); }
.ico { flex-shrink: 0; vertical-align: middle; }

.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; padding: 12px 28px;
          background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(160%) blur(12px);
          -webkit-backdrop-filter: saturate(160%) blur(12px); border-bottom: 1px solid var(--border); }
.topbar .crumb { display: flex; flex-direction: column; line-height: 1.25; }
.topbar .crumb small { color: var(--muted); font-size: .75rem; }
.topbar .crumb strong { font-size: .98rem; }
.topbar .spacer { flex: 1; }
.topbar .burger { display: none; color: var(--text); }
.topbar .today { color: var(--muted); font-size: .85rem; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 4px 6px 4px 4px; border: 1px solid var(--border);
             border-radius: 99px; background: var(--surface); box-shadow: var(--shadow-sm); }
.user-chip .who { display: flex; flex-direction: column; line-height: 1.15; padding-right: 4px; }
.user-chip .who b { font-size: .85rem; }
.user-chip .who small { font-size: .7rem; color: var(--muted); text-transform: capitalize; }
.avatar { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: #fff;
          background: linear-gradient(135deg, #6366f1, #a855f7); font-weight: 700; font-size: .78rem; }
.topbar .logout { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
                  color: var(--muted); }
.topbar .logout:hover { background: var(--bad-bg); color: var(--bad); text-decoration: none; }
.backdrop { display: none; }

@media (max-width: 960px) {
  body.with-nav { padding-left: 0; }
  .sidebar { transform: translateX(-100%); transition: transform .22s ease; }
  body.nav-open .sidebar { transform: none; box-shadow: 20px 0 40px rgba(0, 0, 0, .3); }
  body.nav-open .backdrop { display: block; position: fixed; inset: 0; background: rgba(2, 6, 23, .5); z-index: 25; }
  .topbar { padding: 10px 16px; }
  .topbar .burger { display: inline-flex; }
  .topbar .today, .user-chip .who { display: none; }
  .container { padding: 18px 16px 32px; }
}

/* ===================================================== connexion */
body.no-nav .container { max-width: none; padding: 0; }
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-brand { position: relative; overflow: hidden; color: #fff; padding: 48px 56px; display: flex; flex-direction: column;
              background: radial-gradient(80% 60% at 100% 0%, rgba(236, 72, 153, .45), transparent 60%),
                          radial-gradient(70% 70% at 0% 100%, rgba(6, 182, 212, .35), transparent 60%),
                          linear-gradient(135deg, #312e81, #4f46e5 50%, #7c3aed); }
.auth-brand::after { content: ""; position: absolute; inset: 0; opacity: .12; pointer-events: none;
                     background-image: radial-gradient(#fff 1px, transparent 1px); background-size: 22px 22px; }
.auth-brand .top { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 1.1rem; }
.auth-brand .pitch { margin: auto 0; max-width: 460px; position: relative; z-index: 1; }
.auth-brand h2 { font-size: 2.1rem; line-height: 1.15; letter-spacing: -.03em; margin: 0 0 14px; }
.auth-brand p { opacity: .88; font-size: 1.02rem; margin: 0 0 22px; }
.auth-brand ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.auth-brand li { display: flex; gap: 12px; align-items: center; }
.auth-brand li span { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
                      background: rgba(255, 255, 255, .16); }
.auth-brand .foot { position: relative; z-index: 1; font-size: .8rem; opacity: .7; }
.auth-panel { display: grid; place-items: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h1 { font-size: 1.75rem; margin-bottom: 6px; }
.auth-card .lead { color: var(--muted); margin: 0 0 26px; }
.auth-card button.primary { width: 100%; padding: 12px; font-size: .95rem; margin-top: 6px; }
.auth-card .mobile-logo { display: none; margin-bottom: 22px; }
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .auth-card .mobile-logo { display: inline-grid; }
}

/* ===================================================== accueil */
.hero { position: relative; overflow: hidden; color: #fff; border-radius: 22px; padding: 28px 30px; margin-bottom: 22px;
        background: radial-gradient(70% 90% at 100% 0%, rgba(236, 72, 153, .38), transparent 60%),
                    radial-gradient(60% 80% at 0% 100%, rgba(6, 182, 212, .28), transparent 60%),
                    linear-gradient(135deg, #312e81, #4f46e5 55%, #7c3aed);
        box-shadow: var(--shadow-lg); }
.hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 260px; height: 260px; border-radius: 50%;
               border: 40px solid rgba(255, 255, 255, .06); pointer-events: none; }
.hero > * { position: relative; z-index: 1; }
.hero h1 { font-size: 1.9rem; margin: 0; letter-spacing: -.03em; }
.hero h2 { margin: 0 0 4px; font-size: 1.2rem; }
.hero p { margin: 4px 0; opacity: .9; }
.hero-main { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 18px; align-items: flex-start; }
.hello { display: flex; gap: 16px; align-items: center; }
.hello-ico { display: grid; place-items: center; width: 60px; height: 60px; border-radius: 18px;
             background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .2); }
.revenue { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; min-width: 230px; color: #fff;
           background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .22); border-radius: 16px;
           padding: 14px 20px; box-shadow: none; backdrop-filter: blur(6px); }
.revenue:hover { background: rgba(255, 255, 255, .2); border-color: rgba(255, 255, 255, .35); }
.revenue strong { font-size: 1.35rem; letter-spacing: .04em; }
.quick { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.quick a { display: flex; align-items: center; gap: 10px; padding: 10px 16px 10px 10px; border-radius: 14px; color: #fff;
           font-weight: 600; font-size: .92rem; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .16);
           transition: background .15s, transform .15s; }
.quick a:hover { text-decoration: none; background: rgba(255, 255, 255, .2); transform: translateY(-1px); }
.quick a span { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: #fff; color: #4f46e5; }
.hero.steps { background: var(--surface); color: var(--text); border: 1px solid var(--border); box-shadow: var(--shadow); }
.hero.steps::after { display: none; }
.hero.steps p { color: var(--muted); opacity: 1; }
.hero-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
button.link.light { color: var(--muted); font-weight: 600; }
.step { display: flex; align-items: center; gap: 12px; padding: 12px 16px; margin-top: 8px; border-radius: 12px;
        background: var(--surface-2); border: 1px solid var(--border); }
.step .tick { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--border-strong); }
.step.done .label { text-decoration: line-through; color: var(--muted); }
.step.done .tick { border: none; background: var(--ok); color: #fff; }
.step .pill { margin-left: auto; background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff;
              padding: 7px 14px; border-radius: 10px; font-weight: 600; font-size: .85rem; }
.step .pill:hover { text-decoration: none; filter: brightness(1.07); }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 22px; }
.kpi { --kc: #4f46e5; --kc2: #818cf8; position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 4px;
       padding: 18px 20px; border-radius: var(--radius); color: var(--text); min-height: 140px;
       background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
       transition: transform .15s, box-shadow .15s, border-color .15s; }
.kpi::before { content: ""; position: absolute; right: -40px; bottom: -40px; width: 130px; height: 130px; border-radius: 50%;
               background: radial-gradient(circle, color-mix(in srgb, var(--kc) 16%, transparent), transparent 70%); }
a.kpi:hover { text-decoration: none; transform: translateY(-2px); border-color: color-mix(in srgb, var(--kc) 40%, var(--border)); }
.kpi .k-title { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-weight: 600;
                font-size: .88rem; color: var(--muted); }
.kpi .k-title .ico { width: 38px; height: 38px; padding: 9px; border-radius: 12px; color: #fff;
                     background: linear-gradient(135deg, var(--kc), var(--kc2)); box-shadow: 0 8px 18px -10px var(--kc); }
.kpi .k-num { font-size: 2.1rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi .k-sub { color: var(--muted); font-size: .84rem; margin-top: auto; position: relative; }
.kpi.blue { --kc: #4f46e5; --kc2: #818cf8; }
.kpi.purple { --kc: #a21caf; --kc2: #e879f9; }
.kpi.green { --kc: #059669; --kc2: #34d399; }
.kpi.slate { --kc: #0369a1; --kc2: #38bdf8; }
.kpi.orange { --kc: #d97706; --kc2: #fbbf24; }

.right { text-align: right; margin-top: -36px; }
.bars.week { height: 200px; }
.bars.week .bar small { font-size: .72rem; white-space: nowrap; }
.bars.week .bar b { font-size: .75rem; color: var(--muted); font-weight: 600; }
.empty-chart { text-align: center; padding: 60px 0; }
.donut-wrap { display: grid; place-items: center; padding: 10px 0 18px; }
.donut { width: 170px; height: 170px; border-radius: 50%; display: grid; place-items: center; }
.donut span { display: grid; place-items: center; width: 116px; height: 116px; border-radius: 50%;
              background: var(--surface); font-size: 1.6rem; font-weight: 800; box-shadow: inset 0 0 0 1px var(--border); }
.legend { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 20px; }
.legend li { display: flex; align-items: center; gap: 8px; font-size: .9rem; padding: 6px 10px; border-radius: 9px;
             background: var(--surface-2); }
.legend i { width: 10px; height: 10px; border-radius: 3px; }
.legend b { margin-left: auto; }

@media print {
  .sidebar, .topbar, .no-print, .backdrop, .flash { display: none !important; }
  body.with-nav { padding-left: 0; }
  .card, .kpi, .stat, .table-wrap { box-shadow: none; }
  .kpi { min-height: 0; }
  .card { break-inside: avoid; }
}

/* ===================================================== quota */
.quota-hero { background: radial-gradient(70% 90% at 100% 0%, rgba(56, 189, 248, .35), transparent 60%),
                          linear-gradient(135deg, #064e3b, #0f766e 50%, #1e3a8a); }
.q-big { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin: 16px 0; }
.q-big > div { display: flex; flex-direction: column; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .16);
               border-radius: 14px; padding: 14px 16px; }
.q-big strong { font-size: 1.9rem; line-height: 1.2; letter-spacing: -.02em; }
.q-bar { position: relative; height: 14px; border-radius: 99px; background: rgba(255, 255, 255, .22); overflow: visible; }
.q-used { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.q-mark { position: absolute; top: -5px; bottom: -5px; width: 3px; background: #fff; border-radius: 2px; }
.q-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; }
.q-legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { display: inline-block; width: 14px; height: 10px; border-radius: 3px; }
.sw.used { background: #fbbf24; } .sw.left { background: rgba(255, 255, 255, .35); border: 1px solid rgba(255, 255, 255, .6); }
.sw.mark { background: #fff; width: 4px; height: 14px; }
.sw.cumc { background: #4f46e5; } .sw.idealc { background: transparent; border-top: 2px dashed #94a3b8; height: 0; }
.sw.projc { background: transparent; border-top: 2px dashed #f59e0b; height: 0; }
.sw.mes { background: #4f46e5; } .sw.est { background: #a5b4fc; } .sw.tod { background: #10b981; }
.sw.budc { background: transparent; border-top: 2px solid #ef4444; height: 0; }
svg.chart { width: 100%; height: auto; display: block; }
svg.chart .grid { stroke: var(--border); stroke-width: 1; }
svg.chart .ylab { font-size: 11px; fill: var(--muted); text-anchor: end; }
svg.chart .xlab { font-size: 11px; fill: var(--muted); text-anchor: middle; }
svg.chart .tag { font-size: 12px; font-weight: 700; fill: var(--text); }
svg.chart .quota-tag { fill: #ef4444; }
svg.chart .quota-line { stroke: #ef4444; stroke-width: 1.5; }
svg.chart .ideal { fill: none; stroke: #94a3b8; stroke-width: 1.5; stroke-dasharray: 6 5; }
svg.chart .cum { fill: none; stroke: #4f46e5; stroke-width: 3; stroke-linejoin: round; }
svg.chart .cum-area { fill: rgba(79, 70, 229, .12); stroke: none; }
svg.chart .proj { fill: none; stroke: #f59e0b; stroke-width: 2; stroke-dasharray: 4 4; }
svg.chart .proj.over { stroke: #ef4444; }
svg.chart .today { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 2 3; }
svg.chart .now { fill: #4f46e5; stroke: #fff; stroke-width: 2; }
svg.chart .budget { stroke: #ef4444; stroke-width: 1.5; }
svg.chart .bar-mesure { fill: #4f46e5; } svg.chart .bar-estime { fill: #a5b4fc; }
svg.chart .bar-aujourdhui { fill: #10b981; } svg.chart .bar-futur, svg.chart .bar-inconnu { fill: transparent; }
@media print { .quota-hero, .hero { color: #000; background: #fff !important; border: 1px solid #999; } }
