/* Design tokens — bleu/rouge extraits du logo B-SOFT SENSY (public/images/SENSY.png) */
:root {
    --bm-bg: #f5f7fb;
    --bm-surface: #ffffff;
    --bm-surface-soft: #f8fafc;
    --bm-text: #16213a;
    --bm-muted: #6b7280;
    --bm-line: #e7ebf2;
    --bm-primary: #197dc1;
    --bm-primary-light: #15a4df;
    --bm-primary-dark: #136197;
    --bm-primary-soft: #e8f4fc;
    --bm-accent: #d90442;
    --bm-accent-light: #e7214d;
    --bm-accent-dark: #b7350a;
    --bm-sidebar: #111b32;
    --bm-sidebar-hover: rgba(255, 255, 255, .09);
    --bm-shadow: 0 10px 30px rgba(17, 24, 39, .07);
}

* { box-sizing: border-box; }

body {
    background: var(--bm-bg);
    color: var(--bm-text);
    font-family: "Open Sans", system-ui, -apple-system, sans-serif;
}

a { color: var(--bm-primary); }
a:hover { color: var(--bm-primary-dark); }

/* Coquille applicative : sidebar + topbar + contenu */
.bm-shell { display: flex; min-height: 100vh; }

.bm-sidebar {
    width: 250px;
    flex: 0 0 250px;
    background: var(--bm-sidebar);
    color: #fff;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}

.bm-brand {
    padding: 22px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
}
.bm-brand-logo { height: 38px; width: auto; display: block; }
.bm-brand-logo--lg { height: 52px; }
.bm-brand small { display: block; margin-top: 10px; color: rgba(255, 255, 255, .55); font-size: .68rem; letter-spacing: .04em; text-transform: uppercase; }

.bm-nav { list-style: none; margin: 14px 0; padding: 0 12px; flex: 1; }
.bm-nav li + li { margin-top: 2px; }
.bm-nav a {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border-radius: 10px;
    color: rgba(255, 255, 255, .72); text-decoration: none; font-size: .88rem;
    transition: background .15s ease, color .15s ease;
}
.bm-nav a i { font-size: 1.15rem; }
.bm-nav a:hover { background: var(--bm-sidebar-hover); color: #fff; }
.bm-nav a.active { background: var(--bm-primary); color: #fff; }

.bm-topbar {
    height: 68px;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 26px;
    background: var(--bm-surface);
    border-bottom: 1px solid var(--bm-line);
    position: sticky; top: 0; z-index: 5;
}
.bm-topbar h1 { font-size: 1.15rem; font-weight: 700; margin: 0; }

.bm-user-menu { display: flex; align-items: center; gap: 12px; }
.bm-user-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--bm-primary-soft); color: var(--bm-primary);
    display: grid; place-items: center; font-weight: 700; font-size: .85rem;
}
.bm-user-name { font-size: .84rem; font-weight: 600; }

.bm-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.bm-content { padding: 26px; flex: 1; }

.bm-page-header {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 12px;
    margin-bottom: 22px;
}
.bm-page-header h1 { font-size: 1.4rem; font-weight: 700; margin: 0; }
.bm-page-header .text-muted { font-size: .85rem; }

.bm-form-card { max-width: 640px; }

/* Cartes, tableaux, badges */
.card {
    background: var(--bm-surface);
    border: 1px solid var(--bm-line);
    border-radius: 14px;
    box-shadow: var(--bm-shadow);
}
.card-header {
    background: transparent;
    border-bottom: 1px solid var(--bm-line);
    font-weight: 700;
    font-size: .88rem;
    padding: 14px 18px;
}
.card-body { padding: 20px; }

.table { color: var(--bm-text); margin-bottom: 0; }
.table thead th {
    border-bottom: 1px solid var(--bm-line);
    color: var(--bm-muted);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    padding: 12px 16px;
}
.table td { padding: 12px 16px; border-color: var(--bm-line); vertical-align: middle; }
.table-responsive { border-radius: 14px; overflow: hidden; }

.badge { font-weight: 600; font-size: .72rem; padding: .4em .7em; border-radius: 8px; }

.bm-stat-card {
    background: var(--bm-surface);
    border: 1px solid var(--bm-line);
    border-left: 4px solid var(--bm-accent, var(--bm-primary));
    border-radius: 14px;
    box-shadow: var(--bm-shadow);
    padding: 18px 20px;
}
.bm-stat-card .bm-stat-label { color: var(--bm-muted); font-size: .78rem; margin-bottom: 6px; }
.bm-stat-card .bm-stat-value { font-size: 1.9rem; font-weight: 800; line-height: 1; }
.bm-stat-card--success { --bm-accent: #16a34a; }
.bm-stat-card--warning { --bm-accent: #d97706; }
.bm-stat-card--danger { --bm-accent: #dc2626; }
.bm-stat-card--secondary { --bm-accent: #6b7280; }

/* Formulaires et boutons */
.form-label { font-weight: 600; font-size: .84rem; color: var(--bm-text); }
.form-control, .form-select {
    border: 1px solid var(--bm-line);
    border-radius: 10px;
    padding: .55rem .8rem;
    font-size: .9rem;
}
.form-control:focus, .form-select:focus {
    border-color: var(--bm-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--bm-primary) 16%, transparent);
}
.form-text { font-size: .78rem; }

.btn { border-radius: 10px; font-size: .88rem; font-weight: 600; padding: .55rem 1.1rem; }
.btn-primary {
    background: linear-gradient(135deg, var(--bm-primary-light), var(--bm-primary));
    border: none;
    box-shadow: 0 8px 18px color-mix(in srgb, var(--bm-primary) 25%, transparent);
}
.btn-primary:hover { background: linear-gradient(135deg, var(--bm-primary), var(--bm-primary-dark)); }
.btn-outline-secondary { border-color: var(--bm-line); color: var(--bm-text); }
.btn-outline-secondary:hover { background: var(--bm-surface-soft); border-color: var(--bm-line); color: var(--bm-text); }
.btn-sm { padding: .35rem .75rem; font-size: .8rem; }

.alert { border-radius: 12px; border: none; font-size: .88rem; }
.alert-success { background: #ecfdf3; color: #067647; }
.alert-danger { background: #fff1f2; color: #be123c; }

code { color: var(--bm-primary-dark); background: var(--bm-primary-soft); padding: .1em .4em; border-radius: 5px; font-size: .82em; }

.pagination .page-link { border-color: var(--bm-line); color: var(--bm-text); }
.pagination .page-item.active .page-link { background: var(--bm-primary); border-color: var(--bm-primary); }

/* Page de connexion */
.bm-auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px;
    background: radial-gradient(circle at 8% 12%, color-mix(in srgb, var(--bm-primary) 12%, transparent), transparent 28%),
                radial-gradient(circle at 92% 88%, color-mix(in srgb, var(--bm-accent) 10%, transparent), transparent 26%),
                linear-gradient(135deg, #f8fafc, #eef3fb);
}
.bm-auth-card {
    width: min(420px, 100%);
    background: var(--bm-surface);
    border: 1px solid var(--bm-line);
    border-radius: 20px;
    box-shadow: 0 28px 70px rgba(37, 56, 88, .16);
    padding: 40px 36px;
}
.bm-auth-card .bm-brand { border: none; padding: 0 0 28px; }
.bm-auth-card .bm-brand small { color: var(--bm-muted); }
.bm-auth-card h1 { font-size: 1.4rem; font-weight: 700; margin-bottom: 6px; }
.bm-auth-card .text-muted { font-size: .86rem; margin-bottom: 24px; }

@media (max-width: 860px) {
    .bm-sidebar { position: fixed; left: -260px; z-index: 20; transition: left .2s ease; }
    .bm-sidebar.is-open { left: 0; }
    .bm-content { padding: 18px; }
}
