/* ═══════════════════════════════════════════════
   ORBIS DESIGN SYSTEM — feuille de style partagée
   ═══════════════════════════════════════════════ */

:root {
    --bg: #06070b;
    --bg-elevated: #0c0e14;
    --bg-input: #080a0f;
    --card-bg: rgba(15, 23, 42, 0.55);
    --card-bg-hover: rgba(15, 23, 42, 0.75);
    --border: rgba(255, 255, 255, 0.07);
    --border-hover: rgba(139, 92, 246, 0.4);

    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --text-tertiary: #64748b;

    --accent-blue: #3b82f6;
    --accent-purple: #8b5cf6;
    --accent-pink: #ec4899;
    --accent-gradient: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    --accent-gradient-3: linear-gradient(135deg, var(--accent-blue), var(--accent-purple), var(--accent-pink));

    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 999px;

    --shadow-glow: 0 4px 25px rgba(139, 92, 246, 0.25);
    --shadow-glow-strong: 0 6px 30px rgba(139, 92, 246, 0.5);
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.2);

    --font: 'Inter', 'Segoe UI', sans-serif;
    --transition: 0.2s ease;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background-color: var(--bg);
    color: var(--text-primary);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

body > footer {
    margin-top: auto;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: rgba(139, 92, 246, 0.3); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: rgba(139, 92, 246, 0.5); }

/* ── Orbes lumineux d'ambiance ── */
.orb-bg, .orb-bg-2 {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    animation: floatOrb 12s ease-in-out infinite alternate;
}
.orb-bg {
    width: 420px; height: 420px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.14) 0%, transparent 70%);
    filter: blur(90px);
    top: 5%; left: 12%;
}
.orb-bg-2 {
    width: 480px; height: 480px;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.1) 0%, transparent 70%);
    filter: blur(100px);
    bottom: 5%; right: 8%;
    animation-direction: alternate-reverse;
    animation-duration: 15s;
}
@keyframes floatOrb {
    0% { transform: translateY(0) scale(1); }
    100% { transform: translateY(-30px) scale(1.06); }
}

/* ═══════════════════════════════════════════════
   NAVIGATION COMMUNE (topnav) — identique sur les 3 pages
   ═══════════════════════════════════════════════ */
.topnav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 40px;
    background: rgba(6, 7, 11, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}
.topnav-left { display: flex; align-items: center; gap: 40px; }
.topnav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: 0.5px;
    text-decoration: none;
    background: var(--accent-gradient-3);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.topnav-logo-dot {
    width: 11px; height: 11px;
    background: radial-gradient(circle, #60a5fa, #8b5cf6, #ec4899);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.8);
    flex-shrink: 0;
}
.topnav-links { display: flex; gap: 8px; }
.topnav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    transition: color var(--transition), background var(--transition);
}
.topnav-links a:hover { color: var(--text-primary); background: rgba(255,255,255,0.04); }
.topnav-links a.active { color: var(--text-primary); background: rgba(139, 92, 246, 0.12); }

.topnav-right { display: flex; align-items: center; gap: 12px; }
.user-pill {
    display: flex; align-items: center; gap: 10px;
    background: rgba(255, 255, 255, 0.03);
    padding: 6px 14px 6px 6px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
}
.user-pill img { width: 28px; height: 28px; border-radius: 50%; }
.user-pill span { font-size: 0.85rem; font-weight: 500; }
.btn-logout {
    color: var(--danger);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.18);
    transition: background var(--transition);
}
.btn-logout:hover { background: rgba(239, 68, 68, 0.16); }

/* ═══════════════════════════════════════════════
   BOUTONS
   ═══════════════════════════════════════════════ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-family: var(--font);
    font-weight: 600;
    font-size: 0.875rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: opacity var(--transition), transform var(--transition), box-shadow var(--transition), background var(--transition);
}
.btn-primary {
    background: var(--accent-gradient);
    color: #fff;
    box-shadow: var(--shadow-glow);
}
.btn-primary:hover { opacity: 0.92; box-shadow: var(--shadow-glow-strong); transform: translateY(-1px); }
.btn-outline {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    border: 1px solid var(--border);
}
.btn-outline:hover { background: rgba(255, 255, 255, 0.08); border-color: var(--border-hover); }
.btn-danger { background: linear-gradient(135deg, #ef4444, #b91c1c); color: #fff; box-shadow: 0 4px 20px rgba(239, 68, 68, 0.25); }
.btn-danger:hover { opacity: 0.9; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.8rem; }

/* ═══════════════════════════════════════════════
   CARTES
   ═══════════════════════════════════════════════ */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    backdrop-filter: blur(10px);
    transition: border-color var(--transition), transform var(--transition);
}
.card-hover:hover { border-color: var(--border-hover); transform: translateY(-3px); }

/* ═══════════════════════════════════════════════
   BADGES
   ═══════════════════════════════════════════════ */
.badge {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 0.72rem; font-weight: 600;
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-full);
}
.badge-success { background: rgba(16, 185, 129, 0.12); color: var(--success); }
.badge-muted { background: rgba(148, 163, 184, 0.12); color: var(--text-secondary); }
.badge-accent { background: rgba(139, 92, 246, 0.15); color: var(--accent-purple); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.status-dot.online { background: var(--success); box-shadow: 0 0 8px var(--success); }
.status-dot.offline { background: var(--text-tertiary); }

/* ═══════════════════════════════════════════════
   FORMULAIRES
   ═══════════════════════════════════════════════ */
.form-group { display: flex; flex-direction: column; gap: 0.5rem; }
.form-group label {
    font-size: 0.85rem; font-weight: 500; color: var(--text-secondary);
    display: flex; align-items: center; gap: 0.4rem;
}
.form-control, textarea.form-control, select.form-control {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.7rem 1rem;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-family: var(--font);
    width: 100%;
    outline: none;
    transition: border-color var(--transition);
    resize: vertical;
}
.form-control:focus { border-color: var(--accent-purple); }
select.form-control { cursor: pointer; }
select.form-control option { background-color: #12141c; color: #fff; }
.hint { font-size: 0.75rem; color: var(--text-tertiary); }

/* ── Toggle switch ── */
.switch { position: relative; width: 44px; height: 25px; flex-shrink: 0; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
    position: absolute; inset: 0; cursor: pointer;
    background: #2a2f3a; border-radius: var(--radius-full);
    transition: background var(--transition);
}
.switch .slider::before {
    content: ""; position: absolute; height: 19px; width: 19px; left: 3px; bottom: 3px;
    background: #fff; border-radius: 50%; transition: transform var(--transition);
}
.switch input:checked + .slider { background: var(--accent-gradient); }
.switch input:checked + .slider::before { transform: translateX(19px); }

/* ═══════════════════════════════════════════════
   TABLEAUX
   ═══════════════════════════════════════════════ */
.data-table { width: 100%; border-collapse: collapse; text-align: left; }
.data-table th, .data-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
}
.data-table th {
    color: var(--text-secondary); font-weight: 600; font-size: 0.72rem;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.data-table td img { width: 30px; height: 30px; border-radius: 50%; vertical-align: middle; margin-right: 0.7rem; }
.table-container { width: 100%; overflow-x: auto; }

/* ═══════════════════════════════════════════════
   ÉTATS : vide / chargement / erreur
   ═══════════════════════════════════════════════ */
.empty-state, .error-state {
    text-align: center; padding: 2.5rem 1rem; color: var(--text-secondary);
    display: flex; flex-direction: column; align-items: center; gap: 0.75rem;
}
.empty-state i, .error-state i { font-size: 1.75rem; opacity: 0.5; }
.error-state { color: var(--danger); }
.loading-state { display: flex; align-items: center; gap: 0.6rem; color: var(--text-secondary); font-size: 0.85rem; padding: 1rem 0; }
.spinner {
    width: 16px; height: 16px; border-radius: 50%;
    border: 2px solid rgba(139, 92, 246, 0.2);
    border-top-color: var(--accent-purple);
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════
   UTILITAIRES
   ═══════════════════════════════════════════════ */
.text-muted { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.section-title { font-size: 1.2rem; font-weight: 600; display: flex; align-items: center; gap: 0.7rem; }
.section-desc { color: var(--text-secondary); font-size: 0.85rem; }

@media (max-width: 768px) {
    .topnav { padding: 14px 20px; flex-wrap: wrap; gap: 10px; }
    .topnav-links { display: none; }
}
