/* =============================================================
   Malina — Components
   Buttons, pills, inputs, selects, switches, chips, tabs, popovers
   ============================================================= */

/* ------ BUTTONS ------ */
.btn {
  font-family: var(--font-body);
  font-weight: 600;
  line-height: 1;
  border: 1px solid transparent;
  cursor: pointer;
  border-radius: var(--radius-pill);
  display: inline-flex; align-items: center; justify-content: center;
  gap: 7px;
  white-space: nowrap;
  user-select: none;
  transition: background var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out);
}
.btn:focus-visible { outline: none; box-shadow: var(--ring-focus); }
.btn .lucide { width: 14px; height: 14px; }

.btn-sm { padding: 7px 14px; font-size: 12.5px; }
.btn-md { padding: 9px 16px; font-size: 13px; }
.btn-lg { padding: 11px 18px; font-size: 13.5px; }

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-primary:active { background: var(--accent-press); transform: scale(0.98); }

.btn-secondary {
  background: var(--bg-elev-1);
  color: var(--fg);
  border-color: var(--border-strong);
}
.btn-secondary:hover { background: var(--bg-elev-2); border-color: var(--accent-border); }
.btn-secondary:active { transform: scale(0.98); }

.btn-ghost {
  background: transparent;
  color: var(--fg-muted);
}
.btn-ghost:hover { background: var(--bg-elev-2); color: var(--fg); }

.btn-danger-outline {
  background: transparent;
  color: var(--danger);
  border-color: rgba(216, 117, 117, 0.32);
}
.btn-danger-outline:hover {
  background: var(--danger-tint);
  border-color: var(--danger);
}

.btn-success {
  background: var(--success);
  color: #082218;
  border-color: var(--success);
}
.btn-success:hover { background: #6fc298; }

/* ------ ICON BUTTON ------ */
.icon-btn {
  width: 36px; height: 36px;
  border-radius: var(--radius-pill);
  background: transparent;
  border: 1px solid var(--border);
  color: var(--fg-muted);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  position: relative;
  flex-shrink: 0;
  transition: all var(--dur-fast) var(--ease-out);
}
.icon-btn:hover { background: var(--bg-elev-2); color: var(--fg); border-color: var(--border-strong); }
.icon-btn .lucide { width: 16px; height: 16px; }
.icon-btn.sm { width: 28px; height: 28px; }
.icon-btn.sm .lucide { width: 14px; height: 14px; }
.icon-btn.nb { border: none; }
.icon-btn .notif-dot {
  position: absolute; top: 8px; right: 10px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--danger);
  border: 2px solid var(--bg-base);
}

/* ------ PILL ------ */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  font-size: 12.5px; font-weight: 600; line-height: 1;
  cursor: pointer;
  user-select: none;
  transition: all var(--dur-fast) var(--ease-out);
  white-space: nowrap;
}
.pill .lucide { width: 13px; height: 13px; }
.pill-soft {
  background: var(--accent-tint-2);
  color: var(--gold-200);
}
.pill-soft:hover { background: rgba(217, 179, 108, 0.26); color: var(--gold-100); }
.pill-outline {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--fg);
}
.pill-outline:hover { border-color: var(--accent-border); }
.pill-success {
  background: var(--success-tint);
  color: #A9D8BD;
}
.pill-info {
  background: var(--info-tint);
  color: #B7CFE7;
}
.pill-warning {
  background: var(--warning-tint);
  color: #E8C088;
}
.pill-danger {
  background: var(--danger-tint);
  color: #E89A9A;
}

/* date pill (used in topbar) */
.date-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  background: var(--bg-elev-1);
  border: 1px solid var(--border);
  color: var(--fg);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
}
.date-pill:hover { border-color: var(--accent-border); }
.date-pill .lucide { width: 14px; height: 14px; color: var(--fg-muted); }

/* ------ DATE NAVIGATOR ------
   Today + prev + date + next as one segmented control instead of four loose
   buttons. Desktop shows all four; mobile.css collapses the standalone Today
   button and promotes the label to the jump-to-today target. */
.date-nav {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  background: var(--bg-elev-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  flex-shrink: 0;
}
.date-nav-today,
.date-nav-arrow,
.date-nav .date-nav-label {
  background: transparent;
  border: none;
  border-radius: var(--radius-pill);
  color: var(--fg-muted);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}
.date-nav-today {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
}
.date-nav-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
}
.date-nav-arrow .lucide { width: 16px; height: 16px; }
.date-nav-today:hover,
.date-nav-arrow:hover { background: var(--bg-elev-3); color: var(--fg); }

/* The label sits inside the group, so it drops its own pill chrome. */
.date-nav .date-nav-label {
  padding: 6px 10px;
  font-weight: 600;
  white-space: nowrap;
  color: var(--fg);
}
.date-nav .date-nav-label:hover { background: var(--bg-elev-3); color: var(--fg); }

.date-nav-label .dn-text {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* "Today, " prefix — only meaningful when the standalone Today button is
   hidden, so it stays off until mobile.css opts in. */
.date-nav-label .dn-today,
.date-nav-label .dn-comma { display: none; }

/* ------ PHONE-ONLY CHROME ------
   The filters trigger and its bottom sheet exist in the markup at every width
   but only ever render on phones (mobile.css turns them on). Declaring the
   off state here means a desktop viewport never sees them even for the frame
   before mobile-layout.js runs. */
.schedule-filters-btn,
.filter-sheet,
.filter-sheet-backdrop { display: none; }

/* Language toggle slot in the drawer footer — empty (and invisible) on
   desktop, where the toggle stays in the global bar. */
.sb-lang:empty { display: none; }

/* Labels that only make sense once a control has been relocated into the
   mobile filters sheet, where icon-only buttons become full-width rows. */
.fs-only-label { display: none; }
.filter-sheet .fs-only-label { display: inline; }

/* ------ SEG TOGGLE ------ */
.seg {
  display: inline-flex;
  background: var(--bg-elev-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 3px;
  user-select: none;
}
.seg button {
  border: none; background: transparent;
  font: inherit; font-weight: 600; font-size: 13px;
  color: var(--fg-muted);
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
  white-space: nowrap;
}
.seg button:hover { color: var(--fg); }
.seg button.active {
  background: var(--accent);
  color: var(--accent-ink);
}

/* ------ STATUS DOT ------ */
.dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.dot.success { background: var(--success); box-shadow: 0 0 0 3px rgba(95, 181, 138, 0.18); }
.dot.warning { background: var(--warning); }
.dot.danger  { background: var(--danger); }
.dot.info    { background: var(--info); }
.dot.off     { background: var(--fg-dim); }

/* ------ ZOOM PILL ------ */
.zoom-pill {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--bg-elev-1);
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--fg-muted);
  user-select: none;
}
.zoom-pill .track {
  width: 80px; height: 4px;
  border-radius: var(--radius-pill);
  background: var(--bg-inset);
  position: relative;
}
.zoom-pill .knob {
  position: absolute;
  top: -3px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
  cursor: grab;
  box-shadow: 0 0 0 3px rgba(217, 179, 108, 0.18);
}
.zoom-pill .val {
  color: var(--accent);
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

/* ------ AVATAR ------ */
.av {
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
  letter-spacing: 0;
  user-select: none;
  text-transform: uppercase;
}

/* ------ INPUT (text) ------ */
.input {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 0 14px;
  height: 38px;
  transition: border-color var(--dur-fast) var(--ease-out),
              background var(--dur-fast) var(--ease-out);
}
.input:hover { border-color: var(--accent-border); }
.input:focus-within { border-color: var(--accent); background: var(--bg-elev-2); }
.input .lucide { width: 14px; height: 14px; color: var(--fg-dim); flex-shrink: 0; }
.input input,
.input select,
.input textarea {
  flex: 1; min-width: 0;
  background: transparent; border: none; outline: none;
  color: var(--fg); font: inherit; font-size: 13.5px;
  padding: 0;
  font-family: var(--font-body);
}
.input input::placeholder,
.input textarea::placeholder { color: var(--fg-dim); }
.input.is-mono input { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 13px; }
.input.tall { height: auto; min-height: 90px; padding: 12px 14px; align-items: flex-start; }
.input.tall textarea {
  resize: vertical; min-height: 64px;
  font-family: var(--font-body);
}
.input.full { width: 100%; }
.input.compact { height: 34px; padding: 0 12px; }

/* ------ SELECT (native styled) ------ */
.select {
  display: inline-flex; align-items: center; justify-content: space-between;
  gap: 10px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 0 12px 0 14px;
  height: 38px;
  color: var(--fg);
  font-size: 13.5px;
  cursor: pointer;
  position: relative;
  min-width: 160px;
  transition: border-color var(--dur-fast) var(--ease-out);
}
.select:hover { border-color: var(--accent-border); }
.select select {
  appearance: none; -webkit-appearance: none;
  background: transparent; border: none; outline: none;
  color: var(--fg); font: inherit; font-size: 13.5px;
  padding-right: 24px;
  cursor: pointer;
  flex: 1; min-width: 0;
}
.select .caret {
  position: absolute; right: 12px;
  pointer-events: none;
  width: 14px; height: 14px;
  color: var(--fg-muted);
}
.select option { background: var(--bg-elev-2); color: var(--fg); }

/* ------ FIELD ------ */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-label,
.eyebrow {
  font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.field-hint { font-size: 11.5px; color: var(--fg-dim); }
.field-error { font-size: 12px; color: var(--danger); }

/* Stacked time HH:MM input — used in NewAppt */
.time-stack {
  background: var(--bg-elev-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex; flex-direction: column; align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
.time-stack-row {
  display: flex; align-items: center; gap: 14px;
}
.time-stack-col { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.time-stack-btn {
  width: 28px; height: 18px;
  background: transparent; border: none;
  color: var(--fg-dim);
  cursor: pointer;
  border-radius: var(--radius-xs);
  display: flex; align-items: center; justify-content: center;
  transition: all var(--dur-fast) var(--ease-out);
}
.time-stack-btn:hover { color: var(--accent); background: var(--accent-tint); }
.time-stack-btn .lucide { width: 13px; height: 13px; }
.time-stack-val {
  font-size: 30px; font-weight: 500;
  color: var(--fg);
  letter-spacing: 0.04em;
  font-family: var(--font-display);
}
.time-stack-sep { font-size: 26px; color: var(--fg-muted); font-family: var(--font-display); }
.time-stack-end {
  font-size: 11px; color: var(--fg-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 2px;
  font-family: var(--font-body);
}
.time-stack-end b { color: var(--accent); font-weight: 600; letter-spacing: 0; font-family: var(--font-mono); }

/* ------ SWITCH ------ */
.switch {
  width: 38px; height: 22px;
  border-radius: var(--radius-pill);
  background: var(--bg-elev-3);
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--dur-fast) var(--ease-out);
  border: 1px solid transparent;
}
.switch .knob {
  position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--fg-muted);
  transition: all var(--dur-base) var(--ease-out);
}
.switch.on { background: var(--success-tint); border-color: rgba(95, 181, 138, 0.4); }
.switch.on .knob { left: 18px; background: var(--success); }
.switch.sm { width: 32px; height: 18px; }
.switch.sm .knob { width: 12px; height: 12px; }
.switch.sm.on .knob { left: 16px; }

/* ------ TOGGLE ROW (label + switch) ------ */
.toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out);
}
.toggle-row + .toggle-row { border-top: 1px solid var(--border-soft); }
.toggle-row:hover { background: var(--bg-elev-2); }
.toggle-row-text { min-width: 0; flex: 1; }
.toggle-row-label { font-size: 14px; font-weight: 600; color: var(--fg); }
.toggle-row-hint { font-size: 12px; color: var(--fg-muted); margin-top: 2px; }

/* ------ CHECKBOX ------ */
.checkbox {
  width: 18px; height: 18px;
  border-radius: var(--radius-xs);
  border: 1.5px solid var(--border-strong);
  background: var(--bg-elev-2);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--dur-fast) var(--ease-out);
}
.checkbox:hover { border-color: var(--accent-border); }
.checkbox.on { background: var(--accent); border-color: var(--accent); }
.checkbox.on::after {
  content: "";
  width: 9px; height: 5px;
  border-left: 2px solid var(--accent-ink);
  border-bottom: 2px solid var(--accent-ink);
  transform: rotate(-45deg) translate(1px, -1px);
}
.checkbox-row {
  display: inline-flex; align-items: center; gap: 8px;
  cursor: pointer; user-select: none;
  font-size: 13px; color: var(--fg);
}

/* ------ RADIO ------ */
.radio {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  background: var(--bg-elev-2);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--dur-fast) var(--ease-out);
}
.radio.on { border-color: var(--accent); }
.radio.on::after {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
}
.radio-row {
  display: inline-flex; align-items: center; gap: 8px;
  cursor: pointer; user-select: none;
  font-size: 13px; color: var(--fg);
}

/* ------ BANNER (info / success) ------ */
.banner {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  border: 1px solid transparent;
}
.banner .lucide { width: 16px; height: 16px; flex-shrink: 0; }
.banner-success {
  background: var(--success-tint);
  border-color: rgba(95, 181, 138, 0.28);
  color: #A9D8BD;
}
.banner-info {
  background: var(--info-tint);
  border-color: rgba(123, 168, 217, 0.22);
  color: #B7CFE7;
}
.banner-warning {
  background: var(--warning-tint);
  border-color: rgba(224, 163, 92, 0.28);
  color: #E8C088;
}

/* ------ STATUS CHIPS (table cells) ------ */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.55;
}
.chip-success { background: var(--success-tint); color: #A9D8BD; }
.chip-info    { background: var(--info-tint);    color: #B7CFE7; }
.chip-warning { background: var(--warning-tint); color: #E8C088; }
.chip-danger  { background: var(--danger-tint);  color: #E89A9A; }
.chip-muted   { background: rgba(255,255,255,0.04); color: var(--fg-dim); }
.chip-gold    { background: var(--accent-tint);  color: var(--gold-200); }

/* ------ TABS ------ */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border-soft);
  padding: 0 4px;
}
.tab {
  position: relative;
  padding: 12px 16px;
  font-size: 13.5px; font-weight: 600;
  color: var(--fg-muted);
  cursor: pointer;
  border: none; background: transparent;
  display: inline-flex; align-items: center; gap: 7px;
  transition: color var(--dur-fast) var(--ease-out);
  font-family: var(--font-body);
}
.tab:hover { color: var(--fg); }
.tab.active { color: var(--accent); }
.tab.active::after {
  content: "";
  position: absolute;
  left: 10px; right: 10px;
  bottom: -1px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}
.tab .count {
  font-size: 11px;
  background: var(--bg-elev-2);
  color: var(--fg-muted);
  border-radius: var(--radius-pill);
  padding: 1px 7px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.tab.active .count {
  background: var(--accent-tint-2);
  color: var(--accent);
}

/* ------ FILTER TABS (rounded "All / New / Returning" style) ------ */
.filter-tabs {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--bg-elev-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 4px;
}
.filter-tab {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 13px; font-weight: 600;
  color: var(--fg-muted);
  cursor: pointer;
  border: none; background: transparent;
  transition: all var(--dur-fast) var(--ease-out);
}
.filter-tab:hover { color: var(--fg); }
.filter-tab.active {
  background: var(--accent-tint);
  color: var(--accent);
}
.filter-tab .count {
  font-size: 11px;
  background: var(--bg-elev-3);
  color: var(--fg-muted);
  border-radius: var(--radius-pill);
  padding: 1px 7px;
  font-weight: 700;
}
.filter-tab.active .count {
  background: var(--accent-tint-2);
  color: var(--accent);
}

/* ------ POPOVER ------ */
.popover {
  position: absolute;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop);
  z-index: 100;
  min-width: 200px;
  padding: 6px;
  animation: pop-in var(--dur-base) var(--ease-out);
}
@keyframes pop-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.popover-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  font-size: 13px; color: var(--fg);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out);
}
.popover-item:hover { background: var(--bg-elev-3); }
.popover-item .lucide { width: 15px; height: 15px; color: var(--fg-muted); }
.popover-divider { height: 1px; background: var(--border-soft); margin: 4px 8px; }
.popover-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px 6px;
  font-family: var(--font-display);
  font-size: 16px; font-weight: 500;
}
.popover-header .meta {
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--fg-muted);
  font-weight: 400;
}

/* ------ Color swatches (for picker) ------ */
.swatch-row { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch {
  width: 28px; height: 28px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
  background-clip: padding-box;
}
.swatch:hover { transform: scale(1.08); }
.swatch.on { border-color: var(--fg); }
.swatch.rainbow {
  background: conic-gradient(from 0deg, #ef4444, #f97316, #eab308, #22c55e, #06b6d4, #6366f1, #a855f7, #ec4899, #ef4444);
}

/* ------ TABLES ------ */
.table {
  background: var(--bg-elev-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  overflow: hidden;
}
.table table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left;
  padding: 14px 22px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-muted);
  border-bottom: 1px solid var(--border);
  background: var(--bg-elev-1);
  white-space: nowrap;
}
.table td {
  padding: 14px 22px;
  font-size: 13.5px;
  color: var(--fg);
  border-top: 1px solid var(--border-soft);
  vertical-align: middle;
}
.table tbody tr {
  transition: background var(--dur-fast) var(--ease-out);
}
.table tbody tr:hover td { background: rgba(217, 179, 108, 0.035); }
.table tbody tr:hover td:first-child { box-shadow: inset 2px 0 0 var(--accent); }
.table .num { font-variant-numeric: tabular-nums; }
.table .name-cell { display: flex; align-items: center; gap: 12px; }
.table .name-cell .sub { font-size: 12px; color: var(--fg-muted); margin-top: 2px; }
.table .accent { color: var(--accent); font-weight: 600; }
.table .muted-cell { color: var(--fg-muted); }
.table .row-actions { display: flex; gap: 4px; justify-content: flex-end; }
.table .row-num {
  font-variant-numeric: tabular-nums;
  color: var(--fg-dim);
  font-size: 12px;
  font-weight: 600;
}
.table .delta-pos { color: var(--success); }
.table .delta-neg { color: var(--danger); }

/* dashed row separator variant */
.table.bare {
  background: transparent;
  border: none;
  border-radius: 0;
}
.table.bare table { background: transparent; }
.table.bare th { background: transparent; }

/* ------ STAT CARDS ------ */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.stat-card {
  background: var(--bg-elev-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px 14px;
  display: flex; flex-direction: column; gap: 4px;
  position: relative;
  overflow: hidden;
  transition: border-color var(--dur-fast) var(--ease-out);
}
.stat-card:hover { border-color: var(--accent-border); }
.stat-card .label {
  font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.stat-card .value {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 30px;
  letter-spacing: -0.01em;
  color: var(--fg);
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}
.stat-card .value.accent { color: var(--accent); font-style: italic; }
.stat-card .delta {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px; font-weight: 600;
  margin-top: 6px;
}
.stat-card .delta.pos { color: var(--success); }
.stat-card .delta.neg { color: var(--danger); }

/* ------ CARDS / PANELS ------ */
.panel {
  background: var(--bg-elev-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  padding: 24px;
}
.panel-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 18px;
}
.panel-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 22px;
  letter-spacing: -0.005em;
}
.panel-sub { font-size: 12px; color: var(--fg-muted); margin-top: 4px; }

/* ------ BREADCRUMB ------ */
.crumbs {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px;
  color: var(--fg-muted);
}
.crumbs .crumb-link {
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease-out);
}
.crumbs .crumb-link:hover { color: var(--fg); }
.crumbs .sep { color: var(--fg-dim); }
.crumbs .crumb-current { color: var(--fg); }

/* ------ PAGE HEAD ------ */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 28px 32px 18px;
}
.page-head h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 38px;
  letter-spacing: -0.015em;
  color: var(--fg);
  margin: 0;
  line-height: 1.05;
}
.page-head .sub {
  font-size: 13px; color: var(--fg-muted);
  margin-top: 6px;
}
.page-head .actions { display: flex; align-items: center; gap: 8px; }

.page-body {
  padding: 0 32px 32px;
}

/* ============================================================
   LABELED DATE-RANGE PAIR (Upcoming / Expenses / Salary filters)
   Markup contract: .range-pair > label.range-fld > .range-lbl + input
   Desktop: compact inline fields; phone layout lives in mobile.css.
   ============================================================ */
.range-pair { display: inline-flex; align-items: flex-end; gap: 10px; }
.range-fld { display: inline-flex; flex-direction: column; gap: 3px; min-width: 0; }
.range-lbl {
  font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--fg-muted);
}

/* ── Trial lockout bar ───────────────────────────────────────────────────────
   Shown when a tenant's 14-day trial has expired (or the workspace was
   suspended). The server already refuses every write with 402; this is the
   permanent, non-dismissible explanation. See public/js/trial-guard.js. */
.trial-lock-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  background: #FBF1E2;
  border-top: 1px solid #E4C88F;
  color: #7A4E12;
  font-size: 13.5px;
  box-shadow: 0 -6px 18px rgba(44, 42, 38, 0.08);
}
.trial-lock-dot {
  flex-shrink: 0;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #C9922F;
}
.trial-lock-text { flex: 1; min-width: 0; }

/* Keep the bar from covering the last row of a scrolled list. */
body.is-trial-locked .content { padding-bottom: 56px; }

@media (max-width: 640px) {
  .trial-lock-bar { flex-wrap: wrap; gap: 8px; padding: 10px 14px; font-size: 12.5px; }
  .trial-lock-text { flex: 1 1 100%; }
  /* The bottom bar sits above the mobile tab bar, not under it. */
  body.is-trial-locked .content { padding-bottom: 104px; }
}
