/* ==========================================================================
   DEAT — Les enfants d'Agouni N'teslent
   Système visuel commun à tout l'espace membre.
   Palette : cèdre / olivier / safran / rouge kabyle sur fond pierre.
   ========================================================================== */
:root {
  --cedar: #1f3d2b;
  --cedar-700: #183223;
  --cedar-900: #10241a;
  --olive: #4e6b3a;
  --olive-100: #e8eedf;
  --olive-50: #f3f6ee;
  --saffron: #d9a21b;
  --saffron-100: #fbf0d3;
  --kabyle-red: #b5462e;
  --kabyle-red-100: #f8e4de;
  --sky: #2f6f9f;
  --sky-100: #e2eef7;

  --stone: #f3f4f1;
  --paper: #ffffff;
  --ink: #1c2421;
  --ink-2: #47524c;
  --ink-3: #7a857f;
  --line: #e1e5de;
  --line-2: #eef0eb;

  --radius-s: 6px;
  --radius: 10px;
  --radius-l: 16px;
  --shadow-1: 0 1px 2px rgba(16, 36, 26, .06), 0 1px 1px rgba(16, 36, 26, .04);
  --shadow-2: 0 10px 30px -12px rgba(16, 36, 26, .25);
  --sidebar-w: 268px;
  --font: "Albert Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* motif géométrique kabyle (losanges et chevrons) */
  --motif: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='24' viewBox='0 0 48 24'%3E%3Cg fill='none' stroke-width='2'%3E%3Cpath d='M0 12 L12 0 L24 12 L12 24 Z' stroke='%23d9a21b'/%3E%3Cpath d='M24 12 L36 0 L48 12 L36 24 Z' stroke='%23b5462e'/%3E%3Cpath d='M12 6 L18 12 L12 18 L6 12 Z' fill='%23d9a21b' stroke='none'/%3E%3Cpath d='M36 6 L42 12 L36 18 L30 12 Z' fill='%23f3f4f1' stroke='none' opacity='.55'/%3E%3C/g%3E%3C/svg%3E");
}

[hidden] { display: none !important; }
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--stone);
  font-feature-settings: "tnum" 1;
}
img { max-width: 100%; }
a { color: var(--olive); }
a:hover { color: var(--cedar); }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; font-weight: 700; color: var(--ink); }
h1 { font-size: 1.6rem; letter-spacing: -.01em; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .75em; }
:focus-visible { outline: 3px solid var(--saffron); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--ink-3); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hidden { display: none !important; }
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------------ Layout */
.app { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w);
  background: var(--cedar); color: #e9efe6;
  display: flex; flex-direction: column; z-index: 60;
  transition: transform .25s ease;
}
.sidebar-brand {
  padding: 22px 20px 18px;
  display: flex; align-items: center; gap: 12px;
  text-decoration: none; color: #fff;
}
.sidebar-brand img { width: 40px; height: 40px; border-radius: 10px; background: #fff; object-fit: contain; }
.sidebar-brand strong { display: block; font-size: 1rem; line-height: 1.15; }
.sidebar-brand span { display: block; font-size: .78rem; color: #b7c7b6; }
.motif-band { height: 12px; background: var(--motif) repeat-x center / 24px 12px; opacity: .9; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 14px 12px 20px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.2) transparent; }
.nav-link, .nav-group > summary {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; margin: 1px 0;
  border-radius: var(--radius);
  color: #d8e2d5; text-decoration: none; font-weight: 500; font-size: .93rem;
  cursor: pointer; list-style: none;
}
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-link i, .nav-group > summary i:first-child { width: 20px; text-align: center; color: #9fb59c; font-size: .95rem; }
.nav-link:hover, .nav-group > summary:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-link.active { background: rgba(217,162,27,.16); color: #fff; box-shadow: inset 3px 0 0 var(--saffron); }
.nav-link.active i { color: var(--saffron); }
.nav-group > summary .chev { margin-left: auto; font-size: .7rem; transition: transform .2s ease; color: #9fb59c; }
.nav-group[open] > summary .chev { transform: rotate(90deg); }
.nav-group[open] > summary { color: #fff; }
.nav-group .nav-sub { margin: 2px 0 6px 21px; padding-left: 10px; border-left: 1px solid rgba(255,255,255,.12); }
.nav-group .nav-sub .nav-link { font-size: .88rem; padding: 7px 10px; }
.sidebar-foot { padding: 14px 16px 18px; border-top: 1px solid rgba(255,255,255,.08); }
.user-chip { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: inline-grid; place-items: center; flex: none;
  background: var(--saffron); color: var(--cedar-900); font-weight: 700; font-size: .85rem;
}
.user-chip strong { display: block; font-size: .9rem; color: #fff; }
.user-chip span { font-size: .75rem; color: #b7c7b6; }
.logout {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 8px 12px; border-radius: var(--radius);
  color: #f5c8bd; text-decoration: none; font-size: .88rem; font-weight: 600;
  border: 1px solid rgba(245,200,189,.25);
}
.logout:hover { background: rgba(181,70,46,.25); color: #fff; }

.main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 14px;
  padding: 14px 28px; background: rgba(243,244,241,.92);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar h1 { font-size: 1.25rem; margin: 0; }
.topbar .subtitle { margin: 0; color: var(--ink-3); font-size: .85rem; }
.topbar-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.burger { display: none; border: 0; background: var(--cedar); color: #fff; width: 40px; height: 40px; border-radius: var(--radius); font-size: 1rem; cursor: pointer; flex: none; }
.content { padding: 24px 28px 48px; flex: 1; width: 100%; max-width: 1480px; }
.scrim { display: none; }

@media (max-width: 960px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-2); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(16,36,26,.45); z-index: 55; }
  .main { margin-left: 0; }
  .burger { display: inline-grid; place-items: center; }
  .topbar { padding: 10px 16px; }
  .content { padding: 16px 16px 40px; }
}

/* ------------------------------------------------------------------- Cards */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-l); box-shadow: var(--shadow-1); }
.card-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; font-size: 1rem; display: flex; align-items: center; gap: 8px; }
.card-head h2 i, .card-head h3 i { color: var(--olive); }
.card-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.card-body { padding: 18px; }
.card-body.flush { padding: 0; }
.card + .card, .card + .section, .section + .card, .section + .section { margin-top: 20px; }
.grid > .card, .kpis > .card, .grid > .kpi, .kpis > .kpi, .row > .card, .map-layout > .card, .master-detail > .card { margin-top: 0; }
.section-title { display: flex; align-items: center; gap: 10px; font-size: 1.05rem; margin: 28px 0 12px; }
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* KPI : un chiffre, un libellé, une note — pas de dégradé */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 14px; }
.kpi { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 16px 18px; text-decoration: none; color: inherit; display: block; position: relative; }
.kpi .kpi-label { color: var(--ink-2); font-size: .85rem; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.kpi .kpi-label i { color: var(--olive); }
.kpi .kpi-value { font-size: 1.85rem; font-weight: 800; letter-spacing: -.02em; margin-top: 4px; color: var(--cedar); }
.kpi .kpi-note { color: var(--ink-3); font-size: .8rem; }
a.kpi:hover { border-color: var(--olive); }
.kpi.accent { border-top: 3px solid var(--saffron); }
.kpi.good .kpi-value { color: var(--olive); }
.kpi.bad .kpi-value { color: var(--kabyle-red); }

/* ----------------------------------------------------------------- Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px; border-radius: var(--radius); border: 1px solid transparent;
  font: 600 .9rem/1.2 var(--font); cursor: pointer; text-decoration: none;
  background: var(--cedar); color: #fff; white-space: nowrap;
  transition: background .15s ease, border-color .15s ease;
}
.btn:hover { background: var(--cedar-700); color: #fff; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn-secondary { background: var(--paper); color: var(--ink); border-color: var(--line); }
.btn-secondary:hover { background: var(--olive-50); color: var(--cedar); border-color: var(--olive); }
.btn-accent { background: var(--saffron); color: var(--cedar-900); }
.btn-accent:hover { background: #c48f12; color: var(--cedar-900); }
.btn-danger { background: var(--kabyle-red); }
.btn-danger:hover { background: #973822; }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--line-2); color: var(--ink); }
.btn-sm { padding: 6px 11px; font-size: .82rem; border-radius: var(--radius-s); }
.btn-icon { width: 34px; height: 34px; padding: 0; }
.btn-sm.btn-icon { width: 30px; height: 30px; }
.btn-block { width: 100%; }

/* ------------------------------------------------------------------- Forms */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label, .label { font-weight: 600; font-size: .85rem; color: var(--ink-2); }
.field .hint { font-size: .78rem; color: var(--ink-3); }
.input, .select, .textarea, .field input:not([type=checkbox]):not([type=radio]):not([type=file]), .field select, .field textarea {
  width: 100%; padding: 9px 12px; border: 1px solid #cfd6cc; border-radius: var(--radius);
  font: 400 .93rem/1.35 var(--font); color: var(--ink); background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field textarea, .textarea { min-height: 96px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus, .field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--olive); box-shadow: 0 0 0 3px rgba(78,107,58,.18);
}
.input-sm { padding: 6px 10px; font-size: .85rem; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 16px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; padding-top: 6px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: .9rem; }
.check input { width: 17px; height: 17px; accent-color: var(--olive); }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; padding: 14px 18px; border-bottom: 1px solid var(--line-2); background: #fafbf8; border-radius: var(--radius-l) var(--radius-l) 0 0; }
.toolbar .field { margin: 0; min-width: 150px; }
.search { position: relative; }
.search i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--ink-3); font-size: .85rem; }
.search .input, .field.search input { padding-left: 34px !important; }

/* ------------------------------------------------------------------ Tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-weight: 700; font-size: .78rem; color: var(--ink-2); background: #f7f8f5; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tbody tr:hover td { background: #fafbf7; }
.table tfoot td { font-weight: 700; background: #f7f8f5; border-top: 2px solid var(--line); }
.table .actions { white-space: nowrap; text-align: right; }
.table-compact td, .table-compact th { padding: 6px 10px; }

/* ------------------------------------------------------------ Badges/Pills */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: .75rem; font-weight: 700; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.badge-ok { background: var(--olive-100); color: var(--olive); }
.badge-warn { background: var(--saffron-100); color: #8a6208; }
.badge-bad { background: var(--kabyle-red-100); color: var(--kabyle-red); }
.badge-info { background: var(--sky-100); color: var(--sky); }
.badge-dark { background: var(--cedar); color: #fff; }

/* ------------------------------------------------------------------ Alerts */
.flash-stack { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius); border: 1px solid; font-size: .9rem; }
.alert i { margin-top: 2px; }
.alert-success { background: var(--olive-50); border-color: #c9d8b9; color: #33502a; }
.alert-error { background: #fdf1ee; border-color: #efc4b8; color: #8c321e; }
.alert-info { background: #eef5fa; border-color: #c4dbea; color: #24577d; }
.alert-warning { background: #fdf7e6; border-color: #f0dca3; color: #7a5706; }
.alert .close { margin-left: auto; background: none; border: 0; color: inherit; cursor: pointer; opacity: .6; font-size: 1rem; }

/* ------------------------------------------------------------------- Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs a, .tabs button { padding: 10px 14px; border: 0; background: none; font: 600 .9rem var(--font); color: var(--ink-3); text-decoration: none; border-bottom: 3px solid transparent; margin-bottom: -1px; cursor: pointer; white-space: nowrap; display: inline-flex; gap: 8px; align-items: center; }
.tabs a:hover, .tabs button:hover { color: var(--ink); }
.tabs a.active, .tabs button.active { color: var(--cedar); border-bottom-color: var(--saffron); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ------------------------------------------------------------------ Modal */
dialog.modal { border: 0; padding: 0; border-radius: var(--radius-l); width: min(620px, calc(100vw - 24px)); max-height: calc(100vh - 32px); box-shadow: var(--shadow-2); color: var(--ink); }
dialog.modal.wide { width: min(920px, calc(100vw - 24px)); }
dialog.modal::backdrop { background: rgba(16,36,26,.5); backdrop-filter: blur(2px); }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line-2); position: sticky; top: 0; background: #fff; z-index: 1; }
.modal-head h2 { margin: 0; font-size: 1.05rem; }
.modal-head .close { margin-left: auto; }
.modal-body { padding: 18px 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line-2); background: #fafbf8; position: sticky; bottom: 0; }

/* ---------------------------------------------------------------- Misc UI */
.empty { text-align: center; padding: 42px 18px; color: var(--ink-3); }
.empty i { font-size: 1.8rem; color: #b8c2b5; margin-bottom: 10px; display: block; }
.empty strong { display: block; color: var(--ink-2); margin-bottom: 4px; }
.progress { height: 8px; background: var(--line-2); border-radius: 99px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--olive); border-radius: 99px; }
.progress.warn > span { background: var(--saffron); }
.progress.bad > span { background: var(--kabyle-red); }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; }
.dl dt { color: var(--ink-3); font-size: .85rem; }
.dl dd { margin: 0; font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; gap: 6px; align-items: center; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-size: .82rem; text-decoration: none; color: var(--ink-2); }
.chip.active, .chip:hover { border-color: var(--olive); color: var(--cedar); background: var(--olive-50); }
.pager { display: flex; gap: 6px; justify-content: center; padding: 14px; flex-wrap: wrap; }
.pager a, .pager span { min-width: 34px; padding: 6px 10px; border-radius: var(--radius-s); border: 1px solid var(--line); text-decoration: none; color: var(--ink-2); text-align: center; font-size: .85rem; }
.pager .current { background: var(--cedar); color: #fff; border-color: var(--cedar); }
.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain li { padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.list-plain li:last-child { border-bottom: 0; }
details.fold { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
details.fold + details.fold { margin-top: 10px; }
details.fold > summary { padding: 12px 16px; cursor: pointer; font-weight: 600; display: flex; gap: 10px; align-items: center; list-style: none; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary .chev { margin-left: auto; transition: transform .2s; color: var(--ink-3); }
details.fold[open] > summary .chev { transform: rotate(90deg); }
details.fold > .fold-body { padding: 0 16px 14px; }
.toast-zone { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 300; }
.toast { background: var(--cedar-900); color: #fff; padding: 10px 14px; border-radius: var(--radius); box-shadow: var(--shadow-2); font-size: .88rem; display: flex; gap: 8px; align-items: center; animation: toast-in .2s ease; }
.toast.error { background: var(--kabyle-red); }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.to-top { position: fixed; right: 18px; bottom: 18px; width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--cedar); color: #fff; cursor: pointer; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 50; }
.to-top.show { opacity: 1; pointer-events: auto; }

/* ------------------------------------------------------- Auth (connexion) */
.auth-page { min-height: 100vh; display: grid; grid-template-columns: minmax(300px, 44%) 1fr; background: var(--stone); }
.auth-side {
  position: relative; background: var(--cedar); color: #eef3ea;
  padding: 48px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden;
}
.auth-side::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 18px; background: var(--motif) repeat-x center / 36px 18px; }
.auth-side .brand { display: flex; align-items: center; gap: 14px; color: #fff; text-decoration: none; }
.auth-side .brand img { width: 54px; height: 54px; border-radius: 14px; background: #fff; object-fit: contain; }
.auth-side h2 { color: #fff; font-size: clamp(1.7rem, 3vw, 2.5rem); line-height: 1.1; margin: 0 0 14px; max-width: 14ch; letter-spacing: -.02em; }
.auth-side p { color: #c3d1c0; max-width: 38ch; }
.auth-side .tanmirt { color: var(--saffron); font-weight: 700; letter-spacing: .02em; }
.auth-main { display: grid; place-items: center; padding: 40px 20px; }
.auth-card { width: min(420px, 100%); }
.auth-card h1 { font-size: 1.6rem; margin-bottom: 4px; }
.auth-card .lead { color: var(--ink-3); margin-bottom: 26px; }
.auth-card .input { padding: 12px 14px; font-size: 1rem; }
.auth-card .btn { padding: 12px 18px; font-size: 1rem; }
.auth-links { margin-top: 18px; display: flex; justify-content: space-between; gap: 10px; font-size: .9rem; flex-wrap: wrap; }
.pwd-wrap { position: relative; }
.pwd-wrap .input { padding-right: 44px; }
.pwd-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--ink-3); cursor: pointer; width: 34px; height: 34px; }
.pwd-rules { list-style: none; padding: 0; margin: 8px 0 0; font-size: .8rem; display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px; color: var(--ink-3); }
.pwd-rules li::before { content: "○ "; }
.pwd-rules li.ok { color: var(--olive); }
.pwd-rules li.ok::before { content: "● "; }
@media (max-width: 820px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-side { padding: 28px 22px 40px; }
  .auth-side h2 { font-size: 1.5rem; }
  .auth-side .hide-sm { display: none; }
}

/* ----------------------------------------------------------- Error pages */
.error-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; text-align: center; }
.error-page .code { font-size: 4.5rem; font-weight: 800; color: var(--cedar); letter-spacing: -.04em; line-height: 1; }
.error-page .motif-band { width: 160px; margin: 18px auto; border-radius: 4px; }

/* ------------------------------------------------------------------ Print */
@media print {
  .sidebar, .topbar .burger, .topbar-actions, .no-print, .to-top, .toast-zone { display: none !important; }
  .main { margin: 0; }
  body { background: #fff; }
  .card { box-shadow: none; border-color: #ccc; }
  .topbar { position: static; border: 0; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* --------------------------------------------- Autocomplétion de ville */
.city-list { position: absolute; top: 100%; left: 0; right: 0; z-index: 20; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-2); max-height: 240px; overflow-y: auto; }
.city-list button { display: flex; justify-content: space-between; gap: 10px; width: 100%; padding: 9px 12px; border: 0; background: none; text-align: left; font: inherit; font-size: .88rem; cursor: pointer; }
.city-list button:hover, .city-list button:focus { background: var(--olive-50); }
fieldset { border: 1px solid var(--line); }

/* ------------------------------------------------- Grille de cotisations */
.year-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.year-chips a { padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: .85rem; }
.year-chips a:hover { border-color: var(--olive); }
.year-chips a.active { background: var(--cedar); border-color: var(--cedar); color: #fff; }
.year-chips a.closed::after { content: " \f023"; font-family: "Font Awesome 6 Free"; font-weight: 900; font-size: .7rem; }
.cotis-table th.y, .cotis-table td.y { text-align: center; width: 62px; padding: 6px 4px; }
.cotis-table th.y.sel { background: var(--saffron-100); color: #7a5706; }
.cotis-table td.y.sel { background: #fffbf0; }
.cotis-table td.member { min-width: 220px; }
.cell { width: 34px; height: 30px; border-radius: 8px; border: 1px solid transparent; display: inline-grid; place-items: center; font-size: .82rem; background: none; }
.cell.open { border: 1.5px dashed #b9c3b5; color: transparent; cursor: pointer; background: #fff; }
.cell.open:hover, .cell.open:focus-visible { border-color: var(--olive); color: var(--olive); }
.cell.open:hover::after { content: "\f00c"; font-family: "Font Awesome 6 Free"; font-weight: 900; }
.cell.paid { background: var(--olive); color: #fff; }
.cell.paid.can-cancel { cursor: pointer; }
.cell.paid.can-cancel:hover { background: var(--kabyle-red); }
.cell.exo { color: var(--kabyle-red); background: var(--kabyle-red-100); font-size: .7rem; font-weight: 700; }
.cell.nocot { color: #8a6208; background: var(--saffron-100); }
.cell.before { color: #c5ccc2; }
.cell.closed { color: var(--ink-3); }
.cell.busy { opacity: .5; pointer-events: none; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: .8rem; color: var(--ink-2); align-items: center; }
.legend .cell { width: 22px; height: 20px; font-size: .65rem; margin-right: 4px; vertical-align: middle; }
.foyer-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.foyer-head .count { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.member-line { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line-2); }
.member-line:last-child { border-bottom: 0; }
.member-line .who { flex: 1; min-width: 0; }
.member-line .who strong { display: block; }
.member-line .cell { width: 46px; height: 40px; font-size: 1rem; }
.member-meta { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }

/* ----------------------------------------------------------- Mon espace */
.profile-hero { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.profile-hero .avatar { width: 64px; height: 64px; font-size: 1.4rem; }
.profile-hero h2 { margin: 0; font-size: 1.35rem; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1px; background: var(--line-2); border: 1px solid var(--line-2); border-radius: var(--radius); overflow: hidden; margin-top: 18px; }
.facts > div { background: #fff; padding: 12px 14px; }
.facts dt { font-size: .78rem; color: var(--ink-3); margin-bottom: 2px; }
.facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.pills { display: flex; flex-wrap: wrap; gap: 5px; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: .78rem; font-weight: 700; border: 1px solid transparent; }
.pill.paid { background: var(--olive-100); color: var(--olive); }
.pill.missing { background: #fdf1ee; color: var(--kabyle-red); }
.pill.exo, .pill.nocot { background: var(--saffron-100); color: #8a6208; }
.pill.before { background: var(--line-2); color: var(--ink-3); }
.pill.current { border-color: currentColor; }
.person { padding: 16px 18px; border-bottom: 1px solid var(--line-2); }
.person:last-child { border-bottom: 0; }
.person-top { display: flex; gap: 12px; align-items: flex-start; }
.person-top .who { flex: 1; min-width: 0; }
.person-top .who strong { font-size: 1rem; }
.person .pills { margin-top: 10px; }
.person details { margin-top: 10px; }
.person details > summary { cursor: pointer; color: var(--olive); font-weight: 600; font-size: .88rem; list-style: none; display: inline-flex; gap: 6px; align-items: center; }
.person details > summary::-webkit-details-marker { display: none; }
.person details[open] > summary { margin-bottom: 12px; }

/* ---------------------------------------------- Filtres repliables (mobile) */
details.filters > summary { display: none; }
@media (max-width: 760px) {
  details.filters > summary { display: flex; align-items: center; gap: 8px; padding: 12px 16px; font-weight: 700; cursor: pointer; list-style: none; border-bottom: 1px solid var(--line-2); }
  details.filters > summary::-webkit-details-marker { display: none; }
  details.filters > summary .chev { margin-left: auto; transition: transform .2s; }
  details.filters[open] > summary .chev { transform: rotate(90deg); }
  .toolbar .field { flex: 1 1 140px; min-width: 0; }
  .topbar-actions .btn { font-size: 0; gap: 0; width: 40px; height: 40px; padding: 0; }
  .topbar-actions .btn i { font-size: 1rem; }
  .topbar h1 { font-size: 1.1rem; }
  .topbar .subtitle { display: none; }
}

/* -------------------------------------------------------------- Finances */
.pos { color: var(--olive); }
.neg { color: var(--kabyle-red); }
.ledger { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 6px 20px; max-width: 760px; }
.ledger-row { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px dashed var(--line); font-size: .98rem; }
.ledger-row .num { font-weight: 700; }
.ledger-row.total { border-bottom: 0; border-top: 2px solid var(--ink); margin-top: 2px; font-size: 1.15rem; font-weight: 800; color: var(--cedar); }
.ledger-row.total.neg { color: var(--kabyle-red); }
.bars { display: flex; align-items: flex-end; gap: 10px; height: 200px; padding-top: 10px; overflow-x: auto; }
.bar-col { flex: 1 0 44px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; }
.bar { width: 100%; max-width: 46px; background: #b8c8a6; border-radius: 6px 6px 2px 2px; }
.bar-col:hover .bar { background: var(--olive); }
.bar.cur { background: var(--cedar); }
.bar.neg { background: var(--kabyle-red-100); }
.bar-val { font-size: .72rem; color: var(--ink-2); font-weight: 600; }
.bar-lbl { font-size: .75rem; color: var(--ink-3); }

/* --------------------------------------------------------------- Annuaire */
.contact-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; padding: 18px; }
.contact { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 10px; background: #fff; }
.contact-top { display: flex; gap: 12px; align-items: center; }
.contact-top .who { min-width: 0; }
.contact-top strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-lines { list-style: none; margin: 0; padding: 0; font-size: .86rem; display: grid; gap: 4px; }
.contact-lines a, .contact-lines span { display: flex; gap: 8px; align-items: center; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-lines i { width: 16px; text-align: center; color: var(--olive); }
.contact-lines .muted i { color: #c5ccc2; }
.contact-actions { display: flex; gap: 6px; align-items: center; margin-top: auto; }

/* ------------------------------------------------------- Matrice de droits */
.rights td.center, .rights th.center { text-align: center; }
.rights .group-row td { background: var(--olive-50); font-weight: 700; color: var(--cedar); font-size: .82rem; padding-top: 8px; padding-bottom: 8px; }
.rights input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--olive); }
tr.muted td { color: var(--ink-3); }

/* ----------------------------------------------------- Maître / détail */
.master-detail { display: grid; grid-template-columns: 340px 1fr; gap: 16px; align-items: start; }
.master { position: sticky; top: 84px; max-height: calc(100vh - 110px); display: flex; flex-direction: column; overflow: hidden; }
.master-list { list-style: none; margin: 0; padding: 6px; overflow-y: auto; }
.master-list a { display: flex; flex-direction: column; padding: 9px 12px; border-radius: var(--radius); text-decoration: none; color: var(--ink); }
.master-list a:hover { background: var(--olive-50); }
.master-list a.active { background: var(--cedar); color: #fff; }
.master-list a.active .muted { color: #c9d6c6; }
.detail .card-head .avatar { width: 48px; height: 48px; font-size: 1.05rem; }
@media (max-width: 900px) { .master-detail { grid-template-columns: 1fr; } .master { position: static; max-height: 360px; } }

/* ---------------------------------------------------------------- Projets */
.type-bars { display: grid; gap: 4px; }
.type-row { display: grid; grid-template-columns: 170px 1fr 150px; gap: 14px; align-items: center; padding: 7px 8px; border-radius: var(--radius-s); text-decoration: none; color: var(--ink); }
.type-row:hover, .type-row.active { background: var(--olive-50); }
.type-row.empty { opacity: .55; }
.type-track { height: 10px; background: var(--line-2); border-radius: 99px; overflow: hidden; }
.type-track span { display: block; height: 100%; border-radius: 99px; }
.projet-desc { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 600px) { .type-row { grid-template-columns: 1fr auto; } .type-track { grid-column: 1 / -1; order: 3; } }

/* ------------------------------------------------------------------ Cartes */
.map-layout { display: grid; grid-template-columns: 1fr 300px; gap: 16px; height: calc(100vh - 150px); min-height: 480px; }
.map-card { overflow: hidden; }
#map { width: 100%; height: 100%; min-height: 420px; }
.map-side { display: flex; flex-direction: column; overflow: hidden; }
.city-rank { list-style: none; margin: 0; padding: 6px; overflow-y: auto; }
.city-rank button { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 10px; border: 0; background: none; border-radius: var(--radius-s); font: inherit; text-align: left; cursor: pointer; }
.city-rank button:hover { background: var(--olive-50); }
.map-bubble { display: grid; place-items: center; border-radius: 50%; background: var(--olive); color: #fff; font-weight: 800; font-size: .85rem; border: 3px solid #fff; box-shadow: 0 2px 8px rgba(16,36,26,.35); }
.map-bubble.cluster { background: var(--cedar); border-color: var(--saffron); }
.map-pop ul { list-style: none; margin: 8px 0 0; padding: 0; max-height: 200px; overflow-y: auto; font-size: .85rem; }
.map-pop li { padding: 3px 0; border-bottom: 1px solid var(--line-2); }
.map-pop .input { margin-top: 8px; }
.leaflet-container { font-family: var(--font); }
@media (max-width: 900px) { .map-layout { grid-template-columns: 1fr; height: auto; } .map-card { height: 60vh; } .map-side { max-height: 320px; } }

/* ------------------------------------------------------- Aperçu notification */
.push-preview { display: flex; gap: 12px; align-items: flex-start; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow-2); max-width: 380px; }
.push-preview img { border-radius: 10px; }
.push-preview p { margin: 2px 0 0; font-size: .88rem; color: var(--ink-2); }
code { background: var(--line-2); padding: 1px 5px; border-radius: 4px; font-size: .85em; }

/* ---- Administration du site : vignettes ---- */
.thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line, #dfe3dc); display: inline-block; vertical-align: middle; background: var(--stone, #f3f4f1); }
.thumb-empty { display: inline-grid; place-items: center; color: #9aa59a; }

/* ---- Validation des adhésions ---- */
.request-list { display: grid; gap: 14px; }
.request-head { display: flex; align-items: center; gap: 14px; }
.request-head h3 { margin: 0; font-size: 1.1rem; }
.request-head p { margin: 2px 0 0; }
.avatar-lg { width: 52px; height: 52px; font-size: 1.1rem; }
.request .facts { margin: 16px 0; }

/* ---- Inscriptions fête ---- */
.select-sm { padding: 5px 26px 5px 8px; font-size: .85rem; min-width: 62px; }
.yn { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: #fff; }
.yn label { cursor: pointer; }
.yn input { position: absolute; opacity: 0; pointer-events: none; }
.yn span { display: block; padding: 4px 11px; font-size: .8rem; font-weight: 700; color: var(--ink-3); }
.yn input:checked + span { background: var(--cedar); color: #fff; }
.yn input[value="N"]:checked + span { background: var(--line-2); color: var(--ink-2); }
.yn input:focus-visible + span { outline: 2px solid var(--saffron); outline-offset: -2px; }
.yn input:disabled + span { cursor: default; opacity: .75; }
.foyer-ins { scroll-margin-top: 80px; }
.foyer-ins .card-head { flex-wrap: wrap; }
.foyer-ins .card-head .actions { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; }
.foyer-ins.is-ro .ins-table { background: #fbfcfa; }
.foyer-ins > .chips { padding: 12px 18px 0; }
.foyer-ins > .chips span { display: inline-flex; gap: 6px; align-items: center; padding: 4px 10px; border-radius: 999px; background: var(--olive-50); color: var(--cedar); font-size: .82rem; font-weight: 600; }
.foyer-ins > .chips .chip-strong { background: var(--saffron-100); color: #6d4d06; }
.ins-table td { vertical-align: middle; }
.ins-foot { display: grid; gap: 12px; border-top: 1px solid var(--line-2); }
.ins-invites ul { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; }
.ins-invites li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px; border-radius: var(--radius-s); background: var(--stone); }
.ins-add > summary { cursor: pointer; font-weight: 700; color: var(--olive); font-size: .9rem; }
.ins-add-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin-top: 10px; }
.ins-total { display: flex; align-items: center; justify-content: flex-end; gap: 14px; flex-wrap: wrap; }
.ins-total strong { font-size: 1.1rem; color: var(--cedar); }
@media (max-width: 700px) { .hide-sm { display: none !important; } }

/* ---- Plan de table ---- */
.floor { display: grid; grid-template-columns: repeat(auto-fill, minmax(82px, 1fr)); gap: 10px; margin: 18px 0; padding: 16px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-l); }
.floor-table { display: grid; justify-items: center; gap: 2px; text-decoration: none; color: var(--ink-2); border-radius: var(--radius); padding: 4px; }
.floor-table:hover, .floor-table:focus-visible { background: var(--olive-50); }
.floor-table svg { width: 64px; height: 64px; }
.floor-table .dot { fill: #fff; stroke: #c9d1c3; stroke-width: 1.2; }
.floor-table .dot.on { fill: var(--olive); stroke: var(--olive); }
.floor-table .top { fill: var(--stone); stroke: var(--cedar); stroke-width: 1.5; }
.floor-table text { font: 800 14px var(--font); fill: var(--cedar); }
.floor-count { font-size: .75rem; font-weight: 700; }
.print-title { display: none; }
.unplaced { margin-bottom: 16px; border-color: var(--saffron); }
.unplaced.is-empty { display: none; }
.ptables { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.ptable { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 14px; scroll-margin-top: 80px; transition: box-shadow .2s, border-color .2s; }
.ptable:target { box-shadow: 0 0 0 3px var(--saffron); }
.ptable header { display: flex; align-items: baseline; justify-content: space-between; }
.ptable h3 { margin: 0; font-size: 1rem; color: var(--cedar); }
.pt-occ { font-weight: 800; font-size: .85rem; color: var(--ink-2); }
.pt-meter { height: 5px; border-radius: 99px; background: var(--line-2); margin: 8px 0 10px; overflow: hidden; }
.pt-meter span { display: block; height: 100%; background: var(--olive); transition: width .2s; }
.ptable.is-full .pt-meter span { background: var(--saffron); }
.ptable.is-over { border-color: var(--kabyle-red); }
.ptable.is-over .pt-meter span { background: var(--kabyle-red); }
.ptable.is-refused { animation: refuse .4s; border-color: var(--kabyle-red); }
@keyframes refuse { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.pt-foyers { display: grid; gap: 8px; min-height: 44px; }
.pt-empty { display: none; margin: 0; font-size: .8rem; color: var(--ink-3); text-align: center; padding: 10px; border: 1.5px dashed var(--line); border-radius: var(--radius); }
.ptable { position: relative; }
.ptable.is-vacant .pt-empty { display: block; position: absolute; left: 14px; right: 14px; bottom: 14px; pointer-events: none; }
.pf { border: 1px solid var(--line-2); border-radius: var(--radius); background: #fcfdfb; }
.pf-head { display: flex; align-items: center; gap: 8px; padding: 7px 10px; font-weight: 700; font-size: .86rem; color: var(--cedar); cursor: grab; border-bottom: 1px solid var(--line-2); background: var(--olive-50); border-radius: var(--radius) var(--radius) 0 0; }
.pf-head span:first-of-type { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-grip { color: var(--ink-3); }
.pf-people { list-style: none; margin: 0; padding: 4px; min-height: 30px; }
.seat { display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 0 8px; padding: 5px 6px; border-radius: var(--radius-s); cursor: grab; font-size: .85rem; touch-action: none; }
.seat:hover { background: var(--stone); }
.seat-n { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: .7rem; font-weight: 800; background: var(--line-2); color: var(--ink-2); grid-row: span 2; }
.seat.is-resp .seat-n { background: var(--cedar); color: #fff; }
.seat.is-guest .seat-n { background: var(--saffron-100); color: #6d4d06; }
.seat-name { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat-type { grid-column: 2; font-size: .72rem; color: var(--ink-3); }
.seat-com { grid-column: 3; grid-row: 1 / span 2; color: var(--saffron); }
.is-ghost { opacity: .4; background: var(--saffron-100) !important; }
@media print {
  .no-print, .sidebar, .topbar, .kids-room, .flash-stack, .to-top, .pt-empty, .pt-meter { display: none !important; }
  .main { margin: 0 !important; } .content { padding: 0 !important; }
  .print-title { display: block; font-size: 18pt; font-weight: 800; color: #1f3d2b; margin-bottom: 10px; }
  .ptables { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .ptable { break-inside: avoid; padding: 8px; border-color: #999; }
  .ptable.is-vacant { display: none; }
  .seat { padding: 1px 4px; font-size: 9pt; } .seat-type { font-size: 7.5pt; }
}

/* ---- Accueil des invités ---- */
.welcome-board { display: flex; gap: 28px; align-items: center; flex-wrap: wrap; background: var(--cedar); color: #fff; border-radius: var(--radius-l); padding: 20px 24px; position: relative; overflow: hidden; }
.welcome-board::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 8px; background: var(--motif) repeat-x center / 16px 8px; opacity: .6; }
.wb-progress { position: relative; width: 110px; height: 110px; flex: none; }
.wb-progress svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.wb-progress .ring-bg { fill: none; stroke: rgba(255,255,255,.14); stroke-width: 10; }
.wb-progress .ring { fill: none; stroke: var(--saffron); stroke-width: 10; stroke-linecap: round; transition: stroke-dasharray .4s; }
.wb-progress > div { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.wb-progress strong { font-size: 1.6rem; line-height: 1; }
.wb-progress span { font-size: .75rem; opacity: .8; }
.wb-stats { display: grid; grid-template-columns: repeat(4, minmax(80px, 1fr)); gap: 18px; margin: 0; flex: 1; }
.wb-stats dt { font-size: .8rem; opacity: .75; }
.wb-stats dd { margin: 0; font-size: 1.9rem; font-weight: 800; }
.wb-tools { margin: 16px 0; position: sticky; top: 64px; z-index: 5; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; margin-bottom: 1px; }
.seg input { position: absolute; opacity: 0; }
.seg span { display: block; padding: 9px 13px; font-size: .85rem; font-weight: 700; color: var(--ink-3); cursor: pointer; }
.seg input:checked + span { background: var(--cedar); color: #fff; }
.seg input:focus-visible + span { outline: 2px solid var(--saffron); outline-offset: -2px; }
.wb-list { display: grid; gap: 12px; }
.wb-foyer { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-l); overflow: hidden; }
.wb-foyer header { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.wb-foyer header > div { flex: 1; min-width: 160px; }
.wb-foyer h3 { margin: 0; font-size: 1rem; color: var(--cedar); }
.wb-table { font-weight: 700; font-size: .85rem; color: var(--olive); }
.wb-foyer ul { list-style: none; margin: 0; padding: 0; }
.wb-person { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--line-2); }
.wb-person:first-child { border-top: 0; }
.wb-name { flex: 1; display: grid; min-width: 0; }
.wb-state { font-size: .78rem; font-weight: 800; }
.wb-person[data-statut="present"] { background: var(--olive-50); }
.wb-person[data-statut="present"] .wb-state { color: var(--olive); }
.wb-person[data-statut="absent"] { background: #fbf4f2; }
.wb-person[data-statut="absent"] .wb-state { color: var(--kabyle-red); }
.wb-actions { display: flex; gap: 6px; }
.wb-undo { display: none !important; }
.wb-person[data-statut="present"] .wb-ok, .wb-person[data-statut="present"] .wb-abs,
.wb-person[data-statut="absent"] .wb-ok, .wb-person[data-statut="absent"] .wb-abs { display: none; }
.wb-person[data-statut="present"] .wb-undo, .wb-person[data-statut="absent"] .wb-undo { display: inline-flex !important; }
@media (max-width: 700px) {
  .wb-stats { grid-template-columns: repeat(2, 1fr); }
  .wb-tools { top: 56px; }
  .seg span { padding: 8px 9px; font-size: .8rem; }
  .wb-person { flex-wrap: wrap; } .wb-actions { width: 100%; justify-content: flex-end; }
}

/* ---- Éditions ---- */
.ed-types { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.ed-type input { position: absolute; opacity: 0; }
.ed-type > span { display: grid; gap: 4px; height: 100%; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-l); background: var(--paper); cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.ed-type i { font-size: 1.2rem; color: var(--olive); }
.ed-type small { color: var(--ink-3); font-size: .8rem; line-height: 1.4; }
.ed-type input:checked + span { border-color: var(--cedar); box-shadow: inset 0 0 0 1px var(--cedar); background: var(--olive-50); }
.ed-type input:focus-visible + span { outline: 2px solid var(--saffron); outline-offset: 2px; }
.ed-fams { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 6px 14px; max-height: 210px; overflow: auto; padding: 10px; border: 1px solid var(--line-2); border-radius: var(--radius); }
.ed-preview { margin-bottom: 12px; }
.ed-foyer { padding: 8px 18px; font-weight: 700; font-size: .85rem; color: var(--cedar); background: var(--olive-50); border-top: 1px solid var(--line-2); }
.ed-foyer .ok { color: var(--olive); } .ed-foyer .non { color: var(--kabyle-red); }
.yst { font-size: .72rem; font-weight: 800; }
.yst-paid { color: var(--olive); } .yst-open, .yst-closed { color: var(--kabyle-red); } .yst-exo { color: #8a6208; }

/* ---- Procès-verbal ---- */
.pv-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 18px; align-items: start; }
.pv-step { font-size: .95rem; color: var(--cedar); margin: 18px 0 10px; padding-top: 14px; border-top: 1px solid var(--line-2); }
.pv-step:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.pv-paper { position: sticky; top: 80px; background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 28px 30px; box-shadow: var(--shadow-1, 0 1px 3px rgba(0,0,0,.08)); font-size: .9rem; line-height: 1.55; max-height: calc(100vh - 110px); overflow: auto; border-top: 6px solid var(--cedar); }
.pv-paper h2 { font-size: 1.1rem; color: var(--cedar); margin: 0; }
.pv-paper .pv-asso { color: var(--ink-3); margin: 2px 0 14px; }
.pv-paper h3 { font-size: .9rem; color: var(--cedar); margin: 16px 0 4px; padding-bottom: 3px; border-bottom: 2px solid var(--saffron); }
.pv-paper .pre { white-space: pre-line; margin: 0; }
.pv-paper ol { margin: 0; padding-left: 20px; }
@media (max-width: 1000px) { .pv-layout { grid-template-columns: 1fr; } .pv-paper { position: static; max-height: none; } }
.diag { list-style: none; margin: 0; padding: 4px 0; }
.diag li { display: grid; grid-template-columns: 22px 220px 1fr; gap: 10px; align-items: center; padding: 9px 18px; border-top: 1px solid var(--line-2); }
.diag li:first-child { border-top: 0; }
.diag .ok { color: var(--olive); } .diag .warn { color: var(--saffron); }
.diag-trg { border-top: 1px solid var(--line-2); padding: 10px 18px; }
.diag-trg pre { white-space: pre-wrap; font-size: .78rem; background: var(--stone); padding: 10px; border-radius: var(--radius-s); max-height: 260px; overflow: auto; }
@media (max-width: 700px) { .diag li { grid-template-columns: 22px 1fr; } .diag li span { grid-column: 2; } }
@media (max-width: 700px) {
  .ins-table thead { display: none; }
  .ins-table, .ins-table tbody { display: block; }
  .ins-table tr { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; padding: 12px 16px; border-bottom: 1px solid var(--line-2); }
  .ins-table td { display: grid; gap: 4px; padding: 0; border: 0; }
  .ins-table td[data-label]::before { content: attr(data-label); font-size: .72rem; font-weight: 700; color: var(--ink-3); }
  .ins-table .ins-who, .ins-table .ins-com { grid-column: 1 / -1; }
  .ins-table .select-sm, .ins-table .input-sm { width: 100% !important; }
}
.ins-table .yn { justify-self: start; }
