:root {
    --sidebar-width: 250px;
    --topbar-height: 56px;
    --brand: #1f4e79;
}
body { background: #f4f6f9; }
.topbar { background: var(--brand); height: var(--topbar-height); z-index: 1040; }
.sidebar {
    background: #fff;
    border-right: 1px solid #e3e6ea;
}
@media (min-width: 992px) {
    .sidebar {
        position: fixed; top: var(--topbar-height); bottom: 0; left: 0;
        width: var(--sidebar-width); overflow-y: auto;
    }
    .main-content { margin-left: var(--sidebar-width); }
}
.main-content { padding: calc(var(--topbar-height) + 1.25rem) 1.5rem 2rem; }
.sidebar .nav-link { color: #3c4858; border-radius: .4rem; padding: .45rem .75rem; font-size: .93rem; }
.sidebar .nav-link:hover { background: #eef3f8; }
.sidebar .nav-link.active { background: var(--brand); color: #fff; }
.nav-section {
    font-size: .72rem; text-transform: uppercase; letter-spacing: .06em;
    color: #8a96a3; margin: 1rem .75rem .3rem; font-weight: 600;
}
.card { border: none; box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04); }
.card-header { background: #fff; font-weight: 600; }
.stat-card .stat-icon {
    width: 48px; height: 48px; border-radius: .6rem;
    display: flex; align-items: center; justify-content: center; font-size: 1.4rem;
}
.stat-card .stat-value { font-size: 1.6rem; font-weight: 700; line-height: 1; }
.page-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1.25rem; }
.page-header h1 { font-size: 1.5rem; margin: 0; }
.table > :not(caption) > * > * { vertical-align: middle; }
.timeline { list-style: none; padding-left: 1.25rem; border-left: 2px solid #dee2e6; }
.timeline li { position: relative; margin-bottom: 1rem; }
.timeline li::before {
    content: ""; position: absolute; left: -1.62rem; top: .3rem;
    width: .75rem; height: .75rem; border-radius: 50%; background: var(--brand);
}
.solde-progress { height: 8px; }
.login-wrapper { min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #1f4e79 0%, #2e75b6 100%); }
.login-card { width: 100%; max-width: 420px; }
.notif-unread { background: #eef5ff; }
.widget-matrix th, .widget-matrix td { text-align: center; }
.widget-matrix td:first-child, .widget-matrix th:first-child { text-align: left; }
#calendar { background: #fff; padding: 1rem; border-radius: .5rem; }
@media print {
    .sidebar, .topbar, .no-print { display: none !important; }
    .main-content { margin: 0; padding: 0; }
}
.fc a { text-decoration: none; color: inherit; }
.fc .fc-event { cursor: default; }

/* =====================================================================
   Identité visuelle (couleur --brand définie par l'entreprise)
   ===================================================================== */
:root {
    --brand-dark: color-mix(in srgb, var(--brand) 72%, #000);
    --brand-light: color-mix(in srgb, var(--brand) 12%, #fff);
    --ink: #1d2433;
    --ink-2: #5b6474;
}
.topbar { background: linear-gradient(90deg, var(--brand-dark), var(--brand)); box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.brand-logo { width: 34px; height: 34px; border-radius: 9px; background: #fff; display: inline-flex; align-items: center; justify-content: center; overflow: hidden; padding: 3px; }
.brand-logo img { max-width: 100%; max-height: 100%; }
.btn-brand { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; border-radius: .6rem; }
.btn-brand:hover, .btn-brand:focus { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.logo-apercu { background: repeating-conic-gradient(#f1f3f5 0 25%, #fff 0 50%) 0 0 / 16px 16px; border-radius: .5rem; padding: 1rem; }

/* =====================================================================
   Page de connexion
   ===================================================================== */
.login-body { background: #f4f6f9; min-height: 100vh; }
.apercu-bandeau { background: #fff3cd; color: #664d03; text-align: center; padding: .4rem; font-size: .9rem; }
.login-split { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; }
.login-brand {
    position: relative; overflow: hidden; color: #fff;
    background: radial-gradient(circle at 15% 15%, color-mix(in srgb, var(--brand) 70%, #fff) 0, transparent 45%),
                linear-gradient(145deg, var(--brand) 0%, var(--brand-dark) 100%);
    display: flex; align-items: center; justify-content: center; padding: 3rem;
}
.login-deco { position: absolute; inset: 0; width: 100%; height: 100%; }
.login-brand-inner { position: relative; max-width: 460px; width: 100%; }
.login-logo { width: 96px; height: 96px; border-radius: 24px; background: #fff; padding: 10px; display: flex; align-items: center; justify-content: center;
    box-shadow: 0 12px 30px rgba(0,0,0,.18); margin-bottom: 1.5rem; }
.login-logo img { max-width: 100%; max-height: 100%; }
.login-company { font-size: 2.2rem; font-weight: 800; letter-spacing: -.02em; margin-bottom: .35rem; }
.login-slogan { font-size: 1.1rem; opacity: .85; margin-bottom: 2rem; }
.login-features { list-style: none; padding: 0; margin: 0 0 2.25rem; }
.login-features li { display: flex; gap: .85rem; align-items: flex-start; margin-bottom: .9rem; }
.login-features i { flex: 0 0 38px; height: 38px; border-radius: 10px; background: rgba(255,255,255,.14); display: flex; align-items: center; justify-content: center; font-size: 1.1rem; }
.login-features span { padding-top: .45rem; opacity: .95; }
.login-contact { border-top: 1px solid rgba(255,255,255,.2); padding-top: 1.25rem; font-size: .92rem; }
.login-contact div { display: flex; gap: .65rem; margin-bottom: .45rem; opacity: .9; }
.login-contact a { color: #fff; }
.login-form-side { display: flex; align-items: center; justify-content: center; padding: 2rem 1.25rem; background: #fff; }
.login-form-box { width: 100%; max-width: 400px; }
.login-title { font-weight: 800; color: var(--ink); font-size: 1.9rem; }
.login-field .form-control { border-radius: .7rem; border-color: #dfe3ea; }
.login-field .form-control:focus { border-color: var(--brand); box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--brand) 18%, transparent); }
.login-eye { position: absolute; right: .5rem; top: 50%; transform: translateY(-50%); color: var(--ink-2); z-index: 5; }
.login-footer { margin-top: 2.5rem; text-align: center; color: #9aa3b2; font-size: .8rem; }
/* Page de connexion des entreprises : arrière-plan plein écran + carte centrée */
.login-full {
    position: relative; overflow: hidden; min-height: 100vh; display: flex; align-items: center; justify-content: center;
    padding: 2.5rem 1rem; color: #fff; background-color: var(--brand-dark);
    background-image: radial-gradient(circle at 20% 10%, color-mix(in srgb, var(--brand) 55%, #fff) 0, transparent 40%),
                      radial-gradient(circle at 85% 90%, color-mix(in srgb, var(--brand) 60%, #000) 0, transparent 45%),
                      linear-gradient(150deg, var(--brand) 0%, var(--brand-dark) 100%);
    background-size: cover; background-position: center; background-attachment: fixed;
}
.login-blob { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .35; pointer-events: none; animation: login-flotte 18s ease-in-out infinite alternate; }
.login-blob.b1 { width: 420px; height: 420px; background: color-mix(in srgb, var(--brand) 40%, #fff); top: -120px; left: -100px; }
.login-blob.b2 { width: 360px; height: 360px; background: color-mix(in srgb, var(--brand) 50%, #7b5cff); bottom: -120px; right: -80px; animation-delay: -6s; }
.login-blob.b3 { width: 220px; height: 220px; background: #fff; top: 55%; left: 8%; opacity: .12; animation-delay: -12s; }
@keyframes login-flotte { to { transform: translate(40px, -30px) scale(1.12); } }
@media (prefers-reduced-motion: reduce) { .login-blob { animation: none; } }
.login-centre { position: relative; z-index: 1; width: 100%; max-width: 440px; display: flex; flex-direction: column; align-items: center; }
.login-entete { text-align: center; margin-bottom: 1.5rem; text-shadow: 0 2px 12px rgba(0,0,0,.25); }
.login-entete .login-logo { margin: 0 auto 1rem; width: 84px; height: 84px; border-radius: 22px; }
.login-entete .login-company { font-size: 2rem; margin-bottom: .2rem; }
.login-entete .login-slogan { margin-bottom: 0; font-size: 1.05rem; }
.login-carte {
    width: 100%; background: rgba(255,255,255,.94); color: var(--ink); border-radius: 1.25rem; padding: 2.25rem 2rem 2rem;
    box-shadow: 0 25px 60px rgba(0,0,0,.28), 0 0 0 1px rgba(255,255,255,.5) inset;
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); animation: login-entree .5s ease-out both;
}
@keyframes login-entree { from { opacity: 0; transform: translateY(14px); } }
.login-carte .login-title { font-size: 1.6rem; }
.login-full .login-features { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; margin: 1.5rem 0 0; }
.login-full .login-features li { display: inline-flex; align-items: center; gap: .4rem; margin: 0; padding: .35rem .8rem; font-size: .82rem;
    border-radius: 2rem; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.22); backdrop-filter: blur(6px); }
.login-full .login-features i { flex: none; width: auto; height: auto; background: none; font-size: .95rem; }
.login-full .login-footer { margin-top: 1.5rem; color: rgba(255,255,255,.75); text-shadow: 0 1px 6px rgba(0,0,0,.3); }
.login-full .login-contact { border: 0; padding: 0; margin-bottom: .4rem; display: flex; flex-wrap: wrap; justify-content: center; gap: .35rem 1.1rem; font-size: .82rem; }
.login-full .login-contact span { display: inline-flex; gap: .35rem; }
.login-full .login-contact a { color: #fff; }
@media (max-width: 575.98px) {
    .login-carte { padding: 1.75rem 1.25rem 1.5rem; }
    .login-entete .login-company { font-size: 1.6rem; }
}
/* Image d'en-tête (Administration → Entreprise et langue) */
.topbar.avec-image { background-size: cover; background-position: center; }

@media (max-width: 991.98px) {
    .login-split { grid-template-columns: 1fr; }
    .login-brand { padding: 2rem 1.25rem; }
    .login-split .login-features, .login-split .login-logo { display: none; }
    .login-split .login-company { font-size: 1.6rem; }
    .login-split .login-slogan { margin-bottom: 1rem; }
}

/* =====================================================================
   Tableau de bord
   ===================================================================== */
body { color: var(--ink); }
.main-content { background: #f4f6fa; min-height: 100vh; }
.hero {
    position: relative; overflow: hidden; color: #fff; border-radius: 1.1rem; padding: 1.75rem 2rem; margin-bottom: 1.5rem;
    background: radial-gradient(circle at 85% 10%, color-mix(in srgb, var(--brand) 55%, #fff) 0, transparent 40%),
                linear-gradient(120deg, var(--brand-dark), var(--brand));
    display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: center; justify-content: space-between;
    box-shadow: 0 10px 30px color-mix(in srgb, var(--brand) 25%, transparent);
}
.hero-deco { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hero-main, .hero-side { position: relative; }
.hero-date { font-size: .85rem; opacity: .85; margin-bottom: .25rem; }
.hero-title { font-size: 1.85rem; font-weight: 800; letter-spacing: -.02em; margin-bottom: .75rem; }
.hero-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1.1rem; }
.hero-chip { background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.2); border-radius: 2rem; padding: .2rem .7rem; font-size: .82rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.hero-actions .btn { border-radius: .65rem; }
.btn-hero-ghost { color: #fff; border: 1px solid rgba(255,255,255,.45); background: rgba(255,255,255,.08); }
.btn-hero-ghost:hover { background: rgba(255,255,255,.2); color: #fff; }
.hero-solde { display: flex; align-items: center; gap: 1rem; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2);
    border-radius: 1rem; padding: .9rem 1.2rem; backdrop-filter: blur(4px); }
.hero-solde .ring { width: 92px; height: 92px; }
.hero-solde .ring circle:first-child { stroke: rgba(255,255,255,.22); }
.hero-solde .ring-value, .hero-solde .ring-sub { fill: #fff; }
.hero-solde-label { font-weight: 700; font-size: 1.05rem; }
.hero-solde-detail { font-size: .85rem; opacity: .85; }
.hero-logo { width: 96px; height: 96px; background: #fff; border-radius: 22px; padding: 10px; display: flex; align-items: center; justify-content: center; }
.hero-logo img { max-width: 100%; max-height: 100%; }

/* Cartes widgets */
.card.widget { border: 1px solid #e8ebf1; border-radius: 1rem; box-shadow: 0 1px 2px rgba(16,24,40,.04); transition: box-shadow .2s; }
.card.widget:hover { box-shadow: 0 6px 18px rgba(16,24,40,.07); }
.widget-head { display: flex; align-items: center; gap: .65rem; padding: 1rem 1.25rem .5rem; }
.widget-icon { width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 34px; }
.widget-title { font-size: 1rem; font-weight: 700; margin: 0; flex-grow: 1; }
.widget-link { font-size: .82rem; text-decoration: none; white-space: nowrap; }
.widget-meta { font-size: .8rem; color: var(--ink-2); background: #f1f3f7; border-radius: 2rem; padding: .15rem .6rem; white-space: nowrap; }
.widget-body { padding: .5rem 1.25rem 1.25rem; }
.widget-body .list-group-item { border-color: #f0f2f5; }
.widget-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4rem; color: #9aa3b2; padding: 1.5rem 0; text-align: center; }
.widget-empty i { font-size: 1.8rem; opacity: .6; }

/* KPI */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.kpi-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-label { line-height: 1.2; }
.kpi-text { min-width: 0; }
.kpi { background: #fff; border: 1px solid #e8ebf1; border-radius: 1rem; padding: 1.1rem 1.2rem; display: flex; gap: .9rem; align-items: center; }
.kpi-icon { width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; flex: 0 0 46px; }
.kpi-label { font-size: .8rem; color: var(--ink-2); }
.kpi-value { font-size: 1.65rem; font-weight: 800; line-height: 1.15; letter-spacing: -.02em; }
.kpi-sub { font-size: .76rem; color: #8a93a3; }

/* Anneaux de solde */
.rings { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 1rem; text-align: center; }
.ring { width: 100px; height: 100px; }
.ring-value { font-size: 18px; font-weight: 800; fill: var(--ink); }
.ring-sub { font-size: 8px; fill: #8a93a3; text-transform: uppercase; letter-spacing: .05em; }
.ring-label { font-weight: 600; font-size: .9rem; margin-top: .35rem; }
.ring-detail { font-size: .76rem; color: #8a93a3; }

/* Barres horizontales */
.hbars { display: flex; flex-direction: column; gap: .85rem; }
.hbar-top { display: flex; justify-content: space-between; font-size: .86rem; margin-bottom: .3rem; gap: .5rem; }
.hbar-label { display: inline-flex; align-items: center; gap: .45rem; }
.hbar-val { font-weight: 600; white-space: nowrap; }
.hbar-track { height: 8px; background: #eef0f4; border-radius: 4px; overflow: hidden; }
.hbar-fill { height: 100%; border-radius: 4px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.chart-box { position: relative; height: 260px; }

/* Listes de personnes */
.people-list { list-style: none; padding: 0; margin: 0; }
.people-list li { display: flex; align-items: center; gap: .75rem; padding: .6rem 0; border-bottom: 1px solid #f0f2f5; }
.people-list li:last-child { border-bottom: 0; }
.people-name { font-weight: 600; text-decoration: none; color: var(--ink); }
.avatar { width: 38px; height: 38px; border-radius: 50%; color: #fff; font-weight: 700; font-size: .82rem; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 38px; }
.chip { font-size: .75rem; background: #f1f3f7; color: var(--ink-2); border-radius: 2rem; padding: .15rem .6rem; white-space: nowrap; }
.pays-list { display: flex; flex-direction: column; gap: 1rem; }
.pays-row { display: flex; gap: .85rem; align-items: flex-start; }
.pays-flag { font-size: 1.8rem; line-height: 1; }
@media (max-width: 575.98px) { .hero { padding: 1.25rem; } .hero-title { font-size: 1.45rem; } }
.hero-main { flex: 1 1 440px; min-width: 0; }
.hero-side { flex: 0 0 auto; }

/* Photos de profil */
.avatar-photo { object-fit: cover; background: #e9edf3; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.06); }
.topbar .avatar { border: 2px solid rgba(255,255,255,.6); }
.photo-profil { position: relative; display: inline-block; }
.photo-profil .avatar { box-shadow: 0 6px 18px rgba(16,24,40,.12); }
.journal-details { font-size: .8rem; }
.journal-details td { padding: .15rem .5rem; vertical-align: top; }
.journal-details .ancien { color: #b42318; text-decoration: line-through; }
.journal-details .nouveau { color: #067647; }

