/* JPBusiness Network Cloud — thème sombre : noir · bleu · rouge */
:root {
  /* ── Fonds sombres ── */
  --bg:        #0a0c11;   /* fond principal */
  --bg2:       #0e1118;   /* sidebar / topheader */
  --card:      #131720;   /* cartes */
  --card2:     #191e2c;   /* cartes au survol / champs */
  --border:    #1e2638;   /* bordures subtiles */
  --border2:   #28324a;   /* bordures visibles */

  /* ── Bleu ── */
  --blue:      #2563eb;
  --blue-lt:   #60a5fa;
  --blue-dim:  rgba(37, 99, 235, .18);
  --blue-xdim: rgba(37, 99, 235, .07);

  /* ── Rouge ── */
  --red:       #dc2626;
  --red-lt:    #f87171;
  --red-dim:   rgba(220, 38, 38, .18);

  /* ── Texte ── */
  --text:      #ccd6e8;
  --text-h:    #e8eef8;
  --muted:     #5e7090;

  /* ── Statuts ── */
  --success:   #22c55e;
  --success-dim: rgba(34, 197, 94, .16);
  --warning:   #f59e0b;
  --warning-dim: rgba(245, 158, 11, .16);
  --danger:    #ef4444;
  --danger-dim: rgba(239, 68, 68, .16);
  --accent-2:  #f59e0b;   /* rétro-compat inline */

  /* ── Layout ── */
  --topbar-h:  54px;
  --sidebar-w: 232px;
  --radius:    4px;
}

/* ══════════════════════ THÈME CLAIR (professionnel) ══════════════════════ */
:root[data-theme="light"] {
  --bg:        #eef2f8;   /* fond principal (bleu-gris très clair) */
  --bg2:       #ffffff;   /* sidebar / topheader */
  --card:      #ffffff;   /* cartes */
  --card2:     #f1f5f9;   /* survol / champs */
  --border:    #e5e9f1;   /* bordures subtiles */
  --border2:   #cbd5e1;   /* bordures visibles */

  --blue:      #2563eb;
  --blue-lt:   #2563eb;
  --blue-dim:  rgba(37, 99, 235, .10);
  --blue-xdim: rgba(37, 99, 235, .045);

  --red:       #dc2626;
  --red-lt:    #dc2626;
  --red-dim:   rgba(220, 38, 38, .10);

  --text:      #334155;   /* slate-700 */
  --text-h:    #0f172a;   /* slate-900 */
  --muted:     #64748b;   /* slate-500 */

  --success:     #16a34a;
  --success-dim: rgba(22, 163, 74, .12);
  --warning:     #d97706;
  --warning-dim: rgba(217, 119, 6, .14);
  --danger:      #dc2626;
  --danger-dim:  rgba(220, 38, 38, .10);
  --accent-2:    #d97706;
}
:root[data-theme="light"] body {
  background:
    radial-gradient(1100px 520px at 12% -8%, rgba(37,99,235,.06), transparent 60%),
    var(--bg);
}

/* Reprise des couleurs codées en dur → contraste correct sur fond clair */
:root[data-theme="light"] code,
:root[data-theme="light"] .script                  { color: #1d4ed8; }
:root[data-theme="light"] .badge-online,
:root[data-theme="light"] .badge-active             { color: #15803d; }
:root[data-theme="light"] .badge-unknown,
:root[data-theme="light"] .badge-pending,
:root[data-theme="light"] .badge-warn               { color: #b45309; }
:root[data-theme="light"] .badge-offline,
:root[data-theme="light"] .badge-expired,
:root[data-theme="light"] .badge-cancelled          { color: #b91c1c; }
:root[data-theme="light"] .alert-success            { color: #15803d; }
:root[data-theme="light"] .alert-info               { color: #1d4ed8; }
:root[data-theme="light"] .stat.c-success .stat-ico { color: #16a34a; }
:root[data-theme="light"] .stat.c-warning .stat-ico { color: #d97706; }
:root[data-theme="light"] .pill-tab .n              { background: rgba(15,23,42,.06); }

/* Ombres douces (élévation « material ») en thème clair */
:root[data-theme="light"] .card,
:root[data-theme="light"] .card-v3        { box-shadow: 0 1px 2px rgba(15,23,42,.04), 0 8px 24px rgba(15,23,42,.05); }
:root[data-theme="light"] .auth-card,
:root[data-theme="light"] .auth-split     { box-shadow: 0 24px 60px rgba(15,23,42,.16); }
:root[data-theme="light"] .topheader      { box-shadow: 0 1px 3px rgba(15,23,42,.06); }
:root[data-theme="light"] .stat.stat--icon { box-shadow: 0 1px 2px rgba(15,23,42,.04), 0 6px 18px rgba(15,23,42,.05); }

/* ── Sélecteur de thème (clair / sombre) ── */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 9px; cursor: pointer; flex-shrink: 0;
  background: var(--card2); border: 1px solid var(--border2); color: var(--muted);
  transition: color .15s, border-color .15s, background .15s;
}
.theme-toggle:hover { color: var(--text-h); border-color: var(--blue); }
.theme-toggle svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .ic-moon { display: none; }
.theme-toggle .ic-sun  { display: inline-flex; }
:root[data-theme="light"] .theme-toggle .ic-moon { display: inline-flex; }
:root[data-theme="light"] .theme-toggle .ic-sun  { display: none; }
.theme-toggle.floating { position: fixed; top: 16px; right: 16px; z-index: 60; background: var(--card); box-shadow: 0 6px 20px rgba(0,0,0,.25); }

/* ─────────────────────────────── BASE ─────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, Arial, sans-serif;
  font-size: 14px; line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue-lt); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-weight: 600; margin-top: 0; color: var(--text-h); }
code {
  font-family: Consolas, monospace; font-size: .87em;
  background: var(--card2); color: #7ab3e0;
  padding: 1px 5px; border-radius: 3px;
}
pre { font-family: Consolas, monospace; }

/* ─────────────────────────── TOP HEADER ───────────────────────── */
.topheader {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  z-index: 100;
  display: flex; align-items: stretch;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
}
/* Ligne dégradée bleu → rouge en bas du header */
.topheader::after {
  content: '';
  position: absolute; bottom: -2px; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(to right, var(--blue), var(--red));
  pointer-events: none;
}

/* ── Section gauche : burger + marque ── */
.th-left {
  flex-shrink: 0;
  width: var(--sidebar-w);
  display: flex; align-items: center; gap: 11px;
  padding: 0 14px 0 0;
  border-right: 1px solid var(--border);
}
/* Accent rouge vertical sur la gauche */
.th-left::before {
  content: '';
  display: block; flex-shrink: 0;
  width: 3px; align-self: stretch;
  background: var(--red);
}

.th-burger {
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 1.15rem;
  padding: 0; line-height: 1; flex-shrink: 0;
}
.th-burger:hover { color: var(--text); }

.th-brand { display: flex; align-items: center; gap: 9px; }
.brand-mark {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--red); flex-shrink: 0;
  box-shadow: 0 0 6px var(--red);
}
.th-brand-text strong { display: block; color: var(--text-h); font-size: .9rem; line-height: 1.2; }
.th-brand-text small  { display: block; color: var(--muted); font-size: .68rem; }

/* ── Section droite : plan + utilisateur + logout ── */
.th-right {
  display: flex; align-items: center; gap: 12px;
  margin-left: auto; padding: 0 16px;
}
.th-user { text-align: right; line-height: 1.3; }
.th-user strong { display: block; font-size: .82rem; color: var(--text); }
.th-user small  { font-size: .7rem; color: var(--muted); }
.th-sub-badge   { font-size: .78rem; }

/* ──────────────────────────── COQUILLE ──────────────────────────── */
.shell {
  display: flex;
  padding-top: var(--topbar-h);
  min-height: 100vh;
}

/* ─────────────────────────── SIDEBAR ───────────────────────────── */
.sidebar {
  position: fixed;
  top: var(--topbar-h); bottom: 0; left: 0;
  width: var(--sidebar-w);
  background: var(--bg2);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  display: flex; flex-direction: column;
  z-index: 40;
  transition: transform .22s ease;
}
.sidebar nav {
  flex: 1; display: flex; flex-direction: column; gap: 1px;
  padding: 8px 10px;
}
.sidebar nav a {
  display: flex; align-items: center; gap: 9px; color: var(--muted);
  padding: 7px 12px; border-radius: var(--radius); font-size: .86rem;
}
.sidebar nav a .icon { color: var(--muted); opacity: .85; }
.sidebar nav a:hover { background: var(--card2); color: var(--text-h); text-decoration: none; }
.sidebar nav a:hover .icon { color: var(--text-h); opacity: 1; }
.sidebar nav a.active {
  background: var(--blue-dim);
  color: var(--blue-lt); font-weight: 500;
  border-left: 3px solid var(--blue);
  padding-left: 9px;
}
.sidebar nav a.active .icon { color: var(--blue-lt); opacity: 1; }
.nav-sep {
  padding: 10px 12px 4px;
  font-size: .65rem; text-transform: uppercase;
  letter-spacing: .08em; color: var(--border2); font-weight: 600;
}

/* ─── Overlay mobile ─── */
.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  z-index: 35; background: rgba(0,0,0,.65);
}
.sidebar-overlay.show { display: block; }

/* ───────────────────────── CONTENU ─────────────────────────────── */
.content {
  flex: 1;
  margin-left: var(--sidebar-w);
  padding: 22px 26px; min-width: 0;
}
.topbar {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 20px; padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.topbar h1 { font-size: 1.05rem; margin: 0; color: var(--text-h); }

/* ─────────────────────────── GRILLES ───────────────────────────── */
.grid { display: grid; gap: 14px; }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

/* ─────────────────────────── CARTES ────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.card h3 {
  margin: 0 0 14px; font-size: .88rem;
  padding-bottom: 8px; border-bottom: 1px solid var(--border);
  color: var(--text-h);
}
.stat { text-align: center; }
.stat .num { font-size: 1.8rem; font-weight: 700; color: var(--blue-lt); line-height: 1.2; margin-bottom: 2px; }
.stat .lbl { color: var(--muted); font-size: .79rem; }

/* ─── Cartes stat avec icône (stat_card()) ─── */
.stat.stat--icon {
  display: flex; align-items: center; gap: 14px; text-align: left;
  position: relative; overflow: hidden; padding: 14px 16px 14px 20px;
}
.stat.stat--icon::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--blue);
}
.stat-ico {
  flex: 0 0 auto; width: 38px; height: 38px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: var(--blue-dim); color: var(--blue-lt);
}
.stat-ico .icon { width: 20px; height: 20px; }
.stat-body { min-width: 0; }
.stat-body .num { font-size: 1.55rem; font-weight: 700; color: var(--text-h); line-height: 1.2; margin-bottom: 1px; }
.stat-body .lbl { color: var(--muted); font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-body .delta { font-size: .7rem; font-weight: 600; margin-top: 3px; display: inline-flex; align-items: center; gap: 3px; }
.delta-up   { color: var(--success); }
.delta-down { color: var(--danger); }
.delta-flat { color: var(--muted); }

.stat.c-red::before        { background: var(--red); }
.stat.c-red .stat-ico      { background: var(--red-dim); color: var(--red-lt); }
.stat.c-success::before    { background: var(--success); }
.stat.c-success .stat-ico  { background: var(--success-dim); color: #4ade80; }
.stat.c-warning::before    { background: var(--warning); }
.stat.c-warning .stat-ico  { background: var(--warning-dim); color: #fbbf24; }
.stat.c-muted::before      { background: var(--border2); }
.stat.c-muted .stat-ico    { background: var(--card2); color: var(--muted); }

/* ─── Onglets filtres (pill_tabs()) ─── */
.pill-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.pill-tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 20px;
  border: 1px solid var(--border2); background: var(--card2);
  color: var(--muted); font-size: .79rem; font-weight: 500;
}
.pill-tab:hover { color: var(--text-h); border-color: var(--blue); text-decoration: none; }
.pill-tab.active { background: var(--blue-dim); border-color: var(--blue); color: var(--blue-lt); }
.pill-tab .n {
  background: rgba(255,255,255,.08); border-radius: 10px; min-width: 18px; text-align: center;
  padding: 0 6px; font-size: .72rem; font-weight: 700; line-height: 1.5;
}
.pill-tab.active .n { background: var(--blue); color: #fff; }

/* ─── Cartes graphiques (chart_canvas()) ─── */
.chart-card .chart-wrap { position: relative; height: 220px; }
.chart-card .chart-wrap.chart-sm { height: 170px; }
.chart-empty { color: var(--muted); font-size: .85rem; text-align: center; padding: 50px 0; }

/* ─── Icônes SVG inline (icon()) ─── */
.icon { width: 16px; height: 16px; flex-shrink: 0; vertical-align: -3px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-lg { width: 20px; height: 20px; }

/* ─── Jauges horizontales (CPU/mémoire) ─── */
.gauge { margin-top: 6px; height: 6px; border-radius: 4px; background: var(--card2); overflow: hidden; }
.gauge > span { display: block; height: 100%; border-radius: 4px; background: var(--blue); transition: width .3s; }
.gauge.warn > span   { background: var(--warning); }
.gauge.danger > span { background: var(--danger); }

/* ─── Actions rapides ─── */
.quick-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.quick-actions a {
  display: inline-block; padding: 6px 14px;
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  background: var(--card); color: var(--blue-lt); font-size: .86rem;
}
.quick-actions a:hover { background: var(--blue-xdim); border-color: var(--blue); text-decoration: none; }
.quick-actions .qa-ico { display: none; }

/* ─────────────────────────── TABLEAUX ─────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th {
  color: var(--muted); font-weight: 600;
  font-size: .72rem; text-transform: uppercase; letter-spacing: .05em;
  background: var(--bg2);
}
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--blue-xdim); }

/* ─────────────────────────── FORMULAIRES ─────────────────────── */
label { display: block; margin-bottom: 12px; font-size: .875rem; color: var(--text); }
input:not([type=checkbox]):not([type=radio]),
select, textarea {
  display: block; width: 100%; margin-top: 4px;
  padding: 7px 10px;
  background: var(--card2); color: var(--text);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  font-size: .9rem; font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-dim);
}
select option { background: var(--card2); color: var(--text); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ─────────────────────────── BOUTONS ─────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 6px 14px;
  border: 1px solid transparent; border-radius: var(--radius);
  font-size: .86rem; font-family: inherit;
  cursor: pointer; text-align: center; line-height: 1.5;
  transition: filter .15s, background .15s;
}
.btn-primary { background: var(--blue);    color: #fff; border-color: var(--blue);    font-weight: 600; }
.btn-primary:hover  { filter: brightness(1.15); }
.btn-warn    { background: var(--warning); color: #0a0c11; border-color: var(--warning); font-weight: 600; }
.btn-warn:hover     { filter: brightness(.92); }
.btn-danger  { background: var(--red);     color: #fff; border-color: var(--red); }
.btn-danger:hover   { filter: brightness(.9); }
.btn-ghost   { background: transparent; border-color: var(--border2); color: var(--text); }
.btn-ghost:hover    { background: var(--card2); }
.btn-sm    { padding: 4px 10px; font-size: .79rem; }
.btn-block { display: flex; width: 100%; }
a.btn { text-decoration: none; }

/* ─────────────────────────── BADGES ─────────────────────────── */
.badge { display: inline-block; padding: 2px 8px; border-radius: 3px; font-size: .73rem; font-weight: 600; }
.badge-online, .badge-active    { background: rgba(34,197,94,.16);  color: #4ade80; }
.badge-offline, .badge-expired,
.badge-cancelled                { background: var(--red-dim);        color: var(--red-lt); }
.badge-unknown, .badge-pending  { background: rgba(245,158,11,.14);  color: #fbbf24; }

/* ─────────────────────────── ALERTES ─────────────────────────── */
.alert {
  padding: 10px 14px; margin-bottom: 14px;
  border-radius: var(--radius); font-size: .875rem;
  border-left: 3px solid;
}
.alert-success { background: rgba(34,197,94,.1);  border-color: var(--success); color: #4ade80; }
.alert-danger  { background: var(--red-dim);       border-color: var(--red);     color: var(--red-lt); }
.alert-info    { background: var(--blue-xdim);     border-color: var(--blue);    color: #93c5fd; }

/* ─────────────────────────── SCRIPTS ─────────────────────────── */
pre.script {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px; overflow-x: auto;
  font-size: .8rem; line-height: 1.6;
  white-space: pre; color: #7ab3e0; margin: 0;
}
.script-actions { margin-bottom: 8px; display: flex; gap: 8px; }

/* ─────────────────────────── PAGES AUTH (split-screen) ─────────────────────── */
body.auth-page {
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(37,99,235,.16), transparent 60%),
    radial-gradient(900px 500px at 110% 120%, rgba(37,99,235,.10), transparent 55%),
    var(--bg);
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 20px; overflow-x: hidden;
}
.auth-split {
  display: grid; grid-template-columns: 1.05fr .95fr;
  width: 100%; max-width: 960px; min-height: 580px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 20px; overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,.55);
  animation: authIn .55s cubic-bezier(.2,.7,.3,1) both;
}

/* ── Panneau marque (gauche) ── */
.auth-aside {
  position: relative; overflow: hidden;
  padding: 42px 40px;
  display: flex; flex-direction: column;
  background: linear-gradient(140deg, #0b1a3d 0%, #10275c 45%, #1d3a8a 100%);
  background-size: 180% 180%;
  animation: authGrad 14s ease infinite;
  color: #dbe6ff;
}
.auth-aside .auth-logo { display: flex; align-items: center; gap: 11px; margin-bottom: 34px; }
.auth-aside .auth-logo .brand-mark { width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, var(--blue-lt), var(--blue)); box-shadow: 0 6px 18px rgba(37,99,235,.5); }
.auth-aside .auth-logo strong { font-size: 1.05rem; color: #fff; letter-spacing: -.01em; display: block; }
.auth-aside .auth-logo small  { font-size: .68rem; color: #9db8f0; text-transform: uppercase; letter-spacing: .12em; }
.auth-tagline { font-size: 1.55rem; font-weight: 800; line-height: 1.25; color: #fff;
  letter-spacing: -.02em; margin: 0 0 8px; max-width: 320px; }
.auth-aside .lead { color: #b9cbf0; font-size: .92rem; line-height: 1.6; margin: 0 0 26px; max-width: 340px; }
.auth-features { list-style: none; padding: 0; margin: auto 0 0; display: grid; gap: 14px; }
.auth-features li { display: flex; align-items: center; gap: 11px; font-size: .9rem; color: #cddcf7; }
.auth-features li .fi { width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); }
.auth-features li .fi svg { width: 16px; height: 16px; stroke: #9ec1ff; fill: none; }
.auth-aside-foot { margin-top: 26px; font-size: .72rem; color: #7f9bd0; }
.auth-orb { position: absolute; border-radius: 50%; filter: blur(28px); opacity: .55; pointer-events: none; }
.auth-orb.o1 { width: 220px; height: 220px; top: -60px; right: -60px; background: rgba(96,165,250,.55); animation: authFloat 9s ease-in-out infinite; }
.auth-orb.o2 { width: 260px; height: 260px; bottom: -90px; left: -70px; background: rgba(37,99,235,.45); animation: authFloat 11s ease-in-out infinite reverse; }

/* ── Formulaire (droite) ── */
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 38px; }
.auth-box { width: 100%; max-width: 360px; }
.auth-head { display: none; align-items: center; gap: 10px; margin-bottom: 22px; }
.auth-head .brand-mark { width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg, var(--blue-lt), var(--blue)); }
.auth-head strong { display: block; color: var(--text-h); font-size: .95rem; }
.auth-head small  { display: block; color: var(--muted); font-size: .66rem; text-transform: uppercase; letter-spacing: .1em; }
.auth-box h1 { margin: 0 0 6px; font-size: 1.5rem; color: var(--text-h); letter-spacing: -.02em; }
.auth-box .auth-sub { margin: 0 0 22px; font-size: .88rem; color: var(--muted); }

.auth-tabs { display: flex; gap: 4px; background: var(--bg2); border: 1px solid var(--border);
  border-radius: 11px; padding: 4px; margin-bottom: 20px; }
.auth-tab { flex: 1; text-align: center; padding: 9px 8px; border-radius: 8px; cursor: pointer;
  font-size: .82rem; font-weight: 600; color: var(--muted); border: none; background: none;
  transition: background .15s, color .15s; text-decoration: none; }
.auth-tab:hover { color: var(--text); }
.auth-tab.active { background: var(--blue-dim); color: var(--blue-lt); box-shadow: inset 0 0 0 1px var(--blue); }

.auth-pane { display: none; animation: authFade .3s ease both; }
.auth-pane.active { display: block; }

.auth-box .btn-block { margin-top: 6px; padding: 12px; font-size: .95rem; }
.auth-alt { text-align: center; margin-top: 18px; font-size: .85rem; color: var(--muted); }
.auth-hint { font-size: .78rem; color: var(--muted); margin: -6px 0 14px; line-height: 1.5; }
.code-input input { font-family: Consolas, monospace; letter-spacing: .18em; text-transform: uppercase; font-size: 1.05rem; }

/* Compat : ancienne carte simple encore utilisée ailleurs */
.auth-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px 26px; width: 100%; max-width: 400px; border-top: 3px solid var(--blue);
  box-shadow: 0 12px 40px rgba(0,0,0,.5); animation: authIn .5s ease both; }
.auth-card h1 { margin: 0 0 4px; font-size: 1.1rem; color: var(--blue-lt); }
.auth-card h2 { margin: 0 0 18px; font-size: .87rem; color: var(--muted); font-weight: 400; }

@keyframes authIn   { from { opacity: 0; transform: translateY(18px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes authFade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes authGrad { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
@keyframes authFloat { 0%,100% { transform: translate(0,0); } 50% { transform: translate(14px, 22px); } }

@media (max-width: 860px) {
  .auth-split { grid-template-columns: 1fr; max-width: 420px; min-height: 0; }
  .auth-aside { display: none; }
  .auth-head  { display: flex; }
  .auth-main  { padding: 30px 24px; }
}

/* ─────────────────────────── PAGE ACCUEIL ──────────────────── */
.topnav {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 28px;
  background: var(--bg2); border-bottom: 1px solid var(--border);
}
.topnav .brand { display: flex; align-items: center; gap: 8px; }
.topnav .brand strong { font-size: .94rem; color: var(--text-h); }
.brand-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); flex-shrink: 0; box-shadow: 0 0 5px var(--red); }

.landing-hero { text-align: center; padding: 60px 20px 40px; }
.landing-hero h1 { font-size: 1.9rem; margin-bottom: 10px; color: var(--text-h); }
.landing-hero p  { color: var(--muted); max-width: 560px; margin: 0 auto 24px; font-size: .95rem; }

.pricing {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px; max-width: 860px; margin: 0 auto; padding: 20px;
}
.price-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px; text-align: center;
}
.price-card.featured { border-color: var(--blue); border-top: 3px solid var(--blue); }
.price-card h3 { margin: 0 0 4px; color: var(--text-h); }
.price-card .price { font-size: 1.8rem; font-weight: 700; color: var(--blue-lt); margin: 6px 0 14px; }
.price-card ul { list-style: none; padding: 0; text-align: left; color: var(--muted); font-size: .84rem; margin: 0 0 16px; }
.price-card ul li { padding: 4px 0; border-bottom: 1px solid var(--border); }
.price-card ul li:last-child { border-bottom: none; }

/* ─────────────────────────── MOBILE ─────────────────────────── */
@media (max-width: 860px) {
  /* Topheader : section gauche passe au fond principal */
  .th-left {
    width: auto;
    background: var(--bg2);
    border-right-color: var(--border);
  }

  /* Sidebar hors-écran → slide depuis la gauche */
  .sidebar {
    transform: translateX(-100%);
    border-right: none;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 6px 0 30px rgba(0,0,0,.7);
  }

  .content { margin-left: 0; padding: 14px 16px; }
  .form-row { grid-template-columns: 1fr; }
  .grid-2   { grid-template-columns: 1fr; }
  .chart-card .chart-wrap { height: 200px; }

  /* Le badge plan disparaît sur mobile */
  .th-sub-badge { display: none; }
}

@media (max-width: 480px) {
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .quick-actions a { font-size: .79rem; padding: 5px 10px; }
  .auth-card { padding: 20px 16px; border-radius: 0; border-left: none; border-right: none; }
  .topnav { padding: 10px 14px; }
  .th-user { display: none; }
  .th-right { gap: 8px; padding: 0 10px; }
  .stat-ico { width: 32px; height: 32px; }
  .stat-ico .icon { width: 17px; height: 17px; }
  .stat-body .num { font-size: 1.3rem; }
  .pill-tab { padding: 4px 10px; font-size: .74rem; }
  .tabs { gap: 4px; }
  .tab-btn { font-size: .78rem; padding: 6px 12px; }
}

/* ─── Onglets génériques (tabs / tab-btn / tab-panel) ─── */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0;
  margin-bottom: 0;
}
.tab-btn {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  padding: 8px 16px;
  cursor: pointer;
  color: var(--muted);
  font-size: .875rem;
  font-weight: 500;
  transition: color .15s, border-color .15s;
  border-radius: 4px 4px 0 0;
}
.tab-btn:hover { color: var(--text-h); background: var(--card2); }
.tab-btn.active { color: var(--blue-lt); border-bottom-color: var(--blue); background: transparent; }
.tab-panel { margin-top: 0; }

/* ─── Stat cards simples (sans icône) ─── */
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  text-align: center;
}
.stat-card .stat-value {
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--blue-lt);
  line-height: 1.2;
}
.stat-card .stat-label {
  font-size: .78rem;
  color: var(--muted);
  margin-top: 3px;
}

/* ─── Formulaire : lignes à 3 colonnes ─── */
.form-row-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }

/* ─── Bouton XS ─── */
.btn-xs { padding: 3px 8px; font-size: .72rem; border-radius: 4px; }

/* ─── Table responsive ─── */
.table-responsive { overflow-x: auto; }

/* ─── Badge warn ─── */
.badge-warn { background: var(--warning-dim, rgba(251,191,36,.15)); color: #fbbf24; }
.badge-offline { background: var(--red-dim, rgba(239,68,68,.15)); color: #f87171; }

/* ═══════════════════════════════════════════════════════════════════
   Composants « MIKPORT » (adaptés au thème sombre JPCloud)
   Utilisés par routers.php et access.php pour un rendu moderne cohérent.
   ═══════════════════════════════════════════════════════════════════ */

/* En-tête de page */
.mk-head { display:flex; justify-content:space-between; align-items:flex-end; flex-wrap:wrap; gap:16px; margin-bottom:18px; }
.mk-head h1 { font-size:26px; font-weight:800; letter-spacing:-.02em; line-height:1.15; margin:0; color:var(--text-h); }
.mk-head .sub { color:var(--muted); font-size:13.5px; margin-top:6px; }
.mk-head-actions { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }

/* Pastille « Live » */
.live-stamp { display:inline-flex; align-items:center; gap:7px; font-size:12px; font-weight:600; color:var(--success); background:var(--success-dim); padding:5px 11px; border-radius:20px; }
.live-stamp .dot { width:7px; height:7px; border-radius:50%; background:var(--success); flex-shrink:0; box-shadow:0 0 0 0 var(--success-dim); animation:mkpulse 1.8s ease-in-out infinite; }
@keyframes mkpulse { 0%{box-shadow:0 0 0 0 rgba(34,197,94,.45)} 70%{box-shadow:0 0 0 6px rgba(34,197,94,0)} 100%{box-shadow:0 0 0 0 rgba(34,197,94,0)} }
/* Garde-fou global : tout SVG sans dimension reste raisonnable même sans CSS spécifique */
svg:not([width]) { max-width:100%; max-height:2em; }

/* Bande de statistiques compacte (une seule ligne) */
.stat-strip { display:flex; flex-wrap:wrap; align-items:stretch; background:var(--card); border:1px solid var(--border); border-radius:10px; margin-bottom:18px; overflow:hidden; }
.stat-strip .seg { flex:1 1 0; min-width:110px; padding:11px 18px; display:flex; align-items:center; gap:12px; border-left:1px solid var(--border); }
.stat-strip .seg:first-child { border-left:none; }
.stat-strip .seg .v { font-size:22px; font-weight:800; letter-spacing:-.02em; line-height:1; }
.stat-strip .seg .l { font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.05em; color:var(--muted); }
.stat-strip .seg .s { font-size:10.5px; color:var(--muted); margin-top:2px; }
@media (max-width:560px){ .stat-strip .seg { min-width:50%; } }

/* Rangée de KPI */
.kpi-row { display:grid; grid-template-columns:repeat(4,1fr); gap:14px; margin-bottom:18px; }
.kpi-v3 { background:var(--card); border:1px solid var(--border); border-radius:10px; padding:15px 18px; }
.kpi-v3-lab { font-size:11px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:var(--muted); }
.kpi-v3-val { font-size:26px; font-weight:800; letter-spacing:-.025em; line-height:1.1; margin-top:6px; color:var(--text-h); }
.kpi-v3-sub { margin-top:4px; font-size:12px; color:var(--muted); }
@media (max-width:820px){ .kpi-row{ grid-template-columns:repeat(2,1fr);} }

/* Carte v3 */
.card-v3 { background:var(--card); border:1px solid var(--border); border-radius:12px; overflow:hidden; }
.card-v3-h { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:14px 18px; border-bottom:1px solid var(--border); flex-wrap:wrap; }
.card-v3-h h2 { font-size:15px; margin:0; display:flex; align-items:center; gap:8px; }

/* Table moderne */
.mk-table { width:100%; border-collapse:collapse; font-size:13.5px; }
.mk-table thead th { text-align:left; padding:12px 18px; color:var(--muted); font-size:11px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; background:var(--bg2); border-bottom:1px solid var(--border); white-space:nowrap; }
.mk-table tbody td { padding:13px 18px; border-bottom:1px solid var(--border); vertical-align:middle; }
.mk-table tbody tr:last-child td { border-bottom:none; }
.mk-table tbody tr { transition:background .1s; }
.mk-table tbody tr:hover { background:var(--card2); }
.mono-v3 { font-family:Consolas,monospace; }

/* Pastille d'état */
.st-pill { font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.04em; padding:3px 10px; border-radius:13px; display:inline-block; }
.st-pill.on   { background:var(--success-dim); color:var(--success); }
.st-pill.off  { background:var(--danger-dim);  color:var(--danger); }
.st-pill.wait { background:var(--warning-dim); color:var(--warning); }

/* Marqueur circulaire (icône d'état) */
.s-mark { width:28px; height:28px; border-radius:50%; display:inline-flex; align-items:center; justify-content:center; flex-shrink:0; }
.s-mark svg { width:15px; height:15px; }
.s-mark.on   { background:var(--success-dim); color:var(--success); }
.s-mark.off  { background:var(--danger-dim);  color:var(--danger); }
.s-mark.wait { background:var(--warning-dim); color:var(--warning); }

/* Filtres en segments */
.range-pill { display:inline-flex; gap:2px; background:var(--bg2); border:1px solid var(--border); border-radius:10px; padding:3px; flex-wrap:wrap; }
.range-btn { padding:6px 12px; font-size:12px; border:none; background:none; color:var(--muted); border-radius:7px; cursor:pointer; display:inline-flex; align-items:center; gap:7px; text-decoration:none; }
.range-btn:hover { color:var(--text); text-decoration:none; }
.range-btn.active { background:var(--card); color:var(--text-h); box-shadow:0 1px 3px rgba(0,0,0,.3); }
.range-btn .n { background:var(--card2); color:var(--text); padding:1px 6px; border-radius:5px; font-size:11px; font-weight:700; min-width:18px; text-align:center; }

/* Barre de quota */
.quota-bar { display:flex; align-items:center; gap:10px; min-width:130px; }
.quota-bar .track { flex:1; height:5px; background:var(--bg2); border-radius:3px; overflow:hidden; }
.quota-bar .fill { height:100%; background:var(--blue); border-radius:3px; }

/* Liens d'accès compacts (chips cliquables) */
.acc-chip { display:inline-flex; align-items:center; gap:5px; font-family:Consolas,monospace; font-size:11.5px; background:var(--card2); border:1px solid var(--border); color:var(--blue-lt); padding:3px 8px; border-radius:6px; cursor:pointer; text-decoration:none; }
.acc-chip:hover { border-color:var(--blue); text-decoration:none; }

/* Spinner + barre de progression de chargement */
.mk-spin { display:inline-block; width:13px; height:13px; border:2px solid rgba(255,255,255,.25); border-top-color:#fff; border-radius:50%; animation:mkspin .6s linear infinite; vertical-align:-2px; }
@keyframes mkspin { to { transform:rotate(360deg); } }
#mk-progress { position:fixed; top:0; left:0; height:3px; width:0; opacity:0; background:linear-gradient(90deg,var(--blue),var(--blue-lt)); z-index:9999; box-shadow:0 0 10px var(--blue); transition:width .18s ease, opacity .3s ease; pointer-events:none; }

/* Pastille de progression avec pourcentage */
#mk-progress-pill {
  position:fixed; top:12px; left:50%; z-index:9999;
  transform:translateX(-50%) translateY(-18px);
  display:inline-flex; align-items:center; gap:9px;
  background:var(--card); color:var(--text-h);
  border:1px solid var(--border2); border-radius:22px;
  padding:7px 15px; font-size:12.5px; font-weight:600;
  box-shadow:0 10px 28px rgba(0,0,0,.35);
  opacity:0; pointer-events:none;
  transition:opacity .25s ease, transform .25s ease;
}
#mk-progress-pill.show { opacity:1; transform:translateX(-50%) translateY(0); }
#mk-progress-pill .mk-spin { border-color:var(--blue-dim); border-top-color:var(--blue-lt); }
#mk-progress-pill .lbl { color:var(--muted); font-weight:500; }
#mk-progress-pill .pct { color:var(--blue-lt); font-variant-numeric:tabular-nums; min-width:34px; text-align:right; }

/* Squelette de chargement (shimmer) */
.mk-skel { position:relative; overflow:hidden; background:var(--card2); border-radius:6px; }
.mk-skel::after { content:''; position:absolute; inset:0; transform:translateX(-100%); background:linear-gradient(90deg,transparent,rgba(255,255,255,.06),transparent); animation:mkshimmer 1.3s infinite; }
@keyframes mkshimmer { 100% { transform:translateX(100%); } }

/* ── Animations d'entrée des pages (apparition douce, décalée) ───────────── */
@keyframes fadeInUp { from { opacity:0; transform:translateY(14px); } to { opacity:1; transform:none; } }
.content .card,
.content .card-v3,
.content .stat,
.content .mk-head,
.content > .grid,
.content > .alert { animation: fadeInUp .5s cubic-bezier(.2,.7,.3,1) both; }
/* Décalage progressif pour un effet « cascade » */
.content > *:nth-child(1) { animation-delay: .02s; }
.content > *:nth-child(2) { animation-delay: .08s; }
.content > *:nth-child(3) { animation-delay: .14s; }
.content > *:nth-child(4) { animation-delay: .20s; }
.content > *:nth-child(5) { animation-delay: .26s; }
.content > *:nth-child(6) { animation-delay: .32s; }

@media (prefers-reduced-motion: reduce) {
  .auth-split, .auth-card, .auth-pane,
  .content .card, .content .card-v3, .content .stat,
  .content .mk-head, .content > .grid, .content > .alert,
  .auth-aside, .auth-orb { animation: none !important; }
}
