/* GIE HPDB — Espace adhérents — styles communs (bleu #004289, réglable dans Réglages) */
:root {
    --primary: #004289; --primary-dark: #002855; --primary-light: #E8F0FA;
    --bg: #F3F6FA; --surface: #fff; --text: #1E293B; --muted: #64748B; --border: #E2E8F0; --trait: #ECF0F5;
    --ok: #15803D; --ok-bg: #DCFCE7; --ko: #B91C1C; --ko-bg: #FEE2E2; --warn: #B45309; --warn-bg: #FEF3C7; --info-bg: #E0ECFA;
    --r: 12px; --r-el: 8px; --r-s: 6px;
    --sh: 0 1px 2px rgba(16,24,40,.04), 0 10px 30px -14px rgba(16,24,40,.18);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--bg); scrollbar-gutter: stable; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Roboto, 'Helvetica Neue', Arial, sans-serif; color: var(--text); background: var(--bg); min-height: 100vh; font-size: 15px; line-height: 1.45; }
a { color: var(--primary); }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
.ic { flex: none; vertical-align: -3px; }

/* barre du haut */
.topbar { display: flex; align-items: center; gap: 6px; padding: 0 18px; height: 56px; position: sticky; top: 0; z-index: 50; color: #fff;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); box-shadow: 0 4px 16px rgba(0,40,85,.22); }
.topbar .brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 800; font-size: 1.02rem; letter-spacing: -.01em; margin-right: 18px; white-space: nowrap; }
.topbar nav { display: flex; gap: 4px; flex: 1; }
.topbar nav a, .topbar .moi { display: inline-flex; align-items: center; gap: 7px; color: #fff; text-decoration: none; font-weight: 600; font-size: .88rem; padding: 8px 12px; border-radius: var(--r-el); opacity: .86; white-space: nowrap; }
.topbar nav a:hover, .topbar .moi:hover { background: rgba(255,255,255,.12); opacity: 1; }
.topbar nav a.on, .topbar .moi.on { background: #fff; color: var(--primary); opacity: 1; }
.topbar .moi.quit { padding: 8px 9px; }

/* page */
.wrap { max-width: 1240px; margin: 0 auto; padding: 22px 22px 48px; }
.wrap.etroit { max-width: 760px; }
.ph { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.ph h1 { font-size: 1.45rem; font-weight: 800; letter-spacing: -.015em; }
.ph p { color: var(--muted); font-size: .9rem; margin-top: 2px; }
.ph-a { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.card { background: var(--surface); border: 1px solid var(--trait); border-radius: var(--r); padding: 18px 20px; box-shadow: var(--sh); margin-bottom: 16px; }
.card h2 { font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.card h2 .ic { color: var(--primary); }
.grid { display: grid; gap: 16px; }
.grid.c2 { grid-template-columns: 1fr 1fr; } .grid.c3 { grid-template-columns: repeat(3, 1fr); } .grid.c4 { grid-template-columns: repeat(4, 1fr); }
.grid.c32 { grid-template-columns: 3fr 2fr; }
@media (max-width: 900px) { .grid.c2, .grid.c3, .grid.c4, .grid.c32 { grid-template-columns: 1fr; } }
.muted { color: var(--muted); } .small { font-size: .82rem; } .mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .86em; }
.empty { text-align: center; color: var(--muted); padding: 36px 10px; }
.empty .ic { color: #CBD5E1; display: block; margin: 0 auto 8px; }

/* tuiles de compteurs */
.tuiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tuile { --tc: var(--primary); background: var(--surface); border: 1px solid var(--trait); border-radius: var(--r); padding: 14px 16px; box-shadow: var(--sh); cursor: default; }
.tuile.clic { cursor: pointer; } .tuile.clic:hover { border-color: color-mix(in srgb, var(--tc) 40%, var(--trait)); } .tuile.on { border-color: var(--tc); background: color-mix(in srgb, var(--tc) 7%, #fff); }
.tuile .n { font-size: 1.7rem; font-weight: 800; letter-spacing: -.03em; color: var(--tc); line-height: 1.1; }
.tuile .l { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-top: 4px; }
.tuile .s { font-size: .78rem; color: var(--muted); margin-top: 6px; }
.tuile.ok { --tc: var(--ok); } .tuile.warn { --tc: var(--warn); } .tuile.ko { --tc: var(--ko); } .tuile.gris { --tc: #64748B; }
.barre { height: 7px; border-radius: 4px; background: #E8EDF3; overflow: hidden; margin-top: 8px; } .barre i { display: block; height: 100%; background: var(--tc); border-radius: 4px; }

/* formulaires */
.field { margin-bottom: 14px; }
.field label, .lbl { display: block; font-size: .8rem; font-weight: 700; color: #334155; margin-bottom: 5px; }
.field .aide { font-size: .76rem; color: var(--muted); margin-top: 4px; }
.input, .select, textarea.input { width: 100%; padding: 9px 12px; border: 1px solid #CBD5E1; border-radius: var(--r-el); background: #fff; color: var(--text); font-size: .95rem; }
textarea.input { min-height: 90px; resize: vertical; line-height: 1.45; }
.input:focus, .select:focus, textarea.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 14%, transparent); }
.input:disabled, .select:disabled { background: #F8FAFC; color: var(--muted); }
.row { display: flex; gap: 12px; } .row > * { flex: 1; min-width: 0; } .row .w1 { flex: 0 0 110px; } .row .w2 { flex: 0 0 170px; }
.mdp { position: relative; } .mdp .input { padding-right: 44px; }
.mdp .oeil { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; border: none; background: none; padding: 0; color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center; border-radius: 50%; }
.mdp .oeil:hover { color: var(--primary); background: #F1F5F9; }
.check { display: flex; align-items: center; gap: 9px; font-size: .9rem; cursor: pointer; } .check input { width: 17px; height: 17px; accent-color: var(--primary); }
.segm { display: inline-flex; background: #EEF2F7; border-radius: var(--r-el); padding: 3px; gap: 2px; }
.segm label { padding: 6px 12px; border-radius: 6px; font-size: .84rem; font-weight: 700; color: var(--muted); cursor: pointer; }
.segm input { display: none; } .segm input:checked + span, .segm label.on { background: #fff; color: var(--primary); box-shadow: 0 1px 3px rgba(15,23,42,.12); }
.segm label span { display: block; padding: 6px 12px; margin: -6px -12px; border-radius: 6px; }

/* boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid transparent; text-decoration: none; border-radius: var(--r-el); padding: 9px 15px; font-weight: 700; font-size: .88rem; cursor: pointer; background: var(--primary); color: #fff; white-space: nowrap; transition: transform .1s, opacity .2s, background .15s; }
.btn:hover { background: var(--primary-dark); } .btn:active { transform: scale(.98); } .btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.ghost { background: var(--primary-light); color: var(--primary); border-color: color-mix(in srgb, var(--primary) 28%, transparent); } .btn.ghost:hover { background: color-mix(in srgb, var(--primary) 18%, #fff); }
.btn.gris { background: #fff; color: #334155; border-color: #CBD5E1; } .btn.gris:hover { background: #F8FAFC; }
.btn.danger { background: var(--ko-bg); color: var(--ko); border-color: color-mix(in srgb, var(--ko) 30%, transparent); } .btn.danger:hover { background: #FECACA; }
.btn.ok { background: var(--ok-bg); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.btn.sm { padding: 5px 10px; font-size: .78rem; } .btn.block { width: 100%; } .btn.icone { padding: 7px; }
.lien { background: none; border: none; color: var(--primary); font-weight: 600; cursor: pointer; padding: 0; text-decoration: underline; text-underline-offset: 3px; }

/* alertes, étiquettes */
.alert { padding: 10px 14px; border-radius: var(--r-el); font-size: .88rem; font-weight: 600; margin-bottom: 14px; display: flex; gap: 9px; align-items: flex-start; }
.alert.ko { background: var(--ko-bg); color: #991B1B; } .alert.ok { background: var(--ok-bg); color: #166534; } .alert.warn { background: var(--warn-bg); color: #92400E; } .alert.info { background: var(--info-bg); color: #1E3A8A; }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: .72rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: #EEF2F7; color: #334155; white-space: nowrap; }
.chip.ok { background: var(--ok-bg); color: var(--ok); } .chip.ko { background: var(--ko-bg); color: var(--ko); } .chip.warn { background: var(--warn-bg); color: var(--warn); } .chip.bleu { background: var(--info-bg); color: var(--primary); }
.chip.code { font-family: ui-monospace, Menlo, monospace; font-size: .7rem; background: #F1F5F9; color: #475569; letter-spacing: .02em; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.point { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); margin-right: 6px; }
.point.ok { background: var(--ok); } .point.warn { background: var(--warn); } .point.ko { background: var(--ko); } .point.bleu { background: var(--primary); }

/* tableaux */
.tb { width: 100%; border-collapse: separate; border-spacing: 0; background: #fff; border: 1px solid var(--trait); border-radius: var(--r); overflow: hidden; font-size: .88rem; box-shadow: var(--sh); }
.tb th, .tb td { padding: 10px 12px; border-bottom: 1px solid var(--trait); text-align: left; vertical-align: middle; }
.tb thead th { background: #F8FAFC; font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; white-space: nowrap; }
.tb tbody tr:last-child td { border-bottom: none; }
.tb tbody tr.clic { cursor: pointer; } .tb tbody tr.clic:hover td { background: #F8FAFF; }
.tb td.r, .tb th.r { text-align: right; } .tb .nowrap { white-space: nowrap; }
.tb .act { text-align: right; white-space: nowrap; } .tb .act .btn { margin-left: 4px; }
.tb tr.fade td { color: var(--muted); }
.filtres { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.filtres .input, .filtres .select { width: auto; padding: 8px 12px; font-size: .88rem; }
.filtres .input.rech { min-width: 260px; }
.filtres .compte { margin-left: auto; color: var(--muted); font-size: .84rem; }

/* liste descriptive (fiche) */
.dl { display: grid; grid-template-columns: 140px 1fr; gap: 6px 14px; font-size: .9rem; } .dl dt { color: var(--muted); font-weight: 600; } .dl dd { font-weight: 600; }

/* modale */
.voile { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: none; align-items: center; justify-content: center; z-index: 200; padding: 16px; }
.voile.ouvert { display: flex; }
.modal { background: #fff; border-radius: var(--r); width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; padding: 22px 24px 18px; box-shadow: 0 24px 60px rgba(0,0,0,.3); }
.modal.large { max-width: 760px; }
.modal h3 { font-size: 1.15rem; font-weight: 800; margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.modal .sous { color: var(--muted); font-size: .86rem; margin-bottom: 16px; }
.modal .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; } .modal .actions .gauche { margin-right: auto; }

/* bulle et toast */
.bulle { position: fixed; z-index: 400; display: none; background: #fff; color: var(--text); padding: 7px 11px; border-radius: var(--r-el); font-size: .78rem; line-height: 1.4; white-space: pre-line; max-width: 300px; pointer-events: none; box-shadow: 0 8px 24px rgba(15,23,42,.18); border: 1px solid var(--trait); }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translate(-50%, 200%); visibility: hidden; opacity: 0; background: #0F172A; color: #fff; padding: 11px 20px; border-radius: var(--r-el); font-weight: 700; font-size: .88rem; box-shadow: 0 10px 30px rgba(0,0,0,.25); z-index: 300; transition: transform .3s cubic-bezier(.2,.9,.3,1.2), opacity .25s, visibility 0s linear .3s; text-align: center; max-width: min(92vw, 420px); }
.toast.visible { transform: translate(-50%, 0); visibility: visible; opacity: 1; transition: transform .3s cubic-bezier(.2,.9,.3,1.2), opacity .2s, visibility 0s; }
.toast.ok { background: var(--ok); } .toast.ko { background: var(--ko); }
.toast small { display: block; font-weight: 500; opacity: .9; font-size: .78rem; margin-top: 2px; }

/* page de connexion et page publique */
body.centre { display: flex; align-items: center; justify-content: center; padding: 20px; background: radial-gradient(640px 420px at 85% -5%, color-mix(in srgb, var(--primary) 16%, transparent), transparent 65%), radial-gradient(520px 400px at -10% 30%, color-mix(in srgb, var(--primary) 10%, transparent), transparent 60%), var(--bg); }
.login { width: 100%; max-width: 410px; background: #fff; border-radius: 16px; padding: 34px 30px 26px; box-shadow: 0 20px 50px rgba(15,40,80,.14); border: 1px solid var(--trait); }
.login .lg { width: 64px; height: 64px; border-radius: 18px; margin: 0 auto 14px; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); box-shadow: 0 10px 24px -8px var(--primary); }
.login h1 { text-align: center; font-size: 1.35rem; font-weight: 800; letter-spacing: -.01em; }
.login p.s { text-align: center; color: var(--muted); font-size: .86rem; margin: 4px 0 22px; }
.login .code { font-size: 1.6rem; letter-spacing: .4em; text-align: center; font-weight: 800; padding-left: calc(12px + .4em); }
.login .foot { text-align: center; color: #94A3B8; font-size: .72rem; margin-top: 18px; }
.public .pub { max-width: 680px; margin: 0 auto; padding: 28px 18px 60px; }
.public .pub-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.public .pub-head .lg { width: 46px; height: 46px; border-radius: 13px; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); }
.public .pub-head b { font-size: 1.05rem; } .public .pub-head span { display: block; color: var(--muted); font-size: .82rem; }
.conv-ligne { display: flex; gap: 10px; align-items: flex-start; font-size: .95rem; padding: 6px 0; } .conv-ligne .ic { color: var(--primary); margin-top: 2px; }
.odj { margin: 12px 0 0; padding-left: 0; list-style: none; } .odj li { padding: 6px 0 6px 18px; position: relative; border-top: 1px dashed var(--trait); font-size: .9rem; }
.odj li::before { content: ""; position: absolute; left: 4px; top: 13px; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); }
.choix { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border: 1.5px solid var(--border); border-radius: var(--r-el); margin-bottom: 10px; cursor: pointer; font-size: .98rem; }
.choix:hover { border-color: color-mix(in srgb, var(--primary) 50%, var(--border)); } .choix.on { border-color: var(--primary); background: var(--primary-light); }
.choix input { width: 18px; height: 18px; accent-color: var(--primary); }
.sous-choix { margin: -4px 0 12px 44px; display: none; } .sous-choix.on { display: block; }

/* divers */
.kv { display: flex; gap: 14px; flex-wrap: wrap; font-size: .86rem; color: var(--muted); } .kv b { color: var(--text); }
.cle { font-family: ui-monospace, Menlo, monospace; font-size: .88rem; font-weight: 700; letter-spacing: .06em; text-align: center; background: #F8FAFC; border: 1px dashed var(--border); border-radius: var(--r-el); padding: 9px; word-break: break-all; user-select: all; }
.qr { display: flex; justify-content: center; margin: 6px 0 12px; } .qr svg { border-radius: var(--r-el); border: 1px solid var(--border); }
.secours { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; font-family: ui-monospace, Menlo, monospace; font-size: .95rem; font-weight: 700; text-align: center; }
.secours span { background: #F8FAFC; border: 1px solid var(--border); border-radius: var(--r-s); padding: 7px 4px; }
.onglets { display: flex; gap: 2px; border-bottom: 2px solid var(--trait); margin-bottom: 18px; flex-wrap: wrap; }
.onglets a, .onglets button { background: none; border: none; padding: 9px 14px; font-weight: 700; font-size: .88rem; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -2px; cursor: pointer; }
.onglets a.on, .onglets button.on { color: var(--primary); border-bottom-color: var(--primary); }
.pane { display: none; } .pane.on { display: block; }
.progress { font-size: .86rem; font-weight: 600; color: var(--muted); }
.av { width: 40px; height: 40px; border-radius: 50%; background: var(--primary-light); color: var(--primary); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; flex: none; font-size: .9rem; }
.sep { height: 1px; background: var(--trait); margin: 16px 0; }
@media print { .topbar, .ph-a, .filtres, .btn, .toast, .bulle { display: none !important; } .wrap { padding: 0; } .card { box-shadow: none; } }
