/* ============================================
   STYLES GÉNÉRAUX
   ============================================ */
:root {
    --primary: #1a5f7a;
    --primary-dark: #0e3f52;
    --secondary: #6c757d;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #17a2b8;
    --light: #f8f9fa;
    --dark: #343a40;
    --white: #ffffff;
    --border-radius: 12px;
    --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #e9ecef 100%);
    color: #2c3e50;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============================================
   NAVBAR
   ============================================ */
.navbar {
    background: var(--white) !important;
    box-shadow: var(--box-shadow);
    padding: 0.75rem 1rem;
}

.navbar-brand img {
    transition: var(--transition);
}

.navbar-brand img:hover {
    transform: scale(1.05);
}

.dropdown-menu {
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    border: none;
    margin-top: 0.5rem;
}

.dropdown-item {
    transition: var(--transition);
}

.dropdown-item:hover {
    background-color: var(--primary);
    color: var(--white);
}

/* ============================================
   CARTES
   ============================================ */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    background: var(--white);
    overflow: hidden;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.card-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    border-bottom: none;
    padding: 1rem 1.25rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.card-header.bg-light {
    background: var(--light);
    color: var(--dark);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.card-header.bg-warning {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: var(--white);
}

.card-header.bg-success {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
}

.card-header.bg-danger {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

.card-header.bg-info {
    background: linear-gradient(135deg, #2980b9 0%, #3498db 100%);
}

.card-body {
    padding: 1.5rem;
}

/* ============================================
   TABLEAUX
   ============================================ */
.table {
    border-radius: var(--border-radius);
    overflow: hidden;
    margin-bottom: 0;
}

.table thead th {
    background: linear-gradient(135deg, var(--dark) 0%, #2c3e50 100%);
    color: var(--white);
    border: none;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    padding: 12px 8px;
}

.table tbody tr {
    transition: var(--transition);
}

.table tbody tr:hover {
    background-color: rgba(26, 95, 122, 0.05);
    transform: scale(1.01);
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0, 0, 0, 0.02);
}

/* ============================================
   BOUTONS
   ============================================ */
.btn {
    border-radius: 30px;
    padding: 0.5rem 1.25rem;
    font-weight: 500;
    transition: var(--transition);
    letter-spacing: 0.3px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
}

.btn-success {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    border: none;
}

.btn-danger {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    border: none;
}

.btn-warning {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    border: none;
    color: var(--white);
}

.btn-info {
    background: linear-gradient(135deg, #2980b9 0%, #3498db 100%);
    border: none;
    color: var(--white);
}

.btn-outline-secondary {
    border-radius: 30px;
}

.btn-group-sm .btn {
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
}

/* ============================================
   ACCORDÉON
   ============================================ */
.accordion-item {
    border: none;
    margin-bottom: 0.75rem;
    border-radius: var(--border-radius) !important;
    overflow: hidden;
    box-shadow: var(--box-shadow);
}

.accordion-button {
    background: var(--white);
    font-weight: 600;
    padding: 1rem 1.25rem;
    transition: var(--transition);
}

.accordion-button:not(.collapsed) {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    box-shadow: none;
}

.accordion-button:focus {
    box-shadow: none;
    border-color: transparent;
}

.accordion-body {
    background: var(--light);
    padding: 1.5rem;
}

/* ============================================
   BADGES
   ============================================ */
.badge {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.4rem 0.8rem;
    border-radius: 30px;
    letter-spacing: 0.3px;
}

.badge.bg-success {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
}

.badge.bg-danger {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

.badge.bg-secondary {
    background: linear-gradient(135deg, #7f8c8d 0%, #95a5a6 100%);
}

.badge.bg-warning {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: var(--white);
}

.badge.bg-info {
    background: linear-gradient(135deg, #2980b9 0%, #3498db 100%);
}

/* ============================================
   SIGNATURES
   ============================================ */
.signature-img {
    max-height: 80px;
    border: 1px solid var(--secondary);
    border-radius: 8px;
    padding: 4px;
    background-color: var(--white);
    transition: var(--transition);
}

.signature-img:hover {
    transform: scale(1.5);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10;
    position: relative;
}

.signature-thumb {
    max-height: 30px;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 2px;
}

.signature-thumb:hover {
    transform: scale(3);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 100;
    position: relative;
}

/* ============================================
   FORMULAIRES
   ============================================ */
.form-control,
.form-select {
    border-radius: 8px;
    border: 1px solid #ced4da;
    transition: var(--transition);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(26, 95, 122, 0.25);
}

/* ============================================
   ALERTES
   ============================================ */
.alert {
    border-radius: var(--border-radius);
    border: none;
    box-shadow: var(--box-shadow);
}

.alert-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
}

.alert-danger {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
}

.alert-info {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    color: #0c5460;
}

/* ============================================
   FOOTER AMÉLIORÉ
   ============================================ */
.footer {
    background: linear-gradient(135deg, #1a2a3a 0%, #0f1a24 100%);
    color: #e0e0e0;
    border-top: 3px solid var(--primary);
    font-size: 0.9rem;
}

.footer a {
    color: #bbbbbb;
    text-decoration: none;
    transition: var(--transition);
}

.footer a:hover {
    color: var(--primary);
    padding-left: 5px;
}

.footer hr {
    background-color: rgba(255, 255, 255, 0.1);
    margin: 1rem 0;
}

.footer h5 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--primary);
    letter-spacing: 0.5px;
}

.footer .list-unstyled li {
    margin-bottom: 0.5rem;
}

.footer i {
    width: 25px;
    color: var(--primary);
}

@media (max-width: 768px) {
    .footer {
        text-align: center;
    }
    .footer .list-unstyled li {
        text-align: center;
    }
    .footer i {
        width: auto;
        margin-right: 5px;
    }
}

/* ============================================
   UTILITAIRES
   ============================================ */
.text-primary {
    color: var(--primary) !important;
}

.bg-primary-gradient {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.shadow-custom {
    box-shadow: var(--box-shadow);
}

.rounded-custom {
    border-radius: var(--border-radius);
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card,
.accordion-item,
.alert {
    animation: fadeIn 0.5s ease-out;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .navbar .d-flex {
        flex-direction: column;
        align-items: flex-end;
        gap: 0.5rem;
    }

    .card-header {
        padding: 0.75rem 1rem;
    }

    .card-body {
        padding: 1rem;
    }

    .table-responsive {
        font-size: 0.85rem;
    }

    .btn {
        padding: 0.4rem 1rem;
        font-size: 0.85rem;
    }

    .badge {
        font-size: 0.7rem;
        padding: 0.3rem 0.6rem;
    }
}

/* ============================================
   IMPRESSION
   ============================================ */
@media print {
    .navbar,
    .btn,
    .dropdown,
    footer,
    .no-print {
        display: none !important;
    }

    body {
        background: white;
        margin: 0;
        padding: 0;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }

    .table thead th {
        background: #f8f9fa;
        color: black;
    }
}