/* =============================================================
   GestionAO — Feuille de style personnalisée
   Stack : Bootstrap 5 + Font Awesome 6
   ============================================================= */

/* ── Variables ── */
:root {
    --sidebar-width:     240px;
    --sidebar-bg:        #1e2a3a;
    --sidebar-text:      #c8d6e5;
    --sidebar-hover:     rgba(255,255,255,.08);
    --sidebar-active:    #0d6efd;
    --navbar-height:     56px;
    --transition:        .25s ease;
}

/* ── Body / Layout ── */
body {
    background: #f0f2f5;
    font-size: .9rem;
}

#layoutWrapper {
    min-height: calc(100vh - var(--navbar-height));
}

/* ── Sidebar ── */
.sidebar {
    width: var(--sidebar-width);
    min-height: calc(100vh - var(--navbar-height));
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: var(--navbar-height);
    height: calc(100vh - var(--navbar-height));
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform var(--transition);
    z-index: 1040;
    flex-shrink: 0;
}

.sidebar .nav-link {
    color: var(--sidebar-text);
    padding: .5rem 1.2rem;
    border-radius: 6px;
    margin: 1px 8px;
    font-size: .87rem;
    transition: background var(--transition), color var(--transition);
}

.sidebar .nav-link:hover {
    background: var(--sidebar-hover);
    color: #fff;
}

.sidebar .nav-link.active {
    background: var(--sidebar-active);
    color: #fff;
    font-weight: 600;
}

.sidebar .sidebar-heading {
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #6c7a8d;
    padding: .4rem 1.2rem;
    list-style: none;
}

.sidebar-icon {
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 1rem 1.2rem;
    margin-top: auto;
    border-top: 1px solid rgba(255,255,255,.08);
}

/* ── Main Content ── */
.main-content {
    min-width: 0;
    padding: 1.5rem;
}

/* ── Overlay mobile ── */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 1039;
    display: none;
}

.sidebar-overlay.show {
    display: block;
}

/* Sidebar masquée (mobile) */
@media (max-width: 991.98px) {
    .sidebar {
        position: fixed;
        top: var(--navbar-height);
        left: 0;
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        padding: 1rem;
    }
}

/* ── KPI Cards ── */
.kpi-card {
    border-radius: 12px;
    transition: transform .2s;
}
.kpi-card:hover { transform: translateY(-3px); }

.kpi-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.kpi-number {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

.kpi-label {
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #6c757d;
    font-weight: 600;
}

/* Soft backgrounds */
.bg-primary-soft { background: rgba(13,110,253,.12); }
.bg-success-soft { background: rgba(25,135,84,.12);  }
.bg-warning-soft { background: rgba(255,193,7,.15);  }
.bg-danger-soft  { background: rgba(220,53,69,.12);  }

/* ── Avatar ── */
.avatar-circle {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255,255,255,.2);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .85rem;
}

.avatar-circle-sm {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .75rem;
}

/* ── Cards ── */
.card { border-radius: 10px; }
.card-header { border-radius: 10px 10px 0 0 !important; }

/* ── Tables ── */
.table > :not(caption) > * > * {
    padding: .6rem .75rem;
}

/* ── Hover card (public) ── */
.hover-card {
    transition: box-shadow .2s, transform .2s;
    border-radius: 12px !important;
}
.hover-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,.12) !important;
    transform: translateY(-4px);
}

/* ── Login page ── */
.login-page {
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 60%, #084298 100%);
    min-height: 100vh;
    padding: 1rem;
}
.login-card { border-radius: 16px; overflow: hidden; }

/* ── Boutons extra small ── */
.btn-xs {
    padding: .15rem .4rem;
    font-size: .75rem;
}

/* ── Badge sans contenu saillant ── */
.badge.bg-light { color: #495057 !important; }

/* ── Pagination ── */
.page-link { border-radius: 6px !important; margin: 0 2px; }

/* ── Scrollbar sidebar ── */
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 2px; }

/* ── Animations ── */
@keyframes fadeInUp {
    from { opacity:0; transform:translateY(16px); }
    to   { opacity:1; transform:translateY(0); }
}
.card { animation: fadeInUp .3s ease both; }

/* ── Footer ── */
.footer { font-size: .82rem; }
