/* ============================================================
   Studio Booking — aligned to the Reformer Ready platform design
   ============================================================ */
:root {
  /* Brand — RR logo palette */
  --rr-black:   #1a1a1a;
  --rr-dark:    #2c2c2c;
  --rr-mid:     #4a4a4a;
  --rr-muted:   #6b6b6b;
  --rr-subtle:  #9a9a9a;
  --rr-line:    #d4d4d4;
  --rr-grey:    #e8e8e8;
  --rr-offwhite:#f4f4f4;
  --rr-white:   #ffffff;

  /* Semantic */
  --bg:        var(--rr-offwhite);
  --surface:   var(--rr-white);
  --surface2:  #f7f7f7;
  --text:      var(--rr-black);
  --text-sub:  var(--rr-mid);
  --text-dim:  var(--rr-subtle);

  /* Accent — defaults to brand black; a studio's primaryColor overrides at runtime */
  --accent:      var(--rr-black);
  --accent-text: var(--rr-white);

  --line:  rgba(0,0,0,.08);
  --line2: rgba(0,0,0,.14);
  --mine-tint: rgba(26,26,26,.05); /* faint wash marking a specialist's own classes */

  --ok-bg:   #f0faf0; --ok-line:   #cfe6cf; --ok-text:   #2d6a2d;
  --warn-bg: #fdf7ed; --warn-line: #e7d3a6; --warn-text: #8a6200;
  --danger:  #dc2626; --danger-pale:#fef2f2;

  /* Shape */
  --radius-xl: 20px;
  --radius-lg: 14px;
  --radius-md: 9px;
  --radius-sm: 6px;
  --radius-pill: 999px;

  /* Elevation */
  --shadow-xs: 0 1px 2px rgba(0,0,0,.05);
  --shadow-sm: 0 2px 8px rgba(0,0,0,.07);
  --shadow-md: 0 4px 18px rgba(0,0,0,.09);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.11);

  /* Typography */
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-ui:      'Jost', system-ui, -apple-system, sans-serif;

  --ease: cubic-bezier(.16,1,.3,1);
  --t:    .17s var(--ease);
  --admin-max: 1024px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; min-height: 100%; }
body {
  font-family: var(--font-ui);
  font-size: 16px;
  color: var(--text);
  line-height: 1.5;
  background-color: var(--bg);
  background-image: url('background.svg');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-thumb { background: var(--rr-line); border-radius: 99px; }

.app { max-width: 760px; margin: 0 auto; padding: 0 16px 64px; }

/* Admin is a desktop tool: one shared container width so the header, nav tabs,
   schedule and setup panels all align to the same edges. */
.app.app-admin { max-width: var(--admin-max); padding-bottom: 48px; }
/* Section tabs stay compact + left-aligned within the full-width row. */
.app-admin .main-tabs .tab { flex: 0 0 auto; padding: 8px 18px; }
.app-admin header.top { position: static; top: auto; }

/* ─── Top bar ─── */
header.top {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 18px; margin: 10px 0 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  position: sticky; top: 12px; z-index: 5;
}
header.top .logo { height: 34px; width: auto; object-fit: contain; }
header.top .studio-name {
  font-family: var(--font-display);
  font-weight: 600; font-size: 25px; letter-spacing: .4px;
  flex: 1; min-width: 0; color: var(--rr-black);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ─── Buttons ─── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 38px; padding: 0 16px;
  border: 1px solid var(--rr-line); border-radius: var(--radius-md);
  background: var(--surface); color: var(--text-sub);
  font-family: var(--font-ui); font-size: 13px; font-weight: 500;
  letter-spacing: .02em; cursor: pointer; white-space: nowrap;
  box-shadow: var(--shadow-xs); transition: var(--t); text-decoration: none;
}
.btn:hover { border-color: var(--rr-subtle); background: var(--rr-grey); color: var(--text); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .42; cursor: not-allowed; transform: none; box-shadow: none; }
.btn:disabled:hover { filter: none; transform: none; }
.btn.primary {
  border-color: var(--accent); background: var(--accent); color: var(--accent-text);
  font-weight: 600; box-shadow: 0 2px 8px rgba(0,0,0,.18);
}
.btn.primary:hover { filter: brightness(1.08); background: var(--accent); color: var(--accent-text); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--rr-grey); }
.btn.danger { background: transparent; color: var(--danger); border-color: var(--rr-line); box-shadow: none; }
.btn.danger:hover { background: var(--danger-pale); border-color: #f0b4b4; color: var(--danger); }
.btn.sm { height: 32px; padding: 0 13px; font-size: 12.5px; }

/* ─── Tabs ─── */
.tabs { display: flex; gap: 8px; margin: 0 0 14px; }
.tabs-wrap { flex-wrap: wrap; }
.tabs-wrap .tab { flex: 1 1 auto; min-width: 88px; padding: 9px 8px; }
.tab {
  flex: 1; text-align: center; padding: 11px; cursor: pointer;
  font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--text-dim); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs); transition: var(--t);
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent-text); background: var(--accent); border-color: var(--accent); }

/* Two-level admin nav: prominent section tabs, lighter setup sub-tabs. */
.main-tabs { margin-bottom: 8px; gap: 6px; align-items: center; }
.main-tabs .tab { font-size: 12px; height: 34px; padding: 0 14px; display: inline-flex; align-items: center; letter-spacing: .06em; box-shadow: none; }
/* Booking action: pushed to the right end, same height as the tabs. */
.main-tabs .main-booking-action { margin-left: auto; height: 34px; padding: 0 14px; }
.sub-tabs { margin-bottom: 18px; }
.sub-tabs .tab {
  font-size: 12px; padding: 7px 10px; box-shadow: none;
  background: var(--surface2); color: var(--text-sub);
}
.sub-tabs .tab.active { color: var(--accent-text); background: var(--accent); border-color: var(--accent); }

/* ─── Language switch ─── */
.lang { display: flex; gap: 4px; }
.lang button {
  border: 1px solid var(--rr-line); background: var(--surface); border-radius: var(--radius-sm);
  padding: 5px 9px; font-family: var(--font-ui); font-size: 11px; font-weight: 600;
  letter-spacing: .06em; cursor: pointer; color: var(--text-dim); transition: var(--t);
}
.lang button.active { color: var(--accent-text); background: var(--accent); border-color: var(--accent); }

/* ─── Filter bar (categories + coaches) ─── */
.filters {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  padding: 12px 14px;
  margin-bottom: 18px;
  display: flex; flex-direction: column; gap: 10px;
}
.filter-row { display: flex; align-items: baseline; gap: 10px; }
.filter-label {
  flex-shrink: 0; width: 64px;
  font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-dim); padding-top: 6px;
}
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  border: 1px solid var(--rr-line); background: var(--surface);
  border-radius: var(--radius-pill); padding: 6px 13px;
  font-family: var(--font-ui); font-size: 12.5px; font-weight: 500;
  color: var(--text-sub); cursor: pointer; transition: var(--t); white-space: nowrap;
}
.chip:hover { border-color: var(--rr-subtle); color: var(--text); }
.chip.active {
  background: var(--accent); border-color: var(--accent); color: var(--accent-text);
  font-weight: 600;
}

/* ─── Booking wizard (service → specialist → times) ─── */
/* Step bar reuses the admin program-builder look (.steps / .step-dot). */
.step-dot.clickable { cursor: pointer; transition: var(--t); }
.step-dot.clickable:hover { border-color: var(--rr-subtle); color: var(--text); }

.wiz-summary { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.wiz-pick {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-xs);
  padding: 10px 14px; cursor: pointer; transition: var(--t); text-align: left;
}
.wiz-pick:hover { border-color: var(--rr-subtle); }
.wiz-pick-k {
  font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-dim); flex-shrink: 0;
}
.wiz-pick-v { font-weight: 600; color: var(--text); flex: 1; }
.wiz-pick-x {
  font-size: 12px; font-weight: 600; color: var(--accent);
  letter-spacing: .03em; flex-shrink: 0;
}

.wiz-card {
  background: var(--surface); border: 1px solid var(--line2);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  padding: 22px 20px;
}
.wiz-h {
  font-family: var(--font-display); font-weight: 600;
  font-size: 24px; letter-spacing: .2px; margin: 0 0 4px;
}
.wiz-sub { color: var(--text-sub); font-size: 14px; margin: 0 0 16px; }
.wiz-card .day-group { margin-bottom: 14px; }
.wiz-card .day-group:first-of-type { margin-top: 4px; }

.wiz-opts { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.wiz-opt {
  display: flex; align-items: center; width: 100%;
  background: var(--surface); border: 1px solid var(--rr-line);
  border-radius: var(--radius-lg); padding: 14px 16px;
  font-family: var(--font-ui); font-size: 15px; font-weight: 500;
  color: var(--text); cursor: pointer; transition: var(--t); text-align: left;
}
.wiz-opt:hover { border-color: var(--accent); background: var(--surface2); }
.wiz-opt.wiz-any { color: var(--text-sub); font-style: italic; }
.wiz-back { margin-top: 4px; }

/* Compact, multi-selectable time slots for step 3. */
.slot-day { margin-bottom: 14px; }
.slot-day-h {
  display: flex; align-items: baseline; gap: 8px; margin: 0 0 6px;
  font-family: var(--font-display); font-size: 17px; font-weight: 600;
  color: var(--text); text-transform: capitalize;
}
.slot-day-h span {
  font-family: var(--font-ui); font-size: 12px; font-weight: 500;
  letter-spacing: .03em; text-transform: none; color: var(--text-dim);
}
.slot {
  display: flex; align-items: center; gap: 12px; width: 100%;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-md); padding: 9px 12px; margin-bottom: 6px;
  font-family: var(--font-ui); cursor: pointer; text-align: left;
  transition: border-color var(--t), background var(--t), transform .08s ease;
}
.slot:hover { border-color: var(--rr-subtle); }
.slot:active { transform: scale(.985); }
.slot.busy { opacity: .55; pointer-events: none; }
.slot-check {
  position: relative; width: 18px; height: 18px; flex-shrink: 0;
  border-radius: 5px; border: 1.5px solid var(--rr-subtle); transition: var(--t);
}
.slot-time { font-weight: 600; font-size: 14px; color: var(--text); }
.slot-spots, .slot-state { margin-left: auto; font-size: 12px; font-weight: 600; letter-spacing: .02em; }
.slot-spots.ok   { color: var(--ok-text); }
.slot-spots.warn { color: var(--warn-text); }
.slot-spots.full { color: var(--danger); }
.slot.is-full .slot-time { color: var(--text-dim); }

/* Booked / waitlisted states — filled check + colored label. */
.slot.booked { border-color: var(--ok-line); background: var(--ok-bg); }
.slot.booked .slot-check { border-color: var(--ok-text); background: var(--ok-text); }
.slot.waitlisted { border-color: var(--warn-line, var(--rr-subtle)); background: var(--warn-bg, var(--surface2)); }
.slot.waitlisted .slot-check { border-color: var(--warn-text); background: var(--warn-text); }
.slot.booked .slot-check::after, .slot.waitlisted .slot-check::after {
  content: ""; position: absolute; left: 5px; top: 1px;
  width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0;
  transform: rotate(45deg); transform-origin: center;
}
.slot-state.booked { color: var(--ok-text); }
.slot-state.wait { color: var(--warn-text); }

/* Satisfying feedback when a slot is booked. */
.slot.pop { animation: slotpop .26s cubic-bezier(.34, 1.56, .64, 1); }
.slot.pop .slot-check::after { animation: checkdraw .26s ease .02s both; }
@keyframes slotpop { 0% { transform: scale(1); } 35% { transform: scale(1.035); } 100% { transform: scale(1); } }
@keyframes checkdraw {
  0%   { transform: rotate(45deg) scale(0); }
  60%  { transform: rotate(45deg) scale(1.25); }
  100% { transform: rotate(45deg) scale(1); }
}

/* ─── Day blocks (schedule-table style) ─── */
/* Each day is a panel: a solid header bar + dense, zebra-striped class rows. */
.day-group {
  background: var(--surface);
  border: 1px solid var(--line2);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 18px;
}

.day-head {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px;
  background: var(--accent);
  color: var(--accent-text);
}
.day-weekday {
  font-family: var(--font-display);
  font-size: 21px; font-weight: 600; letter-spacing: .3px;
  color: var(--accent-text); text-transform: capitalize; line-height: 1;
}
.day-date {
  font-size: 13px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
  color: var(--accent-text); opacity: .72;
}
.day-rel {
  margin-left: auto;
  font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-text);
  padding: 4px 10px; border-radius: var(--radius-pill);
}

/* ─── Class rows (table-like) ─── */
.class-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center; gap: 14px;
  padding: 11px 16px;
  border-top: 1px solid var(--line);
  transition: background var(--t);
}
.day-head + .class-row { border-top: 0; }
.class-row:nth-child(odd) { background: var(--surface2); }  /* zebra (day-head is child 1) */
.class-row:hover { background: var(--rr-grey); }

.class-row .time {
  font-family: var(--font-display);
  font-weight: 600; font-size: 17px; letter-spacing: .3px;
  color: var(--rr-black); white-space: nowrap; min-width: 92px;
}
.class-row .c-main { min-width: 0; }
.class-row .c-title { font-weight: 600; font-size: 15.5px; letter-spacing: .01em; }
.class-row .c-meta { font-size: 12.5px; color: var(--text-sub); margin-top: 2px; }
.class-row .c-meta .dot { margin: 0 6px; color: var(--text-dim); }

.class-row .c-right {
  display: flex; flex-direction: column; align-items: flex-end; gap: 6px;
}
.class-row .spots {
  margin: 0; white-space: nowrap; text-align: right;
  font-size: 12px; font-weight: 600; letter-spacing: .02em;
}

/* Standalone cards (used in My bookings — no day grouping there) */
.class-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-md); box-shadow: var(--shadow-xs);
  padding: 9px 13px; margin-bottom: 6px;
  display: flex; align-items: center; gap: 12px; transition: var(--t);
}
.class-card:hover { box-shadow: var(--shadow-sm); }
.class-card .time {
  font-family: var(--font-display); font-weight: 600; font-size: 17px;
  min-width: 48px; color: var(--rr-black); letter-spacing: .4px;
}
.class-card .info { flex: 1; min-width: 0; }
.class-card .title { font-weight: 600; font-size: 14.5px; letter-spacing: .01em; }
.class-card .meta { font-size: 12px; color: var(--text-sub); margin-top: 1px; }
.class-card .meta .dot { margin: 0 6px; color: var(--text-dim); }
.class-card .mine-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.spots { font-size: 12px; font-weight: 600; margin-top: 5px; letter-spacing: .02em; }
.spots.ok   { color: var(--ok-text); }
.spots.warn { color: var(--warn-text); }
.spots.full { color: var(--danger); }

.badge {
  display: inline-block; font-size: 11.5px; font-weight: 600; letter-spacing: .03em;
  padding: 4px 11px; border-radius: var(--radius-pill); border: 1px solid transparent;
}
.badge.booked     { background: var(--ok-bg);   color: var(--ok-text);   border-color: var(--ok-line); }
.badge.waitlisted { background: var(--warn-bg); color: var(--warn-text); border-color: var(--warn-line); }
.badge.neutral    { background: var(--surface2); color: var(--text-sub); border-color: var(--line); }

.empty { text-align: center; color: var(--text-dim); padding: 40px 0; font-size: 15px; }

/* ─── Admin roster ─── */
.rg-day {
  font-family: var(--font-display); font-size: 17px; font-weight: 600;
  color: var(--text); text-transform: capitalize; margin: 16px 0 6px;
}
.rg-day:first-child { margin-top: 4px; }
.rg-class {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-md); padding: 9px 13px; margin-bottom: 6px;
  cursor: pointer; transition: var(--t);
}
.rg-class:hover { border-color: var(--rr-subtle); }
.rg-class.open { border-color: var(--accent); border-bottom-left-radius: 0; border-bottom-right-radius: 0; margin-bottom: 0; }
.rg-time { font-family: var(--font-display); font-weight: 600; font-size: 16px; min-width: 46px; }
.rg-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rg-title { font-weight: 600; font-size: 14.5px; }
.rg-sub { font-size: 12px; color: var(--text-sub); }
.rg-count { font-size: 13px; font-weight: 600; color: var(--text-sub); white-space: nowrap; }
.rg-wl { color: var(--warn-text); font-weight: 600; }
.rg-caret { color: var(--text-dim); font-size: 11px; transition: transform var(--t); }
.rg-class.open .rg-caret { transform: rotate(180deg); }
.rg-roster {
  border: 1px solid var(--accent); border-top: 0;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  background: var(--surface2); margin-bottom: 6px; overflow: hidden;
}
.rg-entry {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 9px 13px; border-top: 1px solid var(--line);
}
.rg-entry:first-child { border-top: 0; }
.rg-person { display: flex; flex-direction: column; min-width: 0; }
.rg-name { font-weight: 600; font-size: 14px; }
.rg-phone { font-size: 12.5px; color: var(--accent); text-decoration: none; }
.rg-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.rg-att {
  border: 1px solid var(--rr-line); background: var(--surface);
  border-radius: var(--radius-pill); padding: 5px 11px;
  font-family: var(--font-ui); font-size: 12px; font-weight: 600;
  color: var(--text-sub); cursor: pointer; transition: var(--t);
}
.rg-att:hover { border-color: var(--rr-subtle); color: var(--text); }
.rg-att.att-yes.on {
  background: var(--ok-bg); border-color: var(--ok-text); color: var(--ok-text);
  box-shadow: inset 0 0 0 1px var(--ok-text);
}
.rg-att.att-no.on  {
  background: var(--danger-pale); border-color: var(--danger); color: var(--danger);
  box-shadow: inset 0 0 0 1px var(--danger);
}
.rg-empty { padding: 12px 13px; color: var(--text-dim); font-size: 13px; }

/* ─── Admin weekly calendar ─── */
/* Schedule sheet: one dominant white panel over the patterned background */
.sched {
  background: var(--surface); border: 1px solid var(--line2);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-md); padding: 12px;
}
/* Inside the sheet, inner panels are subtle dividers, not their own floating cards */
.sched .ag-day { box-shadow: none; border-color: var(--line); }
.sched .cal-tg { box-shadow: none; }

.cal-nav { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.cal-nav .btn { flex: 0 0 auto; }
.cal-datenav { display: inline-flex; gap: 6px; }
#calJump { margin-left: auto; }
.cal-range {
  flex: 1; text-align: center; text-transform: capitalize;
  font-family: var(--font-display); font-weight: 600; font-size: 17px;
}
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(116px, 1fr)); gap: 6px; overflow-x: auto; padding-bottom: 4px; align-items: start; }
.cal-col { background: var(--surface2); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 6px; min-width: 0; }
.cal-col.today { border-color: var(--accent); }
.cal-dayhead { display: flex; align-items: baseline; justify-content: space-between; padding: 2px 4px 7px; }
.cal-dow { font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--text-dim); }
.cal-dnum { font-family: var(--font-display); font-weight: 600; font-size: 16px; }
.cal-col.today .cal-dnum { color: var(--accent); }
.cal-cells { display: flex; flex-direction: column; gap: 4px; }
.cal-card {
  display: flex; flex-direction: column; gap: 1px; width: 100%; text-align: left;
  border: 1px solid var(--line); background: var(--surface);
  border-radius: var(--radius-md); padding: 6px 8px; cursor: pointer; transition: var(--t);
}
.cal-card:hover { border-color: var(--accent); }
.cal-time { font-weight: 700; font-size: 12px; color: var(--text); }
.cal-name { font-size: 12px; color: var(--text-sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-fill { font-size: 11px; font-weight: 600; color: var(--text-dim); }
.cal-card.lvl-full { background: var(--ok-bg); border-color: var(--ok-line); }
.cal-card.lvl-full .cal-fill { color: var(--ok-text); }
.cal-card.lvl-mid { border-color: var(--warn-line); }
.cal-card.lvl-mid .cal-fill { color: var(--warn-text); }
.cal-empty { color: var(--rr-subtle); text-align: center; font-size: 14px; padding: 6px 0; }
.cal-coach { font-size: 11px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-dayhead.coach { justify-content: center; padding-bottom: 8px; }
.coach-name {
  font-family: var(--font-display); font-weight: 600; font-size: 15px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* Day/Week segmented toggle */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-pill); overflow: hidden; flex: 0 0 auto; }
.seg-btn {
  border: 0; background: var(--surface); cursor: pointer;
  font-family: var(--font-ui); font-size: 12px; font-weight: 600; letter-spacing: .03em;
  color: var(--text-sub); padding: 7px 14px; transition: var(--t);
}
.seg-btn.on { background: var(--accent); color: var(--accent-text); }
/* Coach filter chips */
.cal-coaches { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 12px; }
/* Keyboard focus visibility for schedule controls/events */
.ag-event:focus-visible, .tg-card:focus-visible, .filt-trigger:focus-visible,
.chip:focus-visible, .seg-btn:focus-visible, .studio-item:focus-visible, .rg-att:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

/* Week view as a grouped agenda (day -> time -> events), with day summaries */
.agenda { display: flex; flex-direction: column; gap: 10px; }
.ag-day { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-xs); overflow: hidden; }
.ag-day.today { border-color: var(--rr-line); }
.ag-dayhead {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding: 7px 12px; background: var(--surface2); border-bottom: 1px solid var(--line);
}
.ag-day:not(:has(.ag-slot)) .ag-dayhead { border-bottom: 0; }
.ag-daytitle { font-family: var(--font-display); font-weight: 600; font-size: 16px; text-transform: capitalize; }
.ag-day.today .ag-daytitle { color: var(--accent); }
.ag-todaypill {
  font-family: var(--font-ui); font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: var(--accent-text); background: var(--accent); padding: 2px 7px; border-radius: var(--radius-pill); margin-left: 6px;
}
.ag-summary { font-size: 12px; font-weight: 600; color: var(--text-sub); letter-spacing: .01em; }
.ag-empty { padding: 0 12px 6px; color: var(--text-dim); font-size: 11.5px; line-height: 1.2; }
.ag-slot { display: flex; gap: 10px; padding: 8px 12px 4px; border-top: 1px solid var(--line); }
.ag-slot:first-child { border-top: 0; }
.ag-time { flex: 0 0 42px; font-family: var(--font-ui); font-weight: 600; font-size: 12.5px; color: var(--text-sub); padding-top: 5px; }
.ag-events { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ag-event {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; width: 100%;
  background: var(--surface); border: 0; border-left: 3px solid var(--rr-subtle);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 5px 9px; cursor: pointer; transition: background var(--t); text-align: left;
}
.ag-event:hover { background: var(--surface2); }
.ag-event:active { background: var(--rr-grey); }
@media (max-width: 640px) { .ag-event { min-height: 44px; } }
.ag-ev-main { display: flex; flex-direction: column; min-width: 0; }
.ag-ev-name { font-weight: 600; font-size: 13.5px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-coach { font-size: 11.5px; color: var(--text-sub); }

/* Fill badge — count is always text; full/waitlist add icon/text, not colour alone */
.fillbadge {
  flex-shrink: 0; margin-left: auto; font-family: var(--font-ui);
  font-size: 12px; font-weight: 700; letter-spacing: .01em; white-space: nowrap;
  color: var(--text-sub); display: inline-flex; align-items: center; gap: 4px;
}
.fillbadge.full { color: var(--ok-text); }
.fb-wl { font-size: 10.5px; font-weight: 700; color: var(--warn-text); }

/* Day view as a time grid (hour axis + classes placed by time, gaps for empty hours) */
.cal-tg {
  display: grid; overflow: auto; max-height: min(72vh, 760px);
  border: 1px solid var(--line2); border-radius: var(--radius-lg);
  background: var(--surface); box-shadow: var(--shadow-sm);
}
.tg-corner { border-bottom: 1px solid var(--line2); position: sticky; top: 0; left: 0; z-index: 3; background: var(--surface); box-shadow: 0 2px 5px -3px rgba(0,0,0,.18); }
.tg-colhead {
  border-bottom: 1px solid var(--line2); border-left: 1px solid var(--line);
  padding: 7px 6px; text-align: center; min-width: 0;
  position: sticky; top: 0; z-index: 2; background: var(--surface); box-shadow: 0 2px 5px -3px rgba(0,0,0,.18);
}
.tg-colhead .coach-name { font-family: var(--font-ui); font-weight: 600; font-size: 13px; }
.tg-colhead.today { background: var(--mine-tint); }
.tg-colhead.today .coach-name { color: var(--accent); }
.tg-gutter { position: sticky; left: 0; z-index: 1; background: var(--surface); box-shadow: 2px 0 5px -4px rgba(0,0,0,.22); }
.tg-hour {
  position: absolute; right: 6px; transform: translateY(-7px);
  font-size: 10.5px; font-weight: 600; color: var(--text-dim); letter-spacing: .02em;
}
.tg-col { position: relative; border-left: 1px solid var(--line); min-width: 0; }
.tg-now { position: absolute; left: 0; right: 0; height: 1px; background: rgba(220,38,38,.28); z-index: 0; pointer-events: none; }
.tg-nowlabel {
  position: absolute; left: 2px; transform: translateY(-50%); z-index: 2;
  font-size: 9.5px; font-weight: 700; color: var(--danger); background: var(--surface);
  border: 1px solid rgba(220,38,38,.25);
  padding: 1px 4px; border-radius: 3px; letter-spacing: .02em;
}
.tg-card {
  position: absolute; overflow: hidden; z-index: 1;
  display: flex; flex-direction: column; gap: 2px;
  border: 1px solid var(--line2); border-left: 3px solid var(--rr-subtle); border-radius: var(--radius-sm);
  background: var(--surface); padding: 4px 7px; cursor: pointer; text-align: left;
  transition: border-color var(--t), box-shadow var(--t);
}
.tg-card:hover { box-shadow: var(--shadow-sm); z-index: 3; }
.tg-card.overlap { box-shadow: inset 2px 0 0 var(--warn-text); }
.tg-warn { color: var(--warn-text); font-size: 11px; margin-right: 3px; }
.tg-line { display: flex; align-items: center; gap: 6px; min-width: 0; }
.tg-ev-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-width: 0; }
.tg-ev-time { font-weight: 700; font-size: 11px; color: var(--text); flex-shrink: 0; }
.tg-ev-name { display: block; font-size: 12px; font-weight: 600; color: var(--text); line-height: 1.18; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tg-card.tall .tg-ev-name { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tg-card.tiny { gap: 0; padding-top: 3px; padding-bottom: 3px; }
.tg-card.tiny .tg-ev-name { font-size: 11px; }
.tg-card.tiny .fillbadge { font-size: 10.5px; }
.tg-line .tg-ev-name { flex: 1; }
.tg-line .fillbadge { font-size: 11px; }
.tg-coach { font-size: 10.5px; color: var(--text-sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Own classes: subtle tint + their category stripe (no heavy border). */
.tg-card.mine, .ag-event.mine { background: var(--mine-tint); }
/* Colleagues' classes: readable and only slightly quieter; category stripe kept. */
.tg-card.notmine, .ag-event.notmine { opacity: .88; }
.tg-card.notmine:hover, .ag-event.notmine:hover { opacity: 1; }
/* The one strong black border means keyboard-focused or opened/selected — nothing else. */
.tg-card.selected, .ag-event.selected, .cal-card.selected,
.tg-card:focus-visible, .ag-event:focus-visible, .cal-card:focus-visible {
  border-color: var(--rr-black); box-shadow: inset 0 0 0 1px var(--rr-black); z-index: 4;
  outline-color: var(--rr-black);
}
.cal-mine-seg { display: inline-flex; margin-bottom: 8px; }
/* Service form: per-resource units inputs */
.res-uses { display: flex; flex-direction: column; gap: 6px; }
.res-use { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.res-use span { font-size: 13px; color: var(--text-sub); }
.res-use .res-cap { color: var(--text-dim); font-size: 11px; }
.res-use input { width: 72px; flex: 0 0 auto; }
.ri-sub { font-size: 12px; color: var(--text-dim); }
/* Blocked time: hatched, muted, non-booking card */
.tg-card.tg-block, .ag-event.ag-block {
  background: repeating-linear-gradient(45deg, var(--surface2) 0 6px, var(--rr-grey) 6px 12px);
  border-left: 3px solid var(--rr-subtle); color: var(--text-sub);
}
.tg-card.tg-block .tg-ev-name, .ag-event.ag-block .ag-ev-name { font-style: italic; }
.cal-block-btn { margin-left: 8px; }
/* Drag-and-drop reassignment */
.tg-card[draggable="true"] { cursor: grab; }
.tg-card.dragging { opacity: .45; }
.tg-col.drop-ok { background: var(--mine-tint); outline: 2px dashed var(--accent); outline-offset: -2px; }
.cal-scope { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; }
.cal-scope-hint { margin-bottom: 8px; font-size: 12px; color: var(--text-dim); }
/* Right-aligned booking count. */
.ag-ev-right { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; flex-shrink: 0; }
.tg-ev-right { display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0; }
/* "Моите" agenda is a compact list — don't stretch it across the desktop grid. */
.mine-scope { max-width: 600px; }
.rm-readonly { flex: 1; align-self: center; font-size: 12.5px; color: var(--text-dim); font-style: italic; }
.badge.att-done { background: var(--ok-bg, #eef6ee); color: var(--ok-text, #2f6b34); border-color: var(--ok-line, #cfe3cf); }
.badge.att-miss { background: var(--surface2); color: var(--text-dim); }

/* Compact filter bar: dropdown triggers + active-chip summary */
.cal-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 6px; }
.filt-trigger {
  border: 1px solid var(--rr-line); background: var(--surface); cursor: pointer;
  border-radius: var(--radius-pill); padding: 7px 13px;
  font-family: var(--font-ui); font-size: 12.5px; font-weight: 600; color: var(--text-sub);
  transition: var(--t); white-space: nowrap;
}
.filt-trigger:hover { border-color: var(--rr-subtle); color: var(--text); }
.filt-trigger.set { border-color: var(--accent); color: var(--accent); }
.filt-trigger.open { background: var(--surface2); }
.cal-groupby { display: inline-flex; align-items: center; gap: 7px; margin-left: auto;
  font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--text-dim); }
.seg.sm .seg-btn { padding: 5px 10px; font-size: 11px; }
.chip-panel { margin-bottom: 8px; }
.chip-panel .chip, .cal-active .chip { padding: 4px 10px; font-size: 12px; }
.cal-active { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.cal-active .chip.active { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.clearchip { color: var(--text-sub); }

/* ─── Studio setup list ─── */
.studio-menu { display: flex; flex-direction: column; gap: 8px; }
.studio-item {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%;
  min-height: 74px;
  text-align: left; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-xs);
  padding: 14px 18px; cursor: pointer; transition: var(--t);
}
.studio-item:hover { border-color: var(--accent); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.si-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.si-label { font-weight: 600; font-size: 16px; }
.si-desc { font-size: 13px; color: var(--text-sub); margin-top: 2px; }
.si-status {
  margin-left: auto; flex-shrink: 0;
  font-size: 12px; font-weight: 700; color: var(--text-sub);
  background: var(--surface2); border: 1px solid var(--line);
  border-radius: var(--radius-pill); padding: 4px 10px;
}
.si-caret { color: var(--text-dim); font-size: 22px; flex-shrink: 0; }
.studio-back { margin-bottom: 12px; }

/* ─── Modal ─── */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(26,26,26,.42);
  display: flex; align-items: flex-end; justify-content: center; z-index: 20;
  backdrop-filter: blur(2px);
}
.modal {
  background: var(--surface); width: 100%; max-width: 760px;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 22px 20px calc(22px + env(safe-area-inset-bottom));
  box-shadow: var(--shadow-lg); animation: slideup .22s var(--ease);
}
@keyframes slideup { from { transform: translateY(40px); opacity: .5; } to { transform: none; opacity: 1; } }
.modal h3 { font-family: var(--font-display); font-weight: 600; font-size: 26px; margin: 0 0 14px; letter-spacing: .3px; }
.modal label { display: block; font-size: 12px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; color: var(--text-dim); margin: 12px 0 5px; }
.modal input, .modal select {
  width: 100%; padding: 12px 13px; font-family: var(--font-ui); font-size: 16px;
  border: 1px solid var(--rr-line); border-radius: var(--radius-md); background: var(--surface2);
  transition: var(--t);
}
.modal input:focus, .modal select:focus { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px rgba(0,0,0,.05); }
.modal .actions { display: flex; gap: 10px; margin-top: 18px; }
.modal .actions .btn { flex: 1; height: 42px; }
.quick-booking-modal {
  display: flex; flex-direction: column; max-height: min(90vh, 780px); padding: 0;
}
.quick-booking-modal > h3 { flex: 0 0 auto; margin: 0; padding: 20px 20px 12px; }
.qb-modal-body { min-height: 0; overflow-y: auto; padding: 0 20px 8px; }
.quick-booking-modal .qb-actions {
  position: sticky; bottom: 0; z-index: 2; flex: 0 0 auto;
  margin: 0; padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); background: var(--surface);
}
.quick-booking-modal .btn.primary {
  border-color: var(--rr-black); background: var(--rr-black); color: var(--rr-white);
}
.quick-booking-modal .btn.primary:hover { background: var(--rr-black); color: var(--rr-white); }
.quick-booking-modal .btn.primary:disabled,
.quick-booking-modal .btn.primary:disabled:hover {
  border-color: var(--rr-line); background: var(--rr-grey); color: var(--rr-subtle);
}
.qb-client-type { margin-top: 16px; }
.qb-client-type .seg-btn { flex: 1; }
.qb-capacity {
  margin-top: 7px; padding: 7px 10px; border-radius: var(--radius-sm);
  background: var(--surface2); color: var(--text-sub); font-size: 12.5px; font-weight: 600;
}
.qb-capacity.full { background: var(--warn-bg); color: var(--warn-text); border: 1px solid var(--warn-line); }
.qb-name-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.qb-client-results {
  max-height: 230px; overflow-y: auto; margin-top: 6px;
  border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface);
}
.qb-client-option {
  display: flex; flex-direction: column; gap: 2px; width: 100%; padding: 10px 12px;
  border: 0; border-top: 1px solid var(--line); background: transparent; text-align: left; cursor: pointer;
  font: inherit; color: var(--text);
}
.qb-client-option:first-child { border-top: 0; }
.qb-client-option:hover { background: var(--surface2); }
.qb-client-option span, .qb-client-selected span { font-size: 12px; color: var(--text-sub); }
.qb-search-note { padding: 12px; font-size: 12.5px; color: var(--text-dim); }
.qb-empty-result { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; font-size: 12.5px; color: var(--text-dim); }
.qb-empty-copy { display: flex; flex-direction: column; gap: 2px; }
.qb-empty-copy strong { color: var(--text-sub); }
.qb-client-selected {
  display: flex; align-items: center; gap: 9px; padding: 10px 12px;
  background: var(--mine-tint); border: 1px solid var(--rr-black); border-radius: var(--radius-sm);
}
.qb-selected-check {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 22px; height: 22px;
  border-radius: 50%; background: var(--rr-black); color: var(--rr-white) !important; font-size: 13px !important; font-weight: 700;
}
.qb-selected-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
@media (max-width: 520px) { .qb-name-grid { grid-template-columns: 1fr; gap: 0; } }
@media (max-width: 639px) {
  .quick-booking-modal { width: 100%; max-height: 94dvh; border-radius: var(--radius-xl) var(--radius-xl) 0 0; }
  .quick-booking-modal .qb-actions .btn { min-height: 48px; font-size: 14px; }
  .quick-booking-modal input, .quick-booking-modal select { min-height: 48px; }
  .qb-client-type .seg-btn { min-height: 44px; }
  .qb-empty-result { align-items: stretch; flex-direction: column; }
  .qb-empty-result .btn { min-height: 44px; }
}
.note { font-size: 13.5px; color: var(--text-sub); margin-top: 12px; }
.note a { color: var(--accent); font-weight: 600; }
.modal-sub { font-size: 14px; color: var(--text-sub); margin: 0 0 14px; }
.code-input {
  width: 100%; text-align: center;
  font-family: var(--font-ui); font-size: 30px; font-weight: 600;
  letter-spacing: .42em; padding: 12px 0 12px .42em;
}
.code-input::placeholder { letter-spacing: .3em; color: var(--rr-subtle); }
.dev-code { color: var(--accent); font-weight: 700; letter-spacing: .04em; }

/* ─── Roster modal ─── */
.roster-modal { display: flex; flex-direction: column; max-height: 86vh; max-width: 860px; padding: 0; }
.roster-modal .rm-head { padding: 18px 20px 12px; border-bottom: 1px solid var(--line); }
.roster-modal h3 { margin: 0 0 4px; font-size: 22px; }
.rm-meta { font-family: var(--font-ui); font-size: 13px; color: var(--text-sub); }
.rm-counts { font-family: var(--font-ui); font-size: 12.5px; font-weight: 700; color: var(--text); margin-top: 5px; }
.rm-body { overflow-y: auto; padding: 4px 20px; flex: 1; min-height: 60px; }
.rm-body .rg-entry { padding: 8px 0; border-top: 1px solid var(--line); }
.rm-body .rg-entry:first-child { border-top: 0; }
.rm-foot {
  display: flex; gap: 8px; padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); background: var(--surface);
}
.rm-foot .btn { flex: 1; }
.rg-icon {
  display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px;
  border-radius: var(--radius-sm); color: var(--text-dim); text-decoration: none; cursor: pointer;
  border: 1px solid transparent; font-size: 13px;
}
.rg-icon:hover { background: var(--surface2); color: var(--text); }
.rg-cancel:hover { color: var(--danger); }

/* ─── Toast ─── */
/* Translucent, frosted notification that softly fades out toward its edges. */
.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: rgba(26, 26, 26, 0.6); color: var(--rr-white);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  padding: 14px 48px; border-radius: var(--radius-md);
  font-size: 14px; font-weight: 500; letter-spacing: .01em; text-align: center;
  min-width: 300px; max-width: calc(100vw - 32px);
  z-index: 30;
  /* Fade the whole bar (background + text) out at the edges for a soft, airy look. */
  -webkit-mask-image: radial-gradient(115% 165% at 50% 50%, #000 28%, transparent 92%);
  mask-image: radial-gradient(115% 165% at 50% 50%, #000 28%, transparent 92%);
  animation: toast-in .22s ease;
}
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* Phone field with a fixed +359 country prefix. */
.phone-input { display: flex; align-items: stretch; }
.phone-input .phone-cc {
  display: inline-flex; align-items: center; padding: 0 11px; font-family: var(--font-ui);
  font-size: 15px; font-weight: 600; color: var(--text-sub);
  background: var(--surface2); border: 1px solid var(--rr-line); border-right: 0;
  border-radius: var(--radius-md) 0 0 var(--radius-md);
}
.phone-input input { border-radius: 0 var(--radius-md) var(--radius-md) 0; }
.lbl-opt { font-weight: 400; color: var(--text-dim); font-size: 12px; }

/* Login status next to a specialist's name. */
.login-pill {
  font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: var(--radius-pill);
  border: 1px solid var(--rr-line); white-space: nowrap;
}
.login-pill.on { color: var(--ok-text); background: var(--ok-bg); border-color: var(--ok-line); }
.login-pill.off, .login-pill.none { color: var(--text-dim); background: var(--surface2); }

@media (min-width: 640px) {
  .modal { border-radius: var(--radius-xl); margin-bottom: 40px; align-self: center; }
  .modal-backdrop { align-items: center; }
}

/* ─── Admin console ─── */
.admin-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  padding: 18px 20px; margin-bottom: 16px;
}
.admin-card h2 {
  font-family: var(--font-display); font-weight: 600; font-size: 24px;
  margin: 0 0 4px; letter-spacing: .3px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.card-head h2 { margin: 0; }

/* Program editor weekday tabs */
.day-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 14px; }
.day-tab {
  border: 1px solid var(--rr-line); background: var(--surface); border-radius: var(--radius-pill);
  padding: 6px 13px; font-family: var(--font-ui); font-size: 12.5px; font-weight: 600;
  color: var(--text-sub); cursor: pointer; transition: var(--t); min-width: 44px;
}
.day-tab:hover { border-color: var(--rr-subtle); color: var(--text); }
.day-tab.active { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }

/* Destructive delete stays quiet: faded until row hover on pointer devices. */
@media (hover: hover) {
  .st-item .icon-btn.danger, .row-item .icon-btn.danger { opacity: .3; transition: opacity var(--t); }
  .st-item:hover .icon-btn.danger, .row-item:hover .icon-btn.danger { opacity: 1; }
}
/* Compact summary under the Program day tabs. */
.day-summary { font-size: 12.5px; font-weight: 600; color: var(--text-sub); margin: 0 0 10px; text-transform: capitalize; }
/* Program day rows: time · service+specialist · overflow menu */
.sched-row { display: flex; align-items: center; gap: 12px; padding-left: 14px; }
.sched-row .ri-time { font-weight: 600; font-size: 13px; min-width: 46px; color: var(--text); flex-shrink: 0; }
.sched-row .ri-line { flex: 1; min-width: 0; display: flex; flex-direction: column; white-space: normal; overflow: visible; }
.sched-row .ri-svc { font-weight: 600; font-size: 14px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sched-row .ri-sub { color: var(--text-sub); font-size: 12.5px; }
.row-menu { position: relative; flex-shrink: 0; }
.row-pop {
  position: absolute; right: 0; top: 100%; z-index: 10; min-width: 150px;
  background: var(--surface); border: 1px solid var(--line2); border-radius: var(--radius-md);
  box-shadow: var(--shadow-md); display: flex; flex-direction: column; overflow: hidden;
}
.row-pop button {
  text-align: left; padding: 9px 14px; background: none; border: 0;
  font-family: var(--font-ui); font-size: 13px; color: var(--text); cursor: pointer;
}
.row-pop button:hover { background: var(--surface2); }
.row-pop button.danger { color: var(--danger); }
/* Status line at the top of setup detail pages. */
.setup-status { font-size: 13px; font-weight: 600; color: var(--text-sub); margin: 0 0 14px; }
.admin-card .hint { color: var(--text-sub); font-size: 14px; margin: 0 0 16px; }

.field { margin-bottom: 12px; }
.field label {
  display: block; font-size: 11px; font-weight: 600; letter-spacing: .05em;
  text-transform: uppercase; color: var(--text-dim); margin-bottom: 5px;
}
.field label.check-line {
  display: flex; align-items: center; gap: 7px; margin: 8px 0 0;
  font-size: 13px; color: var(--text-sub); text-transform: none; letter-spacing: 0; font-weight: 400;
  cursor: pointer;
}
/* Keep the checkbox its natural size — beats the later `.field input { width:100% }`. */
.field label.check-line input[type="checkbox"] { width: 16px; height: 16px; flex: 0 0 auto; margin: 0; }
/* Numeric input + "no limit" toggle on one row. */
.limit-row { display: flex; align-items: center; gap: 12px; }
.field .limit-row input[type="number"] { flex: 1; width: auto; }
.limit-row .check-line { margin: 0; white-space: nowrap; flex-shrink: 0; }
.field input:disabled { opacity: .5; }
/* Hex text field paired with a native colour swatch. */
.color-row { display: flex; align-items: center; gap: 12px; }
.color-row #setColor { flex: 1; }
.color-row input[type="color"] {
  width: 46px; height: 44px; flex: 0 0 auto; padding: 3px;
  border: 1px solid var(--rr-line); border-radius: var(--radius-md);
  background: var(--surface2); cursor: pointer;
}
.color-row input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.color-row input[type="color"]::-webkit-color-swatch { border: none; border-radius: 4px; }
.field input, .field select {
  width: 100%; padding: 11px 12px; font-family: var(--font-ui); font-size: 15px;
  border: 1px solid var(--rr-line); border-radius: var(--radius-md); background: var(--surface2);
}
/* Custom select look: own chevron, closer to the text, no native arrow */
.field select, select.edit-inp {
  appearance: none; -webkit-appearance: none; cursor: pointer;
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b6b6b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 16px;
}
.field input:focus, .field select:focus {
  outline: none; border-color: var(--accent); background: var(--surface);
}
.field-hint { font-size: 12px; color: var(--text-dim); margin-top: 5px; }

/* Illustrative Category→Service hierarchy, styled like a screenshot of the live schedule
   (black header bars + row dividers) but faded at the edges so it reads as an example. */
.example-hier { margin: 2px 0 20px; }
.example-hier .ex-note { font-size: 13px; color: var(--text-sub); margin-bottom: 12px; }
.example-hier .ex-cols {
  display: flex; gap: 14px; flex-wrap: wrap; padding: 4px 2px 16px;
  opacity: .82;
  -webkit-mask-image: radial-gradient(135% 140% at 50% 40%, #000 52%, transparent 92%);
          mask-image: radial-gradient(135% 140% at 50% 40%, #000 52%, transparent 92%);
}
.example-hier .ex-col {
  flex: 1; min-width: 150px;
  background: var(--surface); border: 1px solid var(--line2);
  border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-sm);
}
.example-hier .ex-cat {
  background: var(--rr-black); color: var(--rr-white);
  font-family: var(--font-display); font-weight: 600; font-size: 16px;
  letter-spacing: .3px; padding: 8px 12px;
}
.example-hier .ex-item {
  font-size: 13px; color: var(--text-sub);
  padding: 7px 12px; border-top: 1px solid var(--line);
}
.example-hier .ex-item:nth-of-type(odd) { background: var(--surface2); }
.example-hier .ex-dots { color: var(--text-dim); letter-spacing: 3px; }
.input-icon { position: relative; }
.input-icon > svg {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 21px; height: 21px; color: var(--text); pointer-events: none;
}
.input-icon > input { padding-left: 44px; }
.form-grid { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: 10px; align-items: end; }
.form-grid .field { margin-bottom: 0; }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr 1fr; } }

@media (max-width: 640px) {
  .app { padding-left: 12px; padding-right: 12px; }
  header.top { top: 8px; margin-top: 8px; }
  .sched { padding: 10px; }
  .cal-nav { align-items: stretch; }
  .cal-range { flex-basis: 100%; order: 3; text-align: left; font-size: 16px; }
  #calJump { margin-left: 0; }
  .filt-trigger { flex: 1 1 140px; }
  .cal-tg { max-height: 70vh; }
}

.sep { border: none; border-top: 1px solid var(--line2); margin: 16px 0; }

/* Three visually separated zones inside a card: tip → entries → add form */
.zone { padding: 16px 0; }
.zone-tip { padding-top: 4px; }
.zone-form { padding-bottom: 2px; }

/* Compact one-line list entry */
.row-item.compact { padding: 9px 0; }
.row-item .ri-line { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ri-sub { color: var(--text-sub); font-size: 14px; }

.icon-btn {
  width: 34px; height: 34px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--rr-line); background: var(--surface);
  border-radius: var(--radius-sm); cursor: pointer; transition: var(--t);
}
.icon-btn svg { width: 16px; height: 16px; color: var(--text-sub); }
.icon-btn:hover { background: var(--rr-grey); }
.icon-btn:hover svg { color: var(--text); }
.icon-btn.danger:hover { background: var(--danger-pale); border-color: #f0b4b4; }
.icon-btn.danger:hover svg { color: var(--danger); }

/* Staff table: real entries (solid) + faded dreamlike example rows in one block */
.staff-table {
  background: var(--surface); border: 1px solid var(--line2);
  border-radius: var(--radius-md); overflow: hidden; margin: 14px 0 6px;
}
.staff-table .st-head {
  background: var(--rr-black); color: var(--rr-white);
  font-family: var(--font-display); font-weight: 600; font-size: 16px;
  letter-spacing: .3px; padding: 8px 12px;
}
.st-row {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; border-top: 1px solid var(--line);
}
.st-row .ri-line { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Real (non-ghost) entries: soft, refined — they already stand out by being full-opacity */
.st-row .ri-title { font-weight: 500; color: var(--rr-dark); }

/* Dreamlike example rows: faded, soft-blurred, italic, gently breathing, fading downward */
.st-ghost {
  font-style: italic; color: var(--text-sub);
  filter: blur(.3px);
  -webkit-mask-image: linear-gradient(#000, #000 68%, transparent 100%);
          mask-image: linear-gradient(#000, #000 68%, transparent 100%);
  animation: dream 4.5s ease-in-out infinite;
  pointer-events: none; user-select: none;
}
@keyframes dream { 0%, 100% { opacity: .42; } 50% { opacity: .58; } }
.st-cap {
  font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-dim); background: var(--surface2); padding-top: 7px; padding-bottom: 7px;
}
.link-btn {
  background: none; border: none; cursor: pointer; padding: 0;
  font-family: var(--font-ui); font-size: 11px; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase; color: var(--text-dim);
}
.link-btn:hover { color: var(--text); text-decoration: underline; }
/* Examples collapse toggle — word + chevron */
.toggle-ex { color: var(--accent); font-size: 12px; display: inline-flex; align-items: center; gap: 4px; }
.toggle-ex .tw { text-decoration: underline; }
.toggle-ex svg { width: 15px; height: 15px; transition: transform .15s var(--ease); }
/* Expanded → chevron points up (collapse); collapsed → points down (expand) */
.staff-table:not(.examples-collapsed) .toggle-ex svg { transform: rotate(180deg); }
.examples-collapsed .st-ghost { display: none; }
.ex-dots { color: var(--text-dim); letter-spacing: 3px; }
@media (prefers-reduced-motion: reduce) { .st-ghost { animation: none; } }
.st-ghost .ex-dots { color: var(--text-dim); letter-spacing: 3px; }

/* Grouped display: category/specialty sub-header + indented entries */
.st-cat {
  font-style: normal; font-weight: 700; color: var(--rr-black);
  font-size: 12px; letter-spacing: .05em; text-transform: uppercase;
  background: var(--surface2); padding-top: 7px; padding-bottom: 7px;
}
.st-item { padding-left: 26px; }
.st-empty { color: var(--text-sub); font-size: 14px; }
.tag {
  display: inline-block; font-size: 11px; font-weight: 600; letter-spacing: .02em;
  padding: 2px 8px; margin-right: 5px; border-radius: var(--radius-pill);
  background: var(--surface2); border: 1px solid var(--line); color: var(--text-sub);
}
.st-ghost .st-cat { background: transparent; }
.btn.outline { background: var(--surface); color: var(--text-sub); border-color: var(--rr-line); box-shadow: none; }
.btn.outline:hover { background: var(--rr-grey); color: var(--text); }
.edit-inp {
  flex: 1; min-width: 120px; padding: 9px 11px; font-family: var(--font-ui); font-size: 14px;
  border: 1px solid var(--rr-line); border-radius: var(--radius-sm); background: var(--surface2);
}
.edit-inp:focus { outline: none; border-color: var(--accent); background: var(--surface); }

.row-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0; border-top: 1px solid var(--line);
}
.row-item:first-child { border-top: 0; }
.row-item .ri-main { flex: 1; min-width: 0; }
.row-item .ri-title { font-weight: 600; }
.row-item .ri-meta { font-size: 13px; color: var(--text-sub); margin-top: 2px; }
.row-item.inactive { opacity: .45; }

.pill-tag {
  display: inline-block; font-size: 11px; font-weight: 600; padding: 3px 9px;
  border-radius: var(--radius-pill); background: var(--surface2);
  border: 1px solid var(--line); color: var(--text-sub);
}
.steps { display: flex; gap: 8px; margin-bottom: 18px; }
.step-dot {
  flex: 1; text-align: center; font-size: 12px; font-weight: 600; padding: 8px;
  border-radius: var(--radius-md); background: var(--surface2);
  border: 1px solid var(--line); color: var(--text-dim);
}
.step-dot.active { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.step-dot.done { color: var(--ok-text); border-color: var(--ok-line); background: var(--ok-bg); }

/* Password login: register/login toggle link */
.login-switch { margin-top: 10px; text-align: center; }
.linkbtn { background: none; border: 0; color: var(--accent); cursor: pointer; font: inherit; text-decoration: underline; padding: 4px; }
