: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
   ===================================================================== */
.apercu-bandeau { background: #fff3cd; color: #664d03; text-align: center; padding: .4rem; font-size: .9rem; }
.entete-apercu { height: 110px; border-radius: .6rem; display: flex; align-items: flex-end; padding: .5rem .75rem; }
.entete-apercu span { background: rgba(0,0,0,.45); color: #fff; font-size: .78rem; padding: .15rem .5rem; border-radius: 1rem; }

/* Fond plein écran (couleur de l'entreprise ou image d'en-tête), carte de connexion centrée */
.cx-body { min-height: 100vh; display: flex; flex-direction: column; color: #fff; background: var(--brand-dark); }
.cx-fond {
    position: fixed; inset: 0; z-index: -1; overflow: hidden;
    background: radial-gradient(circle at 20% 15%, color-mix(in srgb, var(--brand) 65%, #fff) 0, transparent 40%),
                radial-gradient(circle at 85% 90%, color-mix(in srgb, var(--brand) 55%, #000) 0, transparent 45%),
                linear-gradient(140deg, var(--brand) 0%, var(--brand-dark) 100%);
}
.cx-fond-image { background-size: cover; background-position: center; }
.cx-fond-image::after { content: ""; position: absolute; inset: 0;
    background: linear-gradient(160deg, color-mix(in srgb, var(--brand) 45%, transparent), rgba(10,14,24,.55)); }
.cx-bulle { position: absolute; border-radius: 50%; background: #fff; opacity: .07; animation: cx-flotte 18s ease-in-out infinite alternate; }
.cx-bulle.b1 { width: 420px; height: 420px; top: -140px; right: -120px; }
.cx-bulle.b2 { width: 560px; height: 560px; bottom: -260px; left: -180px; opacity: .05; animation-duration: 24s; }
.cx-bulle.b3 { width: 160px; height: 160px; bottom: 18%; right: 14%; animation-duration: 14s; }
@keyframes cx-flotte { to { transform: translate(30px, -25px) scale(1.06); } }
@media (prefers-reduced-motion: reduce) { .cx-bulle { animation: none; } }
.cx-apercu { position: relative; z-index: 2; }

.cx-haut { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.1rem 1.5rem; }
.cx-marque { display: flex; align-items: center; gap: .8rem; min-width: 0; }
.cx-logo { flex: 0 0 auto; width: 52px; height: 52px; border-radius: 14px; background: #fff; padding: 6px; display: flex; align-items: center; justify-content: center;
    box-shadow: 0 8px 20px rgba(0,0,0,.18); }
.cx-logo img { max-width: 100%; max-height: 100%; }
.cx-nom { font-weight: 800; font-size: 1.2rem; letter-spacing: -.01em; line-height: 1.2; text-shadow: 0 1px 8px rgba(0,0,0,.2); }
.cx-slogan { font-size: .86rem; opacity: .85; }
.cx-lien-haut { color: #fff; text-decoration: none; font-size: .88rem; padding: .45rem .9rem; border-radius: 2rem;
    background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.22); backdrop-filter: blur(8px); }
.cx-lien-haut:hover { background: rgba(255,255,255,.24); color: #fff; }

.cx-centre { flex: 1; display: flex; align-items: center; justify-content: center; padding: 1rem 16px 2rem; }
.cx-carte { width: 100%; max-width: 430px; background: rgba(255,255,255,.93); color: var(--ink); border-radius: 1.4rem; padding: 2.25rem 2rem;
    box-shadow: 0 30px 70px rgba(5,10,25,.35); backdrop-filter: blur(14px); border: 1px solid rgba(255,255,255,.35);
    animation: cx-entree .5s ease-out both; }
@keyframes cx-entree { from { opacity: 0; transform: translateY(14px); } }
.cx-titre { font-weight: 800; font-size: 1.6rem; margin: 0 0 .2rem; }
.cx-sous-titre, .cx-aide { color: var(--ink-2); }
.cx-sous-titre { margin-bottom: 1.4rem; }
.cx-bouton { border-radius: .8rem; box-shadow: 0 8px 20px color-mix(in srgb, var(--brand) 35%, transparent); transition: transform .15s; }
.cx-bouton:hover { transform: translateY(-1px); }
.login-field .form-control { border-radius: .8rem; 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; }

.cx-pied { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem 1.4rem; padding: 1rem 16px 1.25rem; font-size: .84rem; color: rgba(255,255,255,.85); }
.cx-pied a { color: #fff; text-decoration: none; }
.cx-pied a:hover { text-decoration: underline; }
@media (max-width: 575.98px) {
    .cx-haut { padding: .75rem 16px; }
    .cx-lien-haut span, .cx-slogan { display: none; }
    .cx-logo { width: 42px; height: 42px; border-radius: 11px; }
    .cx-nom { font-size: 1.05rem; }
    .cx-carte { padding: 1.75rem 1.25rem; border-radius: 1.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; }


/* Recrutement : textes saisis avec retours à la ligne */
.texte-offre { white-space: pre-line; }
