:root {
    --primary: #2b6cb0;
    --primary-light: #3182ce;
    --bg: #f8f9fa;
    --text: #222;
    --border: #ddd;
    --radius: 8px;
    --padding: 10px;
    --transition: 0.2s ease-in-out;
    --font: "Inter", "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    padding: 1rem;
}

h1, h2, h3 {
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

nav {
    background: white;
    border-radius: var(--radius);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    padding: 0.5rem;
    margin-bottom: 1rem;
}

ul, ol {
    list-style: none;        /* Supprime les puces */
    padding-left: 1rem;      /* Décalage léger vers la droite */
    margin: 0.5rem 0;        /* Espacement vertical doux */
}

nav ul {
    display: flex;
    justify-content: space-around;
    list-style: none;
    flex-wrap: wrap;
}

nav a {
    text-decoration: none;
    color: var(--primary);
    font-weight: 500;
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius);
    transition: background var(--transition);
}

nav a:hover {
    background: var(--primary-light);
    color: white;
}

button {
    background: var(--primary);
    color: white;
    font-size: 1rem;
    border: none;
    border-radius: var(--radius);
    padding: 0.8rem;
    cursor: pointer;
    transition: background var(--transition);
}

button:hover {
    background: var(--primary-light);
}

footer {
    text-align: center;
    margin-top: 2rem;
    font-size: 0.85rem;
    color: #555;
}

form {
    background: white;
    padding: 1rem;
    border-radius: var(--radius);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    gap: 0.8rem;
}

#form-saisie > p {
    text-align: center;
}

label {
    font-weight: 600;
}

#div-saisie {
    display: flex;
    justify-content: space-evenly;
}

input, select {
    padding: 0.6rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    font-size: 1rem;
    width: 100%;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(49,130,206,0.2);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    margin-top: 1rem;
    font-size: 0.95rem;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

th, td {
    padding: 0.7rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

th {
    background: var(--primary);
    color: white;
    text-transform: uppercase;
    font-size: 0.8rem;
}

tr:hover {
    background: #f1f5f9;
}

.td-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    width: 100%;
}

.td-actions form {
    flex: 1;
    display: flex;
}

.btn-action {
    flex: 1;
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    font-size: 0.9rem;
    text-align: center;
    border: none;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-delete {
    background-color: #e25050;
    color: white;
}
.btn-delete:hover {
    background-color: #b91c1c;
}

.btn-edit {
    background-color: #2563eb;
    color: white;
}
.btn-edit:hover {
    background-color: #1d4ed8;
}

#form-creation > form > * {
    margin: 0.5em 0;
}

#login-section {
    margin-top: 2rem;
    max-width: 450px;
    background: #ffffff;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

#login-section h2 {
    margin-bottom: 1rem;
    color: #1e3a8a;
}

#login-section form {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    background: #f9fafb;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

#login-section input[type="password"] {
    flex: 1;
    padding: 0.5rem 0.7rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#login-section input[type="password"]:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25);
}

#login-section button {
    background-color: #2563eb;
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

#login-section button:hover {
    background-color: #1e40af;
}

#login-section .login-status {
    color: green;
    font-weight: 600;
    margin-bottom: 0.8rem;
}

.nav-row {
    width: fit-content;
    margin: auto;
    display: flex;
    gap: 1rem;
}

#nav-resultats > h3 {
    text-align: center;
}

h3 {
    margin-top: 1rem;
}

.to-top {
    text-decoration: none;
    color: #0078d7;
    font-weight: bold;
    margin-right: 0.5rem;
    font-size: 1.2rem;
    transition: color 0.2s ease;
}

.to-top:hover {
    color: #005bb5;
}

@media print {
    /* --- layout desktop portrait déjà en place --- */

    /* === Forcer le retour à un vrai tableau === */
    table, thead, tbody, tr, th, td {
        display: table !important;
        width: auto !important;
        border-collapse: collapse !important;
    }

    tr {
        page-break-inside: avoid !important;
    }

    td, th {
        display: table-cell !important;
        vertical-align: middle !important;
        padding: 4px 6px !important;
        border: 1px solid #000 !important;
    }

    /* === Supprime définitivement le mode "mobile" === */
    td[data-label]::before {
        content: none !important;
    }

    /* Format portrait propre */
    @page {
        size: A4 portrait;
        margin: 10mm;
    }
}