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

:root {
    --bg: #f8f9fa; --surface: #ffffff; --surface-2: #f3f4f6;
    --border: #e5e7eb; --border-hi: #d1d5db;
    --accent: #2563eb; --accent-deep: #1d4ed8; --accent-bg: #eff6ff;
    --signal: #059669; --signal-bg: #ecfdf5;
    --warn: #b45309; --warn-bg: #fffbeb;
    --danger: #dc2626; --danger-bg: #fef2f2;
    --text: #111827; --text-muted: #6b7280; --text-dim: #9ca3af;
    --font-display: 'Inter', sans-serif; --font-body: 'Inter', sans-serif; --font-mono: 'JetBrains Mono', monospace;
    --font-admin-display: 'Rajdhani', sans-serif;
    --shadow-sm: 0 1px 2px rgba(17,24,39,0.04);
    --shadow: 0 1px 3px rgba(17,24,39,0.06), 0 1px 2px rgba(17,24,39,0.04);
    --shadow-lg: 0 8px 20px rgba(17,24,39,0.08);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

/* R-TECH: fondu natif entre deux pages au lieu du flash blanc habituel
   d'une navigation classique - fonctionnalite native du navigateur, aucun
   JS, aucun risque : les navigateurs qui ne la supportent pas naviguent
   exactement comme avant. Meme traitement que R-SPOTMON. */
@view-transition {
    navigation: auto;
}
body { background: var(--bg); color: var(--text); font-family: var(--font-body); line-height: 1.6; min-height: 100vh; -webkit-font-smoothing: antialiased; }
.wrap { max-width: 480px; margin: 0 auto; padding: 56px 24px; }
.wrap.wide { max-width: 860px; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.card, .router-row, .stat-card { animation: fadeUp 0.4s cubic-bezier(0.16,1,0.3,1) both; }
.stat-card:nth-child(2) { animation-delay: 0.05s; } .stat-card:nth-child(3) { animation-delay: 0.1s; }

.brand { display: flex; align-items: center; gap: 11px; justify-content: center; margin-bottom: 32px; font-family: var(--font-display); font-weight: 800; font-size: 20px; color: var(--text); letter-spacing: -0.01em; }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; background: var(--accent); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 14px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 32px; box-shadow: var(--shadow); }
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.015em; color: var(--text); margin-bottom: 8px; }
h1 { font-size: 24px; } h2 { font-size: 20px; } h3 { font-size: 16px; }
.subtitle { color: var(--text-muted); font-size: 14px; margin-bottom: 24px; }

label { display: block; font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 7px; }
input, select { width: 100%; padding: 12px 15px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; color: var(--text); font-family: var(--font-body); font-size: 14.5px; margin-bottom: 18px; transition: border-color 0.15s, background 0.15s, box-shadow 0.15s; }
input:focus, select:focus { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px rgba(37,99,235,0.12); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 13px 22px; border-radius: 10px; font-weight: 700; font-size: 14.5px; text-decoration: none; border: none; cursor: pointer; font-family: var(--font-body); transition: background 0.15s, transform 0.15s, box-shadow 0.15s; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-deep); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-ghost { background: var(--surface-2); border: 1px solid var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--border-hi); background: #fff; }
.btn-danger { background: var(--danger-bg); color: var(--danger); border: 1px solid #fecaca; }
.btn-danger:hover { background: #fee2e2; }
.btn-sm { width: auto; padding: 9px 18px; font-size: 13px; }

.alert { padding: 13px 16px; border-radius: 10px; font-size: 13.5px; margin-bottom: 18px; display: flex; align-items: center; gap: 10px; font-weight: 500; }
.alert-error { background: var(--danger-bg); color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: var(--signal-bg); color: #065f46; border: 1px solid #a7f3d0; }
.alert-warn { background: var(--accent-bg); color: #1e40af; border: 1px solid #bfdbfe; }

.link { color: var(--accent); text-decoration: none; font-weight: 600; }
.link:hover { text-decoration: underline; }
.link-muted { color: var(--text-muted); font-weight: 500; }

.wallet-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 24px 26px; display: flex; justify-content: space-between; align-items: center; margin-bottom: 26px; box-shadow: var(--shadow); }
.wallet-label { font-size: 11.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; }
.wallet-amount { font-family: var(--font-mono); font-size: 30px; font-weight: 700; color: var(--accent); margin-top: 5px; }
.wallet-card .btn-primary { width: auto; }

.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 26px; }
.stat-card { border-radius: 12px; padding: 18px; border: 1px solid var(--border); background: var(--surface); transition: transform 0.15s, box-shadow 0.15s; }
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-card.c-signal { background: var(--signal-bg); border-color: #a7f3d0; }
.stat-card.c-amber { background: var(--accent-bg); border-color: #bfdbfe; }
.stat-card.c-violet { background: var(--surface-2); border-color: var(--border); }
.stat-icon { width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 14px; margin-bottom: 12px; }
.stat-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 4px; font-weight: 700; }
.stat-value { font-family: var(--font-mono); font-size: 21px; font-weight: 700; color: var(--text); }

.router-row { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 18px 22px; margin-bottom: 12px; transition: box-shadow 0.15s, border-color 0.15s, transform 0.15s; }
.router-row:hover { box-shadow: var(--shadow); border-color: var(--border-hi); transform: translateY(-1px); }
.router-top { display: flex; justify-content: space-between; align-items: center; }
.router-name { font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 10px; color: var(--text); }
.status-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.pulse { animation: rvpnpulse 1.8s ease-in-out infinite; box-shadow: 0 0 0 0 currentColor; }
@keyframes rvpnpulse { 0%{box-shadow:0 0 0 0 rgba(5,150,105,0.4);} 70%{box-shadow:0 0 0 7px rgba(5,150,105,0);} 100%{box-shadow:0 0 0 0 rgba(5,150,105,0);} }
.router-links { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); margin-top: 10px; }
.router-links a { color: var(--accent); text-decoration: none; font-weight: 600; }
.router-links a:hover { text-decoration: underline; }
.router-detail { font-size: 12px; color: var(--text-dim); margin-top: 5px; font-weight: 500; }
.router-actions { margin-top: 12px; display: flex; gap: 16px; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge-on { background: var(--signal-bg); color: #065f46; }
.badge-off { background: var(--danger-bg); color: #991b1b; }

.section-title { font-family: var(--font-display); font-size: 13px; color: var(--text); text-transform: uppercase; letter-spacing: 0.04em; margin: 32px 0 14px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.empty-state { color: var(--text-dim); font-size: 13.5px; text-align: center; padding: 32px; border: 1px dashed var(--border); border-radius: 12px; font-weight: 500; }

.tx-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.tx-table th { text-align: left; font-family: var(--font-mono); font-size: 10.5px; color: var(--text-dim); text-transform: uppercase; padding: 10px 0; border-bottom: 2px solid var(--border); font-weight: 700; }
.tx-table td { padding: 12px 0; border-bottom: 1px solid var(--border); color: var(--text); }
.tx-desc { color: var(--text-muted); font-weight: 500; }
.tx-amount { font-family: var(--font-mono); font-weight: 700; }
.tx-debit { color: var(--danger); }
.tx-credit { color: var(--signal); }

pre { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 18px; overflow-x: auto; font-family: var(--font-mono); font-size: 12.5px; color: var(--text); line-height: 1.7; }
code { font-family: var(--font-mono); background: var(--surface-2); padding: 3px 7px; border-radius: 6px; font-size: 12.5px; color: var(--text); font-weight: 500; }

.footer-links { text-align: center; margin-top: 28px; font-size: 13px; color: var(--text-dim); }
.contact-block { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 20px; margin-top: 28px; text-align: center; font-size: 13.5px; color: var(--text-muted); font-weight: 500; }
.contact-block a { color: var(--accent); text-decoration: none; font-weight: 700; }
.contact-block a:hover { text-decoration: underline; }

.detail-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 26px; flex-wrap: wrap; gap: 14px; }
.detail-status { display: inline-flex; align-items: center; gap: 8px; padding: 7px 16px; border-radius: 999px; font-size: 12.5px; font-weight: 700; }
.detail-status.on { background: var(--signal-bg); color: #065f46; }
.detail-status.off { background: var(--danger-bg); color: #991b1b; }

.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 22px 0; }
.info-item { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 15px; }
.info-item .k { font-size: 10.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 5px; font-weight: 700; }
.info-item .v { font-family: var(--font-mono); font-size: 14.5px; font-weight: 700; color: var(--text); }

.copy-row { display: flex; align-items: center; gap: 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 13px 15px; margin-bottom: 10px; }
.copy-row code { background: none; padding: 0; flex: 1; overflow-x: auto; white-space: nowrap; font-weight: 600; }
.copy-btn { flex-shrink: 0; background: #fff; border: 1px solid var(--border); color: var(--text-muted); padding: 8px 14px; border-radius: 8px; font-size: 12px; cursor: pointer; font-family: var(--font-body); font-weight: 700; transition: border-color 0.15s, color 0.15s; }
.copy-btn:hover { border-color: var(--accent); color: var(--accent); }
.copy-btn.copied { background: var(--signal-bg); color: #065f46; border-color: #a7f3d0; }
.script-block { position: relative; }
.script-block .copy-btn { position: absolute; top: 14px; right: 14px; }
.router-name-link { color: inherit; text-decoration: none; display: block; }

@media (max-width: 600px) { .stats-grid { grid-template-columns: 1fr; } .info-grid { grid-template-columns: 1fr; } .wallet-card { flex-direction: column; align-items: flex-start; gap: 16px; } .wallet-card .btn-primary { width: 100%; } }

.toggle-row { display: flex; justify-content: space-between; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--border); }
.toggle-row:last-child { border-bottom: none; }
.toggle-info .name { font-weight: 700; font-size: 14px; color: var(--text); }
.toggle-info .desc { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.switch { position: relative; display: inline-block; width: 44px; height: 25px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; inset: 0; background: var(--border-hi); border-radius: 999px; transition: 0.2s; }
.slider::before { content: ''; position: absolute; height: 19px; width: 19px; left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,0.2); }
.switch input:checked + .slider { background: var(--signal); }
.switch input:checked + .slider::before { transform: translateX(19px); }
.nav-tabs { display: flex; gap: 8px; margin-bottom: 24px; }
.nav-tab { padding: 9px 18px; border-radius: 8px; font-size: 13.5px; font-weight: 600; text-decoration: none; color: var(--text-muted); transition: background 0.15s, color 0.15s; }
.nav-tab.active { background: var(--text); color: #fff; }
.nav-tab:not(.active):hover { background: var(--surface-2); }

.admin-nav { display: flex; gap: 6px; margin-bottom: 24px; flex-wrap: wrap; }
.pending-badge { background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 999px; margin-left: 6px; }
.client-row { display: flex; justify-content: space-between; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--border); }
.client-row:last-child { border-bottom: none; }

/* ============================================================
   ESPACE ADMIN — shell (sidebar regroupee + barre superieure),
   tableaux, modales et notifications. Prefixe .admin- pour ne
   jamais affecter le portail client (meme style.css partage).
   ============================================================ */
.admin-shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.admin-sidebar { background: var(--surface); border-right: 1px solid var(--border); padding: 18px 12px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.admin-brand { display: flex; align-items: center; gap: 9px; padding: 6px 8px 18px; }
.admin-brand-mark { width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg, var(--accent), var(--accent-deep)); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 13px; flex-shrink: 0; }
.admin-brand-name { font-family: var(--font-admin-display); font-weight: 700; font-size: 17px; color: var(--text); }
.admin-brand-name b { color: var(--accent); }
.admin-nav-group { margin-top: 4px; }
.admin-nav-group-head { display: flex; align-items: center; justify-content: space-between; width: 100%; background: none; border: none; cursor: pointer; padding: 7px 10px; font-family: var(--font-admin-display); font-weight: 700; font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-dim); }
.admin-nav-group-head:hover { color: var(--text-muted); }
.admin-nav-group-head .chev { font-size: 9px; transition: transform 0.18s ease; }
.admin-nav-group.collapsed .chev { transform: rotate(-90deg); }
.admin-nav-group.collapsed .admin-nav-items { display: none; }
.admin-nav-items { display: flex; flex-direction: column; gap: 1px; padding: 2px 0 8px; }
.admin-nav-link { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; text-decoration: none; color: var(--text-muted); font-weight: 600; font-size: 13px; position: relative; margin-bottom: 2px; }
.admin-nav-link i { width: 15px; text-align: center; font-size: 13px; color: var(--text-dim); }
.admin-nav-link:hover { background: var(--surface-2); color: var(--text); }
.admin-nav-link.active { background: var(--accent-bg); color: var(--accent-deep); }
.admin-nav-link.active i { color: var(--accent); }
.admin-nav-badge { margin-left: auto; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 20px; font-family: var(--font-mono); }
.admin-sidebar-foot { margin-top: auto; padding: 14px 10px 4px; border-top: 1px solid var(--border); }
.admin-sidebar-slogan { font-size: 10px; color: var(--text-dim); letter-spacing: 0.03em; line-height: 1.5; font-weight: 600; }

.admin-col { display: flex; flex-direction: column; min-height: 100vh; }
.admin-topbar { display: flex; align-items: center; gap: 12px; padding: 12px 24px; border-bottom: 1px solid var(--border); background: var(--surface); position: sticky; top: 0; z-index: 20; }
.admin-topbar-title { font-family: var(--font-admin-display); font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 8px; color: var(--text); }
.admin-topbar-title i { color: var(--accent); }
.admin-topbar-title span { color: var(--text-muted); font-weight: 600; }
.admin-topbar-spacer { flex: 1; }
.admin-icon-btn { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface); color: var(--text-muted); display: flex; align-items: center; justify-content: center; cursor: pointer; text-decoration: none; font-size: 13px; }
.admin-icon-btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--border-hi); }

/* R-TECH 2026-08-18: cloche de notifications globale (barre superieure) -
   regroupe tout ce qui merite l'attention de l'admin, visible depuis
   n'importe quelle page (pas juste le dashboard). */
.admin-alerts-wrap { position: relative; }
.admin-alerts-badge { position: absolute; top: -5px; right: -5px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 20px; font-family: var(--font-mono); border: 2px solid var(--surface); line-height: 1.4; }
.admin-alerts-panel { position: absolute; top: calc(100% + 8px); right: 0; width: 340px; max-width: 90vw; max-height: 420px; overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); z-index: 50; opacity: 0; pointer-events: none; transform: translateY(-6px); transition: opacity 0.15s ease, transform 0.15s ease; }
.admin-alerts-panel.show { opacity: 1; pointer-events: auto; transform: translateY(0); }
.admin-alerts-panel-head { font-family: var(--font-admin-display); font-weight: 700; font-size: 13px; padding: 12px 14px; border-bottom: 1px solid var(--border); color: var(--text); }
.admin-alerts-empty { padding: 22px 14px; text-align: center; font-size: 12.5px; color: var(--text-muted); }
.admin-alerts-item { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--border); text-decoration: none; color: var(--text); font-size: 12.5px; }
.admin-alerts-item:last-child { border-bottom: none; }
.admin-alerts-item:hover { background: var(--surface-2); }
.admin-alerts-item i { color: var(--warn); width: 15px; text-align: center; flex-shrink: 0; }
.admin-alerts-item-label { flex: 1; font-weight: 600; }
.admin-alerts-item-count { background: var(--warn-bg); color: var(--warn); font-weight: 700; font-size: 11px; padding: 2px 8px; border-radius: 20px; font-family: var(--font-mono); flex-shrink: 0; }

.admin-main { padding: 24px 28px 60px; max-width: 1180px; }
.admin-main h1 { font-family: var(--font-admin-display); font-size: 24px; }
.admin-main h2 { font-family: var(--font-admin-display); }

/* R-TECH 2026-08-16: bouton hamburger, cache par defaut (desktop) - la
   sidebar y est deja toujours visible, pas besoin d'un bouton pour ca. */
.admin-mobile-toggle { display: none; }

@media (max-width: 880px) {
    .admin-shell { grid-template-columns: 1fr; }
    /* R-TECH 2026-08-16: avant, .admin-sidebar passait a "display: none"
       sur mobile SANS aucun remplacement - une fois sur une page admin
       (ex: apres avoir suivi un lien), impossible d'atteindre le reste du
       site depuis un telephone (aucun bouton, aucun menu). Devient un
       tiroir plein ecran qui glisse depuis la gauche, ouvert/ferme via
       .admin-mobile-toggle (voir admin-shell-open.php / admin-ui.js). */
    .admin-sidebar {
        display: flex;
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 84vw;
        max-width: 300px;
        z-index: 45;
        transform: translateX(-100%);
        transition: transform 0.22s cubic-bezier(0.16,1,0.3,1);
        box-shadow: var(--shadow-lg);
    }
    .admin-sidebar.show { transform: translateX(0); }
    .admin-mobile-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 34px; height: 34px;
        border-radius: 9px;
        border: 1px solid var(--border);
        background: var(--surface);
        color: var(--text-muted);
        cursor: pointer;
        font-size: 15px;
        flex-shrink: 0;
    }
    .admin-mobile-toggle:hover { background: var(--surface-2); color: var(--text); }
    .admin-main { padding: 18px 16px 50px; }
}

.admin-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 13px; margin-bottom: 22px; }

.chips { display: flex; gap: 7px; flex-wrap: wrap; }
.chip { border: 1px solid var(--border); background: var(--surface-2); color: var(--text-muted); padding: 6px 12px; border-radius: 20px; font-size: 12px; font-weight: 700; cursor: pointer; font-family: var(--font-body); }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.mini-search { display: flex; align-items: center; gap: 7px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 7px 11px; min-width: 180px; }
.mini-search input { border: none; background: none; outline: none; font-size: 12.5px; color: var(--text); width: 100%; font-family: inherit; margin-bottom: 0; padding: 0; }
.mini-search i { color: var(--text-dim); font-size: 12px; }
.card-head-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.card-head-row h2 { margin-bottom: 0; }
.card-head-spacer { flex: 1; }

.admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th { text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-dim); padding: 11px 14px; font-weight: 700; border-bottom: 1px solid var(--border); white-space: nowrap; cursor: pointer; user-select: none; font-family: var(--font-body); }
.admin-table th:hover { color: var(--text-muted); }
.admin-table th i { font-size: 9px; margin-left: 4px; opacity: 0.45; }
.admin-table th.sorted i { opacity: 1; color: var(--accent); }
.admin-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 13px; vertical-align: middle; color: var(--text); }
.admin-table tbody tr { cursor: pointer; }
.admin-table tbody tr:hover { background: var(--surface-2); }
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table .cell-sub { font-size: 11.5px; color: var(--text-dim); margin-top: 2px; }
.admin-table .balance { font-family: var(--font-mono); font-weight: 600; }
.admin-table .profile-tag { font-size: 11px; font-weight: 700; color: var(--text-muted); background: var(--surface-2); padding: 3px 8px; border-radius: 6px; }

.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.pill-good { background: var(--signal-bg); color: #065f46; }
.pill-warn { background: var(--warn-bg); color: var(--warn); }
.pill-bad { background: var(--danger-bg); color: #991b1b; }
.pill-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }

.card-foot { display: flex; align-items: center; justify-content: space-between; padding: 14px 4px 4px; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--text-muted); }
.pager { display: flex; gap: 5px; align-items: center; }
.pager button { width: 29px; height: 29px; border-radius: 7px; border: 1px solid var(--border); background: var(--surface); color: var(--text-muted); cursor: pointer; font-size: 12px; font-family: var(--font-mono); font-weight: 600; }
.pager button:hover { border-color: var(--border-hi); }
.pager button.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.pager button:disabled { opacity: 0.4; cursor: default; }

/* Tiroir de detail (remplace l'accordeon inline) */
.scrim { position: fixed; inset: 0; background: rgba(17,24,39,0.42); opacity: 0; pointer-events: none; transition: opacity 0.2s ease; z-index: 40; }
.scrim.show { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; height: 100vh; width: 440px; max-width: 92vw; background: var(--surface); border-left: 1px solid var(--border); box-shadow: var(--shadow-lg); transform: translateX(100%); transition: transform 0.25s cubic-bezier(0.16,1,0.3,1); z-index: 41; overflow-y: auto; padding: 24px 26px 40px; }
.drawer.show { transform: translateX(0); }
.drawer-close-btn { position: absolute; top: 16px; right: 16px; background: var(--surface-2); border: 1px solid var(--border); width: 32px; height: 32px; border-radius: 8px; cursor: pointer; color: var(--text-muted); }
.drawer-close-btn:hover { color: var(--text); }
.drawer-title { font-family: var(--font-admin-display); font-weight: 700; font-size: 19px; word-break: break-all; padding-right: 40px; color: var(--text); }
.drawer-meta { font-size: 12px; color: var(--text-muted); margin-top: 4px; margin-bottom: 6px; }
.drawer-tabs { display: flex; gap: 16px; margin: 16px 0 4px; border-bottom: 1px solid var(--border); }
.drawer-tab { background: none; border: none; padding: 8px 0; font-weight: 700; font-size: 12.5px; color: var(--text-dim); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; font-family: var(--font-body); }
.drawer-tab.active { color: var(--accent-deep); border-color: var(--accent); }
.drawer-pane { display: none; padding-top: 14px; }
.drawer-pane.active { display: block; }
.field-row { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.field-row:last-child { border-bottom: none; }
.field-label { color: var(--text-muted); }
.field-val { font-weight: 600; font-family: var(--font-mono); text-align: right; }
.router-mini { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 12.5px; }
.router-mini:last-child { border-bottom: none; }

/* Modale (remplace confirm()) */
.modal-wrap { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 60; opacity: 0; pointer-events: none; transition: opacity 0.18s ease; }
.modal-wrap.show { opacity: 1; pointer-events: auto; }
.modal-scrim { position: absolute; inset: 0; background: rgba(17,24,39,0.5); }
.admin-modal { position: relative; background: var(--surface); border-radius: 14px; border: 1px solid var(--border); box-shadow: var(--shadow-lg); padding: 24px; width: 380px; max-width: 90vw; transform: scale(0.96) translateY(6px); transition: transform 0.2s cubic-bezier(0.16,1,0.3,1); }
.modal-wrap.show .admin-modal { transform: scale(1) translateY(0); }
.admin-modal-icon { width: 42px; height: 42px; border-radius: 11px; display: flex; align-items: center; justify-content: center; font-size: 17px; margin-bottom: 14px; }
.admin-modal-icon.danger { background: var(--danger-bg); color: var(--danger); }
.admin-modal-icon.info { background: var(--accent-bg); color: var(--accent-deep); }
.admin-modal h3 { font-family: var(--font-admin-display); font-size: 18px; margin-bottom: 7px; }
.admin-modal p { font-size: 13px; color: var(--text-muted); line-height: 1.55; margin-bottom: 18px; }
.admin-modal-row { display: flex; gap: 9px; }
.admin-modal-row .btn { flex: 1; justify-content: center; width: auto; }

/* Notifications (remplacent la banniere flash statique) */
.toasts { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 80; max-width: calc(100vw - 40px); }
.admin-toast { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 12px 16px; font-size: 13px; font-weight: 600; min-width: 260px; transform: translateY(8px); opacity: 0; animation: adminToastIn 0.25s ease forwards; color: var(--text); }
@keyframes adminToastIn { to { transform: translateY(0); opacity: 1; } }
.admin-toast i { color: var(--signal); }
.admin-toast.err i { color: var(--danger); }

@media (max-width: 600px) { .drawer { width: 100vw; padding: 20px; } }
@media (prefers-reduced-motion: reduce) { .admin-nav-group-head .chev, .drawer, .scrim, .modal-wrap, .admin-modal, .admin-toast { transition: none !important; animation: none !important; } }
