/* ClinicFlow — LaunchForce working demo (med). Self-contained, no external assets. */

@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("/fonts/space-grotesk-var.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/inter-var.woff2") format("woff2");
}

:root {
  --bg: #f2f7f6;
  --surface: #ffffff;
  --surface-2: #f7fbfa;
  --ink: #102a2a;
  --ink-2: #33504f;
  --muted: #6b8583;
  --line: #e3eceb;
  --line-strong: #d2e0de;
  --teal: #0f766e;
  --teal-deep: #0b5f59;
  --teal-soft: #e6f3f1;
  --teal-soft-2: #d5ebe8;
  --blue: #0e7490;
  --blue-soft: #e4f2f7;
  --amber: #b45309;
  --amber-soft: #fdf1cf;
  --violet: #6d28d9;
  --violet-soft: #efe9fd;
  --green: #0a7d4f;
  --green-soft: #e5f4ec;
  --red: #b42318;
  --red-soft: #fdecea;
  --slate-soft: #eef2f4;
  --slate-ink: #475569;
  --shadow-sm: 0 1px 2px rgba(16, 42, 42, 0.05);
  --shadow-md: 0 10px 30px -18px rgba(16, 42, 42, 0.24), 0 2px 6px rgba(16, 42, 42, 0.04);
  --shadow-lg: 0 24px 60px -30px rgba(16, 42, 42, 0.35);
  --r-xs: 6px;
  --r-sm: 8px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 16px;
  --pad: clamp(16px, 2.4vw, 32px);
  --labbar-h: 48px;
  --sidebar-w: 240px;
  --font-sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --ease: cubic-bezier(0.2, 0.65, 0.25, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
p,
ul,
ol,
dl,
dd,
figure {
  margin: 0;
  padding: 0;
}

li {
  list-style: none;
}

button {
  font: inherit;
  color: inherit;
}

svg {
  display: block;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

.skip-link {
  position: fixed;
  top: -60px;
  left: 12px;
  z-index: 500;
  padding: 9px 14px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: top 0.18s var(--ease);
}

.skip-link:focus-visible {
  top: 8px;
}

body.no-scroll {
  overflow: hidden;
}

/* ---------- Shared LaunchForce lab bar ---------- */

.labbar {
  position: sticky;
  top: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: var(--labbar-h);
  padding: 0 20px;
  background: #141210;
  color: #f4f1e8;
}

.labbar-left,
.labbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.labbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.21em;
  text-transform: uppercase;
  white-space: nowrap;
}

.labbar-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f24700;
  flex: 0 0 auto;
}

.lab-tag {
  padding: 2px 6px;
  border: 1px solid rgba(244, 241, 232, 0.24);
  border-radius: 4px;
  color: rgba(244, 241, 232, 0.55);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.demo-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 11px;
  border-radius: 999px;
  background: #f24700;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  white-space: nowrap;
}

.labbar-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(244, 241, 232, 0.72);
  font-size: 12.5px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.18s var(--ease);
}

.labbar-back:hover {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.back-arrow {
  font-size: 14px;
  line-height: 1;
}

/* ---------- App shell ---------- */

.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  align-items: start;
}

.sidebar {
  position: sticky;
  top: var(--labbar-h);
  display: flex;
  flex-direction: column;
  gap: 26px;
  height: calc(100vh - var(--labbar-h));
  padding: 22px 16px 18px;
  border-right: 1px solid var(--line);
  background: var(--surface);
  overflow-y: auto;
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 6px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  text-decoration: none;
  border-radius: 8px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(150deg, #0f766e, #0e7490);
  color: #fff;
  box-shadow: 0 4px 12px -4px rgba(15, 118, 110, 0.65);
}

.brand-name {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.mobile-only {
  display: none;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 9px;
  background: none;
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 0.16s var(--ease), color 0.16s var(--ease);
}

.nav-item svg {
  color: var(--muted);
  transition: color 0.16s var(--ease);
}

.nav-item:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.nav-item.is-active {
  background: var(--teal-soft);
  color: var(--teal-deep);
  font-weight: 600;
}

.nav-item.is-active svg {
  color: var(--teal);
}

.nav-item.is-active::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -16px;
  width: 3px;
  height: 18px;
  border-radius: 0 3px 3px 0;
  background: var(--teal);
  transform: translateY(-50%);
}

.sidebar-foot {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: auto;
  padding: 14px 6px 0;
  border-top: 1px solid var(--line);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.user-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.user-info strong {
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-info span {
  font-size: 11px;
  color: var(--muted);
}

.reset-link {
  align-self: flex-start;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--line-strong);
  cursor: pointer;
  transition: color 0.16s var(--ease);
}

.reset-link:hover {
  color: var(--teal);
  text-decoration-color: currentColor;
}

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(150deg, #d8eeea, #bfe2dd);
  color: #0c5c56;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.avatar-user {
  background: linear-gradient(150deg, #0f766e, #0e7490);
  color: #fff;
}

.avatar-mp {
  background: linear-gradient(150deg, #d8eeea, #bde1dc);
  color: #0c5c56;
}

.avatar-er {
  background: linear-gradient(150deg, #dceff7, #c3e2ef);
  color: #0b5c73;
}

.avatar-jo {
  background: linear-gradient(150deg, #ece7fb, #dcd2f7);
  color: #54309c;
}

.avatar-xs {
  width: 22px;
  height: 22px;
  font-size: 9px;
}

.avatar-lg {
  width: 52px;
  height: 52px;
  font-size: 16px;
}

/* ---------- Main / header ---------- */

.main {
  min-width: 0;
}

.page {
  width: 100%;
  max-width: 1400px;
  padding: 26px var(--pad) 22px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.date-line {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #12a37a;
  box-shadow: 0 0 0 0 rgba(18, 163, 122, 0.45);
  animation: live-pulse 2.6s infinite;
}

@keyframes live-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(18, 163, 122, 0.4);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(18, 163, 122, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(18, 163, 122, 0);
  }
}

h1 {
  margin-top: 6px;
  font-family: var(--font-display);
  font-size: clamp(24px, 2.2vw, 30px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.page-sub {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12.5px;
}

.page-tools {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.filter {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}

.select-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 38px;
  padding: 0 32px 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.16s var(--ease), box-shadow 0.16s var(--ease);
}

select:hover {
  border-color: #b9cfcc;
}

select:focus-visible {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

.select-chevron {
  position: absolute;
  right: 10px;
  color: var(--muted);
  pointer-events: none;
}

input[type="text"],
input[type="search"] {
  width: 100%;
  height: 38px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  transition: border-color 0.16s var(--ease), box-shadow 0.16s var(--ease);
}

input::placeholder {
  color: #93a8a6;
}

input[type="text"]:focus-visible,
input[type="search"]:focus-visible {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.16s var(--ease), border-color 0.16s var(--ease), color 0.16s var(--ease), box-shadow 0.16s var(--ease), transform 0.1s var(--ease);
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--teal);
  color: #fff;
  box-shadow: 0 8px 18px -10px rgba(15, 118, 110, 0.75);
}

.btn-primary:hover {
  background: var(--teal-deep);
}

.btn-quiet {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--ink-2);
}

.btn-quiet:hover {
  background: var(--surface-2);
  border-color: #bdd1cf;
}

.btn-quiet:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---------- KPI row ---------- */

.kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.kpi {
  padding: 15px 16px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.kpi-label {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.kpi-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--teal-soft);
  color: var(--teal);
}

.kpi:nth-child(2) .kpi-icon {
  background: var(--blue-soft);
  color: var(--blue);
}

.kpi:nth-child(3) .kpi-icon {
  background: var(--amber-soft);
  color: var(--amber);
}

.kpi:nth-child(4) .kpi-icon {
  background: var(--green-soft);
  color: var(--green);
}

.kpi-value {
  margin-top: 9px;
  font-family: var(--font-display);
  font-size: 27px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.kpi-unit {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--muted);
}

.kpi-trend {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 9px;
  font-size: 11.5px;
  font-weight: 500;
}

.trend-up {
  color: var(--green);
}

.trend-down {
  color: var(--red);
}

.trend-flat {
  color: var(--muted);
}

/* ---------- Cards / columns ---------- */

.columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 336px;
  gap: 14px;
  align-items: start;
  margin-top: 14px;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 18px 13px;
}

.card-head h2 {
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.card-sub {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11.5px;
}

.rail {
  position: sticky;
  top: calc(var(--labbar-h) + 16px);
  display: grid;
  gap: 14px;
  min-width: 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
}

.pill-amber {
  background: var(--amber-soft);
  color: #92400e;
}

/* ---------- Schedule ---------- */

.search {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 190px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--surface);
  color: var(--muted);
  transition: border-color 0.16s var(--ease), box-shadow 0.16s var(--ease);
}

.search:focus-within {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.search input {
  height: 30px;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 12.5px;
}

.search input:focus-visible {
  outline: none;
  box-shadow: none;
}

.schedule-list {
  max-height: 584px;
  overflow-y: auto;
  border-top: 1px solid var(--line);
  scrollbar-width: thin;
  scrollbar-color: #cddfdc transparent;
}

.schedule-list::-webkit-scrollbar {
  width: 10px;
}

.schedule-list::-webkit-scrollbar-thumb {
  background: #cddfdc;
  border: 3px solid #fff;
  border-radius: 999px;
}

.schedule-list::-webkit-scrollbar-thumb:hover {
  background: #b3ceca;
}

.appt {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  border-top: 1px solid var(--line);
  transition: background 0.14s var(--ease);
}

.appt:first-child {
  border-top: 0;
}

.appt:hover {
  background: var(--surface-2);
}

.appt-open {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) 140px 104px;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 8px 11px 18px;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.appt-open:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: -2px;
}

.appt-time {
  display: flex;
  flex-direction: column;
  font-variant-numeric: tabular-nums;
}

.appt-time b {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.appt-time span {
  color: var(--muted);
  font-size: 10.5px;
}

.appt-patient {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.appt-name {
  overflow: hidden;
  font-size: 13.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.appt-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.visit-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 650;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.visit-new {
  background: var(--blue-soft);
  color: #0b5c73;
}

.visit-follow,
.visit-follow-up {
  background: var(--slate-soft);
  color: var(--slate-ink);
}

.visit-telehealth {
  background: var(--violet-soft);
  color: #5b21b6;
}

.appt-age {
  color: var(--muted);
}

.appt-provider {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
}

.status {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
  width: fit-content;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 650;
  white-space: nowrap;
}

.status::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex: 0 0 auto;
}

.status-scheduled {
  background: var(--slate-soft);
  color: var(--slate-ink);
}

.status-checked {
  background: var(--amber-soft);
  color: #92400e;
}

.status-roomed {
  background: var(--violet-soft);
  color: #5b21b6;
}

.status-done {
  background: var(--green-soft);
  color: var(--green);
}

.appt-action {
  height: 30px;
  margin-right: 16px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--teal-deep);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease);
}

.appt-action:hover {
  border-color: var(--teal);
  background: var(--teal-soft);
}

.appt-action.is-quiet {
  color: var(--muted);
}

.appt-action.is-quiet:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
  color: var(--ink-2);
}

.empty {
  padding: 26px 18px;
  color: var(--muted);
  font-size: 12.5px;
  text-align: center;
}

.empty-pad {
  padding: 6px 18px 18px;
  text-align: left;
}

/* ---------- Waiting room ---------- */

.waiting-list {
  border-top: 1px solid var(--line);
}

.wait-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 0 18px;
  border-top: 1px solid var(--line);
  transition: background 0.14s var(--ease);
}

.wait-row:first-child {
  border-top: 0;
}

.wait-row:hover {
  background: var(--surface-2);
}

.wait-open {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 11px 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.wait-open:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
  border-radius: 6px;
}

.wait-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.wait-name {
  overflow: hidden;
  font-size: 12.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wait-meta {
  color: var(--muted);
  font-size: 10.5px;
  white-space: nowrap;
}

.wait-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  flex: 0 0 auto;
}

.wait-time {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--amber-soft);
  color: #92400e;
  font-size: 10px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.wait-time.is-long {
  background: var(--red-soft);
  color: var(--red);
}

.mini-btn {
  padding: 1px 0;
  border: 0;
  background: none;
  color: var(--teal);
  font-size: 10.5px;
  font-weight: 650;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: var(--teal-soft-2);
}

.mini-btn:hover {
  text-decoration-color: currentColor;
}

/* ---------- Quick book ---------- */

.quick-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 2px 18px 18px;
}

.quick-slot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--surface);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}

.quick-slot:hover {
  border-color: var(--teal);
  background: var(--teal-soft);
}

.quick-time {
  font-size: 12.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.quick-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 10.5px;
}

.quick-plus {
  color: var(--teal);
}

/* ---------- Chart ---------- */

.chart-wrap {
  padding: 0 14px 12px;
}

.week-chart {
  width: 100%;
  height: auto;
}

.chart-grid {
  stroke: var(--line);
  stroke-dasharray: 3 4;
}

.chart-bar {
  fill: #cfe7e3;
  transition: fill 0.15s var(--ease);
  cursor: default;
}

.chart-bar.is-today {
  fill: var(--teal);
}

.chart-bar:hover {
  fill: var(--teal);
}

.chart-bar.is-today:hover {
  fill: var(--teal-deep);
}

.chart-label {
  fill: var(--muted);
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 600;
}

.chart-value {
  fill: var(--ink-2);
  font-family: var(--font-sans);
  font-size: 9.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.chart-value.is-today {
  fill: var(--teal-deep);
}

/* ---------- Footer ---------- */

.demo-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 22px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}

.demo-foot p {
  color: var(--muted);
  font-size: 11.5px;
}

.demo-foot .btn {
  height: 32px;
  font-size: 11.5px;
  color: var(--muted);
}

/* ---------- Overlays: modal + drawer ---------- */

.overlay {
  position: fixed;
  top: var(--labbar-h);
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 300;
  display: flex;
  background: rgba(16, 42, 42, 0.3);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.24s var(--ease);
}

.overlay.is-open {
  opacity: 1;
}

.overlay-modal {
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.overlay-drawer {
  justify-content: flex-end;
}

.modal {
  width: min(520px, 100%);
  max-height: calc(100vh - var(--labbar-h) - 40px);
  overflow-y: auto;
  border-radius: var(--r-xl);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  transform: translateY(12px) scale(0.99);
  transition: transform 0.24s var(--ease);
}

.overlay.is-open .modal {
  transform: none;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px 0;
}

.modal-eyebrow {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.modal-head h2 {
  margin-top: 5px;
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s var(--ease), color 0.15s var(--ease), border-color 0.15s var(--ease);
}

.icon-btn:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
  color: var(--ink);
}

#booking-form {
  padding: 4px 22px 22px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 14px;
}

.field > label,
.fieldset legend {
  padding: 0;
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 600;
}

.fieldset {
  margin: 14px 0 0;
  padding: 0;
  border: 0;
}

.fieldset legend {
  margin-bottom: 6px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.optional {
  color: var(--muted);
  font-weight: 400;
  font-size: 10.5px;
}

.field-error {
  margin-top: 1px;
  color: var(--red);
  font-size: 11px;
  font-weight: 500;
}

input[aria-invalid="true"] {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.1);
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-2);
}

.seg {
  position: relative;
  display: flex;
  min-width: 0;
}

.seg input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.seg span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 7px 4px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  text-align: center;
  transition: background 0.15s var(--ease), color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

.seg input:checked + span {
  background: var(--surface);
  color: var(--teal-deep);
  box-shadow: var(--shadow-sm);
}

.seg input:focus-visible + span {
  outline: 2px solid var(--teal);
  outline-offset: 1px;
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

/* Drawer */

.drawer {
  display: flex;
  flex-direction: column;
  width: min(460px, 100%);
  height: 100%;
  background: var(--surface);
  box-shadow: -24px 0 70px -40px rgba(16, 42, 42, 0.4);
  transform: translateX(100%);
  transition: transform 0.3s var(--ease);
}

.overlay.is-open .drawer {
  transform: none;
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--line);
}

.drawer-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px 24px;
  scrollbar-width: thin;
  scrollbar-color: #cddfdc transparent;
}

.drawer-foot {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.detail-head {
  display: flex;
  align-items: center;
  gap: 13px;
}

.detail-head h2 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.detail-sub {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.stepper {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 18px 0 4px;
  padding: 4px 0 10px;
}

.step {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}

.step::before {
  content: "";
  position: absolute;
  top: 10px;
  left: calc(50% + 15px);
  width: calc(100% - 30px);
  height: 2px;
  border-radius: 2px;
  background: var(--line);
}

.step:last-child::before {
  display: none;
}

.step.is-done::before {
  background: #a9d6d0;
}

.step-dot {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 700;
}

.step.is-done .step-dot {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}

.step.is-current .step-dot {
  border: 2px solid var(--teal);
  background: #fff;
  color: var(--teal-deep);
}

.step-label {
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.step.is-done .step-label,
.step.is-current .step-label {
  color: var(--ink-2);
}

.detail-section {
  margin-top: 18px;
}

.detail-section h3,
.drawer-scroll h3 {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.detail-section p {
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.55;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-2);
}

.detail-grid dt {
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.detail-grid dd {
  margin-top: 2px;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 600;
}

.vitals-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.vital {
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-2);
}

.vital-label {
  display: block;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.vital-value {
  display: block;
  margin-top: 3px;
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.vital-value.is-empty {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 500;
}

.note-block {
  padding: 12px 14px;
  border-left: 3px solid var(--teal-soft-2);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 12.5px;
  line-height: 1.55;
}

/* ---------- Toasts ---------- */

.toasts {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 400;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
}

body.layer-right .toasts {
  right: auto;
  left: 20px;
  align-items: flex-start;
}

.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: 340px;
  padding: 11px 14px;
  border-radius: var(--r-md);
  background: #0e2b29;
  color: #eefaf8;
  font-size: 12.5px;
  font-weight: 500;
  box-shadow: 0 16px 40px -18px rgba(0, 0, 0, 0.55);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.22s var(--ease), transform 0.22s var(--ease);
}

.toast.is-visible {
  opacity: 1;
  transform: none;
}

.toast svg {
  flex: 0 0 auto;
  color: #5eead4;
}

.toast.toast-warn svg {
  color: #fcd34d;
}

/* ---------- Responsive ---------- */

@media (max-width: 1180px) {
  .columns {
    grid-template-columns: minmax(0, 1fr);
  }

  .rail {
    position: static;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
  }

  .chart-wrap {
    padding-bottom: 8px;
  }
}

@media (max-width: 960px) {
  .app {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    position: static;
    height: auto;
    gap: 10px;
    padding: 12px 16px 10px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    overflow: visible;
  }

  .sidebar-head {
    padding: 0;
  }

  .mobile-only {
    display: inline-flex;
  }

  .brand-name {
    font-size: 16px;
  }

  .nav {
    flex-direction: row;
    gap: 4px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .nav-item {
    flex: 0 0 auto;
    width: auto;
    padding: 7px 11px;
    border-radius: 8px;
    font-size: 12.5px;
  }

  .nav-item.is-active::before {
    top: auto;
    bottom: -10px;
    left: 10px;
    right: 10px;
    width: auto;
    height: 3px;
    border-radius: 3px 3px 0 0;
    transform: none;
  }

  .sidebar-foot {
    display: none;
  }

  .page {
    padding-top: 20px;
  }

  .kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .kpi-value {
    font-size: 25px;
  }
}

@media (max-width: 760px) {
  .rail {
    grid-template-columns: minmax(0, 1fr);
  }

  .schedule-list {
    max-height: none;
  }

  .appt-open {
    grid-template-columns: 70px minmax(0, 1fr) auto;
    gap: 9px;
    padding: 10px 6px 10px 14px;
  }

  .appt-provider,
  .appt-age {
    display: none;
  }

  .appt-action {
    margin-right: 12px;
    height: 28px;
    padding: 0 9px;
    font-size: 11px;
  }

  .status {
    padding: 3px 8px;
    font-size: 10px;
  }

  .status::before {
    display: none;
  }

  .search {
    flex: 1;
    width: auto;
    min-width: 140px;
  }

  .page-tools {
    width: 100%;
  }

  .filter {
    flex: 1;
    min-width: 140px;
  }

  .page-tools .btn-primary {
    flex: 0 0 auto;
  }

  .toasts,
  body.layer-right .toasts {
    right: 12px;
    bottom: 12px;
    left: 12px;
    align-items: stretch;
  }

  .toast {
    max-width: none;
  }

  .drawer {
    width: 100%;
  }
}

@media (max-width: 540px) {
  .labbar {
    padding: 0 12px;
  }

  .labbar-left,
  .labbar-right {
    gap: 8px;
  }

  .labbar-brand {
    font-size: 10.5px;
    letter-spacing: 0.15em;
  }

  .lab-tag {
    display: none;
  }

  .demo-pill {
    padding: 5px 8px;
    font-size: 9px;
  }

  .labbar-back {
    font-size: 11px;
  }

  .back-word {
    display: none;
  }

  .page {
    padding: 16px 14px 18px;
  }

  .page-head {
    gap: 14px;
  }

  h1 {
    font-size: 23px;
  }

  .kpis {
    gap: 9px;
    margin-top: 16px;
  }

  .kpi {
    padding: 12px 13px;
  }

  .kpi-label {
    font-size: 10.5px;
  }

  .kpi-value {
    font-size: 23px;
  }

  .kpi-trend {
    font-size: 10.5px;
  }

  .card-head {
    padding: 13px 14px 11px;
  }

  .schedule .card-head {
    flex-wrap: wrap;
  }

  .appt-open {
    grid-template-columns: 64px minmax(0, 1fr) auto;
    gap: 8px;
    padding-left: 12px;
  }

  .appt-time b {
    font-size: 12px;
  }

  .appt-time span {
    font-size: 10px;
  }

  .appt-action {
    padding: 0 8px;
    font-size: 10.5px;
  }

  .status {
    padding: 3px 7px;
    font-size: 9.5px;
  }

  .nav {
    gap: 2px;
  }

  .nav-item {
    flex: 1 1 0;
    justify-content: center;
    padding: 8px 4px;
    font-size: 12px;
  }

  .nav-item svg {
    display: none;
  }

  .nav-item.is-active::before {
    left: 14px;
    right: 14px;
  }

  .brand-name {
    font-size: 15px;
  }

  .appt-name {
    font-size: 13px;
  }

  .appt-sub {
    gap: 5px;
  }

  .appt-provider {
    display: none;
  }

  .wait-row {
    padding: 0 14px;
  }

  .quick-list {
    padding: 0 14px 14px;
  }

  .modal-head,
  #booking-form {
    padding-left: 16px;
    padding-right: 16px;
  }

  .field-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .overlay-modal {
    padding: 12px;
  }

  .drawer-head,
  .drawer-scroll {
    padding-left: 16px;
    padding-right: 16px;
  }

  .drawer-foot {
    padding-left: 16px;
    padding-right: 16px;
  }

  .detail-grid {
    gap: 10px 12px;
    padding: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .live-dot {
    animation: none;
  }
}
