/* Reusable building blocks: cards, location card, live clock, punch button,
   lists, tags, avatars, tabs, stat tiles, payroll cards, tasks.
   Gold is the accent; green/red only ever mean live status. */

/* ---------- cards ---------- */
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 18px; margin: 12px 0; box-shadow: var(--shadow-sm);
}
.card > .field:first-child, .card > h3:first-child { margin-top: 0; }
.card h3 { margin: 0 0 4px; font-size: 16px; }
.card .btnrow:last-child { margin-bottom: 0; }
.card > .msg:last-child:empty { display: none; }

/* ---------- location card ---------- */
.prox {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 14px 16px; display: flex; gap: 14px; align-items: center; margin-bottom: 12px;
  box-shadow: var(--shadow-sm); animation: rise .35s var(--ease) both;
}
.radar { flex: 0 0 62px; height: 62px; }
.radar circle:last-child { transition: cx .4s var(--ease), cy .4s var(--ease), fill .25s var(--ease); }
.dist { font-size: 22px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.dist small { font-size: 13px; font-weight: 600; color: var(--ink2); letter-spacing: 0; margin-left: 2px; }
.prox-note { font-size: 13px; color: var(--ink2); margin-top: 3px; line-height: 1.4; }
.prox.inside .dist { color: var(--status-good); }
.prox.outside .dist { color: var(--status-bad); }

/* ---------- live clock (hero) ---------- */
.clock {
  position: relative; overflow: hidden;
  background:
    radial-gradient(90% 70% at 50% -10%, rgba(210, 170, 85, .10) 0%, rgba(210, 170, 85, 0) 60%),
    linear-gradient(180deg, var(--hero-2), var(--hero));
  color: var(--hero-ink); border-radius: var(--radius-xl); padding: 22px 18px 18px;
  text-align: center; margin-bottom: 12px; box-shadow: var(--shadow-lg);
  border: 1px solid rgba(210, 170, 85, .22); animation: rise .4s var(--ease) both;
}
.clock .chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px;
  font-size: 12.5px; font-weight: 700; letter-spacing: .02em; color: var(--hero-ink2);
  background: rgba(246, 241, 228, .07); border: 1px solid var(--hero-line);
}
.clock .chip i { width: 7px; height: 7px; border-radius: 50%; background: var(--hero-ink2); display: block; }
.clock .chip.on { color: #BFF0D1; border-color: rgba(82, 189, 128, .35); background: rgba(82, 189, 128, .12); }
.clock .chip.on i { background: #52BD80; animation: pulse 2s infinite; }
.clock .read {
  font-size: 54px; line-height: 1; font-weight: 300; letter-spacing: -.03em; margin-top: 16px;
  font-variant-numeric: tabular-nums; color: var(--hero-ink);
}
.clock.live .read { color: var(--gold); }
.clock .cap { font-size: 14px; color: var(--hero-ink2); margin-top: 10px; font-weight: 500; }
.clock .punch { margin-top: 20px; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(82, 189, 128, .6); }
  70% { box-shadow: 0 0 0 8px rgba(82, 189, 128, 0); }
  100% { box-shadow: 0 0 0 0 rgba(82, 189, 128, 0); }
}

/* Locked (outside the site / no location): a calm card, not an alarm. */
.clock.locked {
  background: var(--panel); color: var(--ink); border: 1px solid var(--status-bad-soft);
  box-shadow: var(--shadow-sm); padding: 22px 18px;
}
.clock.locked .lock-ico {
  width: 46px; height: 46px; margin: 0 auto 12px; border-radius: 50%; display: grid; place-items: center;
  background: var(--status-bad-soft); color: var(--status-bad);
}
.clock.locked .lock-ico svg { width: 22px; height: 22px; }
.clock.locked .read { font-size: 20px; font-weight: 800; letter-spacing: -.01em; line-height: 1.3; margin-top: 0; color: var(--ink); }
.clock.locked .cap { color: var(--ink2); margin-top: 6px; }

.punch {
  width: 100%; min-height: 62px; border: 0; border-radius: var(--radius-lg); font-family: var(--sans);
  font-size: 18px; font-weight: 800; letter-spacing: -.01em; color: var(--on-gold); background: var(--gold-grad); cursor: pointer;
  box-shadow: var(--shadow-gold); transition: transform .12s var(--ease), filter .15s var(--ease);
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.punch svg { width: 22px; height: 22px; flex: 0 0 auto; }
.punch:active:not(:disabled) { transform: scale(.98); filter: brightness(.95); }
.punch.out { background: var(--hero-ink); color: var(--hero); box-shadow: 0 10px 22px -12px rgba(0, 0, 0, .8); }
.punch:disabled {
  background: transparent; border: 1px dashed var(--hero-line); color: var(--hero-ink2);
  cursor: not-allowed; box-shadow: none;
}
.why { font-size: 13.5px; color: var(--ink2); text-align: center; margin: 10px 2px 0; min-height: 0; }
.why:empty { display: none; }
.why.warn { color: var(--status-bad); font-weight: 600; }
.clock .why { color: var(--hero-ink2); }
.clock .why.warn { color: #F2A48F; }

/* ---------- lists ---------- */
.rows {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: var(--shadow-sm);
}
.day {
  display: flex; justify-content: space-between; align-items: baseline; padding: 10px 16px 8px;
  font-size: 11.5px; font-weight: 750; color: var(--ink3); background: var(--panel-2);
  border-bottom: 1px solid var(--line2); text-transform: uppercase; letter-spacing: .08em;
}
.day b { color: var(--ink2); font-weight: 750; font-variant-numeric: tabular-nums; text-transform: none; letter-spacing: 0; font-size: 12.5px; }
.row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px 16px;
  border-bottom: 1px solid var(--line2); font-size: 14.5px;
}
.rows > .row:last-child, .rows > details:last-child { border-bottom: 0; }
.row .span { font-variant-numeric: tabular-nums; font-weight: 600; }
.row .dur { font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--ink); }
.row .who { font-weight: 700; }
.row .meta { font-size: 13px; color: var(--ink2); }
/* the action group at the end of a row (only when the row has more than one part) */
.row > span:last-child:not(:first-child):not(.dur) { display: flex; gap: 6px; flex: 0 0 auto; align-items: center; }
.person-cell { display: flex !important; align-items: center; gap: 12px; min-width: 0; flex: 1 1 auto !important; }
.person-cell > span { min-width: 0; }

.avatar {
  flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  font-size: 13.5px; font-weight: 800; letter-spacing: .02em; color: var(--gold-strong);
  background: var(--gold-soft); border: 1px solid rgba(210, 170, 85, .35); position: relative;
}
.avatar.in::after {
  content: ""; position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%;
  background: var(--status-good); border: 2px solid var(--panel);
}
.avatar.dim { color: var(--ink3); background: var(--panel-2); border-color: var(--line); }

.tag {
  display: inline-block; font-size: 11px; font-weight: 750; letter-spacing: .02em; color: var(--status-bad);
  background: var(--status-bad-soft); border-radius: 999px; padding: 2px 8px; margin-left: 6px; vertical-align: 2px;
  font-family: var(--sans);
}
.tag.on { color: var(--status-good); background: var(--status-good-soft); }
.tag.admin { color: var(--gold-strong); background: var(--gold-soft); }
.tag.pending { color: var(--gold-strong); background: var(--gold-soft); }
.empty { font-size: 14px; color: var(--ink3); padding: 22px 16px; text-align: center; }

/* ---------- tabs (pills, scroll sideways when they don't fit) ---------- */
.tabs {
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  margin: 0 -16px 6px; padding: 4px 16px 12px; position: sticky; top: 0; z-index: 5;
  background: linear-gradient(180deg, var(--paper) 78%, transparent);
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 0 0 auto; padding: 9px 16px; min-height: 40px; font-size: 13.5px; font-weight: 650; font-family: var(--sans);
  border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--ink2);
  cursor: pointer; white-space: nowrap; transition: all .15s var(--ease); box-shadow: var(--shadow-sm);
}
.tab.sel { background: var(--ink); border-color: var(--ink); color: var(--paper); box-shadow: var(--shadow-md); }
/* A second, in-page tab row (Payroll: Pay run / Rules) reads as a segmented control. */
.tabs.seg {
  position: static; margin: 4px 0 6px; padding: 4px; gap: 4px; background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 999px; overflow: visible;
}
.tabs.seg .tab { flex: 1 1 0; min-width: 0; border: 0; box-shadow: none; background: transparent; min-height: 36px; padding: 7px 4px; overflow: hidden; text-overflow: ellipsis; }
.tabs.seg .tab.sel { background: var(--panel); color: var(--ink); box-shadow: var(--shadow-sm); }

/* ---------- stat + tiles ---------- */
.stat {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 18px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); margin-top: 12px;
  box-shadow: var(--shadow-sm);
}
.stat .k { font-size: 13.5px; color: var(--ink2); font-weight: 600; }
.stat .v { font-size: 24px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--ink); white-space: nowrap; }
.stat .v small { font-size: 14px; font-weight: 600; color: var(--ink3); letter-spacing: 0; }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 14px 16px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 4px; min-width: 0;
}
.tile .k { font-size: 12.5px; color: var(--ink2); font-weight: 600; }
.tile .v { font-size: 24px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .v small { font-size: 13px; font-weight: 600; color: var(--ink3); letter-spacing: 0; margin-left: 2px; }
.tile.gold { background: var(--hero); border-color: rgba(210, 170, 85, .3); }
.tile.gold .k { color: var(--hero-ink2); }
.tile.gold .v { color: var(--gold); }

/* "x of y" bar */
.meter { height: 8px; border-radius: 999px; background: var(--line2); overflow: hidden; margin-top: 12px; }
.meter i { display: block; height: 100%; border-radius: 999px; background: var(--gold-grad); transition: width .4s var(--ease); }

.hero-stat {
  background:
    radial-gradient(100% 120% at 100% 0%, rgba(210, 170, 85, .09) 0%, rgba(210, 170, 85, 0) 50%),
    linear-gradient(180deg, var(--hero-2), var(--hero));
  color: var(--hero-ink); border-radius: var(--radius-xl); padding: 18px 20px; box-shadow: var(--shadow-lg);
  border: 1px solid rgba(210, 170, 85, .22); animation: rise .35s var(--ease) both;
}
.hero-stat .k { font-size: 13px; color: var(--hero-ink2); font-weight: 600; display: block; }
.hero-stat .v { font-size: 40px; font-weight: 300; letter-spacing: -.03em; line-height: 1.1; color: var(--gold); display: block; margin-top: 4px; }
.hero-stat .v small { font-size: 18px; color: var(--hero-ink2); font-weight: 500; letter-spacing: 0; }
.hero-stat .meter { background: rgba(246, 241, 228, .1); }

/* ---------- payroll cards ---------- */
details.pay { border-bottom: 1px solid var(--line2); }
details.pay > summary {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 14px 16px; cursor: pointer; list-style: none; font-size: 14.5px;
}
details.pay > summary::-webkit-details-marker { display: none; }
details.pay[open] > summary { background: var(--panel-2); }
details.pay .net { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--gold-strong); font-size: 16px; }
.kv { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; padding: 5px 0; color: var(--ink2); }
.kv b { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.kv.sum { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 10px; color: var(--ink); font-weight: 750; font-size: 14.5px; }
.kv.sum b { color: var(--gold-strong); font-weight: 800; }
.payfoot { padding: 6px 16px 16px; background: var(--panel-2); }

.loading {
  font-size: 14px; color: var(--ink3); padding: 40px 16px; text-align: center; font-weight: 600;
  position: relative; overflow: hidden; border-radius: var(--radius-lg); background: var(--panel); border: 1px solid var(--line);
}
.loading::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(210, 170, 85, .18), transparent);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* ---------- working-days checkboxes (People → Edit) ---------- */
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.checks label {
  display: inline-flex !important; align-items: center; gap: 6px; width: auto !important; margin: 0 !important;
  padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel-raised);
  font-size: 13.5px; font-weight: 650; color: var(--ink2); cursor: pointer;
}
.checks label:has(input:checked) { background: var(--gold-soft); border-color: rgba(210, 170, 85, .5); color: var(--ink); }
.checks label input[type="checkbox"] { width: 16px !important; height: 16px; margin: 0 !important; flex: 0 0 auto; accent-color: var(--gold-strong); min-height: 0; }

/* ---------- mandatory tasks (inside the live clock) ---------- */
.mandatory-tasks {
  margin: 18px 0 0; text-align: left; padding: 14px 16px; border-radius: var(--radius-md);
  background: rgba(246, 241, 228, .06); border: 1px solid var(--hero-line);
}
.mandatory-tasks h3 { margin: 0 0 6px; font-size: 12px; font-weight: 750; text-transform: uppercase; letter-spacing: .1em; color: var(--hero-ink2); }
.task-item { display: flex; align-items: flex-start; gap: 10px; margin: 10px 0 0; font-size: 14.5px; line-height: 1.4; cursor: pointer; color: var(--hero-ink); }
.task-item input[type="checkbox"] { width: 18px; height: 18px; margin-top: 1px; flex: 0 0 auto; accent-color: var(--gold); }
.task-warning { margin: 12px 0 0; font-size: 13px; color: #F2A48F; font-weight: 600; }

/* ---------- task results in Records ---------- */
.record-tasks { margin-top: 8px; font-size: 13px; line-height: 1.7; }
.task-title { display: block; font-weight: 750; margin-bottom: 2px; color: var(--ink2); }
.task-done, .task-not-done { display: block; }
.task-done { color: var(--status-good); }
.task-not-done { color: var(--status-bad); }
.record-task-status { margin-top: 3px; font-size: 12.5px; font-weight: 750; }
.record-task-status.done { color: var(--status-good); }
.record-task-status.not-done { color: var(--status-bad); }
.record-main { min-width: 0; flex: 1; }
.record-row { align-items: flex-start; }

/* ---------- leave balance ---------- */
.balance { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.balance .k { font-size: 13px; color: var(--ink2); font-weight: 600; display: block; }
.balance .v { font-size: 30px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; display: block; margin-top: 2px; }
.balance .v small { font-size: 14px; font-weight: 600; color: var(--ink3); letter-spacing: 0; }
.balance .side { text-align: right; font-size: 12.5px; color: var(--ink3); font-weight: 600; line-height: 1.5; }

/* A list row whose actions sit on their own line underneath (pending leave). */
.row.stack { flex-wrap: wrap; }
.row.stack > .acts-line { width: 100%; display: flex !important; gap: 8px; padding-left: 50px; }
.row.stack > .acts-line > .btn:not(.icon) { flex: 1; }
.muted { color: var(--ink3); font-size: 13px; }

/* Narrow phones: give names the full width, buttons go underneath. */
@media (max-width: 380px) {
  .row.people-row { flex-wrap: wrap; }
  .row.people-row > span:last-child { width: 100%; padding-left: 50px; }
  .row.people-row > span:last-child > .btn { flex: 1; }
}
.field input[type="date"] { padding-left: 12px; padding-right: 10px; font-size: 15px; }

/* ---------- shift-end reminder ---------- */
.remind {
  display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 14px; margin: 2px 0 12px;
  background: var(--panel); border: 1px solid rgba(210, 170, 85, .45); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md); animation: rise .35s var(--ease) both;
}
.remind-ico { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--gold-soft); color: var(--gold-strong); flex: 0 0 auto; }
.remind-ico svg { width: 20px; height: 20px; }
.remind-txt { flex: 1; min-width: 0; font-size: 14px; line-height: 1.35; }
.remind-txt span { color: var(--ink2); font-size: 13px; }

/* ---------- share one shift ---------- */
.shift-share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.shift-share > span { font-size: 13px; color: var(--ink3); font-weight: 600; margin-right: 2px; }
.chip-btn {
  font-family: var(--sans); font-size: 13px; font-weight: 650; padding: 8px 12px; min-height: 36px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel); color: var(--ink2); cursor: pointer;
}
.chip-btn:active { background: var(--gold-soft); }

/* ---------- image preview sheet ---------- */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 50; background: rgba(10, 9, 7, .55); backdrop-filter: blur(3px);
  display: flex; align-items: flex-end; justify-content: center; animation: fade-in .2s var(--ease);
}
.sheet {
  width: 100%; max-width: 520px; max-height: 92dvh; overflow: auto; background: var(--paper);
  border-radius: 28px 28px 0 0; padding: 14px 16px calc(20px + var(--safe-b)); box-shadow: var(--shadow-lg);
  animation: rise .3s var(--ease) both;
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; font-size: 16px; }
.sheet-img { display: block; width: 100%; height: auto; border-radius: var(--radius-lg); box-shadow: var(--shadow-md); border: 1px solid var(--line); }

/* ---------- client attendance ---------- */
.cl-launch {
  width: 100%; display: flex; align-items: center; gap: 14px; text-align: left; cursor: pointer;
  font-family: var(--sans); color: var(--ink); background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 14px 16px; margin: 0 0 4px; box-shadow: var(--shadow-sm);
  transition: transform .12s var(--ease);
}
.cl-launch:active { transform: scale(.985); }
.cl-launch b { font-size: 15.5px; }
.cl-launch span span { font-size: 13px; color: var(--ink2); }
.cl-launch > span:nth-child(2) { flex: 1; min-width: 0; line-height: 1.4; }
.cl-ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--hero); color: var(--gold); flex: 0 0 auto; }
.cl-ico svg { width: 22px; height: 22px; }
.cl-go { font-size: 26px; color: var(--ink3); line-height: 1; }

.tick {
  flex: 0 0 auto; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  background: var(--panel); border: 2px solid var(--line); color: transparent; transition: all .15s var(--ease);
}
.tick svg { width: 24px; height: 24px; }
.tick:active { transform: scale(.94); }
.tick.on { background: var(--status-good); border-color: var(--status-good); color: #fff; box-shadow: 0 8px 18px -10px rgba(28, 122, 77, .9); }
.cl-row.is-in { background: var(--status-good-soft); }
.cl-row .tag { margin-left: 8px; }

/* ---------- Excel import ---------- */
.file-btn { position: relative; overflow: hidden; }
.file-btn input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.import-sum { margin: 14px 0 8px; font-size: 14px; line-height: 1.7; }
.import-sum .tag { margin-left: 0; margin-right: 6px; }
.import-rows { max-height: 360px; overflow: auto; }

/* ---------- client membership history ---------- */
.ledger-row { align-items: flex-start; }
.pay-line { display: inline-block; margin-top: 4px; font-size: 12.5px; font-weight: 650; color: var(--status-good); }
.pay-line.none { color: var(--ink3); font-weight: 600; }

/* ---------- client sessions ---------- */
.submit-bar {
  position: sticky; bottom: calc(10px + var(--safe-b)); z-index: 6; display: flex; gap: 10px; margin-top: 14px;
  padding: 10px; border-radius: var(--radius-lg); background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow-lg);
}
.submit-bar .btn.go { flex: 1; }
.tick.done { background: var(--status-good-soft); border-color: transparent; color: var(--status-good); cursor: default; }
.cl-row.is-done { opacity: .75; }
details.sess { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); margin-bottom: 10px; box-shadow: var(--shadow-sm); overflow: hidden; }
details.sess > summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; list-style: none; }
details.sess > summary::-webkit-details-marker { display: none; }
details.sess > .rows { border: 0; border-top: 1px solid var(--line2); border-radius: 0; box-shadow: none; }
.struck { text-decoration: line-through; color: var(--ink3); }
.void-line { color: var(--status-bad); }

/* ---------- client filters ---------- */
.filters { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 12px 14px; margin-top: 12px; box-shadow: var(--shadow-sm); }
.filters .field { margin-top: 0; }
.filter-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.filter-grid label { font-size: 12px; font-weight: 650; color: var(--ink2); display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.filter-grid select, .sort-pick select {
  width: 100%; min-height: 42px; padding: 8px 30px 8px 10px; font-size: 14px; font-family: var(--sans); font-weight: 600; color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel-raised); -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23A9832F' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; text-overflow: ellipsis;
}
.list-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.list-head h2 { margin-bottom: 10px; }
details.sess > summary .who { font-weight: 750; font-size: 15px; }
details.sess > summary .meta { font-size: 13px; color: var(--ink2); }
details.sess > summary .dur { font-weight: 800; font-size: 18px; min-width: 34px; height: 34px; border-radius: 999px; display: grid; place-items: center; background: var(--gold-soft); color: var(--gold-strong); }
details.sess[open] > summary { background: var(--panel-2); }

.pkg-info { margin: 8px 0 0; font-size: 13.5px; font-weight: 650; color: var(--gold-strong); background: var(--gold-soft); border-radius: var(--radius-sm); padding: 8px 12px; }
.month-pick { margin-top: 10px; }
.quick { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 10px; margin: 0 -2px; scrollbar-width: none; }
.quick::-webkit-scrollbar { display: none; }
.quick .chip-btn { flex: none; white-space: nowrap; }
.quick .chip-btn b { margin-left: 4px; font-weight: 700; color: var(--ink); }
.quick .chip-btn.on { background: var(--gold-soft); border-color: var(--gold); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid2 .field { margin-top: 0; min-width: 0; }
.filter-tools { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.filter-tools .btn { flex: none; }
.filter-tools .btn.has { border-color: var(--gold); background: var(--gold-soft); color: var(--ink); }
.sort-pick { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 650; color: var(--ink2); }
.sort-pick select { flex: 1; min-width: 0; }
.applied { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.applied .chip-btn { min-height: 32px; padding: 5px 10px; font-size: 12.5px; }
.applied .chip-btn b { margin-left: 4px; }
.filter-panel { margin-top: 12px; padding-top: 4px; border-top: 1px solid var(--line); }
.filter-group { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink3); margin-top: 12px; }
.filter-panel .filter-grid { margin-top: 6px; }
.filter-grid select.set { border-color: var(--gold); background-color: var(--gold-soft); }

/* ---------- finder: search + filter button, smart lists, filter sheet ---------- */
.finder { margin-top: 12px; }
.search-row { display: flex; gap: 8px; align-items: stretch; }
.search-row input {
  flex: 1; min-width: 0; min-height: 48px; padding: 0 16px; font: 500 16px var(--sans); color: var(--ink);
  background: var(--panel-raised); border: 1px solid var(--line); border-radius: 999px; box-shadow: var(--shadow-sm);
}
.search-row input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.filter-btn {
  flex: none; display: inline-flex; align-items: center; gap: 7px; min-height: 48px; padding: 0 16px; cursor: pointer;
  font: 650 14px var(--sans); color: var(--ink); background: var(--panel-raised); border: 1px solid var(--line); border-radius: 999px; box-shadow: var(--shadow-sm);
}
.filter-btn svg { width: 18px; height: 18px; }
.filter-btn.has { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.filter-btn i { font-style: normal; font-size: 12px; font-weight: 800; min-width: 20px; height: 20px; line-height: 20px; text-align: center; border-radius: 999px; background: var(--gold); color: #1B1710; }
@media (max-width: 359px) { .filter-btn span { display: none; } .filter-btn { padding: 0 14px; } }

.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pills.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 12px -16px 0; padding: 0 16px 2px; }
.pills.scroll::-webkit-scrollbar { display: none; }
.pill {
  flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 14px; white-space: nowrap; cursor: pointer;
  font: 600 13.5px var(--sans); color: var(--ink2); background: var(--panel); border: 1px solid var(--line); border-radius: 999px;
  transition: background .15s, color .15s, border-color .15s;
}
.pill b { font-weight: 800; color: var(--ink3); font-variant-numeric: tabular-nums; }
.pill.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.pill.on b { color: var(--gold); }
.pill.small { min-height: 32px; padding: 0 12px; font-size: 12.5px; }
.pill:focus-visible, .filter-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.applied { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }

.list-head { flex-wrap: wrap; margin-top: 16px; }
.list-head h2 { margin: 0; }
.list-tools { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; }
.sort-mini { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 650; color: var(--ink3); }
.sort-mini select {
  max-width: 150px; min-height: 34px; padding: 4px 26px 4px 10px; font: 650 13px var(--sans); color: var(--ink); text-overflow: ellipsis;
  border: 1px solid var(--line); border-radius: 999px; background: var(--panel) no-repeat right 9px center; -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='7' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23A9832F' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.list-head + .rows { margin-top: 10px; }

.filter-sheet { padding: 0 18px; max-height: 88dvh; }
.filter-sheet .sheet-head { position: sticky; top: 0; z-index: 1; margin: 0 -18px; padding: 16px 18px 12px; background: var(--paper); border-bottom: 1px solid var(--line); font-size: 18px; }
.fgroup { margin-top: 20px; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--gold-strong); }
.fsec { padding: 12px 0; border-bottom: 1px solid var(--line); }
.flabel { font-size: 14px; font-weight: 700; color: var(--ink); margin-bottom: 9px; }
.fsec select {
  width: 100%; min-height: 44px; padding: 8px 34px 8px 14px; font: 600 14px var(--sans); color: var(--ink); text-overflow: ellipsis;
  border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--panel-raised) no-repeat right 12px center; -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23A9832F' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.fsec select.set { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.sheet-foot {
  position: sticky; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 8px -18px 0; padding: 12px 18px calc(14px + var(--safe-b)); background: var(--paper); border-top: 1px solid var(--line);
}
.sheet-foot .btn { flex: 1; max-width: 260px; margin-left: auto; }
@media (min-width: 640px) { .sheet-backdrop:has(.filter-sheet) { align-items: center; } .filter-sheet { border-radius: 28px; } }

/* Records: per-person totals */
.rec-sum .dur { font-weight: 800; }

/* With a mouse (or a wide screen) a swipe-only row can't be reached: show every pill, wrapped. */
@media (hover: hover) and (pointer: fine), (min-width: 640px) {
  .pills.scroll { flex-wrap: wrap; overflow: visible; margin: 12px 0 0; padding: 0; }
}

/* Expiry month calendar */
.mcal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.mcal-head b { font-size: 17px; font-weight: 800; }
.mcal-head .meta { margin-right: auto; }
.mcal-head .btn[disabled] { opacity: .35; }
.mcal-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.mcell {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 58px; cursor: pointer;
  font: 650 13.5px var(--sans); color: var(--ink); background: var(--panel-raised); border: 1px solid var(--line); border-radius: var(--radius-md);
}
.mcell b { font-size: 12px; font-weight: 800; color: var(--gold-strong); font-variant-numeric: tabular-nums; }
.mcell.past b { color: var(--ink3); }
.mcell.now { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.mcell[disabled] { cursor: default; color: var(--ink3); background: transparent; border-style: dashed; }
.mcell.on { background: var(--ink); color: var(--paper); border-color: var(--ink); box-shadow: none; }
.mcell.on b { color: var(--gold); }
.mcell:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ---------- list tiles (Clients) ---------- */
.lists { margin-top: 14px; }
.seg-pills { display: flex; gap: 4px; padding: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; }
.seg-pill { flex: 1; min-width: 0; min-height: 38px; padding: 0 6px; cursor: pointer; font: 650 13.5px var(--sans); color: var(--ink2); background: transparent; border: 0; border-radius: 999px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seg-pill.on { background: var(--ink); color: var(--paper); }
.ltiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-top: 10px; }
.ltile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 78px; padding: 12px 14px; text-align: left; cursor: pointer;
  font-family: var(--sans); color: var(--ink); background: var(--panel-raised); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  transition: background .15s, color .15s, border-color .15s;
}
.ltile b { font-size: 24px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.ltile span { font-size: 12.5px; font-weight: 600; color: var(--ink2); line-height: 1.25; }
.ltile i { font-style: normal; font-size: 12.5px; font-weight: 800; color: var(--gold-strong); margin-top: 2px; }
.ltile.on { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.ltile.on span { color: rgba(255, 255, 255, .72); }
.ltile.on i { color: var(--gold); }
.ltile:focus-visible, .seg-pill:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ---------- renewal reminders (coach screens) ---------- */
.sess.renewals { border-color: var(--gold); margin-bottom: 14px; }
.sess.renewals > summary .dur { background: var(--gold); color: #1B1710; min-width: 30px; height: 30px; line-height: 30px; text-align: center; border-radius: 999px; font-size: 14px; }
.tag.warn { color: #B4231B; background: #FBE9E7; }
.renew-flag { display: inline-block; margin-top: 4px; font-size: 12px; font-weight: 700; }
.renew-flag.expired { color: #B4231B; }
.renew-flag.soon { color: var(--gold-strong); }
.remind-note { margin-top: 12px; padding: 10px 14px; font-size: 13.5px; line-height: 1.4; color: var(--ink); background: var(--gold-soft); border: 1px solid var(--gold); border-radius: var(--radius-md); }
.cl-launch span .cl-alert { display: inline-block; margin-top: 3px; font-size: 12.5px; font-weight: 700; color: var(--gold-strong); }
@media (prefers-color-scheme: dark) { .tag.warn { color: #FFB4AB; background: #4A1F1B; } .renew-flag.expired { color: #FFB4AB; } }

/* ---------- spreadsheet view ---------- */
.view-toggle { display: inline-flex; padding: 3px; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; }
.view-toggle button { min-height: 28px; padding: 0 12px; cursor: pointer; font: 650 12.5px var(--sans); color: var(--ink2); background: transparent; border: 0; border-radius: 999px; white-space: nowrap; }
.view-toggle button.on { background: var(--ink); color: var(--paper); }
.sheet-wrap { margin-top: 10px; overflow: auto; max-height: 72vh; background: var(--panel-raised); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); -webkit-overflow-scrolling: touch; }
.gsheet { border-collapse: separate; border-spacing: 0; font: 500 13.5px var(--sans); color: var(--ink); white-space: nowrap; }
.gsheet th { position: sticky; top: 0; z-index: 2; padding: 9px 10px; text-align: left; font-size: 11.5px; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; color: var(--ink2); background: var(--panel); border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); }
.gsheet td { padding: 0; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); background: var(--panel-raised); }
.gsheet td.ro, .gsheet td.num { padding: 0 10px; color: var(--ink2); background: var(--panel); }
.gsheet th.ro { color: var(--ink3); }
.gsheet td.num, .gsheet th.num { text-align: right; color: var(--ink3); font-variant-numeric: tabular-nums; min-width: 34px; }
.gsheet td.n, .gsheet input.n { text-align: right; font-variant-numeric: tabular-nums; }
.gsheet td.c { text-align: center; padding: 0 10px; }
.gsheet .stick { position: sticky; left: 0; z-index: 1; box-shadow: 1px 0 0 var(--line); }
.gsheet th.stick { z-index: 3; }
.gsheet input.sh, .gsheet input.shp:not([type=checkbox]), .gsheet select.shp {
  display: block; min-height: 40px; padding: 0 10px; font: inherit; color: inherit; background: transparent; border: 0; border-radius: 0; outline: none; box-sizing: border-box;
}
.gsheet select.shp { width: 96px; }
.gsheet input[type=checkbox].shp { width: 20px; height: 20px; accent-color: #B4231B; vertical-align: middle; }
.gsheet td.e:focus-within { box-shadow: inset 0 0 0 2px var(--gold); }
.gsheet td.dirty { background: var(--gold-soft); }
.gsheet tr.gone td { text-decoration: line-through; opacity: .55; }
.gsheet tfoot td { position: sticky; bottom: 0; background: var(--panel); min-height: 38px; height: 38px; border-top: 1px solid var(--line); }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; font-size: 13px; color: var(--ink2); }
.list-head { row-gap: 8px; }
.list-tools { flex-wrap: wrap; justify-content: flex-end; row-gap: 8px; max-width: 100%; }
.sheet-wrap { max-width: 100%; }

/* ---------- six sub-tabs: two tidy rows of three, all visible ---------- */
.tabs.seg.many { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; border-radius: var(--radius-lg); }
.tabs.seg.many .tab { padding: 7px 4px; }

/* ---------- read-only sheets (attendance, trials) ---------- */
.gsheet.read td { padding: 9px 10px; }
.gsheet.read td.stick { font-weight: 650; background: var(--panel-raised); }
.gsheet.read td.e { padding: 0; }
.gsheet.read td.wrap { white-space: normal; min-width: 160px; max-width: 260px; }
.gsheet.read td.acts { padding: 5px 8px; }
.gsheet.read td.acts .btn { margin-right: 6px; vertical-align: middle; }
.gsheet select.trs { display: block; min-height: 40px; padding: 0 28px 0 10px; font: inherit; font-weight: 650; color: inherit; background: transparent; border: 0; outline: none; }
.gsheet.reg th.dcol { text-align: center; min-width: 64px; }
.gsheet.reg th.dcol.now { color: var(--gold-strong); }
.gsheet.reg td.hit { text-align: center; font-size: 12px; font-weight: 700; color: #1F6B45; background: #E6F4EC; }
.gsheet.reg td.miss { background: var(--panel-raised); }
@media (prefers-color-scheme: dark) { .gsheet.reg td.hit { color: #BFF0D1; background: #17382A; } }

/* ---------- trial visitors (coach) ---------- */
.sess.trials { margin-top: 14px; }
.trial-form { padding: 4px 16px 14px; }
.trial-form > .field:first-child { margin-top: 4px; }

/* ---------- settings: live location check ---------- */
.here { margin-top: 10px; padding: 10px 14px; font-size: 13.5px; line-height: 1.45; color: var(--ink); background: var(--gold-soft); border: 1px solid var(--gold); border-radius: var(--radius-md); }
.here.ok { background: #E6F4EC; border-color: #9CD3B4; }
.here span { color: var(--ink2); font-size: 13px; }
@media (prefers-color-scheme: dark) { .here.ok { background: #17382A; border-color: #2F6B4C; } }

/* On site: time + End shift */
.onsite-acts { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 6px; }
