/* SBMCB — the dashboard
   Arrangement, not new components. The order down the page is the order a
   practitioner needs things in: who am I and what is today, what needs a
   decision, what is happening now, how the practice is trading, and only
   then the quieter record of what has already happened. */

.greeting { margin-bottom: var(--s5); }

.greeting-line {
  font-size: var(--fs-xl);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: var(--lh-tight);
}

.greeting-context {
  display: flex;
  align-items: center;
  gap: var(--s3);
  margin-top: var(--s2);
  flex-wrap: wrap;
  font-size: var(--fs-xs);
  color: var(--ink-2);
}

.greeting-date { color: var(--ink-2); }

.greeting-sep { color: var(--line-strong); }

.greeting-headline { color: var(--ink); font-weight: 500; }

/* ---- The headline row ---------------------------------------------------- */

.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--s4);
  margin-bottom: var(--s6);
}

/* ---- The working area ------------------------------------------------------ */

/* Today's diary and what needs attention sit side by side, because they are
   the two things the practitioner is deciding between all morning. */
.dash-main {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: var(--s4);
  align-items: start;
}

.dash-second {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: var(--s4);
  margin-top: var(--s4);
  align-items: start;
}

.dash-third {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s4);
  margin-top: var(--s4);
  align-items: start;
}

.stack { display: grid; gap: var(--s4); }

/* The timeline is the tallest thing on the page and the only one allowed to
   scroll inside itself. */
.timeline-scroll { max-height: 520px; overflow-y: auto; }

.day-summary {
  display: flex;
  gap: var(--s5);
  padding: var(--s3) var(--s4);
  border-bottom: 1px solid var(--line);
  background: var(--surface-inset);
}

.day-stat { font-size: var(--fs-xs); color: var(--ink-2); }
.day-stat-value { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }

/* ---- Practice performance ---------------------------------------------------- */

.perf-figures {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
}

.perf-figure {
  padding: var(--s3) var(--s4);
  border-right: 1px solid var(--line-faint);
}

.perf-figure:last-child { border-right: 0; }

.perf-label {
  font-size: var(--fs-micro);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.perf-value {
  margin-top: var(--s1);
  font-size: var(--fs-lg);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.perf-note { font-size: var(--fs-micro); color: var(--ink-3); }

/* ---- Page-level pieces used by the inner pages -------------------------------- */

.page-toolbar {
  display: flex;
  align-items: center;
  gap: var(--s3);
  margin-bottom: var(--s4);
  flex-wrap: wrap;
}

.page-toolbar .field { min-width: 220px; }

.week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.week-day { background: var(--surface); min-height: 150px; padding: var(--s2); }

.week-day--closed { background: var(--surface-2); }
.week-day--today { background: var(--accent-wash); }

.week-day-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--s2);
}

.week-day-name { font-size: var(--fs-micro); font-weight: 600; text-transform: uppercase;
                 letter-spacing: 0.08em; color: var(--ink-3); }

.week-day-date { font-size: var(--fs-xs); font-weight: 600; }

.week-slot {
  display: block;
  width: 100%;
  margin-bottom: 2px;
  padding: 2px var(--s2);
  background: var(--surface-2);
  border: 0;
  border-left: 2px solid var(--line-strong);
  border-radius: var(--radius-sm);
  text-align: left;
  font-size: var(--fs-micro);
  color: var(--ink-2);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.week-slot:hover { background: var(--surface-3); color: var(--ink); }

.week-slot--completed { border-left-color: var(--pos); }
.week-slot--confirmed { border-left-color: var(--accent); }
.week-slot--awaiting-payment { border-left-color: var(--warn); }
.week-slot--requires-action { border-left-color: var(--neg); }
.week-slot--cancelled { border-left-color: var(--line-strong); opacity: 0.5; }

/* ---- Settings ------------------------------------------------------------------ */

.setting {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: var(--s4);
  align-items: center;
  min-height: 48px;
  padding: var(--s3) var(--s4);
  border-bottom: 1px solid var(--line-faint);
}

.setting:last-child { border-bottom: 0; }
.setting-name { font-size: var(--fs-sm); font-weight: 500; }
.setting-note { font-size: var(--fs-xs); color: var(--ink-2); }
.setting-control { justify-self: end; }

@media (max-width: 1180px) {
  .kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-main, .dash-second { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 900px) {
  .kpi-row { grid-template-columns: minmax(0, 1fr); }
  .dash-third { grid-template-columns: minmax(0, 1fr); }
  .week { grid-template-columns: minmax(0, 1fr); }
  .greeting-line { font-size: var(--fs-lg); }
}

/* ---- Capacity room -------------------------------------------------------------
   The one 3D view. The canvas is a figure, so it sits on a plain surface with
   nothing around it competing for attention, and the flat grid below carries the
   same numbers for reading rather than for shape. */

.room-stage {
  display: grid;
  place-items: center;
  padding: var(--s4);
  background: var(--surface-inset);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}

.room-canvas { max-width: 100%; height: auto; cursor: grab; touch-action: none; }
.room-canvas:active { cursor: grabbing; }

.room-legend {
  display: flex;
  gap: var(--s4);
  padding: var(--s2) var(--s4);
  border-bottom: 1px solid var(--line);
  font-size: var(--fs-micro);
  color: var(--ink-2);
  flex-wrap: wrap;
}

.room-key { display: inline-flex; align-items: center; gap: var(--s2); }

.room-key-swatch {
  width: 10px; height: 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-3);
}

.room-grid { padding: var(--s4); overflow-x: auto; }

.room-grid-head,
.room-grid-row {
  display: grid;
  grid-template-columns: 96px repeat(7, minmax(52px, 1fr));
  gap: var(--s1);
  align-items: stretch;
}

.room-grid-row { margin-top: var(--s1); }

.room-grid-day {
  padding: var(--s1) 0;
  font-size: var(--fs-micro);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  text-align: center;
}

.room-grid-day--closed { color: var(--line-strong); }

.room-grid-name {
  display: flex;
  align-items: center;
  font-size: var(--fs-xs);
  color: var(--ink-2);
}

.room-grid-cell {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-height: 38px;
  padding-bottom: 2px;
  background: var(--surface-2);
  border: 1px solid var(--line-faint);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  color: var(--ink-2);
  overflow: hidden;
}

.room-grid-cell--closed { background: var(--surface-3); color: var(--line-strong); }

.room-grid-fill {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  background: var(--accent-wash);
  border-top: 1px solid var(--accent-line);
}
