/* ---------- Couleurs et bases ---------- */
:root {
  /* Identité VitalSport : noir premium + bleu ciel de marque */
  --paper: #0a0b0e;        /* fond de page */
  --surface: #15181e;      /* cartes, listes, formulaires */
  --surface-2: #1c2028;    /* survol / zone légèrement plus claire */
  --ink: #f2f5f8;          /* texte principal */
  --ink-soft: #93a0b0;     /* texte secondaire */
  --line: #272c35;         /* séparateurs, bordures */
  --teal: #38b6ff;         /* bleu de marque : boutons, liens, accents */
  --teal-dark: #0a141c;    /* fond du menu et de l'écran de connexion */
  --teal-tint: rgba(56, 182, 255, 0.14);  /* fond translucide bleu (survols, puces) */
  --whistle: #7fd1ff;      /* bleu clair : accents secondaires, aujourd'hui */
  --success: #3ddc84;
  --success-bg: rgba(61, 220, 132, 0.12);
  --danger: #ff6b6b;
  --danger-bg: rgba(255, 107, 107, 0.12);
  --radius: 10px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
}

[hidden] { display: none !important; }

h1, h2, h3 { margin: 0; line-height: 1.15; letter-spacing: -0.02em; }

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

.muted { margin: 4px 0 0; color: var(--ink-soft); font-size: 0.95rem; min-height: 1.4em; }

:focus-visible {
  outline: 3px solid var(--whistle);
  outline-offset: 2px;
}

/* ---------- Boutons ---------- */
.btn {
  appearance: none;
  border: 2px solid transparent;
  border-radius: 8px;
  padding: 10px 18px;
  min-height: 44px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s;
}
.btn:disabled { opacity: 0.6; cursor: wait; }
.btn-block { width: 100%; }

.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover:not(:disabled) { background: #1c9ee6; }

.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink-soft); }

.btn-danger { background: transparent; color: var(--danger); border-color: transparent; }
.btn-danger:hover { background: var(--danger-bg); }

/* ---------- Champs ---------- */
.field { margin-bottom: 16px; }

.field label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.9rem;
  font-weight: 600;
}

input, textarea, select {
  width: 100%;
  padding: 10px 12px;
  min-height: 44px;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 8px;
}
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(56, 182, 255, 0.25); }

.hint { margin: 6px 0 0; font-size: 0.85rem; color: var(--ink-soft); }

.error {
  margin: 0 0 16px;
  padding: 10px 12px;
  font-size: 0.95rem;
  color: var(--danger);
  background: var(--danger-bg);
  border-radius: 8px;
}

/* ---------- Connexion ---------- */
.login {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--teal-dark);
}

.login-card {
  width: min(400px, 100%);
  padding: 32px 28px;
  background: var(--surface);
  border-radius: 14px;
  border-top: 6px solid var(--whistle);
}

.login-logo { display: block; margin: 0 0 16px; }
.login-card h1 { font-size: 2rem; }
.login-sub { margin: 10px 0 24px; color: var(--ink-soft); }

/* ---------- Structure de l'application ---------- */
.shell {
  display: grid;
  grid-template-columns: 232px 1fr;
  min-height: 100vh;
  min-height: 100dvh;
}

.nav {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 28px 16px 20px;
  background: var(--teal-dark);
  color: #fff;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px 28px;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.brand img { display: block; border-radius: 6px; }

.nav-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }

.nav-link {
  display: block;
  padding: 10px 12px;
  border-left: 4px solid transparent;
  border-radius: 0 8px 8px 0;
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
  font-weight: 600;
}
.nav-link.is-active { color: #fff; background: rgba(255, 255, 255, 0.1); border-left-color: var(--whistle); }
.nav-link.is-soon { opacity: 0.45; cursor: default; }

.nav-logout {
  margin-top: auto;
  padding: 10px 12px;
  text-align: left;
  font: inherit;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.82);
  background: none;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}
.nav-logout:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }

.content { padding: 36px 40px 60px; max-width: 1280px; width: 100%; min-width: 0; }
.section-narrow { max-width: 900px; }

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
.page-head h2 { font-size: 2rem; }

.toolbar { margin-bottom: 16px; }

/* ---------- Liste des clients ---------- */
.client-list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.client-list:empty { display: none; }
.client-list li + li { border-top: 1px solid var(--line); }

.client-row {
  width: 100%;
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  font: inherit;
  text-align: left;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}
.client-row:hover { background: var(--paper); }
.client-row:focus-visible { outline-offset: -3px; }

.avatar {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--teal);
  background: var(--teal-tint);
}

.client-main { display: grid; min-width: 0; }
.client-name { font-weight: 700; }
.client-sub, .client-phone { color: var(--ink-soft); font-size: 0.92rem; }
.client-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.empty {
  margin: 0;
  padding: 40px 16px;
  text-align: center;
  color: var(--ink-soft);
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

/* ---------- Formulaire (fenêtre) ---------- */
dialog {
  width: min(580px, calc(100% - 24px));
  max-height: calc(100dvh - 24px);
  padding: 0;
  color: var(--ink);
  background: var(--surface);
  border: 0;
  border-radius: 14px;
}
dialog::backdrop { background: rgba(0, 0, 0, 0.72); }

dialog form { padding: 24px; }
dialog h3 { margin-bottom: 20px; font-size: 1.4rem; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }

.dialog-actions { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.spacer { flex: 1; }

/* ---------- Message de confirmation ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 20px);
  padding: 12px 20px;
  color: var(--ink);
  font-weight: 600;
  background: var(--surface-2);
  border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 10;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Téléphone : navigation en bas ---------- */
@media (max-width: 720px) {
  .shell { grid-template-columns: 1fr; }

  .nav {
    position: fixed;
    inset: auto 0 0 0;
    height: auto;
    flex-direction: row;
    align-items: center;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    z-index: 5;
  }
  .brand { display: none; }
  .nav-list { display: flex; flex: 1; gap: 0; }
  .nav-list li { flex: 1; }
  .nav-link { text-align: center; padding: 10px 4px; border-left: 0; border-top: 3px solid transparent; border-radius: 0 0 8px 8px; font-size: 0.9rem; }
  .nav-link.is-active { border-top-color: var(--whistle); }
  .nav-logout { margin: 0; padding: 10px 8px; font-size: 0.9rem; }

  .content { padding: 24px 16px 96px; }
  .page-head h2 { font-size: 1.7rem; }
  .client-row { grid-template-columns: 44px 1fr; }
  .client-phone { grid-column: 2; margin-top: -8px; }
  .grid-2 { grid-template-columns: 1fr; }
  .toast { bottom: 84px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

.client-phone:empty { display: none; }

/* ---------- Choix Particulier / Entreprise ---------- */
.type-switch {
  display: inline-flex;
  margin: 0 0 20px;
  padding: 3px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.type-option { position: relative; margin: 0; }

.type-option input {
  position: absolute;
  inset: 0;
  min-height: 0;
  opacity: 0;
  cursor: pointer;
}

.type-option span {
  display: block;
  padding: 8px 18px;
  font-weight: 600;
  color: var(--ink-soft);
  border-radius: 8px;
}

.type-option input:checked + span { color: #fff; background: var(--teal); }
.type-option input:focus-visible + span { outline: 3px solid var(--whistle); outline-offset: 2px; }

/* ---------- Étiquette et avatar entreprise ---------- */
.tag {
  margin-left: 8px;
  padding: 2px 8px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--teal);
  background: var(--teal-tint);
  border-radius: 6px;
  vertical-align: 1px;
}

.avatar.is-company { border-radius: 10px; }

/* ---------- Planning : navigation de semaine ---------- */
.week-nav { display: flex; gap: 8px; margin-bottom: 16px; }
.btn-icon { min-width: 44px; padding: 10px 12px; font-size: 1.3rem; line-height: 1; }

/* ---------- Planning : calendrier ---------- */
.week {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.week-head {
  position: sticky;
  top: 0;
  z-index: 3;
  display: grid;
  grid-template-columns: 52px repeat(7, minmax(0, 1fr));
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  border-radius: var(--radius) var(--radius) 0 0;
}

.day-head {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 2px;
  min-height: 60px;
  padding: 6px 4px;
  font: inherit;
  color: var(--ink-soft);
  background: none;
  border: 0;
  border-left: 1px solid var(--line);
  cursor: pointer;
}
.day-name { font-size: 0.85rem; }
.day-num {
  display: grid;
  place-items: center;
  min-width: 32px;
  height: 32px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
  border-radius: 50%;
}
.day-head.is-today .day-num { background: var(--whistle); color: #06131c; }

.week-body {
  display: grid;
  grid-template-columns: 52px repeat(7, minmax(0, 1fr));
}

.time-gutter { display: grid; grid-auto-rows: var(--hour); }
.hour-label {
  padding: 2px 8px 0 0;
  font-size: 0.75rem;
  text-align: right;
  color: var(--ink-soft);
}

.day-col {
  position: relative;
  height: calc(var(--hours) * var(--hour));
  overflow: hidden;
  border-left: 1px solid var(--line);
  cursor: pointer;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent calc(var(--hour) - 1px),
    var(--line) calc(var(--hour) - 1px),
    var(--line) var(--hour)
  );
}
.day-col.is-today { background-color: rgba(56, 182, 255, 0.06); }

/* ---------- Planning : séances ---------- */
.event {
  position: absolute;
  overflow: hidden;
  padding: 3px 6px;
  font: inherit;
  font-size: 0.8rem;
  line-height: 1.25;
  text-align: left;
  color: #fff;
  background: var(--teal);
  border: 0;
  border-left: 4px solid var(--whistle);
  border-radius: 6px;
  cursor: pointer;
}
.event:hover { background: var(--teal-dark); }
.event-time, .event-name, .event-sub { display: block; overflow: hidden; text-overflow: ellipsis; }
.event-time { font-weight: 700; white-space: nowrap; }
.event-sub { opacity: 0.85; }

.event.is-done { color: var(--teal); background: var(--teal-tint); border-left-color: var(--teal); }
.event.is-done:hover { background: rgba(56, 182, 255, 0.22); }
.event.is-cancelled {
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.06);
  border-left-color: #b9c2be;
  text-decoration: line-through;
}
.event.is-cancelled:hover { background: rgba(255, 255, 255, 0.08); }

/* ---------- Formulaire de séance ---------- */
.grid-3 { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 0 14px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chips:empty { display: none; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 2px 2px 12px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--teal);
  background: var(--teal-tint);
  border-radius: 999px;
}
.chip button {
  appearance: none;
  width: 30px;
  height: 30px;
  font-size: 1.2rem;
  line-height: 1;
  color: inherit;
  background: none;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}
.chip button:hover { background: rgba(56, 182, 255, 0.18); }

/* ---------- Planning sur téléphone : un jour à la fois ---------- */
@media (max-width: 720px) {
  .week-head { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .head-spacer { display: none; }
  .day-head { border-left: 0; }
  .day-head.is-selected { box-shadow: inset 0 -3px 0 var(--teal); color: var(--ink); }

  .week-body { grid-template-columns: 44px minmax(0, 1fr); }
  .day-col:not(.is-selected) { display: none; }
  .event { font-size: 0.9rem; }

  .grid-3 { grid-template-columns: 1fr 1fr; }
  .grid-3 > :first-child { grid-column: 1 / -1; }
}

/* =====================================================================
   FACTURATION
   ===================================================================== */

/* ---------- Petits éléments communs ---------- */
.badge {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  margin-left: 8px;
  padding: 0 6px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  background: var(--danger);
  border-radius: 999px;
}

.btn-small { min-height: 36px; padding: 6px 14px; font-size: 0.9rem; }

.tag-alert { color: #fff; background: var(--danger); }

.notice {
  margin: 0 0 16px;
  padding: 12px 14px;
  font-size: 0.95rem;
  background: var(--teal-tint);
  border-left: 4px solid var(--whistle);
  border-radius: 8px;
}
.notice a { color: var(--teal); font-weight: 600; }

.alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding: 14px 16px;
  color: var(--danger);
  background: var(--danger-bg);
  border-left: 4px solid var(--danger);
  border-radius: 8px;
}
.alert p { margin: 0; }
.alert-names { display: block; margin-top: 2px; font-size: 0.92rem; }

.show-mobile { display: none; }
.settings-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- Onglets ---------- */
.tabs { display: flex; gap: 4px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.tab {
  appearance: none;
  margin-bottom: -1px;
  padding: 10px 16px;
  font: inherit;
  font-weight: 600;
  color: var(--ink-soft);
  background: none;
  border: 0;
  border-bottom: 3px solid transparent;
  cursor: pointer;
}
.tab.is-active { color: var(--ink); border-bottom-color: var(--whistle); }

/* ---------- Chiffres clés ---------- */
.summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.figure { display: grid; gap: 2px; padding: 14px 18px; }
.figure + .figure { border-left: 1px solid var(--line); }
.figure-value { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.figure-label { font-size: 0.9rem; color: var(--ink-soft); }
.figure.is-alert .figure-value { color: var(--danger); }

/* ---------- Filtres ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.filter {
  appearance: none;
  padding: 7px 14px;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink-soft);
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}
.filter.is-active { color: #fff; background: var(--teal); border-color: var(--teal); }

/* ---------- Liste des factures et des abonnements ---------- */
.invoice-list {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.invoice-list:empty { display: none; }
.invoice-list li + li { border-top: 1px solid var(--line); }

.invoice-row, .sub-row {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1.2fr) 110px 150px;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  font: inherit;
  text-align: left;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}
.sub-row { grid-template-columns: minmax(0, 1.6fr) 160px 120px; }
.invoice-row:hover, .sub-row:hover { background: var(--paper); }
.invoice-row:focus-visible, .sub-row:focus-visible { outline-offset: -3px; }

.invoice-main { display: grid; min-width: 0; }
.invoice-number { font-weight: 700; }
.invoice-client { overflow: hidden; font-size: 0.92rem; color: var(--ink-soft); text-overflow: ellipsis; white-space: nowrap; }
.invoice-dates { display: grid; font-size: 0.88rem; color: var(--ink-soft); }
.invoice-dates span:empty { display: none; }
.invoice-amount { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }

.state {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
  border-radius: 999px;
}
.state-draft { color: var(--ink-soft); background: rgba(255, 255, 255, 0.06); }
.state-due { color: var(--teal); background: var(--teal-tint); }
.state-overdue { color: #fff; background: var(--danger); }
.state-paid { color: var(--success); background: var(--success-bg); }
.state-detail { font-weight: 600; opacity: 0.9; }

/* ---------- Création des brouillons du mois ---------- */
.gen-box { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.gen-box .field { margin: 0; }
.gen-hint { margin: 8px 0 16px; }

/* ---------- Formulaire de facture ---------- */
dialog.wide { width: min(780px, calc(100% - 24px)); }
.dialog-actions.wrap { flex-wrap: wrap; }

.lines-block { margin-bottom: 16px; }
.line-head, .line-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px 104px 96px 36px;
  align-items: center;
  gap: 8px;
}
.line-head { margin-bottom: 6px; font-size: 0.85rem; font-weight: 600; color: var(--ink-soft); }
.line-row { margin-bottom: 8px; }
.line-total { font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.line-remove {
  appearance: none;
  width: 36px;
  height: 36px;
  font-size: 1.3rem;
  line-height: 1;
  color: var(--ink-soft);
  background: none;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}
.line-remove:hover { color: var(--danger); background: var(--danger-bg); }

.total-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 14px 0 6px;
  padding-top: 12px;
  font-size: 1.05rem;
  border-top: 2px solid var(--ink);
}
.total-line strong { font-size: 1.5rem; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

.paid-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px;
  background: var(--paper);
  border-radius: var(--radius);
}
.paid-row .paid-field { margin: 0; }
.paid-info { margin: 0; font-weight: 700; color: var(--success); }

.field .check { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.check input { width: 20px; min-height: 0; height: 20px; }
.check-field { align-self: end; }

/* ---------- Document de facture (impression et PDF) ---------- */
#print-area { display: none; }

.doc { font-size: 10.5pt; line-height: 1.45; color: #111; }
.doc * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.doc p { margin: 0; }
.doc-head { display: flex; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.doc-logo { display: block; height: 46px; width: auto; margin-bottom: 10px; }
.doc-name { font-size: 1.1em; font-weight: 700; }
.doc-pre { white-space: pre-line; }
.doc-title { text-align: right; }
.doc-title h1 { margin: 0 0 4px; font-size: 26pt; letter-spacing: -0.02em; color: var(--teal-dark); }
.doc-number { font-weight: 700; }
.doc-label { margin-bottom: 2px; font-size: 0.85em; color: #555; }
.doc-client { width: 58%; margin-bottom: 26px; padding: 12px 14px; background: #f5f6f3; border-left: 4px solid var(--whistle); }
.doc-lines { width: 100%; margin-bottom: 14px; border-collapse: collapse; }
.doc-lines th { padding: 8px 6px; font-size: 0.9em; text-align: left; border-bottom: 2px solid #111; }
.doc-lines td { padding: 9px 6px; vertical-align: top; border-bottom: 1px solid #ddd; }
.doc .num { text-align: right; white-space: nowrap; }
.doc-total { width: 55%; margin: 0 0 26px auto; }
.doc-total-line { display: flex; justify-content: space-between; align-items: baseline; padding: 8px 0; border-top: 2px solid #111; font-size: 1.05em; }
.doc-total-line strong { font-size: 1.4em; }
.doc-note { font-size: 0.85em; color: #444; text-align: right; }
.doc-payment { margin-bottom: 26px; }
.doc-paid { margin-top: 6px; font-weight: 700; color: #1f5a34; }
.doc-legal { padding-top: 10px; font-size: 0.8em; color: #444; border-top: 1px solid #ccc; }

@media print {
  @page { size: A4; margin: 16mm; }
  html, body { background: #fff; }
  .login, .shell, dialog, .toast { display: none !important; }
  #print-area { display: block; }
}

/* ---------- Téléphone ---------- */
@media (max-width: 720px) {
  .nav-logout { display: none; }
  .show-mobile { display: inline-block; }
  .nav-link { position: relative; }
  .badge { position: absolute; top: 2px; right: 2px; min-width: 18px; height: 18px; margin: 0; font-size: 0.7rem; }

  .alert { flex-direction: column; align-items: flex-start; }
  .figure { padding: 12px; }
  .figure-value { font-size: 1.1rem; }
  .figure-label { font-size: 0.8rem; }

  .invoice-row, .sub-row { grid-template-columns: minmax(0, 1fr) auto; row-gap: 6px; }
  .invoice-main { grid-column: 1; grid-row: 1; }
  .invoice-amount { grid-column: 2; grid-row: 1; }
  .invoice-dates { grid-column: 1; grid-row: 2; }
  .state { grid-column: 2; grid-row: 2; }

  .line-head { display: none; }
  .line-row { grid-template-columns: 70px minmax(0, 1fr) auto 36px; }
  .line-desc { grid-column: 1 / -1; }
}

/* =====================================================================
   RELANCES
   ===================================================================== */
.check { display: flex; align-items: center; gap: 8px; font-weight: 600; }

.settings-group {
  margin: 0 0 20px;
  padding: 16px 18px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.settings-group legend { padding: 0 8px; font-weight: 700; }
.settings-group > .check { margin-bottom: 16px; }
.test-hint { margin: 8px 0 14px; }

.reminders-block { margin-bottom: 16px; padding: 14px; background: var(--paper); border-radius: var(--radius); }
.reminders-block h4 { margin: 0 0 8px; font-size: 1rem; }
.reminder-list { margin: 0 0 12px; padding-left: 18px; font-size: 0.92rem; }
.reminder-list li.is-failed { color: var(--danger); }
.reminder-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }

.settings-check { margin: 0 0 16px; }

.button-row { display: flex; flex-wrap: wrap; gap: 10px; }
.check-result { margin: 4px 0 14px; }
.diag-list { margin: 8px 0; padding: 0; list-style: none; }
.diag-list li { display: flex; gap: 10px; padding: 7px 0; font-size: 0.93rem; border-bottom: 1px solid var(--line); }
.diag-list li:last-child { border-bottom: 0; }
.diag-mark { flex: none; width: 1.2em; font-weight: 800; text-align: center; }
.diag-list .is-ok .diag-mark { color: var(--success); }
.diag-list .is-ko .diag-mark { color: var(--danger); }
.diag-list .is-ko { color: var(--danger); }
.diag-list .is-info .diag-mark { color: var(--ink-soft); }
.diag-title { margin: 14px 0 0; font-weight: 700; }
