/* ============================================================
   JOBOOST ADMIN — design system (v2)
   Panneau d'administration réel : sidebar sombre + zone de contenu
   claire, typographie technique (IBM Plex Sans/Mono), cartes à bordure
   fine plutôt qu'à ombre flottante, chiffres en tabulaire/mono partout.
   L'accent vert de marque est réservé aux actions primaires et à l'état
   "succès" — il ne décore plus systématiquement icônes/bordures.
   ============================================================ */

:root {
    /* Texte / surfaces */
    --ink: #0d1420;
    --ink-text: #1c2534;
    --muted: #667085;
    --paper: #ffffff;
    --paper-dim: #f4f5f7;
    --paper-tint: #e6f6ee;
    --line: rgba(13, 20, 32, 0.10);
    --line-strong: rgba(13, 20, 32, 0.16);

    /* Accent de marque + sémantique */
    --primary: #12b76a;
    --primary-dark: #0d8a52;
    --accent: #2a5cad;
    --accent-dim: #eaf0fa;
    --danger: #d92d20;
    --danger-dim: #fdeceb;
    --warning: #dc6803;
    --warning-dim: #fff3e0;

    /* Typographie */
    --font-display: "IBM Plex Sans", "Segoe UI", sans-serif;
    --font-body: "IBM Plex Sans", "Segoe UI", sans-serif;
    --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

    /* Rayons / ombres — sobres, pas de coins "bulle" */
    --radius-lg: 12px;
    --radius-md: 9px;
    --radius-sm: 7px;
    --shadow-soft: 0 20px 45px -22px rgba(13, 20, 32, 0.45);
    --shadow-card: 0 1px 2px rgba(13, 20, 32, 0.05), 0 1px 0 rgba(13, 20, 32, 0.03);

    /* Sidebar sombre (tokens internes, non référencés hors de ce fichier) */
    --sidebar-w: 264px;
    --sidebar-bg: #0d1420;
    --sidebar-bg-hover: #182231;
    --sidebar-text: #c7ccd6;
    --sidebar-text-dim: #6b7386;
    --sidebar-active-bg: rgba(18, 183, 106, 0.16);
    --sidebar-line: rgba(255, 255, 255, 0.08);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: var(--font-body);
    background: var(--paper-dim);
    color: var(--ink-text);
    -webkit-font-smoothing: antialiased;
    font-size: 14px;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; margin: 0; color: var(--ink); letter-spacing: -0.01em; }
code { font-family: var(--font-mono); }
::selection { background: rgba(18, 183, 106, 0.2); }

/* ===== Shell ===== */
.adm-shell { display: flex; min-height: 100vh; }

/* ===== Sidebar (sombre) ===== */
.adm-sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    background: var(--sidebar-bg);
    height: 100vh;
    position: sticky;
    top: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    z-index: 40;
}
.adm-sidebar-brand {
    display: flex; align-items: center; gap: 10px;
    padding: 20px 20px; border-bottom: 1px solid var(--sidebar-line);
}
.adm-sidebar-logo {
    width: 32px; height: 32px; border-radius: var(--radius-sm);
    background: var(--primary);
    color: #06130d; display: flex; align-items: center; justify-content: center; font-size: 0.9rem;
    flex-shrink: 0;
}
.adm-sidebar-brand-text { font-family: var(--font-display); font-weight: 600; font-size: 0.95rem; color: #f2f4f7; }
.adm-sidebar-brand-text strong { color: var(--primary); font-weight: 700; }

.adm-sidebar-nav { padding: 12px 10px 24px; flex: 1; }
.adm-nav-section {
    font-family: var(--font-mono);
    font-size: 0.64rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.09em;
    color: var(--sidebar-text-dim); padding: 16px 10px 6px;
}
.adm-nav-section:first-child { padding-top: 4px; }
.adm-nav-link {
    display: flex; align-items: center; gap: 11px;
    padding: 8px 10px; border-radius: var(--radius-sm);
    font-size: 0.86rem; font-weight: 500; color: var(--sidebar-text);
    transition: background 0.15s, color 0.15s;
}
.adm-nav-link i { width: 16px; text-align: center; color: var(--sidebar-text-dim); font-size: 0.85rem; transition: color 0.15s; }
.adm-nav-link:hover { background: var(--sidebar-bg-hover); color: #f2f4f7; }
.adm-nav-link.active { background: var(--sidebar-active-bg); color: #ffffff; font-weight: 600; }
.adm-nav-link.active i { color: var(--primary); }

/* ===== Main / Topbar ===== */
.adm-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.adm-topbar {
    display: flex; align-items: center; gap: 16px;
    padding: 14px 28px; background: var(--paper); border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 30;
}
.adm-topbar-title { font-size: 1.05rem; flex: 1; }
.adm-sidebar-toggle {
    display: none; width: 34px; height: 34px; border-radius: var(--radius-sm);
    border: 1px solid var(--line); background: var(--paper); color: var(--ink); cursor: pointer;
}
.adm-topbar-actions { display: flex; align-items: center; gap: 14px; }
.adm-admin-chip { display: flex; align-items: center; gap: 10px; }
.adm-admin-avatar { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); }
.adm-admin-chip-text { display: flex; flex-direction: column; gap: 2px; line-height: 1.15; }
.adm-admin-chip-text strong { font-size: 0.8rem; font-weight: 600; }
.adm-role-badge {
    font-family: var(--font-mono);
    font-size: 0.62rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em;
    padding: 1px 7px; border-radius: 4px; display: inline-block; width: fit-content;
}
.adm-role-super_admin { background: var(--danger-dim); color: #9c2a1f; }
.adm-role-admin { background: var(--paper-tint); color: var(--primary-dark); }
.adm-role-moderator { background: var(--accent-dim); color: var(--accent); }
.adm-role-support { background: var(--paper-dim); color: var(--muted); }
.adm-logout-btn {
    width: 34px; height: 34px; border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--line); color: var(--danger); transition: background 0.15s, border-color 0.15s;
}
.adm-logout-btn:hover { background: var(--danger-dim); border-color: var(--danger); }

.adm-content { padding: 24px 28px 60px; max-width: 1400px; width: 100%; margin: 0 auto; }

/* ===== Page intro (titre de section + description) ===== */
.adm-page-intro { margin-bottom: 20px; }
.adm-page-intro p { color: var(--muted); font-size: 0.88rem; margin: 5px 0 0; }

/* ===== Compteur "live" (ex: utilisateurs en temps réel) ===== */
.adm-live-hero { text-align: center; padding: 30px 20px; }
.adm-live-hero-label {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    font-family: var(--font-mono); font-size: 0.74rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 10px;
}
.adm-live-dot {
    width: 8px; height: 8px; border-radius: 50%; background: var(--primary);
    box-shadow: 0 0 0 rgba(18, 183, 106, 0.5);
    animation: admLivePulse 1.6s ease-out infinite;
}
@keyframes admLivePulse {
    0%   { box-shadow: 0 0 0 0 rgba(18, 183, 106, 0.55); }
    70%  { box-shadow: 0 0 0 9px rgba(18, 183, 106, 0); }
    100% { box-shadow: 0 0 0 0 rgba(18, 183, 106, 0); }
}
.adm-live-hero-value {
    font-family: var(--font-mono); font-weight: 700; font-size: 4.2rem; line-height: 1;
    color: var(--ink); font-variant-numeric: tabular-nums;
}
@media (max-width: 600px) { .adm-live-hero-value { font-size: 3rem; } }

/* ===== Stat cards ===== */
.adm-stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 22px; }
.adm-stat-card {
    background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg);
    padding: 18px; box-shadow: var(--shadow-card);
}
.adm-stat-card .label { font-size: 0.76rem; color: var(--muted); font-weight: 500; margin-bottom: 8px; display: flex; align-items: center; gap: 7px; }
.adm-stat-card .label i { color: var(--muted); font-size: 0.8rem; }
.adm-stat-card .value { font-family: var(--font-mono); font-weight: 600; font-size: 1.5rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.adm-stat-card .delta { font-size: 0.76rem; margin-top: 6px; color: var(--muted); font-family: var(--font-mono); }
.adm-stat-card .delta.up { color: var(--primary-dark); }
.adm-stat-card .delta.down { color: var(--danger); }

/* ===== Cards / panels ===== */
.adm-card {
    background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg);
    padding: 20px; box-shadow: var(--shadow-card); margin-bottom: 20px;
}
.adm-card h3 { font-size: 0.94rem; font-weight: 600; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.adm-card h3 i { color: var(--muted); font-size: 0.85rem; }

/* ===== Toolbar (recherche/filtres au-dessus d'une table) ===== */
.adm-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.adm-search { position: relative; flex: 1; min-width: 220px; }
.adm-search i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 0.82rem; pointer-events: none; }
.adm-search input { padding-left: 38px; }

/* ===== Formulaires ===== */
.adm-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.adm-field label { font-size: 0.8rem; font-weight: 600; color: var(--ink); }
.adm-field .hint { font-size: 0.74rem; color: var(--muted); }
input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="date"], input[type="search"], input[type="tel"], input[type="color"], input[type="file"], select, textarea {
    font-family: var(--font-body); font-size: 0.88rem;
    padding: 9px 12px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong);
    background: #fff; color: var(--ink-text); width: 100%;
}
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(18,183,106,0.14);
}
label { font-size: 0.85rem; }

/* ===== Boutons ===== */
.adm-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    padding: 9px 16px; border-radius: var(--radius-sm); border: 1px solid transparent; cursor: pointer;
    font-family: var(--font-body); font-weight: 600; font-size: 0.83rem;
    transition: background 0.15s, box-shadow 0.15s, opacity 0.15s, border-color 0.15s;
}
.adm-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.adm-btn-primary { background: var(--primary); color: #fff; }
.adm-btn-primary:hover:not(:disabled) { background: var(--primary-dark); }
.adm-btn-danger { background: var(--danger); color: #fff; }
.adm-btn-danger:hover:not(:disabled) { background: #b6251b; }
.adm-btn-ghost { background: var(--paper); color: var(--ink-text); border-color: var(--line-strong); }
.adm-btn-ghost:hover:not(:disabled) { background: var(--paper-dim); border-color: var(--muted); }
.adm-btn-sm { padding: 6px 12px; font-size: 0.76rem; }

/* ===== Badges de statut ===== */
.badge, .adm-badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 10px; border-radius: 999px; font-size: 0.72rem; font-weight: 600;
    font-family: var(--font-mono);
}
.bg-success, .adm-badge-success { background: var(--paper-tint); color: var(--primary-dark); }
.bg-danger, .adm-badge-danger { background: var(--danger-dim); color: #9c2a1f; }
.bg-warning, .adm-badge-warning { background: var(--warning-dim); color: #8a4a0a; }
.bg-secondary, .adm-badge-neutral { background: var(--paper-dim); color: var(--muted); }
.adm-badge-info { background: #e8f0fe; color: #1a56c4; }
.text-dark { color: inherit; }

/* ===== Tables ===== */
.adm-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--paper); }
.adm-table { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
.adm-table th {
    text-align: left; padding: 10px 14px; background: var(--paper-dim);
    font-family: var(--font-mono);
    font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 600;
    white-space: nowrap;
}
.adm-table td { padding: 10px 14px; border-top: 1px solid var(--line); vertical-align: middle; }
.adm-table tbody tr:hover { background: var(--paper-dim); }
.adm-table .num { font-variant-numeric: tabular-nums; font-family: var(--font-mono); }

/* ===== Pagination ===== */
.adm-pagination { display: flex; align-items: center; gap: 6px; justify-content: flex-end; margin-top: 14px; }
.adm-pagination a, .adm-pagination span {
    min-width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-sm); font-size: 0.8rem; font-weight: 600; color: var(--ink-text);
    font-family: var(--font-mono);
    border: 1px solid var(--line); padding: 0 8px;
}
.adm-pagination a:hover { background: var(--paper-dim); }
.adm-pagination .current { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ===== Alerts ===== */
.adm-alert { display: flex; align-items: flex-start; gap: 10px; padding: 12px 15px; border-radius: var(--radius-sm); border: 1px solid transparent; font-size: 0.86rem; margin-bottom: 16px; }
.adm-alert-success { background: var(--paper-tint); color: var(--primary-dark); border-color: rgba(18,183,106,0.25); }
.adm-alert-error { background: var(--danger-dim); color: #8a1f1f; border-color: rgba(217,45,32,0.25); }
.adm-alert-info { background: var(--accent-dim); color: var(--accent); border-color: rgba(42,92,173,0.2); }

/* ===== Modal ===== */
.adm-modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(13,20,32,0.55);
    z-index: 1000; align-items: center; justify-content: center; padding: 20px;
}
.adm-modal-overlay.open { display: flex; }
.adm-modal { background: #fff; border-radius: var(--radius-lg); padding: 24px; max-width: 440px; width: 100%; box-shadow: var(--shadow-soft); border: 1px solid var(--line); }
.adm-modal h3 { margin-bottom: 10px; font-size: 1rem; }
.adm-modal p { color: var(--muted); font-size: 0.88rem; margin: 0 0 18px; }
.adm-modal-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* ===== Empty state ===== */
.adm-empty-state { text-align: center; padding: 60px 24px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); max-width: 480px; margin: 60px auto; }
.adm-empty-icon { width: 56px; height: 56px; margin: 0 auto 16px; border-radius: 50%; background: var(--paper-dim); color: var(--muted); display: flex; align-items: center; justify-content: center; font-size: 1.3rem; }
.adm-empty-state h2 { font-size: 1.1rem; margin-bottom: 8px; }
.adm-empty-state p { color: var(--muted); font-size: 0.88rem; margin: 0 0 20px; }

/* ===== Toasts ===== */
#admToasts { position: fixed; bottom: 24px; right: 24px; z-index: 2000; display: flex; flex-direction: column; gap: 10px; }
.adm-toast {
    background: var(--ink); color: #fff; padding: 11px 16px; border-radius: var(--radius-sm);
    font-size: 0.83rem; box-shadow: var(--shadow-soft); display: flex; align-items: center; gap: 8px;
    animation: admToastIn 0.2s ease-out;
}
.adm-toast.success { background: var(--primary-dark); }
.adm-toast.error { background: #8a1f1f; }
@keyframes admToastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ===== Responsive ===== */
@media (max-width: 900px) {
    .adm-sidebar {
        position: fixed; left: 0; top: 0; transform: translateX(-100%);
        transition: transform 0.2s ease; box-shadow: var(--shadow-soft);
    }
    .adm-sidebar.open { transform: translateX(0); }
    .adm-sidebar-toggle { display: flex; align-items: center; justify-content: center; }
    .adm-content { padding: 18px 16px 40px; }
    .adm-admin-chip-text { display: none; }
}
