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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f0f2f5;
    color: #333;
}

/* LOGIN */
.login-container {
    max-width: 400px;
    margin: 100px auto;
    background: #fff;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}
.login-container h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 30px;
    font-size: 24px;
}
.login-container input {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 15px;
}
.login-container button {
    width: 100%;
    padding: 12px;
    background: #3498db;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s;
}
.login-container button:hover { background: #2980b9; }
.login-error { color: #e74c3c; text-align: center; margin-top: 10px; }

/* LAYOUT */
.topbar {
    background: #2c3e50;
    color: #fff;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.topbar h1 { font-size: 20px; }
.topbar .user-info { display: flex; align-items: center; gap: 15px; }
.topbar button {
    background: #e74c3c;
    color: #fff;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
}
.layout { display: flex; min-height: calc(100vh - 60px); }
.sidebar { width: 220px; background: #34495e; padding: 20px 0; }
.sidebar a {
    display: block;
    color: #ecf0f1;
    text-decoration: none;
    padding: 12px 25px;
    transition: background 0.2s;
}
.sidebar a:hover, .sidebar a.active {
    background: #3498db;
    border-left: 4px solid #fff;
}
.content { flex: 1; padding: 30px; }
h2 { color: #2c3e50; margin-bottom: 20px; }

/* CARDS */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin-bottom: 30px; }
.card {
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.card h3 { font-size: 14px; color: #7f8c8d; text-transform: uppercase; margin-bottom: 10px; }
.card .value { font-size: 28px; font-weight: bold; color: #2c3e50; }

/* TABLES */
table {
    width: 100%;
    background: #fff;
    border-collapse: collapse;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
table th, table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}
table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #555;
    font-size: 13px;
    text-transform: uppercase;
}
table tr:hover { background: #f8f9fa; }

/* BADGES */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}
.badge-depart { background: #fff3cd; color: #856404; }
.badge-arrivee { background: #cce5ff; color: #004085; }
.badge-fin_mission { background: #d4edda; color: #155724; }
.badge-retour { background: #d1ecf1; color: #0c5460; }
.badge-actif { background: #d4edda; color: #155724; }
.badge-inactif { background: #f8d7da; color: #721c24; }

/* BOUTONS */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: opacity 0.2s;
}
.btn:hover { opacity: 0.85; }
.btn-primary { background: #3498db; color: #fff; }
.btn-success { background: #27ae60; color: #fff; }
.btn-warning { background: #f39c12; color: #fff; }
.btn-danger { background: #e74c3c; color: #fff; }
.btn-secondary { background: #95a5a6; color: #fff; }
.btn-sm { padding: 5px 10px; font-size: 12px; }

/* FORMULAIRES */
.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 5px; font-weight: 600; font-size: 14px; color: #555; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }

/* MODALE */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.modal {
    background: #fff;
    padding: 30px;
    border-radius: 10px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}
.modal h3 { margin-bottom: 20px; color: #2c3e50; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* ÉTAPES MISSION */
.steps-bar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    background: #fff;
    padding: 20px;
    border-radius: 10px;
}
.step {
    flex: 1;
    text-align: center;
    padding: 10px;
    color: #bbb;
    font-weight: 600;
    position: relative;
}
.step.active { color: #3498db; }
.step.done { color: #27ae60; }
.step::after {
    content: '→';
    position: absolute;
    right: -5px;
    top: 50%;
    transform: translateY(-50%);
    color: #ddd;
}
.step:last-child::after { content: ''; }

/* ✅ Lien "Nouvelle mission ouverte" dans la barre d'étapes */
.steps-bar a.step-lien {
    text-decoration: none;
    color: #27ae60;
    cursor: pointer;
    transition: background 0.2s;
    border-radius: 6px;
}
.steps-bar a.step-lien:hover {
    background: #d4edda;
}
.steps-bar a.step-lien::after {
    content: '';
}

.recap {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    border-left: 4px solid #3498db;
}
.recap h4 { color: #2c3e50; margin-bottom: 10px; }
.recap p { margin: 5px 0; font-size: 14px; color: #555; }

.info-banner {
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 600;
}
.info-banner.green { background: #d4edda; color: #155724; }
.info-banner.orange { background: #fff3cd; color: #856404; }
.info-banner.red { background: #f8d7da; color: #721c24; }

/* ALERTES */
.alert-item {
    background: #fff3cd;
    border-left: 4px solid #f39c12;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 10px;
}
.alert-item.danger { background: #f8d7da; border-left-color: #e74c3c; }

/* RESPONSIVE */
@media (max-width: 768px) {
    .layout { flex-direction: column; }
    .sidebar { width: 100%; display: flex; overflow-x: auto; }
    .sidebar a { white-space: nowrap; }
    .form-row { grid-template-columns: 1fr; }
}
/* ============================================================
   Page Paramètres - Grille côte à côte
   ============================================================ */

.parametres-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;   /* 2 colonnes égales */
    gap: 20px;
    align-items: start;
}

/* Responsive : sur mobile, on empile */
@media (max-width: 900px) {
    .parametres-grid {
        grid-template-columns: 1fr;
    }
}

.parametres-grid .recap {
    margin: 0;
    height: 100%;
}

.parametres-grid h4 {
    border-bottom: 2px solid #ecf0f1;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.parametres-grid h5 {
    font-size: 15px;
    margin-bottom: 10px;
}