/* ===== VARIABLES ===== */
:root {
    --primary-green: #076633;
    --primary-gold: #F7A400;
    --primary-green-dark: #054d26;
    --primary-green-light: #0a8a45;
    --primary-gold-light: #fdb813;
    --sidebar-width: 250px;
    --danger: #dc3545;
    --warning: #ffc107;
    --success: #28a745;
    --info: #17a2b8;
}

/* ===== GLOBAL ===== */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    min-height: 100vh;
}

/* ===== BOUTONS ===== */
.btn-primary-custom,
.btn-primary-green {
    background-color: var(--primary-green);
    border-color: var(--primary-green);
    color: white;
    transition: all 0.3s ease;
}
.btn-primary-custom:hover,
.btn-primary-green:hover {
    background-color: var(--primary-green-dark);
    border-color: var(--primary-green-dark);
    color: white;
    transform: translateY(-1px);
}
.btn-primary-custom:disabled,
.btn-primary-green:disabled {
    opacity: 0.6;
    transform: none;
}

.btn-gold {
    background-color: var(--primary-gold);
    border-color: var(--primary-gold);
    color: #000;
    transition: all 0.3s ease;
}
.btn-gold:hover {
    background-color: var(--primary-gold-light);
    border-color: var(--primary-gold-light);
    color: #000;
    transform: translateY(-1px);
}

.btn-outline-primary-custom {
    color: var(--primary-green);
    border-color: var(--primary-green);
}
.btn-outline-primary-custom:hover {
    background-color: var(--primary-green);
    color: white;
}

/* ===== SIDEBAR ===== */
.sidebar {
    min-height: 100vh;
    background: linear-gradient(180deg, var(--primary-green) 0%, var(--primary-green-dark) 100%);
    color: white;
    padding: 20px 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    transition: all 0.3s ease;
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.8);
    padding: 12px 24px;
    border-radius: 10px;
    margin: 4px 12px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    text-decoration: none;
}
.sidebar .nav-link:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    transform: translateX(5px);
}
.sidebar .nav-link.active {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-weight: 600;
    border-left: 4px solid var(--primary-gold);
}
.sidebar .nav-link i {
    margin-right: 14px;
    width: 22px;
    text-align: center;
    font-size: 1.1rem;
}

.sidebar .brand {
    padding: 0 20px 20px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 20px;
}

.sidebar .brand img {
    max-height: 45px;
}

/* ===== CARDS ===== */
.card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}
.card:hover {
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.1);
}
.card-header {
    border-radius: 15px 15px 0 0 !important;
    font-weight: 600;
}
.card-header.bg-primary-green {
    background-color: var(--primary-green) !important;
}

/* ===== TABLES ===== */
.table th {
    font-weight: 600;
    color: #444;
    border-bottom: 2px solid var(--primary-green);
    background-color: #f8f9fa;
}
.table td {
    vertical-align: middle;
}
.table-hover tbody tr:hover {
    background-color: rgba(7, 102, 51, 0.05);
}

/* ===== BADGES ===== */
.badge-status {
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 500;
}
.badge-status.actif { background: #d4edda; color: #155724; }
.badge-status.inactif { background: #e2e3e5; color: #383d41; }
.badge-status.bloque { background: #f8d7da; color: #721c24; }
.badge-status.gele { background: #fff3cd; color: #856404; }
.badge-status.suspendu { background: #f8d7da; color: #721c24; }

/* ===== FORMULAIRE ===== */
.form-control:focus {
    border-color: var(--primary-green);
    box-shadow: 0 0 0 0.2rem rgba(7, 102, 51, 0.25);
}
.form-control.is-invalid:focus {
    border-color: var(--danger);
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* ===== MODALES ===== */
.modal-content {
    border-radius: 15px;
    border: none;
}
.modal-header {
    border-radius: 15px 15px 0 0;
}
.modal-header .btn-close {
    filter: brightness(0) invert(1);
}

/* ===== NOTIFICATIONS ===== */
#notificationContainer {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    max-width: 400px;
    width: 100%;
}
#notificationContainer .alert {
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    animation: slideInRight 0.3s ease;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes slideInRight {
    from { transform: translateX(100px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.fade-in {
    animation: fadeIn 0.5s ease;
}
.pulse {
    animation: pulse 2s infinite;
}

/* ===== UTILITIES ===== */
.text-primary-green { color: var(--primary-green); }
.text-gold { color: var(--primary-gold); }
.bg-primary-green { background-color: var(--primary-green); }
.border-primary-green { border-color: var(--primary-green); }

.cursor-pointer { cursor: pointer; }
.hover-shadow:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.1); }
.transition { transition: all 0.3s ease; }

/* ===== AVATAR ===== */
.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e9ecef;
    color: #6c757d;
    flex-shrink: 0;
}
.avatar-sm {
    width: 30px;
    height: 30px;
    font-size: 0.8rem;
}
.avatar-lg {
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .sidebar {
        min-height: auto;
        height: auto;
        position: relative;
        padding: 10px 0;
    }
    .sidebar .nav-link {
        padding: 8px 16px;
        margin: 2px 8px;
    }
    #notificationContainer {
        top: 10px;
        right: 10px;
        max-width: calc(100% - 20px);
    }
}

/* ===== TABLEAU DE BORD ===== */
.stats-card {
    border-radius: 15px;
    padding: 20px;
    color: white;
    transition: all 0.3s ease;
}
.stats-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}
.stats-card .icon {
    font-size: 2.5rem;
    opacity: 0.5;
}
.stats-card .number {
    font-size: 2rem;
    font-weight: 700;
}

/* ===== COMPTE À REBOURS ===== */
.countdown-warning {
    color: var(--warning);
    font-weight: bold;
}
.countdown-danger {
    color: var(--danger);
    font-weight: bold;
    animation: pulse 1s infinite;
}

/* ===== OTP ===== */
.otp-input {
    font-size: 24px;
    letter-spacing: 8px;
    text-align: center;
    font-weight: bold;
}
.otp-input:focus {
    letter-spacing: 8px;
}

/* ===== SECURITY QUESTIONS ===== */
.security-question-item {
    padding: 10px 15px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin-bottom: 8px;
    background: white;
    transition: all 0.3s ease;
}
.security-question-item:hover {
    border-color: var(--primary-green);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.security-question-item .question-text {
    font-weight: 500;
}
.security-question-item .answer-status {
    font-size: 0.85rem;
}

/* ===== IMPRESSION ===== */
@media print {
    .sidebar {
        display: none !important;
    }
    .no-print {
        display: none !important;
    }
    .card {
        box-shadow: none !important;
        border: 1px solid #dee2e6 !important;
    }
}