:root {
    --sidebar-color: #0c0e14;
    --accent: #21caad;
    --bg-light: #f8fafc;
    --sidebar-item-hover: rgba(255, 255, 255, 0.06);
}

body {
    background-color: var(--bg-light);
    min-height: 100vh;
    margin: 0;
    font-family: 'Outfit', sans-serif;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    color: white !important;
    background-color: #21caad !important;
    border-color: #21caad !important;
}

/* ─────────────────────────────────────────────────────────────────
   SIDEBAR
───────────────────────────────────────────────────────────────── */
.sidebar {
    width: 240px;
    background-color: var(--sidebar-color) !important;
    color: white;
    padding: 1.25rem 1rem;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 1060;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    overflow-x: hidden;
}

.main-content {
    margin-left: 240px;
    padding: 2rem;
    min-height: 100vh;
}

/* ── Header mobile ── */
.mobile-header {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 70px;
    background: var(--sidebar-color);
    color: white;
    align-items: center;
    padding: 0 1rem;
    z-index: 1050;
    gap: 12px;
}
.mobile-project-info { flex-grow: 1; overflow: hidden; line-height: 1.2; }

/* ── Project box ── */
.project-box {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 1.25rem;
}
.project-dropdown-btn {
    background: none;
    border: none;
    color: white;
    width: 100%;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0;
}
.project-name-display { font-size: 0.9rem; font-weight: 700; color: #ffffff; display: block; }
.project-url-display  { font-size: 0.72rem; color: #94a3b8; display: block; }

.btn-settings { color: #94a3b8; transition: 0.3s; padding: 5px; border-radius: 6px; }
.btn-settings:hover { color: white; background: rgba(255,255,255,0.1); }

/* ── Section labels ── */
.nav-section-label {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: #475569;
    padding: 0 0.75rem;
    margin-bottom: 4px;
    margin-top: 1.25rem;
}

/* ── Nav links ── */
.nav-link {
    color: #94a3b8 !important;
    padding: 0.55rem 0.75rem;
    border-radius: 8px;
    margin-bottom: 2px;
    transition: 0.2s;
    text-decoration: none;
    display: flex;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 500;
}
.nav-link i {
    width: 18px;
    text-align: center;
    margin-right: 10px;
    font-size: 0.8rem;
    opacity: 0.7;
    flex-shrink: 0;
}
.nav-link:hover {
    background: var(--sidebar-item-hover) !important;
    color: white !important;
}
.nav-link:hover i { opacity: 1; }
.nav-link.active {
    background-color: rgba(33, 202, 173, 0.15) !important;
    color: #21caad !important;
}
.nav-link.active i { opacity: 1; color: #21caad; }

/* tabs — ne pas surcharger les nav-link de la sidebar */
.custom-tabs-minimal .nav-link {
    border: none !important;
    border-bottom: 2px solid transparent !important;
    border-radius: 0 !important;
    padding: 0 0 0.5rem !important;
    margin-bottom: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
}
.custom-tabs-minimal .nav-link:hover {
    background: transparent !important;
    color: #21caad !important;
}
.custom-tabs-minimal .nav-link.active {
    color: #14b8a6 !important;
    border-bottom: 2px solid #14b8a6 !important;
    background: transparent !important;
}

/* ── Admin nav links ── */
.nav-link-admin {
    border: 1px solid rgba(239, 68, 68, 0.2);
    margin-top: 4px;
}
.nav-link-admin:hover { border-color: rgba(239, 68, 68, 0.5); }

/* ── User section ── */
.user-section { margin-top: auto; padding-top: 1rem; border-top: 1px solid #1e293b; }
.user-badge {
    background: #1e293b;
    padding: 10px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.credits-pill {
    background: rgba(59, 130, 246, 0.2);
    color: var(--accent);
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.8rem;
}

/* ── Overlay mobile ── */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(2px);
    z-index: 1055;
}
.sidebar-overlay.show { display: block; }

/* ─────────────────────────────────────────────────────────────────
   COMPOSANTS GÉNÉRAUX
───────────────────────────────────────────────────────────────── */
.rounded-4 { border-radius: 1rem !important; }
.x-small   { font-size: 0.7rem; }
.italic    { font-style: italic; }
.text-teal { color: #14b8a6 !important; }
.bg-teal   { background-color: #14b8a6 !important; }
.border-teal { border-color: #14b8a6 !important; }
.bg-light-subtle { background-color: #f8fafc !important; }

/* ── Surcharge Bootstrap couleur primaire ── */
.text-primary    { color: #21caad !important; }
.border-primary  { border-color: #21caad !important; }
.bg-primary      { background-color: #21caad !important; }
.btn-primary     { background-color: #21caad !important; border-color: #21caad !important; }
.btn-outline-primary { color: #21caad !important; border-color: #21caad !important; }
.btn-start       { background-color: #21caad; color: white; border-radius: 50px; border: none; }

/* ── Boutons filtre ── */
.btn-filter {
    background-color: #f1f5f9;
    color: #64748b;
    border: none;
    border-radius: 20px;
    padding: 6px 16px;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.2s;
    cursor: pointer;
}
.btn-filter:hover  { background-color: #e2e8f0; }
.btn-filter.active { background-color: #21caad; color: white; }

/* ── Admin ── */
.admin-card {
    background: white;
    border-radius: 16px;
    border: none;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}
.table-thead {
    background-color: #f1f5f9;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}
.user-avatar {
    width: 40px; height: 40px;
    background: #21caad;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-weight: bold;
}
.badge-plan { font-weight: 800; font-size: 0.7rem; padding: 5px 10px; border-radius: 6px; }
.badge-free    { background: #f1f5f9; color: #64748b; }
.badge-premium { background: #fef9c3; color: #a16207; border: 1px solid #fde047; }

/* ── Tables ── */
.custom-table thead th { font-weight: 700; border: none !important; }
.hover-row { transition: background-color 0.15s; }
.hover-row:hover { background-color: #f9fafb !important; }

/* ── LLM headers ── */
.llm-header {
    width: 18px; height: 18px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 4px;
    color: white;
    font-size: 0.6rem; font-weight: 900;
    margin-right: 4px;
}
.llm-header.gpt        { background-color: #10a37f; }
.llm-header.gemini     { background-color: #4285f4; }
.llm-header.perplexity { background-color: #581c87; }
.llm-header.grok       { background-color: #000000; }

/* ── Status icons ── */
.status-icon {
    width: 24px; height: 24px;
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    margin: 0 auto;
    font-size: 0.75rem; font-weight: bold;
}
.status-dot-mini {
    width: 18px; height: 18px;
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 0.55rem;
}

/* ── Prompts ── */
.method-card { transition: all 0.3s ease; border: 2px solid #eee !important; }
.method-card:hover { border-color: var(--accent) !important; background: #f8faff; }
.method-card input:checked + .card-body { color: #21caad; }
.method-card input:checked { background-color: #21caad; border-color: #21caad; }
.prompt-row { transition: all 0.2s; border-left: 4px solid #dee2e6 !important; }
.prompt-row.selected { border-left-color: #21caad !important; background: #f8faff; }
.prompt-row:hover { background: #f8f9fa; }
.limit-reached { opacity: 0.6; pointer-events: none; }
.badge-type {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 6px;
    border-radius: 4px;
}

/* ── Nav pills ── */
.nav-pills .nav-link { border-radius: 8px; font-weight: bold; color: #6c757d; }
.nav-pills .nav-link.active {
    background-color: #fff !important;
    color: #0d6efd !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* ── Radar hallucination ── */
.radar-container { width: 120px; height: 120px; position: relative; }
.radar-grid {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    border-radius: 50%;
    border: 1px solid #fee2e2;
    background: repeating-radial-gradient(circle, transparent, transparent 15px, #fee2e2 16px);
}
.radar-shape {
    position: absolute; top: 20%; left: 20%; right: 10%; bottom: 10%;
    background: rgba(220, 38, 38, 0.2);
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
    border: 2px solid #dc2626;
}
.radar-center {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 24px; height: 24px;
    background: #dc2626;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 10px;
    box-shadow: 0 0 10px rgba(220, 38, 38, 0.5);
}

/* ── Scrollbar ── */
pre::-webkit-scrollbar { width: 6px; height: 6px; }
pre::-webkit-scrollbar-thumb { background: #444; border-radius: 10px; }

/* ─────────────────────────────────────────────────────────────────
   PAGES LÉGALES
───────────────────────────────────────────────────────────────── */
.legal-page { background: var(--bg-light); min-height: 100vh; padding: 2rem 1rem 4rem; }
.legal-container {
    max-width: 820px;
    margin: 0 auto;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    padding: 2.5rem 3rem;
}
.legal-back {
    display: inline-flex; align-items: center;
    font-size: 0.82rem; color: #64748b;
    text-decoration: none;
    margin-bottom: 1.5rem;
    transition: color 0.15s;
}
.legal-back:hover { color: #21caad; }
.legal-title   { font-size: 1.75rem; font-weight: 700; color: #0f172a; margin: 0 0 0.25rem; }
.legal-updated { font-size: 0.78rem; color: #94a3b8; margin-bottom: 2rem; }
.legal-section { margin-bottom: 2rem; padding-bottom: 2rem; border-bottom: 1px solid #f1f5f9; }
.legal-section:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.legal-section h2 {
    font-size: 1rem; font-weight: 700; color: #1e293b;
    margin: 0 0 0.75rem;
    padding-left: 0.75rem;
    border-left: 3px solid #21caad;
}
.legal-section h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
}
.legal-section p,
.legal-section address,
.legal-section ul { font-size: 0.88rem; color: #475569; line-height: 1.75; margin-bottom: 0.6rem; font-style: normal; }
.legal-section ul { padding-left: 1.25rem; }
.legal-container > p {
    margin-top: 0.5rem;
    margin-bottom: 1.5rem;
}
.legal-section a { color: #21caad; text-decoration: none; }
.legal-section a:hover { text-decoration: underline; }

/* ─────────────────────────────────────────────────────────────────
   FOOTER
───────────────────────────────────────────────────────────────── */
.cockpyt-footer,
.login-footer {
    width: 100%;
    border-top: 1px solid #e2e8f0;
    padding: 1rem 2rem;
    text-align: center;
    background: #fff;
    margin-top: auto;
}
.footer-links,
.login-footer-links {
    display: flex; align-items: center; justify-content: center;
    flex-wrap: wrap; gap: 0.4rem;
}
.footer-brand { font-size: 0.75rem; color: #94a3b8; font-weight: 600; }
.footer-links a,
.login-footer-links a { font-size: 0.75rem; color: #64748b; text-decoration: none; transition: color 0.15s; }
.footer-links a:hover,
.login-footer-links a:hover { color: #21caad; }
.footer-sep,
.login-footer-sep { color: #cbd5e1; font-size: 0.75rem; user-select: none; }

/* ─────────────────────────────────────────────────────────────────
   LAYOUTS PUBLICS (login, register, wizard sans sidebar)
───────────────────────────────────────────────────────────────── */
.register-card {
    width: 100%;
    max-width: 700px;
    border: none;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
}
.page-public .sidebar { display: none !important; }
.page-public .main-content {
    margin-left: 0 !important;
    width: 100% !important;
    min-height: 100vh !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    background-color: var(--bg-light) !important;
}
.main-content--public {
    margin-left: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    min-height: calc(100vh - 56px) !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    background-color: #f8fafc !important;
    overflow-x: hidden !important;
}

/* ── Tooltips ── */
.cockpyt-tooltip { position: relative; display: inline-flex; align-items: center; cursor: pointer; }
.cockpyt-tooltip-popup {
    position: fixed;
    background: #1e293b;
    color: white;
    font-size: 0.72rem;
    line-height: 1.5;
    padding: 8px 12px;
    border-radius: 8px;
    width: 220px;
    white-space: normal;
    z-index: 99999;
    pointer-events: none;
    font-weight: 400;
    text-transform: none;
    letter-spacing: normal;
    display: none;
}

:root {
    --cc-btn-primary-bg: #21caad !important;
    --cc-btn-primary-hover-bg: #1ab89d !important;
    --cc-btn-primary-color: #083830 !important;
    --cc-toggle-on-bg: #21caad !important;
    --cc-toggle-on-knob-bg: #fff !important;
}

#s-all-bn, #s-rall-bn {
    display: none !important;
}

/* ─────────────────────────────────────────────────────────────────
   MOBILE
───────────────────────────────────────────────────────────────── */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
        padding-top: 1rem;
        width: 260px;
        max-width: 80vw; /* ← ajout */
    }
    .sidebar.show { transform: translateX(0); }

    .main-content {
        margin-left: 0;
        padding: 1rem;
        padding-top: 5rem;
    }

    .mobile-header { display: flex !important; }
    .desktop-table { display: none; }

    .mobile-user-card {
        background: white;
        border-radius: 12px;
        padding: 15px;
        margin-bottom: 10px;
        border: 1px solid #e2e8f0;
    }
}

@media (min-width: 992px) { .mobile-cards { display: none; } }

@media (max-width: 640px) {
    .legal-container { padding: 1.5rem; }
}
