/* ============================================================
   IZIA — "Platform" design layer
   Sobre, sombre, neutre : sidebar graphite, contenu aéré, cartes
   à filet fin, KPI en grille, accents colorés réservés aux données.
   Chargé APRÈS style.css (client) ou admin.css (admin) : redéfinit
   les tokens et les composants de base communs aux deux espaces.
   ============================================================ */

:root {
    color-scheme: dark;

    /* Surfaces */
    --bg-void: #171717;        /* sidebar */
    --bg-base: #212121;        /* contenu */
    --bg-surface: #212121;     /* cartes (filet, pas d'aplat) */
    --bg-elevated: #2a2a2a;    /* menus, modales, éléments actifs */
    --bg-hover: #2f2f2f;
    --bg-input: #1b1b1b;
    --bg-subtle: rgba(255, 255, 255, 0.03);

    /* Filets */
    --border-subtle: rgba(255, 255, 255, 0.07);
    --border-default: rgba(255, 255, 255, 0.11);
    --border-strong: rgba(255, 255, 255, 0.18);
    --border-focus: rgba(255, 255, 255, 0.38);

    /* Texte */
    --text-primary: #ececec;
    --text-secondary: #b4b4b4;
    --text-muted: #8f8f8f;
    --text-faint: #5e5e5e;
    --text-inverse: #0d0d0d;

    /* Accents (données, états) */
    --accent-cyan: #7cc4fa;
    --accent-green: #10a37f;
    --accent-purple: #8b5cf6;
    --accent-blue: #5b8def;
    --accent-amber: #f5a524;
    --accent-pink: #ef4f6c;
    --accent-teal: #19c39c;

    --success: #19c39c;
    --warning: #f5a524;
    --danger: #ef4f6c;
    --info: #7cc4fa;

    --glow-cyan: none;
    --glow-green: none;
    --glow-purple: none;

    --sidebar-width: 232px;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    --font-sans: 'Inter', ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', 'Cascadia Code', monospace;

    --shadow-pop: 0 12px 40px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.06);
}

/* ---------- Base ---------- */
html, body { background: var(--bg-base); }
body {
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.55;
    color: var(--text-primary);
    font-feature-settings: 'cv11', 'ss01';
}
::selection { background: rgba(255, 255, 255, 0.18); color: #fff; }
a { color: var(--text-primary); text-decoration: none; }
a:hover { color: #fff; }
h1, h2, h3, h4 { color: var(--text-primary); letter-spacing: -0.015em; font-weight: 600; }
code, kbd, pre { font-family: var(--font-mono); }
code { font-size: 0.85em; color: var(--text-secondary); background: var(--bg-subtle); border: 1px solid var(--border-subtle); padding: 1px 6px; border-radius: 5px; }
hr { border: 0; border-top: 1px solid var(--border-subtle); }
.text-muted { color: var(--text-muted) !important; }
.mono { font-family: var(--font-mono); }

/* ---------- Layout ---------- */
.dashboard { display: flex; min-height: 100vh; background: var(--bg-base); }

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-void);
    border-right: 1px solid var(--border-subtle);
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: none;
}

.main-content {
    flex: 1;
    min-width: 0;
    margin-left: var(--sidebar-width);
    padding: 40px 40px 64px;
    background: var(--bg-base);
    max-width: none;
}
.main-content > * { max-width: 1480px; }

.content-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin: 0 0 28px;
    padding: 0;
    border: 0;
    background: none;
}
.content-header h1 {
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
}
.content-header h1 i { font-size: 18px; color: var(--text-muted); }
.content-header .user-info { color: var(--text-muted); font-size: 13px; }
.page-subtitle { color: var(--text-muted); margin: -20px 0 28px; font-size: 14px; }

/* ---------- Sidebar (nouvelle structure) ---------- */
.sb-top { display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 6px; }
.sb-workspace {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 8px; border-radius: var(--radius-md);
    color: var(--text-primary); font-weight: 600; font-size: 13.5px;
    cursor: default;
}
.sb-workspace img { height: 18px; width: auto; }
.sb-workspace .sb-ws-name { white-space: nowrap; }
.sb-workspace .sb-ws-tag {
    font-size: 10px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
    color: var(--text-muted); border: 1px solid var(--border-default); border-radius: 4px; padding: 0 5px;
}
.sb-icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; border-radius: var(--radius-sm);
    color: var(--text-muted); background: none; border: 0; cursor: pointer;
}
.sb-icon-btn:hover { background: var(--bg-hover); color: var(--text-primary); }

.sb-search {
    display: flex; align-items: center; gap: 8px; width: 100%;
    height: 34px; padding: 0 8px 0 10px; margin: 2px 0 8px;
    background: transparent; color: var(--text-muted);
    border: 1px solid var(--border-default); border-radius: var(--radius-md);
    font: inherit; font-size: 13px; cursor: pointer; text-align: left;
}
.sb-search:hover { border-color: var(--border-strong); color: var(--text-secondary); }
.sb-search span { flex: 1; }
.sb-search kbd, .kbd {
    font-family: var(--font-sans); font-size: 11px; color: var(--text-muted);
    border: 1px solid var(--border-default); border-radius: 4px; padding: 0 5px; line-height: 18px;
}

.sb-nav { display: flex; flex-direction: column; gap: 1px; }
.sb-section { margin-top: 14px; padding: 0 10px 4px; font-size: 11.5px; font-weight: 500; color: var(--text-faint); }
.sb-link {
    position: relative;
    display: flex; align-items: center; gap: 10px;
    height: 32px; padding: 0 10px;
    border-radius: var(--radius-md);
    color: var(--text-secondary); font-size: 13.5px; font-weight: 450;
    transition: background 120ms ease, color 120ms ease;
}
.sb-link i { width: 16px; text-align: center; font-size: 13px; color: var(--text-muted); transition: color 120ms ease; }
.sb-link:hover { background: var(--bg-hover); color: var(--text-primary); }
.sb-link:hover i { color: var(--text-secondary); }
.sb-link.active { background: var(--bg-elevated); color: #fff; }
.sb-link.active i { color: #fff; }
.sb-link span:not(.badge) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-link .sb-badge { margin-left: auto; flex-shrink: 0; }

.sb-spacer { flex: 1; min-height: 16px; }

.sb-langs { display: flex; gap: 2px; padding: 0 6px 6px; }
.sb-langs a {
    flex: 1; text-align: center; font-size: 11.5px; font-weight: 500; color: var(--text-muted);
    padding: 3px 0; border-radius: var(--radius-sm);
}
.sb-langs a:hover { background: var(--bg-hover); color: var(--text-primary); }
.sb-langs a.active { background: var(--bg-elevated); color: var(--text-primary); }

.sb-account {
    display: flex; align-items: center; gap: 10px;
    padding: 8px; border-radius: var(--radius-md);
    border-top: 1px solid var(--border-subtle);
    margin-top: 4px; padding-top: 12px;
}
.sb-avatar {
    width: 26px; height: 26px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: #e9e9e9; color: #111; font-size: 11.5px; font-weight: 700; flex-shrink: 0;
}
.sb-account-text { min-width: 0; flex: 1; line-height: 1.25; }
.sb-account-name { font-size: 13px; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-account-sub { font-size: 11.5px; color: var(--text-muted); }

/* Ancien markup de sidebar (pages non migrées) */
.sidebar .logo, .sidebar .sidebar-header { padding: 6px 8px 12px; text-align: left; border: 0; margin: 0; }
.sidebar .logo-img, .sidebar-header .logo { max-width: 92px; height: auto; }
.sidebar-nav ul { list-style: none; margin: 0; padding: 0; }
.sidebar-nav .nav-item a, .sidebar-nav > a.nav-item {
    display: flex; align-items: center; gap: 10px; height: 32px; padding: 0 10px;
    border-radius: var(--radius-md); color: var(--text-secondary); font-size: 13.5px;
}
.sidebar-nav .nav-item.active a, .sidebar-nav > a.nav-item.active { background: var(--bg-elevated); color: #fff; }
.sidebar-nav .nav-item::before, .sidebar-nav .nav-item::after { display: none !important; }

/* Mobile */
.menu-toggle {
    display: none; position: fixed; top: 12px; left: 12px; z-index: 120;
    width: 36px; height: 36px; border-radius: var(--radius-md);
    background: var(--bg-elevated); color: var(--text-primary);
    border: 1px solid var(--border-default); cursor: pointer;
}
@media (max-width: 900px) {
    .menu-toggle { display: inline-flex; align-items: center; justify-content: center; }
    .sidebar { transform: translateX(-100%); transition: transform 200ms ease; box-shadow: var(--shadow-pop); }
    .sidebar.active { transform: none; }
    .main-content { margin-left: 0; padding: 64px 16px 48px; }
    .content-header h1 { font-size: 24px; }
}

/* ---------- Command palette (Ctrl+K) ---------- */
.cmdk-backdrop {
    position: fixed; inset: 0; z-index: 1000; display: none;
    background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(2px);
    align-items: flex-start; justify-content: center; padding-top: 14vh;
}
.cmdk-backdrop.open { display: flex; }
.cmdk {
    width: min(560px, calc(100vw - 32px));
    background: var(--bg-elevated); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-pop); overflow: hidden;
}
.cmdk input {
    width: 100%; height: 48px; padding: 0 16px; border: 0; outline: 0;
    background: transparent; color: var(--text-primary); font: inherit; font-size: 15px;
    border-bottom: 1px solid var(--border-subtle);
}
.cmdk ul { list-style: none; margin: 0; padding: 6px; max-height: 50vh; overflow-y: auto; }
.cmdk li a {
    display: flex; align-items: center; gap: 10px; padding: 8px 10px;
    border-radius: var(--radius-md); color: var(--text-secondary); font-size: 13.5px;
}
.cmdk li a i { width: 16px; text-align: center; color: var(--text-muted); }
.cmdk li a.sel, .cmdk li a:hover { background: var(--bg-hover); color: #fff; }
.cmdk .cmdk-empty { padding: 14px 16px; color: var(--text-muted); font-size: 13px; }

/* ---------- Cartes ---------- */
.card, .chart-card, .service-card, .form-section, .info-section, .endpoint-section {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    box-shadow: none;
}
.card { padding: 20px; margin-bottom: 20px; }
.card::before, .card::after, .stat-card::before, .stat-card::after { display: none !important; }
.card h2, .card > h3 { font-size: 15px; font-weight: 600; margin: 0 0 14px; color: var(--text-primary); }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-header h2, .card-header h3 { margin: 0; font-size: 15px; }
.card-flush { padding: 0; overflow: hidden; }
.card-flush .table th:first-child, .card-flush .table td:first-child { padding-left: 20px; }
.card-flush .table th:last-child, .card-flush .table td:last-child { padding-right: 20px; }

.section-title { font-size: 17px; font-weight: 600; margin: 36px 0 14px; letter-spacing: -0.01em; }
.section-title:first-child { margin-top: 0; }

/* KPI : cellules séparées par des filets, dans un seul cadre */
.kpi-panel {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
    border: 1px solid var(--border-default); border-radius: var(--radius-lg);
    overflow: hidden; margin-bottom: 8px;
}
.kpi {
    position: relative; min-width: 0; min-height: 112px; padding: 16px 16px 14px;
    border-right: 1px solid var(--border-default); border-bottom: 1px solid var(--border-default);
    display: flex; flex-direction: column; gap: 4px;
}
.kpi-panel > .kpi:nth-child(3n) { border-right: 0; }
.kpi-panel > .kpi:nth-last-child(-n+3) { border-bottom: 0; }
.kpi-label { font-size: 12.5px; color: var(--text-muted); display: inline-flex; align-items: center; gap: 4px; }
.kpi-label a { color: inherit; }
.kpi-label a:hover { color: var(--text-primary); }
.kpi-value { font-size: 19px; font-weight: 600; color: var(--text-primary); letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: 12px; color: var(--text-muted); }
.kpi-chart { margin-top: auto; height: 36px; }
.kpi-chart svg { width: 100%; height: 36px; display: block; overflow: visible; }
.kpi .btn { align-self: flex-start; margin-top: 8px; }
.kpi-meter { margin-top: 10px; }
.kpi-meter-row { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--text-secondary); margin-bottom: 6px; }
.meter { height: 8px; background: var(--bg-elevated); border-radius: 999px; position: relative; overflow: hidden; }
.meter > span { position: absolute; inset: 0 auto 0 0; background: #d9d9d9; border-radius: 999px; }
.meter.warn > span { background: var(--warning); }
.meter.danger > span { background: var(--danger); }
@media (max-width: 1100px) {
    .kpi-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .kpi-panel > .kpi { border-right: 1px solid var(--border-default) !important; border-bottom: 1px solid var(--border-default) !important; }
    .kpi-panel > .kpi:nth-child(2n) { border-right: 0 !important; }
}
@media (max-width: 640px) {
    .kpi-panel { grid-template-columns: minmax(0, 1fr); }
    .kpi-panel > .kpi { border-right: 0 !important; }
}

/* Anciennes stat-cards (pages non migrées) */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat-card {
    background: var(--bg-surface); border: 1px solid var(--border-default);
    border-radius: var(--radius-lg); padding: 16px; box-shadow: none;
}
.stat-card:hover { transform: none; border-color: var(--border-strong); box-shadow: none; }
.stat-title, .stat-info h3 { font-size: 12.5px; color: var(--text-muted); font-weight: 400; text-transform: none; letter-spacing: 0; }
.stat-value, .stat-info p { font-size: 22px; font-weight: 600; color: var(--text-primary); font-family: var(--font-sans); }
.stat-icon { background: var(--bg-elevated) !important; color: var(--text-secondary) !important; box-shadow: none !important; }
.progress-bar { height: 6px; background: var(--bg-elevated); border-radius: 999px; overflow: hidden; }
.progress-bar .progress { background: #d9d9d9; border-radius: 999px; box-shadow: none; }

/* ---------- Bandeau d'annonce (façon hero étoilé) ---------- */
.hero {
    position: relative; overflow: hidden;
    border-radius: var(--radius-lg); border: 1px solid var(--border-subtle);
    min-height: 156px; padding: 28px 26px; margin-bottom: 28px;
    background:
        radial-gradient(circle at 78% 62%, rgba(255, 214, 102, 0.95) 0 9%, rgba(255, 170, 60, 0.45) 13%, rgba(255, 140, 40, 0.10) 24%, transparent 34%),
        radial-gradient(1px 1px at 12% 30%, #fff 50%, transparent 51%),
        radial-gradient(1px 1px at 35% 70%, rgba(255,255,255,.7) 50%, transparent 51%),
        radial-gradient(1px 1px at 52% 20%, rgba(255,255,255,.8) 50%, transparent 51%),
        radial-gradient(1.5px 1.5px at 63% 44%, #fff 50%, transparent 51%),
        radial-gradient(1px 1px at 70% 15%, rgba(255,255,255,.7) 50%, transparent 51%),
        radial-gradient(1px 1px at 88% 30%, rgba(255,255,255,.8) 50%, transparent 51%),
        radial-gradient(1.5px 1.5px at 93% 78%, #fff 50%, transparent 51%),
        radial-gradient(1px 1px at 58% 86%, rgba(255,255,255,.6) 50%, transparent 51%),
        radial-gradient(ellipse at 60% 50%, rgba(80, 110, 200, 0.18), transparent 60%),
        #050506;
}
.hero.hero-violet {
    background:
        radial-gradient(circle at 80% 55%, rgba(167, 139, 250, 0.9) 0 7%, rgba(139, 92, 246, 0.35) 14%, transparent 32%),
        radial-gradient(1px 1px at 20% 40%, #fff 50%, transparent 51%),
        radial-gradient(1px 1px at 45% 75%, rgba(255,255,255,.7) 50%, transparent 51%),
        radial-gradient(1.5px 1.5px at 66% 25%, #fff 50%, transparent 51%),
        radial-gradient(1px 1px at 90% 85%, rgba(255,255,255,.7) 50%, transparent 51%),
        #060509;
}
.hero.hero-teal {
    background:
        radial-gradient(circle at 82% 58%, rgba(52, 211, 153, 0.85) 0 7%, rgba(16, 163, 127, 0.35) 14%, transparent 32%),
        radial-gradient(1px 1px at 25% 35%, #fff 50%, transparent 51%),
        radial-gradient(1px 1px at 50% 80%, rgba(255,255,255,.7) 50%, transparent 51%),
        radial-gradient(1.5px 1.5px at 70% 18%, #fff 50%, transparent 51%),
        #040706;
}
.hero-content { position: relative; max-width: 560px; }
.hero h2 { font-size: 17px; font-weight: 600; margin: 0 0 4px; color: #fff; }
.hero p { color: rgba(255, 255, 255, 0.78); font-size: 13px; margin: 0 0 14px; }
.hero-close { position: absolute; top: 12px; right: 12px; color: rgba(255, 255, 255, 0.7); }
.hero-pager { display: flex; justify-content: flex-end; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); margin: -16px 0 8px; }
.hero-slide { display: none; }
.hero-slide.active { display: block; }

/* ---------- Tuiles (services / démarrer) ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr)); gap: 12px; }
.tile {
    display: flex; flex-direction: column; gap: 6px;
    min-height: 140px; padding: 16px;
    border: 1px solid var(--border-default); border-radius: var(--radius-lg);
    background: var(--bg-surface); color: var(--text-primary);
    transition: border-color 120ms ease, background 120ms ease;
}
.tile:hover { border-color: var(--border-strong); background: #242424; color: var(--text-primary); }
.tile-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 8px; }
.tile-icon {
    width: 38px; height: 38px; border-radius: 9px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--border-default); background: var(--bg-void); color: var(--text-primary); font-size: 15px;
}
.tile-icon.grad-1 { background: linear-gradient(135deg, #2b2b2b, #0b0b0b); }
.tile-icon.grad-2 { background: linear-gradient(135deg, #4f46e5, #a78bfa); border-color: transparent; color: #fff; }
.tile-icon.grad-3 { background: linear-gradient(135deg, #10a37f, #a3e635); border-color: transparent; color: #08130f; }
.tile-icon.grad-4 { background: linear-gradient(135deg, #f97316, #facc15); border-color: transparent; color: #1a0f00; }
.tile-icon.grad-5 { background: linear-gradient(135deg, #0ea5e9, #6366f1); border-color: transparent; color: #fff; }
.tile-title { font-size: 13.5px; font-weight: 600; }
.tile-desc { font-size: 12.5px; color: var(--text-muted); line-height: 1.45; }
.tile.disabled { opacity: 0.45; pointer-events: none; }

/* Colonne principale + colonne "Nouveautés" */
.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
@media (max-width: 1200px) { .split { grid-template-columns: minmax(0, 1fr); } }

.updates { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 18px; }
.updates li { display: flex; gap: 12px; }
.update-icon {
    width: 28px; height: 28px; flex-shrink: 0; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(91, 141, 239, 0.14); color: #8fb0ff; font-size: 12px;
}
.update-meta { font-size: 11.5px; color: var(--text-muted); }
.update-title { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.update-text { font-size: 12.5px; color: var(--text-muted); line-height: 1.45; }

/* ---------- Segmented control ---------- */
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--bg-void); border: 1px solid var(--border-subtle); border-radius: 999px; }
.seg a, .seg button {
    font: inherit; font-size: 12.5px; font-weight: 500; color: var(--text-muted);
    padding: 3px 10px; border-radius: 999px; background: none; border: 0; cursor: pointer;
}
.seg a:hover, .seg button:hover { color: var(--text-primary); }
.seg a.active, .seg button.active { background: var(--bg-hover); color: #fff; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }

/* ---------- Boutons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    height: 34px; padding: 0 14px;
    border-radius: var(--radius-md); border: 1px solid transparent;
    font: inherit; font-size: 13px; font-weight: 500; line-height: 1;
    cursor: pointer; white-space: nowrap;
    transition: background 120ms ease, border-color 120ms ease, color 120ms ease, opacity 120ms ease;
    box-shadow: none; text-transform: none; letter-spacing: 0;
}
.btn:hover { transform: none; box-shadow: none; }
.btn i { font-size: 12px; }
.btn-primary, .btn-login, .btn-buy { background: #f2f2f2; color: var(--text-inverse); border-color: #f2f2f2; }
.btn-primary:hover, .btn-login:hover, .btn-buy:hover { background: #fff; color: var(--text-inverse); }
.btn-secondary, .btn-accent, .btn-ghost {
    background: transparent; color: var(--text-primary); border-color: var(--border-default);
}
.btn-secondary:hover, .btn-accent:hover, .btn-ghost:hover { background: var(--bg-hover); border-color: var(--border-strong); color: #fff; }
.btn-danger { background: transparent; color: #ff8097; border-color: rgba(239, 79, 108, 0.35); }
.btn-danger:hover { background: rgba(239, 79, 108, 0.12); color: #ffa3b4; }
.btn-success { background: rgba(25, 195, 156, 0.14); color: #4fe0bd; border-color: rgba(25, 195, 156, 0.3); }
.btn-success:hover { background: rgba(25, 195, 156, 0.22); }
.btn-warning { background: rgba(245, 165, 36, 0.14); color: #ffc35c; border-color: rgba(245, 165, 36, 0.3); }
.btn-demo { background: rgba(139, 92, 246, 0.16); color: #c4b5fd; border-color: rgba(139, 92, 246, 0.35); }
.btn-demo:hover { background: rgba(139, 92, 246, 0.26); color: #ddd6fe; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: var(--radius-sm); }
.btn-icon { width: 30px; padding: 0; }
.btn-sm.btn-icon { width: 28px; }
.btn[disabled], .btn.disabled { opacity: 0.45; pointer-events: none; }
.btn-group { display: inline-flex; gap: 4px; }

/* ---------- Formulaires ---------- */
.form-group { margin-bottom: 14px; }
.form-group label, .form-label { display: block; font-size: 12.5px; font-weight: 500; color: var(--text-secondary); margin-bottom: 6px; }
.form-control, input[type="text"].form-control, select.form-control, textarea.form-control {
    width: 100%; min-height: 36px; padding: 8px 11px;
    background: var(--bg-input); color: var(--text-primary);
    border: 1px solid var(--border-default); border-radius: var(--radius-md);
    font: inherit; font-size: 13.5px; box-shadow: none;
    transition: border-color 120ms ease, box-shadow 120ms ease;
}
.form-control::placeholder { color: var(--text-faint); }
.form-control:hover { border-color: var(--border-strong); }
.form-control:focus { outline: 0; border-color: var(--border-focus); box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.06); }
.form-control-sm { min-height: 30px; padding: 4px 8px; font-size: 12.5px; }
.form-text, .form-hint { display: block; font-size: 12px; color: var(--text-muted); margin-top: 5px; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 700px) { .form-row-2, .form-row-3 { grid-template-columns: 1fr; } }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

/* Switch */
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track {
    width: 32px; height: 18px; border-radius: 999px; background: #3a3a3a; position: relative; flex-shrink: 0;
    transition: background 150ms ease;
}
.switch .track::after {
    content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%;
    background: #fff; transition: transform 150ms ease;
}
.switch input:checked + .track { background: var(--accent-green); }
.switch input:checked + .track::after { transform: translateX(14px); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.15); }
.switch .switch-label { font-size: 13px; color: var(--text-primary); }

/* Ancien toggle des permissions (admin) */
.toggle-slider { background: #3a3a3a !important; }
.perm-checkbox:checked + .toggle-slider { background: var(--accent-green) !important; }

/* ---------- Tableaux ---------- */
.table-responsive { width: 100%; overflow-x: auto; }
.table, .data-table {
    width: 100%; border-collapse: collapse; font-size: 13px; background: none;
}
.table th, .data-table th {
    text-align: left; font-weight: 500; font-size: 12px; color: var(--text-muted);
    text-transform: none; letter-spacing: 0;
    padding: 10px 12px; border-bottom: 1px solid var(--border-default); background: none; white-space: nowrap;
}
.table td, .data-table td {
    padding: 11px 12px; border-bottom: 1px solid var(--border-subtle); color: var(--text-secondary); vertical-align: middle;
}
.table tbody tr:last-child td, .data-table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td, .data-table tbody tr:hover td { background: rgba(255, 255, 255, 0.02); }
.table td strong, .cell-strong { color: var(--text-primary); font-weight: 500; }
.cell-sub { display: block; font-size: 12px; color: var(--text-muted); }
.table .num, .data-table .num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Badges ---------- */
.badge, .status-badge {
    display: inline-flex; align-items: center; gap: 5px;
    height: 20px; padding: 0 8px; border-radius: 999px;
    font-size: 11.5px; font-weight: 500; line-height: 1; white-space: nowrap;
    border: 1px solid transparent; background: var(--bg-elevated); color: var(--text-secondary);
}
.badge-success, .status-success { background: rgba(25, 195, 156, 0.12); color: #4fe0bd; }
.badge-danger, .status-error { background: rgba(239, 79, 108, 0.12); color: #ff8097; }
.badge-warning { background: rgba(245, 165, 36, 0.12); color: #ffc35c; }
.badge-info { background: rgba(124, 196, 250, 0.12); color: #9ed4fb; }
.badge-standard { background: var(--bg-elevated); color: var(--text-secondary); }
.badge-unlimited { background: rgba(245, 165, 36, 0.12); color: #ffc35c; }
.badge-demo { background: rgba(139, 92, 246, 0.16); color: #c4b5fd; }
.badge-new { background: #6d4aff; color: #fff; height: 18px; padding: 0 7px; font-size: 10.5px; font-weight: 600; border-radius: 5px; }
.badge-outline { background: transparent; border-color: var(--border-default); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; display: inline-block; }

/* ---------- Alertes ---------- */
.alert {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 12px 14px; margin-bottom: 18px;
    border-radius: var(--radius-md); border: 1px solid var(--border-default);
    background: var(--bg-subtle); color: var(--text-secondary); font-size: 13px;
}
.alert i { margin-top: 2px; }
.alert-success { border-color: rgba(25, 195, 156, 0.3); background: rgba(25, 195, 156, 0.07); color: #9ef0da; }
.alert-danger, .alert-error { border-color: rgba(239, 79, 108, 0.3); background: rgba(239, 79, 108, 0.07); color: #ffb3c1; }
.alert-warning { border-color: rgba(245, 165, 36, 0.3); background: rgba(245, 165, 36, 0.07); color: #ffd590; }
.alert-info { border-color: rgba(124, 196, 250, 0.3); background: rgba(124, 196, 250, 0.07); color: #c4e5fd; }
.alert-demo { border-color: rgba(139, 92, 246, 0.35); background: rgba(139, 92, 246, 0.08); color: #ddd6fe; }

/* ---------- Modales ---------- */
.modal {
    display: none; position: fixed; inset: 0; z-index: 900;
    background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(2px); overflow-y: auto; padding: 8vh 16px;
}
.modal-content {
    position: relative; margin: 0 auto; width: 100%; max-width: 560px;
    background: var(--bg-elevated); border: 0; border-radius: var(--radius-xl);
    box-shadow: var(--shadow-pop); padding: 24px;
}
.modal-content h2 { font-size: 17px; margin: 0 0 4px; display: flex; align-items: center; gap: 8px; }
.modal-subtitle { color: var(--text-muted); font-size: 13px; margin: 0 0 18px; }
.modal .form-control { background: var(--bg-base); }

/* ---------- Divers ---------- */
.empty { padding: 32px 16px; text-align: center; color: var(--text-muted); font-size: 13px; }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 8px 16px; font-size: 13px; }
.kv dt { color: var(--text-muted); }
.kv dd { margin: 0; color: var(--text-primary); }
.chip-list { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
    display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 4px 0 10px;
    border: 1px solid var(--border-default); border-radius: 999px; font-family: var(--font-mono); font-size: 12px; color: var(--text-primary);
}
.chip button { width: 20px; height: 20px; border-radius: 50%; border: 0; background: none; color: var(--text-muted); cursor: pointer; }
.chip button:hover { background: var(--bg-hover); color: #fff; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border-default); margin-bottom: 20px; overflow-x: auto; }
.tabs a, .tabs button {
    font: inherit; font-size: 13px; color: var(--text-muted); background: none; border: 0; cursor: pointer;
    padding: 8px 12px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.tabs a:hover, .tabs button:hover { color: var(--text-primary); }
.tabs a.active, .tabs button.active { color: #fff; border-bottom-color: #fff; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 1000px) { .grid-2 { grid-template-columns: 1fr; } }
.api-key code, .api-key-box code { background: none; border: 0; padding: 0; color: var(--text-primary); font-size: 12.5px; word-break: break-all; }
.api-key-box { display: flex; align-items: center; gap: 6px; padding: 6px 6px 6px 10px; border: 1px solid var(--border-default); border-radius: var(--radius-md); background: var(--bg-input); }
.api-key-box code { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.copy-btn, .renew-btn {
    display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px;
    border-radius: var(--radius-sm); border: 0; background: none; color: var(--text-muted); cursor: pointer;
}
.copy-btn:hover, .renew-btn:hover { background: var(--bg-hover); color: #fff; }
.fade-in { animation: pfade 200ms ease both; }
@keyframes pfade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- Pages de connexion ---------- */
.login-page { background: var(--bg-base); }
.login-form-container, .login-container .login-form {
    background: var(--bg-elevated); border: 1px solid var(--border-subtle); border-radius: var(--radius-xl); box-shadow: var(--shadow-pop);
}

/* ---------- Neutralisation des styles hérités ---------- */
.badge, .status-badge { text-transform: none; letter-spacing: 0; font-family: var(--font-sans); }
.modal-content h2 { border: 0; padding: 0; background: none; }
.modal-content h2::before, .modal-content h2::after { display: none; }
.tabs { scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.nowrap { white-space: nowrap; }
.table td:has(> .cell-sub) { min-width: 160px; }

/* ---------- Documentation API ---------- */
.doc-section { scroll-margin-top: 24px; }
.doc-endpoint { padding: 18px 0; border-top: 1px solid var(--border-subtle); }
.doc-endpoint:first-of-type { border-top: 0; padding-top: 4px; }
.doc-endpoint-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.doc-path { background: none; border: 0; padding: 0; font-size: 13px; color: var(--text-primary); word-break: break-all; }
.doc-meta { margin-left: auto; display: inline-flex; gap: 6px; flex-wrap: wrap; }
.doc-title { font-size: 14px; font-weight: 600; margin: 10px 0 4px; }
.doc-desc { font-size: 13px; color: var(--text-secondary); margin: 0 0 10px; }
.doc-params { margin: 6px 0 12px; }
.doc-params td, .doc-params th { padding: 7px 10px; font-size: 12.5px; }
.doc-endpoint pre, .card pre {
    margin: 8px 0 0; padding: 12px 14px; border-radius: var(--radius-md);
    background: #171717 !important; border: 1px solid var(--border-subtle); font-size: 12.5px; overflow-x: auto;
}
.doc-endpoint pre code, .card pre code { background: none; border: 0; padding: 0; color: #e6e6e6; }
.method {
    display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 5px;
    font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: 0.02em;
    background: var(--bg-elevated); color: var(--text-secondary);
}
.method-get { background: rgba(25, 195, 156, 0.14); color: #4fe0bd; }
.method-post { background: rgba(91, 141, 239, 0.16); color: #9db9ff; }
.method-put { background: rgba(245, 165, 36, 0.14); color: #ffc35c; }
.method-delete { background: rgba(239, 79, 108, 0.14); color: #ff8097; }
