/* Importation d'une belle police */
@import url('https://fonts.googleapis.com/css2?family=Segoe+UI:wght@400;600;700&display=swap');

* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    font-family: 'Segoe UI', Arial, sans-serif; 
}

body { 
    background: #f3f4f6; 
    color: #1f2937; 
}

/* ===== ÉCRAN DE CONNEXION ===== */
#loginScreen { 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    height: 100vh; 
    background: linear-gradient(135deg, #1e40af, #3b82f6); 
}

.login-box { 
    background: white; 
    padding: 40px; 
    border-radius: 16px; 
    width: 400px; 
    box-shadow: 0 20px 40px rgba(0,0,0,0.2); 
}

.login-box h1 { 
    color: #1e40af; 
    font-size: 24px; 
    text-align: center; 
    margin-bottom: 8px; 
}

.subtitle { 
    text-align: center; 
    color: #6b7280; 
    font-size: 14px; 
    margin-bottom: 24px; 
}

.tabs { 
    display: flex; 
    gap: 8px; 
    margin-bottom: 20px; 
    background: #e5e7eb; 
    padding: 4px; 
    border-radius: 8px; 
}

.tab { 
    flex: 1; 
    padding: 10px; 
    border: none; 
    background: transparent; 
    border-radius: 6px; 
    cursor: pointer; 
    font-weight: 600; 
    color: #4b5563; 
    transition: 0.2s; 
}

.tab.active { 
    background: white; 
    color: #1e40af; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.1); 
}

.form-panel { 
    display: flex; 
    flex-direction: column; 
    gap: 12px; 
}

.form-panel.hidden { 
    display: none; /* C'est ça qui cache le formulaire d'inscription ! */
}

input, select { 
    padding: 14px; 
    border: 1px solid #d1d5db; 
    border-radius: 8px; 
    font-size: 14px; 
    outline: none; 
    transition: 0.2s; 
    background: #f9fafb;
}

input:focus, select:focus { 
    border-color: #1e40af; 
    background: white;
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.btn-primary { 
    padding: 14px; 
    background: #1e40af; 
    color: white; 
    border: none; 
    border-radius: 8px; 
    font-weight: 600; 
    cursor: pointer; 
    font-size: 15px; 
    transition: 0.2s;
    margin-top: 8px;
}

.btn-primary:hover { 
    background: #1e3a8a; 
}

.hint { 
    font-size: 12px; 
    color: #6b7280; 
    text-align: center; 
    margin-top: 16px; 
    background: #eff6ff;
    padding: 10px;
    border-radius: 6px;
}

.error { 
    color: #dc2626; 
    font-size: 13px; 
    text-align: center; 
    margin-top: 12px; 
    font-weight: 600;
}

/* ===== APPLICATION (APRÈS CONNEXION) ===== */
#appScreen { 
    display: none; 
    min-height: 100vh; 
    flex-direction: column;
}

/* On force l'affichage en flex quand on l'active via JS */
#appScreen[style*="display: block"] {
    display: flex !important;
}

header { 
    background: #1e40af; 
    color: white; 
    padding: 16px 32px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

header h1 { 
    font-size: 20px; 
    letter-spacing: 0.5px;
}

.user-info { 
    display: flex; 
    align-items: center; 
    gap: 16px; 
    font-size: 14px; 
}

.btn-logout { 
    background: rgba(255,255,255,0.15); 
    color: white; 
    border: none; 
    padding: 8px 16px; 
    border-radius: 8px; 
    cursor: pointer; 
    font-weight: 600;
    transition: 0.2s;
}

.btn-logout:hover {
    background: rgba(255,255,255,0.25);
}

nav { 
    background: white; 
    padding: 0 32px; 
    display: flex; 
    gap: 8px; 
    border-bottom: 1px solid #e5e7eb; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

nav button { 
    padding: 16px 20px; 
    border: none; 
    background: none; 
    cursor: pointer; 
    font-size: 14px; 
    font-weight: 600;
    color: #6b7280; 
    border-bottom: 3px solid transparent; 
    transition: 0.2s;
}

nav button:hover {
    color: #1e40af;
}

nav button.active { 
    color: #1e40af; 
    border-bottom-color: #1e40af; 
}

main { 
    padding: 32px; 
    max-width: 1200px; 
    margin: 0 auto; 
    width: 100%;
    flex: 1;
}

h2 { 
    color: #1e40af; 
    margin-bottom: 24px; 
    font-size: 24px;
}

/* ===== CARTES DASHBOARD ===== */
.cards { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); 
    gap: 20px; 
    margin-bottom: 32px; 
}

.card { 
    background: white; 
    padding: 24px; 
    border-radius: 12px; 
    box-shadow: 0 4px 12px rgba(0,0,0,0.05); 
    border-left: 5px solid #1e40af; 
    transition: 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.1);
}

.card .label { 
    font-size: 14px; 
    color: #6b7280; 
    font-weight: 600;
}

.card .value { 
    font-size: 32px; 
    font-weight: 700; 
    margin-top: 8px; 
    color: #1f2937;
}

/* ===== TABLEAUX ===== */
table { 
    width: 100%; 
    background: white; 
    border-radius: 12px; 
    overflow: hidden; 
    box-shadow: 0 4px 12px rgba(0,0,0,0.05); 
    border-collapse: collapse; 
    margin-top: 16px;
}

th, td { 
    padding: 16px; 
    text-align: left; 
    border-bottom: 1px solid #f3f4f6; 
    font-size: 14px; 
}

th { 
    background: #f9fafb; 
    color: #374151; 
    font-weight: 700;
}

tr:hover {
    background: #f9fafb;
}

/* ===== BADGES ===== */
.badge { 
    padding: 6px 12px; 
    border-radius: 20px; 
    font-size: 12px; 
    font-weight: 700; 
    display: inline-block;
}

.badge.pending { background: #fef3c7; color: #92400e; }
.badge.active, .badge.validated, .badge.completed { background: #d1fae5; color: #065f46; }
.badge.suspended, .badge.cancelled, .badge.rejected { background: #fee2e2; color: #991b1b; }
.badge.driver { background: #dbeafe; color: #1e40af; }
.badge.client { background: #e0e7ff; color: #4338ca; }

/* ===== BOUTONS ACTIONS ===== */
.btn-sm { 
    padding: 8px 14px; 
    border: none; 
    border-radius: 6px; 
    cursor: pointer; 
    font-size: 12px; 
    font-weight: 700; 
    margin-right: 6px; 
    transition: 0.2s;
}

.btn-sm:hover {
    opacity: 0.8;
}

.btn-validate { background: #10b981; color: white; }
.btn-reject, .btn-danger { background: #ef4444; color: white; }

/* ===== FORMULAIRES ===== */
.form-group { 
    background: white; 
    padding: 32px; 
    border-radius: 12px; 
    box-shadow: 0 4px 12px rgba(0,0,0,0.05); 
    max-width: 500px; 
}

.form-group h3 { 
    color: #1e40af; 
    margin-bottom: 20px; 
    font-size: 18px;
}

.form-group input, .form-group select { 
    width: 100%; 
    margin-bottom: 16px; 
}

.empty { 
    text-align: center; 
    padding: 60px 20px; 
    color: #9ca3af; 
    font-size: 16px;
    background: white;
    border-radius: 12px;
    border: 2px dashed #e5e7eb;
}