/* ═══════════════════════════════════════════════════════════════════════════
   Talaqi TiktokTech — V5.2.0 · CSS RÉÉCRIT DE ZÉRO (exigence : supprimer tout
   le front-end et recréer la dashboard). Aucun build, aucune dépendance.
   Vocabulaire de classes conservé (le back fournit les mêmes données), la
   STRUCTURE est nouvelle : parcours numéroté ١→٧, tout regroupé.
   Palette : nuit #0B0F1A · carte #121826 · or #D4AF37 · vert #2FBF71.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
    --bg: #0B0F1A;
    --bg-soft: #0F1420;
    --card: #121826;
    --card-2: #161D2E;
    --line: #232C42;
    --line-soft: #1B2338;
    --text: #E8ECF4;
    --muted: #8A93A8;
    --gold: #D4AF37;
    --gold-soft: rgba(212, 175, 55, .14);
    --green: #2FBF71;
    --green-soft: rgba(47, 191, 113, .14);
    --red: #E5484D;
    --red-soft: rgba(229, 72, 77, .14);
    --blue: #4C8DFF;
    --blue-soft: rgba(76, 141, 255, .14);
    --warn: #E5A13A;
    --warn-soft: rgba(229, 161, 58, .16);
    --radius: 14px;
    --radius-sm: 9px;
    --shadow: 0 10px 30px rgba(0, 0, 0, .35);
    --sidebar-w: 272px;
    --font: 'Tajawal', 'Segoe UI', Tahoma, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font);
    background:
        radial-gradient(1100px 500px at 85% -10%, rgba(212, 175, 55, .05), transparent 60%),
        radial-gradient(900px 420px at -10% 110%, rgba(76, 141, 255, .05), transparent 60%),
        var(--bg);
    color: var(--text);
    font-size: 14.5px;
    line-height: 1.65;
    min-height: 100vh;
}
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }
code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    background: var(--bg-soft);
    border: 1px solid var(--line-soft);
    border-radius: 6px;
    padding: .05rem .35rem;
    font-size: .85em;
    color: #C9D2E5;
    direction: ltr;
    unicode-bidi: embed;
}
/* V5.5 - isolation bidi COMPLETE : embed laissait fuiter l'ordre visuel autour des fragments latins (exigence : mots ar/fr/en melanges) ; isolate cloture chaque fragment dans sa propre direction. */
.ltr { direction: ltr; unicode-bidi: isolate; }
.icon { width: 17px; height: 17px; flex: none; vertical-align: -3px; }

/* ═══ 1. SIDEBAR — le parcours numéroté ═══ */
.sidebar {
    position: fixed; inset-block: 0; inset-inline-start: 0;
    width: var(--sidebar-w);
    background: linear-gradient(180deg, #0E1322 0%, #0B0F1A 100%);
    border-inline-end: 1px solid var(--line);
    display: flex; flex-direction: column;
    z-index: 50;
    overflow-y: auto;
}
.brand {
    display: flex; align-items: center; gap: .6rem;
    padding: 1rem .9rem;
    border-bottom: 1px solid var(--line-soft);
}
.brand-logo {
    width: 40px; height: 40px; flex: none;
    border-radius: 11px; overflow: hidden;
    background: var(--gold-soft);
    display: flex; align-items: center; justify-content: center;
}
.brand-logo img { width: 100%; height: 100%; object-fit: cover; }
.brand-fallback {
    font-weight: 800; color: var(--gold); font-size: 1.2rem;
    display: flex; align-items: center; justify-content: center;
}
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name { font-weight: 800; font-size: .98rem; white-space: nowrap; }
.brand-sub { font-size: .72rem; color: var(--muted); white-space: nowrap; }
.sidebar-close {
    margin-inline-start: auto;
    background: none; border: none; color: var(--muted); cursor: pointer;
    padding: .3rem; border-radius: 8px;
}
.sidebar-close:hover { background: var(--card-2); color: var(--text); }

.nav { padding: .7rem .55rem; display: flex; flex-direction: column; gap: .2rem; }
.nav-section {
    font-size: .68rem; font-weight: 700; letter-spacing: .06em;
    color: var(--muted); text-transform: uppercase;
    padding: .8rem .55rem .3rem;
}
.nav-link {
    display: flex; align-items: center; gap: .65rem;
    padding: .55rem .6rem;
    border-radius: var(--radius-sm);
    color: var(--text);
    border: 1px solid transparent;
    transition: background .15s, border-color .15s;
}
.nav-link:hover { background: var(--card-2); text-decoration: none; }
.nav-link.active {
    background: linear-gradient(90deg, var(--gold-soft), transparent 70%);
    border-color: rgba(212, 175, 55, .3);
}
.nav-num {
    width: 26px; height: 26px; flex: none;
    display: flex; align-items: center; justify-content: center;
    border-radius: 8px;
    background: var(--card-2);
    border: 1px solid var(--line);
    font-weight: 800; font-size: .82rem; color: var(--muted);
}
.nav-link.active .nav-num {
    background: var(--gold-soft); border-color: rgba(212, 175, 55, .45); color: var(--gold);
}
.nav-body { display: flex; flex-direction: column; min-width: 0; }
.nav-label { font-weight: 700; font-size: .88rem; line-height: 1.3; }
.nav-desc { font-size: .7rem; color: var(--muted); line-height: 1.35; }
.nav-new {
    font-size: .62rem; font-weight: 800; color: var(--gold);
    background: var(--gold-soft); border-radius: 5px; padding: 0 .3rem;
    vertical-align: 1px; margin-inline-start: .25rem;
}
.sidebar-foot { margin-top: auto; padding: .8rem; }
.sidebar-foot-card {
    display: flex; flex-direction: column; gap: .25rem;
    background: var(--card-2); border: 1px solid var(--line-soft);
    border-radius: var(--radius-sm);
    padding: .6rem .7rem; font-size: .74rem; color: var(--muted);
}
.status-live { display: inline-flex; align-items: center; gap: .35rem; color: var(--green); font-weight: 700; font-size: .8rem; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-completed { background: var(--green); box-shadow: 0 0 8px rgba(47, 191, 113, .8); }
.dot-pending { background: var(--warn); box-shadow: 0 0 8px rgba(229, 161, 58, .8); }
.live-dot {
    width: 9px; height: 9px; border-radius: 50%; display: inline-block;
    background: var(--red); box-shadow: 0 0 8px rgba(229, 72, 77, .9);
    animation: pulse 1.6s infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
.live-pulse {
    width: 9px; height: 9px; border-radius: 50%; display: inline-block;
    background: var(--red); animation: pulse 1.6s infinite;
}

.sidebar-toggle {
    display: none; position: fixed; inset-block-start: .8rem; inset-inline-start: .8rem;
    z-index: 60; background: var(--card); color: var(--text);
    border: 1px solid var(--line); border-radius: 10px; padding: .5rem;
    cursor: pointer;
}

/* ═══ 2. MAIN ═══ */
.main {
    margin-inline-start: var(--sidebar-w);
    padding: 1.4rem 1.5rem 1rem;
    max-width: 1480px;
}
.main-foot { padding: 1.2rem 0 .6rem; text-align: center; font-size: .78rem; }

/* ═══ 3. HERO + ENCHAÎNEMENT ═══ */
.hero {
    display: flex; gap: 1rem; align-items: stretch; justify-content: space-between;
    background: linear-gradient(120deg, var(--card) 0%, var(--card-2) 100%);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.1rem 1.2rem;
    margin-bottom: .6rem;
    box-shadow: var(--shadow);
}
.hero-text h2 { font-size: 1.35rem; font-weight: 800; margin-bottom: .3rem; }
.hero-text p { color: var(--muted); max-width: 72ch; }
.hero-text strong { color: var(--text); }
.hero-actions { display: flex; gap: .55rem; align-items: center; flex-wrap: wrap; }

/* La bande du parcours (chaque page affiche où on en est) */
.stepflow {
    display: grid; gap: .45rem;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    margin-bottom: .8rem;
}
.stepflow a {
    display: flex; gap: .5rem; align-items: center;
    background: var(--card); border: 1px solid var(--line-soft);
    border-radius: var(--radius-sm); padding: .5rem .6rem;
    color: var(--text);
}
.stepflow a:hover { border-color: rgba(212, 175, 55, .35); text-decoration: none; }
.stepflow a.here {
    background: linear-gradient(120deg, var(--gold-soft), transparent 80%);
    border-color: rgba(212, 175, 55, .45);
}
.stepflow-num {
    width: 22px; height: 22px; flex: none;
    display: flex; align-items: center; justify-content: center;
    border-radius: 7px; background: var(--card-2); border: 1px solid var(--line);
    font-weight: 800; font-size: .72rem; color: var(--muted);
}
.stepflow a.here .stepflow-num { background: var(--gold-soft); color: var(--gold); border-color: rgba(212, 175, 55, .45); }
.stepflow-label { font-size: .78rem; font-weight: 700; line-height: 1.25; }
.stepflow-hint { font-size: .66rem; color: var(--muted); display: block; }

/* ═══ 4. CARTES ═══ */
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    margin-bottom: .8rem;
    overflow: hidden;
}
.card-pad { padding: .95rem 1rem; }
.card-head {
    display: flex; align-items: center; justify-content: space-between; gap: .6rem;
    padding: .8rem 1rem;
    border-bottom: 1px solid var(--line-soft);
    flex-wrap: wrap;
}
.card-title {
    font-size: 1.02rem; font-weight: 800;
    display: inline-flex; align-items: center; gap: .5rem; flex-wrap: wrap;
}
.card-title .icon { color: var(--gold); }
.mt-2 { margin-top: .8rem; }
.mt-1 { margin-top: .45rem; }
.mb-2 { margin-bottom: .8rem; }
.mb-1 { margin-bottom: .45rem; }
.mb-0 { margin-bottom: 0; }

/* ═══ 5. BOUTONS ═══ */
.btn {
    display: inline-flex; align-items: center; gap: .4rem;
    font-family: var(--font); font-weight: 700; font-size: .88rem;
    padding: .5rem .95rem;
    border-radius: 10px; border: 1px solid var(--line);
    background: var(--card-2); color: var(--text);
    cursor: pointer; white-space: nowrap;
    transition: filter .15s, transform .05s;
}
.btn:hover { filter: brightness(1.12); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: wait; }
.btn-lg { padding: .65rem 1.3rem; font-size: .98rem; }
.btn-sm { padding: .28rem .6rem; font-size: .78rem; border-radius: 8px; }
.btn-gold {
    background: linear-gradient(135deg, #E3C460, #C9A227);
    border-color: rgba(212, 175, 55, .5); color: #1A1608;
}
.btn-ghost { background: transparent; }
.btn-muted { background: var(--bg-soft); color: var(--muted); }
.btn-info { background: var(--blue-soft); border-color: rgba(76, 141, 255, .4); color: #A8C6FF; }
.btn-danger-text { color: #FF8589; }
.inline-form { display: inline-flex; margin: 0; }
.actions-row { display: flex; gap: .3rem; align-items: center; flex-wrap: wrap; }
.btn-target-chip { font-size: .78rem; opacity: .85; }

/* ═══ 6. BADGES · CHIPS · TAGS ═══ */
.badge {
    display: inline-flex; align-items: center; gap: .3rem;
    font-size: .72rem; font-weight: 700;
    padding: .12rem .5rem; border-radius: 999px;
    background: var(--card-2); border: 1px solid var(--line);
    color: var(--muted);
}
.badge-success { background: var(--green-soft); border-color: rgba(47, 191, 113, .4); color: #7FE0AC; }
.badge-danger { background: var(--red-soft); border-color: rgba(229, 72, 77, .4); color: #FF9B9E; }
.badge-warning { background: var(--warn-soft); border-color: rgba(229, 161, 58, .4); color: #F2C186; }
.badge-info { background: var(--blue-soft); border-color: rgba(76, 141, 255, .4); color: #A8C6FF; }
.badge-gold { background: var(--gold-soft); border-color: rgba(212, 175, 55, .4); color: var(--gold); }
.tab-count {
    font-size: .72rem; font-weight: 800;
    background: var(--gold-soft); color: var(--gold);
    border-radius: 999px; padding: .05rem .5rem;
}
.chip-row { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.chip {
    display: inline-flex; align-items: center; gap: .35rem;
    background: var(--card-2); border: 1px solid var(--line);
    color: var(--text); border-radius: 999px;
    padding: .28rem .7rem; font-size: .8rem; font-weight: 700;
}
.chip:hover { border-color: rgba(212, 175, 55, .4); text-decoration: none; }
.chip-active { background: var(--gold-soft); border-color: rgba(212, 175, 55, .45); color: var(--gold); }
.chip-count { color: var(--muted); font-weight: 500; }
.chip-var { cursor: pointer; direction: ltr; }
.tag {
    display: inline-flex; align-items: center; gap: .3rem;
    background: var(--bg-soft); border: 1px solid var(--line-soft);
    color: var(--text); border-radius: 8px;
    padding: .16rem .55rem; font-size: .76rem;
}
.tag-gold { background: var(--gold-soft); border-color: rgba(212, 175, 55, .35); }
.tag-danger { background: var(--red-soft); border-color: rgba(229, 72, 77, .35); }
.tag-muted { color: var(--muted); }
.chips-row { display: flex; gap: .35rem; flex-wrap: wrap; }
.count-chip {
    display: inline-flex; align-items: center; gap: .4rem;
    background: var(--card-2); border: 1px solid var(--line);
    border-radius: 999px; padding: .35rem .8rem; font-weight: 700; font-size: .84rem;
}
.radar-version-chip {
    font-size: .66rem; font-weight: 800; letter-spacing: .04em;
    color: var(--gold); background: var(--gold-soft);
    border: 1px solid rgba(212, 175, 55, .4);
    border-radius: 999px; padding: .08rem .55rem;
    vertical-align: 3px;
}
.verified-badge { color: var(--blue); display: inline-flex; }
.verified-badge .icon { width: 14px; height: 14px; }
.geo-badge {
    font-size: .66rem; font-weight: 800; border-radius: 6px;
    padding: .05rem .35rem; margin-inline-start: .25rem;
}
.geo-exact { background: var(--green-soft); color: #7FE0AC; border: 1px solid rgba(47, 191, 113, .35); }
.geo-term { background: var(--warn-soft); color: #F2C186; border: 1px solid rgba(229, 161, 58, .35); }
.quality-chip {
    display: inline-block; min-width: 30px; text-align: center;
    font-weight: 800; font-size: .78rem;
    border-radius: 8px; padding: .14rem .4rem;
}
.quality-high { background: var(--green-soft); color: #7FE0AC; border: 1px solid rgba(47, 191, 113, .35); }
.quality-mid { background: var(--warn-soft); color: #F2C186; border: 1px solid rgba(229, 161, 58, .35); }
.quality-low { background: var(--red-soft); color: #FF9B9E; border: 1px solid rgba(229, 72, 77, .35); }
.live-chip {
    display: inline-flex; align-items: center; gap: .3rem;
    background: var(--red-soft); color: #FF9B9E;
    border: 1px solid rgba(229, 72, 77, .4);
    border-radius: 999px; padding: .1rem .55rem;
    font-size: .72rem; font-weight: 800;
}

/* ═══ 7. FORMULAIRES ═══ */
.filter-grid, .form-grid {
    display: grid; gap: .65rem;
    grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
    align-items: start;
}
.span-2 { grid-column: span 2; }
@media (max-width: 720px) { .span-2 { grid-column: span 1; } }
.field { display: flex; flex-direction: column; gap: .28rem; min-width: 0; }
.label { font-size: .78rem; font-weight: 700; color: var(--muted); }
.optional { color: var(--muted); font-weight: 500; font-size: .7rem; }
.input, .select {
    font-family: var(--font); font-size: .88rem;
    background: var(--bg-soft); color: var(--text);
    border: 1px solid var(--line); border-radius: 10px;
    padding: .5rem .7rem; width: 100%;
    outline: none;
}
.input:focus, .select:focus { border-color: rgba(212, 175, 55, .55); box-shadow: 0 0 0 3px rgba(212, 175, 55, .1); }
.select { appearance: auto; }
.select-sm { padding: .3rem .5rem; font-size: .8rem; width: auto; }
textarea.input { resize: vertical; }
.field-hint { font-size: .74rem; color: var(--muted); }
.filter-actions { flex-direction: row; align-items: end; gap: .5rem; flex-wrap: wrap; }
.checkbox-inline { display: flex; align-items: center; gap: .4rem; font-size: .8rem; color: var(--text); font-weight: 600; }
input[type="checkbox"] { accent-color: var(--gold); width: 15px; height: 15px; }
.radar-filter-form { margin-bottom: .6rem; }
.radar-filter-run { margin-top: .55rem; }
.radar-filter-head { color: var(--text); display: inline-flex; align-items: center; gap: .4rem; }

/* ═══ 8. KPI ═══ */
.kpi-grid {
    display: grid; gap: .6rem;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    margin-bottom: .8rem;
}
.kpi {
    display: flex; gap: .7rem; align-items: center;
    background: var(--card); border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: .8rem .9rem;
    min-width: 0;
}
.kpi-live { border-color: rgba(229, 72, 77, .35); }
.kpi-icon {
    width: 42px; height: 42px; flex: none;
    display: flex; align-items: center; justify-content: center;
    border-radius: 12px; font-size: 1.1rem;
}
.kpi-icon .icon { width: 20px; height: 20px; }
.tint-gold { background: var(--gold-soft); color: var(--gold); }
.tint-danger { background: var(--red-soft); color: #FF9B9E; }
.tint-success { background: var(--green-soft); color: #7FE0AC; }
.tint-info { background: var(--blue-soft); color: #A8C6FF; }
.tint-warning { background: var(--warn-soft); color: #F2C186; }
.kpi-body { display: flex; flex-direction: column; min-width: 0; }
.kpi-value { font-size: 1.28rem; font-weight: 800; line-height: 1.25; word-break: break-word; }
.kpi-label { font-size: .74rem; color: var(--muted); }
.kpi-group-title {
    display: flex; align-items: center; gap: .5rem;
    font-size: 1rem; font-weight: 800; margin: 1.1rem 0 .55rem;
}
.kpi-group-title .icon { color: var(--gold); }

/* ═══ 9. TABLES ═══ */
.table-wrap { overflow-x: auto; }
.table-wrap.bordered { border: 1px solid var(--line-soft); border-radius: 10px; }
.table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.table thead th {
    text-align: start; font-size: .72rem; font-weight: 800;
    color: var(--muted); text-transform: none;
    padding: .6rem .7rem;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
    background: var(--bg-soft);
}
.table tbody td {
    padding: .55rem .7rem;
    border-bottom: 1px solid var(--line-soft);
    vertical-align: middle;
}
.table tbody tr:hover { background: rgba(255, 255, 255, .017); }
.table tbody tr:last-child td { border-bottom: none; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.th-sub { display: block; font-weight: 500; font-size: .64rem; color: var(--muted); }
.cell-muted { color: var(--muted); }
.account-cell { display: flex; gap: .55rem; align-items: center; min-width: 180px; }
.avatar { width: 34px; height: 34px; border-radius: 10px; object-fit: cover; flex: none; background: var(--card-2); }
.avatar-lg { width: 64px; height: 64px; border-radius: 16px; }
.avatar-fallback {
    width: 34px; height: 34px; border-radius: 10px; flex: none;
    background: var(--gold-soft); color: var(--gold);
    display: flex; align-items: center; justify-content: center;
    font-weight: 800;
}
span.avatar-fallback.avatar-lg { width: 64px; height: 64px; border-radius: 16px; font-size: 1.5rem; }
.name-stack { display: flex; flex-direction: column; min-width: 0; }
.name-line { font-weight: 700; display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
.name-line a { color: var(--text); }
.name-line a:hover { color: var(--gold); }
.username-line { color: var(--muted); font-size: .76rem; direction: ltr; unicode-bidi: isolate; text-align: end; }
.contact-value { direction: ltr; unicode-bidi: embed; word-break: break-all; }
td.contact-value { max-width: 240px; }
td.contact-actions { white-space: nowrap; }
.live-viewers { font-weight: 800; }
.live-title-cell { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sparkline { width: 120px; height: 26px; color: var(--blue); }
.gift-kpi { color: var(--gold); font-weight: 800; }
.usd-sub { color: var(--muted); font-size: .7rem; font-weight: 600; }
.hours-stack { display: flex; flex-direction: column; gap: .1rem; }
.watch-chip {
    background: var(--bg-soft); border: 1px solid var(--line-soft);
    border-radius: 6px; padding: 0 .3rem; font-size: .76rem; font-weight: 700;
}
.hours-sub { font-size: .7rem; color: var(--muted); }
.hours-month { opacity: .8; }

/* ═══ 10. ÉTATS VIDES · PAGINATION · DIVERS ═══ */
.empty { text-align: center; padding: 1.6rem 1rem; }
.empty-icon { color: var(--muted); opacity: .7; }
.empty-icon .icon { width: 34px; height: 34px; }
.empty-title { font-weight: 800; margin: .4rem 0 .2rem; }
.empty-text { color: var(--muted); font-size: .82rem; max-width: 60ch; margin-inline: auto; }
.pagination-wrap { padding: .75rem 1rem; display: flex; justify-content: center; }
.pagination-wrap nav { display: flex; gap: .25rem; flex-wrap: wrap; }
.pagination-wrap .page-link {
    background: var(--card-2); border: 1px solid var(--line);
    color: var(--text); border-radius: 8px; padding: .3rem .65rem;
    font-size: .82rem;
}
.pagination-wrap .page-link:hover { text-decoration: none; border-color: rgba(212, 175, 55, .4); }
.pagination-wrap .active .page-link { background: var(--gold-soft); border-color: rgba(212, 175, 55, .45); color: var(--gold); }
.pagination-wrap .disabled .page-link { opacity: .4; }
.back-link {
    display: inline-flex; align-items: center; gap: .35rem;
    color: var(--muted); font-weight: 700; font-size: .82rem;
    margin-bottom: .7rem;
}
.back-link:hover { color: var(--gold); }
.raw-json {
    background: var(--bg-soft); border: 1px solid var(--line-soft);
    border-radius: 10px; padding: .8rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: .74rem; max-height: 480px; overflow: auto;
    text-align: left; white-space: pre;
}
.link { color: var(--gold); }
.grad-text {
    background: linear-gradient(90deg, var(--text), #C7B77E);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}
.page-head {
    display: flex; align-items: center; justify-content: space-between; gap: .8rem;
    margin-bottom: .9rem; flex-wrap: wrap;
}
.page-head h2 { font-size: 1.4rem; font-weight: 800; }
.page-desc { color: var(--muted); font-size: .84rem; max-width: 75ch; }
.page-actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }

/* ═══ 11. ONGLETS (fiche profil) ═══ */
.tabs { display: flex; gap: .3rem; border-bottom: 1px solid var(--line); padding: 0 .6rem; flex-wrap: wrap; }
.tab {
    background: none; border: none; border-bottom: 2px solid transparent;
    color: var(--muted); font-family: var(--font); font-weight: 700; font-size: .88rem;
    padding: .7rem .9rem; cursor: pointer;
    display: inline-flex; align-items: center; gap: .4rem;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--gold); border-bottom-color: var(--gold); }
.tab-panel { display: none; padding: 1rem; }
.tab-panel.active { display: block; }
.overview-section { margin-bottom: 1.1rem; }
.overview-section > .label {
    display: inline-flex; align-items: center; gap: .4rem;
    margin-bottom: .4rem; color: var(--text);
}
.overview-section > .label .icon { color: var(--gold); }

/* ═══ 12. PROFIL (fiche) ═══ */
.profile-head { display: flex; gap: 1rem; align-items: flex-start; flex-wrap: wrap; }
.profile-id { flex: 1; min-width: 260px; }
.profile-name-row { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.profile-name { font-size: 1.25rem; font-weight: 800; }
.profile-username { color: var(--muted); direction: ltr; }
.profile-badges { display: flex; gap: .35rem; flex-wrap: wrap; margin: .4rem 0; }
.profile-bio { color: var(--muted); white-space: pre-line; }
.profile-actions { display: flex; gap: .5rem; align-items: center; }
.live-summary-strip {
    display: grid; gap: .5rem;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    margin: .5rem 0 .8rem;
}
.live-summary-item {
    background: var(--bg-soft); border: 1px solid var(--line-soft);
    border-radius: 10px; padding: .55rem .7rem;
    display: flex; flex-direction: column;
}
.live-summary-value { font-weight: 800; font-size: 1.02rem; }
.live-summary-label { font-size: .7rem; color: var(--muted); }
.gifts-list { display: flex; flex-direction: column; gap: .25rem; }
.gift-row {
    display: flex; justify-content: space-between;
    background: var(--bg-soft); border: 1px solid var(--line-soft);
    border-radius: 8px; padding: .35rem .6rem; font-size: .82rem;
}
.gift-count { font-weight: 800; color: var(--gold); }
.contacts-grid {
    display: grid; gap: .5rem;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.contact-card {
    background: var(--bg-soft); border: 1px solid var(--line-soft);
    border-radius: 10px; padding: .6rem .75rem;
    display: flex; flex-direction: column; gap: .25rem;
}
.contact-type { display: flex; align-items: center; gap: .4rem; font-weight: 800; font-size: .8rem; color: var(--muted); }
.contact-type .icon { color: var(--gold); }
a.contact-value { color: var(--gold); }
.work-tag {
    align-self: flex-start;
    background: var(--blue-soft); color: #A8C6FF;
    font-size: .66rem; font-weight: 800; border-radius: 6px; padding: .05rem .4rem;
}

/* ═══ 13. OUTREACH ═══ */
.outreach-grid { display: grid; gap: 1rem; grid-template-columns: 1fr 1fr; }
@media (max-width: 980px) { .outreach-grid { grid-template-columns: 1fr; } }
.outreach-list {
    display: flex; flex-direction: column; gap: .3rem;
    max-height: 430px; overflow-y: auto;
    padding-inline-end: .2rem;
}
.outreach-item {
    display: flex; gap: .55rem; align-items: flex-start;
    background: var(--bg-soft); border: 1px solid var(--line-soft);
    border-radius: 10px; padding: .5rem .7rem; cursor: pointer;
}
.outreach-item:hover { border-color: rgba(212, 175, 55, .35); }
.outreach-item-body { display: flex; flex-direction: column; min-width: 0; }
.outreach-template { font-size: .95rem; line-height: 1.8; }
.outreach-messages { display: flex; flex-direction: column; gap: .6rem; padding: 1rem; }
.outreach-msg {
    background: var(--bg-soft); border: 1px solid var(--line-soft);
    border-radius: 10px; padding: .7rem .9rem;
}
.outreach-msg-head {
    display: flex; justify-content: space-between; gap: .5rem;
    align-items: center; flex-wrap: wrap; margin-bottom: .4rem;
}
.outreach-msg-actions { display: flex; gap: .3rem; flex-wrap: wrap; }
.outreach-msg-body {
    background: var(--card); border: 1px solid var(--line-soft);
    border-radius: 8px; padding: .6rem .8rem; font-size: .88rem;
}
.outreach-msg-status { display: flex; gap: .4rem; align-items: center; margin-top: .5rem; }

/* ═══ 14. MOTEUR (chaîne + bannières) ═══ */
.pipeline-chain { display: flex; align-items: stretch; gap: .4rem; flex-wrap: wrap; padding: .9rem 1rem; }
.pipeline-step {
    flex: 1; min-width: 200px;
    background: var(--bg-soft); border: 1px solid var(--line-soft);
    border-radius: 10px; padding: .6rem .75rem;
    display: flex; flex-direction: column; gap: .15rem;
}
.pipeline-step strong { font-size: .86rem; }
.pipeline-step span { font-size: .74rem; color: var(--muted); }
.step-ok { border-color: rgba(47, 191, 113, .35); }
.step-ko { border-color: rgba(229, 72, 77, .4); }
.step-warn { border-color: rgba(229, 161, 58, .4); }
.pipeline-badge { font-weight: 800; }
.step-ok .pipeline-badge { color: var(--green); }
.step-ko .pipeline-badge { color: #FF9B9E; }
.step-warn .pipeline-badge { color: #F2C186; }
.pipeline-arrow { align-self: center; color: var(--muted); font-size: 1.1rem; }
.euler-banner {
    display: flex; flex-direction: column; gap: .2rem;
    background: var(--warn-soft); border: 1px solid rgba(229, 161, 58, .35);
    border-radius: 10px; padding: .6rem .8rem; margin: .7rem 1rem;
    font-size: .84rem;
}
.euler-banner.euler-ok {
    background: var(--green-soft); border-color: rgba(47, 191, 113, .3);
}
.engine-beat { font-size: .78rem; color: var(--muted); }
.engine-beat-warn { color: #F2C186; }
.ops-status-line {
    display: flex; justify-content: space-between; gap: .6rem;
    align-items: center; flex-wrap: wrap;
    padding: .85rem 1rem;
}

/* ═══ 15. QUALIFICATION (page ③) ═══ */
.funnel-grid {
    display: grid; gap: .6rem;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    margin-bottom: .8rem;
}
.funnel-item {
    background: var(--card); border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: .7rem .8rem;
    display: flex; flex-direction: column; gap: .1rem;
    position: relative;
    overflow: hidden;
}
.funnel-item::before {
    content: ''; position: absolute; inset-inline-start: 0; inset-block: 0;
    width: 3px; background: var(--line);
}
.funnel-item.f-gold::before { background: var(--gold); }
.funnel-item.f-green::before { background: var(--green); }
.funnel-item.f-red::before { background: var(--red); }
.funnel-item.f-blue::before { background: var(--blue); }
.funnel-value { font-size: 1.4rem; font-weight: 800; }
.funnel-label { font-size: .72rem; color: var(--muted); line-height: 1.4; }
.qualified-yes { color: #7FE0AC; font-weight: 800; }
.qualified-no { color: var(--muted); }

/* ═══ 16. TOASTS ═══ */
.toasts { position: fixed; inset-block-start: 1rem; inset-inline-end: 1rem; z-index: 100; display: flex; flex-direction: column; gap: .4rem; }
.toast {
    min-width: 260px; max-width: 380px;
    background: var(--card-2); border: 1px solid var(--line);
    border-radius: 12px; padding: .7rem .9rem;
    box-shadow: var(--shadow); font-size: .86rem; font-weight: 600;
    display: flex; gap: .5rem; align-items: flex-start;
    animation: slidein .25s ease;
}
@keyframes slidein { from { transform: translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }
.toast-success { border-color: rgba(47, 191, 113, .45); }
.toast-success::before { content: '✓'; color: var(--green); font-weight: 800; }
.toast-error { border-color: rgba(229, 72, 77, .45); }
.toast-error::before { content: '✗'; color: #FF9B9E; font-weight: 800; }
.toast-info { border-color: rgba(76, 141, 255, .45); }
.toast-info::before { content: 'ℹ'; color: #A8C6FF; font-weight: 800; }

/* ═══ 17. RESPONSIVE ═══ */
@media (max-width: 980px) {
    .sidebar { transform: translateX(100%); transition: transform .2s ease; }
    [dir="rtl"] .sidebar { transform: translateX(100%); }
    .sidebar.open { transform: none; box-shadow: var(--shadow); }
    .main { margin-inline-start: 0; padding: 4rem 1rem 1rem; }
    .sidebar-toggle { display: block; }
    .hero { flex-direction: column; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   V5.5.0 — COCKPIT KPI · TABLES SANS DÉBORDEMENT · PAGINATION RTL · BIDI
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── 1. KPI tiles (page d'accueil) ── */
.grid-5 { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 980px) { .grid-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat-tile {
    background: var(--card-2, #171C27);
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    padding: .7rem .8rem;
    display: flex; flex-direction: column; gap: .25rem;
    min-width: 0;               /* jamais pousser hors de la grille */
    overflow: hidden;
}
.stat-tile .stat-num { font-size: 1.25rem; font-weight: 800; line-height: 1.15; color: var(--text); font-variant-numeric: tabular-nums; }
.stat-tile.gold { border-color: rgba(212, 175, 55, .45); background: linear-gradient(150deg, rgba(212, 175, 55, .12), var(--card-2)); }
.stat-tile.gold .stat-num { color: var(--gold); }
.stat-tile.small .stat-num { font-size: 1.02rem; }
.stat-tile .stat-label { font-size: .7rem; color: var(--muted); line-height: 1.4; }
.kpi-chart-title { font-size: .8rem; font-weight: 700; margin: .8rem 0 .35rem; color: var(--text); }
.table-compact { font-size: .76rem; }
.table-compact thead th { padding: .35rem .5rem; }
.table-compact tbody td { padding: .3rem .5rem; }
.avatar-dot {
    width: 30px; height: 30px; flex: none;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, #E3C460, #C9A227);
    color: #1A1608; font-weight: 800; font-size: .85rem;
}

/* ── 2. TABLES QUI NE DÉBORDED JAMAIS LA PAGE (exigence client V5.5 :
       « tableaux qui dépassent 100% de la page »). Trois garde-fous :
       a) toute carte contenant un tableau garde min-width:0 en grille ;
       b) .table-wrap scrolle HORIZONTALEMENT au lieu d'étirer la page ;
       c) les cellules cassent les mots longs (URLs, handles, bios). ── */
.main { min-width: 0; }                       /* a */
.card { min-width: 0; }                       /* a */
.grid > * { min-width: 0; }                  /* a */
.table-wrap { overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; } /* b */
.table { width: 100%; max-width: 100%; table-layout: auto; } /* b */
.table thead th { white-space: nowrap; }
.table tbody td {
    overflow-wrap: anywhere;                 /* c — casse URLs/handles très longs */
    word-break: break-word;
}
.table tbody td nowrap-safe, .table .live-title-cell { white-space: nowrap; }

/* ── 3. PAGINATION RTL (exigence : « pagination totalement pétée ») ──
      La vue vendor/pagination/talaqi utilise .pagination-wrap : les
      boutons sont grands, tapables, numérotés avec ellipses, en RTL. */
.pagination-wrap { padding: .8rem .5rem; display: flex; justify-content: center; direction:ltr !important; }
.pagination-wrap nav { display: flex; gap: .3rem; flex-wrap: wrap; justify-content: center; direction: rtl; }
.pagination-wrap .page-link {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 2.1rem; height: 2.1rem; padding: 0 .55rem;
    background: var(--card-2); border: 1px solid var(--line);
    border-radius: 9px; color: var(--text);
    font-size: .84rem; font-weight: 700; font-variant-numeric: tabular-nums;
    transition: border-color .15s, background .15s;
}
.pagination-wrap .page-link:hover { text-decoration: none; border-color: rgba(212, 175, 55, .5); }
.pagination-wrap .page-link[aria-disabled="true"],
.pagination-wrap .disabled .page-link { opacity: .4; pointer-events: none; }
.pagination-wrap .active .page-link { background: var(--gold-soft); border-color: rgba(212, 175, 55, .55); color: var(--gold); }
.pagination-wrap .page-info { display: inline-flex; align-items: center; font-size: .74rem; color: var(--muted); padding: 0 .6rem; }

/* ── 4. BIDI : isoler les fragments latins dans les phrases arabes ──
      (exigence : « combinaison de mots en arabe français et anglais »).
      Les mots latins insérés dans le texte RTL reçoivent une isolation
      explicite : plus de ponctuation/parenthèses qui « sautent » de
      côté, plus d'ordre visuel cassé. */
bdi, [dir="ltr"] { unicode-bidi: isolate; }
.cell-latin { direction: ltr; unicode-bidi: isolate; display: inline-block; }

/* ── 5. LOGIN (guest layout) réutilise les mêmes classes ── */
.login-remember { color: var(--muted); font-size: .82rem; }

/* Talaqi — Pagination RTL, thème nuit/or */
.pagination-wrap {
    direction: rtl;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 20px;
    width: 100%;
}

.pagination-wrap nav {
    width: 100%;
}

.pagination-wrap nav > div:first-child {
    display: none;
}

.pagination-wrap nav > div:last-child,
.pagination-wrap .pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.pagination-wrap .pagination {
    list-style: none;
    margin: 0;
    padding: 0;
}

.pagination-wrap .page-item {
    margin: 0;
    list-style: none;
}

.pagination-wrap .page-link,
.pagination-wrap a,
.pagination-wrap button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    border: 1px solid #232C42;
    border-radius: 10px;
    background: #121826;
    color: #E8ECF4;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: background .2s ease, border-color .2s ease, color .2s ease;
}

.pagination-wrap a:hover,
.pagination-wrap button:hover,
.pagination-wrap .page-link:hover {
    background: #161D2E;
    border-color: #D4AF37;
    color: #D4AF37;
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    border: 1px solid #232C42;

}

.pagination-wrap .active .page-link,
.pagination-wrap [aria-current="page"] {
    background: #D4AF37;
    border-color: #D4AF37;
    color: #0B0F1A;
    font-weight: 700;
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    border: 1px solid #232C42;

}

.pagination-wrap .disabled .page-link,
.pagination-wrap a[aria-disabled="true"],
.pagination-wrap button:disabled {
    opacity: .4;
    cursor: not-allowed;
    pointer-events: none;
    background: #121826;
    border-color: #232C42;
    color: #8A93A8;
}

.pagination-wrap .page-info {
    color: #8A93A8;
    font-size: 12px;
}

.pagination-wrap svg {
    width: 16px;
    height: 16px;
}

@media (max-width: 576px) {
    .pagination-wrap {
        gap: 4px;
    }

    .pagination-wrap .page-link,
    .pagination-wrap a,
    .pagination-wrap button {
        min-width: 34px;
        height: 34px;
        padding: 0 9px;
        font-size: 12px;
        border-radius: 8px;
    }
}