/* main stylesheet, part 6 of 6: staff app shell, dashboards, lists (clients and admin lists), phone tab bars.
   Loaded in this order by templates/base.html; the parts are one cascade, order matters. */
/* ══════════════════════════════════════════════════════════════════
   Staff app shell (templates/staff_base.html) — panel + counselor portal.
   A work tool: grouped sidebar, slim sticky top bar with client search,
   bottom tab bar on phones. No marketing header, banner or footer.
   ══════════════════════════════════════════════════════════════════ */
.staff-body {
  --staff-sidebar-w: 248px;
  --staff-topbar-h: 64px;
  --staff-line: rgba(30, 40, 38, 0.09);
  --staff-line-strong: rgba(30, 40, 38, 0.16);
  --staff-surface: #fff;
  --staff-ground: #f4f2ee;
  --staff-teal-soft: rgba(37, 145, 147, 0.1);
  --staff-pink-soft: rgba(222, 63, 130, 0.1);
  --staff-shadow: 0 1px 2px rgba(25, 40, 38, 0.05), 0 4px 14px rgba(25, 40, 38, 0.04);
  background: var(--staff-ground);
  line-height: 1.75;
}
.staff-body svg { flex-shrink: 0; }
.staff-app { min-height: 100vh; }

/* Sidebar */
.staff-sidebar {
  position: fixed;
  inset-block: 0;
  inset-inline-start: 0;
  z-index: 40;
  width: var(--staff-sidebar-w);
  display: flex;
  flex-direction: column;
  background: var(--staff-surface);
  border-inline-end: 1px solid var(--staff-line);
}
.staff-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  height: var(--staff-topbar-h);
  padding: 0 1rem;
  border-bottom: 1px solid var(--staff-line);
}
.staff-brand { display: flex; align-items: center; gap: 0.6rem; min-width: 0; }
.staff-brand-logo { width: 34px; height: 34px; object-fit: contain; }
.staff-brand-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.staff-brand-text strong { font-size: 0.98rem; color: var(--accent-strong); font-weight: 700; }
.staff-brand-text small { font-size: var(--fs-74); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.staff-icon-btn.staff-sheet-close { display: none; }

.staff-nav { flex: 1; overflow-y: auto; padding: 0.75rem 0.65rem; display: flex; flex-direction: column; gap: 0.9rem; }
.staff-nav-group { display: flex; flex-direction: column; gap: 2px; }
.staff-nav-title {
  margin: 0 0 0.2rem;
  padding: 0 0.7rem;
  font-size: var(--fs-72);
  font-weight: 600;
  color: rgba(30, 30, 30, 0.45);
}
.staff-nav-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 38px;
  padding: 0.35rem 0.7rem;
  border-radius: var(--radius-sm2);
  color: rgba(30, 30, 30, 0.78);
  font-size: var(--fs-92);
  font-weight: 500;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.staff-nav-link svg,
.staff-tab svg,
.staff-foot-link svg,
.staff-icon-btn svg,
.staff-search-icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.staff-nav-link:hover { background: rgba(30, 40, 38, 0.045); color: var(--text); }
.staff-nav-link.is-active { background: var(--staff-teal-soft); color: var(--accent-strong); font-weight: 600; }
.staff-nav-link:focus-visible,
.staff-tab:focus-visible,
.staff-icon-btn:focus-visible,
.staff-foot-link:focus-visible,
.staff-search-option:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 2px; }

.staff-sidebar-foot { border-top: 1px solid var(--staff-line); padding: 0.75rem 0.65rem 0.9rem; display: flex; flex-direction: column; gap: 0.5rem; }
.staff-user { display: flex; align-items: center; gap: 0.6rem; padding: 0 0.35rem; }
.staff-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: inline-grid; place-items: center;
  background: var(--staff-pink-soft); color: var(--accent);
  font-weight: 700; font-size: var(--fs-95);
}
.staff-user-text { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.staff-user-text strong { font-size: var(--fs-86); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.staff-user-text small { font-size: var(--fs-74); color: var(--muted); }
.staff-foot-actions { display: flex; gap: 0.35rem; }
.staff-foot-actions form { display: contents; }
.staff-foot-link {
  flex: 1;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.35rem;
  min-height: 34px; padding: 0 0.5rem;
  border-radius: 0.55rem;
  border: 1px solid var(--staff-line);
  font-size: var(--fs-80); color: rgba(30, 30, 30, 0.72);
  background: transparent;
  white-space: nowrap;
}
.staff-foot-link svg { width: 16px; height: 16px; }
.staff-foot-link:hover { background: rgba(30, 40, 38, 0.04); color: var(--text); }
.staff-foot-link.is-danger:hover { color: var(--danger); border-color: rgba(180, 40, 40, 0.25); background: rgba(180, 40, 40, 0.05); }

/* Main column + top bar */
.staff-main-col { margin-inline-start: var(--staff-sidebar-w); min-width: 0; overflow-x: clip; }
.staff-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 1rem;
  height: var(--staff-topbar-h);
  padding: 0 1.5rem;
  background: rgba(244, 242, 238, 0.88);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--staff-line);
}
.staff-heading { min-width: 0; flex: 0 1 auto; display: flex; flex-direction: column; justify-content: center; }
.staff-title {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.staff-crumbs { display: flex; align-items: center; gap: 0.3rem; font-size: var(--fs-74); color: var(--muted); line-height: 1.3; white-space: nowrap; overflow: hidden; }
.staff-crumbs a { color: var(--muted); }
.staff-crumbs a:hover { color: var(--accent-strong); }
.staff-crumbs span[aria-hidden] { opacity: 0.6; }

.staff-icon-btn {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px;
  border-radius: var(--radius-sm2);
  color: rgba(30, 30, 30, 0.75);
}
.staff-icon-btn:hover { background: rgba(30, 40, 38, 0.06); color: var(--text); }
.staff-icon-btn.staff-menu-btn, .staff-icon-btn.staff-search-open, .staff-icon-btn.staff-search-cancel { display: none; }

.staff-search { position: relative; margin-inline-start: auto; width: min(440px, 42vw); }
.staff-search-icon { position: absolute; inset-inline-start: 0.8rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; width: 18px; height: 18px; }
.staff-search-input {
  width: 100%;
  height: 42px;
  padding: 0 2.5rem 0 2.6rem;
  padding-inline-start: 2.5rem;
  padding-inline-end: 2.6rem;
  border-radius: 0.7rem;
  border: 1px solid var(--staff-line-strong);
  background: var(--staff-surface);
  font: inherit;
  font-size: var(--fs-90);
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.staff-search-input::placeholder { color: rgba(30, 30, 30, 0.45); }
.staff-search-input:focus { outline: none; border-color: var(--accent-strong); box-shadow: 0 0 0 3px var(--teal-14); }
.staff-search-input::-webkit-search-cancel-button { display: none; }
.staff-kbd {
  position: absolute; inset-inline-end: 0.7rem; top: 50%; transform: translateY(-50%);
  min-width: 22px; height: 22px; padding: 0 5px;
  display: inline-grid; place-items: center;
  border: 1px solid var(--staff-line-strong); border-radius: 5px;
  font: 600 0.75rem/1 ui-monospace, monospace; color: var(--muted);
  background: var(--staff-ground);
  pointer-events: none;
}
.staff-search-input:focus ~ .staff-kbd { opacity: 0; }
.staff-search.is-loading .staff-search-icon { animation: staff-pulse 0.9s ease-in-out infinite; }
@keyframes staff-pulse { 50% { opacity: 0.35; } }

.staff-search-results {
  position: absolute; top: calc(100% + 6px); inset-inline: 0;
  max-height: min(420px, 70vh); overflow-y: auto;
  padding: 0.35rem;
  background: var(--staff-surface);
  border: 1px solid var(--staff-line-strong);
  border-radius: 0.8rem;
  box-shadow: 0 12px 32px rgba(25, 40, 38, 0.14);
}
.staff-search-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0 0.6rem;
  padding: 0.5rem 0.7rem;
  border-radius: 0.55rem;
  color: var(--text);
}
.staff-search-option.is-active, .staff-search-option:hover { background: var(--staff-teal-soft); }
.staff-search-name { font-weight: 600; font-size: var(--fs-92); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.staff-search-case { font-size: var(--fs-74); color: var(--accent-strong); align-self: center; white-space: nowrap; }
.staff-search-meta { grid-column: 1 / -1; font-size: var(--fs-78); color: var(--muted); }
.staff-search-empty { padding: 0.9rem; text-align: center; font-size: var(--fs-85); color: var(--muted); }
/* #58: a family with several children: one row, a pill per child */
.staff-search-family { display: grid; gap: 0.3rem; padding: 0.45rem 0.7rem 0.55rem; }
.staff-search-pills { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.staff-search-option.staff-search-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  padding: 0.28rem 0.7rem;
  border: 1px solid var(--staff-line-strong);
  border-radius: 0.55rem;
  font-weight: 600;
  font-size: var(--fs-86);
}
.staff-search-pill small { font-weight: 400; font-size: var(--fs-72); color: var(--accent-strong); }
.staff-search-option.staff-search-pill.is-active { border-color: var(--accent-strong); }
.staff-ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }

/* Content */
.staff-content { padding: 1.5rem; max-width: 1400px; }
.staff-content .dashboard-main { gap: 1.1rem; }
.staff-body .dashboard-section {
  border-radius: 0.9rem;
  background: var(--staff-surface);
  border: 1px solid var(--staff-line);
  box-shadow: var(--staff-shadow);
}

/* Tab bar (phones) */
.staff-tabbar { display: none; }

/* Toasts */
.staff-toasts {
  position: fixed;
  z-index: 1200;
  inset-block-end: 1.25rem;
  inset-inline-start: 50%;
  transform: translateX(50%);
  display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
  pointer-events: none;
  width: max-content; max-width: calc(100vw - 2rem);
}
.staff-toast {
  pointer-events: auto;
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.6rem 0.7rem 0.6rem 0.9rem;
  padding-inline-start: 0.9rem; padding-inline-end: 0.6rem;
  border-radius: var(--radius-md);
  background: #1f2a28; color: #fff;
  font-size: var(--fs-90);
  box-shadow: 0 10px 30px rgba(20, 30, 28, 0.25);
  animation: staff-toast-in 0.22s ease-out;
}
.staff-toast svg { width: 18px; height: 18px; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; stroke: #7fd6c2; }
.staff-toast.is-error svg { stroke: #ff9c94; }
.staff-toast.is-warning svg { stroke: #f5c26b; }
.staff-toast-close { color: rgba(255, 255, 255, 0.6); font-size: var(--fs-120); line-height: 1; width: 26px; height: 26px; border-radius: 6px; }
.staff-toast-close:hover { color: #fff; background: rgba(255, 255, 255, 0.1); }
.staff-toast.is-leaving { opacity: 0; transform: translateY(6px); transition: opacity 0.18s ease, transform 0.18s ease; }
@keyframes staff-toast-in { from { opacity: 0; transform: translateY(8px); } }

/* Tablets: sidebar becomes a sheet behind a menu button */
@media (max-width: 1100px) {
  .staff-main-col { margin-inline-start: 0; }
  .staff-icon-btn.staff-menu-btn { display: inline-grid; margin-inline-start: -0.4rem; }
  .staff-sidebar {
    width: min(300px, 86vw);
    transform: translateX(100%);
    transition: transform 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: -12px 0 40px rgba(20, 30, 28, 0.18);
    visibility: hidden;
  }
  .staff-sheet-open .staff-sidebar { transform: none; visibility: visible; }
  .staff-icon-btn.staff-sheet-close { display: inline-grid; }
  .staff-sheet-backdrop {
    position: fixed; inset: 0; z-index: 35;
    background: rgba(20, 30, 28, 0.35);
  }
  .staff-sheet-open { overflow: hidden; }
}

/* Phones: bottom tab bar, compact top bar, search behind an icon */
@media (max-width: 720px) {
  .staff-body { --staff-topbar-h: 56px; }
  .staff-icon-btn.staff-menu-btn { display: none; }
  .staff-topbar { padding: 0 1rem; gap: 0.5rem; }
  .staff-title { font-size: 1.02rem; }
  .staff-crumbs { display: none; }
  .staff-search { display: none; }
  .staff-icon-btn.staff-search-open { display: inline-grid; margin-inline-start: auto; }
  .staff-topbar.is-searching .staff-heading,
  .staff-topbar.is-searching .staff-icon-btn.staff-search-open { display: none; }
  .staff-topbar.is-searching .staff-search { display: flex; align-items: center; gap: 0.25rem; width: 100%; margin: 0; }
  .staff-topbar.is-searching .staff-icon-btn.staff-search-cancel { display: inline-grid; flex-shrink: 0; }
  .staff-topbar.is-searching .staff-search-icon { inset-inline-start: 0.8rem; }
  .staff-search-input { font-size: 16px; } /* no iOS zoom on focus */
  .staff-kbd { display: none; }
  .staff-search-results { inset-inline-end: 44px; position: fixed; top: calc(var(--staff-topbar-h) + 4px); inset-inline-start: 0.75rem; inset-inline-end: 0.75rem; max-height: 65vh; }

  .staff-content { padding: 1rem 0.85rem calc(84px + env(safe-area-inset-bottom, 0px)); }
  .staff-body .dashboard-section { padding: 1.1rem; border-radius: 0.85rem; }

  .staff-tabbar {
    position: fixed; z-index: 30;
    inset-inline: 0; bottom: 0;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    padding: 0.35rem 0.35rem calc(0.35rem + env(safe-area-inset-bottom, 0px));
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid var(--staff-line);
  }
  .staff-tab {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    min-height: 52px;
    border-radius: var(--radius-sm2);
    font-size: var(--fs-72); font-weight: 500;
    color: rgba(30, 30, 30, 0.6);
  }
  .staff-tab svg { width: 22px; height: 22px; }
  .staff-tab.is-active { color: var(--accent-strong); font-weight: 700; }
  .staff-tab.is-active svg { stroke-width: 2; }
  .staff-toasts { inset-block-end: calc(76px + env(safe-area-inset-bottom, 0px)); }
}

@media (prefers-reduced-motion: reduce) {
  .staff-sidebar, .staff-toast, .staff-toast.is-leaving { transition: none; animation: none; }
}

/* Whole-row links in client lists: the name's link stretches over the row,
   while the phone link and the ⋮ menu stay clickable above it. */
.reservation-item.is-linked { position: relative; transition: border-color 0.15s ease, background-color 0.15s ease; }
.reservation-item.is-linked:hover { border-color: rgba(37, 145, 147, 0.28); }
.row-link { color: inherit; }
.row-link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.row-link:focus-visible { outline: none; }
.reservation-item.is-linked:has(.row-link:focus-visible) { outline: 2px solid var(--accent-strong); outline-offset: 2px; }
.reservation-item.is-linked .phone-link,
.reservation-item.is-linked .reservation-item-actions { position: relative; z-index: 1; }
.row-case {
  margin-inline-start: 0.5rem;
  padding: 0.05rem 0.45rem;
  border-radius: var(--radius-2xs);
  background: var(--teal-08);
  color: var(--accent-strong);
  font-size: var(--fs-72);
  font-weight: 500;
  vertical-align: middle;
  white-space: nowrap;
}

/* Tap-to-call phone number */
.phone-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.1rem 0.4rem;
  margin-inline-start: -0.4rem;
  border-radius: 0.45rem;
  color: var(--accent-strong);
  font-size: var(--fs-86);
  font-variant-numeric: tabular-nums;
  line-height: 1.6;
}
.phone-link svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.phone-link:hover { background: var(--teal-10); }

/* Quick date-range tabs above the reservations/sessions lists */
.rf-range {
  display: flex;
  gap: 0.25rem;
  padding: 0.25rem;
  border-radius: var(--radius-md);
  background: rgba(30, 40, 38, 0.05);
  overflow-x: auto;
  scrollbar-width: none;
  width: max-content;
  max-width: 100%;
}
.rf-range::-webkit-scrollbar { display: none; }
.rf-range-tab {
  flex-shrink: 0;
  padding: 0.3rem 0.85rem;
  border-radius: 0.55rem;
  font-size: var(--fs-85);
  color: rgba(30, 30, 30, 0.7);
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.rf-range-tab:hover { color: var(--text); background: rgba(255, 255, 255, 0.6); }
.rf-range-tab.is-active { background: #fff; color: var(--accent-strong); font-weight: 600; box-shadow: 0 1px 3px rgba(25, 40, 38, 0.1); }
.row-service { color: var(--muted); font-weight: 500; font-size: 0.85em; }

/* Session edit popup: who/what/phone in the header, when in one row,
   save in a footer that stays visible, delete far from close. */
.cal-modal-box-edit { width: min(720px, 100%); padding-bottom: 0; }
.cal-edit-header { align-items: flex-start; gap: 1rem; padding-bottom: 0.85rem; border-bottom: 1px solid rgba(30, 40, 38, 0.08); }
.cal-edit-head-main { display: flex; flex-direction: column; align-items: flex-start; gap: 0.35rem; min-width: 0; }
.cal-edit-facts { display: flex; flex-wrap: wrap; align-items: center; gap: 0.15rem 0.4rem; font-size: var(--fs-86); color: var(--muted); line-height: 1.6; }
.cal-edit-facts strong { color: var(--text); font-weight: 600; }
.cal-edit-dot { opacity: 0.5; }
.cal-edit-body { gap: 0.85rem; }
.cal-edit-footer {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 1rem -1.35rem 0;
  padding: 0.85rem 1.35rem;
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid rgba(30, 40, 38, 0.08);
  border-radius: 0 0 1.1rem 1.1rem;
}
.cal-edit-footer .button { display: inline-flex; align-items: center; gap: 0.5rem; }
.cal-btn-kbd {
  font: 600 0.7rem/1 ui-monospace, monospace;
  padding: 0.15rem 0.35rem;
  border-radius: 0.3rem;
  background: rgba(255, 255, 255, 0.22);
  color: rgba(255, 255, 255, 0.9);
}
.cal-edit-delete {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: var(--fs-85);
  color: rgba(180, 40, 40, 0.85);
}
.cal-edit-delete:hover { background: rgba(180, 40, 40, 0.07); color: var(--danger); }
@media (max-width: 560px) { .cal-btn-kbd { display: none; } }

/* ══════════════════════════════════════════════════════════════════
   Panel dashboard: the clinic's day (templates/panel/dashboard.html)
   ══════════════════════════════════════════════════════════════════ */
.staff-body {
  --tone-came: #1f8a7c;
  --tone-came-soft: rgba(31, 138, 124, 0.12);
  --tone-missed: #c0392b;
  --tone-missed-soft: rgba(192, 57, 43, 0.1);
  --tone-attention: #b7790f;
  --tone-attention-soft: rgba(214, 150, 30, 0.15);
  --tone-planned: #4b5d5a;
  --tone-planned-soft: rgba(75, 93, 90, 0.08);
  --tone-ahead: rgba(37, 145, 147, 0.22);
}
.dash-day, .dash-card {
  background: var(--staff-surface);
  border: 1px solid var(--staff-line);
  border-radius: 0.9rem;
  box-shadow: var(--staff-shadow);
}
.dash-day { padding: 1.25rem 1.4rem 1.3rem; display: flex; flex-direction: column; gap: 1rem; }
.dash-day-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.dash-eyebrow { margin: 0; font-size: var(--fs-78); font-weight: 600; color: var(--accent); }
.dash-day-title { margin: 0; font-size: 1.45rem; font-weight: 700; line-height: 1.4; color: var(--text); }
.dash-day-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.dash-btn { min-height: 40px; padding: 0 1rem; font-size: var(--fs-90); display: inline-flex; align-items: center; }
.dash-day-stats { display: flex; flex-wrap: wrap; gap: 0.25rem 2rem; margin: 0; }
.dash-day-stats > div { display: flex; flex-direction: column-reverse; gap: 0; }
.dash-day-stats dt { font-size: var(--fs-80); color: var(--muted); display: flex; align-items: center; gap: 0.35rem; }
.dash-day-stats dt a { color: inherit; }
.dash-day-stats dt a:hover { color: var(--accent-strong); }
.dash-day-stats dd { margin: 0; font-size: 1.6rem; font-weight: 700; line-height: 1.3; font-variant-numeric: tabular-nums; }
.dash-day-stats .is-came dt::before,
.dash-day-stats .is-missed dt::before,
.dash-day-stats .is-attention dt::before,
.dash-day-stats .is-ahead dt::before { content: ""; width: 8px; height: 8px; border-radius: 2px; }
.dash-day-stats .is-came dt::before { background: var(--tone-came); }
.dash-day-stats .is-missed dt::before { background: var(--tone-missed); }
.dash-day-stats .is-attention dt::before { background: var(--tone-attention); }
.dash-day-stats .is-ahead dt::before { background: var(--tone-ahead); }
.dash-day-stats .is-attention dd { color: var(--tone-attention); }
.dash-day-stats .is-muted dd { color: var(--muted); }
.dash-day-bar { display: flex; gap: 3px; height: 8px; border-radius: 99px; overflow: hidden; background: rgba(30, 40, 38, 0.05); }
.dash-day-bar span { min-width: 6px; border-radius: 2px; }
.dash-day-bar .is-came { background: var(--tone-came); }
.dash-day-bar .is-missed { background: var(--tone-missed); }
.dash-day-bar .is-attention { background: var(--tone-attention); }
.dash-day-bar .is-ahead { background: var(--tone-ahead); }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.1rem; align-items: start; }
.dash-grid-even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dash-side { display: flex; flex-direction: column; gap: 1.1rem; min-width: 0; }
.dash-card { padding: 1.1rem 1.25rem; min-width: 0; }
.dash-card-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 0.75rem; }
.dash-card-head h2 { margin: 0; font-size: var(--fs-100); font-weight: 700; color: var(--text); }
.dash-card-sub { font-size: var(--fs-78); color: var(--muted); }
.dash-card-link { font-size: var(--fs-82); color: var(--accent-strong); }
.dash-card-foot { margin: 0.6rem 0 0; font-size: var(--fs-80); color: var(--muted); }
.dash-muted { margin: 0; font-size: var(--fs-88); color: var(--muted); }
.dash-empty { padding: 2.5rem 1rem; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 0.75rem; }
.dash-empty p { margin: 0; }

/* Doctor filter chips */
.dash-filter { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.dash-filter-chip {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.2rem 0.65rem;
  border-radius: 99px;
  border: 1px solid var(--staff-line-strong);
  font-size: var(--fs-80); color: rgba(30, 30, 30, 0.75);
  background: var(--staff-surface);
}
.dash-filter-chip small { font-size: var(--fs-72); color: var(--muted); }
.dash-filter-chip:hover { border-color: rgba(37, 145, 147, 0.4); }
.dash-filter-chip.is-active { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }
.dash-filter-chip.is-active small { color: rgba(255, 255, 255, 0.8); }

/* Schedule rows */
.sched-list { list-style: none; margin: 0 -1.25rem -1.1rem; padding: 0; }
.sched-row {
  display: grid;
  grid-template-columns: 4.6rem minmax(0, 1fr) auto;
  gap: 0.9rem;
  align-items: center;
  padding: 0.7rem 1.25rem;
  border-top: 1px solid var(--staff-line);
  position: relative;
}
.sched-row:last-child { border-radius: 0 0 0.9rem 0.9rem; }
.sched-row.is-next { background: rgba(222, 63, 130, 0.045); }
.sched-row.is-next::before {
  content: ""; position: absolute; inset-block: 0.55rem; inset-inline-start: 0;
  width: 3px; border-radius: 0 3px 3px 0; background: var(--accent);
}
.sched-row.is-cancelled .sched-name, .sched-row.is-cancelled .sched-time strong { text-decoration: line-through; color: var(--muted); }
.sched-time { display: flex; flex-direction: column; line-height: 1.3; font-variant-numeric: tabular-nums; }
.sched-time strong { font-size: 1.02rem; font-weight: 700; }
.sched-time small { font-size: var(--fs-72); color: var(--muted); }
.sched-row.is-past .sched-time strong { color: var(--muted); font-weight: 600; }
.sched-next { margin-top: 0.15rem; font-size: 0.68rem; font-weight: 700; color: var(--accent); }
.sched-who { min-width: 0; }
.sched-name-line { display: flex; align-items: center; gap: 0.45rem; flex-wrap: wrap; }
.sched-name { font-weight: 600; font-size: var(--fs-95); color: var(--text); }
a.sched-name:hover { color: var(--accent-strong); }
.sched-pos { font-size: var(--fs-72); color: var(--accent-strong); background: var(--teal-08); padding: 0 0.4rem; border-radius: 0.35rem; white-space: nowrap; }
.sched-note { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; color: var(--tone-attention); background: var(--tone-attention-soft); cursor: help; }
.sched-note svg { width: 13px; height: 13px; fill: currentColor; }
.sched-meta { font-size: var(--fs-80); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sched-side { display: flex; align-items: center; gap: 0.5rem; }
.sched-call {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 0.55rem;
  color: var(--accent-strong); border: 1px solid var(--staff-line);
}
.sched-call:hover { background: var(--teal-08); }
.sched-call svg, .todo-call svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sched-status { display: flex; align-items: center; gap: 0.4rem; min-width: 0; justify-content: flex-end; }
.sched-pill { display: inline-flex; align-items: center; padding: 0.15rem 0.55rem; border-radius: 0.45rem; font-size: var(--fs-76); font-weight: 500; white-space: nowrap; }
.sched-pill.is-planned { background: var(--tone-planned-soft); color: var(--tone-planned); }
.sched-pill.is-came, .sched-pill.is-done { background: var(--tone-came-soft); color: var(--tone-came); }
.sched-pill.is-missed { background: var(--tone-missed-soft); color: var(--tone-missed); }
.sched-pill.is-cancelled { background: rgba(30, 40, 38, 0.05); color: var(--muted); }
.sched-pill.is-attention { background: var(--tone-attention-soft); color: var(--tone-attention); font-weight: 600; }
/* While quick buttons are offered, the default pill adds nothing. */
.sched-quick + .sched-pill.is-planned { display: none; }
.sched-quick { display: inline-flex; border: 1px solid var(--staff-line-strong); border-radius: 0.55rem; overflow: hidden; }
.sched-quick-btn { padding: 0.28rem 0.7rem; font-size: var(--fs-80); font-weight: 600; color: var(--text); background: var(--staff-surface); }
.sched-quick-btn + .sched-quick-btn { border-inline-start: 1px solid var(--staff-line-strong); }
.sched-quick-btn.is-came:hover { background: var(--tone-came-soft); color: var(--tone-came); }
.sched-quick-btn.is-missed:hover { background: var(--tone-missed-soft); color: var(--tone-missed); }
.sched-quick-btn:disabled { opacity: 0.5; cursor: progress; }
.sched-quick-btn:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: -2px; }

/* Needs attention */
.dash-all-clear { margin: 0; display: flex; align-items: center; gap: 0.5rem; font-size: var(--fs-90); color: var(--tone-came); }
.dash-all-clear svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.todo-block + .todo-block { margin-top: 0.9rem; padding-top: 0.9rem; border-top: 1px solid var(--staff-line); }
.todo-head { display: flex; align-items: center; gap: 0.55rem; font-weight: 600; font-size: var(--fs-90); color: var(--text); margin: 0; }
a.todo-head:hover { color: var(--accent-strong); }
.todo-head.is-static { font-size: var(--fs-86); }
.todo-chev { width: 16px; height: 16px; margin-inline-start: auto; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: 0.5; }
.todo-count { min-width: 1.7rem; height: 1.7rem; padding: 0 0.4rem; display: inline-grid; place-items: center; border-radius: var(--radius-sm); font-size: var(--fs-85); font-weight: 700; }
.todo-count.is-attention { background: var(--tone-attention-soft); color: var(--tone-attention); }
.todo-hint { margin: 0.3rem 0 0; font-size: var(--fs-76); color: var(--muted); }
.todo-list { list-style: none; margin: 0.45rem 0 0; padding: 0; display: flex; flex-direction: column; }
.todo-list li { display: flex; align-items: center; gap: 0.5rem; padding: 0.3rem 0; font-size: var(--fs-86); min-width: 0; }
.todo-list li > a:first-child, .todo-list li > span:first-child { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.todo-list li > a:first-child:hover { color: var(--accent-strong); }
.todo-sub { font-size: var(--fs-76); color: var(--muted); white-space: nowrap; margin-inline-start: auto; }
.todo-call { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 0.45rem; color: var(--accent-strong); flex-shrink: 0; }
.todo-call:hover { background: var(--teal-08); }
.todo-flag { font-size: 0.7rem; font-weight: 600; color: var(--tone-missed); background: var(--tone-missed-soft); padding: 0 0.35rem; border-radius: 0.3rem; }

/* Tomorrow / simple rows */
.tmr-list { list-style: none; margin: 0; padding: 0; }
.tmr-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 0.75rem; align-items: center; padding: 0.45rem 0; border-top: 1px solid var(--staff-line); font-size: var(--fs-88); }
.tmr-list li:first-child { border-top: 0; }
.tmr-list a { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tmr-list a:hover { color: var(--accent-strong); }
.tmr-hours { font-size: var(--fs-78); color: var(--muted); font-variant-numeric: tabular-nums; }
.tmr-count { font-size: var(--fs-80); font-weight: 600; color: var(--accent-strong); white-space: nowrap; }

/* Manager: this week */
.week-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 0; margin: 0; }
.week-metric { padding: 0.2rem 1rem; border-inline-start: 1px solid var(--staff-line); }
.week-metric:first-child { border-inline-start: 0; padding-inline-start: 0; }
.week-metric dt { font-size: var(--fs-78); color: var(--muted); }
.week-metric dd { margin: 0; display: flex; align-items: baseline; gap: 0.45rem; }
.week-metric strong { font-size: 1.45rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.week-delta { font-size: var(--fs-75); color: var(--muted); }
.week-delta.is-good { color: var(--tone-came); }
.week-delta.is-bad { color: var(--tone-missed); }

/* Horizontal bars */
.bar-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.55rem; }
.bar-list li { display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr) 2rem; gap: 0.75rem; align-items: center; font-size: var(--fs-85); }
.bar-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { height: 8px; border-radius: 99px; background: rgba(30, 40, 38, 0.06); overflow: hidden; }
.bar-track span { display: block; height: 100%; border-radius: 99px; background: var(--accent-strong); }
.bar-value { text-align: end; font-weight: 600; font-variant-numeric: tabular-nums; }
.risk-tag { font-size: 0.7rem; color: var(--tone-missed); background: var(--tone-missed-soft); padding: 0 0.3rem; border-radius: 0.3rem; }

@media (max-width: 1100px) {
  .dash-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .dash-day { padding: 1rem; }
  .dash-day-title { font-size: var(--fs-120); }
  .dash-day-stats { gap: 0.25rem 1.25rem; }
  .dash-day-stats dd { font-size: 1.3rem; }
  .dash-grid-even { grid-template-columns: minmax(0, 1fr); }
  .dash-card { padding: 1rem; }
  .sched-list { margin: 0 -1rem -1rem; }
  .sched-row { grid-template-columns: 3.6rem minmax(0, 1fr); padding: 0.7rem 1rem; gap: 0.35rem 0.75rem; }
  .sched-side { grid-column: 2; justify-content: space-between; }
  .week-metric { padding: 0.4rem 0; border-inline-start: 0; }
  .bar-list li { grid-template-columns: minmax(0, 8rem) minmax(0, 1fr) 2rem; }
}

/* Counselor home: owed records + agenda (templates/counselor/dashboard.html) */
.owed-list { list-style: none; margin: 0 -1.25rem -1.1rem; padding: 0; }
.owed-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 0.75rem; align-items: center; padding: 0.7rem 1.25rem; border-top: 1px solid var(--staff-line); }
.owed-who { display: flex; flex-direction: column; min-width: 0; line-height: 1.5; }
.owed-name { font-weight: 600; font-size: var(--fs-95); }
.owed-meta { font-size: var(--fs-78); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.owed-age { font-size: var(--fs-78); color: var(--muted); white-space: nowrap; }
.owed-row.is-late .owed-age { color: var(--tone-missed); font-weight: 600; }
.owed-btn { min-height: 36px; padding: 0 0.9rem; font-size: var(--fs-85); }

.agenda { display: flex; flex-direction: column; gap: 1rem; }
.agenda-day-title { margin: 0 0 0.4rem; font-size: var(--fs-95); font-weight: 700; }
.agenda-day-title span { font-weight: 500; font-size: var(--fs-80); color: var(--muted); margin-inline-start: 0.35rem; }
.agenda-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.agenda-row {
  display: grid; grid-template-columns: 3.6rem minmax(0, 1fr) auto; gap: 0.75rem; align-items: center;
  padding: 0.65rem 0.8rem;
  border-radius: 0.7rem;
  border: 1px solid var(--staff-line);
  background: var(--staff-surface);
  color: var(--text);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.agenda-row:hover { border-color: rgba(37, 145, 147, 0.35); }
.agenda-row.is-next { border-color: rgba(222, 63, 130, 0.45); background: rgba(222, 63, 130, 0.04); box-shadow: 0 0 0 3px rgba(222, 63, 130, 0.07); }
.agenda-row.is-past { background: rgba(30, 40, 38, 0.02); }
.agenda-row.is-past .agenda-time strong { color: var(--muted); }
.agenda-row.is-missed .agenda-name { color: var(--muted); text-decoration: line-through; }
.agenda-time { display: flex; flex-direction: column; line-height: 1.3; font-variant-numeric: tabular-nums; }
.agenda-time strong { font-size: var(--fs-100); }
.agenda-time small { font-size: var(--fs-72); color: var(--muted); }
.agenda-who { display: flex; flex-direction: column; min-width: 0; line-height: 1.5; }
.agenda-name { font-weight: 600; font-size: var(--fs-95); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agenda-meta { font-size: var(--fs-78); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agenda-note { margin-top: 0.15rem; font-size: var(--fs-76); color: var(--tone-attention); background: var(--tone-attention-soft); border-radius: 0.35rem; padding: 0 0.4rem; width: fit-content; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agenda-tag { font-size: var(--fs-72); font-weight: 700; color: var(--muted); }
.agenda-row.is-next .agenda-tag { color: var(--accent); }
.agenda-row.is-missed .agenda-tag { color: var(--tone-missed); }
.agenda-empty { padding: 0.25rem 0 0.4rem; }
.agenda-more { align-self: flex-start; font-size: var(--fs-85); color: var(--accent-strong); }
@media (max-width: 720px) {
  .owed-list { margin: 0 -1rem -1rem; }
  .owed-row { grid-template-columns: minmax(0, 1fr) auto; padding: 0.7rem 1rem; }
  .owed-age { grid-row: 1; grid-column: 2; }
  .owed-btn { grid-column: 1 / -1; width: 100%; justify-content: center; }
}
.cal-modal-box-edit .cal-status-options { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 560px) { .cal-modal-box-edit .cal-status-options { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Client header card (partials/client_card.html): who on top, then one
   strip of equal cells; the next session is the highlighted one. */
.client-card {
  background: var(--staff-surface, #fff);
  border: 1px solid var(--staff-line, rgba(30, 40, 38, 0.09));
  border-radius: 0.9rem;
  box-shadow: var(--staff-shadow, none);
  overflow: hidden;
}
.client-card-head { display: flex; align-items: center; gap: 0.9rem; padding: 1.1rem 1.25rem; flex-wrap: wrap; }
.client-avatar {
  width: 52px; height: 52px; flex-shrink: 0; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(222, 63, 130, 0.1); color: var(--accent); font-weight: 700; font-size: 1.3rem;
}
.client-card-title { min-width: 0; flex: 1 1 260px; display: flex; flex-direction: column; gap: 0.25rem; }
.client-card-title h2 { margin: 0; font-size: 1.3rem; font-weight: 700; line-height: 1.35; }
.client-card-sub { display: flex; align-items: center; flex-wrap: wrap; gap: 0.25rem 0.5rem; font-size: var(--fs-82); color: var(--muted); }
.client-card-sub > span:not(.row-case):not(.client-badge) + span:not(.client-badge)::before { content: "·"; margin-inline-end: 0.5rem; opacity: 0.6; }
.client-card-sub .row-case { margin-inline-start: 0; }
.client-badge { font-size: var(--fs-72); font-weight: 600; padding: 0.05rem 0.45rem; border-radius: var(--radius-2xs); }
.client-badge.is-off { background: rgba(192, 57, 43, 0.1); color: #c0392b; }
.client-card-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-inline-start: auto; }

.client-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 0;
  border-top: 1px solid var(--staff-line, rgba(30, 40, 38, 0.09));
  background: rgba(30, 40, 38, 0.015);
}
.client-cell { min-width: 0; padding: 0.8rem 1.25rem 0.9rem; display: flex; flex-direction: column; gap: 0.2rem; }
.client-cell + .client-cell { border-inline-start: 1px solid var(--staff-line, rgba(30, 40, 38, 0.09)); }
.client-cell dt { font-size: var(--fs-74); font-weight: 500; color: var(--muted); }
.client-cell dd { margin: 0; min-height: 1.6em; font-size: var(--fs-92); font-weight: 600; line-height: 1.6; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.client-cell dd small { display: block; font-size: var(--fs-78); font-weight: 400; color: var(--muted); }
.client-cell.is-next { background: var(--teal-07); }
.client-cell.is-next dt { color: var(--accent-strong); }
.client-cell.is-next dd { color: var(--text); }
.client-phone { display: inline-flex; align-items: center; gap: 0.35rem; color: var(--accent-strong); }
.client-phone svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.client-phone:hover { text-decoration: underline; text-underline-offset: 3px; }
.client-note {
  margin: 0; padding: 0.7rem 1.25rem;
  border-top: 1px solid rgba(214, 150, 30, 0.25);
  background: rgba(214, 150, 30, 0.08); color: #6f4c0d; font-size: var(--fs-85); line-height: 1.75;
}
.client-note strong { margin-inline-end: 0.5rem; font-weight: 700; }

@media (max-width: 1100px) {
  .client-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .client-cell { border-top: 1px solid var(--staff-line, rgba(30, 40, 38, 0.09)); }
  .client-cell:nth-child(-n+3) { border-top: 0; }
  .client-cell:nth-child(3n+1) { border-inline-start: 0; }
}
@media (max-width: 720px) {
  .client-card-head { padding: 1rem; gap: 0.75rem; }
  .client-avatar { width: 44px; height: 44px; font-size: 1.1rem; }
  .client-card-title h2 { font-size: 1.15rem; }
  .client-card-actions { width: 100%; margin: 0; }
  .client-card-actions .button { flex: 1; justify-content: center; }
  .client-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .client-cell { padding: 0.7rem 1rem 0.75rem; }
  .client-cell, .client-cell:nth-child(-n+3) { border-top: 1px solid var(--staff-line, rgba(30, 40, 38, 0.09)); border-inline-start: 0; }
  .client-cell:nth-child(-n+2) { border-top: 0; }
  .client-cell:nth-child(2n) { border-inline-start: 1px solid var(--staff-line, rgba(30, 40, 38, 0.09)); }
  .client-cell.is-next { grid-column: 1 / -1; border-inline-start: 0; }
  .client-cell.is-next + .client-cell { border-top: 1px solid var(--staff-line, rgba(30, 40, 38, 0.09)); border-inline-start: 0; }
  .client-cell.is-next ~ .client-cell:nth-child(2n+1) { border-inline-start: 1px solid var(--staff-line, rgba(30, 40, 38, 0.09)); }
  .client-cell.is-next ~ .client-cell:nth-child(2n) { border-inline-start: 0; }
  .client-note { padding: 0.65rem 1rem; }
}

/* Profile read view (partials/user_profile_summary.html) */
.profile-summary { display: flex; flex-direction: column; gap: 1.1rem; }
.profile-summary-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; }
.profile-summary-hint { margin: 0; font-size: var(--fs-85); color: var(--muted); }
.profile-summary-head .button { display: inline-flex; align-items: center; gap: 0.4rem; }
.profile-summary-section h3 { margin: 0 0 0.5rem; font-size: var(--fs-80); font-weight: 600; color: var(--accent-strong); }
.profile-summary-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 0.6rem; margin: 0; }
.profile-summary-grid > div {
  min-width: 0;
  padding: 0.5rem 0.8rem 0.55rem;
  border: 1px solid rgba(30, 40, 38, 0.1);
  border-radius: var(--radius-sm2);
  background: rgba(30, 40, 38, 0.02);
}
.profile-summary-grid > div.is-wide { grid-column: 1 / -1; }
.profile-summary-grid dt { font-size: var(--fs-74); color: var(--muted); line-height: 1.6; }
.profile-summary-grid dd { margin: 0; font-size: var(--fs-92); line-height: 1.7; overflow-wrap: anywhere; }
.profile-summary-missing { margin: 0; font-size: var(--fs-80); color: var(--muted); line-height: 1.8; }
.profile-summary-missing strong { font-weight: 600; color: rgba(30, 30, 30, 0.6); }

/* Calendar: booking for a chosen client */
.cal-preset-banner {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-md);
  background: var(--teal-10);
  border: 1px solid rgba(37, 145, 147, 0.25);
  font-size: var(--fs-90);
}
.cal-preset-banner svg { width: 20px; height: 20px; fill: none; stroke: var(--accent-strong); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.cal-preset-banner span { flex: 1; min-width: 0; }
.cal-preset-back { font-size: var(--fs-82); color: var(--accent-strong); white-space: nowrap; }
.cal-preset-clear { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 0.45rem; font-size: var(--fs-120); color: var(--muted); }
.cal-preset-clear:hover { background: rgba(30, 40, 38, 0.06); color: var(--text); }
.row-facts { display: flex; flex-wrap: wrap; gap: 0 0.9rem; font-size: var(--fs-78); color: rgba(30, 30, 30, 0.7); line-height: 1.7; }
.row-facts > span + span::before { content: "·"; margin-inline-end: 0.9rem; color: var(--muted); }
.row-facts-dim { color: var(--muted); }

/* Website reservation detail: the request on the right, actions beside it */
.res-detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.1rem; align-items: start; }
.res-side { position: sticky; top: calc(var(--staff-topbar-h, 64px) + 1rem); }
.intake-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
@media (max-width: 1100px) {
  .res-detail-grid { grid-template-columns: minmax(0, 1fr); }
  .res-side { position: static; order: -1; }
}
.staff-nav-badge {
  margin-inline-start: auto; min-width: 20px; height: 20px; padding: 0 6px;
  display: inline-grid; place-items: center; border-radius: 99px;
  background: var(--accent); color: #fff; font-size: var(--fs-72); font-weight: 700;
}
.staff-tab { position: relative; }
.staff-tab-badge {
  position: absolute; top: 4px; inset-inline-end: calc(50% - 22px);
  min-width: 17px; height: 17px; padding: 0 4px; display: grid; place-items: center;
  border-radius: 99px; background: var(--accent); color: #fff; font-size: 0.66rem; font-weight: 700;
}
.rf-range-row { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.rf-waiting {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.35rem 0.8rem; border-radius: 0.65rem;
  border: 1px solid rgba(214, 150, 30, 0.45); background: rgba(214, 150, 30, 0.1);
  color: #8a5a07; font-size: var(--fs-85); font-weight: 600;
}
.rf-waiting span { min-width: 20px; height: 20px; padding: 0 5px; display: inline-grid; place-items: center; border-radius: 99px; background: #b7790f; color: #fff; font-size: var(--fs-72); }
.rf-waiting.is-active, .rf-waiting:hover { background: rgba(214, 150, 30, 0.2); }
.cal-move-following {
  display: flex; align-items: flex-start; gap: 0.55rem;
  margin-top: -0.25rem; padding: 0.55rem 0.7rem;
  border-radius: var(--radius-sm2); background: var(--teal-06);
  font-size: var(--fs-86); cursor: pointer;
}
.cal-move-following input { margin-top: 0.3rem; accent-color: var(--accent-strong); width: 16px; height: 16px; flex-shrink: 0; }
.cal-move-following span { display: flex; flex-direction: column; line-height: 1.6; }
.cal-move-following small { font-size: var(--fs-74); color: var(--muted); }
.dash-head-tools { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.dash-view-toggle { display: inline-flex; padding: 3px; border-radius: var(--radius-sm2); background: rgba(30, 40, 38, 0.06); }
.dash-view-toggle button { padding: 0.2rem 0.7rem; border-radius: 0.45rem; font-size: var(--fs-80); color: rgba(30, 30, 30, 0.7); }
.dash-view-toggle button[aria-pressed="true"] { background: #fff; color: var(--accent-strong); font-weight: 600; box-shadow: 0 1px 3px rgba(25, 40, 38, 0.1); }
.sched-columns { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 0.75rem; overflow-x: auto; padding-bottom: 0.25rem; }
.sched-col { min-width: 0; border: 1px solid var(--staff-line); border-radius: var(--radius-md); background: rgba(30, 40, 38, 0.015); }
.sched-col h3 { margin: 0; padding: 0.6rem 0.8rem; font-size: var(--fs-90); font-weight: 700; display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1px solid var(--staff-line); }
.sched-col h3 small { font-size: var(--fs-74); font-weight: 500; color: var(--muted); }
.sched-col ol { list-style: none; margin: 0; padding: 0; }
.sched-col .sched-row { grid-template-columns: 3.4rem minmax(0, 1fr); padding: 0.6rem 0.8rem; gap: 0.3rem 0.6rem; }
.sched-col .sched-row:first-child { border-top: 0; }
.sched-col .sched-side { grid-column: 2; justify-content: space-between; }
.sched-col .sched-meta { white-space: normal; }
.profile-summary-grid dd:empty { min-height: 1.7em; }
@media (max-width: 720px) {
  .profile-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; }
  .profile-summary-grid > div { padding: 0.45rem 0.7rem 0.5rem; }
}

/* Uploaded files on a client's page (partials/document_row.html) */
.doc-list { display: flex; flex-direction: column; gap: 0.5rem; }
.doc-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 0.9rem; align-items: center;
  padding: 0.75rem 0.9rem;
  border: 1px solid rgba(30, 40, 38, 0.1);
  border-radius: var(--radius-md);
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.doc-row:hover { border-color: var(--teal-30); box-shadow: 0 2px 10px rgba(25, 40, 38, 0.05); }
.doc-icon {
  position: relative; width: 42px; height: 48px; flex-shrink: 0;
  display: grid; place-items: center;
  --doc-tone: #5d6b68; --doc-soft: rgba(93, 107, 104, 0.1);
  color: var(--doc-tone);
}
.doc-icon.is-pdf { --doc-tone: #c0392b; --doc-soft: rgba(192, 57, 43, 0.1); }
.doc-icon.is-image { --doc-tone: #1f8a7c; --doc-soft: rgba(31, 138, 124, 0.1); }
.doc-icon.is-doc { --doc-tone: #2f6fb5; --doc-soft: rgba(47, 111, 181, 0.1); }
.doc-icon.is-sheet { --doc-tone: #2e8b57; --doc-soft: rgba(46, 139, 87, 0.1); }
.doc-icon svg { position: absolute; inset: 0; width: 100%; height: 100%; fill: var(--doc-soft); stroke: var(--doc-tone); stroke-width: 1.2; stroke-linejoin: round; }
.doc-icon b { position: relative; margin-top: 10px; font: 700 0.6rem/1 ui-monospace, SFMono-Regular, monospace; letter-spacing: 0.02em; direction: ltr; }
.doc-body { min-width: 0; display: flex; flex-direction: column; gap: 0.1rem; }
.doc-title { font-weight: 600; font-size: var(--fs-95); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-title:hover { color: var(--accent-strong); }
.doc-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0 0.5rem; font-size: var(--fs-78); color: var(--muted); line-height: 1.7; }
.doc-meta > span + span::before { content: "·"; margin-inline-end: 0.5rem; opacity: 0.6; }
.doc-note {
  margin: 0.35rem 0 0; padding: 0.35rem 0.6rem; border-radius: 0.45rem;
  background: rgba(30, 40, 38, 0.035); font-size: var(--fs-84); line-height: 1.7; color: rgba(30, 30, 30, 0.8);
  white-space: pre-line;
}
.doc-actions { display: flex; align-items: center; gap: 0.3rem; }
.doc-btn {
  height: 34px; min-width: 34px; padding: 0 0.55rem;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.35rem;
  border-radius: 0.55rem; border: 1px solid rgba(30, 40, 38, 0.12);
  color: rgba(30, 30, 30, 0.7); background: #fff; font-size: var(--fs-82);
}
.doc-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.doc-btn:hover { background: rgba(30, 40, 38, 0.04); color: var(--text); }
.doc-btn.is-primary { color: var(--accent-strong); border-color: var(--teal-30); padding: 0 0.75rem; }
.doc-btn.is-primary:hover { background: var(--teal-08); }
.doc-btn.is-danger:hover { color: #c0392b; border-color: rgba(192, 57, 43, 0.3); background: rgba(192, 57, 43, 0.06); }
.doc-btn:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 2px; }
@media (max-width: 720px) {
  .doc-row { grid-template-columns: auto minmax(0, 1fr); gap: 0.6rem 0.75rem; padding: 0.7rem; }
  .doc-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .doc-btn.is-primary { margin-inline-end: auto; }
}

/* Client page tabs (سابقه / نتایج تست‌ها / فایل‌ها / اطلاعات فردی): the same
   segmented control as the reservations range tabs — a quiet track, the
   active tab a white raised segment, small radius. */
.staff-body .panel-tabs {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 0.2rem;
  padding: 0.25rem;
  border-radius: var(--radius-md);
  background: rgba(30, 40, 38, 0.06);
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}
.staff-body .panel-tabs::-webkit-scrollbar { display: none; }
.staff-body .panel-tab {
  flex-shrink: 0;
  padding: 0.4rem 0.95rem;
  border-radius: 0.55rem;
  border: 0;
  background: transparent;
  color: rgba(30, 30, 30, 0.65);
  font-size: var(--fs-88);
  font-weight: 500;
  white-space: nowrap;
  box-shadow: none;
}
.staff-body .panel-tab svg { opacity: 0.55; }
.staff-body .panel-tab:hover { background: rgba(255, 255, 255, 0.55); color: var(--text); }
.staff-body .panel-tab[aria-selected="true"] {
  background: #fff;
  color: var(--accent-strong);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(25, 40, 38, 0.12);
}
.staff-body .panel-tab[aria-selected="true"] svg { opacity: 1; }
.staff-body .panel-tab:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: -2px; }
@media (max-width: 720px) {
  .staff-body .panel-tabs { display: flex; width: 100%; }
  .staff-body .panel-tab { flex: 1 0 auto; justify-content: center; padding: 0.4rem 0.7rem; font-size: var(--fs-84); }
}
.staff-body .panel-tabs { justify-self: start; width: fit-content; min-width: 0; }
.staff-body div:has(> .panel-tabs) { min-width: 0; max-width: 100%; }
@media (max-width: 720px) {
  .staff-body div:has(> .panel-tabs) { flex: 1 1 100%; }
  .staff-body .panel-tabs { width: 100%; }
  .staff-body .panel-tab { flex: 1 1 auto; min-width: 0; padding: 0.45rem 0.4rem; }
  .staff-body .panel-tab svg { display: none; }
}

/* Counselor client page: «تاریخچه ویزیت‌ها» (partials/history_entries.html).
   A group is one card; its visits are lines inside it, not cards in a card. */
.visit-group.therapy-plan-subcard {
  padding: 0;
  border: 1px solid rgba(30, 40, 38, 0.1);
  border-radius: 0.8rem;
  background: #fff;
  overflow: hidden;
  box-shadow: none;
}
.visit-group + .visit-group { margin-top: 0.6rem; }
.visit-group-head.dashboard-section-header { margin: 0; padding: 0.75rem 1rem; gap: 0.75rem; }
.visit-group-head .therapy-plan-toggle { flex: 1; min-width: 0; }
.visit-group-head .therapy-plan-subcard-title { font-size: 0.98rem; font-weight: 700; gap: 0.5rem; }
.visit-group-meta { display: flex; align-items: center; gap: 0.5rem; font-size: var(--fs-80); color: var(--muted); white-space: nowrap; }
.visit-group-meta > span + span::before { content: "·"; margin-inline-end: 0.5rem; opacity: 0.6; }
.visit-group-meta > span:first-child { font-weight: 600; color: var(--accent-strong); }
.visit-group .therapy-plan-sessions-inner { padding: 0; }
.visit-group .visit-list { border-top: 1px solid rgba(30, 40, 38, 0.08); }

.visit-list { display: flex; flex-direction: column; }
.visit-row { margin: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; padding: 0; }
.visit-row + .visit-row { border-top: 1px solid rgba(30, 40, 38, 0.07); }
.visit-main {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  width: 100%; padding: 0.75rem 1rem;
  text-align: start; background: transparent; border: 0; font: inherit; color: inherit;
}
button.visit-main { cursor: pointer; }
button.visit-main:hover { background: var(--teal-04); }
.visit-info { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.visit-when { font-size: 0.93rem; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.visit-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0 0.5rem; font-size: var(--fs-78); color: var(--muted); line-height: 1.7; }
.visit-meta > span + span::before { content: "·"; margin-inline-end: 0.5rem; opacity: 0.6; }
.visit-meta .session-ordinal { background: none; padding: 0; border: 0; font-size: inherit; color: inherit; font-weight: 400; }
.visit-note {
  margin-top: 0.2rem; width: fit-content; max-width: 100%;
  padding: 0.1rem 0.5rem; border-radius: var(--radius-2xs);
  background: rgba(214, 150, 30, 0.1); color: #7a5410; font-size: var(--fs-78); line-height: 1.7;
}
.visit-note::before { content: "یادداشت پذیرش: "; font-weight: 600; }
.visit-preview {
  display: flex; align-items: center; gap: 0.35rem; margin-top: 0.15rem;
  font-size: var(--fs-80); color: rgba(30, 30, 30, 0.62); line-height: 1.6;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 62ch;
}
.visit-preview svg { width: 14px; height: 14px; flex-shrink: 0; fill: none; stroke: var(--accent-strong); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.visit-row.has-record .expandable-toggle[aria-expanded="true"] .visit-preview { display: none; }
.visit-end { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }
.visit-status { display: inline-flex; align-items: center; gap: 0.35rem; font-size: var(--fs-75); font-weight: 500; padding: 0.12rem 0.5rem; border-radius: var(--radius-2xs); white-space: nowrap; background: rgba(75, 93, 90, 0.08); color: #4b5d5a; }
.visit-status.is-awaiting_summary, .visit-status.is-pending { background: rgba(214, 150, 30, 0.14); color: #8a5a07; }
.visit-status.is-done, .visit-status.is-confirmed { background: rgba(31, 138, 124, 0.12); color: #1f8a7c; }
.visit-status.is-missed, .visit-status.is-cancelled { background: rgba(192, 57, 43, 0.09); color: #b03a2e; }
.visit-write { min-height: 32px; padding: 0 0.8rem; font-size: var(--fs-82); }
.visit-row .session-summary-inner { padding: 0; }
.visit-record { margin: 0 1rem 0.85rem; padding: 0.7rem 0.85rem; border-radius: var(--radius-sm2); background: var(--teal-05); border: 1px solid var(--teal-12); }
.visit-record .session-summary-text { margin: 0; font-size: var(--fs-90); line-height: 1.95; white-space: pre-line; }
.visit-record .session-summary-edit { margin-top: 0.55rem; }
@media (max-width: 720px) {
  .visit-group-head.dashboard-section-header { padding: 0.7rem 0.85rem; flex-wrap: wrap; }
  .visit-main { padding: 0.7rem 0.85rem; align-items: flex-start; gap: 0.6rem; }
  .visit-end { flex-direction: column; align-items: flex-end; }
  .visit-preview { max-width: 100%; }
  .visit-record { margin: 0 0.85rem 0.75rem; }
}
/* Visit rows override the older stand-alone expandable card look. */
.visit-list > .reservation-item-expandable.visit-row {
  display: block; border: 0; border-radius: 0; background: transparent;
}
.visit-list > .reservation-item-expandable.visit-row + .visit-row,
.visit-list > .visit-row + .reservation-item-expandable.visit-row { border-top: 1px solid rgba(30, 40, 38, 0.07); }
.visit-list > .reservation-item-expandable.visit-row:hover { background: transparent; }
.visit-list > .reservation-item-expandable.visit-row > .expandable-toggle.visit-main { display: flex; padding: 0.75rem 1rem; }
.visit-list > .reservation-item-expandable.visit-row.open { background: rgba(37, 145, 147, 0.025); }
.visit-list > .reservation-item-expandable.visit-row .session-summary-inner,
.visit-list > .reservation-item-expandable.visit-row.open .session-summary-inner { padding: 0; }
.visit-record .session-summary-text { padding: 0; border: 0; background: transparent; border-radius: 0; }
.visit-meta .session-ordinal { margin: 0; padding: 0; background: none; box-shadow: none; border-radius: 0; color: inherit; font-size: inherit; font-weight: 400; vertical-align: baseline; }
@media (max-width: 720px) {
  .visit-list > .reservation-item-expandable.visit-row > .expandable-toggle.visit-main { padding: 0.7rem 0.85rem; }
}

/* Visit rows: status reads at a glance — a colour bar on the row's start
   edge and a coloured pill with a dot; upcoming visits tinted lightly. */
.visit-list > .visit-row { position: relative; }
.visit-list > .visit-row::before {
  content: ""; position: absolute; inset-block: 0.6rem; inset-inline-start: 0;
  width: 3px; border-radius: 0 3px 3px 0; background: #b9c3c1;
}
.visit-row.tone-awaiting_summary::before, .visit-row.tone-pending::before { background: #d6961e; }
.visit-row.tone-done::before, .visit-row.tone-confirmed::before { background: #1f8a7c; }
.visit-row.tone-missed::before, .visit-row.tone-cancelled::before { background: #c0392b; }
.visit-row.tone-scheduled.is-future::before, .visit-row.tone-contacted.is-future::before { background: var(--accent-strong); }
.visit-list > .visit-row.is-future { background: rgba(37, 145, 147, 0.035); }
.visit-row.tone-missed .visit-when, .visit-row.tone-cancelled .visit-when { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(30, 30, 30, 0.3); }

.visit-status i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.visit-status.is-paid { background: rgba(76, 175, 100, 0.16); color: #2e7d43; }
.visit-status.is-scheduled, .visit-status.is-contacted { background: var(--teal-10); color: var(--accent-strong); }

.visit-section {
  margin: 0; padding: 0.35rem 1rem;
  font-size: var(--fs-72); font-weight: 700; letter-spacing: 0.02em;
  color: var(--muted); background: rgba(30, 40, 38, 0.035);
  border-top: 1px solid rgba(30, 40, 38, 0.07);
}
.visit-list > .visit-section:first-child { border-top: 0; }
.visit-section + .visit-row { border-top: 1px solid rgba(30, 40, 38, 0.07) !important; }

.visit-group-meta { flex-wrap: wrap; justify-content: flex-end; gap: 0.35rem; }
.visit-group-meta > span + span::before { content: none; }
.visit-chip { padding: 0.1rem 0.55rem; border-radius: 0.45rem; font-size: var(--fs-76); font-weight: 600; background: rgba(30, 40, 38, 0.06); color: rgba(30, 30, 30, 0.7); }
.visit-group-meta > .visit-chip:first-child { color: inherit; }
.visit-chip.is-upcoming { background: var(--teal-10); color: var(--accent-strong) !important; }
.visit-chip.is-owed { background: rgba(214, 150, 30, 0.15); color: #8a5a07 !important; }
.visit-group-last { font-size: var(--fs-78); color: var(--muted); margin-inline-start: 0.25rem; }
.visit-row:not(.is-future) .visit-status.is-scheduled { background: rgba(75, 93, 90, 0.08); color: #6b7876; }
/* Status colour as the row's own right edge, full height. */
.visit-list > .visit-row::before { content: none; }
.visit-list > .visit-row { border-inline-start: 3px solid #c5cdcb; }
.visit-list > .visit-row.tone-awaiting_summary, .visit-list > .visit-row.tone-pending { border-inline-start-color: #d6961e; }
.visit-list > .visit-row.tone-done, .visit-list > .visit-row.tone-confirmed { border-inline-start-color: #1f8a7c; }
.visit-list > .visit-row.tone-missed, .visit-list > .visit-row.tone-cancelled { border-inline-start-color: #c0392b; }
.visit-list > .visit-row.is-future.tone-scheduled, .visit-list > .visit-row.is-future.tone-contacted { border-inline-start-color: var(--accent-strong); }

/* Counselor calendar: session popup */
.cs-box.cal-modal-box { width: min(620px, 100%); }
.cs-head { align-items: flex-start; gap: 1rem; padding-bottom: 0.8rem; margin-bottom: 0.9rem; border-bottom: 1px solid rgba(30, 40, 38, 0.08); }
.cs-head-main { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; }
.cs-name { font-size: var(--fs-120); font-weight: 700; color: var(--text); line-height: 1.4; }
a.cs-name:hover { color: var(--accent-strong); }
.cs-facts { display: flex; flex-wrap: wrap; align-items: center; gap: 0.1rem 0.4rem; font-size: var(--fs-85); color: var(--muted); }
.cs-facts strong { color: var(--text); font-weight: 600; }
.cs-dot { opacity: 0.5; }
.cs-when { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0 0 0.85rem; border: 1px solid rgba(30, 40, 38, 0.1); border-radius: 0.7rem; overflow: hidden; }
.cs-when > div { padding: 0.55rem 0.8rem; min-width: 0; }
.cs-when > div + div { border-inline-start: 1px solid rgba(30, 40, 38, 0.1); }
.cs-when dt { font-size: var(--fs-74); color: var(--muted); }
.cs-when dd { margin: 0.1rem 0 0; font-size: var(--fs-92); font-weight: 600; font-variant-numeric: tabular-nums; }
.visit-status.is-past { background: rgba(75, 93, 90, 0.08); color: #6b7876; }
.cs-note { margin-bottom: 0.85rem; padding: 0.55rem 0.8rem; border-radius: var(--radius-sm2); background: rgba(214, 150, 30, 0.1); color: #6f4c0d; font-size: var(--fs-86); line-height: 1.75; }
.cs-note strong { display: block; font-size: var(--fs-74); margin-bottom: 0.1rem; }
.cs-block { padding: 0.8rem 0.9rem; border: 1px solid rgba(30, 40, 38, 0.1); border-radius: 0.7rem; margin-bottom: 0.7rem; }
.cs-block h4 { margin: 0 0 0.35rem; font-size: var(--fs-80); font-weight: 700; color: var(--accent-strong); }
.cs-record-text { margin: 0 0 0.5rem; font-size: var(--fs-90); line-height: 1.9; white-space: pre-line; color: var(--text); }
.cs-record-text.is-clamped { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.cs-hint { margin: 0 0 0.5rem; font-size: var(--fs-85); color: var(--muted); line-height: 1.8; }
.cs-block .cs-hint:last-child, .cs-block .cs-record-text:last-child { margin-bottom: 0; }
.cs-write { min-height: 38px; padding: 0 1rem; font-size: var(--fs-88); }
.cs-last-meta { font-size: var(--fs-78); color: var(--muted); margin-bottom: 0.25rem; }
.cs-more { font-size: var(--fs-82); color: var(--accent-strong); font-weight: 600; padding: 0; }
.cs-all { margin-bottom: 0.7rem; }
.cs-foot { display: flex; gap: 0.5rem; flex-wrap: wrap; padding-top: 0.2rem; }
@media (max-width: 560px) {
  .cs-when { grid-template-columns: 1fr 1fr; }
  .cs-when > div:nth-child(3) { grid-column: 1 / -1; border-inline-start: 0; border-top: 1px solid rgba(30, 40, 38, 0.1); }
  .cs-foot .doc-btn { flex: 1; }
}
.cs-write { margin-bottom: 0.7rem; }
.cs-foot { justify-content: center; gap: 0.6rem; padding-top: 0.35rem; }
.cs-foot-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
  min-height: 40px; padding: 0 1.1rem; border-radius: var(--radius-sm2);
  font-size: var(--fs-88); font-weight: 600; transition: background-color 0.15s ease, color 0.15s ease;
}
.cs-foot-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cs-foot-btn.is-solid { background: var(--accent-strong); color: #fff; }
.cs-foot-btn.is-solid:hover { background: #1d7a7c; }
.cs-foot-btn.is-soft { background: var(--teal-10); color: var(--accent-strong); }
.cs-foot-btn.is-soft:hover { background: var(--teal-18); }
.cs-foot-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 560px) { .cs-foot-btn { flex: 1; padding: 0 0.6rem; } }

/* Counselor home v2: next session, today | to-do, the week */
.cn-next {
  background: #fff; border: 1px solid rgba(30, 40, 38, 0.1); border-radius: 0.9rem;
  box-shadow: var(--staff-shadow); padding: 1.1rem 1.3rem;
  display: flex; flex-direction: column; gap: 0.45rem;
}
.cn-next-when { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.6rem; font-size: var(--fs-85); color: var(--muted); }
.cn-next-when > span + span::before { content: "·"; margin-inline-end: 0.6rem; opacity: 0.6; }
.cn-next-when > span:nth-child(3) { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.cn-next-label { color: var(--accent-strong); font-weight: 700; }
.cn-next-name { margin: 0; font-size: 1.4rem; font-weight: 700; line-height: 1.4; }
.cn-next-name a { color: var(--text); }
.cn-next-name a:hover { color: var(--accent-strong); }
.cn-next-meta { margin: 0; font-size: var(--fs-90); color: var(--muted); }
.cn-next-note { margin: 0; padding: 0.45rem 0.7rem; border-radius: 0.55rem; background: rgba(214, 150, 30, 0.1); color: #6f4c0d; font-size: var(--fs-86); line-height: 1.7; }
.cn-prev { padding: 0.6rem 0.8rem; border-radius: var(--radius-sm2); background: rgba(30, 40, 38, 0.03); border: 1px solid rgba(30, 40, 38, 0.08); }
.cn-prev-head { margin: 0 0 0.2rem; font-size: var(--fs-78); font-weight: 700; color: rgba(30, 30, 30, 0.7); display: flex; justify-content: space-between; gap: 0.5rem; }
.cn-prev-head .jdate { font-weight: 500; color: var(--muted); }
.cn-prev-text { margin: 0; font-size: var(--fs-88); line-height: 1.85; color: var(--text); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; }
.cn-next-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.25rem; }
.cn-empty-text { margin: 0; font-size: var(--fs-100); color: var(--muted); }

.cn-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 1.1rem; align-items: stretch; }
.cn-grid > .dash-card { display: flex; flex-direction: column; }

.cn-today { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.cn-today-row {
  display: grid; grid-template-columns: 3.4rem minmax(0, 1fr) auto; gap: 0.75rem; align-items: center;
  padding: 0.55rem 0.75rem; border-radius: var(--radius-sm2); color: var(--text);
  border: 1px solid rgba(30, 40, 38, 0.08);
}
.cn-today-row:hover { border-color: var(--teal-30); }
.cn-today-row.is-next { border-color: rgba(37, 145, 147, 0.45); background: var(--teal-06); }
.cn-today-row.is-past { opacity: 0.7; }
.cn-today-row.is-missed b { text-decoration: line-through; color: var(--muted); }
.cn-today-time { font-weight: 700; font-variant-numeric: tabular-nums; }
.cn-today-who { display: flex; flex-direction: column; min-width: 0; line-height: 1.5; }
.cn-today-who b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cn-today-who small { font-size: var(--fs-78); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cn-today-state { font-size: var(--fs-75); font-weight: 600; color: var(--muted); white-space: nowrap; }
.cn-today-row.is-next .cn-today-state { color: var(--accent-strong); }
.cn-today-row.is-missed .cn-today-state { color: #c0392b; }

.cn-owed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.cn-owed li { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.55rem 0; border-top: 1px solid rgba(30, 40, 38, 0.07); }
.cn-owed li:first-child { border-top: 0; padding-top: 0; }
.cn-owed-who { display: flex; flex-direction: column; min-width: 0; line-height: 1.5; }
.cn-owed-who b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cn-owed-who small { font-size: var(--fs-78); color: var(--muted); }
.cn-owed-btn { min-height: 36px; padding: 0 0.9rem; font-size: var(--fs-84); flex-shrink: 0; }
.cn-owed-btn.is-late { background: #b7790f; }
.cn-owed-btn.is-late:hover { background: #9c670c; }
.cn-unscheduled { margin: 0.75rem 0 0; font-size: var(--fs-82); color: var(--muted); }
.cn-unscheduled a { color: var(--accent-strong); font-weight: 600; }

.cn-week { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid rgba(30, 40, 38, 0.1); border-radius: 0.7rem; overflow: hidden; }
.cn-week li + li { border-inline-start: 1px solid rgba(30, 40, 38, 0.08); }
.cn-week-day { display: flex; flex-direction: column; gap: 0.05rem; padding: 0.6rem 0.7rem; color: var(--text); height: 100%; }
.cn-week-day:hover { background: var(--teal-04); }
.cn-week-name { font-size: var(--fs-82); font-weight: 600; }
.cn-week-date { font-size: var(--fs-72); color: var(--muted); }
.cn-week-count { margin-top: 0.35rem; font-size: var(--fs-82); color: var(--muted); }
.cn-week-day.has-sessions .cn-week-count { color: var(--accent-strong); font-weight: 700; }
.cn-week-day.is-today { background: var(--teal-07); }
.cn-week-day.is-today .cn-week-name { color: var(--accent-strong); }
.cn-week-day.is-off { background: rgba(30, 40, 38, 0.025); }
.cn-week-day.is-off .cn-week-name, .cn-week-day.is-off .cn-week-count { color: rgba(30, 30, 30, 0.4); }
.cn-month { margin: 0.75rem 0 0; display: flex; flex-wrap: wrap; gap: 0.2rem 0.9rem; font-size: var(--fs-84); color: var(--muted); }
.cn-month b { color: var(--text); font-weight: 700; }
.cn-sub-head { margin: 0.9rem 0 0.4rem; font-size: var(--fs-78); font-weight: 700; color: var(--muted); }

@media (max-width: 1100px) { .cn-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 720px) {
  .cn-next { padding: 1rem; }
  .cn-next-name { font-size: var(--fs-120); }
  .cn-next-actions .cs-foot-btn { flex: 1; }
  .cn-week { grid-template-columns: repeat(7, minmax(4.6rem, 1fr)); overflow-x: auto; }
  .cn-week-day { padding: 0.55rem 0.5rem; }
}
/* A row's ⋮ menu must sit above the rows after it: lift that row's action
   area while its menu is open (rows are linked, so actions carry z-index). */
.reservation-item-actions:has(.therapy-plan-menu-dropdown.open),
.reservation-item:has(.therapy-plan-menu-dropdown.open) { z-index: 40; }
.reservation-item:has(.therapy-plan-menu-dropdown.open) { position: relative; }

/* Reservations list grouped by day */
.list-day + .list-day { margin-top: 0.9rem; }
.list-day-head {
  display: flex; align-items: baseline; gap: 0.6rem;
  margin: 0 0 0.45rem; padding: 0.35rem 0.2rem;
  font-size: var(--fs-92); font-weight: 700; color: var(--text);
  border-bottom: 1px solid rgba(30, 40, 38, 0.1);
}
.list-day-head small { font-size: var(--fs-76); font-weight: 500; color: var(--muted); }
.list-day.is-waiting .list-day-head span { color: #8a5a07; }
.list-day .reservation-item + .reservation-item { margin-top: 0.4rem; }
.row-time { font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
/* Range tabs + «فیلتر» on one row; the button matches the tab track. */
.rf-range-row { width: 100%; }
.rf-open-btn {
  margin-inline-start: auto;
  display: inline-flex; align-items: center; gap: 0.4rem;
  height: 38px; padding: 0 0.9rem;
  border-radius: 0.65rem;
  background: rgba(30, 40, 38, 0.06);
  color: rgba(30, 30, 30, 0.75);
  font: inherit; font-size: var(--fs-86); font-weight: 600;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.rf-open-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; }
.rf-open-btn:hover { background: rgba(30, 40, 38, 0.1); color: var(--text); }
.rf-open-btn:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 2px; }
.rf-open-btn .rf-badge { margin: 0; }
.rf-range-row:has(.rf-badge:not([hidden])) .rf-open-btn,
.ul-head-actions .rf-open-btn:has(.rf-badge:not([hidden])) { background: var(--teal-12); color: var(--accent-strong); }

/* Top bar and content share one column: the content runs the full width of
   the main column, so the cards' far edge lines up with the search box's. */
.staff-body { --staff-gutter: 1.5rem; }
.staff-content { max-width: none; padding-inline: var(--staff-gutter); }
.staff-topbar { padding-inline: var(--staff-gutter); }
@media (max-width: 720px) {
  .staff-body { --staff-gutter: 1rem; }
  .staff-content { padding-inline: var(--staff-gutter); }
}

/* Reception home: clock + shortcuts, schedule line, month calendar */
.rd-top {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1.25rem; align-items: center;
  padding: 1rem 1.25rem; background: #fff;
  border: 1px solid var(--staff-line); border-radius: 0.9rem; box-shadow: var(--staff-shadow);
}
.rd-clock { display: flex; flex-direction: column; padding-inline-end: 1.25rem; border-inline-end: 1px solid var(--staff-line); min-width: 210px; }
.rd-clock-time { font-size: 2.4rem; font-weight: 700; line-height: 1.15; color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: 0.01em; }
.rd-clock-date { font-size: var(--fs-100); font-weight: 600; color: var(--accent-strong); }
.rd-clock-greg { font-size: var(--fs-78); color: var(--muted); }
.rd-shortcuts { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 0.5rem; }
.rd-short {
  position: relative;
  display: flex; flex-direction: column; align-items: flex-start; gap: 0.35rem;
  padding: 0.7rem 0.8rem; border-radius: 0.7rem;
  border: 1px solid var(--staff-line); background: rgba(30, 40, 38, 0.015);
  color: var(--text); font: inherit; font-size: var(--fs-88); font-weight: 600; text-align: start;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.rd-short svg { width: 22px; height: 22px; fill: none; stroke: var(--accent-strong); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.rd-short:hover { border-color: rgba(37, 145, 147, 0.35); background: var(--teal-04); }
.rd-short:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 2px; }
.rd-short.is-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.rd-short.is-primary svg { stroke: #fff; stroke-width: 2.2; }
.rd-short.is-primary:hover { background: #c9356f; }
.rd-short kbd { position: absolute; top: 0.6rem; inset-inline-end: 0.6rem; font: 600 0.7rem/1 ui-monospace, monospace; padding: 0.15rem 0.35rem; border-radius: 0.3rem; border: 1px solid var(--staff-line-strong); color: var(--muted); }
.rd-short-badge { position: absolute; top: 0.55rem; inset-inline-end: 0.6rem; min-width: 20px; height: 20px; padding: 0 5px; display: grid; place-items: center; border-radius: 99px; background: var(--accent); color: #fff; font-size: var(--fs-72); }

.rd-sched-title { display: flex; flex-direction: column; gap: 0.15rem; }
.rd-day-line { margin: 0; display: flex; flex-wrap: wrap; gap: 0.1rem 0.75rem; font-size: var(--fs-82); color: var(--muted); }
.rd-day-line b { color: var(--text); font-weight: 700; }
.rd-day-line .is-came b { color: var(--tone-came); }
.rd-day-line .is-missed b { color: var(--tone-missed); }
.rd-day-line .is-attention b { color: var(--tone-attention); }

.rd-cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.rd-cal-wd { text-align: center; font-size: var(--fs-72); font-weight: 600; color: var(--muted); padding-bottom: 0.2rem; }
.rd-cal-day {
  position: relative; aspect-ratio: 1 / 1; max-width: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border-radius: var(--radius-sm); font-size: var(--fs-85); font-weight: 500; color: var(--text); font-variant-numeric: tabular-nums;
}
.rd-cal-day:hover { background: var(--teal-08); }
.rd-cal-day small { font-size: 0.62rem; font-weight: 700; line-height: 1; color: var(--accent-strong); }
.rd-cal-day.has-sessions { background: var(--teal-06); }
.rd-cal-day.is-past { color: rgba(30, 30, 30, 0.45); }
.rd-cal-day.is-past small { color: rgba(37, 145, 147, 0.6); }
.rd-cal-day.is-friday, .rd-cal-day.is-holiday { color: #c0392b; }
.rd-cal-day.is-today { background: var(--accent-strong); color: #fff; font-weight: 700; }
.rd-cal-day.is-today small { color: rgba(255, 255, 255, 0.9); }
.rd-cal-hint { margin: 0.6rem 0 0; font-size: var(--fs-72); color: var(--muted); line-height: 1.7; }

@media (max-width: 1100px) {
  .rd-top { grid-template-columns: minmax(0, 1fr); }
  .rd-clock { border-inline-end: 0; padding-inline-end: 0; flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 0.2rem 0.8rem; }
}
@media (max-width: 720px) {
  .rd-top { padding: 0.9rem; gap: 0.75rem; }
  .rd-clock-time { font-size: 1.9rem; }
  .rd-shortcuts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rd-short { padding: 0.6rem; font-size: var(--fs-80); }
  .rd-short kbd { display: none; }
}
@media (min-width: 1101px) {
  .rd-shortcuts { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); grid-auto-flow: column; }
  .rd-short { padding: 0.65rem 0.7rem; font-size: var(--fs-85); }
}
/* «برنامه امروز»: state chips that also filter the list */
.rd-states { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.35rem; }
.rd-state {
  display: inline-flex; align-items: center; gap: 0.4rem;
  height: 30px; padding: 0 0.7rem; border-radius: 0.55rem;
  border: 1px solid transparent; font: inherit; font-size: var(--fs-80); font-weight: 600;
  background: rgba(30, 40, 38, 0.05); color: rgba(30, 30, 30, 0.75);
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.rd-state b { font-weight: 700; font-variant-numeric: tabular-nums; }
.rd-state.is-came { background: var(--tone-came-soft); color: var(--tone-came); }
.rd-state.is-missed { background: var(--tone-missed-soft); color: var(--tone-missed); }
.rd-state.is-unset { background: var(--tone-attention-soft); color: var(--tone-attention); }
.rd-state.is-ahead { background: var(--teal-10); color: var(--accent-strong); }
.rd-state:hover { filter: brightness(0.97); }
.rd-state.is-active { border-color: currentColor; box-shadow: 0 1px 2px rgba(25, 40, 38, 0.08); }
.rd-state.is-all.is-active { background: var(--text); color: #fff; border-color: var(--text); }
.rd-state:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 2px; }

/* «نیاز به اقدام» v2 */
.todo-card .todo-group + .todo-group { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--staff-line); }
.todo-group-head { display: flex; align-items: flex-start; gap: 0.6rem; }
.todo-icon { width: 32px; height: 32px; flex-shrink: 0; display: grid; place-items: center; border-radius: 0.55rem; }
.todo-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.todo-icon.is-attention { background: var(--tone-attention-soft); color: var(--tone-attention); }
.todo-icon.is-pink { background: rgba(222, 63, 130, 0.1); color: var(--accent); }
.todo-icon.is-teal { background: var(--teal-10); color: var(--accent-strong); }
.todo-group-title { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.5; }
.todo-group-title b { font-size: var(--fs-90); font-weight: 700; }
.todo-group-title small { font-size: var(--fs-74); color: var(--muted); }
.todo-pill { min-width: 26px; height: 24px; padding: 0 0.45rem; display: inline-grid; place-items: center; border-radius: 0.45rem; font-size: var(--fs-80); font-weight: 700; }
.todo-pill.is-attention { background: var(--tone-attention-soft); color: var(--tone-attention); }
.todo-pill.is-pink { background: rgba(222, 63, 130, 0.1); color: var(--accent); }
.todo-rows { list-style: none; margin: 0.55rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.3rem; }
.todo-row {
  display: flex; align-items: center; justify-content: space-between; gap: 0.6rem;
  padding: 0.45rem 0.6rem; border-radius: 0.55rem; background: rgba(30, 40, 38, 0.025);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.todo-row.is-done { opacity: 0; transform: translateX(-8px); }
.todo-row-main { min-width: 0; display: flex; flex-direction: column; line-height: 1.5; }
.todo-row-main b { font-size: var(--fs-86); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.todo-row-main small { font-size: var(--fs-74); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.todo-row .sched-quick-btn { padding: 0.22rem 0.6rem; font-size: var(--fs-78); }
.todo-row-actions { display: flex; align-items: center; gap: 0.3rem; flex-shrink: 0; }
.todo-open { padding: 0.25rem 0.65rem; border-radius: 0.45rem; font-size: var(--fs-78); font-weight: 600; background: var(--teal-10); color: var(--accent-strong); }
.todo-open:hover { background: var(--teal-18); }
.todo-more { display: inline-block; margin-top: 0.45rem; font-size: var(--fs-80); font-weight: 600; color: var(--accent-strong); }
.todo-clear { display: flex; align-items: center; gap: 0.6rem; padding: 0.6rem 0.75rem; border-radius: var(--radius-sm2); background: var(--tone-came-soft); color: var(--tone-came); }
.todo-clear svg { width: 22px; height: 22px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.todo-clear div { display: flex; flex-direction: column; line-height: 1.5; }
.todo-clear small { font-size: var(--fs-76); opacity: 0.85; }
@media (prefers-reduced-motion: reduce) { .todo-row { transition: none; } }

/* Phone popup (staff_shell.js): the number, large, with copy */
.phone-pop {
  position: fixed; z-index: 1300; min-width: 220px;
  padding: 0.75rem 0.85rem 0.7rem;
  background: #fff; border-radius: 0.8rem;
  box-shadow: 0 0 0 1px rgba(30, 40, 38, 0.1), 0 14px 36px rgba(25, 40, 38, 0.18);
  animation: staff-toast-in 0.15s ease-out;
}
.phone-pop-who { margin: 0 0 0.15rem; font-size: var(--fs-78); color: var(--muted); }
.phone-pop-number { margin: 0; font-size: 1.45rem; font-weight: 700; letter-spacing: 0.02em; color: var(--text); font-variant-numeric: tabular-nums; text-align: right; user-select: all; }
.phone-pop-actions { display: flex; align-items: center; gap: 0.4rem; margin-top: 0.55rem; }
.phone-pop-copy {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 0.35rem;
  height: 34px; border-radius: 0.55rem; background: var(--teal-10); color: var(--accent-strong);
  font: inherit; font-size: var(--fs-84); font-weight: 600;
}
.phone-pop-copy svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.phone-pop-copy:hover { background: var(--teal-18); }
.phone-pop-copy.is-done { background: var(--tone-came-soft, rgba(31, 138, 124, 0.12)); color: #1f8a7c; }
.phone-pop-close { width: 34px; height: 34px; border-radius: 0.55rem; font-size: var(--fs-120); color: var(--muted); }
.phone-pop-close:hover { background: rgba(30, 40, 38, 0.06); color: var(--text); }

/* Four-status buttons (partials/status_set.html) */
.status-set { display: inline-flex; flex-wrap: wrap; gap: 3px; padding: 3px; border-radius: var(--radius-sm2); background: rgba(30, 40, 38, 0.05); }
.status-set-btn {
  padding: 0.22rem 0.55rem; border-radius: 0.45rem;
  font: inherit; font-size: var(--fs-76); font-weight: 500; white-space: nowrap;
  color: rgba(30, 30, 30, 0.65); background: transparent;
  transition: background-color 0.12s ease, color 0.12s ease;
}
.status-set-btn:hover { background: rgba(255, 255, 255, 0.8); color: var(--text); }
.status-set-btn:disabled { opacity: 0.5; cursor: progress; }
.status-set-btn:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: -2px; }
.status-set-btn.is-current { font-weight: 700; box-shadow: 0 1px 2px rgba(25, 40, 38, 0.12); }
.status-set-btn.is-current.is-scheduled { background: #fff; color: var(--accent-strong); }
.status-set-btn.is-current.is-awaiting_summary { background: var(--tone-came); color: #fff; }
.status-set-btn.is-current.is-missed { background: var(--tone-missed); color: #fff; }
.status-set-btn.is-current.is-cancelled { background: #6b7876; color: #fff; }
.status-confirm {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin-top: 0.35rem;
  padding: 0.4rem 0.55rem; border-radius: 0.55rem;
  background: rgba(192, 57, 43, 0.07); color: #8f2a20; font-size: var(--fs-78);
}
.status-confirm span { flex: 1 1 160px; }
.status-confirm button { padding: 0.2rem 0.6rem; border-radius: var(--radius-2xs); font: inherit; font-size: var(--fs-78); font-weight: 600; }
.status-confirm-yes { background: #c0392b; color: #fff; }
.status-confirm-no { background: #fff; color: var(--text); box-shadow: inset 0 0 0 1px rgba(30, 40, 38, 0.15); }
.sched-status { flex-wrap: wrap; justify-content: flex-end; }
.sched-status .status-confirm { flex-basis: 100%; }
/* In the narrow «نیاز به اقدام» column the buttons go under the name */
.todo-row:has(.status-set) { flex-direction: column; align-items: stretch; gap: 0.4rem; }
.todo-row .status-set { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.todo-row .status-set-btn { text-align: center; }
/* status chips: same names/colours as the buttons */
.rd-state.is-scheduled { background: var(--teal-10); color: var(--accent-strong); }
.rd-state.is-awaiting_summary, .rd-state.is-done { background: var(--tone-came-soft); color: var(--tone-came); }
.rd-state.is-cancelled { background: rgba(75, 93, 90, 0.08); color: #4b5d5a; }
@media (max-width: 720px) {
  .sched-status .status-set { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .sched-side { flex-wrap: wrap; }
}
.sched-row > .status-confirm { grid-column: 1 / -1; margin-top: 0; }
/* Phone popup listing every number on file */
.phone-pop.is-list { min-width: 280px; padding: 0.7rem 0.8rem 0.6rem; }
.phone-pop-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.4rem; }
.phone-pop-name { margin: 0; font-size: var(--fs-95); font-weight: 700; color: var(--text); }
.phone-pop.is-list .phone-pop-who { margin: 0; }
.phone-pop-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.phone-pop-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "label copy" "num copy"; gap: 0 0.6rem; align-items: center; padding: 0.45rem 0; border-top: 1px solid rgba(30, 40, 38, 0.08); }
.phone-pop-label { grid-area: label; font-size: var(--fs-74); color: var(--muted); }
.phone-pop-list .phone-pop-number { grid-area: num; font-size: var(--fs-120); text-align: right; }
.phone-pop-copy.is-small { grid-area: copy; flex: none; height: 32px; padding: 0 0.6rem; font-size: var(--fs-78); }


/* Reception's profile, edited in place (partials/user_profile_inline.html):
   the same boxes as the read view; the field inside is borderless and the
   box itself shows hover, focus and errors. */
.profile-inline .pi-box {
  display: flex; flex-direction: column; min-width: 0;
  padding: 0.5rem 0.8rem 0.55rem;
  border: 1px solid rgba(30, 40, 38, 0.1); border-radius: var(--radius-sm2);
  background: rgba(30, 40, 38, 0.02);
  cursor: text;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}
.profile-inline .pi-box.is-wide { grid-column: 1 / -1; }
.profile-inline .pi-box:hover { border-color: var(--teal-30); }
.profile-inline .pi-box:focus-within { border-color: var(--accent-strong); background: #fff; box-shadow: 0 0 0 3px var(--teal-12); }
.profile-inline .pi-box.has-error { border-color: rgba(192, 57, 43, 0.6); background: rgba(192, 57, 43, 0.03); }
.profile-inline .pi-label { font-size: var(--fs-74); color: var(--muted); line-height: 1.6; }
.profile-inline .pi-hint { font-size: 0.7rem; opacity: 0.8; }
.profile-inline .pi-input {
  width: 100%; min-height: 1.7em; margin: 0; padding: 0;
  border: 0; border-radius: 0; background: transparent; box-shadow: none; outline: none;
  font: inherit; font-size: var(--fs-92); line-height: 1.7; color: var(--text);
}
.profile-inline select.pi-input { cursor: pointer; -webkit-appearance: none; appearance: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%2394a19e'%3E%3Cpath fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z' clip-rule='evenodd'/%3E%3C/svg%3E") no-repeat left center / 14px;
  padding-inline-end: 1.2rem; }
.profile-inline textarea.pi-input { resize: vertical; }
.profile-inline .jdp-input { cursor: pointer; }
.profile-inline .form-error { font-size: var(--fs-74); margin-top: 0.15rem; }
.pi-foot { display: flex; align-items: center; gap: 0.75rem 1.25rem; flex-wrap: wrap; padding-top: 0.25rem; }
.pi-meta { display: flex; gap: 0.25rem 1rem; flex-wrap: wrap; font-size: var(--fs-80); color: var(--muted); margin-inline-end: auto; }
.pi-active { margin: 0; padding: 0.35rem 0.75rem; }
.pi-save { min-height: 42px; padding: 0 1.4rem; }
/* add-client uses the same form (#58): no account meta, so the buttons sit at the end */
.profile-inline.is-new .pi-foot { justify-content: flex-end; }
.pi-back { min-height: 42px; padding: 0 1rem; display: inline-flex; align-items: center; }
/* add-sibling: the family's fields are shown but belong to the family */
.profile-inline .pi-box:has(.pi-input:disabled) { background: var(--staff-ground, var(--surface)); }
.profile-inline .pi-input:disabled { color: var(--muted); cursor: not-allowed; opacity: 1; -webkit-text-fill-color: var(--muted); }
.profile-inline .family-suggest { grid-column: 1 / -1; margin-top: 0; }
@media (max-width: 720px) {
  .pi-foot { flex-direction: column; align-items: stretch; }
  .pi-save { width: 100%; }
}
/* Tablets / small laptops: the side cards sit two side by side under the
   schedule (a full-width month grid and to-do list read badly), and the
   shortcuts form two even rows of three. */
@media (min-width: 721px) and (max-width: 1100px) {
  .dash-side { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem; align-items: start; }
  .rd-shortcuts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
/* Side column: calendar + «فردا» are grouped; on a wide screen the group
   dissolves so the order reads calendar, «نیاز به اقدام», «فردا»; on a
   tablet the group is one column beside «نیاز به اقدام». */
.dash-side-col { display: contents; }
.dash-side-col > .rd-cal { order: 0; }
.dash-side > .todo-card { order: 1; }
.dash-side-col > section:not(.rd-cal) { order: 2; }
@media (min-width: 721px) and (max-width: 1100px) {
  .dash-side-col { display: flex; flex-direction: column; gap: 1.1rem; min-width: 0; }
}

/* ── #58 families: add-sibling banner, existing-number suggestion, family bar ── */
.family-add-banner {
  display: grid;
  gap: 0.2rem;
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm2);
  background: var(--teal-07);
  border: 1px solid var(--teal-18);
  font-size: var(--fs-90);
}

.family-add-banner span {
  color: var(--muted);
  font-size: var(--fs-84);
}

.family-suggest {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-top: 0.5rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm2);
  background: var(--teal-07);
  border: 1px solid var(--teal-18);
  font-size: var(--fs-84);
  line-height: 1.7;
  animation: cal-pop-in 0.18s ease-out;
}

.family-suggest[hidden] {
  display: none;
}

.family-suggest-text {
  flex: 1 1 14rem;
}

.family-suggest .button {
  padding: 0.35rem 0.85rem;
  font-size: var(--fs-82);
}

.family-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 1rem;
  padding: 0.8rem 0.9rem;
  border-radius: var(--radius-sm2);
  background: var(--staff-ground, var(--surface));
  border: 1px solid var(--staff-line, var(--border));
}

.family-bar-main {
  display: grid;
  gap: 0.45rem;
  min-width: 0;
}

.family-bar-label {
  color: var(--muted);
  font-size: var(--fs-80);
}

/* a sibling: the same pill as the search results, the whole chip opens them */
.family-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.family-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  max-width: 100%;
  min-height: 36px;
  padding-block: 0.2rem;
  padding-inline: 0.3rem 0.8rem;
  border: 1px solid var(--staff-line-strong, var(--border));
  border-radius: 0.55rem;
  background: var(--staff-surface, #fff);
  color: var(--text);
  font-size: var(--fs-86);
  font-weight: 600;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.family-chip:hover {
  border-color: var(--accent-strong);
  background: var(--staff-teal-soft, var(--teal-10));
}

.family-chip:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 2px;
}

.family-chip-avatar {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--staff-teal-soft, var(--teal-10));
  color: var(--accent-strong);
  font-size: var(--fs-80);
  font-weight: 700;
}

.family-chip-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.family-chip-case {
  flex-shrink: 0;
  color: var(--accent-strong);
  font-size: var(--fs-72);
  font-weight: 500;
}

.family-bar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.5rem;
}

/* the bar's buttons: card-action size (.dash-btn), with an icon */
.family-btn {
  gap: 0.4rem;
  min-height: 38px;
  padding: 0 0.95rem;
  font-size: var(--fs-85);
  cursor: pointer;
}

.family-btn svg {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.button.family-btn:not(.danger):not(.primary) {
  border: 1px solid var(--staff-line-strong, var(--border));
  background: var(--staff-surface, #fff);
  color: var(--accent-strong);
}

.button.family-btn:not(.danger):not(.primary):hover {
  transform: none;
  box-shadow: none;
  border-color: var(--accent-strong);
  background: var(--staff-teal-soft, var(--teal-10));
}

.button.danger.family-btn:hover {
  transform: none;
  box-shadow: none;
}

.family-detach {
  position: relative;
}

.family-detach summary {
  list-style: none;
}

.family-detach summary::-webkit-details-marker {
  display: none;
}

.family-detach[open] > summary {
  background: rgba(180, 40, 40, 0.09);
}

/* floats under its button so opening it never moves the bar */
.family-detach-confirm {
  position: absolute;
  top: calc(100% + 0.4rem);
  inset-inline-end: 0;
  z-index: 20;
  display: grid;
  gap: 0.6rem;
  width: min(22rem, calc(100vw - 2.5rem));
  box-shadow: 0 12px 32px rgba(25, 40, 38, 0.14);
  padding: 0.75rem 0.85rem;
  border-radius: 0.8rem;
  border: 1px solid rgba(180, 40, 40, 0.18);
  background: var(--staff-surface, #fff);
  font-size: var(--fs-82);
  line-height: 1.8;
  animation: cal-pop-in 0.18s ease-out;
}

.family-detach-confirm p {
  margin: 0;
}

/* phone: the buttons stack, so the confirm spans their column instead */
@media (max-width: 640px) {
  .family-bar-actions {
    position: relative;
  }

  .family-detach {
    position: static;
  }

  .family-detach-confirm {
    inset-inline: 0;
    width: auto;
  }
}

.family-detach-actions {
  display: flex;
  gap: 0.4rem;
}


/* #58: «۲ فرزند» beside the file number in client lists */
.cl-family {
  color: var(--muted);
  background: var(--teal-07);
}

.client-card-siblings a {
  color: var(--accent-strong);
  font-weight: 600;
}

.button.primary.family-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.family-join-form .form-label {
  margin: 0;
}

.family-join-result {
  color: var(--muted);
}

.family-join-result.is-found {
  color: var(--accent-strong);
  font-weight: 600;
}

.family-join-form {
  border-color: var(--staff-line-strong, var(--border));
}

/* Website bookings drawn inside the session calendar (reception) */
.cal-res-tag { flex-shrink: 0; font-size: 0.68rem; font-weight: 600; color: var(--accent-strong); background: var(--teal-10); padding: 0.05rem 0.4rem; border-radius: 0.3rem; }
.cal-res-status { flex-shrink: 0; font-size: var(--fs-78); font-weight: 600; color: var(--status-color, var(--accent-strong)); padding: 0 0.5rem; }

/* Child's age worked out from the date of birth */
.profile-age { font-weight: 600; color: var(--accent-strong); }
.client-card-age { font-weight: 600; }

/* Calls to make: a normal dashboard card (todo icon, pill, rows), one slim row per request */
.call-strip { margin: 0; padding: 0.8rem 1.25rem 0.9rem; }
.call-strip-head { display: flex; align-items: center; flex-wrap: wrap; gap: 0.3rem 0.65rem; }
.call-strip-head h2 { margin: 0; font-size: var(--fs-95); font-weight: 700; color: var(--text); }
.call-strip-hint { font-size: var(--fs-76); color: var(--muted); }
.call-strip-all { margin-inline-start: auto; font-size: var(--fs-80); font-weight: 600; color: var(--accent-strong); }
.call-rows { margin-top: 0.6rem; gap: 0.25rem; }
.call-row-main { display: flex; align-items: center; flex-wrap: wrap; gap: 0 0.7rem; min-width: 0; }
.call-row-main b { font-size: var(--fs-88); font-weight: 600; }
.call-row-main small { font-size: var(--fs-76); color: var(--muted); }
.call-row-phone { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.25rem 0.7rem; border-radius: 0.45rem; font-size: var(--fs-78); font-weight: 600; background: var(--accent-strong); color: #fff; }
.call-row-phone svg { width: 0.9rem; height: 0.9rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 640px) { .call-strip-hint { display: none; } .call-row-main small { flex-basis: 100%; } }

/* ── Panel clients list (same family as the dashboard: dash-card, rd-state,
   sched-pill, sched-call) ─────────────────────────────────────────────── */
.ul-card { --ul-pad: 1.5rem; padding: 1.4rem var(--ul-pad) 0; }
.ul-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.ul-title { display: flex; align-items: baseline; gap: 0.7rem; min-width: 0; }
.ul-title h2 { margin: 0; font-size: 1.3rem; font-weight: 700; }
.ul-total { font-size: var(--fs-82); color: var(--muted); font-variant-numeric: tabular-nums; }
.ul-add { flex-direction: row; align-items: center; height: 40px; min-height: 40px; padding: 0 1rem; gap: 0.45rem; font-size: var(--fs-88); font-weight: 600; width: auto; }
.ul-add svg { width: 17px; height: 17px; }
.ul-tools { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; margin: 0 0 1.1rem; padding-top: 1.1rem; border-top: 1px solid var(--staff-line); }
.ul-search { flex: 1 1 16rem; min-width: 0; margin: 0; }
.ul-search input[type="search"] { height: 40px; min-height: 40px; padding-block: 0; font-size: var(--fs-88); border-radius: 0.65rem; }
.ul-dd { position: relative; }
.ul-dd-btn {
  display: inline-flex; align-items: center; gap: 0.45rem; height: 40px; padding-block: 0; padding-inline: 0.7rem 0.6rem;
  font: inherit; font-size: var(--fs-84); color: var(--text); white-space: nowrap;
  background: var(--staff-surface); border: 1px solid var(--staff-line-strong); border-radius: 0.65rem; cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.ul-dd-btn:hover, .ul-dd-btn[aria-expanded="true"] { border-color: rgba(37, 145, 147, 0.45); }
.ul-dd-btn:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 1px; }
.ul-dd-k { color: var(--muted); font-size: var(--fs-78); }
.ul-dd-v { font-weight: 600; max-width: 9rem; overflow: hidden; text-overflow: ellipsis; }
.ul-dd.is-set .ul-dd-btn { background: var(--teal-08); border-color: rgba(37, 145, 147, 0.35); }
.ul-dd.is-set .ul-dd-v { color: var(--accent-strong); }
.ul-dd-btn svg { width: 14px; height: 14px; fill: none; stroke: var(--muted); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.15s ease; }
.ul-dd-btn[aria-expanded="true"] svg { transform: rotate(180deg); stroke: var(--accent-strong); }
.ul-dd-menu {
  position: absolute; z-index: 30; top: calc(100% + 0.35rem); inset-inline-start: 0; min-width: 100%; width: max-content; max-width: 18rem;
  max-height: 20rem; overflow-y: auto; padding: 0.3rem;
  background: #fff; border-radius: var(--radius-md);
  box-shadow: var(--shadow-popover);
}
.ul-dd-menu[hidden] { display: none; }
.ul-dd-item {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; width: 100%; text-align: start;
  padding: 0.5rem 0.7rem; border: 0; border-radius: var(--radius-sm); background: none; font: inherit; font-size: var(--fs-85); color: var(--text); cursor: pointer;
}
.ul-dd-item:hover, .ul-dd-item:focus-visible { background: var(--teal-08); outline: 0; }
.ul-dd-item.is-selected { color: var(--accent-strong); font-weight: 600; }
.ul-dd-item.is-selected::after {
  content: ""; flex-shrink: 0; width: 14px; height: 14px; background: var(--accent-strong);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E") center / contain no-repeat;
}
.ul-chips { margin: 0 0 1.3rem; gap: 0.5rem; }
.ul-chips .rd-state { text-decoration: none; }
.ul-chips .rd-state.is-off { background: rgba(30, 40, 38, 0.05); color: var(--muted); }
.ul-chips .rd-state.is-family { background: rgba(222, 63, 130, 0.08); color: var(--accent); }
#users-list-container { margin: 0 calc(var(--ul-pad) * -1); transition: opacity 0.15s ease; }
#users-list-container.is-loading { opacity: 0.55; }
#users-list-container > .ul-chips { margin-inline: var(--ul-pad); }
#users-list-container > .empty-state,
#users-list-container > .pagination { margin-inline: var(--ul-pad); }
#users-list-container > .pagination { padding-bottom: 1rem; }
.ul-table { display: block; }
.ul-row {
  display: grid;
  grid-template-columns: minmax(0, 2.4fr) 5.2rem 8.6rem 9.5rem 6.6rem 5.4rem;
  gap: 0.9rem; align-items: center;
  padding: 0.7rem var(--ul-pad); border-top: 1px solid var(--staff-line);
  font-size: var(--fs-88); position: relative;
}
.ul-row:not(.ul-thead):hover { background: rgba(37, 145, 147, 0.035); }
.ul-row.is-off .ul-name { color: var(--muted); }
.ul-thead { padding-block: 0.5rem; background: rgba(30, 40, 38, 0.025); font-size: var(--fs-76); font-weight: 600; color: var(--muted); }
.ul-sort { display: inline-flex; align-items: center; gap: 0.25rem; color: inherit; }
.ul-sort:hover { color: var(--accent-strong); }
.ul-sort svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
.ul-sort:hover svg { opacity: 0.45; }
.ul-sort.is-sorted { color: var(--accent-strong); }
.ul-sort.is-sorted svg { opacity: 1; }
.ul-sort.is-asc svg { transform: rotate(180deg); }
.ul-who { display: flex; align-items: center; gap: 0.7rem; min-width: 0; }
.ul-avatar {
  flex-shrink: 0; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  background: var(--staff-pink-soft); color: var(--accent); font-weight: 700; font-size: var(--fs-90);
}
.ul-row.is-off .ul-avatar { background: rgba(30, 40, 38, 0.06); color: var(--muted); }
.ul-who-text { min-width: 0; display: flex; flex-direction: column; gap: 0.15rem; }
.ul-name { font-weight: 600; font-size: var(--fs-95); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ul-name:hover { color: var(--accent-strong); }
/* Every row is the same height whether or not it carries a sibling/status
   tag: tagged rows are exactly this tall (fixed tag line) and untagged rows
   get the same min-height with the name centred beside the avatar. */
.ul-row:not(.ul-thead) { min-height: 4.75rem; }
.ul-tags { display: flex; flex-wrap: nowrap; align-items: center; gap: 0.3rem; height: 1.5rem; overflow: hidden; }
.ul-tags:empty { display: none; }
.ul-case, .ul-phone, .ul-next, .ul-c-last { font-variant-numeric: tabular-nums; white-space: nowrap; }
.ul-muted { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ul-dash { color: rgba(30, 30, 30, 0.25); }
.ul-next .sched-pill.is-planned { background: var(--teal-10); color: var(--accent-strong); font-weight: 600; }
.ul-act { justify-content: flex-end; }
@media (max-width: 1000px) {
  .ul-c-last { display: none; }
  .ul-row { grid-template-columns: minmax(0, 2.2fr) 5rem 8.4rem 9.5rem 5.4rem; }
}
@media (max-width: 640px) {
  .ul-card { --ul-pad: 1rem; padding-top: 1rem; }
  .ul-head { margin-bottom: 0.9rem; }
  .ul-tools { padding-top: 0.9rem; margin-bottom: 0.9rem; }
  .ul-chips { margin-bottom: 1rem; }
  .ul-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .ul-chips .rd-state { flex-shrink: 0; }
  .ul-dd { flex: 1 1 8rem; }
  .ul-dd-btn { width: 100%; justify-content: space-between; }
  .ul-dd-btn .ul-dd-v { margin-inline-end: auto; }
  .ul-add span { display: none; }
  .ul-add { padding: 0; width: 40px; justify-content: center; }
  .cl-list { padding-inline: 1rem; }
}
.ul-tools .ul-search { width: auto; max-width: none; }
.ul-head-actions { display: flex; align-items: center; gap: 0.6rem; }
.ul-export {
  display: inline-flex; align-items: center; gap: 0.45rem; height: 40px; padding: 0 0.9rem;
  font-size: var(--fs-85); font-weight: 600; color: var(--text); white-space: nowrap;
  background: var(--staff-surface); border: 1px solid var(--staff-line-strong); border-radius: 0.65rem;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}
.ul-export svg { width: 20px; height: 20px; flex-shrink: 0; }
.ul-export:hover { border-color: rgba(37, 145, 147, 0.45); background: var(--teal-05); color: var(--accent-strong); }
.ul-export:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 1px; }
@media (max-width: 640px) {
  .ul-export span { display: none; }
  .ul-export { width: 40px; padding: 0; justify-content: center; }
}

/* ══════════════════════════════════════════════════════════════════
   Public site on phones (≤720px, the staff app's tab-bar breakpoint).
   Bottom tab bar «خدمات | رزرو نوبت | حساب من» like the staff app; the
   rest of the menu stays behind ☰. Markup: templates/base.html
   (block site_tabbar, emptied on staff pages and the test/intake flows).
   ══════════════════════════════════════════════════════════════════ */
.site-tabbar { display: none; }

@media (max-width: 720px) {
  :root { --site-tabbar-h: calc(62px + env(safe-area-inset-bottom, 0px)); }

  .site-tabbar {
    position: fixed;
    z-index: 90; /* under the header's menu (100/120) and every modal (1000+) */
    inset-inline: 0;
    bottom: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: center;
    padding: 0.3rem 0.75rem calc(0.3rem + env(safe-area-inset-bottom, 0px));
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 -1px 0 rgba(30, 30, 30, 0.08), 0 -6px 20px rgba(30, 30, 30, 0.04);
  }
  .site-tab {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: 54px;
    border-radius: var(--radius-md);
    font-size: var(--fs-74);
    font-weight: 500;
    line-height: 1.3;
    color: rgba(30, 30, 30, 0.6);
    -webkit-tap-highlight-color: transparent;
    transition: color 0.15s ease;
  }
  .site-tab svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 0.12s ease;
  }
  .site-tab:active svg { transform: scale(0.96); }
  .site-tab.is-active { color: var(--accent-strong); font-weight: 700; }
  .site-tab.is-active svg { stroke-width: 2; }
  .site-tab:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: -2px; }

  /* middle tab: the pink pill, soft at rest, solid while you're booking */
  .site-tab.is-home { color: var(--accent); font-weight: 600; }
  .site-tab-pill {
    display: grid;
    place-items: center;
    width: 58px;
    height: 32px;
    border-radius: var(--radius-pill);
    background: rgba(222, 63, 130, 0.12);
    transition: background-color 0.15s ease, transform 0.12s ease;
  }
  .site-tab.is-home:active .site-tab-pill { transform: scale(0.96); }
  .site-tab.is-home:active svg { transform: none; }
  .site-tab.is-home .site-tab-pill svg { stroke: var(--accent); stroke-width: 1.9; }
  .site-tab.is-home.is-active .site-tab-pill { background: var(--accent); }
  .site-tab.is-home.is-active .site-tab-pill svg { stroke: #fff; }

  /* the header keeps logo + ☰; login and the account button live in the tab bar */
  body:has(.site-tabbar) .nav-actions .user-account-link,
  body:has(.site-tabbar) .nav-actions .button-login { display: none; }

  /* nothing at the bottom of the page hides behind the bar */
  body:has(.site-tabbar) .site-footer { padding-bottom: var(--site-tabbar-h); }
  body:has(.site-tabbar) .footer-copy { padding-bottom: 1rem; }

  /* ── Booking popup opens as a bottom sheet ────────────────────── */
  .res-backdrop { align-items: flex-end; padding: 0; }
  .res-dialog { width: 100%; max-height: calc(100dvh - 2.5rem); }
  .res-dialog:focus { outline: none; }
  .res-box {
    border-radius: 1.35rem 1.35rem 0 0;
    border-bottom: 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    transform: translateY(24px);
  }
  .res-close {
    top: 0.7rem;
    left: 0.7rem;
    z-index: 2;
    width: 2.25rem;
    height: 2.25rem;
    background: rgba(30, 30, 30, 0.06);
    color: var(--text);
  }
  .res-close:hover { background: rgba(30, 30, 30, 0.1); }
}

@media (prefers-reduced-motion: reduce) {
  .site-tab, .site-tab svg, .site-tab-pill { transition: none; }
}

/* Family dashboard once it is one column (≤768px): bookings first, the
   profile card last, its buttons side by side. */
@media (max-width: 768px) {
  .dashboard-page .dashboard-layout { gap: 1rem; margin-top: 1rem; }
  .dashboard-page .dashboard-layout > aside { order: 2; }
  .dashboard-page .dashboard-main { order: 1; }
  .dashboard-page .profile-card-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 0.5rem; }
  .dashboard-page .profile-card-actions .logout-form { display: contents; }
  .dashboard-page .profile-card-actions > * { min-height: 44px; }
}

/* ══════════════════════════════════════════════════════════════════
   Phone polish (≤720px), round 2: one spacing rhythm, 44px+ tap sizes,
   card rows that scroll sideways instead of a 6000px home page, a clearer
   selected tab, a taller booking sheet.
   ══════════════════════════════════════════════════════════════════ */
@media (max-width: 720px) {
  /* public pages only: staff pages share the main stylesheet (static/css/site/) but have their own phone CSS */
  body:not(.staff-body) .container { width: calc(100% - 2.5rem); } /* 20px gutters */

  /* ── rhythm: sections 3.5rem apart, not 9rem ─────────────────── */
  body:not(.staff-body) .stack { gap: 1rem; margin-bottom: 3.5rem; }
  body:not(.staff-body) .page-hero { margin-bottom: 1.5rem; }
  body:not(.staff-body) .section-action-heading { align-items: center; }
  body:not(.staff-body) .section-action-heading h2 { font-size: var(--fs-120); margin: 0; text-wrap: balance; }

  /* ── buttons: 44px+ tall everywhere, 48px for the main action ── */
  body:not(.staff-body) .button { min-height: 44px; padding: 0.55rem 1.25rem; border-radius: 14px; }
  body:not(.staff-body) .button:active { transform: scale(0.96); }
  body:not(.staff-body) .button.primary { min-height: 48px; padding-inline: 1.5rem; }
  body:not(.staff-body) .section-more {
    min-height: 38px;
    padding: 0.35rem 0.85rem;
    border-radius: var(--radius-pill);
    background: var(--teal-08);
    color: var(--accent-strong);
    font-size: var(--fs-84);
    font-weight: 600;
  }
  body:not(.staff-body) .empty-state .button { width: 100%; max-width: 20rem; }

  /* dashboard cards: less inner padding so a booking's date stays on one line */
  .dashboard-page .dashboard-section { padding: 1.1rem 1rem; border-radius: 1.1rem; }
  .dashboard-page .reservation-item,
  .dashboard-page .test-item { padding: 0.8rem 0.85rem; gap: 0.6rem; border-radius: 0.8rem; }
  .dashboard-page .reservation-item-meta { font-size: var(--fs-80); }

  /* ── tab bar: every tab gets a pill slot; the selected one fills ── */
  .site-tab { color: rgba(30, 30, 30, 0.58); }
  .site-tab > svg {
    box-sizing: content-box;
    padding: 5px 18px;
    border-radius: var(--radius-pill);
    transition: background-color 0.15s ease, transform 0.12s ease;
  }
  .site-tab.is-active { color: var(--accent-strong); }
  .site-tab.is-active > svg { background: rgba(37, 145, 147, 0.13); stroke-width: 2.1; }
  .site-tab.is-home.is-active { color: var(--accent); }
  .site-tab-pill { width: 58px; height: 32px; }

  /* ── «ادامه متن» under a page summary ────────────────────────── */
  .page-summary-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    min-height: 36px;
    margin: 0.15rem 0 0;
    padding: 0.3rem 0.6rem 0.3rem 0.85rem;
    border-radius: var(--radius-pill);
    background: var(--teal-08);
    color: var(--accent-strong);
    font-size: var(--fs-85);
    font-weight: 600;
    justify-self: start;
    width: fit-content;
    transition: background-color 0.15s ease, transform 0.12s ease;
  }
  .page-summary-toggle svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 0.2s cubic-bezier(0.2, 0, 0, 1);
  }
  .page-summary-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
  .page-summary-toggle:active { transform: scale(0.96); }
  .page-hero .page-summary-toggle { background: rgba(255, 255, 255, 0.18); color: #fff; }
  .page-hero .page-summary { margin-bottom: 0; }

  /* ── list cards (services, blog, tests, counselors) ──────────── */
  .service-card-vertical,
  .counselor-card-vertical { border-radius: 1.1rem; }
  .blog-card-body,
  .service-card-body,
  .counselor-card-body { gap: 0.75rem; padding: 0.95rem 1rem 1rem; }
  .service-card-text p:empty,
  .blog-card-text p:empty { display: none; }
  .blog-card-footer,
  .service-card-footer,
  .counselor-card-footer { justify-content: space-between; }
  .button.service-card-more,
  .button.blog-card-more,
  .button.counselor-card-more,
  .service-card-more,
  .blog-card-more,
  .counselor-card-more {
    min-height: 42px;
    padding: 0.45rem 0.95rem 0.45rem 0.8rem;
    gap: 0.45rem;
    border-radius: 12px; /* card 1.1rem (≈18px) minus ~6px */
    background: var(--teal-08);
    color: var(--accent-strong);
    font-size: var(--fs-88);
    font-weight: 600;
  }
  .service-card-footer:has(> :only-child) .service-card-more,
  .blog-card-footer:has(> :only-child) .blog-card-more { width: 100%; justify-content: center; }

  /* ── home: card rows scroll sideways and snap ─────────────────── */
  .services-section .services-grid,
  .articles-section .articles-grid {
    direction: rtl;
    display: grid;
    grid-auto-flow: column;
    grid-template-columns: none;
    grid-template-areas: none;
    grid-auto-columns: 74%;
    gap: 0.75rem;
    margin-inline: -1.25rem;
    padding: 0.25rem 1.25rem 0.75rem;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 1.25rem;
    scrollbar-width: none;
  }
  .services-section .services-grid::-webkit-scrollbar,
  .articles-section .articles-grid::-webkit-scrollbar { display: none; }
  .services-section .service-tile,
  .articles-section .article-tile,
  .articles-section .article-tile-featured {
    grid-area: auto;
    aspect-ratio: 4 / 5;
    min-height: 0;
    scroll-snap-align: start;
    border-radius: 1.25rem;
    box-shadow: 0 10px 24px rgba(33, 50, 58, 0.08);
  }
  .services-section .service-tile:active,
  .articles-section .article-tile:active { transform: scale(0.98); }

  .how-we-work-panel { border-radius: 1.25rem; }
  .cta-card { padding: 2.25rem 1.25rem; border-radius: 1.25rem; }

  /* ── booking sheet: tall, actions pinned to its bottom ────────── */
  .res-dialog { max-height: calc(100dvh - 1.25rem); }
  .res-box { min-height: min(88dvh, 760px); padding-bottom: 0; } /* the pinned footer carries the safe area */
  .res-header { padding: 1.35rem 1.25rem 0; }
  .res-box::before {
    content: "";
    position: absolute;
    top: 0.5rem;
    left: 50%;
    width: 40px;
    height: 4px;
    margin-left: -20px;
    border-radius: var(--radius-pill);
    background: rgba(30, 30, 30, 0.14);
  }
  .res-body { flex: 1 0 auto; padding: 0 1.25rem 1.25rem; }
  .res-footer {
    position: sticky;
    bottom: 0;
    z-index: 1;
    margin-top: auto;
    padding: 0.85rem 1.25rem calc(0.85rem + env(safe-area-inset-bottom, 0px));
    background: rgba(255, 255, 255, 0.97);
  }
  .res-footer .button { flex: 1; min-height: 50px; }
}

@media (max-width: 720px) and (prefers-reduced-motion: reduce) {
  body:not(.staff-body) .button:active, .page-summary-toggle:active, .site-tab > svg,
  .services-section .service-tile:active, .articles-section .article-tile:active { transform: none; transition: none; }
}

/* ── Admin dashboard: «نیاز به اقدام» shows 5 per list, the rest open in place ── */
.todo-expand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  width: 100%;
  min-height: 40px;
  margin-top: 0.5rem;
  border-radius: var(--radius-sm2);
  background: var(--teal-07);
  color: var(--accent-strong);
  font-size: var(--fs-82);
  font-weight: 600;
  transition: background-color 0.15s ease, transform 0.12s ease;
}
.todo-expand:hover { background: var(--teal-12); }
.todo-expand:active { transform: scale(0.98); }
.todo-expand:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 2px; }
.todo-expand svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.2s cubic-bezier(0.2, 0, 0, 1);
}
.todo-expand[aria-expanded="true"] svg { transform: rotate(180deg); }
.todo-expand + .todo-more { display: block; text-align: center; }

/* «برنامه امروز» on laptops: as tall as the column beside it (never shorter
   than 26rem), so a quiet day leaves room inside the card, not a hole next to
   it; a busy day still grows it. */
@media (min-width: 1101px) {
  /* laptop layout: «برنامه امروز» | calendar + «فردا», then «نیاز به اقدام»
     full width with its lists side by side (it used to sit in the 340px
     column and made that column ~1200px tall beside a 2-row schedule) */
  .dash-grid:has(> .dash-side) { grid-template-areas: "sched side" "todo todo"; }
  .dash-grid > .dash-schedule { grid-area: sched; }
  .dash-grid > .dash-side { display: contents; }
  .dash-side > .dash-side-col { grid-area: side; display: flex; flex-direction: column; gap: 1.1rem; min-width: 0; }
  .dash-side > .todo-card { grid-area: todo; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 2.25rem; align-items: start; }
  .todo-card > .dash-card-head,
  .todo-card > .todo-clear { grid-column: 1 / -1; }
  .todo-card .todo-group + .todo-group { margin-top: 0; padding-top: 0; border-top: 0; }
  .todo-card .todo-group:only-of-type { grid-column: 1 / -1; }

  .dash-grid > .dash-schedule { align-self: stretch; display: flex; flex-direction: column; min-height: 26rem; }
  .dash-schedule > .dash-empty { flex: 1; justify-content: center; }
  .dash-schedule > .sched-list { flex: 0 0 auto; }
}
@media (prefers-reduced-motion: reduce) {
  .todo-expand, .todo-expand svg { transition: none; }
}
/* a lone card in an even 2-column row (e.g. no test results yet) takes the full width */
.dash-grid-even > :only-child { grid-column: 1 / -1; }
/* section titles in the family's own forms (profile, sign-up) read as headings;
   staff forms keep their quieter style */
body:not(.staff-body) .form-section-title { font-size: 0.98rem; font-weight: 700; color: var(--text); text-wrap: balance; }

/* «پرداخت آنلاین | دیروز، ۱۴:۳۰» on reservation rows: when the money came in.
   A hairline, not «·», between the two (a dot next to Persian digits reads as ۰). */
.visit-status.is-paid .paid-when {
  margin-inline-start: 0.1rem;
  padding-inline-start: 0.4rem;
  border-inline-start: 1px solid currentColor;
  border-color: rgba(46, 125, 67, 0.35);
  font-variant-numeric: tabular-nums;
}
@media (max-width: 640px) {
  .visit-status.is-paid .paid-online { display: none; }
}

/* Family dashboard: «جلسه‌های من» (R20) */
.family-next-session { margin-bottom: 0.9rem; }
.reservation-item.is-cancelled { opacity: 0.6; }
.family-sessions-past { margin-top: 0.8rem; }
.family-sessions-past > summary { cursor: pointer; font-weight: 600; font-size: var(--fs-90); padding: 0.5rem 0; color: var(--accent-strong); }
.family-sessions-past[open] > summary { margin-bottom: 0.4rem; }

/* Booking popup: inline step error and «بازگشت» (R21, R22) */
.res-step-error {
  margin: 0 1.5rem;
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-sm2);
  background: rgba(180, 40, 40, 0.08);
  color: var(--danger);
  font-size: var(--fs-88);
  font-weight: 500;
}
.res-step-error[hidden] { display: none; }
.res-footer .button-flat { min-width: 0; }

/* Counselor page: the pink booking card is for desktop; phones have «رزرو نوبت» in the tab bar (R48, open question 15) */
@media (max-width: 720px) {
  .counselor-cta-desktop { display: none; }
}

/* Calendar month that failed to load: a message and a retry, not an empty month (R50) */
.cal-load-error {
  grid-column: 1 / -1;
  display: flex; flex-direction: column; align-items: center; gap: 0.75rem;
  padding: 2.5rem 1rem; text-align: center; color: var(--danger);
}
.cal-load-error p { margin: 0; font-weight: 500; }

/* ══════════════════════════════════════════════════════════════════
   Admin lists (reservations, services, counselors, challenges, blog,
   test results): the same look as the clients list (.ul-*): one card,
   a header with the count and the main action, chip filters, a table
   with a column header on desktop, compact rows on phones. Each page
   sets its columns with --al-cols.
   ══════════════════════════════════════════════════════════════════ */
.al-body { margin: 0 calc(var(--ul-pad) * -1); }
.al-body > .empty-state, .al-body > .pagination { margin-inline: var(--ul-pad); }
.al-body > .pagination { padding-bottom: 1rem; }
.al-body > .empty-state { margin-block: 1rem 1.5rem; }
.al-row {
  display: grid; grid-template-columns: var(--al-cols); gap: 0.9rem; align-items: center;
  min-height: 4rem; padding: 0.65rem var(--ul-pad); border-top: 1px solid var(--staff-line);
  font-size: var(--fs-88); position: relative; background: var(--staff-surface, #fff);
}
.al-row:not(.al-thead):hover { background: rgba(37, 145, 147, 0.035); }
.al-thead { min-height: 0; padding-block: 0.5rem; background: rgba(30, 40, 38, 0.025); font-size: var(--fs-76); font-weight: 600; color: var(--muted); }
.al-row.is-off .ul-name { color: var(--muted); }
.al-row.is-off .ul-avatar, .al-row.is-off .al-thumb { opacity: 0.55; }
.al-group {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
  padding: 0.5rem var(--ul-pad); border-top: 1px solid var(--staff-line);
  background: var(--teal-05); color: var(--accent-strong); font-size: var(--fs-80); font-weight: 700;
}
.al-group small { color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.al-group.is-waiting { background: var(--tone-attention-soft); color: var(--tone-attention); }
.al-thumb { flex-shrink: 0; width: 36px; height: 36px; border-radius: var(--radius-sm2); overflow: hidden; background: var(--teal-08); }
.al-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.al-thumb.is-letter { display: grid; place-items: center; color: var(--accent-strong); font-weight: 700; font-size: var(--fs-90); }
.al-sub { font-size: var(--fs-78); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.al-time { font-weight: 700; font-variant-numeric: tabular-nums; }
.al-cell { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.al-cell.is-wrap { white-space: normal; }
.al-act { display: flex; align-items: center; justify-content: flex-end; gap: 0.35rem; }
.al-act .visit-status { flex-shrink: 0; }
.al-score { display: inline-grid; place-items: center; min-width: 2.2rem; height: 1.75rem; padding: 0 0.5rem; border-radius: var(--radius-sm); background: var(--teal-10); color: var(--accent-strong); font-weight: 700; font-variant-numeric: tabular-nums; }
.al-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 0 0 1.1rem; padding-top: 1.1rem; border-top: 1px solid var(--staff-line); }
.al-tools .rd-states { margin: 0; }
.al-tools .rd-state { text-decoration: none; }
.al-tools-end { margin-inline-start: auto; display: flex; align-items: center; gap: 0.5rem; }
.al-card-section + .al-card-section { margin-top: 1rem; }
.al-section-head { display: flex; align-items: baseline; gap: 0.6rem; padding: 0.9rem var(--ul-pad) 0.6rem; border-top: 1px solid var(--staff-line); font-size: var(--fs-95); font-weight: 700; }
.al-section-head small { color: var(--muted); font-weight: 500; font-size: var(--fs-78); }
.al-body > .al-section-head:first-child { border-top: 0; }
[data-sortable-list].al-sortable { display: block; gap: 0; }
.al-row .sortable-handle { margin-inline-end: -0.35rem; }
.ul-head-actions .button.secondary { height: 40px; min-height: 40px; padding: 0 0.9rem; font-size: var(--fs-85); display: inline-flex; align-items: center; }

/* The details line under the name is for phones; desktop has its own columns. */
.al-ph-line { display: none; }
/* Phones: no column header; name and a details line, then status and menu. */
@media (max-width: 640px) {
  .al-row.al-thead { display: none; }
  .al-row { grid-template-columns: minmax(0, 1fr) auto; gap: 0.6rem; min-height: 0; padding-block: 0.75rem; }
  .al-row > .al-cell { display: none; }
  .al-ph-line { display: block; font-size: var(--fs-78); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .al-ph-line .al-time { color: var(--text); }
  .al-tools { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .al-tools .rd-states { flex-wrap: nowrap; }
  .al-tools .rd-state, .al-tools .rf-open-btn { flex-shrink: 0; }
  .ul-head-actions .button.secondary span { display: none; }
}
.al-tag { font-size: var(--fs-72); color: var(--accent-strong); background: var(--teal-08); padding: 0 0.4rem; border-radius: 0.35rem; white-space: nowrap; }
.al-tag.is-pink { color: var(--accent); background: rgba(222, 63, 130, 0.08); }
.al-tag.is-muted { color: var(--muted); background: rgba(30, 40, 38, 0.05); }
/* A <details> version of the clients-list dropdown (no script needed). */
.al-dd > summary { list-style: none; cursor: pointer; }
.al-dd > summary::-webkit-details-marker { display: none; }
.al-dd[open] > summary { border-color: rgba(37, 145, 147, 0.45); }
.al-dd[open] > summary svg { transform: rotate(180deg); stroke: var(--accent-strong); }
.al-dd .ul-dd-v { max-width: 18rem; }
.al-dd .ul-dd-menu { max-height: 22rem; overflow-y: auto; min-width: 16rem; }
.al-dd .ul-dd-item { display: block; text-decoration: none; color: var(--text); }
