/* Reset et base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f7fa;
    color: #333;
}

/* Spinner de chargement */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Navbar */
.navbar {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.navbar h1 {
    font-size: 24px;
    font-weight: 600;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 20px;
}

.navbar-user span {
    font-size: 14px;
}

.navbar button, .btn-logout {
    background: white;
    color: #11998e;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.navbar button:hover, .btn-logout:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Container */
.container {
    max-width: 1400px;
    margin: 30px auto;
    padding: 0 20px;
}

/* Onglets */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid #e0e0e0;
    flex-wrap: wrap;
}

.tab {
    padding: 12px 24px;
    background: white;
    border: none;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    border-radius: 8px 8px 0 0;
    transition: all 0.3s;
    color: #666;
}

.tab:hover {
    background: #f5f7fa;
}

.tab.active {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    box-shadow: 0 -2px 10px rgba(17, 153, 142, 0.3);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Cards */
.card {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
    margin-bottom: 20px;
    transition: all 0.3s;
}

.card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}

.card h3 {
    margin-bottom: 25px;
    color: #11998e;
    font-size: 20px;
    font-weight: 600;
    border-bottom: 2px solid #11998e;
    padding-bottom: 10px;
}

/* Grille de cartes */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

/* Formulaires */
.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 600;
    font-size: 14px;
}

input, select, textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s;
    font-family: inherit;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #11998e;
    box-shadow: 0 0 0 3px rgba(17, 153, 142, 0.1);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

/* Boutons */
.btn {
    padding: 12px 30px;
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(17, 153, 142, 0.4);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

.btn-block {
    width: 100%;
    justify-content: center;
}

.btn-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Tableaux */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

table th, table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

table th {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 0.5px;
}

table tr:hover {
    background: #f8f9fa;
}

table tr:last-child td {
    border-bottom: none;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

.badge-danger {
    background: #f8d7da;
    color: #721c24;
}

.badge-info {
    background: #d1ecf1;
    color: #0c5460;
}

/* Stats Cards */
.stat-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
    text-align: center;
    transition: all 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 25px rgba(0,0,0,0.15);
}

.stat-card .icon {
    font-size: 40px;
    margin-bottom: 15px;
}

.stat-card .value {
    font-size: 32px;
    font-weight: 700;
    color: #11998e;
    margin-bottom: 8px;
}

.stat-card .label {
    font-size: 14px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Info box */
.info-box {
    background: linear-gradient(135deg, #e8f5f3 0%, #d4f1ea 100%);
    border-left: 4px solid #11998e;
    padding: 20px;
    margin-bottom: 25px;
    border-radius: 8px;
}

.info-box p {
    margin-bottom: 8px;
    line-height: 1.6;
}

.info-box strong {
    color: #11998e;
}

/* Actions */
.actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.action-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.action-btn.edit {
    background: #17a2b8;
    color: white;
}

.action-btn.delete {
    background: #dc3545;
    color: white;
}

.action-btn.view {
    background: #28a745;
    color: white;
}

.action-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state .icon {
    font-size: 60px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: #666;
}

.empty-state p {
    font-size: 14px;
}

/* Loader page */
.page-loader {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

.page-loader .spinner {
    width: 50px;
    height: 50px;
    border-width: 4px;
    border-color: #11998e;
    border-top-color: transparent;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .navbar-user {
        flex-direction: column;
        gap: 10px;
    }

    .tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
    }

    .tab {
        white-space: nowrap;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .cards-grid {
        grid-template-columns: 1fr;
    }

    table {
        font-size: 12px;
    }

    table th, table td {
        padding: 10px;
    }

    .actions {
        flex-direction: column;
    }

    .action-btn {
        width: 100%;
    }
}

/* Personnalisation SweetAlert2 */
.swal2-popup {
    border-radius: 12px;
}

.swal2-confirm {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%) !important;
    border-radius: 8px;
}