/* ═══════════════════════════════════════════════════════════════
   QUIZFUNNEL — AFFILIATION MODULE
   Design premium sobre, aligné sur scripteditor.quizfunnel.local
   Tokens, font, rythme : reprise fidèle (pas de rupture visuelle).
   ─────────────────────────────────────────────────────────────────
   Table des matières :
     1. Tokens & reset
     2. Typographie
     3. Layout global (app shell / sidebar / header)
     4. Navigation sidebar
     5. Boutons
     6. Formulaires
     7. Cards & panels
     8. KPI tiles
     9. Tables
    10. Badges & status
    11. Messages & alerts
    12. Login / register (auth pages)
    13. Dashboard spécifique
    14. Pie & chart containers
    15. Empty states
    16. Modals
    17. Utilitaires
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@500;600&display=swap');

/* ─── 1. Tokens & reset ─────────────────────────────────────── */
:root {
    --primary: #4F46E5;
    --primary-dark: #4338CA;
    --primary-light: #818CF8;
    --secondary: #06B6D4;
    --success: #10B981;
    --warning: #F59E0B;
    --error: #EF4444;

    --bg-dark: #070A12;
    --bg-medium: #0D1220;
    --bg-light: #151E30;
    --surface: #0D1220;
    --surface-light: #151E30;

    --chrome: #0A0D16;
    --chrome-border: rgba(99, 102, 241, 0.18);

    --text-primary: #E2E8F0;
    --text-secondary: #94A3B8;
    --text-tertiary: #4B5680;

    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.14);

    --shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 12px 48px rgba(0, 0, 0, 0.6);
    --glow: 0 0 40px rgba(79, 70, 229, 0.15);

    --radius: 10px;
    --radius-lg: 14px;
    --radius-sm: 6px;

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

*::-webkit-scrollbar { width: 5px; height: 5px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: rgba(79, 70, 229, 0.28); border-radius: 3px; }
*::-webkit-scrollbar-thumb:hover { background: rgba(79, 70, 229, 0.5); }

html, body {
    height: 100%;
}

body {
    font-family: var(--font-sans);
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-dark);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ─── 2. Typographie ────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 { font-weight: 700; color: var(--text-primary); line-height: 1.2; }
h1 { font-size: 28px; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
h4 { font-size: 15px; font-weight: 600; }
p { color: var(--text-secondary); }
a { color: var(--primary-light); text-decoration: none; }
a:hover { color: var(--primary); }

code, .mono { font-family: var(--font-mono); font-size: 0.92em; }

/* ─── 3. Layout global ──────────────────────────────────────── */
.app-shell {
    display: flex;
    min-height: 100vh;
    background:
        radial-gradient(ellipse 80% 55% at 10% -5%,  rgba(79, 70, 229, 0.13) 0%, transparent 55%),
        radial-gradient(ellipse 65% 50% at 90% 105%, rgba(124, 58, 237, 0.08) 0%, transparent 55%),
        var(--bg-dark);
}

.sidebar {
    width: 240px;
    flex-shrink: 0;
    background: linear-gradient(180deg, #0E1222 0%, #0A0D16 100%);
    border-right: 1px solid var(--chrome-border);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 10;
}

.sidebar-header {
    padding: 8px 14px 14px;
    border-bottom: 1px solid var(--border);
}

.brand-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.sidebar-logo {
    width: 180px;
    height: auto;
    object-fit: contain;
    display: block;
}

.brand-stack .brand-sub {
    font-size: 10px;
    font-weight: 700;
    color: var(--primary-light);
    text-transform: uppercase;
    letter-spacing: 0.22em;
    opacity: 0.85;
    margin-top: -6px;
    text-align: center;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
}

.brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    font-size: 15px;
    letter-spacing: -0.5px;
}

.brand-text .brand-name {
    font-weight: 700;
    font-size: 15px;
    letter-spacing: -0.01em;
    display: block;
}

.brand-text .brand-sub {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sidebar-nav {
    flex: 1;
    padding: 18px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
}

.nav-section-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.09em;
    padding: 14px 12px 6px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 13.5px;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
}

.nav-link svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.8;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
}

.nav-link.active {
    background: rgba(79, 70, 229, 0.12);
    color: var(--text-primary);
    box-shadow: inset 2px 0 0 var(--primary);
}

.nav-link.active svg {
    opacity: 1;
    color: var(--primary-light);
}

.sidebar-footer {
    padding: 14px 16px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
}

.user-chip .avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 12px;
    flex-shrink: 0;
}

.user-chip .info {
    min-width: 0;
    flex: 1;
}

.user-chip .info .name {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-chip .info .email {
    font-size: 11px;
    color: var(--text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-footer .logout-link {
    font-size: 12.5px;
    color: var(--text-tertiary);
    padding: 6px 10px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.15s, background 0.15s;
}
.sidebar-footer .logout-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

/* Main content area */
.main-area {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.topbar {
    padding: 22px 36px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.page-title {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.page-subtitle {
    font-size: 13px;
    color: var(--text-tertiary);
    margin-top: 2px;
}

.content {
    flex: 1;
    padding: 26px 36px 60px;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

/* ─── 5. Boutons ────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background 0.18s, border-color 0.18s, color 0.18s, transform 0.18s, box-shadow 0.18s;
    text-decoration: none;
    white-space: nowrap;
}

.btn svg { width: 16px; height: 16px; flex-shrink: 0; }

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.32);
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.45);
    color: #fff;
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--border-strong);
    color: var(--text-primary);
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.05); color: var(--text-primary); }

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}
.btn-danger:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.5);
    color: #fff;
}

.btn-sm { padding: 7px 12px; font-size: 12.5px; }
.btn-lg { padding: 14px 22px; font-size: 15px; }
.btn-block { width: 100%; }

.btn:disabled,
.btn.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* ─── 6. Formulaires ────────────────────────────────────────── */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.01em;
}

.form-group .hint {
    font-size: 11.5px;
    color: var(--text-tertiary);
    margin-top: 2px;
}

.form-control,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
input[type="date"],
input[type="url"],
select,
textarea {
    width: 100%;
    padding: 11px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.form-control::placeholder,
input::placeholder,
textarea::placeholder {
    color: rgba(148, 163, 184, 0.45);
}

.form-control:focus,
input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

textarea { resize: vertical; min-height: 80px; }

.form-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(2, 1fr);
}

.form-grid.full { grid-template-columns: 1fr; }

.form-grid .span-2 { grid-column: span 2; }

.form-section {
    padding: 22px 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.015);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-section-header {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 6px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}

.form-section-header h3 {
    font-size: 15px;
    font-weight: 700;
}

.form-section-header .desc {
    font-size: 12.5px;
    color: var(--text-tertiary);
}

/* Checkbox simple */
.check {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    font-size: 13px;
    color: var(--text-secondary);
}

.check input { display: none; }

.check .box {
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--border-strong);
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.check input:checked + .box {
    background: var(--primary);
    border-color: var(--primary);
}

.check input:checked + .box::after {
    content: "";
    width: 10px;
    height: 6px;
    border-left: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(-45deg) translate(1px, -1px);
}

/* ─── 7. Cards & panels ─────────────────────────────────────── */
.card {
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px 24px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.card-compact { padding: 16px 18px; }

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}

.card-header h3 {
    font-size: 15px;
    font-weight: 700;
}

.card-header .sub {
    font-size: 12px;
    color: var(--text-tertiary);
}

/* ─── 8. KPI tiles ──────────────────────────────────────────── */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 26px;
}

@media (max-width: 1100px) {
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

.kpi-card {
    position: relative;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px 22px 18px;
    overflow: hidden;
    transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.kpi-card:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(99, 102, 241, 0.22);
    transform: translateY(-2px);
    box-shadow: var(--glow);
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    opacity: 0.7;
    transition: opacity 0.2s;
}
.kpi-card:hover::before { opacity: 1; }

.kpi-card.accent-emerald::before { background: linear-gradient(90deg, #10B981, #6EE7B7); }
.kpi-card.accent-violet::before  { background: linear-gradient(90deg, #8B5CF6, #C4B5FD); }
.kpi-card.accent-amber::before   { background: linear-gradient(90deg, #F59E0B, #FCD34D); }

.kpi-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.kpi-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(79, 70, 229, 0.12);
    color: var(--primary-light);
}

.kpi-icon svg { width: 18px; height: 18px; }

.kpi-card.accent-emerald .kpi-icon { background: rgba(16, 185, 129, 0.12); color: #6EE7B7; }
.kpi-card.accent-violet .kpi-icon  { background: rgba(139, 92, 246, 0.12); color: #C4B5FD; }
.kpi-card.accent-amber .kpi-icon   { background: rgba(245, 158, 11, 0.12); color: #FCD34D; }

.kpi-label {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.kpi-value {
    font-family: var(--font-mono);
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 4px;
    letter-spacing: -0.01em;
}

.kpi-value .unit {
    font-size: 16px;
    color: var(--text-tertiary);
    margin-left: 4px;
}

.kpi-meta {
    margin-top: 10px;
    font-size: 11.5px;
    color: var(--text-tertiary);
}

/* ─── 9. Tables ─────────────────────────────────────────────── */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table thead th {
    text-align: left;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
}

.data-table tbody td {
    padding: 13px 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
    vertical-align: middle;
}

.data-table tbody tr:hover td {
    background: rgba(79, 70, 229, 0.04);
}

.data-table tbody tr:last-child td { border-bottom: none; }

.data-table td.mono { font-family: var(--font-mono); }

.data-table td.right { text-align: right; }

.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.015);
}

/* ─── 10. Badges & status ───────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-primary { background: rgba(79, 70, 229, 0.14); color: var(--primary-light); border: 1px solid rgba(79, 70, 229, 0.32); }
.badge-success { background: rgba(16, 185, 129, 0.12); color: #6EE7B7; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-warning { background: rgba(245, 158, 11, 0.12); color: #FCD34D; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-error   { background: rgba(239, 68, 68, 0.12); color: #FCA5A5; border: 1px solid rgba(239, 68, 68, 0.3); }
.badge-neutral { background: rgba(148, 163, 184, 0.1); color: var(--text-secondary); border: 1px solid var(--border); }

/* ─── 11. Messages ──────────────────────────────────────────── */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius);
    font-size: 13.5px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 18px;
}

.alert svg { flex-shrink: 0; width: 18px; height: 18px; margin-top: 1px; }

.alert-success { background: rgba(16, 185, 129, 0.08); color: #6EE7B7; border: 1px solid rgba(16, 185, 129, 0.25); }
.alert-error   { background: rgba(239, 68, 68, 0.08); color: #FCA5A5; border: 1px solid rgba(239, 68, 68, 0.25); }
.alert-info    { background: rgba(79, 70, 229, 0.08); color: var(--primary-light); border: 1px solid rgba(79, 70, 229, 0.25); }
.alert-warning { background: rgba(245, 158, 11, 0.08); color: #FCD34D; border: 1px solid rgba(245, 158, 11, 0.25); }

/* ─── 12. Login / register (auth pages) — style scripteditor ─── */
body.auth-page {
    overflow: auto;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 40px 20px;
}

.auth-bg {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #070A12 0%, #0D1220 40%, #111833 100%);
    overflow: hidden;
    z-index: 0;
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.55;
    will-change: transform;
}
.orb-1 {
    width: 500px; height: 500px;
    background: linear-gradient(135deg, #4F46E5, #6366F1);
    top: -200px; left: -200px;
    animation: authFloat1 25s ease-in-out infinite;
}
.orb-2 {
    width: 400px; height: 400px;
    background: linear-gradient(135deg, #06B6D4, #0891B2);
    bottom: -150px; right: -150px;
    animation: authFloat2 30s ease-in-out infinite;
}
.orb-3 {
    width: 350px; height: 350px;
    background: linear-gradient(135deg, #7C3AED, #4F46E5);
    top: 50%; left: 50%;
    animation: authFloat3 20s ease-in-out infinite;
}
@keyframes authFloat1 {
    0%, 100% { transform: translate(0, 0) scale(1) rotate(0deg); }
    25% { transform: translate(50px, -80px) scale(1.15) rotate(90deg); }
    50% { transform: translate(-30px, 60px) scale(0.9) rotate(180deg); }
    75% { transform: translate(70px, 30px) scale(1.05) rotate(270deg); }
}
@keyframes authFloat2 {
    0%, 100% { transform: translate(0, 0) scale(1) rotate(0deg); }
    30% { transform: translate(-60px, 50px) scale(1.1) rotate(-90deg); }
    60% { transform: translate(40px, -40px) scale(0.95) rotate(-180deg); }
    90% { transform: translate(-50px, -60px) scale(1.08) rotate(-270deg); }
}
@keyframes authFloat3 {
    0%, 100% { transform: translate(-50%, -50%) scale(1) rotate(0deg); }
    20% { transform: translate(calc(-50% + 80px), calc(-50% - 70px)) scale(1.2) rotate(72deg); }
    40% { transform: translate(calc(-50% - 90px), calc(-50% + 40px)) scale(0.85) rotate(144deg); }
    60% { transform: translate(calc(-50% + 60px), calc(-50% + 80px)) scale(1.1) rotate(216deg); }
    80% { transform: translate(calc(-50% - 70px), calc(-50% - 50px)) scale(0.95) rotate(288deg); }
}

.auth-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 460px;
    background: rgba(13, 18, 32, 0.80);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(99, 102, 241, 0.18);
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6), 0 0 80px rgba(79, 70, 229, 0.10);
    padding: 36px 36px 30px;
}

.auth-card.wide { max-width: 520px; }

.auth-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
}

.auth-brand .logo-img {
    width: 200px;
    height: auto;
    object-fit: contain;
}

.auth-brand .brand-sub {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary-light);
    text-transform: uppercase;
    letter-spacing: 0.18em;
    opacity: 0.9;
}

.auth-title {
    font-size: 24px;
    font-weight: 800;
    text-align: center;
    margin-bottom: 6px;
    background: linear-gradient(135deg, var(--primary-light), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-desc {
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 24px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-form input {
    padding: 13px 16px;
    background: rgba(7, 10, 18, 0.5);
    border: 2px solid rgba(99, 102, 241, 0.15);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 14.5px;
    font-family: inherit;
    transition: all 0.2s;
}
.auth-form input::placeholder { color: rgba(148, 163, 184, 0.5); }
.auth-form input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(7, 10, 18, 0.7);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.auth-footer {
    margin-top: 20px;
    text-align: center;
    font-size: 13.5px;
    color: var(--text-secondary);
}

.auth-footer a { color: var(--primary-light); font-weight: 600; }
.auth-footer a:hover { color: var(--secondary); }

/* ─── 13. Dashboard spécifique ──────────────────────────────── */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

@media (max-width: 1200px) {
    .dashboard-grid { grid-template-columns: 1fr; }
}

.chart-card {
    padding: 22px 24px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.025);
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.chart-wrap {
    position: relative;
    height: 280px;
}

/* Per-user list (compact row style) */
.user-row-list {
    display: flex;
    flex-direction: column;
}

.user-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 4px;
    border-bottom: 1px solid var(--border);
}
.user-row:last-child { border-bottom: none; }

.user-row .avatar {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.35), rgba(139, 92, 246, 0.25));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
    color: var(--text-primary);
    flex-shrink: 0;
}

.user-row .meta {
    flex: 1;
    min-width: 0;
}

.user-row .meta .email {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-row .meta .sub {
    font-size: 11.5px;
    color: var(--text-tertiary);
}

.user-row .amount {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    text-align: right;
    white-space: nowrap;
}

/* ─── 14. Pie & chart containers ───────────────────────────── */
.pie-container {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 24px;
    align-items: center;
}

@media (max-width: 900px) { .pie-container { grid-template-columns: 1fr; } }

.pie-legend {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pie-legend .row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12.5px;
    color: var(--text-secondary);
}

.pie-legend .swatch {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}

.pie-legend .label {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
}

.pie-legend .val {
    font-family: var(--font-mono);
    font-weight: 600;
}

/* ─── 15. Empty states ──────────────────────────────────────── */
.empty-state {
    padding: 56px 24px;
    text-align: center;
    color: var(--text-tertiary);
}

.empty-state .icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: rgba(79, 70, 229, 0.08);
    color: var(--primary-light);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}

.empty-state h4 {
    color: var(--text-primary);
    margin-bottom: 6px;
    font-size: 15px;
}

.empty-state p {
    font-size: 13px;
    max-width: 400px;
    margin: 0 auto;
    color: var(--text-tertiary);
}

/* ─── 16. Modals ────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-overlay.hidden { display: none; }

.modal {
    background: linear-gradient(180deg, #0F1525 0%, #0B1018 100%);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 480px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.7);
    animation: modalIn 0.22s ease-out;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.96) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-head {
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-head h3 { font-size: 16px; }

.modal-body { padding: 22px 24px; display: flex; flex-direction: column; gap: 14px; }

.modal-foot {
    padding: 16px 24px 20px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ─── 17. Utilitaires ───────────────────────────────────────── */
.flex { display: flex; }
.row { display: flex; align-items: center; gap: 12px; }
.between { justify-content: space-between; }
.center { align-items: center; }
.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; }
.gap-sm { gap: 8px; }
.gap-md { gap: 14px; }
.gap-lg { gap: 22px; }

.muted { color: var(--text-tertiary); }
.secondary { color: var(--text-secondary); }
.right { text-align: right; }
.mb-md { margin-bottom: 18px; }
.mb-lg { margin-bottom: 26px; }
.mt-md { margin-top: 18px; }
.mt-lg { margin-top: 26px; }

.mono { font-family: var(--font-mono); }

.divider {
    height: 1px;
    background: var(--border);
    margin: 16px 0;
    border: none;
}

.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 22px;
}

.tab-btn {
    padding: 12px 18px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}

.tab-btn:hover { color: var(--text-primary); }

.tab-btn.active {
    color: var(--primary-light);
    border-bottom-color: var(--primary);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.hidden { display: none !important; }

/* ─── Copyable field (for affiliate links) ─────────────────── */
.copyable {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: var(--font-mono);
    font-size: 12.5px;
    color: var(--text-primary);
    cursor: pointer;
    transition: border-color 0.15s;
}
.copyable:hover { border-color: rgba(99, 102, 241, 0.32); }
.copyable .url { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.copyable .copy-icon { flex-shrink: 0; opacity: 0.6; transition: opacity 0.15s; }
.copyable:hover .copy-icon { opacity: 1; }

/* ─── Small responsive adjustments ─────────────────────────── */
@media (max-width: 900px) {
    .sidebar { display: none; }
    .content, .topbar { padding-left: 20px; padding-right: 20px; }
    .form-grid { grid-template-columns: 1fr; }
    .form-grid .span-2 { grid-column: span 1; }
}
