/* --- Variables de design --- */
:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --danger: #ef4444;
    --success: #22c55e;
    --border-radius: 12px;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

/* --- Base --- */
body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    margin: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

h2 {
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 1.5rem;
}

/* --- Conteneur & Formulaires --- */
form {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 450px;
    margin-bottom: 2rem;
    border: 1px solid #e2e8f0;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

input[type="text"],
input[type="password"],
input[type="date"] {
    width: 100%;
    padding: 0.75rem;
    margin-bottom: 1.25rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    box-sizing: border-box; /* Évite que l'input dépasse */
    transition: border-color 0.2s;
}

input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* --- Boutons --- */
input[type="submit"] {
    width: 100%;
    background-color: var(--primary-color);
    color: white;
    padding: 0.75rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

input[type="submit"]:hover {
    background-color: var(--primary-hover);
}

/* --- Tableaux (Index.php) --- */
table {
    width: 100%;
    max-width: 900px;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--card-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-top: 1rem;
}

th {
    background-color: #f1f5f9;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    padding: 1rem;
    text-align: left;
}

td {
    padding: 1rem;
    border-bottom: 1px solid #f1f5f9;
}

tr:last-child td {
    border-bottom: none;
}

/* --- Liens & Actions --- */
a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

a:hover {
    text-decoration: underline;
}

.deconnexion-link {
    margin-top: 2rem;
    color: var(--danger);
    font-size: 0.9rem;
}

/* --- Alertes --- */
.error-msg {
    color: var(--danger);
    background: #fef2f2;
    padding: 0.5rem;
    border-radius: 6px;
    margin-top: 10px;
    text-align: center;
}

.btn-deconnexion {
    margin-top: 2rem;
    display: inline-block;
    background-color: var(--danger);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

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