/* ==========================================================
   IDOBCLUB — page de démonstration
   Complète styles.css (couleurs, polices, boutons, formulaires)
   ========================================================== */

.demo-page { background: var(--paper-2); }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---- BANDEAU ---- */
.demo-banner {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 12px 24px;
  background: var(--dark);
  color: #fff;
}
.demo-banner p { flex: 1; font-size: 0.875rem; color: var(--on-dark-2); }

.demo-brand { color: #fff; }
.demo-brand .club-mark { --club-word: var(--accent); height: 28px; }
.demo-brand .brand-name { font-size: 1.1rem; }
.demo-brand .brand-name span { color: var(--accent); }

.demo-banner-actions { display: flex; align-items: center; gap: 16px; flex-shrink: 0; }
.demo-banner-link { font-size: 0.875rem; font-weight: 500; color: var(--on-dark-2); transition: color 0.2s; }
.demo-banner-link:hover { color: #fff; }
.demo-banner-cta {
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--ink);
  font-size: 0.875rem;
  font-weight: 600;
  transition: background-color 0.2s;
}
.demo-banner-cta:hover { background: #86efac; }
.demo-banner-cta:hover .arrow { transform: translateX(3px); }

/* ---- STRUCTURE ---- */
.demo-app { display: grid; grid-template-columns: 220px minmax(0, 1fr); align-items: stretch; }

.demo-side { background: var(--paper); border-right: 1px solid var(--line); }
.demo-side-inner { position: sticky; top: 0; padding: 24px 14px; }

.demo-club { display: flex; flex-direction: column; padding: 0 12px 20px; }
.demo-club strong { font-family: var(--font-display); font-size: 1.1rem; font-weight: 600; }
.demo-club span { font-size: 0.8rem; color: var(--ink-3); }

.demo-nav { display: flex; flex-direction: column; gap: 2px; }
.demo-nav a {
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  font-size: 0.95rem;
  white-space: nowrap;
  transition: color 0.2s, background-color 0.2s;
}
.demo-nav a:hover { color: var(--ink); }
.demo-nav a[aria-current="page"] { background: var(--paper-2); color: var(--ink); font-weight: 600; }

.demo-main { width: 100%; max-width: 1080px; min-height: calc(100vh - 62px); padding: 36px 40px 64px; }
.demo-main:focus { outline: none; }

/* ---- EN-TÊTE DE VUE ---- */
.demo-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.demo-head h1 { font-size: clamp(1.8rem, 3vw, 2.4rem); letter-spacing: -0.035em; line-height: 1.08; }
.demo-head p { margin-top: 4px; color: var(--ink-2); }

.demo-hint {
  margin-bottom: 24px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--ok-text);
  font-size: 0.9rem;
}
.demo-hint strong { font-weight: 600; }

/* ---- BOUTONS ---- */
.demo-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--paper);
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}
.demo-btn:hover { border-color: var(--ink); }
.demo-btn-dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.demo-btn-dark:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.demo-btn:disabled { cursor: not-allowed; opacity: 0.45; border-color: var(--line-strong); }

.demo-name {
  font-weight: 600;
  text-align: left;
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
  transition: color 0.2s;
}
.demo-name:hover { color: var(--accent-ink); }

/* ---- CHIFFRES ---- */
.demo-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin-bottom: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
}
.demo-stats div { display: flex; flex-direction: column-reverse; gap: 4px; padding: 18px; background: var(--paper); }
.demo-stats dt { font-size: 0.82rem; color: var(--ink-3); }
.demo-stats dd { font-family: var(--font-display); font-size: 1.8rem; font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; }

/* ---- CARTES ET LISTES ---- */
.demo-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.demo-card-title { padding: 16px 20px; border-bottom: 1px solid var(--line); font-size: 1.1rem; }

.demo-columns { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px; align-items: start; margin-bottom: 16px; }

.demo-todo a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  transition: background-color 0.2s;
}
.demo-todo li:last-child a { border-bottom: none; }
.demo-todo a:hover { background: var(--paper-2); }
.demo-todo a:hover .arrow { transform: translateX(3px); }
.demo-empty { padding: 28px 20px; color: var(--ink-2); text-align: center; }

.demo-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 20px;
  border-bottom: 1px solid var(--line);
}
li:last-child > .demo-line, .demo-line:last-child { border-bottom: none; }
.demo-line small { display: block; font-size: 0.8rem; color: var(--ink-3); }
.demo-line strong { font-weight: 600; }

.demo-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }

.demo-cta-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px;
  border-radius: var(--radius);
  background: var(--dark);
  color: #fff;
}
.demo-cta-card h2 { font-size: 1.3rem; letter-spacing: -0.02em; }
.demo-cta-card p { color: var(--on-dark-2); font-size: 0.95rem; }

/* ---- OUTILS DE LISTE ---- */
.demo-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.demo-tools input,
.demo-tools select,
.demo-field-inline {
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--paper);
  font-size: 0.92rem;
}
.demo-tools input { flex: 1; min-width: 200px; max-width: 360px; }
.demo-tools select { max-width: 100%; }
.demo-tools input:focus,
.demo-tools select:focus { border-color: var(--accent-ink); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.demo-count { margin-left: auto; font-size: 0.875rem; color: var(--ink-3); }

.demo-filters { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.demo-filters button {
  margin-bottom: -1px;
  padding: 8px 12px;
  border-bottom: 2px solid transparent;
  color: var(--ink-3);
  font-size: 0.9rem;
  font-weight: 600;
  transition: color 0.2s;
}
.demo-filters button:hover { color: var(--ink); }
.demo-filters button[aria-pressed="true"] { border-bottom-color: var(--ink); color: var(--ink); }

/* ---- TABLEAUX ---- */
.demo-table { width: 100%; border-collapse: collapse; }
.demo-table th {
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}
.demo-table td { padding: 13px 20px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.demo-table tr:last-child td { border-bottom: none; }
.demo-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.demo-table .end { text-align: right; }
.demo-table small { display: block; color: var(--ink-3); }
.demo-table small.show-sm { display: none; }
.demo-nowrap { white-space: nowrap; }
.demo-who { display: flex; align-items: center; gap: 12px; }

.demo-av {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--paper-2);
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-2);
}

.pill-late { background: rgba(185, 28, 28, 0.1); color: #b91c1c; }
.pill-neutral { background: var(--paper-2); color: var(--ink-2); }

/* ---- PRÉSENCES ---- */
.demo-check {
  min-width: 92px;
  padding: 7px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--ink-3);
  font-size: 0.85rem;
  font-weight: 600;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}
.demo-check:hover { border-color: var(--ink); color: var(--ink); }
.demo-check[aria-pressed="true"] { border-color: transparent; background: var(--accent-soft); color: var(--ok-text); }

/* ---- COTISATIONS ---- */
.demo-progress { margin-bottom: 18px; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.demo-progress p { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; margin-bottom: 10px; }
.demo-progress strong { font-family: var(--font-display); font-size: 1.2rem; font-weight: 600; letter-spacing: -0.02em; }
.demo-bar { overflow: hidden; height: 8px; border-radius: 999px; background: var(--paper-2); }
.demo-bar span { display: block; height: 100%; border-radius: 999px; background: var(--accent); transition: width 0.4s var(--ease); }

/* ---- STOCKS ---- */
.demo-stepper { display: inline-flex; align-items: center; gap: 8px; }
.demo-stepper button {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1;
  transition: border-color 0.2s;
}
.demo-stepper button:hover { border-color: var(--ink); }
.demo-stepper button:disabled { cursor: not-allowed; opacity: 0.4; border-color: var(--line-strong); }
.demo-stepper output { min-width: 30px; font-family: var(--font-display); font-size: 1.05rem; font-weight: 600; text-align: center; }

/* ---- FENÊTRES ---- */
.demo-dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  margin: auto;
  border: none;
  border-radius: var(--radius-lg);
  background: var(--paper);
  color: var(--ink);
  overflow: auto;
}
.demo-dialog::backdrop { background: rgba(11, 13, 17, 0.55); }
.demo-dialog-inner { padding: 26px; }
.demo-dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.demo-dialog-head h2 { font-size: 1.45rem; letter-spacing: -0.025em; }
.demo-dialog-head p { font-size: 0.9rem; color: var(--ink-2); }
.demo-close { font-size: 1.5rem; line-height: 1; color: var(--ink-3); transition: color 0.2s; }
.demo-close:hover { color: var(--ink); }
.demo-dialog form { display: flex; flex-direction: column; gap: 16px; }
.demo-dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.demo-dialog form .demo-dialog-actions { margin-top: 4px; }

.demo-facts { border-top: 1px solid var(--line); }
.demo-facts div { display: flex; justify-content: space-between; gap: 20px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 0.92rem; }
.demo-facts dt { flex-shrink: 0; color: var(--ink-3); }
.demo-facts dd { font-weight: 500; text-align: right; overflow-wrap: anywhere; }

/* ---- FACTURE ---- */
.demo-invoice-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 18px; font-size: 0.92rem; }
.demo-invoice-parties small { display: block; color: var(--ink-3); font-size: 0.75rem; letter-spacing: 0.05em; text-transform: uppercase; }
.demo-invoice-lines { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.demo-invoice-lines th { padding: 8px 0; border-bottom: 1px solid var(--ink); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.05em; text-align: left; text-transform: uppercase; }
.demo-invoice-lines td { padding: 10px 0; border-bottom: 1px solid var(--line); }
.demo-invoice-lines .num { text-align: right; }
.demo-invoice-total { display: flex; align-items: baseline; justify-content: space-between; margin-top: 14px; }
.demo-invoice-total strong { font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; letter-spacing: -0.02em; }
.demo-invoice-note { margin-top: 12px; font-size: 0.8rem; color: var(--ink-3); }

/* ---- MESSAGE ---- */
.demo-toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 20;
  max-width: min(420px, calc(100vw - 40px));
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: #fff;
  font-size: 0.9rem;
  box-shadow: 0 18px 40px -18px rgba(15, 18, 21, 0.5);
}

.demo-noscript { padding: 24px; text-align: center; }
.demo-noscript a { text-decoration: underline; }

/* ---- ÉCRANS MOYENS ---- */
@media (max-width: 1080px) {
  .demo-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .demo-columns { grid-template-columns: minmax(0, 1fr); }
}

/* ---- TABLETTES ET TÉLÉPHONES ---- */
@media (max-width: 860px) {
  .demo-banner { flex-wrap: wrap; gap: 8px 16px; padding: 12px 16px; }
  .demo-banner p { flex-basis: 100%; order: 3; font-size: 0.82rem; }
  .demo-banner-actions { margin-left: auto; gap: 12px; }

  .demo-app { display: block; }
  .demo-side { position: sticky; top: 0; z-index: 5; border-right: none; border-bottom: 1px solid var(--line); }
  .demo-side-inner { position: static; padding: 8px 10px; }
  .demo-club { display: none; }
  .demo-nav { flex-direction: row; gap: 2px; overflow-x: auto; scrollbar-width: none; }
  .demo-nav::-webkit-scrollbar { display: none; }

  .demo-main { min-height: 0; padding: 24px 16px 48px; }
  .demo-head { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 640px) {
  .demo-banner-link { display: none; }
  .demo-banner-cta { padding: 8px 12px; font-size: 0.82rem; }
  .demo-brand .brand-name { font-size: 1rem; }

  .hide-sm { display: none; }
  .demo-table small.show-sm { display: block; }
  .demo-table th, .demo-table td { padding-left: 12px; padding-right: 12px; }
  .demo-stats dd { font-size: 1.5rem; }
  .demo-tools input { min-width: 100%; max-width: none; }
  .demo-count { margin-left: 0; }
  .demo-line { align-items: flex-start; flex-direction: column; gap: 10px; padding: 13px 16px; }
  .demo-line.keep-row { align-items: center; flex-direction: row; }
  .demo-actions { justify-content: flex-start; }
  .demo-cta-card { align-items: flex-start; flex-direction: column; }
  .demo-dialog-inner { padding: 20px; }
  .demo-invoice-parties { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .demo-bar span { transition: none; }
}
