/* =========================================================
   TONTINE DE P - Caisse commune CODM
   Thème unique : HUD sombre militaire, accent orange.
   Rayons : conteneurs et boutons 6px, pastilles de statut en
   pilule (règle documentée). Aucune autre valeur de rayon.
   ========================================================= */

:root {
  --bg: #0d0f13;
  --bg-2: #10131a;
  --surface: #151920;
  --surface-2: #1b202a;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);

  --text: #e9ecf1;
  --muted: #a3abb6;
  --faint: #77808c;

  --accent: #e78a2e;
  --accent-strong: #f0a44f;
  --accent-soft: rgba(231, 138, 46, 0.14);
  --accent-ink: #1d1206;

  --ok: #4fae77;
  --ok-soft: rgba(79, 174, 119, 0.14);
  --late: #c9a13d;
  --late-soft: rgba(201, 161, 61, 0.14);
  --bad: #d05c50;
  --bad-soft: rgba(208, 92, 80, 0.16);

  --radius: 6px;
  --cut: 16px;

  --f-display: "Rajdhani", "Arial Narrow", sans-serif;
  --f-body: "Outfit", "Helvetica Neue", Arial, sans-serif;

  --shadow: 0 10px 30px rgba(4, 6, 10, 0.45);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  --sidebar-w: 248px;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { color-scheme: dark; }

body {
  margin: 0;
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(231, 138, 46, 0.06), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: var(--f-body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--f-display);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.15;
  margin: 0;
}

p { margin: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; }
i.ph-bold { flex-shrink: 0; }

::selection { background: var(--accent); color: var(--accent-ink); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius);
}

/* =========== Structure =========== */

.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100dvh;
}

.view {
  padding: 32px 36px 64px;
  max-width: 1160px;
  width: 100%;
  margin: 0 auto;
  outline: none;
}

@media (prefers-reduced-motion: no-preference) {
  .view > * { animation: rise 0.3s var(--ease) both; }
  .view > *:nth-child(2) { animation-delay: 0.04s; }
  .view > *:nth-child(3) { animation-delay: 0.08s; }
  .view > *:nth-child(4) { animation-delay: 0.12s; }
  .view > *:nth-child(5) { animation-delay: 0.16s; }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* =========== Barre latérale =========== */

.sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px 18px;
  background: var(--bg-2);
  border-right: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  padding: 4px 6px;
}

.logo-hex {
  display: grid;
  place-items: center;
  width: 42px;
  height: 46px;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  background: linear-gradient(160deg, var(--accent-strong), var(--accent) 60%, #b76a1e);
  color: var(--accent-ink);
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 22px;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong {
  font-family: var(--f-display);
  font-size: 19px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.brand-text small { color: var(--faint); font-size: 12px; }

.nav { display: flex; flex-direction: column; gap: 2px; }

.nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius);
  border-left: 2px solid transparent;
  text-decoration: none;
  color: var(--muted);
  font-weight: 500;
  transition: background 0.18s var(--ease), color 0.18s var(--ease);
}

.nav a i { font-size: 18px; }
.nav a:hover { background: rgba(255, 255, 255, 0.04); color: var(--text); }
.nav a.active {
  background: var(--accent-soft);
  border-left-color: var(--accent);
  color: var(--accent-strong);
}

.nav-badge {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--bad);
  color: #fff;
  font-size: 11.5px;
  font-weight: 600;
}

.sidebar-foot {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
}

.sidebar-foot .foot-line { display: flex; justify-content: space-between; gap: 8px; }
.sidebar-foot .foot-line strong { color: var(--text); font-family: var(--f-display); font-size: 15px; }

/* =========== Barre haute + nav basse (mobile) =========== */

.topbar, .bottomnav { display: none; }

/* =========== Cartes & blocs =========== */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}

.card + .card, .card + .block, .block + .card, .block + .block { margin-top: 18px; }

.card-cut {
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, 0 100%);
  border-left: 2px solid var(--accent);
}

.card-hero {
  position: relative;
  background:
    repeating-linear-gradient(-55deg, rgba(255, 255, 255, 0.016) 0 2px, transparent 2px 6px),
    linear-gradient(140deg, var(--surface-2), var(--surface) 55%);
  padding: 26px;
  overflow: hidden;
}

.view-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.view-head h2 { font-size: 26px; font-weight: 700; }
.view-head .view-sub { color: var(--muted); margin-top: 4px; font-size: 14px; }
.view-head .view-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.section-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  margin: 26px 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title i { color: var(--accent); font-size: 18px; }

/* =========== Boutons =========== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  background: var(--surface-2);
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  font-family: var(--f-body);
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.15s var(--ease), background 0.18s var(--ease),
              border-color 0.18s var(--ease), color 0.18s var(--ease);
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: scale(0.98); }
.btn:disabled, .btn[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn i { font-size: 17px; }

.btn-primary {
  background: linear-gradient(160deg, var(--accent-strong), var(--accent));
  color: var(--accent-ink);
}
.btn-primary:hover { background: linear-gradient(160deg, #f4af62, var(--accent-strong)); }

.btn-ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--muted);
}
.btn-ghost:hover { color: var(--text); border-color: rgba(255, 255, 255, 0.25); }

.btn-danger { background: var(--bad); color: #fff; }
.btn-danger.btn-outline {
  background: transparent;
  border-color: var(--bad);
  color: var(--bad);
}
.btn-danger.btn-outline:hover { background: var(--bad-soft); }

.btn-small { padding: 6px 12px; font-size: 13px; }
.btn-icon { padding: 9px; }
.btn-icon.btn-small { padding: 6px; }

.btn-whats {
  background: transparent;
  border-color: rgba(79, 174, 119, 0.5);
  color: var(--ok);
}
.btn-whats:hover { background: var(--ok-soft); }

/* =========== Pastilles de statut (pilules) =========== */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: default;
  white-space: nowrap;
}

button.chip { cursor: pointer; transition: transform 0.15s var(--ease); }
button.chip:hover { transform: translateY(-1px); }
button.chip:active { transform: scale(0.97); }

.chip i { font-size: 14px; }
.chip-ok    { background: var(--ok-soft);   border-color: rgba(79, 174, 119, 0.45); color: var(--ok); }
.chip-late  { background: var(--late-soft); border-color: rgba(201, 161, 61, 0.45); color: var(--late); }
.chip-bad   { background: var(--bad-soft);  border-color: rgba(208, 92, 80, 0.5);   color: #e2837a; }
.chip-idle  { background: rgba(255, 255, 255, 0.04); }
.chip-accent { background: var(--accent-soft); border-color: rgba(231, 138, 46, 0.5); color: var(--accent-strong); }

.arme-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(231, 138, 46, 0.1);
  border: 1px solid rgba(231, 138, 46, 0.32);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 600;
}
.arme-tag i { font-size: 13px; }

.badge-role {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line-strong);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* =========== Avatars =========== */

.avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 44px;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
  text-transform: uppercase;
}

.avatar-lg { width: 54px; height: 60px; font-size: 20px; }
.avatar-sm { width: 30px; height: 33px; font-size: 12px; }

/* Emblème d'opérateur : il remplit tout l'hexagone */
.avatar-svg { width: 100%; height: 100%; display: block; }

/* Teintes d'identité des membres (données, pas déco) */
.hue-0 { background: #2b3a4d; color: #9fc2e8; }
.hue-1 { background: #30443a; color: #9fd8b4; }
.hue-2 { background: #4a3a2b; color: #e8c49f; }
.hue-3 { background: #45303d; color: #e0a9c7; }
.hue-4 { background: #2b4448; color: #9fdbe2; }
.hue-5 { background: #3d3d2c; color: #d6d69a; }
.hue-6 { background: #402f2c; color: #e2ab9f; }
.hue-7 { background: #35314a; color: #b7ade4; }

/* =========== Tableau de bord =========== */

.hero-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 18px;
  align-items: stretch;
}

.hero-label {
  color: var(--faint);
  font-size: 12.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-bottom: 8px;
}

.hero-amount {
  font-family: var(--f-display);
  font-size: clamp(38px, 5vw, 52px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.01em;
}

.hero-amount small {
  font-size: 0.42em;
  color: var(--muted);
  font-weight: 600;
  margin-left: 6px;
}

.hero-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.progress {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
  margin-top: 18px;
}

.progress > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
  transition: width 0.5s var(--ease);
}

.progress-note {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
  margin-top: 8px;
}

.benef-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  justify-content: space-between;
}

.benef-id { display: flex; align-items: center; gap: 14px; }
.benef-id .pseudo { font-family: var(--f-display); font-size: 21px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; }
.benef-id .nom { color: var(--muted); font-size: 13px; }

.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.stat-cell { padding: 16px 20px; }
.stat-cell + .stat-cell { border-left: 1px solid var(--line); }
.stat-cell .stat-label { color: var(--faint); font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 600; }
.stat-cell .stat-value {
  font-family: var(--f-display);
  font-size: 26px;
  font-weight: 700;
  margin-top: 4px;
  line-height: 1.1;
}
.stat-cell .stat-value small { font-size: 0.55em; color: var(--muted); font-weight: 600; }
.stat-cell .stat-sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
}

/* =========== Listes de personnes / paiements =========== */

.row-list { display: flex; flex-direction: column; }

.p-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 4px;
}

.p-row + .p-row { border-top: 1px solid var(--line); }

.p-row .p-id { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.p-row .p-name { min-width: 0; }
.p-row .p-name .pseudo { font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.p-row .p-name .sub { color: var(--faint); font-size: 12.5px; }
.p-row .p-side { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }

/* =========== Membres =========== */

.member-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.member-card { display: flex; flex-direction: column; gap: 12px; }
.member-top { display: flex; align-items: center; gap: 12px; }
.member-top .info { min-width: 0; flex: 1; }
.member-top .pseudo { font-family: var(--f-display); font-size: 18px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.member-top .nom { color: var(--muted); font-size: 13px; }

.member-facts { display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; color: var(--muted); }
.member-facts .fact { display: flex; align-items: center; gap: 8px; }
.member-facts .fact i { color: var(--faint); font-size: 15px; }
.member-facts .fact strong { color: var(--text); font-weight: 600; }

.member-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 4px; }

.fiab { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.fiab i { color: var(--accent); }
.fiab strong { color: var(--text); }

/* =========== Tours / ordre de passage =========== */

.tour-list { display: flex; flex-direction: column; gap: 10px; }

.tour-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.tour-item.current {
  border-color: rgba(231, 138, 46, 0.55);
  background: linear-gradient(140deg, rgba(231, 138, 46, 0.08), var(--surface) 60%);
}

.tour-item.done { opacity: 0.72; }

.tour-num {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 20px;
  color: var(--faint);
  width: 34px;
  text-align: center;
  flex-shrink: 0;
}
.tour-item.current .tour-num { color: var(--accent-strong); }

.tour-info { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; }
.tour-who { min-width: 0; }
.tour-who .pseudo { font-weight: 600; }
.tour-who .sub { color: var(--faint); font-size: 12.5px; }
.tour-side { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.tour-reorder { display: flex; flex-direction: column; gap: 2px; }

/* =========== Journal =========== */

.journal-list { display: flex; flex-direction: column; }

.journal-item {
  display: flex;
  gap: 14px;
  padding: 13px 4px;
  align-items: flex-start;
}
.journal-item + .journal-item { border-top: 1px solid var(--line); }

.journal-ico {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--accent);
  font-size: 16px;
  flex-shrink: 0;
}

.journal-txt { flex: 1; min-width: 0; }
.journal-txt .msg { font-size: 14px; }
.journal-txt .when { color: var(--faint); font-size: 12px; margin-top: 2px; }

/* =========== Règlement =========== */

.article { padding: 18px 0; }
.article + .article { border-top: 1px solid var(--line); }
.article h3 { font-size: 16px; color: var(--accent-strong); margin-bottom: 8px; }
.article p, .article li { color: var(--muted); font-size: 14.5px; }
.article ul { margin: 8px 0 0; padding-left: 20px; }
.article li + li { margin-top: 5px; }
.article strong { color: var(--text); }

.steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.step-card { display: flex; flex-direction: column; gap: 8px; }
.step-card i { font-size: 24px; color: var(--accent); }
.step-card h3 { font-size: 15px; }
.step-card p { color: var(--muted); font-size: 13.5px; }

/* =========== Formulaires =========== */

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }

.field label { font-weight: 600; font-size: 13.5px; }
.field label .req { color: var(--faint); font-weight: 500; font-size: 12px; margin-left: 4px; }

.field input, .field select, .field textarea {
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
  width: 100%;
  transition: border-color 0.18s var(--ease);
}

.field input::placeholder, .field textarea::placeholder { color: var(--faint); }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.field input[aria-invalid="true"] { border-color: var(--bad); }

.field-hint { color: var(--faint); font-size: 12.5px; }
.field-error { color: #e2837a; font-size: 12.5px; font-weight: 500; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-grid .field-full { grid-column: 1 / -1; }

/* =========== Boîtes de dialogue =========== */

.dlg {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 0;
  width: min(520px, calc(100vw - 32px));
  box-shadow: var(--shadow);
}

.dlg::backdrop { background: rgba(5, 7, 10, 0.72); }

.dlg-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px 0;
}
.dlg-head h2 { font-size: 19px; }

.dlg-body { padding: 18px 22px; }
.dlg-body h2 { font-size: 19px; margin-bottom: 6px; }
.dlg-body p { color: var(--muted); }

.dlg-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 0 22px 20px;
  flex-wrap: wrap;
}
.dlg-foot-spacer { flex: 1; }

.dlg-wizard { width: min(620px, calc(100vw - 32px)); }

.wizard-steps {
  display: flex;
  gap: 6px;
  padding: 18px 22px 0;
}
.wizard-steps span {
  height: 4px;
  flex: 1;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
}
.wizard-steps span.on { background: var(--accent); }

.wizard-welcome { text-align: center; padding: 38px 30px 30px; }
.wizard-welcome .logo-hex { width: 64px; height: 70px; font-size: 32px; margin: 0 auto 18px; }
.wizard-welcome h2 { font-size: 28px; }
.wizard-welcome .lead { color: var(--muted); margin: 10px auto 24px; max-width: 40ch; }
.wizard-welcome .dlg-foot { justify-content: center; padding: 0; }

.wizard-member-list { display: flex; flex-direction: column; margin-bottom: 14px; }

.tirage-body { text-align: center; padding: 30px 26px 24px; }
.tirage-sub { color: var(--muted); margin-top: 4px; }

.tirage-slot {
  margin: 22px auto 8px;
  padding: 18px 14px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  font-family: var(--f-display);
  font-size: 30px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent-strong);
  min-height: 72px;
  display: grid;
  place-items: center;
}

.tirage-result {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}

.tirage-result li {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 12px;
}

@media (prefers-reduced-motion: no-preference) {
  .tirage-result li { animation: rise 0.3s var(--ease) both; }
}

.tirage-result .rank {
  font-family: var(--f-display);
  font-weight: 700;
  color: var(--accent);
  width: 26px;
  text-align: center;
}

.tirage-foot { justify-content: center; padding: 18px 0 0; }

/* =========== Onglets de tours (cotisations) =========== */

.tour-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 16px;
  scrollbar-width: thin;
}

.tour-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--muted);
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.18s var(--ease), color 0.18s var(--ease);
}

.tour-tab i { font-size: 14px; }
.tour-tab:hover { color: var(--text); }
.tour-tab.on {
  border-color: var(--accent);
  color: var(--accent-strong);
  background: var(--accent-soft);
}

/* =========== États vides =========== */

.empty {
  text-align: center;
  padding: 44px 24px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
}
.empty i { font-size: 34px; color: var(--faint); display: block; margin-bottom: 10px; }
.empty h3 { font-size: 17px; color: var(--text); margin-bottom: 6px; }
.empty p { font-size: 14px; max-width: 46ch; margin: 0 auto; }
.empty .btn { margin-top: 16px; }

/* =========== Toasts =========== */

.toasts {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 50;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 12px 16px;
  box-shadow: var(--shadow);
  font-size: 14px;
  max-width: 340px;
}

.toast.ok { border-left-color: var(--ok); }
.toast.bad { border-left-color: var(--bad); }
.toast i { font-size: 17px; color: var(--accent); }
.toast.ok i { color: var(--ok); }
.toast.bad i { color: var(--bad); }

@media (prefers-reduced-motion: no-preference) {
  .toast { animation: toast-in 0.3s var(--ease) both; }
  @keyframes toast-in {
    from { opacity: 0; transform: translateX(16px); }
    to   { opacity: 1; transform: translateX(0); }
  }
}

/* =========== Divers =========== */

.note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--accent-soft);
  border: 1px solid rgba(231, 138, 46, 0.3);
  border-radius: var(--radius);
  padding: 12px 14px;
  color: var(--muted);
  font-size: 13.5px;
}
.note i { color: var(--accent); font-size: 16px; margin-top: 1px; }
.note strong { color: var(--text); }

.danger-zone { border-color: rgba(208, 92, 80, 0.4); }
.danger-zone h3 { color: #e2837a; }

.mono-num { font-family: var(--f-display); font-weight: 600; }

.txt-muted { color: var(--muted); }
.txt-faint { color: var(--faint); }
.txt-ok { color: var(--ok); }
.txt-bad { color: #e2837a; }

hr.sep { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }

.sheet-nav { display: flex; flex-direction: column; gap: 4px; padding: 16px; }
.sheet-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
}
.sheet-nav a:hover { background: rgba(255, 255, 255, 0.05); }
.sheet-nav a i { color: var(--accent); font-size: 19px; }
.sheet-nav .btn { margin-top: 10px; }

.dlg-sheet {
  width: min(420px, calc(100vw - 24px));
  margin-bottom: 16px;
}

/* =========== Impression (règlement) =========== */

@media print {
  body { background: #fff; color: #111; }
  .sidebar, .topbar, .bottomnav, .view-head .view-actions, .toasts { display: none !important; }
  .app { display: block; }
  .view { padding: 0; max-width: none; }
  .card { border-color: #ccc; background: #fff; }
  .article h3 { color: #a35a12; }
  .article p, .article li { color: #333; }
}

/* =========== Adaptation mobile =========== */

@media (max-width: 980px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    padding-top: calc(10px + env(safe-area-inset-top));
    background: rgba(13, 15, 19, 0.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
  }

  .topbar-title { font-size: 18px; flex: 1; }
  .topbar .logo-hex { width: 34px; height: 38px; font-size: 17px; }

  .bottomnav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    background: rgba(16, 19, 26, 0.96);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom);
  }

  .bottomnav a, .bottomnav button {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 9px 4px 8px;
    text-decoration: none;
    color: var(--faint);
    font-size: 10.5px;
    font-weight: 600;
    background: none;
    border: none;
    cursor: pointer;
  }

  .bottomnav a i, .bottomnav button i { font-size: 20px; }
  .bottomnav a.active { color: var(--accent-strong); }

  .view { padding: 18px 14px 96px; }

  .hero-grid, .two-col, .form-grid { grid-template-columns: 1fr; }
  .stat-strip { grid-template-columns: 1fr 1fr; }
  .stat-cell:nth-child(2n + 1) { border-left: none; }
  .stat-cell:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .steps-grid { grid-template-columns: 1fr; }
  .member-grid { grid-template-columns: 1fr; }

  .view-head h2 { font-size: 22px; }
  .hero-amount { font-size: 38px; }

  .p-row { flex-wrap: wrap; }
  .p-row .p-side { width: 100%; justify-content: flex-start; padding-left: 52px; }

  .tour-item { flex-wrap: wrap; }
  .tour-side { width: 100%; justify-content: flex-start; padding-left: 50px; }

  .toasts { left: 14px; right: 14px; bottom: calc(78px + env(safe-area-inset-bottom)); }
  .toast { max-width: none; }

  .dlg-sheet {
    margin: auto auto 0;
    width: 100vw;
    max-width: none;
    border-radius: var(--radius) var(--radius) 0 0;
    border-bottom: none;
  }
}

@media (max-width: 420px) {
  .stat-strip { grid-template-columns: 1fr 1fr; }
  .view-head { flex-direction: column; align-items: flex-start; }
}

/* =========================================================
   Modes d'affichage : app (connecté), connexion, public
   ========================================================= */

body[data-mode="public"] .sidebar,
body[data-mode="connexion"] .sidebar,
body[data-mode="public"] .bottomnav,
body[data-mode="connexion"] .bottomnav { display: none; }

body[data-mode="public"] .app,
body[data-mode="connexion"] .app { grid-template-columns: 1fr; }

body[data-mode="public"] .topbar,
body[data-mode="connexion"] .topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  padding-top: calc(12px + env(safe-area-inset-top));
  background: rgba(13, 15, 19, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}

body[data-mode="public"] .topbar-title,
body[data-mode="connexion"] .topbar-title { font-size: 18px; flex: 1; }

body[data-mode="public"] .topbar .logo-hex,
body[data-mode="connexion"] .topbar .logo-hex { width: 34px; height: 38px; font-size: 17px; }

body[data-mode="public"] .view,
body[data-mode="connexion"] .view { padding-bottom: 64px; }

.public-wrap { max-width: 680px; margin: 0 auto; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* =========== Écran de connexion =========== */

.connexion {
  min-height: 70dvh;
  display: grid;
  place-items: center;
  padding: 20px 0;
}

.connexion-box {
  width: min(460px, 100%);
  text-align: center;
  padding: 32px 26px;
}

.connexion-box .logo-hex { width: 58px; height: 64px; font-size: 28px; margin: 0 auto 16px; }
.connexion-box h2 { font-size: 24px; }
.connexion-box > .txt-muted { margin-top: 8px; }

.profil-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 22px;
  text-align: left;
}

.profil-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.15s var(--ease), border-color 0.18s var(--ease);
}

.profil-btn:hover { transform: translateY(-1px); border-color: var(--accent); }
.profil-btn:active { transform: scale(0.99); }
.profil-btn .profil-txt { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.profil-btn .pseudo { font-weight: 600; }
.profil-btn .sub { color: var(--faint); font-size: 12.5px; }
.profil-btn > i { color: var(--faint); font-size: 18px; }

.dlg-code { width: min(400px, calc(100vw - 32px)); }

.code-input {
  text-align: center;
  font-family: var(--f-display);
  font-size: 34px;
  font-weight: 700;
  letter-spacing: 0.4em;
  text-indent: 0.4em;
  padding: 14px 12px;
}

.code-ligne {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 10px 14px;
}

.code-ligne strong {
  font-family: var(--f-display);
  font-size: 22px;
  letter-spacing: 0.22em;
  color: var(--accent-strong);
}

/* =========== Case à cocher =========== */

.check-line {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  cursor: pointer;
  margin-bottom: 16px;
}

.check-line input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--accent);
  flex-shrink: 0;
  cursor: pointer;
}

.check-line span { display: flex; flex-direction: column; gap: 2px; }
.check-line strong { font-size: 14px; font-weight: 600; }
.check-line small { color: var(--faint); font-size: 12.5px; line-height: 1.45; }

.badge-admin {
  background: var(--accent-soft);
  border-color: rgba(231, 138, 46, 0.5);
  color: var(--accent-strong);
}

/* =========== QR code =========== */

.qr-wrap { display: flex; justify-content: center; margin-top: 18px; }

.qr-box {
  background: #fff;
  padding: 12px;
  border-radius: var(--radius);
  line-height: 0;
}

.qr-box svg { width: 200px; height: 200px; display: block; }

/* =========== Espace membre =========== */

.moi-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.moi-head h2 { font-size: 24px; }
.moi-head .view-sub { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.moi-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

.moi-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

.moi-ok {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 18px;
  color: var(--ok);
  font-size: 14px;
  font-weight: 500;
}
.moi-ok i { font-size: 17px; margin-top: 1px; }

.btn-large { padding: 14px 22px; font-size: 15px; }

/* =========== Paiement =========== */

.note-bad {
  background: var(--bad-soft);
  border-color: rgba(208, 92, 80, 0.4);
}
.note-bad i { color: #e2837a; }

/* =========== Page d'accueil du clan =========== */

.landing { max-width: 860px; }

.landing-hero {
  text-align: center;
  padding: 40px 20px 34px;
}

.landing-hero .logo-img { margin: 0 auto 20px; }

.landing-hero h2 {
  font-size: clamp(34px, 7vw, 48px);
  font-weight: 700;
  letter-spacing: 0.06em;
}

.landing-tagline {
  color: var(--accent-strong);
  font-family: var(--f-display);
  font-size: 15px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  margin-top: 8px;
}

.landing-pitch {
  color: var(--muted);
  font-size: 16px;
  max-width: 44ch;
  margin: 16px auto 0;
}

.landing-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 28px;
}

.landing-note {
  color: var(--faint);
  font-size: 13px;
  margin-top: 18px;
  max-width: 46ch;
  margin-left: auto;
  margin-right: auto;
}

.landing-activites {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 12px;
}

.landing-carte { display: flex; flex-direction: column; gap: 10px; }
.landing-carte i { font-size: 26px; color: var(--accent); }
.landing-carte h3 { font-size: 15px; }
.landing-carte p { color: var(--muted); font-size: 13.5px; }


@media (max-width: 720px) {
  .landing-activites { grid-template-columns: 1fr; }
  .landing-hero { padding: 26px 8px 24px; }
  .landing-actions .btn { width: 100%; }
}

/* =========== Logo du clan =========== */

.logo-img { display: block; flex-shrink: 0; }
.logo-grand { margin: 0 auto 16px; }
.wizard-welcome .logo-grand { margin-bottom: 18px; }

/* =========== Scrims et compétitions =========== */

.match-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}

.match-card { display: flex; flex-direction: column; gap: 14px; }

.match-tournoi { border-left: 2px solid var(--accent); }

.match-head { display: flex; align-items: center; gap: 12px; }

.match-ico {
  display: grid;
  place-items: center;
  width: 38px;
  height: 42px;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  background: var(--surface-2);
  color: var(--accent);
  font-size: 18px;
  flex-shrink: 0;
}

.match-titre { flex: 1; min-width: 0; }
.match-titre .pseudo {
  font-family: var(--f-display);
  font-size: 17px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.match-titre .sub { color: var(--muted); font-size: 13px; }

.match-infos {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13.5px;
}
.match-infos span { display: inline-flex; align-items: center; gap: 6px; }
.match-infos i { color: var(--faint); font-size: 15px; }

.match-note {
  color: var(--muted);
  font-size: 13.5px;
  font-style: italic;
  border-left: 2px solid var(--line-strong);
  padding-left: 12px;
}

.match-convoc { display: flex; flex-direction: column; gap: 12px; }
.match-compte { display: flex; gap: 8px; flex-wrap: wrap; }

.match-joueurs { display: flex; gap: 8px; flex-wrap: wrap; }

.joueur-puce {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 12px 4px 4px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--bg-2);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
}

.joueur-puce.ok   { border-color: rgba(79, 174, 119, 0.45); color: var(--ok); }
.joueur-puce.late { border-color: rgba(201, 161, 61, 0.45); color: var(--late); }
.joueur-puce.bad  { border-color: rgba(208, 92, 80, 0.45); color: #e2837a; }

.match-rsvp {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
.rsvp-boutons { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

.match-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 4px;
}

.convoc-ligne { margin-bottom: 6px; padding: 8px 12px; }

/* La règle .check-line span impose une colonne : on la remet en ligne ici */
.check-line .convoc-info {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.check-line .convoc-info > span { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.convoc-info strong { font-size: 14px; }
.convoc-info small { color: var(--faint); font-size: 12px; }

.score-ligne {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 14px;
  margin-bottom: 20px;
}
.score-ligne .field { margin-bottom: 0; }
.score-ligne label { text-align: center; }

.score-input {
  width: 92px;
  text-align: center;
  font-family: var(--f-display);
  font-size: 32px;
  font-weight: 700;
  padding: 8px;
}

.score-sep {
  font-family: var(--f-display);
  font-size: 28px;
  color: var(--faint);
  padding-bottom: 14px;
}

/* =========== Période du cycle =========== */

.cycle-dates {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 16px;
  border-radius: var(--radius);
  border: 1px solid rgba(231, 138, 46, 0.3);
  background: var(--accent-soft);
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.5;
}

.cycle-dates i { color: var(--accent); font-size: 16px; margin-top: 2px; }
.cycle-dates strong { color: var(--text); }

.field input[readonly] {
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  cursor: default;
}

.etat-paiement {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background: var(--bg-2);
  font-size: 13.5px;
  color: var(--muted);
}
.etat-paiement i { font-size: 17px; margin-top: 1px; }
.etat-paiement strong { color: var(--text); }
.etat-paiement.on { border-color: rgba(79, 174, 119, 0.45); background: var(--ok-soft); }
.etat-paiement.on i { color: var(--ok); }
.etat-paiement.demo { border-color: rgba(231, 138, 46, 0.45); background: var(--accent-soft); }
.etat-paiement.demo i { color: var(--accent); }
.etat-paiement.off { border-color: rgba(208, 92, 80, 0.45); background: var(--bad-soft); }
.etat-paiement.off i { color: #e2837a; }

.demo-pay { text-align: center; padding: 30px 26px; }

.demo-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--late-soft);
  border: 1px solid rgba(201, 161, 61, 0.45);
  color: var(--late);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 14px;
}

.demo-lignes { margin-top: 20px; text-align: left; }

.demo-ligne {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  font-size: 14px;
  color: var(--muted);
}
.demo-ligne + .demo-ligne { border-top: 1px solid var(--line); }
.demo-ligne strong { color: var(--text); word-break: break-all; text-align: right; }

.demo-pay .moi-actions { justify-content: center; }

/* =========== Chargement =========== */

.skeleton-bloc {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 18px;
}

.skeleton {
  display: block;
  height: 42px;
  border-radius: var(--radius);
  background: linear-gradient(100deg, var(--surface-2) 30%, rgba(255, 255, 255, 0.07) 50%, var(--surface-2) 70%);
  background-size: 220% 100%;
}

@media (prefers-reduced-motion: no-preference) {
  .skeleton { animation: shimmer 1.4s ease-in-out infinite; }
  @keyframes shimmer {
    from { background-position: 180% 0; }
    to   { background-position: -20% 0; }
  }
}

/* =========== Adaptation mobile des ajouts =========== */

@media (max-width: 980px) {
  .moi-head h2 { font-size: 21px; }
  .moi-head .avatar-lg { width: 46px; height: 51px; font-size: 17px; }
  .qr-box svg { width: 168px; height: 168px; }
  .demo-ligne { flex-direction: column; gap: 2px; }
  .demo-ligne strong { text-align: left; }
  .moi-actions .btn { flex: 1; min-width: 150px; }
}

/* =========== Mouvement réduit =========== */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
