* { box-sizing: border-box; }
html { min-height: 100%; }
body {
    font-family: -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    background-color: #f4f5f7;
    background-image: url('assets/logo-watermark.png');
    background-repeat: no-repeat;
    background-position: center top;
    background-size: 100% 100%;
    background-attachment: fixed;
    color: #1f2430;
    margin: 0;
    min-height: 100vh;
}
input, select, button, textarea { font-family: inherit; font-size: 16px; }
table.num, .num { text-align: right; }
th.num { text-align: right; }
.menu {
    background: #1f2430;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}
.menu-logo { height: 40px; width: auto; display: block; margin-right: 6px; }
.menu a:has(.menu-logo) { text-decoration: none !important; }
.menu a {
    color: #e7e9ee;
    text-decoration: none;
    font-size: 14px;
    padding: 6px 4px;
    border-radius: 6px;
}
.menu a:hover { text-decoration: underline; }
.menu a.menu-actif {
    background: #fff;
    color: #1f2430;
    text-decoration: none;
    padding: 6px 12px;
    font-weight: 600;
}
.menu a.menu-actif:hover { text-decoration: none; }
.menu .deconnexion { margin-left: 0; color: #f2a9a9; }
.menu .utilisateur-connecte { margin-left: auto; color: #b7bccb; font-size: 13px; align-self: center; }

.conteneur {
    max-width: 560px;
    margin: 40px auto;
    padding: 0 20px;
}
.conteneur-large { max-width: 1320px; }
td, th { white-space: nowrap; }
td.texte-libre { white-space: normal; }
.tableau-defilant { overflow-x: auto; }

.conteneur-login {
    max-width: 340px;
    margin: 80px auto;
    padding: 30px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    text-align: center;
}

h1 { font-size: 22px; margin-bottom: 6px; }
h2 { font-size: 16px; margin-top: 28px; }

.carte {
    background: #fff;
    padding: 22px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    display: flex;
    flex-direction: column;
    gap: 10px;
}
label { font-size: 13px; font-weight: 600; color: #4a4f5c; margin-top: 6px; }
input[type=text], input[type=number], input[type=password] {
    padding: 10px 12px;
    font-size: 16px;
    border: 1px solid #d6d9e0;
    border-radius: 6px;
    width: 100%;
}
button {
    margin-top: 14px;
    padding: 12px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    background: #2f6feb;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}
button:hover { background: #2559c2; }

.toggle-type { display: flex; gap: 12px; margin-bottom: 4px; }
.toggle-type button {
    flex: 1;
    margin-top: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 14px;
    font-size: 15px;
    font-weight: 600;
    background: #f0f1f4;
    color: #565c6b;
    border: 2px solid transparent;
    border-radius: 10px;
    transition: background 0.15s ease, box-shadow 0.15s ease, color 0.15s ease, transform 0.1s ease;
}
.toggle-type button svg { width: 22px; height: 22px; flex-shrink: 0; }
.toggle-type button.toggle-actif {
    background: linear-gradient(135deg, #3b7cf5, #2555d6);
    color: #fff;
    box-shadow: 0 6px 16px rgba(47, 111, 235, 0.32);
}
.toggle-type button:hover:not(.toggle-actif) { background: #e4e6ec; }
.toggle-type button:active { transform: scale(0.98); }

.ligne-double { display: flex; gap: 16px; }
.ligne-double > div { flex: 1; }

.succes { background: #e3f6e8; color: #1a7a37; padding: 10px 14px; border-radius: 6px; }
.erreur { background: #fdeaea; color: #c62828; padding: 10px 14px; border-radius: 6px; }
.info { background: #eaf1fd; color: #22509e; padding: 10px 14px; border-radius: 6px; }
.aide { color: #6a6f7b; font-size: 13px; margin-top: 16px; }

.barre-actions { display: flex; justify-content: space-between; align-items: center; margin: 18px 0; gap: 12px; flex-wrap: wrap; }
.recherche { display: flex; gap: 8px; }
.recherche input { width: 320px; }
.bouton {
    background: linear-gradient(135deg, #3b7cf5, #2555d6); color: #fff; text-decoration: none;
    padding: 10px 16px; border-radius: 8px; font-weight: 600; font-size: 14px;
    white-space: nowrap; display: inline-flex; align-items: center; height: 42px;
    box-sizing: border-box; box-shadow: 0 3px 10px rgba(47, 111, 235, 0.28);
    transition: transform 0.1s ease, box-shadow 0.15s ease;
}
.bouton:hover { box-shadow: 0 5px 14px rgba(47, 111, 235, 0.38); }
.bouton:active { transform: scale(0.98); }
.bouton-secondaire { background: #eceef1; color: #1f2430; }
.bouton-secondaire:hover { background: #dfe2e8; }

.ligne-inline { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.ligne-inline > div { display: flex; flex-direction: column; gap: 4px; }
.ligne-inline input[type=text], .ligne-inline input[type=date], .ligne-inline input[type=number] {
    height: 42px; padding: 0 12px; margin: 0;
}
.ligne-inline button { margin-top: 0; height: 42px; padding: 0 16px; }
.ligne-inline select { height: 42px; padding: 0 10px; margin: 0; }

table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #eceef1; font-size: 14px; }
th { background: #f0f1f4; font-size: 12px; text-transform: uppercase; color: #5a5f6b; }
tr.alerte { background: #fff6e0; }

.cartes-total { display: flex; gap: 16px; margin: 18px 0 26px; flex-wrap: wrap; }
.carte-total {
    background: #fff; padding: 18px 22px; border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06); flex: 1; min-width: 200px;
    text-align: center;
}
.carte-total h2 { margin-top: 0; font-size: 13px; color: #6a6f7b; text-transform: uppercase; text-align: center; }
.montant { margin: 4px 0; }
.ligne-montant {
    display: flex; justify-content: space-between; align-items: baseline;
    max-width: 190px; margin: 6px auto; font-size: 15px; color: #4a4f5c;
}
.ligne-montant strong { text-align: right; font-size: 16px; color: #1f2430; }

.pagination { display: flex; gap: 6px; margin-top: 16px; align-items: center; }
.pagination a { padding: 6px 10px; background: #fff; border-radius: 4px; text-decoration: none; color: #1f2430; }
.pagination a.page-active { background: #2f6feb; color: #fff; }
.pagination .page-info { padding: 6px 10px; color: #4a4f5c; font-size: 14px; }

.banniere-volee {
    padding: 16px 20px;
    border-radius: 8px;
    font-size: 17px;
    font-weight: 700;
    margin: 16px 0;
}
.banniere-succes { background: #1a7a37; color: #fff; }
.banniere-erreur { background: #c62828; color: #fff; }

/* ==== Adaptation mobile / petits écrans ==== */
@media (max-width: 780px) {
    .menu { padding: 8px 12px; gap: 8px 14px; }
    .menu-logo { height: 30px; }
    .menu a { font-size: 13px; padding: 6px 8px; }
    .menu .utilisateur-connecte { width: 100%; margin-left: 0; order: 10; }

    .conteneur { margin: 16px auto; padding: 0 14px; }
    .conteneur-large { max-width: 100%; }
    .conteneur-login { margin: 40px auto; padding: 22px; max-width: 90%; }

    h1 { font-size: 19px; }
    h2 { font-size: 15px; }

    .barre-actions { flex-direction: column; align-items: stretch; }
    .recherche { flex-direction: column; }
    .recherche input { width: 100%; }

    .ligne-inline { flex-direction: column; align-items: stretch; }
    .ligne-inline > div { width: 100%; }
    .ligne-inline input, .ligne-inline select, .ligne-inline button { width: 100%; }

    .ligne-double { flex-direction: column; gap: 0; }

    .toggle-type { flex-direction: column; }

    .cartes-total { flex-direction: column; }
    .carte-total { min-width: 0; }

    table { font-size: 13px; }
    th, td { padding: 8px; }

    .bouton, button { width: 100%; justify-content: center; }
}
