/*
 * Styles spécifiques pour le Catalogue des Coûts
 * Amélioration de l'affichage professionnel
 */

/* ===== CORRECTIONS LAYOUT PRINCIPAL ===== */

/* Éviter la duplication de main-content */
.main-content .main-content {
    padding: 0 !important;
    margin-left: 0 !important;
    margin-top: 0 !important;
    min-height: auto !important;
    background: transparent !important;
}

/* Structure principale AdminLTE integration */
.content-wrapper .main-content {
    background: transparent;
    padding: 0;
    margin: 0;
    min-height: auto;
}

/* Suppression du padding/margin par défaut dans le layout AdminLTE */
.admin-wrapper .content-wrapper .main-content {
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Page header dans le layout AdminLTE */
.main-content .page-header {
    background: white;
    padding: 1.5rem 2rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #dee2e6;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    border-radius: 0;
}

/* Responsive adjustments */
@media (max-width: 767px) {
    .main-content .page-header {
        padding: 1rem 1.5rem;
        margin-bottom: 1rem;
    }
    
    .main-content .page-header .d-flex {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 1rem;
    }
    
    .main-content .page-header .d-flex > div:last-child {
        width: 100%;
        justify-content: space-between;
    }
}

/* ===== EN-TÊTE DE PAGE AMÉLIORÉ POUR ADMINLTE ===== */

.page-header {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 0;
    padding: 1.5rem 2rem;
    margin-bottom: 1.5rem;
    border: none;
    border-bottom: 1px solid #e0e6ed;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    position: relative;
    overflow: hidden;
}

/* Contenu principal avec espacement adapté AdminLTE */
.main-content > .row,
.main-content > .nav,
.main-content > .tab-content {
    margin-left: 2rem;
    margin-right: 2rem;
}

/* Responsive pour le contenu */
@media (max-width: 767px) {
    .main-content > .row,
    .main-content > .nav,
    .main-content > .tab-content {
        margin-left: 1rem;
        margin-right: 1rem;
    }
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #3c8dbc, #2c7aa5, #1e6091);
}

.page-header h1 {
    margin: 0 0 0.75rem 0;
    font-size: 2.25rem;
    font-weight: 700;
    color: #2c3e50;
    display: flex;
    align-items: center;
    line-height: 1.2;
}

.page-header h1 i {
    margin-right: 1.25rem;
    font-size: 2rem;
    color: #f39c12;
    text-shadow: 0 2px 4px rgba(243, 156, 18, 0.3);
}

.page-header p {
    margin: 0;
    font-size: 1.1rem;
    color: #6c757d;
    font-weight: 400;
    line-height: 1.5;
}

/* Boutons dans l'en-tête */
.page-header .btn {
    font-weight: 600;
    padding: 0.75rem 1.25rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.page-header .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}

.page-header .btn-primary {
    background: linear-gradient(135deg, #3c8dbc, #2c7aa5);
    border: none;
}

.page-header .btn-outline-success:hover {
    background: linear-gradient(135deg, #28a745, #20a142);
    border-color: #28a745;
}

.page-header .btn-outline-info:hover {
    background: linear-gradient(135deg, #17a2b8, #138496);
    border-color: #17a2b8;
}

/* ===== CARTES DE STATISTIQUES AMÉLIORÉES ===== */

.stats-card {
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
}

.stats-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--color, #3c8dbc), var(--color-dark, #2c7aa5));
}

.stats-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.stats-card .card-body {
    padding: 2rem 1.5rem;
}

.stats-card h3 {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0.5rem 0;
    color: #2c3e50;
}

.stats-card h6 {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0;
    font-size: 0.95rem;
}

.stats-card small {
    color: #6c757d;
    font-size: 0.85rem;
    font-weight: 500;
}

/* Icônes colorées dans les stats */
.stats-card .bg-primary {
    background: linear-gradient(135deg, #3c8dbc, #2c7aa5) !important;
}

.stats-card .bg-success {
    background: linear-gradient(135deg, #28a745, #20a142) !important;
}

.stats-card .text-primary {
    color: #3c8dbc !important;
}

.stats-card .text-success {
    color: #28a745 !important;
}

/* ===== CONFIGURATION SYSTÈME AMÉLIORÉE ===== */

.config-item {
    background: linear-gradient(135deg, #ffffff, #f8f9fa);
    border: 2px solid #e9ecef;
    border-radius: 0.5rem;
    padding: 1.25rem;
    transition: all 0.3s ease;
    position: relative;
}

.config-item:hover {
    border-color: #3c8dbc;
    box-shadow: 0 4px 12px rgba(60, 141, 188, 0.15);
    transform: translateY(-2px);
}

.config-item .text-uppercase {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: #6c757d;
    margin-bottom: 0.5rem;
}

.config-item .fw-bold {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2c3e50;
}

/* ===== NAVIGATION PAR ONGLETS PROFESSIONNELLE ===== */

.nav-tabs {
    border-bottom: 3px solid #e9ecef;
    margin-bottom: 2rem;
    background: #ffffff;
    padding: 0.5rem 0.5rem 0;
    border-radius: 0.75rem 0.75rem 0 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.nav-tabs .nav-link {
    border: none;
    border-radius: 0.5rem 0.5rem 0 0;
    padding: 1rem 2rem;
    font-weight: 600;
    color: #6c757d;
    background: transparent;
    transition: all 0.3s ease;
    margin-right: 0.25rem;
    position: relative;
    font-size: 0.95rem;
}

.nav-tabs .nav-link i {
    margin-right: 0.75rem;
    font-size: 1rem;
    opacity: 0.8;
}

.nav-tabs .nav-link:hover {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    color: #3c8dbc;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.nav-tabs .nav-link:hover i {
    opacity: 1;
    transform: scale(1.1);
}

.nav-tabs .nav-link.active {
    background: linear-gradient(135deg, #3c8dbc, #2c7aa5);
    color: #ffffff !important;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(60, 141, 188, 0.3);
    border: none;
}

.nav-tabs .nav-link.active i {
    color: #ffffff !important;
    opacity: 1;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.nav-tabs .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #3c8dbc, #2c7aa5);
}

/* ===== CONTENU DES ONGLETS ===== */

.tab-content {
    background: transparent;
    padding: 0;
}

.tab-pane {
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== CARTES DE CONTENU AMÉLIORÉES ===== */

.content-card {
    background: #ffffff;
    border: 1px solid #e0e6ed;
    border-radius: 0.75rem;
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
    margin-bottom: 2rem;
    overflow: hidden;
    transition: all 0.3s ease;
}

.content-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

.content-card .card-header {
    background: linear-gradient(135deg, #3c8dbc, #2c7aa5);
    color: #ffffff;
    border-bottom: none;
    padding: 1.25rem 1.75rem;
    font-weight: 600;
}

.content-card .card-header h5 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    display: flex;
    align-items: center;
}

.content-card .card-header i {
    margin-right: 0.75rem;
    font-size: 1.1rem;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.content-card .card-header .btn {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: #ffffff;
    font-weight: 600;
}

.content-card .card-header .btn:hover {
    background: rgba(255,255,255,0.3);
    border-color: rgba(255,255,255,0.4);
    transform: translateY(-1px);
}

/* ===== TABLEAUX PROFESSIONNELS ===== */

.professional-table {
    border-collapse: separate;
    border-spacing: 0;
    background: #ffffff;
    border-radius: 0;
    overflow: hidden;
    margin-bottom: 0;
}

.professional-table thead th {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-bottom: 2px solid #dee2e6;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.075em;
    color: #495057;
    padding: 1.25rem 1rem;
    border-top: none;
    position: relative;
}

.professional-table tbody tr {
    transition: all 0.2s ease;
    border-bottom: 1px solid #f0f2f5;
}

.professional-table tbody tr:hover {
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
    transform: scale(1.005);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.professional-table tbody td {
    padding: 1.25rem 1rem;
    vertical-align: middle;
    border-top: 1px solid #f0f2f5;
    font-size: 0.9rem;
}

.professional-table .fw-bold {
    font-weight: 700;
    color: #2c3e50;
}

/* ===== BADGES AMÉLIORÉS ===== */

.badge {
    font-weight: 600;
    letter-spacing: 0.025em;
    padding: 0.5rem 0.875rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.badge.bg-primary {
    background: linear-gradient(135deg, #3c8dbc, #2c7aa5) !important;
    color: #ffffff;
}

.badge.bg-success {
    background: linear-gradient(135deg, #28a745, #20a142) !important;
    color: #ffffff;
}

.badge.bg-warning {
    background: linear-gradient(135deg, #ffc107, #e0a800) !important;
    color: #212529;
}

.badge.bg-danger {
    background: linear-gradient(135deg, #dc3545, #c82333) !important;
    color: #ffffff;
}

.badge.bg-secondary {
    background: linear-gradient(135deg, #6c757d, #5a6268) !important;
    color: #ffffff;
}

/* ===== BOUTONS D'ACTION AMÉLIORÉS ===== */

.btn-group-sm .btn {
    padding: 0.5rem 0.875rem;
    font-size: 0.775rem;
    border-radius: 0.4rem;
    font-weight: 600;
    transition: all 0.3s ease;
    border-width: 2px;
}

.btn-outline-primary {
    border-color: #3c8dbc;
    color: #3c8dbc;
}

.btn-outline-primary:hover {
    background: linear-gradient(135deg, #3c8dbc, #2c7aa5);
    border-color: #3c8dbc;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(60, 141, 188, 0.3);
}

.btn-outline-danger {
    border-color: #dc3545;
    color: #dc3545;
}

.btn-outline-danger:hover {
    background: linear-gradient(135deg, #dc3545, #c82333);
    border-color: #dc3545;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(220, 53, 69, 0.3);
}

.btn-outline-success {
    border-color: #28a745;
    color: #28a745;
}

.btn-outline-success:hover {
    background: linear-gradient(135deg, #28a745, #20a142);
    border-color: #28a745;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(40, 167, 69, 0.3);
}

/* ===== SWITCH ET CONTRÔLES ===== */

.form-switch .form-check-input {
    width: 3rem;
    height: 1.5rem;
    background-color: #dee2e6;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.form-switch .form-check-input:checked {
    background-color: #3c8dbc;
    box-shadow: 0 2px 8px rgba(60, 141, 188, 0.3);
}

.form-switch .form-check-label {
    font-weight: 500;
    color: #6c757d;
    font-size: 0.875rem;
}

/* ===== DROPDOWN AMÉLIORÉ ===== */

.dropdown-menu {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    padding: 0.5rem 0;
    background: #ffffff;
    border: 1px solid #e0e6ed;
}

.dropdown-item {
    padding: 0.75rem 1.25rem;
    font-weight: 500;
    color: #495057;
    transition: all 0.2s ease;
    border-radius: 0;
}

.dropdown-item:hover {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    color: #3c8dbc;
    transform: translateX(5px);
}

.dropdown-item i {
    width: 20px;
    text-align: center;
    opacity: 0.8;
}

.dropdown-divider {
    margin: 0.5rem 0;
    border-color: #e9ecef;
}

/* ===== RESPONSIVE AMÉLIORATIONS ===== */

@media (max-width: 768px) {
    .main-content {
        padding: 1rem;
    }
    
    .page-header {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .page-header h1 {
        font-size: 1.75rem;
    }
    
    .nav-tabs .nav-link {
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
    }
    
    .professional-table thead th {
        padding: 1rem 0.75rem;
        font-size: 0.75rem;
    }
    
    .professional-table tbody td {
        padding: 1rem 0.75rem;
        font-size: 0.85rem;
    }
}

/* ===== ANIMATIONS ET TRANSITIONS ===== */

.main-content > * {
    animation: slideInFromTop 0.6s ease;
}

@keyframes slideInFromTop {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* States spéciaux */
.loading-state {
    opacity: 0.6;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.success-state {
    animation: successPulse 0.6s ease;
}

@keyframes successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}