/* Palette vive (violet, bleu nuit, turquoise, accents néon) sur un fond très sombre. Le rouge pur reste réservé au logo. */
:root {
  --bg: #06051a; --panel: linear-gradient(180deg, rgba(34, 30, 98, .82), rgba(15, 13, 50, .9)); --panel-2: #2a2780; --line: rgba(255, 255, 255, .12); --line-strong: rgba(255, 255, 255, .22);
  --text: #ffffff; --muted: #d3d6f7; --faint: #aeb4e6;
  --brand: #E5161B; --red: #8b5cff; --red-2: #c9bcff; --red-deep: #6d28d9; --red-soft: rgba(139, 92, 255, .26);
  --primary: linear-gradient(135deg, #22e58b, #22d3ee); --on-primary: #03261f;
  --vivid: linear-gradient(135deg, #7c3aed, #c026d3);
  --crit: #ff5c97; --high: #ff9f1c; --med: #ffd60a; --info: #38bdf8; --ok: #22e58b; --teal: #22d3ee; --pink: #ff4d8d;
  --glass: var(--panel);
  --glass-strong: linear-gradient(180deg, rgba(20, 17, 66, .94), rgba(9, 8, 32, .96));
  --inset: rgba(255, 255, 255, .05);
  /* Profondeur : arête claire en haut, ombres en couches dessous. */
  --edge: inset 0 1px 0 rgba(255, 255, 255, .09), inset 0 -1px 0 rgba(0, 0, 0, .35);
  --depth: var(--edge), 0 1px 2px rgba(0, 0, 0, .5), 0 8px 16px -6px rgba(0, 0, 0, .55), 0 26px 50px -18px rgba(0, 0, 0, .75);
  --depth-hi: var(--edge), 0 2px 4px rgba(0, 0, 0, .5), 0 18px 30px -10px rgba(0, 0, 0, .6), 0 40px 70px -24px rgba(0, 0, 0, .85), 0 0 0 1px rgba(139, 92, 255, .25), 0 20px 60px -30px rgba(34, 211, 238, .45);
  --sunken: inset 0 2px 6px rgba(0, 0, 0, .45), inset 0 -1px 0 rgba(255, 255, 255, .05);
  --radius: 18px; --font: -apple-system, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; color: var(--text); font: 14px/1.45 var(--font); }
/* Fond : base presque noire, halos de la palette en calques, sol en perspective (body::after). */
body {
  min-height: 100vh; position: relative; isolation: isolate;
  background:
    radial-gradient(1100px 680px at 6% -12%, rgba(124, 58, 237, .30), transparent 62%),
    radial-gradient(900px 620px at 104% 108%, rgba(11, 179, 154, .20), transparent 60%),
    radial-gradient(760px 520px at 72% 18%, rgba(42, 42, 158, .22), transparent 66%),
    linear-gradient(160deg, #0b0928 0%, #05040f 55%, #03111a 100%) var(--bg);
  background-attachment: fixed;
}
body::before, body::after { content: ""; position: fixed; pointer-events: none; z-index: -1; }
body::before { inset: 0; background: radial-gradient(ellipse at 50% 40%, transparent 45%, rgba(0, 0, 0, .55) 100%); }
body::after { left: -50%; right: -50%; bottom: -8vh; height: 70vh; opacity: 1;
  background-image: linear-gradient(rgba(139, 92, 255, .5) 2px, transparent 2px), linear-gradient(90deg, rgba(34, 211, 238, .32) 1px, transparent 1px);
  background-size: 64px 64px; transform: perspective(520px) rotateX(64deg); transform-origin: 50% 100%;
  -webkit-mask-image: linear-gradient(to top, #000 0%, rgba(0, 0, 0, .6) 45%, transparent 92%); mask-image: linear-gradient(to top, #000 0%, rgba(0, 0, 0, .6) 45%, transparent 92%); }
a { color: inherit; }
[hidden] { display: none !important; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .error { color: var(--crit); }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12.5px; }
.up { color: var(--ok); font-weight: 700; } .down { color: var(--crit); font-weight: 700; }

.brand { font-weight: 900; font-size: 26px; letter-spacing: -1px; color: var(--brand); }
.brand span { color: var(--brand); } .brand small { font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: .12em; text-transform: uppercase; margin-left: 6px; }
.brand.big { font-size: 44px; }

/* Icônes */
.ico { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ico-tile { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; color: var(--red-2);
  background: var(--red-soft); }
.ico-tile .ico { width: 20px; height: 20px; }

/* Connexion */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: min(400px, 100%); background: var(--glass); backdrop-filter: blur(40px); -webkit-backdrop-filter: blur(40px);
  border: 1px solid var(--line); border-radius: 24px; padding: 36px; display: grid; gap: 14px; box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .35); }
.login-card p { margin: -6px 0 6px; }

/* Structure */
.shell { display: grid; grid-template-columns: 268px 1fr; min-height: 100vh; }
.side { position: sticky; top: 16px; height: calc(100vh - 32px); margin: 16px 0 16px 16px; padding: 26px 16px 18px;
  display: flex; flex-direction: column; gap: 20px; border-radius: 24px; border: 1px solid var(--line);
  background: var(--glass-strong); overflow-y: auto; }
.side .brand { padding: 0 10px 18px; border-bottom: 1px solid; border-image: linear-gradient(90deg, transparent, var(--line-strong), transparent) 1; }
nav { display: grid; gap: 3px; }
nav a { text-decoration: none; padding: 9px 12px; border-radius: 14px; color: var(--muted); display: flex; align-items: center; gap: 12px; font-weight: 600; font-size: 13.5px; transition: background .15s, color .15s; }
nav a .nav-ico { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: rgba(255, 255, 255, .05); color: var(--red-2); flex: none; transition: background .15s, color .15s; }
nav a .nav-ico .ico { width: 16px; height: 16px; }
nav a .grow { flex: 1; }
nav a:hover { color: var(--text); background: rgba(255, 255, 255, .03); }
nav a.active { background: rgba(255, 255, 255, .13); color: var(--text); box-shadow: 0 10px 24px -14px rgba(0, 0, 0, .35); }
#nav a:nth-of-type(6n+1) .nav-ico { color: var(--teal); } #nav a:nth-of-type(6n+2) .nav-ico { color: var(--pink); } #nav a:nth-of-type(6n+3) .nav-ico { color: var(--ok); }
#nav a:nth-of-type(6n+4) .nav-ico { color: var(--high); } #nav a:nth-of-type(6n+5) .nav-ico { color: var(--red-2); } #nav a:nth-of-type(6n) .nav-ico { color: var(--med); }
#nav a.active .nav-ico { background: var(--vivid); color: #fff; }
.nav-sep { margin: 16px 12px 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--faint); font-weight: 700; }
.side > * { flex-shrink: 0; }
.side-help { margin-top: auto; position: relative; overflow: hidden; border-radius: 18px; padding: 16px; display: grid; gap: 4px;
  background: var(--vivid); border: 1px solid var(--line); }
.side-help .ico-tile { width: 34px; height: 34px; border-radius: 10px; margin-bottom: 6px; }
.side-help b { font-size: 13.5px; } .side-help span { font-size: 12px; color: rgba(255, 255, 255, .7); }
.side-help .btn { margin-top: 8px; background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .12); font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; text-align: center; }
.view { padding: 22px 28px 60px; min-width: 0; max-width: 1480px; }

/* Barre du haut */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.crumbs { font-size: 12px; color: var(--faint); } .crumbs b { color: var(--text); font-weight: 600; }
.topbar .page-title { font-size: 14px; font-weight: 700; margin-top: 2px; }
.top-tools { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 12.5px; }
.top-tools .who { display: flex; align-items: center; gap: 8px; }
.top-tools .avatar { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-size: 12px; color: #fff; background: linear-gradient(135deg, var(--red-2), var(--red-deep)); }
.top-tools .link { color: var(--muted); }

h1 { font-size: 26px; margin: 0 0 4px; letter-spacing: -.4px; overflow-wrap: anywhere; }
h2 { font-size: 16px; margin: 0 0 4px; font-weight: 700; overflow-wrap: anywhere; }
td { overflow-wrap: anywhere; }
h2 + .muted, .card-sub { font-size: 12.5px; margin: 0 0 14px; color: var(--muted); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head p { margin: 0; }

/* Cartes et grilles */
.grid { display: grid; gap: 18px; }
.kpis { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-bottom: 18px; }
.two { grid-template-columns: 1.6fr 1fr; } .three { grid-template-columns: repeat(3, 1fr); }
.hero-row { grid-template-columns: 1.2fr 1fr 1.15fr; margin-bottom: 18px; }
.card { background: var(--glass); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px; min-width: 0; box-shadow: 0 20px 50px -30px rgba(0, 0, 0, .35); }
.card h2 { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.kpi { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 18px; text-decoration: none; }
.kpi > div:first-child { min-width: 0; }
.kpi .label { color: var(--muted); font-size: 12px; font-weight: 600; }
.kpi .ico-tile { width: 38px; height: 38px; }
.kpi .value { font-size: 22px; font-weight: 700; letter-spacing: -.2px; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: 11.5px; color: var(--faint); margin-top: 2px; }
.kpi.bad .value { color: var(--crit); } .kpi.good .value { color: var(--ok); }
.kpis .kpi:nth-child(4n+1) .ico-tile { color: #04263a; background: linear-gradient(135deg, var(--teal), var(--info)); }
.kpis .kpi:nth-child(4n+2) .ico-tile { color: #03261f; background: linear-gradient(135deg, var(--ok), var(--teal)); }
.kpis .kpi:nth-child(4n+3) .ico-tile { color: #fff; background: var(--vivid); }
.kpis .kpi:nth-child(4n) .ico-tile { color: #3a2100; background: linear-gradient(135deg, var(--med), var(--high)); }
.kpis .kpi.bad .ico-tile { color: #2c0016; background: linear-gradient(135deg, var(--pink), #ff8a5c); }
a.kpi:hover { border-color: var(--line-strong); }

/* Carte d'accueil */
.welcome { position: relative; overflow: hidden; min-height: 240px; display: flex; flex-direction: column; justify-content: space-between;
  background: linear-gradient(120deg, #6d28d9, #c026d3 58%, #f05a3c); border-color: transparent; }
.welcome::after { content: "+"; position: absolute; right: 6%; top: 50%; transform: translateY(-52%); font-size: 260px; font-weight: 900; line-height: 1;
  color: #fff; opacity: .2; pointer-events: none; }
.welcome .hi { color: var(--muted); font-size: 13px; } .welcome .name { font-size: 28px; font-weight: 800; letter-spacing: -.5px; margin: 4px 0 8px; }
.welcome p { margin: 0; color: #fff; max-width: 52%; } .welcome .hi { color: rgba(255, 255, 255, .9); } .welcome .go { position: relative; z-index: 1; font-size: 12.5px; font-weight: 700; text-decoration: none; color: var(--text); }

/* Jauge */
.gauge { position: relative; display: grid; place-items: center; margin: 4px auto 0; width: 190px; }
.gauge > svg { width: 190px; height: 110px; overflow: visible; }
.gauge .center { position: absolute; top: 52px; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--vivid); }
.gauge-box { margin-top: 10px; position: relative; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 16px; border-radius: 16px; background: var(--inset); border: 1px solid var(--line); }
.gauge-box b { font-size: 24px; font-weight: 800; display: block; text-align: center; } .gauge-box small { color: var(--faint); font-size: 11px; }
.ring-wrap { display: flex; align-items: center; gap: 14px; min-width: 0; }
.ring-stats { display: grid; gap: 12px; flex: 1 1 0; min-width: 0; }
.ring-stats div { padding: 12px 16px; border-radius: 16px; background: var(--inset); border: 1px solid var(--line); }
.ring-stats small { color: var(--muted); font-size: 11.5px; display: block; } .ring-stats b { font-size: 17px; }
.ring { position: relative; flex: 0 1 150px; min-width: 104px; aspect-ratio: 1; }
.ring > svg { display: block; width: 100%; height: 100%; }
.ring .c { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring .c small { color: var(--muted); font-size: 11px; } .ring .c b { font-size: 26px; font-weight: 800; letter-spacing: -1px; line-height: 1.1; }

/* Tableaux */
.table-wrap, .card:has(> table) { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); font-weight: 700; padding: 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 12px 10px; border-bottom: 1px solid rgba(255, 255, 255, .045); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; } tr.click:hover td { background: rgba(255, 255, 255, .03); }
.empty { padding: 40px; text-align: center; color: var(--muted); }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; white-space: nowrap; background: rgba(255, 255, 255, .06); color: var(--muted); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.b-ok { color: var(--ok); background: rgba(34, 229, 139, .18); } .b-crit { color: var(--crit); background: rgba(255, 77, 141, .2); }
.b-high { color: var(--high); background: rgba(255, 159, 28, .2); } .b-med { color: var(--med); background: rgba(255, 214, 10, .16); }
.b-info { color: var(--info); background: rgba(56, 189, 248, .18); } .b-off { color: var(--faint); }
.pill { background: var(--pink); color: #2c0016; font-weight: 800; border-radius: 999px; padding: 1px 7px; font-size: 11px; }

/* Formulaires */
label { display: grid; gap: 6px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
input, select, textarea { width: 100%; background: rgba(255, 255, 255, .04); color: var(--text); border: 1px solid var(--line-strong); border-radius: 14px; padding: 10px 13px; font: inherit; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--teal); outline-offset: -1px; border-color: transparent; }
input::placeholder, textarea::placeholder { color: var(--faint); }
select option { background: var(--panel-2); color: var(--text); }
.form { display: grid; gap: 14px; } .form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 500; } .check input { width: auto; }
.btn { border: 1px solid var(--line-strong); background: rgba(255, 255, 255, .05); color: var(--text); border-radius: 12px; padding: 9px 15px; font: inherit; font-weight: 700; cursor: pointer; white-space: nowrap; text-decoration: none; display: inline-block; }
.btn:hover { background: rgba(255, 255, 255, .09); }
.btn.primary { background: var(--primary); border-color: transparent; color: var(--on-primary); }
.btn.primary:hover { filter: brightness(1.1); } .btn.danger { color: var(--crit); } .btn.small { padding: 5px 11px; font-size: 12.5px; border-radius: 10px; }
.btn:disabled { opacity: .5; cursor: default; }
.link { background: none; border: 0; padding: 0; color: var(--muted); cursor: pointer; font: inherit; text-align: left; } .link:hover { color: var(--text); }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar input[type=search] { max-width: 300px; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; padding: 4px; border-radius: 14px; background: var(--inset); border: 1px solid var(--line); width: fit-content; }
.tabs button { background: none; border: 0; color: var(--muted); padding: 6px 14px; border-radius: 10px; cursor: pointer; font: inherit; font-weight: 650; }
.tabs button.on { background: var(--vivid); color: #fff; }

/* Alertes */
.alert { display: grid; grid-template-columns: 4px 1fr auto; gap: 14px; align-items: center; padding: 14px 16px; border-radius: 16px; background: var(--inset); border: 1px solid var(--line); }
.alert + .alert { margin-top: 10px; } .alert .bar { align-self: stretch; border-radius: 4px; }
.alert.critical .bar { background: var(--crit); } .alert.high .bar { background: var(--high); } .alert.medium .bar { background: var(--med); } .alert.info .bar { background: var(--info); }
.alert .t { font-weight: 700; } .alert .d { color: var(--muted); font-size: 13px; } .alert.acked { opacity: .5; }
.alert-actions { display: flex; gap: 6px; }

/* Graphiques */
.chart { display: flex; align-items: flex-end; gap: 6px; height: 170px; padding: 18px 14px 10px; border-radius: 16px; background: var(--inset); border: 1px solid var(--line); }
.chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; min-width: 0; }
.chart .bar { width: 7px; border-radius: 99px; background: linear-gradient(180deg, var(--teal), var(--red)); min-height: 3px; }
.chart.red .bar { background: linear-gradient(180deg, var(--pink), var(--red)); }
.chart .bar.zero { background: rgba(255, 255, 255, .12); box-shadow: none; } .chart .x { font-size: 10.5px; color: var(--faint); }
.two > .card { display: flex; flex-direction: column; }
.area { width: 100%; flex: 1 1 auto; min-height: 240px; display: block; overflow: visible; }
.area text { fill: var(--faint); font-size: 10.5px; font-family: var(--font); }
.area .grid-line { stroke: rgba(255, 255, 255, .08); stroke-dasharray: 4 4; }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.meter { height: 6px; border-radius: 99px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--red); border-radius: 99px; }
.split-list { display: grid; gap: 12px; } .split-list .r { display: grid; grid-template-columns: 1fr auto; gap: 6px; font-size: 13px; margin-bottom: 6px; }
.mini-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.mini-stats .s { display: grid; gap: 6px; } .mini-stats .s .h { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; font-weight: 600; }
.mini-stats .s:nth-child(4n+1) .meter i { background: var(--info); } .mini-stats .s:nth-child(4n+2) .meter i { background: var(--ok); }
.mini-stats .s:nth-child(4n+3) .meter i { background: var(--pink); } .mini-stats .s:nth-child(4n) .meter i { background: var(--high); }
.mini-stats .s .h .ico-tile { width: 26px; height: 26px; border-radius: 8px; } .mini-stats .s .h .ico { width: 14px; height: 14px; }
.mini-stats .s b { font-size: 17px; }

/* Détail */
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 8px 14px; font-size: 13.5px; } .kv dt { color: var(--muted); } .kv dd { margin: 0; overflow-wrap: anywhere; }
pre.stack { background: var(--inset); border: 1px solid var(--line); border-radius: 14px; padding: 14px; overflow: auto; max-height: 420px; font-size: 12px; line-height: 1.5; }
details.tech summary { cursor: pointer; color: var(--muted); font-weight: 600; font-size: 13px; }
details.tech[open] summary { margin-bottom: 10px; }
.back { display: inline-block; margin-bottom: 12px; color: var(--muted); text-decoration: none; } .back:hover { color: var(--text); }
.keys { display: grid; gap: 6px; max-height: 280px; overflow: auto; }

/* Assistance */
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(185px, 1fr)); gap: 10px; margin-bottom: 14px; align-items: end; }
.filters input, .filters select { height: 42px; padding-right: 6px; text-overflow: ellipsis; }
.filters .wide { grid-column: span 2; }
.check-inline { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--text); } .check-inline input { width: auto; }
.preview { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-line { display: flex; flex-direction: column; gap: 1px; min-width: 130px; }
.thread { display: flex; flex-direction: column; gap: 10px; max-height: 58vh; overflow-y: auto; padding: 4px; margin-bottom: 14px; }
.msg { max-width: 78%; padding: 10px 14px; border-radius: 16px; background: var(--inset); border: 1px solid var(--line); align-self: flex-start; }
.msg.reseller { background: rgba(90, 169, 255, .10); border-color: rgba(90, 169, 255, .25); align-self: flex-end; }
.msg.admin { background: var(--red-soft); border-color: rgba(139, 124, 255, .35); align-self: flex-end; }
.msg.note { align-self: stretch; max-width: none; background: rgba(245, 197, 66, .08); border: 1px dashed rgba(245, 197, 66, .45); }
.msg .h { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); margin-bottom: 4px; }
.msg .b { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg img { display: block; max-width: 100%; max-height: 320px; border-radius: 10px; margin-top: 8px; }
.composer { display: grid; gap: 10px; } .composer .row-end { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.pager { display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 14px; color: var(--muted); }
.timeline { display: grid; gap: 8px; font-size: 12.5px; color: var(--muted); max-height: 280px; overflow: auto; } .timeline b { color: var(--text); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.split-list a.row-link { display: block; text-decoration: none; border-radius: 10px; padding: 4px; } .split-list a.row-link:hover { background: rgba(255, 255, 255, .04); }
.warn { padding: 12px 14px; border-radius: 14px; background: rgba(245, 197, 66, .08); border: 1px solid rgba(245, 197, 66, .3); color: var(--med); font-size: 13px; }

/* Fenêtre et notifications */
.modal { position: fixed; inset: 0; background: rgba(0, 0, 0, .65); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: grid; place-items: center; padding: 16px; z-index: 10; }
.modal-card { width: min(520px, 100%); max-height: 90vh; overflow: auto; background: var(--glass-strong); border: 1px solid var(--line-strong); border-radius: 24px; padding: 26px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .35); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--text); color: #111; padding: 10px 18px; border-radius: 999px; font-weight: 700; z-index: 20; }
.toast.err { background: var(--crit); color: #fff; }

@media (max-width: 1200px) { .hero-row { grid-template-columns: 1fr 1fr; } .hero-row .welcome { grid-column: 1 / -1; } }
@media (max-width: 1000px) { .two, .three, .hero-row { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; margin: 12px 12px 0; padding: 14px 12px; gap: 10px; border-radius: 18px; }
  .side .brand { padding-bottom: 10px; }
  nav { grid-auto-flow: column; overflow-x: auto; } nav a { white-space: nowrap; } nav a .nav-ico { width: 28px; height: 28px; }
  .nav-sep, .side-help { display: none; }
  .view { padding: 18px 16px 50px; } .form .row, .kv { grid-template-columns: 1fr; }
  .welcome p { max-width: 100%; } .welcome::after { font-size: 160px; opacity: .35; }
  .msg { max-width: 92%; } .filters .wide { grid-column: auto; }
  .ring-wrap { flex-direction: column; } .top-tools .who span { display: none; }
  .table-wrap td { white-space: nowrap; } .table-wrap td.preview { max-width: 200px; }
  .toolbar input[type=search] { max-width: none; }
}

.card > .value { font-size: 26px; font-weight: 800; margin: 2px 0 8px; font-variant-numeric: tabular-nums; }
.err { color: var(--crit); font-size: 12px; }

/* Profondeur et 3D : cartes en relief, inclinaison au survol (depth.js), graphiques et boutons en volume. */
.card, .login-card { box-shadow: var(--depth); }
.side { box-shadow: var(--depth), 18px 0 50px -30px rgba(124, 58, 237, .35); }
.login-card { background: var(--glass); box-shadow: var(--depth-hi); }
.brand { text-shadow: 0 1px 0 #a80f13, 0 2px 0 #7d0b0e, 0 3px 0 #560709, 0 6px 10px rgba(0, 0, 0, .5); }
.ico-tile, nav a .nav-ico { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), inset 0 -2px 4px rgba(0, 0, 0, .28), 0 6px 14px -6px rgba(0, 0, 0, .7); }
nav a.active { background: linear-gradient(180deg, rgba(255, 255, 255, .15), rgba(255, 255, 255, .07)); box-shadow: var(--edge), 0 12px 24px -12px rgba(0, 0, 0, .8), 0 0 0 1px rgba(139, 92, 255, .3); }
.gauge-box, .ring-stats div, .chart, .alert, .tabs, pre.stack, .msg { box-shadow: var(--sunken); }
input, select, textarea { background: rgba(0, 0, 0, .28); box-shadow: inset 0 2px 5px rgba(0, 0, 0, .4); }

/* Cartes inclinables : tuiles de statistiques et cartes du haut du tableau de bord. */
.kpi, .hero-row > .card { position: relative; transform-style: preserve-3d;
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateZ(0);
  transition: transform .5s cubic-bezier(.2, .8, .2, 1), box-shadow .3s ease, border-color .3s; }
.kpi::before, .hero-row > .card::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), rgba(255, 255, 255, .13), transparent 45%); }
.kpi.is-tilting, .hero-row > .card.is-tilting { transition: transform .08s linear, box-shadow .3s ease, border-color .3s; box-shadow: var(--depth-hi); border-color: var(--line-strong); }
.kpi.is-tilting::before, .hero-row > .card.is-tilting::before { opacity: 1; }
.kpi .ico-tile { transition: transform .4s cubic-bezier(.2, .8, .2, 1); }
.kpi.is-tilting .ico-tile { transform: translateZ(28px); }

/* « + » de la carte d'accueil en volume extrudé. */
.welcome { box-shadow: var(--depth), 0 30px 60px -30px rgba(192, 38, 211, .6); }
.welcome::after { opacity: 1; color: rgba(255, 255, 255, .24);
  text-shadow: 2px 2px 0 rgba(86, 12, 140, .45), 4px 4px 0 rgba(86, 12, 140, .4), 6px 6px 0 rgba(86, 12, 140, .35), 8px 8px 0 rgba(86, 12, 140, .3), 10px 10px 0 rgba(86, 12, 140, .25), 18px 22px 30px rgba(20, 0, 40, .45); }

/* Graphiques : barres en cylindres lumineux, courbes et anneaux avec relief. */
.chart .bar { width: 9px; background: linear-gradient(90deg, rgba(255, 255, 255, .45), rgba(255, 255, 255, 0) 45%, rgba(0, 0, 0, .3)), linear-gradient(180deg, var(--teal), var(--red));
  box-shadow: 0 0 12px -2px rgba(34, 211, 238, .55), 3px 4px 6px rgba(0, 0, 0, .45); }
.chart.red .bar { background: linear-gradient(90deg, rgba(255, 255, 255, .45), rgba(255, 255, 255, 0) 45%, rgba(0, 0, 0, .3)), linear-gradient(180deg, var(--pink), var(--red)); box-shadow: 0 0 12px -2px rgba(255, 77, 141, .55), 3px 4px 6px rgba(0, 0, 0, .45); }
.chart .bar.zero { background: rgba(255, 255, 255, .12); box-shadow: none; }
.area path[fill="none"] { filter: drop-shadow(0 6px 6px rgba(0, 0, 0, .55)) drop-shadow(0 0 5px rgba(255, 255, 255, .22)); }
.gauge > svg, .ring > svg { filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .55)) drop-shadow(0 0 10px rgba(34, 211, 238, .25)); }
.gauge .center { background: radial-gradient(circle at 35% 30%, #d6c2ff, #8b5cff 40%, #4c1d95 85%);
  box-shadow: inset 0 -5px 10px rgba(0, 0, 0, .35), inset 0 2px 3px rgba(255, 255, 255, .45), 0 12px 22px -6px rgba(124, 58, 237, .75); }
.meter { box-shadow: inset 0 1px 3px rgba(0, 0, 0, .55); }
.meter i { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), inset 0 -1px 1px rgba(0, 0, 0, .25); }

/* Boutons : principal en relief qui s'enfonce au clic, onglet actif surélevé. */
.btn { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 2px 0 rgba(0, 0, 0, .45); transition: transform .12s, box-shadow .12s, background .15s, filter .15s; }
.btn.primary { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 3px 0 #0b7f73, 0 12px 22px -10px rgba(34, 211, 238, .7); }
.btn:active:not(:disabled) { transform: translateY(2px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 0 0 rgba(0, 0, 0, .45); }
.btn.primary:active:not(:disabled) { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 1px 0 #0b7f73, 0 6px 12px -8px rgba(34, 211, 238, .7); }
.tabs button.on { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 4px 10px -4px rgba(124, 58, 237, .8); }

/* Fenêtre : bascule en perspective à l'ouverture. */
.modal-card { box-shadow: var(--depth-hi); animation: pop-in .28s cubic-bezier(.2, .8, .2, 1); transform-origin: 50% 0; }
@keyframes pop-in { from { opacity: 0; transform: perspective(900px) rotateX(10deg) translateY(14px) scale(.97); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .kpi, .hero-row > .card, .kpi.is-tilting .ico-tile { transform: none; }
  .btn:active:not(:disabled) { transform: none; }
}
