/* Fit9 — owner web · follows Docs/Fit9_BrandGuide.html */

:root {
  --bg: #F3F4F1;
  --card: #FFFFFF;
  --border: #E3E5EA;
  --chip: #EEF0F3;
  --divider: #EEF0F3;
  --text: #14161B;
  --text-2: #3F4553;
  --muted: #5F6675;
  --accent: #D4FF3A;
  --ink: var(--accent-ink, #596B18);
  --deep-lime: color-mix(in srgb, var(--accent), #000 38%);
  --night: #0E1014;
  --r-chip: 10px;
  --r-btn: 14px;
  --r-card: 22px;
  --r-hero: 28px;
  --warn: #C2410C;
  --warn-2: #9A3412;
  --warn-bg: #FFF7ED;
  --warn-border: #FED7AA;
  --danger: #B42318;
  --danger-bg: #FDE8E1;
  --ok: #3F4F0E;
  --ok-bg: #EEF5D6;
  --info: #1E40AF;
  --info-bg: #E7F0FF;
  --plate-1: #14161B;
  --plate-2: #6B7280;
  --plate-3: #C2C7D0;
  --bar: #9AA1B0;
  --sleeve: #6B7280;
  --on-text: #FFFFFF;
  --hover: #FAFBF8;
  --sel: #FBFDF4;
  --soft: #F6F7F5;
  --wa-bg: #EAE4DA;
  --bubble: #FFFFFF;
  --edge: #CBD0D8;
  --dark-hover: #2A2D35;
  --placeholder: #9AA1B0;

  --bs-body-font-family: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --bs-body-bg: var(--bg);
  --bs-body-color: var(--text);
  --bs-border-color: var(--border);
}

* { -webkit-font-smoothing: antialiased; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--bs-body-font-family);
  font-size: 14px;
  line-height: 1.45;
}

a { color: inherit; }

.num, .ld-table td, .ld-stat { font-variant-numeric: tabular-nums; }

.ld-shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 32px 64px;
}

/* ---------- Top bar ---------- */

.ld-top {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.ld-brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  padding: 6px 0;
  text-decoration: none;
}
.ld-brand img { display: block; }
.ld-brand-mark { display: none !important; }

.ld-nav {
  display: flex;
  gap: 2px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px;
  overflow-x: auto;
  scrollbar-width: none;
  max-width: 100%;
}
.ld-nav::-webkit-scrollbar { display: none; }

.ld-nav a {
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 999px;
  white-space: nowrap;
  transition: background .15s;
}
.ld-nav a:hover { background: var(--chip); }
.ld-nav a.ld-nav-icon { display: inline-flex; align-items: center; justify-content: center; padding: 9px 13px; }
.ld-nav a.active { background: var(--text); color: var(--on-text); font-weight: 800; }

.ld-top-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.ld-date { color: var(--muted); font-size: 13px; margin-right: 6px; }
.ld-top-actions :is(.btn-ld, .btn-ld-outline, .btn-ld-dark, .btn-ld-ink) { min-height: 48px; padding: 0 18px; font-size: 14px; }

.ld-live { display: inline-flex; align-items: center; gap: 6px; }
.ld-live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #22C55E; box-shadow: 0 0 0 3px rgba(34, 197, 94, .18); }

/* ---------- Type ---------- */

.ld-label {
  font-size: 12px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 800;
  margin: 0 0 6px;
}
.ld-label.warn { color: var(--danger); }

.ld-h1 { font-size: 48px; font-weight: 800; letter-spacing: -0.03em; margin: 0; line-height: 1.08; }
.ld-h2 { font-size: 20px; font-weight: 700; margin: 0; }
.ld-h3 { font-size: 16px; font-weight: 700; margin: 0; }
.ld-sub { color: var(--muted); font-size: 12.5px; }
.ld-muted { color: var(--muted); }
.ld-ink { color: var(--ink); }
.ld-warn-text { color: var(--warn); font-weight: 600; }
.ld-danger-text { color: var(--danger); font-weight: 600; }

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

.ld-back {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  font-weight: 600;
  text-decoration: none;
  font-size: 13px;
  margin-bottom: 14px;
}
.ld-back:hover { text-decoration: underline; }

.ld-link {
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  background: none;
  border: 0;
  padding: 0;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}

/* ---------- Cards ---------- */

.ld-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 22px 24px;
}
.ld-card.hero { border-radius: var(--r-hero); }
.ld-card.tight { padding: 18px 20px; }
.ld-card.flush { padding: 0; overflow: hidden; }
.ld-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.ld-stat { font-size: 32px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.ld-stat.xl { font-size: 48px; }
.ld-stat.ink { color: var(--ink); }
.ld-stat.danger { color: var(--danger); }
.ld-stat.warn { color: var(--warn); }

/* ---------- Buttons ---------- */

.btn-ld,
.btn-ld-dark,
.btn-ld-outline,
.btn-ld-ink,
.btn-ld-danger,
.btn-ld-red {
  --btn-edge: transparent;
  --btn-shade: rgba(20, 22, 27, .14);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 52px;
  padding: 0 22px;
  border-radius: var(--r-btn);
  font-weight: 800;
  font-size: 15px;
  border: 1.5px solid var(--btn-edge);
  box-shadow: inset 0 -3px 0 var(--btn-shade);
  text-decoration: none;
  cursor: pointer;
  transition: filter .15s, background .15s, box-shadow .15s, transform .05s;
  white-space: nowrap;
}
:is(.btn-ld, .btn-ld-dark, .btn-ld-outline, .btn-ld-ink, .btn-ld-danger, .btn-ld-red):hover { border-color: var(--btn-edge); }
:is(.btn-ld, .btn-ld-dark, .btn-ld-outline, .btn-ld-ink, .btn-ld-danger, .btn-ld-red):active:not([disabled]) {
  transform: translateY(1px);
  box-shadow: inset 0 0 0 var(--btn-shade);
}

.btn-ld { --btn-edge: var(--deep-lime); background: var(--accent); color: var(--text); }
.btn-ld:hover { filter: brightness(.95); color: var(--text); }

.btn-ld-dark { --btn-edge: #000; --btn-shade: rgba(0, 0, 0, .5); background: var(--text); color: var(--on-text); }
.btn-ld-dark:hover { background: var(--dark-hover); color: var(--on-text); }

.btn-ld-outline { --btn-edge: var(--edge); --btn-shade: rgba(20, 22, 27, .06); background: var(--card); color: var(--text); font-weight: 700; }
.btn-ld-outline:hover { background: var(--chip); color: var(--text); }

.btn-ld-ink { --btn-edge: var(--ink); --btn-shade: color-mix(in srgb, var(--ink) 20%, transparent); background: var(--card); color: var(--ink); font-weight: 700; }
.btn-ld-ink:hover { background: var(--ok-bg); color: var(--ink); }

.btn-ld-danger { --btn-edge: color-mix(in srgb, var(--danger) 45%, #fff); --btn-shade: color-mix(in srgb, var(--danger) 16%, transparent); background: var(--card); color: var(--danger); font-weight: 700; }
.btn-ld-danger:hover { background: var(--danger-bg); color: var(--danger); }

.btn-ld-red { --btn-edge: color-mix(in srgb, var(--danger), #000 30%); --btn-shade: rgba(0, 0, 0, .25); background: var(--danger); color: #fff; }
.btn-ld-red:hover { filter: brightness(.94); color: #fff; }

.btn-sm-ld { min-height: 40px; padding: 0 16px; font-size: 13px; border-radius: 12px; }
:is(.btn-ld, .btn-ld-dark, .btn-ld-outline, .btn-ld-ink, .btn-ld-danger, .btn-ld-red)[disabled] { opacity: .55; cursor: default; box-shadow: none; filter: none; }

/* ---------- Chips, pills, tabs ---------- */

.ld-chips { display: flex; flex-wrap: wrap; gap: 8px; }

.ld-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  min-height: 40px;
  white-space: nowrap;
}
.ld-chip .cnt { font-weight: 400; color: var(--muted); }
.ld-chip.active { background: var(--text); color: var(--on-text); border-color: var(--text); }
.ld-chip.active .cnt { color: #c8ccd4; }
.ld-chip.static { cursor: default; font-weight: 600; }
.ld-chip.warn { color: var(--warn); border-color: var(--warn); font-weight: 600; }
.ld-chip.soft { background: var(--chip); border-color: var(--chip); font-weight: 600; }
.ld-chip.lime { background: var(--accent); border: 1.5px solid var(--ink); }
.ld-chip.dark { background: var(--text); border-color: var(--text); color: var(--accent); }

.ld-pill {
  display: inline-flex;
  align-items: center;
  font-size: 11.5px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
  background: var(--chip);
  color: var(--text-2);
}
.ld-pill.ok { background: var(--ok-bg); color: var(--ok); }
.ld-pill.warn { background: var(--warn-bg); color: var(--warn-2); }
.ld-pill.danger { background: var(--danger-bg); color: var(--danger); }
.ld-pill.info { background: var(--info-bg); color: var(--info); }
.ld-pill.accent { background: var(--accent); color: var(--text); }

/* ---------- Avatar ---------- */

.ld-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--chip);
  color: var(--text);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.ld-avatar.lg { width: 56px; height: 56px; border-radius: var(--r-btn); font-size: 18px; }
.ld-avatar.xl { width: 64px; height: 64px; border-radius: var(--r-btn); font-size: 18px; }
.ld-avatar.accent { background: var(--accent); }

/* ---------- Lists ---------- */

.ld-list { list-style: none; margin: 0; padding: 0; }
.ld-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--divider);
}
.ld-row:first-child { border-top: 0; }
.ld-list.top-rule .ld-row:first-child { border-top: 1px solid var(--divider); }
.ld-row .grow { flex: 1; min-width: 0; }
.ld-row .name { font-weight: 600; }
.ld-row .meta { color: var(--muted); font-size: 12.5px; }

.ld-kv { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: 13px; }
.ld-kv dt { font-weight: 600; color: var(--text-2); }
.ld-kv dd { margin: 0; font-weight: 600; text-align: right; }

/* ---------- Progress ---------- */

.ld-track {
  height: 6px;
  border-radius: 999px;
  background: var(--chip);
  overflow: hidden;
  flex: 1;
}
.ld-track > span { display: block; height: 100%; border-radius: inherit; background: var(--bar); }
.ld-track > span.ink { background: var(--ink); }
.ld-track.thick { height: 8px; }

.ld-split {
  display: flex;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  gap: 2px;
}
.ld-split > span:nth-child(1) { background: var(--text); }
.ld-split > span:nth-child(2) { background: var(--bar); }
.ld-split > span:nth-child(3) { background: var(--accent); }
.ld-split.thin { height: 8px; }
.ld-split.members > span:nth-child(1) { background: var(--text); }
.ld-split.members > span:nth-child(2) { background: var(--warn); }
.ld-split.members > span:nth-child(3) { background: var(--bar); }
.ld-members-card { position: relative; overflow: hidden; }
.ld-members-bg { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 58%; color: var(--ink); pointer-events: none; }
.ld-members-body { position: relative; }
.ld-split.dues > span:nth-child(1) { background: var(--danger); }
.ld-split.dues > span:nth-child(2) { background: var(--warn); }
.ld-split.dues > span:nth-child(3) { background: var(--bar); }
.ld-legend .k1 { background: var(--text); }
.ld-legend .k2 { background: var(--bar); }
.ld-legend .k3 { background: var(--accent); }
.ld-key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 8px; vertical-align: 0; }
.ld-key.d1 { background: var(--danger); }
.ld-key.d2 { background: var(--warn); }
.ld-key.d3 { background: var(--bar); }

.ld-h1-btn { padding: 0; border: 0; background: none; font: inherit; color: inherit; letter-spacing: inherit; text-align: left; cursor: pointer; }
.ld-h1-btn:hover { text-decoration: underline dotted; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.ld-label-link { padding: 0; border: 0; background: none; font: inherit; letter-spacing: inherit; text-transform: inherit; color: var(--text); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* ---------- Table ---------- */

.ld-table { width: 100%; border-collapse: collapse; }
.ld-table th {
  font-size: 11px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 800;
  padding: 14px 10px;
  white-space: nowrap;
  text-align: left;
}
.ld-table td {
  padding: 12px 10px;
  border-top: 1px solid var(--divider);
  vertical-align: middle;
}
.ld-table tbody tr.clickable { cursor: pointer; }
.ld-table tbody tr.clickable:hover td { background: var(--hover); }
.ld-table tfoot td { border-top: 2px solid var(--text); font-weight: 700; padding-top: 16px; }
.ld-table-wrap { overflow-x: auto; }
.ld-card.flush .ld-table th:first-child,
.ld-card.flush .ld-table td:first-child { padding-left: 20px; }
.ld-card.flush .ld-table th:last-child,
.ld-card.flush .ld-table td:last-child { padding-right: 20px; }

.ld-empty { text-align: center; color: var(--muted); padding: 36px 12px; }

.ld-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ld-search { position: relative; flex: 1 1 320px; margin: 0; }
.ld-search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.ld-search .ld-input { padding-left: 42px; }
.ld-search.compact { flex-basis: 200px; }
.ld-filters { display: flex; gap: 10px; flex-wrap: wrap; }
.ld-filters .ld-select { width: auto; min-width: 150px; font-weight: 600; cursor: pointer; }
.ld-filters .ld-select.on { border-color: var(--ink); background: var(--ok-bg); }
.ld-filters .ld-filter-clear { min-height: 46px; }

.ld-results { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13.5px; }
.ld-perpage { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--muted); font-size: 13px; font-weight: 600; }
.ld-perpage .ld-select { width: auto; min-height: 38px; padding: 0 10px; font-size: 13px; cursor: pointer; }
.ld-pager { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; }
.ld-page {
  min-width: 40px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-btn);
  background: var(--card);
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.ld-page:hover:not([disabled]) { background: var(--chip); }
.ld-page[aria-current="page"] { background: var(--accent); border-color: var(--deep-lime); }
.ld-page[disabled] { color: var(--muted); opacity: .55; cursor: default; }
.ld-page-gap { color: var(--muted); padding: 0 2px; }

/* Read-only link with a Copy button joined to its right edge. */
.ld-copy-field { display: flex; }
.ld-copy-field .ld-input { min-width: 0; font-size: 12.5px; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.ld-copy-field button {
  flex-shrink: 0;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-left: 0;
  border-radius: 0 var(--r-btn) var(--r-btn) 0;
  background: var(--chip);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.ld-copy-field button:hover { background: var(--accent); }
.ld-stage-select { width: auto; min-height: 38px; padding: 0 8px; font-size: 13px; }

.ld-row-link { position: relative; margin: 0 -12px; padding-left: 12px; padding-right: 12px; border-radius: 10px; }
.ld-row-link:hover { background: var(--hover); }
.ld-row-link .name { color: var(--text); text-decoration: none; }
.ld-row-link .stretched-link::after { content: ""; position: absolute; inset: 0; }
.ld-chev { color: var(--muted); font-size: 22px; line-height: 1; }

.ld-log-kinds { display: flex; gap: 6px; flex-wrap: wrap; }
.ld-timeline { list-style: none; margin: 0; padding: 0; }
.ld-timeline li { position: relative; display: flex; gap: 12px; padding: 0 0 18px; }
.ld-timeline li::before { content: ""; position: absolute; left: 15px; top: 32px; bottom: 0; width: 2px; background: var(--divider); }
.ld-timeline li:last-child::before { display: none; }
.ld-tl-icon { flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: #F1F3EE; color: var(--text-2); font-size: 14px; }
.ld-tl-icon.call { background: #E8F1FB; color: #2563A8; }
.ld-tl-icon.whatsapp, .ld-tl-icon.message { background: #E6F6EC; color: #1F8A4C; }
.ld-tl-icon.visit { background: #FFF4E0; color: #A86400; }
.ld-tl-icon.follow_up { background: #FDECEC; color: #B23B3B; }
.ld-tl-body { flex: 1; min-width: 0; padding-top: 5px; }
.ld-tl-body p { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; }
.ld-tl-head { font-size: 12.5px; color: var(--muted); }
.ld-tl-head strong { color: var(--text); font-weight: 600; }
.btn-ld-outline.ld-btn-xs { min-height: 34px; padding: 0 12px; font-size: 12.5px; box-shadow: inset 0 -2px 0 var(--btn-shade); }
.ld-inline-num { display: inline-block; width: 64px; min-height: 34px; padding: 0 8px; margin: 0 4px; text-align: center; }
.ld-adv { border-top: 1px solid var(--border); padding-top: 14px; }
.ld-adv summary { cursor: pointer; font-weight: 700; font-size: 14px; list-style: none; display: flex; align-items: center; gap: 6px; }
.ld-adv summary::-webkit-details-marker { display: none; }
.ld-adv summary::before { content: "›"; display: inline-block; transition: transform .15s; font-size: 18px; line-height: 1; }
.ld-adv[open] summary::before { transform: rotate(90deg); }

.ld-quick {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  height: 100%;
  padding: 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  color: var(--text);
  text-decoration: none;
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .05s;
}
.ld-quick:hover { color: var(--text); border-color: var(--edge); box-shadow: 0 6px 18px rgba(20, 22, 27, .06); }
.ld-quick:active { transform: translateY(1px); }
.ld-quick-icon { width: 42px; height: 42px; border-radius: var(--r-chip); background: var(--accent); border: 1.5px solid var(--deep-lime); display: grid; place-items: center; flex-shrink: 0; }
.ld-quick-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ld-quick-text strong { font-size: 14.5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ld-quick-text > span { color: var(--muted); font-size: 12.5px; }
.ld-quick-go { color: var(--muted); font-size: 22px; line-height: 1; }

/* ---------- Forms ---------- */

.ld-field label,
.ld-field .ld-field-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 6px;
}

.ld-input,
.ld-select,
.ld-textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--border);
  border-radius: var(--r-btn);
  padding: 0 14px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  background: var(--card);
  transition: border-color .15s, box-shadow .15s;
}
.ld-textarea { padding: 12px 14px; min-height: 120px; resize: vertical; }
.ld-select { appearance: auto; }
.ld-input::placeholder { color: var(--placeholder); text-transform: none; }
.ld-input:focus, .ld-select:focus, .ld-textarea:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 45%, transparent);
}

.ld-upload {
  width: 100px;
  height: 100px;
  border-radius: var(--r-card);
  border: 1.5px dashed var(--plate-3);
  background: var(--soft);
  display: grid;
  place-items: center;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  overflow: hidden;
  flex-shrink: 0;
}
.ld-upload img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Toggle switch ---------- */

.ld-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 26px;
  flex-shrink: 0;
}
.ld-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.ld-switch .track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--chip);
  border: 1px solid var(--border);
  transition: background .15s, border-color .15s;
}
.ld-switch .track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--card);
  box-shadow: 0 1px 2px rgba(0,0,0,.2);
  transition: transform .18s, background .15s;
}
.ld-switch input:checked + .track { background: var(--accent); border-color: var(--ink); }
.ld-switch input:checked + .track::after { transform: translateX(18px); background: var(--text); }
.ld-switch input:focus-visible + .track { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 50%, transparent); }

/* ---------- Check box (permission matrix) ---------- */

.ld-check {
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 1px solid var(--plate-3);
  background: var(--card);
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  margin: 0;
}
.ld-check:checked {
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='%2314161B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/14px no-repeat;
  border-color: var(--text);
}

/* ---------- Notes ---------- */

.ld-note {
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 13px;
}
.ld-note .ld-label { color: var(--warn-2); font-weight: 700; margin-bottom: 4px; }

/* ---------- Barbell ---------- */

.ld-barbell { width: 100%; display: block; }
.ld-barbell svg { width: 100%; height: auto; display: block; overflow: visible; }

/* ---------- Bar charts ---------- */

.ld-bars {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 140px;
}
.ld-bars .col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; }
.ld-bars .bar { width: 100%; border-radius: 10px; background: var(--plate-3); transition: height .4s; }
.ld-bars .bar.now { background: var(--accent); border: 1px solid var(--text); }
.ld-bars .val { font-size: 11px; color: var(--text-2); font-weight: 600; }
.ld-bars .lbl { font-size: 11.5px; color: var(--muted); }

.ld-pairs {
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  height: 200px;
  padding-top: 10px;
}
.ld-pairs .grp { display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.ld-pairs .duo { display: flex; align-items: flex-end; gap: 4px; flex: 1; min-height: 0; }
.ld-pairs .duo span { width: 16px; border-radius: 4px; display: block; }
.ld-pairs .j { background: var(--text); }
.ld-pairs .l { background: var(--plate-3); }
.ld-pairs .lbl { font-size: 11.5px; color: var(--muted); }
.ld-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--text-2); }
.ld-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* ---------- Attendance grid ---------- */

.ld-attend {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.ld-attend span { height: 18px; border-radius: 5px; background: var(--chip); }
.ld-attend span.on { background: var(--ink); }
.ld-attend span.today { background: var(--accent); border: 1px solid var(--ink); }
.ld-attend span.future { background: var(--card); border: 1px solid var(--border); }
.ld-attend-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 8px; font-size: 11px; color: var(--muted); }

/* ---------- Roster ---------- */

.ld-roster { width: 100%; border-collapse: separate; border-spacing: 6px; min-width: 640px; table-layout: fixed; }
.ld-roster th:first-child { width: 140px; }
.ld-roster th { font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); font-weight: 800; padding: 0 4px 4px; text-align: left; }
.ld-roster th.today { color: var(--text); font-weight: 700; }
.ld-roster td.who { font-weight: 600; font-size: 13px; white-space: nowrap; padding-right: 6px; }
.ld-roster .cell {
  display: grid;
  place-items: center;
  min-height: 40px;
  border-radius: 10px;
  background: var(--chip);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  padding: 4px;
}
.ld-roster .cell.off { background: var(--card); border: 1px dashed var(--plate-3); color: var(--muted); }
.ld-roster .cell.leave { background: var(--warn-bg); color: var(--warn); }
.ld-roster .cell.today { background: var(--accent); border: 1px solid var(--ink); font-weight: 600; }
.ld-roster .cell.today.off { background: var(--card); }

.ld-leave {
  border: 1px solid var(--border);
  border-radius: var(--r-btn);
  padding: 14px 16px;
}
.ld-leave + .ld-leave { margin-top: 12px; }
.ld-leave .type { font-size: 10.5px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--text-2); font-weight: 600; }

/* ---------- WhatsApp preview ---------- */

.ld-wa {
  background: var(--wa-bg);
  border-radius: var(--r-card);
  padding: 14px;
}
.ld-wa .bubble {
  background: var(--bubble);
  border-radius: var(--r-chip);
  padding: 12px 14px;
  font-size: 13.5px;
  white-space: pre-wrap;
  box-shadow: 0 1px 1px rgba(0,0,0,.06);
}
.ld-wa .bubble b { font-weight: 700; }

.ld-msg-row { cursor: pointer; }
.ld-msg-row .name { transition: color .15s; }
.ld-msg-row.selected .name { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Plan cards ---------- */

.ld-plan { height: 100%; display: flex; flex-direction: column; }
.ld-plan.featured { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink) inset; }
.ld-plan .price { font-size: 26px; font-weight: 700; letter-spacing: -0.3px; }
.ld-plan .per { color: var(--muted); font-size: 12.5px; font-weight: 400; }
.ld-plan .foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--divider); display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; }

/* ---------- Staff cards ---------- */

.ld-staff-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; font-size: 12px; margin: 14px 0; }
.ld-staff-grid .k { color: var(--muted); }
.ld-staff-grid .v { font-weight: 700; font-size: 13px; }

/* ---------- Tweaks ---------- */

.ld-tweaks {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1050;
}
.ld-tweaks-btn {
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 600;
  font-size: 13px;
  box-shadow: 0 6px 20px rgba(20,22,27,.08);
  display: flex;
  align-items: center;
  gap: 8px;
}
.ld-tweaks-btn i { width: 14px; height: 14px; border-radius: 50%; background: var(--accent); border: 1px solid var(--text); display: inline-block; }
.ld-tweaks-panel {
  position: absolute;
  right: 0;
  bottom: 52px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 14px;
  width: 220px;
  box-shadow: 0 12px 32px rgba(20,22,27,.12);
  display: none;
}
.ld-tweaks.open .ld-tweaks-panel { display: block; }
.ld-swatches { display: flex; gap: 10px; margin-top: 8px; }
.ld-swatch {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid transparent;
  outline: 1px solid var(--border);
  cursor: pointer;
}
.ld-swatch.active { border-color: var(--text); }

/* ---------- Bootstrap overrides ---------- */

.modal-content { border-radius: var(--r-hero); border: 1px solid var(--border); }
.modal-header, .modal-footer { border: 0; padding: 20px 24px; }
.modal-body { padding: 4px 24px 8px; }
.modal-title { font-weight: 700; font-size: 18px; }

.dropdown-menu { border-radius: 14px; border-color: var(--border); padding: 6px; box-shadow: 0 10px 28px rgba(20,22,27,.1); }
.dropdown-item { border-radius: var(--r-chip); font-weight: 600; padding: 8px 12px; }
.dropdown-item.active, .dropdown-item:active { background: var(--text); }

.toast-container { z-index: 1100; }
.ld-toast {
  background: var(--text);
  color: var(--on-text);
  border-radius: 14px;
  padding: 12px 16px;
  font-weight: 600;
  font-size: 13.5px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 10px 30px rgba(20,22,27,.25);
}
.ld-toast::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }

.ld-radio-card {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  cursor: pointer;
  font-weight: 600;
}
.ld-radio-card input { accent-color: var(--text); width: 18px; height: 18px; }
.ld-radio-card:has(input:checked) { border-color: var(--ink); background: var(--ok-bg); }
.ld-radio-card .sub { font-weight: 400; color: var(--muted); font-size: 12.5px; }

.ld-plan-pick { position: relative; }
.ld-plan-btn { width: 100%; display: flex; align-items: center; gap: 12px; border: 1px solid var(--ink); border-radius: 14px; padding: 12px 14px; background: var(--ok-bg); color: var(--text); font-weight: 600; text-align: left; }
.ld-plan-btn svg { flex-shrink: 0; color: var(--text-2); transition: transform .15s; }
.ld-plan-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
.ld-plan-pick .sub { display: block; font-weight: 400; color: var(--muted); font-size: 12.5px; }
.ld-plan-menu { max-height: 280px; overflow-y: auto; }
.ld-plan-menu .dropdown-item { white-space: normal; padding: 10px 12px; }
.ld-plan-btn, .ld-plan-menu .dropdown-item { font-size: 14.5px; }
.ld-plan-menu .dropdown-item.active { background: var(--ok-bg); color: var(--text); box-shadow: inset 0 0 0 1px var(--ink); }

.ld-seg { display: flex; background: var(--chip); border-radius: var(--r-btn); padding: 4px; gap: 4px; }
.ld-seg label { flex: 1; text-align: center; padding: 9px 8px; border-radius: 9px; cursor: pointer; font-weight: 600; font-size: 13px; }
.ld-seg input { display: none; }
.ld-seg label:has(input:checked) { background: var(--card); box-shadow: 0 1px 3px rgba(0,0,0,.08); }

/* ---------- Header: gym switcher + account ---------- */

.ld-gym-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-btn);
  padding: 6px 14px 6px 6px;
  text-align: left;
  color: var(--text);
  min-height: 48px;
}
.ld-gym-btn:hover { background: var(--hover); }
.ld-gym-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
}
.ld-gym-text strong { display: block; font-size: 13.5px; font-weight: 700; line-height: 1.2; }
.ld-gym-text small { display: block; font-size: 11.5px; color: var(--muted); line-height: 1.2; }
.ld-gym-text small::after { content: " ▾"; font-size: 9px; }

.ld-gym-menu { width: 300px; padding: 10px; border-radius: var(--r-card); }
.ld-gym-menu .ld-label { padding: 6px 10px 4px; }
.ld-gym-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: 0;
  background: none;
  border-radius: var(--r-chip);
  padding: 9px 10px;
  text-align: left;
  color: var(--text);
  text-decoration: none;
}
.ld-gym-item:hover, .ld-gym-item.current { background: var(--chip); }
.ld-gym-item .grow { flex: 1; min-width: 0; }
.ld-gym-item strong { display: block; font-size: 14px; }
.ld-gym-item small { color: var(--muted); font-size: 12px; }
.ld-gym-item .check { color: var(--ink); font-weight: 700; }
.ld-menu-link {
  display: block;
  padding: 10px;
  border-radius: 10px;
  font-weight: 600;
  text-decoration: none;
  color: var(--text);
}
.ld-menu-link:hover { background: var(--chip); }
.ld-menu-sep { border: 0; border-top: 1px solid var(--divider); margin: 6px 0; opacity: 1; }

.ld-avatar-btn {
  width: 48px;
  height: 48px;
  border-radius: var(--r-btn);
  border: 0;
  background: var(--text);
  color: var(--on-text);
  font-weight: 700;
  font-size: 13px;
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 3px transparent;
  transition: box-shadow .15s;
}
.ld-avatar-btn[aria-expanded="true"], .ld-avatar-btn:hover { box-shadow: 0 0 0 3px var(--accent); }
.ld-avatar.dark { background: var(--text); color: var(--on-text); border-radius: 10px; }
.ld-top-end { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.ld-top-actions:empty { display: none; }
.ld-top-actions:empty ~ .ld-top-end { margin-left: auto; }

.ld-account-menu { width: 320px; padding: 8px; border-radius: var(--r-card); }
.ld-account-head { display: flex; align-items: center; gap: 12px; padding: 10px 12px 12px; border-bottom: 1px solid var(--divider); margin-bottom: 4px; }
.ld-account-head strong { display: block; font-size: 16px; }
.ld-account-head small { color: var(--muted); }
.ld-account-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  font-size: 14.5px;
  background: none;
  border: 0;
  width: 100%;
  text-align: left;
}
.ld-account-row:hover { background: var(--chip); }
.ld-account-row { white-space: nowrap; }
.ld-account-row small { color: var(--muted); font-weight: 400; font-size: 12.5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; text-align: right; }
.ld-account-row.danger { color: var(--danger); }

/* ---------- Steps (Add a gym) ---------- */

.ld-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.ld-steps li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 10px;
  border-radius: var(--r-chip);
  font-weight: 600;
  font-size: 13.5px;
}
.ld-steps li.on { background: var(--chip); }
.ld-steps .n {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  font-size: 11.5px;
  flex-shrink: 0;
}
.ld-steps li.on .n { background: var(--text); color: var(--on-text); border-color: var(--text); }
.ld-steps li.done .n { background: var(--accent); border-color: var(--ink); }

.ld-check-row { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-top: 1px solid var(--divider); cursor: pointer; }
.ld-check-row input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--text); flex-shrink: 0; }

/* ---------- Feedback ---------- */

.ld-fb-item {
  display: flex;
  gap: 12px;
  width: 100%;
  border: 1px solid transparent;
  background: none;
  border-radius: 14px;
  padding: 12px 14px;
  text-align: left;
  color: var(--text);
}
.ld-fb-item:hover { background: var(--hover); }
.ld-fb-item.selected { border-color: var(--ink); background: var(--sel); }
.ld-fb-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); margin-top: 7px; flex-shrink: 0; }
.ld-fb-item.resolved .ld-fb-dot { background: var(--plate-3); }
.ld-quote { background: var(--chip); border-radius: 14px; padding: 12px 16px; }

/* ---------- Import ---------- */

.ld-file {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--ink);
  background: var(--sel);
  border-radius: var(--r-card);
  padding: 14px 16px;
}
.ld-file-badge { width: 36px; height: 36px; border-radius: 10px; background: var(--accent); display: grid; place-items: center; font-size: 11px; font-weight: 700; flex-shrink: 0; }
.ld-col-src {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  background: var(--chip);
  border-radius: 8px;
  padding: 7px 10px;
  flex: 1;
}
.ld-col-dst { flex: 1; border: 0; background: none; font-weight: 600; font-size: 13.5px; padding: 4px 0; color: var(--text); }
.ld-col-dst.skip { color: var(--muted); font-weight: 400; }

/* ---------- Tax invoice (A4) ---------- */

.ld-a4 {
  width: 210mm;
  min-height: 297mm;
  max-width: 100%;
  margin: 0 auto;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 20px 50px -20px rgba(20,22,27,.25);
  padding: 18mm 16mm 14mm;
  display: flex;
  flex-direction: column;
  font-size: 13px;
}
.ld-inv-box { border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; height: 100%; }
.ld-inv-table { width: 100%; border-collapse: collapse; margin-top: 24px; }
.ld-inv-table th { background: #F3F4F1; font-size: 10.5px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--text-2); font-weight: 600; padding: 10px 12px; text-align: left; }
.ld-inv-table th:first-child { border-radius: 10px 0 0 10px; }
.ld-inv-table th:last-child { border-radius: 0 10px 10px 0; text-align: right; }
.ld-inv-table td { padding: 14px 12px; border-bottom: 1px solid var(--divider); vertical-align: top; }
.ld-inv-table td:last-child { text-align: right; }
.ld-inv-foot { display: flex; gap: 24px; align-items: flex-start; flex-wrap: wrap; margin-top: 18px; }
.ld-inv-plan { width: 300px; height: auto; }
.ld-inv-totals { width: 300px; margin-left: auto; }
.ld-inv-totals .ld-kv { padding: 5px 0; }
.ld-inv-bar { position: relative; height: 4px; background: var(--chip); border-radius: 2px; margin: 34px 0 0; }
.ld-inv-bar::before, .ld-inv-bar::after { content: ""; position: absolute; top: -8px; width: 8px; height: 20px; border-radius: 3px; background: var(--accent); border: 1px solid var(--ink); }
.ld-inv-bar::before { left: 0; }
.ld-inv-bar::after { right: 0; }

/* ---------- ID card ---------- */

.ld-idcard {
  width: 400px;
  max-width: 100%;
  aspect-ratio: 85.6 / 54;
  border-radius: 18px;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
.ld-idcard.front { background: var(--night); color: #fff; }
.ld-idcard.back { background: #fff; border: 1px solid var(--border); flex-direction: row; align-items: center; gap: 22px; }
.ld-idcard .photo { width: 72px; height: 84px; border-radius: 12px; background: #3A3F4B; display: grid; place-items: center; font-size: 12px; color: #A9AEB8; flex-shrink: 0; }
.ld-idcard .bar { margin-top: auto; height: 4px; background: #3A3F4B; border-radius: 2px; position: relative; }
.ld-idcard .bar::before, .ld-idcard .bar::after { content: ""; position: absolute; top: -6px; width: 10px; height: 16px; border-radius: 3px; background: var(--accent); box-shadow: 5px 0 0 -1px var(--accent); }
.ld-idcard .bar::before { left: 0; }
.ld-idcard .bar::after { right: 5px; }
.ld-idqr { width: 120px; height: 120px; padding: 10px; border-radius: 14px; background: #fff; border: 8px solid var(--accent); flex-shrink: 0; }
.ld-idqr svg { width: 100%; height: 100%; display: block; }

/* ---------- States sheet ---------- */

.ld-skel { background: linear-gradient(90deg, var(--chip) 25%, var(--hover) 37%, var(--chip) 63%); background-size: 400% 100%; animation: ld-shimmer 1.4s ease infinite; border-radius: 8px; }
@keyframes ld-shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.ld-state-icon { width: 44px; height: 44px; border-radius: var(--r-chip); background: var(--chip); display: grid; place-items: center; margin: 0 auto 12px; }
.ld-banner-dark { background: var(--text); color: var(--on-text); border-radius: var(--r-btn); padding: 14px 18px; display: flex; gap: 12px; align-items: flex-start; }

@media print {
  .ld-noprint, .ld-tweaks, .toast-container { display: none !important; }
  body { background: #fff; }
  .ld-shell { padding: 0; max-width: none; }
  .ld-a4 { box-shadow: none; border-radius: 0; width: auto; min-height: auto; padding: 0; }
}

/* ---------- Responsive ---------- */

/* ---------- Login ---------- */

body.ld-auth {
  min-height: 100vh;
  background:
    radial-gradient(600px 320px at 50% -80px, color-mix(in srgb, var(--accent) 35%, transparent), transparent 70%),
    var(--bg);
}
.ld-auth-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 40px 16px;
}
.ld-auth-logo img { display: block; }
.ld-auth-card { width: 100%; max-width: 420px; padding: 32px; }
.ld-auth-title { font-size: 32px; font-weight: 800; letter-spacing: -0.03em; margin: 0 0 6px; }
.ld-phone { display: flex; }
.ld-phone-cc {
  display: grid;
  place-items: center;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-right: 0;
  border-radius: var(--r-btn) 0 0 var(--r-btn);
  background: var(--chip);
  font-weight: 700;
}
.ld-phone .ld-input { border-radius: 0 var(--r-btn) var(--r-btn) 0; font-size: 17px; letter-spacing: .5px; }
.ld-code-input { font-size: 28px; font-weight: 800; letter-spacing: 12px; text-align: center; min-height: 60px; }
.ld-code-input::placeholder { letter-spacing: 12px; }
.ld-auth-error { color: var(--danger); background: var(--danger-bg); border-radius: var(--r-chip); padding: 10px 12px; font-size: 13.5px; font-weight: 600; margin: 0 0 14px; }
.ld-auth-dev { color: var(--ok); background: var(--ok-bg); border-radius: var(--r-chip); padding: 10px 12px; font-size: 13.5px; font-weight: 700; margin: 0 0 14px; }
.ld-auth-foot { color: var(--muted); font-size: 13px; text-align: center; margin: 0; }
.ld-link[disabled] { color: var(--muted); text-decoration: none; cursor: default; }

/* ---------- Empty pages (real gym, no data yet) ---------- */

.ld-empty-card { width: 100%; margin: 8px 0 0; padding: 56px 32px 32px; text-align: center; }
.ld-empty-card .ld-empty-progress { max-width: 560px; margin-left: auto; margin-right: auto; }

.ld-day-picks { display: flex; flex-wrap: wrap; gap: 6px; }
.ld-day-picks label { position: relative; }
.ld-day-picks input { position: absolute; opacity: 0; pointer-events: none; }
.ld-day-picks span {
  display: inline-grid;
  place-items: center;
  min-width: 48px;
  height: 40px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-chip);
  background: var(--card);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}
.ld-day-picks input:checked + span { background: var(--text); border-color: var(--text); color: var(--on-text); }
.ld-day-picks input:focus-visible + span { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 50%, transparent); }
.ld-empty-plate { display: block; margin: 0 auto 18px; }
.ld-empty-title { font-size: 28px; font-weight: 800; letter-spacing: -0.03em; margin: 0 0 8px; }
.ld-empty-text { max-width: 420px; margin: 0 auto 24px; font-size: 15px; }
.ld-empty-progress {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  margin-top: 32px;
  padding: 14px 18px;
  border-radius: var(--r-btn);
  background: var(--bg);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: none;
  text-align: left;
}
.ld-empty-progress:hover { background: var(--chip); color: var(--text); }
.ld-empty-progress .go { color: var(--ink); }

@media (max-width: 575.98px) {
  .ld-empty-card { padding: 36px 20px 22px; }
  .ld-empty-progress { grid-template-columns: 1fr auto; }
  .ld-empty-progress .ld-track { grid-column: 1 / -1; grid-row: 2; }
}

/* ---------- First gym setup ---------- */

.ld-setup { max-width: 640px; margin: 0 auto; padding: 24px 16px 64px; }
.ld-setup-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.ld-setup-top img { display: block; }
.ld-setup-card { padding: 32px; }
.ld-setup-block { padding: 22px 0; border-top: 1px solid var(--divider); }
.ld-setup-block:last-of-type { margin-bottom: 22px; border-bottom: 1px solid var(--divider); }
.ld-hours { display: grid; grid-template-columns: auto 1fr auto 1fr; align-items: center; gap: 10px 12px; }
.ld-hours .ld-input:disabled { opacity: .45; }
.ld-plan-rows { display: grid; gap: 10px; }
.ld-plan-row { display: grid; grid-template-columns: 1fr 130px 120px 36px; gap: 8px; align-items: center; }
.ld-money, .ld-days { position: relative; }
.ld-money span { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 700; }
.ld-money .ld-input { padding-left: 30px; }
.ld-days span { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 13px; }
.ld-days .ld-input { padding-right: 48px; }
.ld-plan-remove { width: 36px; height: 36px; border: 0; border-radius: var(--r-chip); background: var(--chip); color: var(--muted); font-size: 20px; line-height: 1; }
.ld-plan-remove:hover:not(:disabled) { background: var(--danger-bg); color: var(--danger); }
.ld-plan-remove:disabled { opacity: .35; }

@media (max-width: 575.98px) {
  .ld-setup-card { padding: 22px; }
  .ld-hours { grid-template-columns: 1fr 1fr; }
  .ld-hours > span.fw-semibold { grid-column: 1 / -1; }
  .ld-hours > span.ld-muted { display: none; }
  .ld-plan-row { grid-template-columns: 1fr 1fr 36px; }
  .ld-plan-row > [data-f="name"] { grid-column: 1 / -1; }
}

@media (max-width: 991.98px) {
  .ld-top-end { order: 1; margin-left: auto; }
  .ld-nav { order: 2; width: 100%; }
  .ld-top-actions { order: 3; margin-left: 0; width: 100%; justify-content: flex-end; }
  .ld-date { display: none; }
}

@media (max-width: 575.98px) {
  .ld-shell { padding: 16px 16px 80px; }
  .ld-h1 { font-size: 32px; }
  .ld-stat { font-size: 26px; }
  .ld-stat.xl { font-size: 40px; }
  .ld-card { padding: 18px; }
  .ld-top { gap: 12px; }
  .ld-filters { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .ld-filters .ld-select { min-width: 0; padding: 0 8px; font-size: 13px; }
  .ld-filters .ld-filter-clear { grid-column: 1 / -1; }
  .ld-gym-text strong { font-size: 12.5px; }
  .ld-brand-lockup { display: none !important; }
  .ld-brand-mark { display: block !important; }
  .ld-top-end { gap: 8px; }
  .ld-top-actions :is(.btn-ld, .btn-ld-outline, .btn-ld-dark, .btn-ld-ink) { min-height: 40px; padding: 0 12px; font-size: 13px; }
  .ld-a4 { padding: 20px; min-height: auto; }
  .ld-idcard.back { gap: 14px; padding: 16px; }
  .ld-idqr { width: 96px; height: 96px; border-width: 6px; }
}

/* ---------- Photos ---------- */

.ld-avatar { overflow: hidden; }
.ld-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ld-photo-edit { position: relative; display: inline-block; cursor: pointer; line-height: 0; }
.ld-photo-pencil {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--text);
  color: var(--on-text);
  border: 2px solid var(--card);
  display: grid;
  place-items: center;
}
.ld-photo-edit:hover .ld-photo-pencil { background: var(--ink); }
.ld-photo-busy { opacity: .5; }
.ld-photo-view .modal-content { background: rgba(10, 11, 14, .94); border: 0; border-radius: 0; display: grid; place-items: center; cursor: zoom-out; }
.ld-photo-view img { max-width: 94vw; max-height: 90vh; object-fit: contain; border-radius: 14px; }
.ld-photo-view .btn-close { position: absolute; top: 18px; right: 18px; z-index: 2; }

/* ---------- Month picker (page heading) ---------- */

.ld-month { display: inline-flex; align-items: center; background: var(--card); border: 1px solid var(--border); border-radius: var(--r-btn); padding: 3px; }
.ld-month-step { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; font-size: 20px; line-height: 1; color: var(--text); text-decoration: none; }
.ld-month-step:hover { background: var(--chip); color: var(--text); }
.ld-month-step.disabled { color: var(--plate-3); pointer-events: none; }
.ld-month-btn { border: 0; background: none; font-weight: 700; font-size: 14px; padding: 6px 10px; border-radius: 9px; color: var(--text); white-space: nowrap; }
.ld-month-btn:hover { background: var(--chip); }
@media print { .ld-month { display: none !important; } }

.ld-icon-btn { width: 44px; flex: 0 0 44px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.ld-dots { width: 30px; height: 30px; flex: 0 0 30px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--muted); display: inline-grid; place-items: center; line-height: 0; }
.ld-dots svg { width: 16px; height: 16px; }
.ld-dots:hover, .ld-dots[aria-expanded="true"] { background: var(--chip); color: var(--text); }
.ld-mini-btn { width: 28px; height: 28px; flex: 0 0 28px; padding: 0; border: 1px solid var(--border); border-radius: 8px; background: var(--card); color: var(--text-2); display: inline-grid; place-items: center; line-height: 0; text-decoration: none; }
.ld-mini-btn:hover, .ld-mini-btn[aria-expanded="true"] { background: var(--chip); color: var(--text); }
.ld-mini-btn svg { width: 14px; height: 14px; }

.ld-auth-or { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--text-2); font-size: 13px; }
.ld-auth-or::before, .ld-auth-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* Demo gym strip under the header. */
.ld-demo-bar { display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap; margin: -8px 0 20px; padding: 10px 12px 10px 16px; border-radius: 14px; background: var(--text); color: var(--on-text); font-size: 14px; }
.ld-demo-text { flex: 1 1 220px; }
.ld-demo-roles { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.ld-demo-label { opacity: .7; margin-right: 4px; font-size: 13px; }
.ld-demo-role { padding: 5px 12px; border-radius: 999px; color: inherit; text-decoration: none; font-weight: 600; font-size: 13px; border: 1px solid rgba(255, 255, 255, .22); }
html[data-theme="dark"] .ld-demo-role { border-color: rgba(0, 0, 0, .2); }
.ld-demo-role:hover { color: inherit; background: rgba(127, 127, 127, .18); }
.ld-demo-role.active { background: var(--accent); border-color: var(--accent); color: #14161B; }
.ld-demo-cta { color: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.ld-demo-cta:hover { color: var(--accent); }
html[data-theme="dark"] .ld-demo-cta:hover { color: inherit; opacity: .75; }

/* My clients: workout editor rows. */
.ld-wo-row { display: grid; grid-template-columns: minmax(0, 1fr) 64px 76px 72px 28px; gap: 8px; align-items: center; margin-bottom: 8px; }
.ld-wo-row.ld-label { margin-bottom: 4px; }
.ld-wo-row .ld-input { padding-left: 12px; padding-right: 8px; min-width: 0; }
@media (max-width: 520px) { .ld-wo-row { grid-template-columns: minmax(0, 1fr) 48px 60px 56px 28px; gap: 6px; } }
.ld-pay-off { color: var(--ok); font-weight: 600; }
.ld-ok-text { color: var(--ok); font-weight: 600; }
.dropdown-item.ld-danger-item { color: var(--danger); font-weight: 600; }

/* ---------- Staff without the discount switch don't see discount fields ---------- */
.cannot-discount .ld-field:has(> #amDiscount, > #paDiscount, > #renewDiscount, > #recDiscount) { display: none !important; }

/* ---------- Dark mode (html[data-theme="dark"], set from the account menu) ---------- */

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0E1014;
  --card: #171A20;
  --border: #2A2F38;
  --chip: #222630;
  --divider: #232731;
  --text: #ECEEF2;
  --text-2: #C3C8D2;
  --muted: #959DAB;
  --ink: color-mix(in srgb, var(--accent) 82%, #ECEEF2);
  --warn: #FB923C;
  --warn-2: #FDBA74;
  --warn-bg: #2A1A0E;
  --warn-border: #5A3412;
  --danger: #F87171;
  --danger-bg: #3A1716;
  --ok: color-mix(in srgb, var(--accent) 82%, #ECEEF2);
  --ok-bg: color-mix(in srgb, var(--accent) 12%, #171A20);
  --info: #93B4FF;
  --info-bg: #14213D;
  --plate-1: #ECEEF2;
  --plate-2: #8A93A3;
  --plate-3: #3A404B;
  --bar: #5B6372;
  --sleeve: #8A93A3;
  --on-text: #0E1014;
  --hover: #1C2027;
  --sel: #1E2810;
  --soft: #1C2027;
  --wa-bg: #1B1F24;
  --bubble: #232831;
  --edge: #3A404B;
  --dark-hover: #FFFFFF;
  --placeholder: #6B7384;
  --bs-body-bg: var(--bg);
  --bs-body-color: var(--text);
  --bs-border-color: var(--border);
  --bs-secondary-bg: var(--chip);
  --bs-tertiary-bg: var(--hover);
  --bs-emphasis-color: var(--text);
}
/* Lime (accent) surfaces keep dark text. */
html[data-theme="dark"] :is(.btn-ld, .ld-pill.accent, .ld-avatar.accent, .ld-gym-mark, .ld-page[aria-current="page"], .ld-quick-icon,
  .ld-chip.lime, .ld-copy-field button:hover, .ld-roster .cell.today, .ld-attend span.today, .ld-steps li.done .n, .ld-file-badge) { color: #14161B; }
html[data-theme="dark"] .ld-quick-icon svg { color: #14161B; }
html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .dropdown-menu { background: var(--card); color: var(--text); }
html[data-theme="dark"] .dropdown-item { color: var(--text); }
html[data-theme="dark"] .dropdown-item:hover, html[data-theme="dark"] .dropdown-item:focus { background: var(--chip); color: var(--text); }
html[data-theme="dark"] .dropdown-item.active, html[data-theme="dark"] .dropdown-item:active { background: var(--text); color: var(--on-text); }
html[data-theme="dark"] .ld-chip.active .cnt { color: #4B5260; }
html[data-theme="dark"] .ld-tl-icon { background: #222630; }
html[data-theme="dark"] .ld-tl-icon.call { background: #16243A; color: #93B4FF; }
html[data-theme="dark"] .ld-tl-icon.whatsapp, html[data-theme="dark"] .ld-tl-icon.message { background: #12291C; color: #5BD08A; }
html[data-theme="dark"] .ld-tl-icon.visit { background: #2E2210; color: #F5B556; }
html[data-theme="dark"] .ld-tl-icon.follow_up { background: #351819; color: #F08A8A; }
html[data-theme="dark"] .ld-barbell svg [fill="#9AA1B0"] { fill: #5B6372; }
html[data-theme="dark"] .ld-barbell svg [fill="#14161B"] { fill: #ECEEF2; }
html[data-theme="dark"] .ld-barbell svg [stroke="#C2C7D0"] { stroke: #3A404B; }
html[data-theme="dark"] .ld-barbell svg rect[fill="#fff"] { fill: var(--card); stroke: var(--border); }
html[data-theme="dark"] .ld-empty-card svg [stroke="#14161B"] { stroke: var(--text); }
html[data-theme="dark"] .ld-empty-card svg [fill="#E3E5EA"], html[data-theme="dark"] .ld-empty-card svg [stroke="#E3E5EA"] { fill: var(--chip); stroke: var(--border); }

/* Logo: the white + lime lockup on dark. */
.ld-brand .theme-dark { display: none !important; }
html[data-theme="dark"] .ld-brand .theme-light { display: none !important; }
html[data-theme="dark"] .ld-brand .ld-brand-lockup.theme-dark { display: block !important; }
@media (max-width: 575.98px) {
  html[data-theme="dark"] .ld-brand .ld-brand-lockup.theme-dark { display: none !important; }
  html[data-theme="dark"] .ld-brand .ld-brand-mark.theme-dark { display: block !important; }
}

/* Paper stays paper: invoices, ID cards and QR codes keep light colours, and printing is always light. */
html[data-theme="dark"] .ld-a4,
html[data-theme="dark"] .ld-idcard.back,
html[data-theme="dark"] .ld-idqr {
  color-scheme: light;
  --card: #FFFFFF;
  --border: #E3E5EA;
  --chip: #EEF0F3;
  --divider: #EEF0F3;
  --text: #14161B;
  --text-2: #3F4553;
  --muted: #5F6675;
  --ink: #596B18;
  --ok: #3F4F0E;
  --ok-bg: #EEF5D6;
  --on-text: #FFFFFF;
  color: var(--text);
}
@media print {
  html[data-theme="dark"] {
    color-scheme: light;
    --bg: #FFFFFF;
    --card: #FFFFFF;
    --border: #E3E5EA;
    --chip: #EEF0F3;
    --divider: #EEF0F3;
    --text: #14161B;
    --text-2: #3F4553;
    --muted: #5F6675;
    --ink: #596B18;
    --on-text: #FFFFFF;
    --plate-1: #14161B;
    --plate-3: #C2C7D0;
    --bar: #9AA1B0;
  }
}

/* Account menu: dark mode switch row. */
.ld-account-row.ld-theme-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; border: 0; background: none; text-align: left; }
