/* ============================================
   VARIABLES ET RÉINITIALISATION GLOBALES
   ============================================ */

:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --primary-light: #3b82f6;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #0ea5e9;
    --dark-bg: #0f172a;
    --light-bg: #f8fafc;
    --border-color: #e2e8f0;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --transition: all 0.3s ease;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--light-bg);
    color: var(--text-primary);
    line-height: 1.6;
}

/* ============================================
   AUTHENTIFICATION
   ============================================ */

.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    padding: 20px;
}

.auth-box {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 450px;
    padding: 40px 30px;
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header h1 {
    color: var(--primary-color);
    font-size: 28px;
    margin-bottom: 8px;
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Tabs */
.tabs {
    display: flex;
    margin-bottom: 25px;
    border-bottom: 2px solid var(--border-color);
    gap: 10px;
}

.tab-btn {
    flex: 1;
    padding: 12px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: var(--transition);
    margin-bottom: -2px;
}

.tab-btn:hover {
    color: var(--primary-color);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ============================================
   FORMULAIRES
   ============================================ */

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
    background-color: white;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group textarea {
    resize: vertical;
}

.error {
    display: block;
    color: var(--danger-color);
    font-size: 12px;
    margin-top: 5px;
}

.form-container {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 25px;
}

/* ============================================
   BOUTONS
   ============================================ */

.btn,
.btn-small {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    text-align: center;
}

.btn-small {
    padding: 8px 12px;
    font-size: 12px;
    margin-right: 5px;
}

.btn-primary,
.btn-small.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover,
.btn-small.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary,
.btn-small.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover,
.btn-small.btn-secondary:hover {
    background-color: #475569;
}

.btn-danger,
.btn-small.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover,
.btn-small.btn-danger:hover {
    background-color: #dc2626;
}

.btn-logout {
    background-color: var(--danger-color);
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    text-decoration: none;
}

.btn-logout:hover {
    background-color: #dc2626;
}

/* ============================================
   NAVBAR
   ============================================ */

.navbar {
    background: white;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border-color);
}

.navbar-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.navbar-brand h2 {
    color: var(--primary-color);
    font-size: 20px;
    margin: 0;
}

.navbar-menu {
    list-style: none;
    display: flex;
    gap: 30px;
    flex: 1;
    margin: 0 50px;
}

.navbar-menu a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    transition: var(--transition);
    font-size: 14px;
}

.navbar-menu a:hover {
    color: var(--primary-color);
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 14px;
}

@media (max-width: 768px) {
    .navbar-menu {
        flex-direction: column;
        gap: 10px;
        margin: 0;
    }

    .navbar-container {
        flex-direction: column;
        height: auto;
        padding: 15px 20px;
    }
}

/* ============================================
   CONTENEUR ET LAYOUT
   ============================================ */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.page-header h1 {
    font-size: 28px;
    color: var(--text-primary);
    margin: 0;
}

.page-header p {
    color: var(--text-secondary);
    margin: 5px 0 0 0;
}

/* ============================================
   ALERTES
   ============================================ */

.alert {
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
    border-left: 4px solid var(--success-color);
}

.alert-danger {
    background-color: #fee2e2;
    color: #991b1b;
    border-left: 4px solid var(--danger-color);
}

.alert-warning {
    background-color: #fef3c7;
    color: #92400e;
    border-left: 4px solid var(--warning-color);
}

.alert-info {
    background-color: #cffafe;
    color: #164e63;
    border-left: 4px solid var(--info-color);
}

/* ============================================
   TABLEAU
   ============================================ */

.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.table thead {
    background-color: var(--light-bg);
    border-bottom: 2px solid var(--border-color);
}

.table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.table td {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}

.table tbody tr:hover {
    background-color: #f8fafc;
}

.table tbody 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-ouvert {
    background-color: #dbeafe;
    color: #1e40af;
}

.badge-en_cours {
    background-color: #fed7aa;
    color: #92400e;
}

.badge-fermé {
    background-color: #dcfce7;
    color: #166534;
}

.badge-basse {
    background-color: #dbeafe;
    color: #1e40af;
}

.badge-normal {
    background-color: #e0e7ff;
    color: #3730a3;
}

.badge-haute {
    background-color: #fecaca;
    color: #991b1b;
}

.badge-urgente {
    background-color: #fed7aa;
    color: #92400e;
}

/* ============================================
   DASHBOARD
   ============================================ */

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.dashboard-card {
    background: white;
    border-radius: 8px;
    padding: 25px;
    box-shadow: var(--shadow-md);
    text-decoration: none;
    color: var(--text-primary);
    transition: var(--transition);
    border-top: 4px solid var(--primary-color);
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.card-icon {
    font-size: 40px;
    margin-bottom: 15px;
}

.dashboard-card h3 {
    font-size: 18px;
    margin-bottom: 8px;
}

.dashboard-card p {
    color: var(--text-secondary);
    font-size: 14px;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.stat-card {
    background: white;
    border-radius: 8px;
    padding: 25px;
    box-shadow: var(--shadow-md);
    text-align: center;
}

.stat-card h4 {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 15px;
}

.stat-number {
    font-size: 36px;
    font-weight: 700;
    color: var(--primary-color);
}

/* ============================================
   BARRE DE RECHERCHE
   ============================================ */

.search-bar {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-md);
}

.search-bar form {
    display: flex;
    gap: 10px;
}

.search-bar input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
}

.search-bar input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* ============================================
   RESPONSIVITÉ
   ============================================ */

@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .page-header h1 {
        font-size: 24px;
    }

    .table {
        font-size: 12px;
    }

    .table th,
    .table td {
        padding: 10px;
    }

    .form-actions {
        flex-direction: column;
    }

    .btn,
    .btn-small {
        width: 100%;
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dashboard-card,
.stat-card,
.alert {
    animation: slideIn 0.3s ease;
}

/* ============================================
   UTILITAIRES
   ============================================ */

.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.text-center { text-align: center; }
.text-muted { color: var(--text-secondary); }
