/* Qurba · tableau de bord · v3 : l'identité de la vitrine (logo 1b, vert du Q, or de la queue, Jost et Newsreader) */
:root {
  color-scheme: light;
  --bg: #f3f5f2;             /* blanc à peine sauge, de la famille de la vitrine */
  --surface: #ffffff;
  --surface-2: #f3f5f1;
  --line: #e4e7e1;
  --line-strong: #cbd2ca;
  --ink: #10261f;
  --ink-2: #3b4a44;
  --ink-3: #56645e;          /* ≥ 5:1 sur blanc et sur le fond */
  --accent: #0b3d30;         /* vert du Q : action principale, liens, rubrique active */
  --accent-hover: #11503f;
  --accent-2: #2b7a5e;       /* vert des données : barres, interrupteurs, borne en ligne */
  --accent-soft: #e3ebe5;    /* sauge pâle */
  --gold: #8a6a1c;           /* texte or lisible */
  --gold-mark: #c9a24a;      /* or de la marque : queue du Q, progression des objectifs */
  --gold-soft: #fbf3dc;
  --on-green: #f6f3ec;       /* ivoire sur le vert */
  --on-green-2: #b9cbc2;
  --danger: #c4242a;
  --danger-soft: #ffedea;
  --warn: #8f5500;
  --warn-soft: #fff4e0;
  --radius: 14px;
  --shadow: 0 8px 24px rgba(16, 38, 31, 0.08);   /* ce qui flotte : menus, résultats, notifications */
  --sidebar: 248px;
  --tabbar: 64px;
  --focus: 0 0 0 3px rgba(43, 122, 94, .45);
  /* Jost pour tout (chiffres à chasse fixe là où ils s'alignent), Newsreader pour les titres de page. */
  --font: "Jost", "Futura", "Avenir Next", system-ui, sans-serif;
  --font-head: "Newsreader", "Iowan Old Style", "Palatino", Georgia, serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font: 15px/1.45 var(--font);
  /* Jost a de petites minuscules (0,46 contre 0,55 pour l'ancienne police) : on les remonte pour garder la lisibilité. */
  font-size-adjust: 0.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
b, strong { font-weight: 600; }   /* Jost en 700 est trop noir pour un écran de travail */
[hidden] { display: none !important; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 8px; }
.input:focus-visible { box-shadow: var(--focus); }

/* ───────── Marque ───────── */
.logo { display: block; width: auto; height: 28px; flex: none; }
.logo .logo-q { fill: var(--accent); }
.logo .logo-tail { fill: var(--gold-mark); }
.brand { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; text-decoration: none; color: inherit; }
.brand small { display: block; color: var(--ink-3); font-size: 13px; }
h1, h2, .topbar h1 { font-size-adjust: none; }

/* ───────── Connexion : le vert de la marque et la vraie borne à gauche, le formulaire à droite ───────── */
.login { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); background: var(--bg); }
.login-side { display: flex; flex-direction: column; gap: 32px; padding: 40px 48px 0; background: var(--accent); color: var(--on-green); overflow: hidden; }
.login-logo { align-self: flex-start; border-radius: 6px; }
.login-logo .logo { height: 34px; }
.login-side .logo .logo-q { fill: var(--on-green); }
.login-line { margin: 0; max-width: 13ch; font-family: var(--font-head); font-size-adjust: none; font-weight: 500; font-size: clamp(30px, 2.7vw, 44px); line-height: 1.08; letter-spacing: -0.015em; text-wrap: balance; }
.login-kiosk { display: block; margin: auto auto 0; width: auto; height: min(62vh, 640px); max-width: 100%; object-fit: contain; object-position: bottom; }
.login-main { display: grid; place-items: center; padding: 48px 32px; }
.login-card { width: 100%; max-width: 400px; }
.login-card h1 { margin: 0 0 8px; font-family: var(--font-head); font-weight: 500; font-size: 32px; line-height: 1.1; letter-spacing: -0.012em; color: var(--accent); text-wrap: balance; }
.login-sub { margin: 0 0 28px; color: var(--ink-3); }
.login-card > .alert { margin-bottom: 16px; }
.login .btn.big { width: 100%; justify-content: center; }
.login-link { align-self: center; font-size: 14px; color: var(--ink-2); padding: 10px; min-height: 44px; display: inline-flex; align-items: center; }
.login-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-3); }
.login-foot a { color: var(--ink-2); }
.lang-switch { display: flex; gap: 2px; font-size: 13px; }
.lang-switch a { display: inline-flex; align-items: center; min-height: 32px; padding: 4px 10px; border-radius: 999px; color: var(--ink-3); text-decoration: none; }
.lang-switch a:hover { color: var(--ink); background: rgba(0,0,0,.05); }
.lang-switch a[aria-current="true"] { color: var(--ink); font-weight: 600; background: rgba(0,0,0,.06); }
@media (max-width: 900px) {
  .login { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .login-side { flex-direction: row; align-items: center; padding: 16px 20px; gap: 0; }
  .login-logo .logo { height: 28px; }
  .login-line, .login-kiosk { display: none; }
  .login-main { place-items: start center; padding: 36px 20px 40px; }
  .login-card h1 { font-size: 28px; }
}
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 48px; }
.pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }
.pw-eye svg { width: 20px; height: 20px; }

/* ───────── Structure ───────── */
.app { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar { background: var(--surface); border-right: 1px solid var(--line); padding: 20px 16px; display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: 100vh; }
.sidebar .brand { padding: 8px 8px 20px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 11px 12px; min-height: 44px; border-radius: 10px; text-decoration: none; color: var(--ink-2); font-weight: 500; }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav a svg { width: 18px; height: 18px; flex: none; }
.viewas-note { margin: 10px 8px; font-size: 13px; }
.sidebar-foot { margin-top: auto; padding: 8px; font-size: 13px; color: var(--ink-3); display: flex; flex-direction: column; gap: 2px; }
.sidebar-foot b { color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-foot a { display: inline-block; padding: 8px 0; min-height: 44px; }
.main { padding: 24px 32px 48px; min-width: 0; }
.topbar { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; flex-wrap: wrap; }
.topbar h1 { margin: 0; font-family: var(--font-head); font-size: 28px; font-weight: 500; line-height: 1.15; letter-spacing: -0.012em; color: var(--accent); }
.topbar-mark { display: none; }
.spacer { flex: 1; }
.org-switch { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 6px 10px; min-height: 44px; }
.org-switch select { border: 0; background: transparent; font-weight: 600; max-width: 260px; }
.tabbar { display: none; }

/* ───────── Composants ───────── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card h3 { margin: 0 0 14px; font-size: 16px; font-weight: 600; }
a.card { text-decoration: none; color: inherit; display: block; }
a.card:hover { border-color: var(--line-strong); }
.grid { display: grid; gap: 16px; }
.grid.kpi { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.grid.two { grid-template-columns: 1.4fr 1fr; }
.kpi .label { font-size: 13px; color: var(--ink-3); }
.kpi .value { font-size: 26px; font-weight: 500; letter-spacing: -0.01em; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: 13px; color: var(--ink-2); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 14px; min-height: 44px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); cursor: pointer; font-weight: 500; text-decoration: none; color: var(--ink); line-height: 1.2; transition: background .15s, border-color .15s; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.danger { color: var(--danger); border-color: #ecc4bf; }
.btn.danger:hover { background: var(--danger-soft); }
.btn.sm { padding: 8px 12px; font-size: 13.5px; }
.btn.sm svg { width: 16px; height: 16px; }
.btn.big { min-height: 48px; font-size: 16px; }
.btn:disabled, .btn[aria-busy="true"] { opacity: .55; cursor: default; }
.input, select.input, textarea.input { width: 100%; padding: 11px 12px; min-height: 44px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); }
.input.grow { flex: 1; min-width: 220px; }
.input:focus { outline: none; box-shadow: var(--focus); border-color: transparent; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .field .label { font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.field .opt { font-weight: 400; color: var(--ink-3); }
.help, .field .help { font-size: 13px; color: var(--ink-3); line-height: 1.45; }
.help .count { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink-2); }
.help .count.warn { color: var(--warn, #b26a00); }
.help .count.max { color: var(--danger, #b3261e); }
.form { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.form .full { grid-column: 1 / -1; }
.check { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; font-size: 14.5px; }
.check input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--accent); margin: 0; flex: none; }
.checks { display: grid; gap: 2px; max-height: 260px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; padding: 6px 12px; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.toggle:first-of-type { border-top: 0; }
.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch > span:not(.sr-only) { position: absolute; inset: 0; background: #c3cec8; border-radius: 30px; transition: .15s; }
.switch > span:not(.sr-only)::after { content: ""; position: absolute; width: 24px; height: 24px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--accent-2); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { box-shadow: var(--focus); }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 20px; font-size: 12.5px; font-weight: 600; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); line-height: 1.3; }
.badge svg { width: 14px; height: 14px; }
.badge.ok { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.badge.gold { background: var(--gold-soft); color: var(--gold); border-color: transparent; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #c3cec8; display: inline-block; flex: none; }
.dot.on { background: var(--accent-2); box-shadow: 0 0 0 3px rgba(43, 122, 94, .18); }
.dot.off { background: var(--danger); }
.muted { color: var(--ink-3); }
.tiny { font-size: 12.5px; }
.mono { font-family: "SF Mono", Menlo, Consolas, monospace; /* taste-skill-ignore : codes d'enrôlement et identifiants */ letter-spacing: .08em; font-size: 15px; }
.empty { padding: 36px 20px; text-align: center; color: var(--ink-3); line-height: 1.5; }
.empty b { display: block; color: var(--ink); margin-bottom: 4px; }
.summary { margin: 0 0 12px; color: var(--ink-2); }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .input { width: auto; min-width: 160px; }
.toolbar .input.grow { flex: 1; }
.tabs { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 3px; max-width: 100%; }
.tabs.wrap { flex-wrap: wrap; }
.tabs button, .tabs a { border: 0; background: transparent; padding: 9px 14px; min-height: 40px; border-radius: 9px; cursor: pointer; font-weight: 600; color: var(--ink-2); text-decoration: none; display: inline-flex; align-items: center; white-space: nowrap; }
.tabs .active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.chips { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.chips button { border: 1px solid var(--line-strong); background: var(--surface); padding: 9px 14px; min-height: 40px; border-radius: 999px; cursor: pointer; font-weight: 600; color: var(--ink-2); }
.chips button.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.chips button:disabled { opacity: .4; cursor: default; }
details.filters summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px; border: 1px dashed var(--line-strong); border-radius: 999px; font-weight: 600; color: var(--ink-2); }
details.filters summary::-webkit-details-marker { display: none; }
details.filters[open] { flex-basis: 100%; }
details.filters[open] .row { margin-top: 10px; }
.code-big { font: 700 44px/1 "SF Mono", Menlo, Consolas, monospace; letter-spacing: .18em; color: var(--accent); background: var(--accent-soft); padding: 18px 24px; border-radius: 14px; text-align: center; word-break: break-all; }
.cred { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 8px 0; }
.cred > span { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; }
.chart { width: 100%; max-height: 240px; }
.chart text { font-size: 11px; fill: var(--ink-3); }
.chart rect { fill: var(--accent-2); }
.chart rect:hover { fill: var(--accent); }
.legend { display: grid; grid-template-columns: 1fr auto auto; gap: 6px 14px; font-size: 14px; }
.legend .bar { height: 6px; background: var(--accent-soft); border-radius: 6px; overflow: hidden; grid-column: 1 / -1; }
.legend .bar i { display: block; height: 100%; background: var(--accent-2); }
.alert { padding: 12px 14px; border-radius: 10px; background: var(--warn-soft); color: var(--warn); font-size: 14px; line-height: 1.5; }
.alert.info { background: var(--accent-soft); color: var(--accent); }
.alert.error { background: var(--danger-soft); color: var(--danger); }
.alert a { color: inherit; font-weight: 600; }
.quick .btn { background: var(--surface); }
.todo h3 { margin-bottom: 6px; }
.todo-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.todo-row:first-of-type { border-top: 0; }
.recent-row { display: grid; grid-template-columns: auto 1fr auto auto; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.recent-row b { font-variant-numeric: tabular-nums; }
.more { display: inline-block; margin-top: 10px; font-weight: 600; text-decoration: none; }
.checklist { margin: 0; padding-left: 20px; line-height: 1.9; }
.readiness .badge { font-size: 13.5px; padding: 7px 12px; }

/* Tableaux */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 13px; color: var(--ink-3); font-weight: 500; white-space: nowrap; }
td.actions { text-align: right; white-space: nowrap; }
td.actions .btn { margin-left: 6px; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td, tr.clickable:focus-visible td { background: var(--surface-2); }
tr.clickable:focus-visible { outline: none; box-shadow: inset var(--focus); }
tr.failed td { color: var(--ink-3); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Sélecteur de donateur */
.picker-list { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; max-height: 280px; overflow: auto; }
.picker-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 10px 12px; min-height: 44px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; }
.picker-row:hover { background: var(--surface-2); }
.picker-row.on { border-color: var(--accent); background: var(--accent-soft); }

/* Réglages borne */
.amount { display: inline-flex; align-items: center; gap: 4px; padding: 6px 6px 6px 14px; border-radius: 999px; background: var(--gold-soft); color: var(--gold); font-weight: 700; font-size: 15px; }
.amount .icon-btn { color: var(--gold); }
.motifs { display: flex; flex-direction: column; gap: 12px; }
.motif { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: var(--surface-2); }
.motif-head { display: flex; align-items: flex-end; gap: 10px; }
.motif-head .field { flex: 1; }
.motif-head .drag { width: 26px; height: 26px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line); display: grid; place-items: center; font-size: 12px; font-weight: 700; margin-bottom: 9px; flex: none; }
.motif-tools { flex-wrap: nowrap; gap: 2px; margin-bottom: 1px; }
.motif-body { display: grid; grid-template-columns: 160px 1fr auto; gap: 14px; align-items: center; margin-top: 12px; }
.motif-head .motif-active { margin-bottom: 7px; }
.motif-name-view { display: flex; align-items: center; gap: 6px; min-height: 44px; }
.motif-name-view .icon-btn { flex: none; }   /* un nom long passe à la ligne, le crayon garde sa taille */
.motif-name-text { font-size: 17px; font-weight: 650; padding: 0 2px; }
.motif-name-edit { display: flex; gap: 8px; align-items: center; }
.motif-name-edit .input { flex: 1; min-width: 160px; }
.motif:not(.editing) .motif-name-edit, .motif:not(.editing) .motif-name-help { display: none; }
.motif.editing .motif-name-view { display: none; }
.cfg-status .badge { font-size: 13.5px; padding: 7px 12px; }
.savebar .spacer { flex: 1; }
.motif-name-help { margin-top: 6px; padding-left: 96px; } /* 26 + 10 + 50 + 10 : aligné sur le champ nom */
.motif.off { background: var(--surface); }
.motif.off .motif-body, .motif.off .motif-head .field { opacity: .55; }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.swatch { position: relative; width: 32px; height: 32px; cursor: pointer; }
.swatch input { position: absolute; opacity: 0; width: 0; height: 0; }
.swatch > span:not(.sr-only) { display: block; width: 32px; height: 32px; border-radius: 50%; border: 3px solid transparent; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.swatch input:checked + span { border-color: var(--ink); }
.swatch.taken { cursor: not-allowed; }
.swatch.taken > span:not(.sr-only) { /* taste-skill-ignore : couleur barrée, déjà prise */ opacity: .25; background-image: linear-gradient(135deg, transparent 45%, var(--ink) 45%, var(--ink) 55%, transparent 55%) !important; }
.swatch input:focus-visible + span { box-shadow: var(--focus); }
/* Pictogramme du motif (cercles de la borne) : au trait, dans une teinte foncée de la couleur du motif.
   60 % de la couleur (et non 74 % comme la maquette) : jaune et bleu clair restent au-dessus de 3:1 sur le disque. */
.motif { --mc: #198754; --mc-ink: color-mix(in oklab, var(--mc) 60%, #0b1411); }
.motif-disc { width: 34px; height: 34px; border-radius: 50%; background: #e4e9e3; color: var(--mc-ink); display: grid; place-items: center; flex: none; margin-right: 4px; }
.motif-disc svg { width: 20px; height: 20px; display: block; }
.motif-picto { grid-column: 1 / -1; }
.pictos { display: flex; flex-wrap: wrap; gap: 8px; }
.picto { position: relative; cursor: pointer; }
.picto input { position: absolute; opacity: 0; width: 0; height: 0; }
.picto > span:not(.sr-only) { width: 42px; height: 42px; border-radius: 50%; background: #e4e9e3; color: #33423d; display: grid; place-items: center; transition: background .15s, color .15s; }
.picto svg { width: 24px; height: 24px; display: block; }
.picto:hover input:not(:checked) + span { background: #d8dfd8; }
.picto input:checked + span { background: var(--mc-ink); color: #fff; outline: 2px solid var(--ink); outline-offset: 2px; }
.picto input:focus-visible + span { box-shadow: var(--focus); }
/* Présentation de l'écran de don : deux vignettes, celle choisie cerclée du vert du Q */
.pres-opts { display: grid; grid-template-columns: repeat(2, minmax(0, 190px)); gap: 12px; }
.pres-opt { position: relative; cursor: pointer; }
.pres-opt input { position: absolute; opacity: 0; width: 0; height: 0; }
.pres-card { display: flex; flex-direction: column; gap: 8px; padding: 8px 8px 10px; border-radius: 14px; background: #eef1ee; box-shadow: inset 0 0 0 1px var(--line); transition: background .15s, box-shadow .15s; } /* taste-skill-ignore : anneau de sélection de la maquette */
.pres-opt:hover input:not(:checked) + .pres-card { box-shadow: inset 0 0 0 1px var(--line-strong); }
.pres-opt input:checked + .pres-card { background: var(--surface); box-shadow: inset 0 0 0 2px var(--accent); }
.pres-opt input:focus-visible + .pres-card { box-shadow: inset 0 0 0 2px var(--accent), var(--focus); }
.pres-lab { font-size: 15px; font-weight: 500; text-align: center; }
.pres-mini { height: 82px; border-radius: 8px; background: #f3f5f2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; overflow: hidden; }
.pres-mini .tl { width: 38%; height: 5px; border-radius: 3px; background: #9aa6a0; }
.pres-mini .bar { width: 76%; height: 11px; border-radius: 6px; background: #e4e9e3; display: flex; padding: 1.5px; gap: 2px; }
.pres-mini .bar i { flex: 1; border-radius: 5px; }
.pres-mini .tiles { width: 76%; display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; }
.pres-mini .tiles i { height: 16px; border-radius: 5px; background: #e4e9e3; }
.pres-mini .dots { display: flex; gap: 7px; margin-top: 4px; }
.pres-mini .dots i { width: 22px; height: 22px; border-radius: 50%; background: #e4e9e3; display: grid; place-items: center; }
.pres-mini .dots b { width: 8px; height: 8px; border-radius: 50%; }
.pres-mini .lines { display: flex; gap: 7px; }
.pres-mini .lines i { width: 22px; height: 3px; border-radius: 2px; background: #c3ccc7; }
.pres-help { margin: 10px 0 0; }
.savebar { position: sticky; bottom: 0; display: flex; justify-content: flex-start; align-items: center; gap: 14px; padding: 12px 16px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); /* taste-skill-ignore : la seule barre fixe (Enregistrer) */ border: 1px solid var(--line); border-radius: 12px; z-index: 5; }
.savebar.is-dirty { border-color: var(--warn); }

/* ───────── Panneau latéral & modales ───────── */
.drawer-bg { position: fixed; inset: 0; background: rgba(16, 32, 27, .35); z-index: 40; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100%); background: var(--surface); z-index: 41; box-shadow: -10px 0 40px rgba(0,0,0,.15); display: flex; flex-direction: column; animation: slide .18s ease-out; }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer header { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.drawer header h3 { margin: 0; font-size: 18px; flex: 1; outline: none; }
.drawer .body { padding: 20px; overflow: auto; flex: 1; -webkit-overflow-scrolling: touch; }
.drawer footer { padding: 12px 20px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
body.has-drawer { overflow: hidden; }
.modal-bg { position: fixed; inset: 0; background: rgba(16, 32, 27, .4); z-index: 50; display: grid; place-items: center; padding: 20px; }
.modal { background: var(--surface); border-radius: 16px; padding: 24px; width: 100%; max-width: 460px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal h3 { margin: 0 0 8px; font-size: 18px; }
.modal p { color: var(--ink-2); margin: 0 0 18px; line-height: 1.5; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.toast-wrap { position: fixed; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; width: min(560px, calc(100% - 32px)); pointer-events: none; }
.toast { display: flex; align-items: center; gap: 12px; background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 10px; font-weight: 500; box-shadow: var(--shadow); animation: slide .15s; pointer-events: auto; line-height: 1.4; }
.toast.error { background: var(--danger); }
.toast-x { margin-left: auto; border: 0; background: rgba(255,255,255,.15); color: #fff; width: 32px; height: 32px; border-radius: 8px; cursor: pointer; flex: none; }
.icon-btn { border: 0; background: transparent; width: 44px; height: 44px; display: inline-grid; place-items: center; border-radius: 10px; cursor: pointer; color: var(--ink-3); }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.loading { padding: 40px; text-align: center; color: var(--ink-3); }

/* Squelette de chargement */
.skeleton { display: flex; flex-direction: column; gap: 16px; }
/* Blocs gris fixes à la taille du contenu, sans scintillement */
.sk { background: var(--line); border-radius: var(--radius); }
.sk-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; background: none; }
.sk-kpis i { display: block; height: 92px; border-radius: var(--radius); background: var(--line); }
.sk-card { height: 220px; }
.sk-card.short { height: 120px; }

/* ───────── Exploitation : recherche, points à traiter, assistant ───────── */
.search-box { position: relative; min-width: 320px; flex: 1; max-width: 460px; }
.search-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); z-index: 30; max-height: 360px; overflow: auto; padding: 6px; }
.search-results a { display: flex; align-items: center; gap: 10px; padding: 10px; min-height: 44px; border-radius: 8px; text-decoration: none; color: var(--ink); }
.search-results a:hover { background: var(--surface-2); }
.issues { display: flex; flex-direction: column; }
.issue { display: flex; align-items: center; gap: 14px; padding: 12px 4px; border-top: 1px solid var(--line); }
.issue:first-child { border-top: 0; }
.issue .badge { flex: none; min-width: 64px; justify-content: center; }
.issue-body { flex: 1; min-width: 0; }
.issue-body b { display: block; }
.steps { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }
.steps span { padding: 8px 12px; border-radius: 20px; background: var(--surface-2); color: var(--ink-3); font-weight: 600; font-size: 13px; border: 1px solid var(--line); }
.steps span.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.steps span.done { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ───────── Réactif ───────── */
@media (max-width: 1000px) {
  .motif-body { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .main { padding: 14px 14px calc(var(--tabbar) + 24px + env(safe-area-inset-bottom, 0px)); }
  .topbar { margin-bottom: 14px; }
  .topbar h1 { font-size: 24px; }
  .topbar-mark { display: block; border-radius: 6px; }
  .topbar-mark .logo { height: 26px; }
  .search-box { min-width: 0; max-width: none; width: 100%; }
  .grid.two { grid-template-columns: 1fr; }
  .issue { flex-wrap: wrap; }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; height: calc(var(--tabbar) + env(safe-area-inset-bottom, 0px)); padding: 0 8px env(safe-area-inset-bottom, 0px); background: var(--surface); border-top: 1px solid var(--line); z-index: 35; }
  .tabbar a { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-decoration: none; color: var(--ink-3); font-size: 11px; font-size-adjust: none; font-weight: 500; min-height: 44px; border-radius: 10px; }
  .tabbar a svg { width: 22px; height: 22px; }
  .tabbar a.active { color: var(--accent); }
  .savebar { bottom: calc(var(--tabbar) + 8px + env(safe-area-inset-bottom, 0px)); }
  .toast-wrap { bottom: calc(var(--tabbar) + 12px + env(safe-area-inset-bottom, 0px)); }
  .drawer footer { padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
}
/* Tableaux → cartes quand le conteneur est étroit (téléphone, panneau latéral) */
.table-wrap.cards { container-type: inline-size; }
@container (max-width: 720px) {
  .table-wrap.cards { overflow: visible; }
  .cards table, .cards tbody, .cards tr, .cards td { display: block; width: 100%; }
  .cards thead { display: none; }
  .cards tr { border: 1px solid var(--line); border-radius: 12px; padding: 6px 12px; margin-bottom: 10px; background: var(--surface); }
  .cards td { border: 0; padding: 7px 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: right; }
  .cards td[data-label]::before { content: attr(data-label); font-size: 13px; color: var(--ink-3); font-weight: 500; text-align: left; flex: none; }
  .cards td.num { text-align: right; }
  .cards td.actions { justify-content: flex-start; flex-wrap: wrap; white-space: normal; padding-top: 10px; border-top: 1px solid var(--line); margin-top: 4px; }
  .cards td.actions .btn { margin: 0; flex: 1; }
  .cards td:not([data-label]):not(.actions) { justify-content: flex-start; text-align: left; }
  .cards td br { display: none; }
  .cards tr.clickable:hover, .cards tr.clickable:focus-visible { border-color: var(--accent); }
  .cards tr.clickable:hover td { background: transparent; }
}
@media (max-width: 700px) {
  .motif-body { grid-template-columns: 1fr; }
  .motif-name-help { padding-left: 0; }
  /* Tête d'un motif : numéro, interrupteur et outils sur une ligne, le nom en dessous (sinon ✕ sort de la carte). */
  .motif-head { flex-wrap: wrap; align-items: center; row-gap: 4px; }
  .motif-head .drag, .motif-head .motif-active { margin-bottom: 0; }
  .motif-head .field { order: 1; flex: 1 1 100%; min-width: 0; }
  .motif-tools { margin-left: auto; }
  .motif-name-text { min-width: 0; overflow-wrap: anywhere; }
  .motif-name-edit { flex-wrap: wrap; }
  .motif-name-edit .input { flex: 1 1 100%; min-width: 0; }
  .pictos { display: grid; grid-template-columns: repeat(6, minmax(0, 42px)); }
  .picto > span:not(.sr-only) { width: 100%; height: auto; aspect-ratio: 1; }
  .grid.kpi { grid-template-columns: 1fr 1fr; }
  .topbar .search-box { flex: 1 1 100%; }
  .issue .row { flex-basis: 100%; }
  .issue .row .btn { flex: 1; }
  .recent-row { grid-template-columns: 1fr auto; }
  .recent-row > span:first-child { grid-column: 1 / -1; font-size: 12.5px; }
  .todo-row { flex-direction: column; align-items: stretch; }
  .toolbar .input { min-width: 110px; flex: 1; }
  .toolbar .btn { flex: 1 1 100%; }
  .toolbar .btn.sm { flex: 0 1 auto; }
  .toolbar .spacer { display: none; }
  .form { grid-template-columns: 1fr; }
  .card { padding: 16px; }
  .kpi .value { font-size: 22px; }
  .code-big { font-size: 32px; }
  .chips { width: 100%; }
  .chips button { flex: 1; }
}

/* ───────── Bornes v4.3 : télémétrie, menu d'actions, journaux, QR ───────── */
table.kiosks { font-size: 13.5px; }
table.kiosks th, table.kiosks td { padding: 10px 8px; }
.tele { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tele svg { width: 16px; height: 16px; flex: none; color: var(--ink-3); }
.tele.bad { color: var(--danger); font-weight: 600; }
.tele.bad svg { color: var(--danger); }
.tele .charge svg { color: var(--accent-2); width: 14px; height: 14px; }
.tele .temp { color: var(--ink-3); font-weight: 400; }
.tele .temp.hot { color: var(--danger); font-weight: 600; }
.tele .bars { font-size: 11px; letter-spacing: -1px; color: var(--accent-2); }
.err { color: var(--danger); }
.pin { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.pin .pin-val { font-size: 14px; min-width: 76px; }
.icon-btn.sm { width: 32px; height: 32px; }
.icon-btn.sm svg { width: 16px; height: 16px; }
.menu { position: fixed; z-index: 45; min-width: 260px; max-width: calc(100vw - 16px); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 36px rgba(16, 32, 27, .18); padding: 6px; max-height: calc(100vh - 16px); overflow: auto; }
.menu button { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; text-align: left; border: 0; background: transparent; padding: 10px 12px; min-height: 42px; border-radius: 8px; cursor: pointer; font-weight: 500; color: var(--ink); }
.menu button:hover, .menu button:focus-visible { background: var(--surface-2); }
.menu button.danger { color: var(--danger); }
.menu button .muted { font-size: 12px; }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.menu-head { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); font-weight: 600; padding: 8px 12px 2px; }
.logs { margin: 0; font: 12.5px/1.5 "SF Mono", Menlo, Consolas, monospace; background: #15211d; color: #e6ede9; padding: 12px; border-radius: 10px; max-height: 60vh; overflow: auto; white-space: pre-wrap; word-break: break-word; }
.logs .at { color: #8fa39b; }
.logs .lvl { font-weight: 700; }
.logs .lvl.debug { color: #8fa39b; }
.logs .lvl.info { color: #7fd3b4; }
.logs .lvl.warn { color: #f0c15c; }
.logs .lvl.error { color: #ff8a7a; }
.code-qr { display: flex; align-items: center; justify-content: center; gap: 18px; flex-wrap: wrap; }
.code-qr .code-big { flex: 1 1 220px; }
.qr { width: 200px; height: 200px; border-radius: 10px; border: 1px solid var(--line); background: #fff; image-rendering: pixelated; }
.qr.big { width: min(320px, 100%); height: auto; aspect-ratio: 1; }
.qr-wrap { display: flex; justify-content: center; }
.payload { margin: 8px 0 0; font: 12px/1.5 "SF Mono", Menlo, Consolas, monospace; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px; overflow: auto; white-space: pre-wrap; word-break: break-all; }
code.mono { font-size: 13px; letter-spacing: 0; background: var(--surface-2); padding: 2px 6px; border-radius: 6px; }
@container (max-width: 720px) {
  .cards td .pin { justify-content: flex-end; }
}
/* Tableau des bornes compact : 6 colonnes, sous-lignes dans Borne / État / Appareil */
table.kiosks th:nth-child(1) { width: 26%; }
table.kiosks td { vertical-align: top; }
table.kiosks td[data-label="Dons en attente"] { white-space: nowrap; }
table.kiosks td.actions { white-space: nowrap; }
.stackcell { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.stackcell .tele { max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
.pin { gap: 2px; margin-top: 4px; }
.pin .pin-val { font-size: 13px; min-width: 64px; }
.pin > .muted.tiny { margin-right: 4px; }
@container (max-width: 720px) {
  .cards td .stackcell { align-items: flex-end; }
}
.subline { margin-top: 3px; line-height: 1.35; }
table.kiosks td[data-label="Dernière erreur"] { max-width: 180px; }
@container (max-width: 720px) {
  .cards td .subline { text-align: right; }
}

/* ───────── Objectifs de collecte ───────── */
.goals { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); gap: 16px; }
.goal { display: flex; flex-direction: column; gap: 10px; }
.goal.closed { background: var(--surface-2); box-shadow: none; }
.goal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.goal-title { flex: 1 1 180px; min-width: 0; }
.goal-head h3 { margin: 0; font-size: 17px; }
.goal-head p { margin: 4px 0 0; font-size: 14px; }
.goal-badges { gap: 6px; }
.goal-bar { height: 12px; border-radius: 999px; background: #f3ecd8; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(138, 106, 28, .12); }
.goal-bar i { display: block; height: 100%; background: var(--gold-mark); border-radius: inherit; transition: width .3s; }
.goal-figures { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-variant-numeric: tabular-nums; }
.goal-figures b { font-size: 21px; letter-spacing: -.01em; }
.goal-pct { margin-left: auto; font-weight: 700; font-size: 17px; color: var(--gold); }
.goal-break { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.goal-motifs { gap: 6px; }
.goal-motifs:empty { display: none; }
.goal-actions { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); gap: 8px; }
.motif-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; color: var(--ink-2); }
.cdot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; flex: none; background: #c9d3ce; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.section-title { margin: 8px 0 0; font-size: 16px; color: var(--ink-2); }
.sub-box { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; background: var(--surface-2); }
.check.is-taken { opacity: .6; cursor: not-allowed; }
.goal-preview { color: var(--gold); font-weight: 600; font-size: 14px; }
.goal-tag { margin-left: 4px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
td.amount-neg b { color: var(--danger); }

/* ───────── Bénévolat ───────── */
.mission-cell { display: flex; align-items: center; gap: 10px; text-align: left; }
.cat-ico { width: 38px; height: 38px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: inline-grid; place-items: center; flex: none; }
.cat-ico svg { width: 20px; height: 20px; }
.slots { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.slot-row, .rule-sentence { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.slot-row .input[type=date] { width: auto; flex: 1 1 150px; }
.input.time { width: 112px; flex: none; }
select.input.compact { width: auto; min-width: 120px; }
.rule { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: var(--surface-2); margin-bottom: 10px; display: flex; flex-direction: column; gap: 10px; }
.daypick { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.daypick button { min-width: 46px; min-height: 42px; border: 1px solid var(--line-strong); background: var(--surface); border-radius: 10px; font-weight: 600; cursor: pointer; color: var(--ink-2); }
.daypick button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.phone-cell { display: inline-flex; align-items: center; gap: 2px; white-space: nowrap; }
.phone-cell a { font-variant-numeric: tabular-nums; font-weight: 600; }
.status-select { width: auto; min-width: 150px; min-height: 40px; padding: 8px 10px; font-weight: 600; }
.status-select.st-todo { border-color: var(--warn); color: var(--warn); }
.status-select.st-confirmed { border-color: var(--accent-2); color: var(--accent); }
.status-select.st-declined { color: var(--ink-3); }
.note-cell { display: inline-block; max-width: 220px; white-space: pre-wrap; font-size: 13.5px; color: var(--ink-2); }

/* Barre d'onglets du téléphone : 7 entrées */
.tabbar a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 480px) {
  .tabbar a { font-size: 11px; }
  .tabbar a svg { width: 20px; height: 20px; }
  .goal-actions .btn { flex: 1 1 auto; }
  .input.time { width: 100px; }
}

/* ── Bornes : fiche d'une borne et réglages propres (22/11/2026) ── */
.kiosk-link { color: inherit; text-decoration: none; }
.kiosk-link:hover b { text-decoration: underline; }
.card.own { box-shadow: inset 0 0 0 2px var(--gold-mark); }
.amount.ro { padding: 6px 14px; }
.motif-dot { display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-right: 8px; vertical-align: -1px; flex: none; }
.own-note { margin: 12px 0 0; padding: 8px 12px; border-radius: 10px; background: var(--gold-soft); color: var(--gold); font-size: 13.5px; line-height: 1.45; }
.sum-lines { display: grid; gap: 8px; }
.sum-lines div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.sum-lines span { color: var(--ink-2); }
.kfiche .pres-card { padding: 12px 8px; }
/* Huit rubriques dans la barre du bas de l'espace mosquée : libellés entiers sur un téléphone étroit. */
@media (max-width: 430px) {
  .mode-org .tabbar { padding-left: 2px; padding-right: 2px; }
  .mode-org .tabbar a { font-size: 10px; letter-spacing: -0.01em; }
}

/* ── Bornes : exceptions sous chaque réglage commun (24/11/2026) ── */
.all-lab { margin: 0 0 8px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.exceptions { display: grid; gap: 8px; margin-top: 14px; }
.exceptions:empty { display: none; }
.ex { display: grid; grid-template-columns: minmax(150px, 220px) minmax(0, 1fr) auto; gap: 6px 14px; align-items: center; padding: 10px 14px; border-radius: 10px; background: var(--gold-soft); color: var(--ink); }
.ex-sum { color: var(--ink-2); }
.ex-act { display: flex; gap: 14px; white-space: nowrap; }
.ex.open { display: flex; flex-direction: column; align-items: stretch; gap: 12px; padding: 14px; box-shadow: inset 0 0 0 2px var(--gold-mark); }
.ex.open .toggle { border-top-color: rgba(138, 106, 28, .25); padding: 8px 0; }
.ex.open .pres-card { padding: 12px 8px; background: var(--surface); }
.ex-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.link { border: 0; background: none; padding: 0; min-height: 36px; font: inherit; font-weight: 600; color: var(--accent); text-decoration: underline; cursor: pointer; }
.link:hover { color: var(--accent-hover); }
.ex-add { justify-self: start; min-height: 44px; }
a.badge.ex-jump { text-decoration: none; cursor: pointer; }
a.badge.ex-jump:hover { text-decoration: underline; }
@media (max-width: 720px) {
  .ex { grid-template-columns: 1fr; }
}
.ex.open .amount { background: var(--surface); box-shadow: inset 0 0 0 1px var(--gold-mark); }
