/* Gestion MarocLIS : sobre, lisible, sans dépendance. */
:root {
    --accent: #0b6e79;
    --accent-fonce: #08525a;
    --encre: #14212b;
    --gris: #51606b;
    --trait: #d5dde2;
    --fond: #f5f7f8;
    --carte: #ffffff;
    --ok: #1f7a3a;
    --ok-fond: #e7f4ea;
    --alerte: #a1361f;
    --alerte-fond: #fbeae6;
    --attention: #8a5a00;
    --attention-fond: #fdf3dc;
    color-scheme: light;
}

* { box-sizing: border-box; }
html { font-size: 15px; }
body {
    margin: 0;
    font-family: "Segoe UI", Carlito, Calibri, system-ui, -apple-system, sans-serif;
    color: var(--encre);
    background: var(--fond);
    line-height: 1.45;
}

.barre {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: .6rem 1.25rem;
    background: var(--carte);
    border-bottom: 1px solid var(--trait);
    flex-wrap: wrap;
}
.marque { font-weight: 700; color: var(--accent); text-decoration: none; font-size: 1.15rem; }
.marque span { color: var(--gris); font-weight: 400; }
.barre nav { display: flex; gap: .25rem; flex-wrap: wrap; flex: 1; }
.barre nav a {
    color: var(--encre); text-decoration: none; padding: .35rem .7rem; border-radius: 6px;
}
.barre nav a:hover { background: var(--fond); }
.barre nav a.actif { background: var(--accent); color: #fff; }
.deconnexion { margin: 0; }

main { max-width: 1280px; margin: 0 auto; padding: 1.25rem; }
main.etroit { max-width: 460px; padding-top: 3rem; }

h1 { font-size: 1.4rem; margin: 0 0 1rem; }
h2 { font-size: 1.1rem; margin: 1.5rem 0 .6rem; }
h3 { font-size: 1rem; margin: 1rem 0 .4rem; }

.carte {
    background: var(--carte); border: 1px solid var(--trait); border-radius: 8px; padding: 1rem 1.25rem;
}
.carte + .carte { margin-top: 1rem; }
.entete { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.entete h1 { margin: 0; }

.deux { display: grid; grid-template-columns: minmax(0, 3fr) minmax(320px, 2fr); gap: 1rem; align-items: start; }
@media (max-width: 960px) { .deux { grid-template-columns: 1fr; } }

table { width: 100%; border-collapse: collapse; background: var(--carte); }
th, td { text-align: left; padding: .45rem .6rem; border-bottom: 1px solid var(--trait); vertical-align: top; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--gris); font-weight: 600; background: #fafbfc; }
td.nombre, th.nombre { text-align: right; white-space: nowrap; }
tr.choisi td { background: #e9f3f4; }
tr.cliquable td a.ligne { color: inherit; text-decoration: none; display: block; }
.tableau { border: 1px solid var(--trait); border-radius: 8px; overflow-x: auto; }
.tableau table { border: 0; }
.vide { color: var(--gris); font-style: italic; padding: 1rem; }

.pastille {
    display: inline-block; padding: .05rem .5rem; border-radius: 999px; font-size: .8rem; font-weight: 600;
    background: var(--fond); color: var(--gris); border: 1px solid var(--trait); white-space: nowrap;
}
.pastille.nouveau, .pastille.actif { background: var(--attention-fond); color: var(--attention); border-color: #f0dca9; }
.pastille.traite, .pastille.envoye { background: var(--ok-fond); color: var(--ok); border-color: #bfe0c8; }
.pastille.actif { background: var(--ok-fond); color: var(--ok); border-color: #bfe0c8; }
.pastille.coupe, .pastille.echec { background: var(--alerte-fond); color: var(--alerte); border-color: #f0c5bb; }

dl.fiche { display: grid; grid-template-columns: 9rem 1fr; gap: .3rem .8rem; margin: 0; }
dl.fiche dt { color: var(--gris); }
dl.fiche dd { margin: 0; overflow-wrap: anywhere; }
.besoin { white-space: pre-wrap; background: var(--fond); border-radius: 6px; padding: .6rem .8rem; margin: .5rem 0 0; }

form.pile { display: grid; gap: .8rem; }
label { display: grid; gap: .25rem; font-weight: 600; font-size: .9rem; }
label.case { display: flex; gap: .5rem; align-items: center; font-weight: 400; }
input[type=text], input[type=password], input[type=email], input[type=number], input:not([type]), select, textarea {
    font: inherit; padding: .45rem .6rem; border: 1px solid #b9c5cc; border-radius: 6px; background: #fff; color: var(--encre); width: 100%;
}
textarea { min-height: 8rem; resize: vertical; }
textarea.long { min-height: 22rem; font-family: ui-monospace, Consolas, monospace; font-size: .9rem; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
input.court { width: 6rem; }
.aide { color: var(--gris); font-size: .85rem; font-weight: 400; }

button, .bouton {
    font: inherit; font-weight: 600; cursor: pointer; border-radius: 6px; padding: .45rem .9rem;
    border: 1px solid var(--accent); background: var(--accent); color: #fff; text-decoration: none; display: inline-block;
}
button:hover, .bouton:hover { background: var(--accent-fonce); }
button.second, .bouton.second { background: #fff; color: var(--accent); }
button.second:hover, .bouton.second:hover { background: #eef6f7; }
button.danger { background: #fff; color: var(--alerte); border-color: var(--alerte); }
button.danger:hover { background: var(--alerte-fond); }
button.lien { background: none; border: 0; color: var(--gris); padding: .3rem; font-weight: 400; }
button.lien:hover { color: var(--encre); background: none; }
button.petit, .bouton.petit { padding: .2rem .55rem; font-size: .85rem; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.actions form { margin: 0; }

.note { padding: .6rem .9rem; border-radius: 6px; margin: 0 0 1rem; border: 1px solid; }
.note.ok { background: var(--ok-fond); color: var(--ok); border-color: #bfe0c8; }
.note.erreur { background: var(--alerte-fond); color: var(--alerte); border-color: #f0c5bb; }
.note.info { background: #eef6f7; color: var(--accent-fonce); border-color: #c6e0e3; }
.note.attention { background: var(--attention-fond); color: var(--attention); border-color: #f0dca9; }

.codes { columns: 2; font-family: ui-monospace, Consolas, monospace; font-size: 1.05rem; padding-left: 1.5rem; }
.secret { font-family: ui-monospace, Consolas, monospace; font-size: 1.05rem; letter-spacing: .05em; word-break: break-all; }
.qr { width: 220px; height: 220px; image-rendering: pixelated; border: 1px solid var(--trait); border-radius: 6px; }
code, .mono { font-family: ui-monospace, Consolas, monospace; }
.duree { display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; }
.duree label { font-weight: 400; }
.total { font-size: 1.1rem; font-weight: 700; }
.discret { color: var(--gris); }
.cache { display: none; }
.sans-marge { margin: 0; }

.deux > .carte + .carte { margin-top: 0; }
.carte > h2:first-child, .carte > form > h2:first-child { margin-top: 0; }
input, select, textarea { font-weight: 400; }
