:root {
    /* Charte BET DIMA — bleu royal + or (d'après le logo) */
    --bd-primary: #0E5BC9;          /* bleu royal du logo */
    --bd-primary-700: #084198;
    --bd-primary-900: #052a6b;
    --bd-primary-100: #e3edfb;
    --bd-accent: #F2C518;            /* or/jaune du logo */
    --bd-accent-700: #d4a800;
    --bd-accent-100: #fdf3c7;
    --bd-bg: #F4F7FC;
    --bd-card: #ffffff;
    --bd-text: #0e1a2b;
    --bd-text-muted: #6b7385;
    --bd-border: #e3e7ef;
    --bd-success: #16a34a;
    --bd-danger: #dc2626;
    --bd-radius: 14px;
}

* { box-sizing: border-box; }

html, body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--bd-text);
    background: var(--bd-bg);
    margin: 0;
}

a { color: var(--bd-primary); text-decoration: none; }
a:hover { color: var(--bd-accent); }

/* ===== Brand ===== */
.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--bd-primary) 0%, var(--bd-primary-900) 100%);
    color: var(--bd-accent);
    font-weight: 800;
    font-size: 15px;
    letter-spacing: 1px;
    border: 2px solid var(--bd-accent);
    box-shadow: 0 2px 8px rgba(14, 91, 201, 0.25);
}
.brand-logo-img {
    height: 44px;
    width: auto;
    display: inline-block;
}
.brand-text { display: inline-flex; flex-direction: column; line-height: 1.1; margin-left: 10px; }
.brand-text strong { font-size: 16px; font-weight: 800; color: var(--bd-primary); letter-spacing: 0.4px; }
.brand-text small { font-size: 11px; color: var(--bd-text-muted); }

/* ===== Public navbar ===== */
.bd-navbar {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--bd-border);
    box-shadow: 0 2px 10px rgba(11, 37, 69, 0.04);
}
.bd-navbar .nav-link {
    font-weight: 500;
    color: var(--bd-text);
    padding: 0.5rem 0.85rem !important;
    border-radius: 8px;
}
.bd-navbar .nav-link:hover { background: var(--bd-primary-100); color: var(--bd-primary); }
.bd-navbar .nav-link.active { color: var(--bd-primary); font-weight: 600; }
.btn-accent {
    background: var(--bd-accent);
    border-color: var(--bd-accent);
    color: #fff;
    font-weight: 600;
}
.btn-accent:hover { background: var(--bd-accent-700); border-color: var(--bd-accent-700); color: #fff; }
.btn-outline-primary { color: var(--bd-primary); border-color: var(--bd-primary); }
.btn-outline-primary:hover { background: var(--bd-primary); border-color: var(--bd-primary); }
.btn-primary { background: var(--bd-primary); border-color: var(--bd-primary); }
.btn-primary:hover { background: var(--bd-primary-700); border-color: var(--bd-primary-700); }

/* ===== Hero ===== */
.bd-hero {
    background: linear-gradient(135deg, #084198 0%, #0E5BC9 60%, #2c7af0 100%);
    color: #fff;
    padding: 6rem 0 5rem;
    position: relative;
    overflow: hidden;
}
.bd-hero::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -10%;
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(242, 197, 24, 0.28) 0%, transparent 55%);
    border-radius: 50%;
}
.bd-hero h1 { font-size: clamp(2rem, 4.4vw, 3.4rem); font-weight: 800; line-height: 1.1; }
.bd-hero .badge-pill {
    display: inline-block;
    background: rgba(255,255,255,0.12);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    backdrop-filter: blur(4px);
}
.bd-hero .hero-illustration {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 18px;
    padding: 2rem;
    backdrop-filter: blur(6px);
}
.bd-hero .hero-illustration .stat {
    background: rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 16px;
}
.bd-hero .hero-illustration .stat-value { font-size: 28px; font-weight: 800; color: #fff; }
.bd-hero .hero-illustration .stat-label { font-size: 12px; opacity: 0.75; }

/* ===== Sections ===== */
.section { padding: 5rem 0; }
.section-light { background: #fff; }
.section-title { font-size: 2.1rem; font-weight: 800; margin-bottom: 0.5rem; color: var(--bd-primary); }
.section-subtitle { color: var(--bd-text-muted); max-width: 720px; margin: 0 auto 3rem; }
.eyebrow {
    display: inline-block;
    color: var(--bd-accent);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-size: 12px;
    margin-bottom: 0.75rem;
}

/* Cards */
.feature-card {
    background: #fff;
    border: 1px solid var(--bd-border);
    border-radius: var(--bd-radius);
    padding: 2rem;
    transition: all 0.25s ease;
    height: 100%;
}
.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 40px rgba(11,37,69,0.10);
    border-color: transparent;
}
.feature-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: var(--bd-primary-100);
    color: var(--bd-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    margin-bottom: 1.25rem;
}
.feature-icon.accent { background: rgba(255,122,0,0.12); color: var(--bd-accent); }

.value-card {
    background: linear-gradient(135deg, var(--bd-primary), var(--bd-primary-700));
    color: #fff;
    border-radius: var(--bd-radius);
    padding: 2.5rem;
}

.client-strip {
    background: #fff;
    padding: 2rem 0;
    border-top: 1px solid var(--bd-border);
    border-bottom: 1px solid var(--bd-border);
}
.client-strip .client-logo {
    color: var(--bd-text-muted);
    font-weight: 700;
    letter-spacing: 1px;
    opacity: 0.7;
    transition: opacity 0.2s;
}
.client-strip .client-logo:hover { opacity: 1; color: var(--bd-primary); }

.cta-banner {
    background: linear-gradient(135deg, var(--bd-accent) 0%, #ffd84a 100%);
    color: var(--bd-primary-900);
    border-radius: var(--bd-radius);
    padding: 3rem;
}
.cta-banner h3 { color: var(--bd-primary-900); }

/* FAQ */
.accordion-button:not(.collapsed) {
    background: var(--bd-primary-100);
    color: var(--bd-primary);
    box-shadow: none;
}
.accordion-item {
    border: 1px solid var(--bd-border);
    border-radius: var(--bd-radius) !important;
    margin-bottom: 0.75rem;
    overflow: hidden;
}

/* Footer */
.bd-footer {
    background: #0a1c33;
    color: #adb6c7;
}
.bd-footer h6 { font-weight: 700; margin-bottom: 1rem; }
.bd-footer a { color: #adb6c7; }
.bd-footer a:hover { color: #fff; }
.social-link {
    display: inline-flex;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
    align-items: center;
    justify-content: center;
    color: #fff;
}
.social-link:hover { background: var(--bd-accent); color: #fff; }

/* ===== App shell ===== */
.app-shell {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
    background: var(--bd-bg);
}
.bd-sidebar {
    background: linear-gradient(180deg, #0E5BC9 0%, #052a6b 100%);
    color: #cfdcf2;
    padding: 1.25rem 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}
.sidebar-brand { padding: 0 0.75rem 1.5rem; display: flex; align-items: center; justify-content: center; text-decoration: none; }
.sidebar-brand-img {
    width: 100%;
    max-width: 240px;
    height: auto;
    display: block;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.25);
}
.sidebar-brand .brand-text strong { color: #fff; }
.sidebar-brand .brand-text small { color: rgba(255,255,255,0.5); }
.sidebar-nav { display: flex; flex-direction: column; }
.sidebar-section {
    padding: 1.5rem 1.5rem 0.5rem;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: rgba(255,255,255,0.4);
    font-weight: 600;
}
.sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.7rem 1.5rem;
    color: #c5cee0;
    font-size: 14px;
    border-left: 3px solid transparent;
    transition: all 0.15s;
}
.sidebar-item:hover { background: rgba(255,255,255,0.05); color: #fff; }
.sidebar-item.active {
    background: rgba(242, 197, 24, 0.15);
    color: #fff;
    border-left-color: var(--bd-accent);
    font-weight: 600;
}
.sidebar-item i { font-size: 18px; }

.bd-main { display: flex; flex-direction: column; min-width: 0; }
.bd-topbar {
    background: #fff;
    padding: 0.85rem 1.75rem;
    border-bottom: 1px solid var(--bd-border);
    display: flex;
    align-items: center;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 10;
}
.topbar-title { font-weight: 700; color: var(--bd-primary); font-size: 17px; }
.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--bd-primary) 0%, var(--bd-primary-900) 100%);
    color: var(--bd-accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    border: 2px solid var(--bd-accent);
}
.bd-content { padding: 1.75rem; flex: 1; }

/* ===== Cards & widgets ===== */
.bd-card {
    background: var(--bd-card);
    border-radius: var(--bd-radius);
    border: 1px solid var(--bd-border);
    padding: 1.5rem;
    box-shadow: 0 2px 6px rgba(11,37,69,0.03);
}
.bd-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}
.bd-card-title { font-weight: 700; color: var(--bd-primary); margin: 0; font-size: 16px; }

.stat-tile {
    background: #fff;
    border-radius: var(--bd-radius);
    padding: 1.25rem;
    border: 1px solid var(--bd-border);
    display: flex;
    align-items: center;
    gap: 14px;
}
.stat-tile .stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: var(--bd-primary-100);
    color: var(--bd-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}
.stat-tile .stat-icon.success { background: rgba(22,163,74,0.12); color: var(--bd-success); }
.stat-tile .stat-icon.danger { background: rgba(220,38,38,0.12); color: var(--bd-danger); }
.stat-tile .stat-icon.accent { background: rgba(255,122,0,0.12); color: var(--bd-accent); }
.stat-tile .stat-value { font-size: 24px; font-weight: 800; color: var(--bd-primary); line-height: 1.1; }
.stat-tile .stat-label { font-size: 12px; color: var(--bd-text-muted); }

/* Project tile */
.project-tile {
    background: #fff;
    border-radius: var(--bd-radius);
    border: 1px solid var(--bd-border);
    padding: 1.25rem;
    transition: all 0.2s;
    height: 100%;
}
.project-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(11,37,69,0.08);
}
.project-tile .project-code {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: var(--bd-text-muted);
    background: var(--bd-bg);
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
}
.project-tile h5 { font-size: 16px; font-weight: 700; color: var(--bd-primary); margin: 8px 0 4px; }

.progress-thin { height: 6px; border-radius: 4px; }

/* Kanban */
.kanban-board { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.kanban-col {
    background: #f8fafc;
    border-radius: var(--bd-radius);
    padding: 0.75rem;
    min-height: 400px;
}
.kanban-col-header {
    font-weight: 700;
    color: var(--bd-primary);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.kanban-card {
    background: #fff;
    border-radius: 10px;
    padding: 0.85rem;
    border: 1px solid var(--bd-border);
    margin-bottom: 0.5rem;
    cursor: grab;
    transition: all 0.15s;
}
.kanban-card:hover { box-shadow: 0 4px 12px rgba(11,37,69,0.08); }
.kanban-card-title { font-weight: 600; font-size: 14px; color: var(--bd-text); margin-bottom: 6px; }

/* Documents grid */
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.doc-tile {
    background: #fff;
    border-radius: var(--bd-radius);
    border: 1px solid var(--bd-border);
    padding: 1rem;
    text-align: center;
    transition: all 0.2s;
    position: relative;
}
.doc-tile:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(11,37,69,0.08); }
.doc-tile .doc-icon { font-size: 42px; color: var(--bd-primary); margin-bottom: 0.5rem; }
.doc-tile .doc-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--bd-text);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.doc-tile .doc-meta { font-size: 11px; color: var(--bd-text-muted); }
.doc-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    opacity: 0;
    transition: opacity 0.15s;
}
.doc-tile:hover .doc-actions { opacity: 1; }

/* Auth pages */
.auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #084198 0%, #0E5BC9 60%, #2c7af0 100%);
    padding: 2rem 1rem;
    position: relative;
    overflow: hidden;
}
.auth-shell::before {
    content: '';
    position: absolute;
    top: -30%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(242, 197, 24, 0.25) 0%, transparent 60%);
    border-radius: 50%;
}
.auth-shell .auth-card { position: relative; z-index: 1; }
.auth-card {
    background: #fff;
    border-radius: 18px;
    padding: 2.5rem;
    max-width: 460px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}

/* Activity feed */
.activity-item {
    display: flex;
    gap: 12px;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--bd-border);
}
.activity-item:last-child { border-bottom: 0; }
.activity-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bd-primary);
    color: var(--bd-accent);
    font-size: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
    border: 1px solid var(--bd-accent);
}
.activity-text { font-size: 13px; }
.activity-time { font-size: 11px; color: var(--bd-text-muted); }

/* Tables */
.table { background: #fff; }
.table thead th {
    border-bottom: 2px solid var(--bd-border);
    color: var(--bd-text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* Forms */
.form-control, .form-select {
    border-color: var(--bd-border);
    border-radius: 8px;
    padding: 0.55rem 0.85rem;
}
.form-control:focus, .form-select:focus {
    border-color: var(--bd-primary);
    box-shadow: 0 0 0 0.2rem rgba(11,37,69,0.1);
}
.form-label { font-weight: 600; color: var(--bd-text); font-size: 13px; }

/* Badges */
.bd-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    background: var(--bd-primary-100);
    color: var(--bd-primary);
}

/* Responsive sidebar */
@media (max-width: 991.98px) {
    .app-shell { grid-template-columns: 1fr; }
    .bd-sidebar {
        position: fixed;
        top: 0; left: -280px;
        width: 260px;
        z-index: 1000;
        transition: left 0.25s;
    }
    .bd-sidebar.open { left: 0; }
}
