/* ========================================
   RESET & VARIABLES GLOBALES
   ======================================== */
:root {
    --primary: #2c3e50;
    --primary-light: #34495e;
    --accent: #3498db;
    --accent-dark: #2980b9;
    --success: #27ae60;
    --danger: #e74c3c;
    --warning: #f39c12;
    --light: #ecf0f1;
    --gray: #95a5a6;
    --gray-dark: #7f8c8d;
    --white: #ffffff;
    --text: #2c3e50;
    --border: #ddd;
    --bg: #f8f9fa;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.15);
    --radius: 6px;
    --transition: 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.5;
    padding-top: 50px;
    margin: 0;
    padding: 50px 0 0 0;
}

/* ========================================
   NAVBAR
   ======================================== */
.navbar {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 50px;
    z-index: 9999;
    display: flex;
    align-items: center;
    padding: 0 20px;
    box-shadow: var(--shadow-lg);
}

.navbar a {
    color: var(--white);
    text-decoration: none;
    padding: 0 18px;
    height: 50px;
    display: flex;
    align-items: center;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.navbar a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background-color: var(--accent);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform var(--transition);
}

.navbar a:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

.navbar .newfit-button {
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin: 0 5px;
    transition: var(--transition);
}

.navbar .newfit-button:hover {
    background-color: rgba(255,255,255,0.2);
    transform: scale(1.1);
}

.navbar .user-info {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 15px;
}

.navbar .user-info span {
    color: var(--white);
    font-size: 13px;
    font-weight: 500;
}

.navbar .logout-link {
    background-color: var(--danger);
    padding: 8px 16px;
    border-radius: var(--radius);
    color: var(--white);
    font-size: 13px;
    font-weight: 600;
    transition: var(--transition);
    cursor: pointer;
    border: none;
}

.navbar .logout-link:hover {
    background-color: #c0392b;
    box-shadow: 0 4px 12px rgba(231,76,60,0.3);
}

/* ========================================
   CONTENEURS
   ======================================== */
.container, .content, .main-container {
    max-width: 100%;
    margin: 0;
    padding: 0;
}

.card, .panel, .data-item {
    background: var(--white);
    border-radius: var(--radius);
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.card:hover, .panel:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

/* ========================================
   TYPOGRAPHIE
   ======================================== */
h1, h2, h3, h4, h5, h6 {
    color: var(--text);
    margin-bottom: 15px;
    font-weight: 600;
    line-height: 1.3;
}

h1 { font-size: 32px; }
h2 { font-size: 26px; }
h3 { font-size: 22px; }
h4 { font-size: 18px; }
h5 { font-size: 16px; }
h6 { font-size: 14px; }

p {
    margin-bottom: 15px;
    color: var(--text);
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--accent-dark);
}

/* ========================================
   FORMULAIRES
   ======================================== */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: var(--text);
    font-weight: 600;
    font-size: 14px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="time"],
input[type="number"],
input[type="file"],
select,
textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    background-color: var(--white);
    color: var(--text);
    transition: var(--transition);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
    background-color: var(--white);
}

input[readonly] {
    background-color: var(--light);
    cursor: not-allowed;
}

textarea {
    resize: vertical;
    min-height: 120px;
}

/* ========================================
   BOUTONS
   ======================================== */
button,
.btn,
input[type="submit"],
.btn-submit,
.btn-primary,
.btn-success,
.btn-danger,
.btn-secondary,
.btn-warning {
    padding: 11px 22px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-block;
    text-decoration: none;
    text-align: center;
    white-space: nowrap;
}

button:disabled,
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Bouton primaire */
button,
.btn-primary,
input[type="submit"],
.btn-submit {
    background-color: var(--accent);
    color: var(--white);
}

button:hover,
.btn-primary:hover,
input[type="submit"]:hover,
.btn-submit:hover {
    background-color: var(--accent-dark);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
    transform: translateY(-2px);
}

/* Bouton succès */
.btn-success {
    background-color: var(--success);
    color: var(--white);
}

.btn-success:hover {
    background-color: #229954;
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
    transform: translateY(-2px);
}

/* Bouton danger */
.btn-danger {
    background-color: var(--danger);
    color: var(--white);
}

.btn-danger:hover {
    background-color: #c0392b;
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
    transform: translateY(-2px);
}

/* Bouton secondaire */
.btn-secondary {
    background-color: var(--gray);
    color: var(--white);
}

.btn-secondary:hover {
    background-color: var(--gray-dark);
    transform: translateY(-2px);
}

/* Bouton warning */
.btn-warning {
    background-color: var(--warning);
    color: var(--white);
}

.btn-warning:hover {
    background-color: #d68910;
    transform: translateY(-2px);
}

/* ========================================
   TABLES
   ======================================== */
table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    margin: 20px 0;
}

thead {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: var(--white);
}

th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

td {
    padding: 13px 15px;
    border-bottom: 1px solid var(--light);
    color: var(--text);
    font-size: 14px;
}

tbody tr {
    transition: var(--transition);
}

tbody tr:hover {
    background-color: var(--bg);
}

tbody tr:last-child td {
    border-bottom: none;
}

/* ========================================
   ALERTES
   ======================================== */
.alert {
    padding: 15px 20px;
    margin: 20px 0;
    border-radius: var(--radius);
    border-left: 4px solid;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-success {
    background-color: #d5f4e6;
    color: #155724;
    border-left-color: var(--success);
}

.alert-danger, .alert-error {
    background-color: #fadbd8;
    color: #721c24;
    border-left-color: var(--danger);
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border-left-color: var(--warning);
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border-left-color: var(--accent);
}

/* ========================================
   BADGES
   ======================================== */
.badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background-color: #d5f4e6;
    color: #155724;
}

.badge-danger {
    background-color: #fadbd8;
    color: #721c24;
}

.badge-warning {
    background-color: #fff3cd;
    color: #856404;
}

.badge-primary {
    background-color: #d6eaf8;
    color: #1a3a52;
}

/* ========================================
   MODALES
   ======================================== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--white);
    padding: 30px;
    border-radius: var(--radius);
    width: 90%;
    max-width: 600px;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--light);
    padding-bottom: 15px;
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--gray);
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--danger);
}

.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 25px;
    padding-top: 15px;
    border-top: 1px solid var(--light);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ========================================
   RECHERCHE
   ======================================== */
.search-container {
    background: var(--white);
    padding: 25px;
    border-radius: var(--radius);
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

.search-input {
    position: relative;
}

.search-input input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--light);
    border-radius: var(--radius);
    font-size: 15px;
    transition: var(--transition);
}

.search-input input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.suggestions, .dropdown-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: var(--shadow);
    margin-top: -2px;
    display: none;
}

.suggestions.active, .dropdown-list.active {
    display: block;
}

.suggestion-item, .dropdown-item {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid var(--light);
    transition: var(--transition);
    font-size: 14px;
}

.suggestion-item:hover, .dropdown-item:hover {
    background-color: var(--bg);
    color: var(--accent);
    padding-left: 20px;
}

.suggestion-item:last-child, .dropdown-item:last-child {
    border-bottom: none;
}

/* ========================================
   UTILITAIRES
   ======================================== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.p-0 { padding: 0; }
.p-1 { padding: 8px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }
.p-4 { padding: 32px; }

.d-flex { display: flex; }
.d-inline-block { display: inline-block; }
.d-block { display: block; }
.d-none { display: none; }

.flex-wrap { flex-wrap: wrap; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.align-center { align-items: center; }

.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }

.rounded { border-radius: var(--radius); }
.shadow { box-shadow: var(--shadow); }

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    .navbar {
        flex-wrap: wrap;
        height: auto;
        padding: 10px;
    }

    .navbar a {
        padding: 10px 12px;
        font-size: 13px;
    }

    .navbar .user-info {
        width: 100%;
        margin-top: 10px;
        flex-wrap: wrap;
    }

    .modal-content {
        width: 95%;
        padding: 20px;
    }

    .container, .content {
        padding: 15px;
    }

    table {
        font-size: 12px;
    }

    th, td {
        padding: 10px;
    }

    h1 { font-size: 24px; }
    h2 { font-size: 20px; }
    h3 { font-size: 18px; }
}

@media (max-width: 480px) {
    h1 { font-size: 20px; }
    h2 { font-size: 18px; }
    h3 { font-size: 16px; }

    button, .btn {
        width: 100%;
    }

    .navbar a {
        padding: 8px 10px;
        font-size: 12px;
    }
}