/* === BASE === */
:root {
    --primary:       #0d6efd;
    --primary-dark:  #0a58ca;
    --primary-light: #cfe2ff;
    --bg-page:       #f0f4f8;
    --text-muted:    #6c757d;
    --border:        #dee2e6;
}

body {
    background-color: var(--bg-page);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* === NAVBAR === */
.navbar-nav .nav-link.active {
    font-weight: 700;
    background-color: rgba(255, 255, 255, 0.18);
    border-radius: 6px;
}
.navbar-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

/* === PAGE HEADER === */
.page-header {
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    color: #fff;
    border-radius: 14px;
    padding: 1.5rem 2rem;
    margin-bottom: 1.5rem;
}
.page-header h1 { font-size: 1.6rem; font-weight: 700; margin: 0; }
.page-header p  { margin: 0.25rem 0 0; opacity: 0.85; font-size: 0.95rem; }

/* === CARTES === */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}
.card-hover {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}
.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 0.5rem 1.5rem rgba(13, 110, 253, 0.15) !important;
}

/* === ICÔNE RONDE === */
.icon-box {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.8rem;
}

/* === KPI CARDS === */
.kpi-card {
    border-radius: 12px;
    padding: 1.2rem 1.5rem;
    color: #fff;
    position: relative;
    overflow: hidden;
}
.kpi-card .kpi-value { font-size: 2rem; font-weight: 800; line-height: 1; }
.kpi-card .kpi-label { font-size: 0.82rem; opacity: 0.85; margin-top: 0.25rem; }
.kpi-card .kpi-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2.8rem;
    opacity: 0.2;
}
.kpi-blue   { background: linear-gradient(135deg, #0d6efd, #0a58ca); }
.kpi-green  { background: linear-gradient(135deg, #198754, #146c43); }
.kpi-red    { background: linear-gradient(135deg, #dc3545, #b02a37); }
.kpi-orange { background: linear-gradient(135deg, #fd7e14, #ca6510); }

/* === TABLES === */
.table th {
    font-size: 0.80rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    background-color: #e8f0fe;
    color: #0a58ca;
    white-space: nowrap;
}
.table td { vertical-align: middle; }
.table-hover tbody tr:hover { background-color: #f0f4ff; }

/* === BADGES === */
.badge { font-weight: 500; font-size: 0.78rem; }

/* === FORMULAIRES === */
.form-label { font-weight: 500; color: #344054; }
.form-control:focus, .form-select:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.2);
}
.form-control-lg { border-radius: 10px; }

/* === ALERTES === */
.alert { border-radius: 10px; border-left: 4px solid; }
.alert-success { border-left-color: #198754; }
.alert-danger  { border-left-color: #dc3545; }
.alert-warning { border-left-color: #ffc107; }
.alert-info    { border-left-color: #0dcaf0; }

/* === MODALS === */
.modal-content { border-radius: 14px; border: none; }
.modal-header  { border-radius: 14px 14px 0 0; padding: 1rem 1.5rem; }

/* === GRAPHS === */
.chart-container {
    position: relative;
    background: #fff;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}

/* === STAT TABLE === */
.stat-box {
    background: #fff;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    border-left: 4px solid var(--primary);
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}
.stat-box .stat-val { font-size: 1.6rem; font-weight: 700; color: var(--primary); }
.stat-box .stat-lbl { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; }

/* === ANIMATIONS === */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-12px); }
    to   { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeInDown 0.3s ease-out; }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.6; }
}
.pulse { animation: pulse 1.8s infinite; }

/* === FOOTER === */
footer {
    background: transparent;
    color: var(--text-muted);
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .container { padding-left: 12px; padding-right: 12px; }
    .table-responsive { font-size: 0.80rem; }
    .page-header { padding: 1rem 1.25rem; border-radius: 10px; }
    .page-header h1 { font-size: 1.3rem; }
    .kpi-card .kpi-value { font-size: 1.5rem; }
    .icon-box { width: 56px; height: 56px; font-size: 1.4rem; }
    .stat-box .stat-val { font-size: 1.3rem; }
}

/* === PRINT (PDF via navigateur) === */
@media print {
    .navbar, footer, .btn, .no-print { display: none !important; }
    body { background: #fff !important; }
    .card { box-shadow: none !important; border: 1px solid #dee2e6 !important; }
    .page-header { background: #0d6efd !important; -webkit-print-color-adjust: exact; }
}
