:root {
  color-scheme: light;
  --navy-950: #052f3b;
  --navy-900: #073b4c;
  --navy-800: #0b4c5b;
  --ink: #16323b;
  --ink-soft: #36545d;
  --muted: #586f76;
  --muted-light: #60767c;
  --teal-700: #08766f;
  --teal-600: #0b8a82;
  --teal-500: #15a49a;
  --teal-100: #d8f2ee;
  --teal-50: #ecf9f7;
  --blue-100: #dfeefb;
  --blue-600: #3477a8;
  --violet-100: #eee8fb;
  --violet-600: #705a9f;
  --coral-100: #fce8df;
  --coral-600: #b85637;
  --amber-100: #fff2cf;
  --amber-700: #8a6415;
  --red-100: #fde7e5;
  --red-700: #a53b36;
  --green-100: #ddf3e8;
  --green-700: #267252;
  --canvas: #f4f7f7;
  --surface: #ffffff;
  --surface-soft: #f8fbfa;
  --line: #dce6e5;
  --line-strong: #c9d8d6;
  --focus: #0b8a82;
  --shadow-sm: 0 1px 2px rgb(5 47 59 / 4%), 0 8px 24px rgb(5 47 59 / 5%);
  --shadow-md: 0 16px 44px rgb(5 47 59 / 10%);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 13px;
  --sidebar-width: 264px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { min-width: 320px; scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: .005em;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input, textarea, select { font: inherit; }

button { border: 0; }

button, select { cursor: pointer; }

button:disabled { cursor: wait; opacity: .72; }

h1, h2, h3, p { margin-top: 0; }

h1, h2, h3, strong { letter-spacing: normal; }

h1 { font-size: clamp(2rem, 4vw, 3rem); line-height: 1.08; margin-bottom: 12px; text-wrap: balance; }

h2 { font-size: 1.26rem; line-height: 1.24; margin-bottom: 8px; text-wrap: balance; }

p { color: var(--muted); }

svg {
  display: block;
  width: 1.25em;
  height: 1.25em;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

:focus-visible {
  outline: 3px solid #fff;
  box-shadow: 0 0 0 5px var(--focus);
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 12px;
  left: 12px;
  padding: 10px 16px;
  color: #fff;
  background: var(--navy-950);
  border-radius: 10px;
  transform: translateY(-150%);
  transition: transform .2s ease;
}

.skip-link:focus { transform: translateY(0); }

.eyebrow {
  margin-bottom: 6px;
  color: var(--teal-700);
  font-size: .71rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.brand { display: flex; align-items: center; gap: 12px; }

.brand > span:last-child { display: grid; gap: 1px; }

.brand strong { font-size: .98rem; line-height: 1.15; }

.brand small { color: var(--muted); font-size: .71rem; letter-spacing: .035em; }

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, var(--teal-500), var(--teal-700));
  border-radius: 14px 14px 18px 14px;
  box-shadow: inset 0 1px rgb(255 255 255 / 30%), 0 8px 20px rgb(7 59 76 / 18%);
}

.brand-mark svg { width: 28px; height: 28px; stroke-width: 1.7; }

.brand-mark svg path:first-child { fill: rgb(255 255 255 / 16%); }

.brand-light strong { color: #fff; }

.brand-light small { color: rgb(255 255 255 / 58%); }

/* Login */
.login-page {
  min-height: 100vh;
  background: var(--surface);
}

.login-shell { display: grid; grid-template-columns: minmax(480px, 1.08fr) minmax(440px, .92fr); min-height: 100vh; }

.login-story {
  position: relative;
  isolation: isolate;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: clamp(38px, 5vw, 72px);
  color: #fff;
  background:
    radial-gradient(circle at 84% 18%, rgb(80 211 194 / 24%) 0, transparent 27%),
    radial-gradient(circle at 18% 88%, rgb(89 158 188 / 22%) 0, transparent 31%),
    linear-gradient(145deg, var(--navy-950) 0%, var(--navy-900) 50%, #075c60 100%);
}

.login-story::before,
.login-story::after {
  position: absolute;
  z-index: -1;
  content: "";
  border: 1px solid rgb(255 255 255 / 9%);
  border-radius: 50%;
}

.login-story::before { width: 620px; height: 620px; top: -250px; right: -260px; }

.login-story::after { width: 420px; height: 420px; right: 9%; bottom: -265px; box-shadow: 0 0 0 80px rgb(255 255 255 / 2.5%); }

.story-copy { max-width: 650px; margin: auto 0; padding: 80px 0; }

.environment-chip,
.pilot-chip,
.privacy-chip,
.status-pill {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  font-size: .76rem;
  font-weight: 750;
  letter-spacing: .01em;
  white-space: nowrap;
}

.environment-chip {
  padding: 7px 12px;
  color: #d8fffa;
  background: rgb(255 255 255 / 9%);
  border: 1px solid rgb(255 255 255 / 13%);
}

.environment-chip i,
.pilot-chip i,
.status-pill i,
.clinic-mini-card small i,
.table-intro i {
  width: 7px;
  height: 7px;
  background: #52d6b7;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgb(82 214 183 / 13%);
}

.story-copy h1 {
  max-width: 640px;
  margin: 24px 0 22px;
  color: #fff;
  font-size: clamp(3rem, 6vw, 5.3rem);
  font-weight: 620;
  line-height: 1.03;
  letter-spacing: .005em;
}

.story-copy p { max-width: 580px; margin: 0; color: rgb(255 255 255 / 70%); font-size: clamp(1.05rem, 1.5vw, 1.25rem); }

.trust-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; padding-top: 26px; border-top: 1px solid rgb(255 255 255 / 12%); }

.trust-row > div { display: flex; align-items: flex-start; gap: 10px; }

.trust-row span:last-child { display: grid; }

.trust-row strong { color: #fff; font-size: .84rem; }

.trust-row small { color: rgb(255 255 255 / 52%); font-size: .72rem; }

.trust-icon { display: grid; width: 22px; height: 22px; flex: 0 0 auto; place-items: center; color: var(--navy-900); background: #72dbc6; border-radius: 50%; font-size: .72rem; font-weight: 900; }

.story-footnote { display: none; }

.login-panel { display: grid; align-content: center; padding: clamp(32px, 6vw, 86px); background: var(--surface); }

.mobile-brand { display: none; }

.login-card { width: min(430px, 100%); margin: auto; }

.secure-icon {
  display: grid;
  width: 48px;
  height: 48px;
  margin-bottom: 24px;
  place-items: center;
  color: var(--teal-700);
  background: var(--teal-100);
  border-radius: 16px;
}

.secure-icon svg { width: 23px; height: 23px; }

.login-heading h2 { margin: 2px 0 10px; font-size: clamp(2rem, 4vw, 2.55rem); }

.login-heading > p:last-child { margin-bottom: 30px; }

.form-alert { display: none; align-items: flex-start; gap: 10px; margin-bottom: 20px; padding: 13px; color: var(--red-700); background: var(--red-100); border: 1px solid #f4c8c4; border-radius: 13px; }

.form-alert[data-error="true"] { display: flex; }

.form-alert > span { display: grid; width: 22px; height: 22px; flex: 0 0 auto; place-items: center; color: #fff; background: var(--red-700); border-radius: 50%; font-weight: 800; }

.form-alert p { margin: 0; color: inherit; font-size: .82rem; }

.login-form { display: grid; gap: 13px; }

.login-form > label,
.stack-form > label { color: var(--ink); font-size: .82rem; font-weight: 750; }

.input-shell { position: relative; }

.input-shell svg { position: absolute; top: 50%; left: 16px; width: 19px; height: 19px; color: var(--muted); transform: translateY(-50%); pointer-events: none; }

input,
textarea,
select {
  width: 100%;
  min-height: 48px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

input { padding: 12px 15px; }

.input-shell input { padding-left: 48px; }

textarea { min-height: 126px; padding: 13px 15px; resize: vertical; }

select { appearance: none; padding: 10px 40px 10px 14px; }

input::placeholder, textarea::placeholder { color: #95a7ab; }

input:hover, textarea:hover, select:hover { border-color: #9db7b5; }

input:focus, textarea:focus, select:focus { outline: 0; border-color: var(--teal-600); box-shadow: 0 0 0 4px rgb(11 138 130 / 13%); }

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 18px;
  color: #fff;
  border-radius: 13px;
  font-size: .85rem;
  font-weight: 780;
  letter-spacing: .005em;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.button:hover:not(:disabled) { transform: translateY(-1px); }

.button:active:not(:disabled) { transform: translateY(0); }

.button svg { width: 18px; height: 18px; }

.button-primary { background: linear-gradient(135deg, var(--teal-700), var(--teal-600)); box-shadow: 0 8px 20px rgb(8 118 111 / 18%); }

.button-primary:hover:not(:disabled) { background: linear-gradient(135deg, #06655f, var(--teal-700)); box-shadow: 0 10px 25px rgb(8 118 111 / 25%); }

.button-secondary { color: var(--teal-700); background: var(--teal-50); border: 1px solid #bfe3de; box-shadow: none; }

.button-secondary:hover:not(:disabled) { background: var(--teal-100); }

.button-large { min-height: 52px; margin-top: 6px; }

.button-wide { width: 100%; }

.button.is-loading svg { animation: nudge 1s ease-in-out infinite; }

.security-note { display: flex; gap: 12px; margin-top: 26px; padding: 16px 0 0; border-top: 1px solid var(--line); }

.security-note svg { width: 21px; height: 21px; flex: 0 0 auto; color: var(--teal-700); }

.security-note p { margin: 0; font-size: .76rem; }

.security-note strong { color: var(--ink-soft); }

.login-help { margin: 34px auto 0; font-size: .76rem; text-align: center; }

.brand-link { width: max-content; color: inherit; text-decoration: none; }
.auth-proof-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding-top: 24px; border-top: 1px solid rgb(255 255 255 / 12%); }
.auth-proof-grid > div { display: grid; gap: 2px; }
.auth-proof-grid strong { color: #fff; font-size: .92rem; }
.auth-proof-grid small { color: rgb(255 255 255 / 50%); font-size: .69rem; }
.password-shell { position: relative; }
.password-shell input { padding-right: 66px; }
.password-toggle { position: absolute; top: 50%; right: 8px; min-width: 50px; min-height: 34px; padding: 5px 8px; color: var(--teal-700); background: var(--teal-50); border-radius: 9px; font-size: .7rem; font-weight: 780; transform: translateY(-50%); }
.password-toggle:hover { background: var(--teal-100); }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 22px 0 14px; color: var(--muted); font-size: .68rem; }
.auth-divider::before, .auth-divider::after { height: 1px; flex: 1; content: ""; background: var(--line); }
.auth-link-button { text-decoration: none; }
.signup-panel { align-content: start; overflow-y: auto; padding-block: clamp(30px, 4vw, 62px); }
.signup-card { width: min(650px, 100%); }
.signup-heading { margin-bottom: 25px; }
.signup-heading h2 { margin: 10px 0 7px; font-size: clamp(1.8rem, 3vw, 2.35rem); }
.signup-heading p:last-child { margin: 0; }
.back-link { display: inline-flex; margin-bottom: 28px; color: var(--teal-700); font-size: .75rem; font-weight: 750; text-decoration: none; }
.signup-form { gap: 23px; }
.signup-form fieldset { display: grid; gap: 12px; margin: 0; padding: 0 0 22px; border: 0; border-bottom: 1px solid var(--line); }
.signup-form legend { margin-bottom: 14px; color: var(--ink); font-size: .76rem; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.signup-form label, .account-form label, .form-dialog label { display: grid; gap: 6px; color: var(--ink); font-size: .74rem; font-weight: 750; }
.signup-form label > small, .form-dialog label > small { color: var(--muted); font-weight: 500; }
.auth-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.password-guidance { color: var(--muted); font-size: .64rem; font-weight: 500; }
.password-guidance.ready { color: var(--green-700); }
.auth-consent { display: grid !important; grid-template-columns: 18px 1fr; align-items: start; gap: 10px !important; color: var(--muted) !important; font-size: .67rem !important; font-weight: 500 !important; }
.auth-consent input { width: 17px; min-height: 17px; accent-color: var(--teal-600); }
.auth-legal { margin: 21px 0 0; color: var(--muted); font-size: .65rem; text-align: center; }
.onboarding-steps { display: grid; gap: 17px; margin: 0; padding: 24px 0 0; border-top: 1px solid rgb(255 255 255 / 12%); list-style: none; }
.onboarding-steps li { display: flex; align-items: center; gap: 12px; }
.onboarding-steps li > span { display: grid; width: 30px; height: 30px; flex: 0 0 auto; place-items: center; color: #baf6ec; background: rgb(80 211 194 / 13%); border: 1px solid rgb(151 239 226 / 15%); border-radius: 10px; font-size: .67rem; font-weight: 850; }
.onboarding-steps div { display: grid; }
.onboarding-steps strong { color: #fff; font-size: .77rem; }
.onboarding-steps small { color: rgb(255 255 255 / 50%); font-size: .66rem; }
.invite-shell { grid-template-columns: minmax(430px, .9fr) minmax(480px, 1.1fr); }
.invite-clinic-preview { display: flex; align-items: center; gap: 14px; padding: 18px; background: rgb(255 255 255 / 8%); border: 1px solid rgb(255 255 255 / 12%); border-radius: 18px; }
.invite-clinic-mark { display: grid; width: 46px; height: 46px; place-items: center; color: #d8fff9; background: rgb(80 211 194 / 15%); border-radius: 14px; font-size: .74rem; font-weight: 850; }
.invite-clinic-preview div { display: grid; }
.invite-clinic-preview small, .invite-clinic-preview span:last-child { color: rgb(255 255 255 / 52%); font-size: .66rem; }
.invite-clinic-preview strong { color: #fff; font-size: .88rem; }
.login-heading p strong { color: var(--ink-soft); }

/* Application shell */
.app-body { min-height: 100vh; }

.app-shell { min-height: 100vh; }

.sidebar {
  position: fixed;
  z-index: 20;
  inset: 0 auto 0 0;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  color: #fff;
  background:
    radial-gradient(circle at 30% 100%, rgb(21 164 154 / 13%), transparent 33%),
    linear-gradient(180deg, var(--navy-950), #063744 60%, #07343f);
  border-right: 1px solid rgb(255 255 255 / 5%);
}

.sidebar-brand { min-height: 92px; padding: 20px 24px; border-bottom: 1px solid rgb(255 255 255 / 7%); }

.side-nav { display: flex; flex: 1; flex-direction: column; gap: 5px; padding: 27px 16px; }

.nav-label { margin: 0 10px 10px; color: rgb(255 255 255 / 35%); font-size: .64rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }

.nav-item {
  position: relative;
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 12px;
  padding: 10px 13px;
  color: rgb(255 255 255 / 62%);
  background: transparent;
  border-radius: 12px;
  font-size: .83rem;
  font-weight: 650;
  text-align: left;
  transition: color .18s ease, background .18s ease, transform .18s ease;
}

.nav-item:hover { color: #fff; background: rgb(255 255 255 / 6%); }

.nav-item.active { color: #fff; background: linear-gradient(120deg, rgb(21 164 154 / 27%), rgb(255 255 255 / 7%)); box-shadow: inset 0 0 0 1px rgb(129 235 222 / 10%); }

.side-nav .nav-item.active::before { position: absolute; left: -16px; width: 3px; height: 25px; content: ""; background: #4ed4c2; border-radius: 0 4px 4px 0; }

.nav-item svg { width: 20px; height: 20px; flex: 0 0 auto; }

.nav-item > span:nth-child(2) { flex: 1; }

.nav-count { display: grid; min-width: 23px; height: 23px; place-items: center; color: #b9ece5; background: rgb(21 164 154 / 16%); border-radius: 8px; font-size: .68rem; }

.sidebar-bottom { padding: 18px 16px 20px; border-top: 1px solid rgb(255 255 255 / 7%); }

.clinic-mini-card { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; padding: 12px 10px; }

.clinic-mini-card > span:nth-child(2) { display: grid; min-width: 0; }

.clinic-mini-card strong { overflow: hidden; color: #fff; font-size: .76rem; text-overflow: ellipsis; white-space: nowrap; }

.clinic-mini-card small { display: flex; align-items: center; gap: 6px; color: rgb(255 255 255 / 43%); font-size: .65rem; }

.clinic-avatar,
.operator-avatar {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  color: #bdeee8;
  background: rgb(21 164 154 / 14%);
  border: 1px solid rgb(129 235 222 / 13%);
  border-radius: 12px;
  font-size: .68rem;
  font-weight: 850;
}

.clinic-avatar { width: 36px; height: 36px; }

.signout-button { display: flex; width: 100%; min-height: 44px; align-items: center; gap: 12px; padding: 10px 13px; color: rgb(255 255 255 / 48%); background: transparent; border-radius: 12px; font-size: .78rem; font-weight: 650; }

.signout-button:hover { color: #fff; background: rgb(255 255 255 / 6%); }

.signout-button svg { width: 19px; height: 19px; }

.workspace { min-height: 100vh; margin-left: var(--sidebar-width); }

.topbar {
  position: sticky;
  z-index: 15;
  top: 0;
  display: flex;
  height: 76px;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(24px, 4vw, 54px);
  background: rgb(244 247 247 / 88%);
  border-bottom: 1px solid rgb(201 216 214 / 72%);
  backdrop-filter: blur(18px);
}

.topbar-context { display: flex; align-items: center; gap: 11px; }

.topbar-context > span:last-child { display: grid; }

.topbar-context strong { font-size: .79rem; }

.topbar-context small { color: var(--muted); font-size: .67rem; }

.context-dot { width: 9px; height: 9px; background: var(--teal-500); border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 3px var(--teal-100); }

.topbar-actions { display: flex; align-items: center; gap: 10px; }

.icon-button { display: grid; width: 40px; height: 40px; place-items: center; color: var(--ink-soft); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: 0 1px 2px rgb(5 47 59 / 4%); transition: color .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease, transform .18s ease; }

.icon-button:hover { color: var(--teal-700); background: var(--teal-50); border-color: #a9d6d1; box-shadow: 0 5px 14px rgb(8 118 111 / 10%); transform: translateY(-1px); }

.icon-button:active { transform: translateY(0); }

.icon-button svg { width: 19px; height: 19px; stroke-width: 2; }

.icon-button.rotating svg { animation: rotate .8s linear infinite; }

.status-pill { min-height: 38px; padding: 8px 13px; }

.status-pill.neutral { color: var(--muted); background: #e9efef; }

.status-pill.success { color: var(--green-700); background: var(--green-100); }

.status-pill.warning { color: var(--amber-700); background: var(--amber-100); }

.status-pill.warning i { background: #d99829; box-shadow: 0 0 0 4px rgb(217 152 41 / 13%); }

.operator-avatar { width: 40px; height: 40px; color: var(--navy-800); background: var(--teal-100); border-color: #c0e5e0; }

.operator-button { transition: transform .18s ease, box-shadow .18s ease, background .18s ease; }
.operator-button:hover { background: #c6ece7; box-shadow: 0 6px 16px rgb(8 118 111 / 15%); transform: translateY(-1px); }

.mobile-wordmark { display: none; }

#main-content { max-width: 1580px; margin: 0 auto; padding: 42px clamp(24px, 4vw, 54px) 70px; outline: 0; }

.page { animation: page-in .34s ease both; }

.page[hidden] { display: none; }

.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 30px; }

.page-heading > div:first-child { max-width: 740px; }

.page-heading h1 { margin-bottom: 9px; font-weight: 650; }

.page-heading > div:first-child > p:last-child { max-width: 680px; margin-bottom: 0; font-size: .96rem; }

.heading-meta { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: .73rem; }

.pilot-chip { min-height: 30px; padding: 6px 11px; color: var(--teal-700); background: var(--teal-100); }

.pilot-chip i { background: var(--teal-600); }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; margin-bottom: 18px; }

.metric-card {
  position: relative;
  display: flex;
  min-height: 148px;
  align-items: flex-start;
  gap: 15px;
  overflow: hidden;
  padding: 21px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease;
}

.metric-card::after { position: absolute; width: 92px; height: 92px; right: -42px; bottom: -48px; content: ""; background: var(--metric-bg); border-radius: 50%; opacity: .55; }

.metric-card:hover { z-index: 1; transform: translateY(-2px); box-shadow: var(--shadow-md); }

.metric-card > div:last-child { display: grid; }

.metric-icon { display: grid; width: 42px; height: 42px; flex: 0 0 auto; place-items: center; color: var(--metric-color); background: var(--metric-bg); border-radius: 13px; }

.metric-icon svg { width: 21px; height: 21px; }

.metric-teal { --metric-bg: var(--teal-100); --metric-color: var(--teal-700); }
.metric-blue { --metric-bg: var(--blue-100); --metric-color: var(--blue-600); }
.metric-violet { --metric-bg: var(--violet-100); --metric-color: var(--violet-600); }
.metric-coral { --metric-bg: var(--coral-100); --metric-color: var(--coral-600); }

.metric-label { color: var(--muted); font-size: .74rem; font-weight: 700; }

.metric-card strong { margin: 2px 0 -1px; font-size: 2.15rem; line-height: 1.1; }

.metric-card small { color: var(--muted); font-size: .68rem; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr); gap: 18px; }

.surface { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-xl); box-shadow: var(--shadow-sm); }

.calls-card,
.schedule-card,
.message-card,
.readiness-card,
.lab-card,
.table-card,
.audit-card { padding: clamp(20px, 2.2vw, 28px); }

.card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 12px; }

.card-heading h2 { margin: 0; }

.privacy-chip { min-height: 29px; padding: 6px 10px; color: var(--muted); background: var(--surface-soft); border: 1px solid var(--line); }

.privacy-chip svg { width: 14px; height: 14px; color: var(--teal-700); }

.activity-list { min-height: 260px; }

.activity-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 13px; padding: 16px 0; border-top: 1px solid var(--line); }

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

.activity-icon { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 13px; }

.activity-icon svg { width: 19px; height: 19px; }

.activity-icon.success { color: var(--teal-700); background: var(--teal-100); }
.activity-icon.warning { color: var(--amber-700); background: var(--amber-100); }
.activity-icon.danger { color: var(--red-700); background: var(--red-100); }
.activity-icon.info { color: var(--blue-600); background: var(--blue-100); }

.activity-main { display: grid; min-width: 0; }

.activity-main strong { font-size: .82rem; }

.activity-main small { overflow: hidden; color: var(--muted); font-size: .71rem; text-overflow: ellipsis; white-space: nowrap; }

.activity-status { display: grid; justify-items: end; gap: 5px; }

.activity-status time { color: var(--muted-light); font-size: .65rem; }

.status-tag { display: inline-flex; min-height: 25px; align-items: center; padding: 4px 9px; border-radius: 999px; font-size: .65rem; font-weight: 780; white-space: nowrap; }

.status-tag.success { color: var(--green-700); background: var(--green-100); }
.status-tag.warning { color: var(--amber-700); background: var(--amber-100); }
.status-tag.danger { color: var(--red-700); background: var(--red-100); }
.status-tag.info { color: var(--blue-600); background: var(--blue-100); }

.readiness-card {
  position: relative;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 100% 0, rgb(51 186 171 / 25%), transparent 40%),
    linear-gradient(145deg, var(--navy-950), var(--navy-900));
  border: 0;
}

.readiness-card::after { position: absolute; width: 210px; height: 210px; top: -145px; right: -80px; content: ""; border: 1px solid rgb(255 255 255 / 8%); border-radius: 50%; box-shadow: 0 0 0 42px rgb(255 255 255 / 2.5%); }

.readiness-orb { display: grid; width: 62px; height: 62px; margin-bottom: 18px; place-items: center; color: #f7d993; background: conic-gradient(#efc76e 70%, rgb(255 255 255 / 10%) 0); border-radius: 50%; }

.readiness-orb::before { position: absolute; width: 48px; height: 48px; content: ""; background: var(--navy-950); border-radius: 50%; }

.readiness-orb span { z-index: 1; font-size: .72rem; font-weight: 850; }

.readiness-orb.complete { color: #8ce6ce; background: #52cfae; }

.readiness-copy { position: absolute; top: 31px; left: 106px; right: 25px; }

.readiness-copy .eyebrow { color: #83dfd2; }

.readiness-copy h2 { color: #fff; font-size: 1.08rem; }

.readiness-copy p:last-child { margin: 0; color: rgb(255 255 255 / 55%); font-size: .69rem; }

.check-list { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; padding-top: 18px; border-top: 1px solid rgb(255 255 255 / 10%); }

.check-item { display: grid; grid-template-columns: 20px 1fr; align-items: center; gap: 7px; min-width: 0; padding: 5px 0; }

.check-item > span:nth-child(2) { overflow: hidden; color: rgb(255 255 255 / 68%); font-size: .67rem; text-overflow: ellipsis; white-space: nowrap; }

.check-item strong { display: none; }

.check-symbol { display: grid; width: 18px; height: 18px; place-items: center; border-radius: 6px; font-size: .65rem; font-weight: 900; }

.check-item.passed .check-symbol { color: #bff4e6; background: rgb(82 207 174 / 18%); }

.check-item.pending .check-symbol { color: #f9dc9d; background: rgb(239 199 110 / 15%); }

.text-button { min-height: 38px; padding: 6px 3px; color: var(--teal-700); background: transparent; font-size: .73rem; font-weight: 750; }

.text-button:hover { color: var(--navy-900); }

.compact-list { min-height: 120px; }

.compact-row { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 11px; padding: 12px 0; border-top: 1px solid var(--line); }

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

.date-tile { display: grid; width: 40px; height: 42px; place-items: center; align-content: center; color: var(--teal-700); background: var(--teal-50); border: 1px solid #d4eeea; border-radius: 11px; }

.date-tile strong { font-size: .9rem; line-height: 1; }

.date-tile small { font-size: .56rem; font-weight: 800; text-transform: uppercase; }

.compact-main { display: grid; min-width: 0; }

.compact-main strong { overflow: hidden; font-size: .76rem; text-overflow: ellipsis; white-space: nowrap; }

.compact-main small { overflow: hidden; color: var(--muted); font-size: .64rem; text-overflow: ellipsis; white-space: nowrap; }

.compact-row > time { color: var(--ink-soft); font-size: .68rem; font-weight: 750; }

.message-symbol { display: grid; width: 38px; height: 38px; place-items: center; color: var(--violet-600); background: var(--violet-100); border-radius: 11px; }

.message-symbol svg { width: 18px; height: 18px; }

.empty-state { display: grid; min-height: 180px; place-items: center; align-content: center; padding: 24px; text-align: center; }

.empty-state > span { display: grid; width: 45px; height: 45px; margin-bottom: 10px; place-items: center; color: var(--teal-700); background: var(--teal-50); border-radius: 14px; }

.empty-state svg { width: 21px; height: 21px; }

.empty-state strong { font-size: .83rem; }

.empty-state p { max-width: 280px; margin: 4px 0 0; font-size: .7rem; }

.skeleton-row { height: 58px; margin: 10px 0; background: linear-gradient(90deg, #edf2f1 25%, #f7f9f9 45%, #edf2f1 65%); background-size: 220% 100%; border-radius: 12px; animation: shimmer 1.5s infinite; }

/* Safety lab */
.lab-notice { display: flex; align-items: center; gap: 13px; margin-bottom: 18px; padding: 15px 18px; background: var(--teal-50); border: 1px solid #c7e9e4; border-radius: var(--radius-lg); }

.notice-icon { display: grid; width: 38px; height: 38px; flex: 0 0 auto; place-items: center; color: var(--teal-700); background: var(--teal-100); border-radius: 12px; }

.notice-icon svg { width: 20px; height: 20px; }

.lab-notice strong { font-size: .82rem; }

.lab-notice p { margin: 1px 0 0; font-size: .72rem; }

.lab-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: start; }

.lab-card { position: relative; overflow: hidden; }

.lab-card::after { position: absolute; width: 120px; height: 120px; top: -75px; right: -65px; content: ""; background: var(--teal-50); border-radius: 50%; }

.lab-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }

.step-number { color: var(--muted-light); font-size: .68rem; font-weight: 850; letter-spacing: .08em; }

.feature-icon { z-index: 1; display: grid; width: 44px; height: 44px; place-items: center; border-radius: 14px; }

.feature-icon svg { width: 21px; height: 21px; }

.feature-icon.coral { color: var(--coral-600); background: var(--coral-100); }
.feature-icon.teal { color: var(--teal-700); background: var(--teal-100); }
.feature-icon.blue { color: var(--blue-600); background: var(--blue-100); }

.lab-card h2 { font-size: 1.35rem; }

.card-description { min-height: 63px; font-size: .76rem; }

.stack-form { display: grid; gap: 9px; margin-top: 20px; }

.field-hint { margin: -2px 0 5px; font-size: .65rem; }

.select-shell { position: relative; }

.select-shell::after { position: absolute; top: 50%; right: 16px; width: 7px; height: 7px; content: ""; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: translateY(-70%) rotate(45deg); pointer-events: none; }

.flow-list { display: grid; gap: 10px; margin: 20px 0; padding: 16px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 14px; list-style: none; }

.flow-list li { display: flex; align-items: center; gap: 9px; color: var(--ink-soft); font-size: .72rem; }

.flow-list i { display: grid; width: 21px; height: 21px; place-items: center; color: var(--teal-700); background: var(--teal-100); border-radius: 7px; font-size: .6rem; font-style: normal; font-weight: 850; }

.result-placeholder { display: grid; min-height: 92px; margin-top: 17px; place-items: center; padding: 16px; color: var(--muted-light); background: var(--surface-soft); border: 1px dashed var(--line-strong); border-radius: 14px; font-size: .7rem; text-align: center; }

.result-card { margin-top: 17px; padding: 16px; background: var(--surface-soft); border: 1px solid var(--line); border-left: 4px solid var(--blue-600); border-radius: 14px; }

.result-card.success { background: #f1faf6; border-color: #bfe4d2; border-left-color: var(--green-700); }
.result-card.warning { background: #fffbf0; border-color: #f0dfac; border-left-color: #d59c2f; }
.result-card.danger { background: #fff6f5; border-color: #efcbc7; border-left-color: var(--red-700); }

.result-card p { margin: 8px 0; font-size: .72rem; }

.result-card small { color: var(--muted); font-size: .64rem; }

.result-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

.result-heading span { font-size: .68rem; font-weight: 750; text-transform: uppercase; }

.result-heading strong { font-size: .78rem; }

.slot-list { display: grid; margin-top: 17px; }

.slot-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); text-align: left; }

.slot-row > span { display: grid; }

.slot-row strong { font-size: .72rem; }

.slot-row small { color: var(--muted); font-size: .62rem; }

/* Data pages */
.page-actions { display: flex; align-items: center; }

.filter-control { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .72rem; font-weight: 700; }

.filter-control select { width: auto; min-width: 170px; min-height: 42px; background-color: var(--surface); }

.table-card { overflow: hidden; padding: 0; }

.table-intro { display: flex; min-height: 64px; align-items: center; justify-content: space-between; padding: 0 24px; color: var(--muted); border-bottom: 1px solid var(--line); font-size: .71rem; }

.table-intro > span:last-child { display: flex; align-items: center; gap: 7px; }

.table-intro svg { width: 15px; height: 15px; color: var(--teal-700); }

.data-table-wrap { min-height: 190px; overflow-x: auto; }

.data-table { width: 100%; border-collapse: collapse; font-size: .76rem; }

.data-table th { padding: 13px 24px; color: var(--muted); background: var(--surface-soft); border-bottom: 1px solid var(--line); font-size: .64rem; font-weight: 800; letter-spacing: .035em; text-align: left; text-transform: uppercase; }

.data-table td { padding: 16px 24px; color: var(--ink-soft); border-bottom: 1px solid var(--line); vertical-align: middle; }

.data-table tbody tr:last-child td { border-bottom: 0; }

.data-table tbody tr { transition: background .15s ease; }

.data-table tbody tr:hover { background: #fbfdfd; }

.patient-cell,
.message-type { display: flex; align-items: center; gap: 10px; color: var(--ink); }

.patient-cell i { display: grid; width: 34px; height: 34px; place-items: center; color: var(--teal-700); background: var(--teal-100); border-radius: 11px; font-size: .62rem; font-style: normal; font-weight: 850; }

.message-type svg { width: 18px; height: 18px; color: var(--violet-600); }

.audit-card { padding-top: 14px; padding-bottom: 14px; }

.audit-timeline { min-height: 190px; }

.audit-event { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 13px; padding: 16px 0 20px; }

.audit-marker { position: relative; display: flex; justify-content: center; }

.audit-marker::after { position: absolute; top: 19px; bottom: -33px; width: 1px; content: ""; background: var(--line); }

.audit-event:last-child .audit-marker::after { display: none; }

.audit-marker i { z-index: 1; width: 12px; height: 12px; margin-top: 4px; background: var(--teal-500); border: 3px solid var(--teal-100); border-radius: 50%; box-shadow: 0 0 0 2px #fff; }

.audit-content strong { font-size: .78rem; }

.audit-content p { margin: 2px 0; font-size: .7rem; }

.audit-content small { color: var(--muted-light); font-size: .61rem; text-transform: uppercase; }

.audit-event > time { display: grid; justify-items: end; color: var(--ink-soft); }

.audit-event > time strong { font-size: .68rem; }

.audit-event > time small { color: var(--muted); font-size: .61rem; }

.mobile-nav { display: none; }

.toast {
  position: fixed;
  z-index: 100;
  right: 24px;
  bottom: 24px;
  display: flex;
  min-width: 270px;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  color: #fff;
  background: var(--navy-950);
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: 14px;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}

.toast.visible { opacity: 1; transform: translateY(0); }

.toast.error { background: #7f302e; }

.toast-icon { display: grid; width: 22px; height: 22px; place-items: center; color: var(--navy-950); background: #75d8c4; border-radius: 50%; font-size: .7rem; font-weight: 900; }

@keyframes shimmer { to { background-position: -220% 0; } }
@keyframes rotate { to { transform: rotate(360deg); } }
@keyframes nudge { 50% { transform: translateX(3px); } }
@keyframes page-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 1180px) {
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .metric-card { min-height: 126px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .lab-grid { grid-template-columns: 1fr 1fr; }
  .featured-lab { grid-row: span 2; }
  .story-footnote { display: none; }
}

@media (max-width: 900px) {
  :root { --sidebar-width: 222px; }
  .sidebar-brand { padding-inline: 18px; }
  .brand strong { font-size: .88rem; }
  .login-shell { grid-template-columns: 1fr; }
  .login-story { display: none; }
  .login-panel { min-height: 100vh; }
  .signup-panel { padding-top: 96px; }
  .mobile-brand { display: flex; position: absolute; top: 28px; left: 30px; }
}

@media (max-width: 760px) {
  :root { --sidebar-width: 0; }
  .sidebar { display: none; }
  .workspace { margin-left: 0; padding-bottom: 72px; }
  .topbar { height: 68px; padding-inline: 18px; }
  .topbar-context { display: none; }
  .mobile-wordmark { display: flex; align-items: center; gap: 9px; }
  .mobile-wordmark .brand-mark { width: 34px; height: 34px; border-radius: 11px 11px 14px 11px; }
  .mobile-wordmark .brand-mark svg { width: 22px; height: 22px; }
  .mobile-wordmark strong { font-size: .8rem; }
  .operator-avatar { display: none; }
  .status-pill { min-height: 34px; padding: 6px 10px; font-size: .67rem; }
  #main-content { padding: 28px 17px 40px; }
  .page-heading { align-items: flex-start; flex-direction: column; margin-bottom: 24px; }
  .page-heading h1 { font-size: 2.05rem; }
  .overview-heading .heading-meta { width: 100%; justify-content: space-between; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .metric-card { min-height: 136px; flex-direction: column; gap: 9px; padding: 16px; }
  .metric-icon { width: 36px; height: 36px; }
  .metric-card strong { font-size: 1.7rem; }
  .metric-card small { line-height: 1.3; }
  .surface { border-radius: 18px; }
  .calls-card, .schedule-card, .message-card, .readiness-card, .lab-card, .audit-card { padding: 19px; }
  .privacy-chip { display: none; }
  .activity-row { grid-template-columns: 40px minmax(0, 1fr); }
  .activity-status { grid-column: 2; grid-row: 2; justify-items: start; grid-auto-flow: column; align-items: center; }
  .readiness-copy { top: 24px; left: 94px; }
  .check-list { grid-template-columns: 1fr; }
  .lab-grid { grid-template-columns: 1fr; }
  .featured-lab { grid-row: auto; }
  .card-description { min-height: 0; }
  .table-card { border-radius: 18px; }
  .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; }
  .data-table thead { display: none; }
  .data-table tr { padding: 14px 18px; border-bottom: 1px solid var(--line); }
  .data-table tr:last-child { border-bottom: 0; }
  .data-table td { display: grid; grid-template-columns: 110px 1fr; align-items: center; gap: 12px; padding: 7px 0; border: 0; }
  .data-table td::before { content: attr(data-label); color: var(--muted); font-size: .64rem; font-weight: 780; text-transform: uppercase; }
  .audit-event { grid-template-columns: 24px minmax(0, 1fr); }
  .audit-event > time { grid-column: 2; grid-auto-flow: column; justify-content: start; gap: 6px; justify-items: start; }
  .mobile-nav {
    position: fixed;
    z-index: 30;
    inset: auto 0 0;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    min-height: 69px;
    padding: 6px max(8px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    background: rgb(255 255 255 / 94%);
    border-top: 1px solid var(--line);
    box-shadow: 0 -8px 30px rgb(5 47 59 / 7%);
    backdrop-filter: blur(16px);
  }
  .mobile-nav .nav-item { min-height: 54px; flex-direction: column; justify-content: center; gap: 3px; padding: 5px 2px; color: var(--muted); border-radius: 12px; font-size: .58rem; text-align: center; }
  .mobile-nav .nav-item:hover { color: var(--teal-700); background: var(--teal-50); }
  .mobile-nav .nav-item.active { color: var(--teal-700); background: var(--teal-50); box-shadow: none; }
  .mobile-nav .nav-item svg { width: 20px; height: 20px; }
  .mobile-nav .nav-item > span:nth-child(2) { flex: 0; }
  .toast { right: 14px; bottom: 84px; left: 14px; min-width: 0; }
}

@media (max-width: 480px) {
  .login-panel { align-content: start; padding: 114px 24px 34px; }
  .mobile-brand { left: 24px; }
  .login-heading h2 { font-size: 2rem; }
  .signup-panel { padding: 104px 19px 30px; }
  .signup-heading h2 { font-size: 1.8rem; }
  .copy-link { grid-template-columns: 1fr; }
  .metric-card { min-height: 145px; }
  .metric-card small { max-width: 120px; }
  .heading-meta > span:last-child { display: none; }
  .card-heading { align-items: flex-start; }
  .readiness-card { padding-top: 23px; }
  .readiness-copy { position: static; margin: -61px 0 21px 76px; min-height: 62px; }
  .table-intro { padding-inline: 18px; }
  .filter-control { width: 100%; justify-content: space-between; }
  .filter-control select { flex: 1; }
  .data-table td { grid-template-columns: 95px 1fr; }
}

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

@media (prefers-contrast: more) {
  :root { --line: #9ab0af; --muted: #405b63; }
  .surface, .metric-card { border-width: 2px; }
}

/* Clinic-ready operations workspace */
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; margin: -1px !important; padding: 0 !important; border: 0 !important; clip: rect(0 0 0 0) !important; white-space: nowrap !important; }

.side-nav { overflow-y: auto; gap: 3px; padding-block: 22px; scrollbar-width: none; }
.side-nav::-webkit-scrollbar { display: none; }
.nav-label-manage { margin-top: 17px; }
.side-nav .nav-item { min-height: 44px; }

.count-badge { display: inline-flex; min-height: 34px; align-items: center; padding: 7px 12px; color: var(--teal-700); background: var(--teal-100); border-radius: 999px; font-size: .71rem; font-weight: 800; }
.button-small { min-height: 34px; padding: 7px 12px; font-size: .68rem; }

.operations-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(330px, .75fr); gap: 18px; }
.action-centre-card, .communication-card { padding: clamp(20px, 2.2vw, 28px); }
.compact-readiness { min-height: 330px; }
.compact-readiness .check-list { max-height: 180px; overflow: auto; }

.action-list { min-height: 240px; }
.action-item { display: grid; grid-template-columns: 15px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 15px 0; border-top: 1px solid var(--line); }
.action-item:first-child { border-top: 0; }
.action-item.resolved { opacity: .68; }
.action-priority { align-self: stretch; display: flex; justify-content: center; }
.action-priority i { width: 3px; min-height: 38px; background: var(--amber-700); border-radius: 6px; }
.action-item.urgent .action-priority i { background: var(--red-700); }
.action-copy { display: grid; min-width: 0; }
.action-copy strong { font-size: .79rem; }
.action-copy p { overflow: hidden; margin: 2px 0; font-size: .7rem; text-overflow: ellipsis; white-space: nowrap; }
.action-copy small { color: var(--muted-light); font-size: .61rem; }

.mini-stat-grid, .insight-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 18px; }
.mini-stat-grid article, .insight-metrics article { display: grid; min-height: 112px; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 17px; box-shadow: var(--shadow-sm); }
.mini-stat-grid span, .insight-metrics span { color: var(--muted); font-size: .68rem; font-weight: 750; }
.mini-stat-grid strong, .insight-metrics strong { align-self: end; font-size: 1.8rem; line-height: 1.1; }
.mini-stat-grid small, .insight-metrics small { color: var(--muted-light); font-size: .62rem; }

.data-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 17px 22px; border-bottom: 1px solid var(--line); }
.search-control { position: relative; display: flex; min-width: min(380px, 50%); align-items: center; }
.search-control svg { position: absolute; left: 14px; z-index: 1; width: 17px; height: 17px; color: var(--muted); pointer-events: none; }
.search-control input { min-height: 42px; padding-left: 42px; background: var(--surface-soft); }
.toolbar-filters { display: flex; gap: 9px; }
.toolbar-filters select { width: auto; min-width: 145px; min-height: 42px; padding-block: 8px; background-color: var(--surface); }
.calls-table .table-summary { display: -webkit-box; max-width: 390px; overflow: hidden; color: var(--muted); font-size: .72rem; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.patient-cell > span { display: grid; }
.patient-cell small { color: var(--muted); font-size: .61rem; }
.row-action { padding: 7px 3px; color: var(--teal-700); background: transparent; font-size: .68rem; font-weight: 800; white-space: nowrap; }
.row-action:hover { color: var(--navy-900); }

.integration-banner { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 13px; margin-bottom: 18px; padding: 15px 18px; background: var(--teal-50); border: 1px solid #c8e8e4; border-radius: 16px; }
.integration-banner > div { display: grid; }
.integration-banner strong { font-size: .77rem; }
.integration-banner p { margin: 1px 0 0; font-size: .68rem; }
.integration-logo { display: grid; width: 40px; height: 40px; place-items: center; color: #fff; background: linear-gradient(145deg, var(--teal-600), var(--navy-900)); border-radius: 12px; font-size: .76rem; font-weight: 900; }

.segmented-control { display: inline-flex; gap: 4px; margin-bottom: 17px; padding: 4px; background: #e8eeee; border-radius: 13px; }
.segmented-control button { min-height: 36px; padding: 7px 14px; color: var(--muted); background: transparent; border-radius: 10px; font-size: .7rem; font-weight: 750; }
.segmented-control button.active { color: var(--ink); background: #fff; box-shadow: 0 2px 8px rgb(5 47 59 / 9%); }
.inbox-layout { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(310px, .7fr); align-items: start; gap: 18px; }
.inbox-card { min-height: 360px; padding: 12px 26px; }
.inbox-card .action-item { padding-block: 20px; }
.communication-card { position: sticky; top: 94px; }

.receptionist-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(340px, .9fr); align-items: start; gap: 18px; }
.settings-card { padding: clamp(21px, 2.4vw, 30px); }
.settings-card-heading { display: flex; align-items: center; gap: 13px; margin-bottom: 24px; }
.settings-card-heading > div { min-width: 0; flex: 1; }
.settings-card-heading h2 { margin: 0 0 2px; }
.settings-card-heading p { margin: 0; font-size: .7rem; }
.settings-icon { display: grid; width: 43px; height: 43px; flex: 0 0 auto; place-items: center; border-radius: 13px; }
.settings-icon svg { width: 21px; height: 21px; }
.settings-icon.teal { color: var(--teal-700); background: var(--teal-100); }
.settings-icon.blue { color: var(--blue-600); background: var(--blue-100); }
.settings-icon.violet { color: var(--violet-600); background: var(--violet-100); }
.settings-card label, .form-dialog label { display: grid; gap: 7px; margin-bottom: 15px; color: var(--ink); font-size: .7rem; font-weight: 760; }
.settings-card textarea { min-height: 94px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.toggle-stack { display: grid; margin-top: 8px; border-top: 1px solid var(--line); }
.toggle-row { display: flex !important; align-items: center; justify-content: space-between; gap: 20px !important; margin: 0 !important; padding: 15px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.toggle-row > span:first-child { display: grid; }
.toggle-row strong { font-size: .72rem; }
.toggle-row small { color: var(--muted); font-size: .62rem; font-weight: 450; }
.toggle-row input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-row i { position: relative; width: 42px; height: 24px; flex: 0 0 auto; background: #cad6d5; border-radius: 999px; transition: background .2s ease; }
.toggle-row i::after { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; content: ""; background: #fff; border-radius: 50%; box-shadow: 0 2px 5px rgb(5 47 59 / 18%); transition: transform .2s ease; }
.toggle-row input:checked + i { background: var(--teal-600); }
.toggle-row input:checked + i::after { transform: translateX(18px); }
.toggle-row input:focus-visible + i { outline: 3px solid var(--focus); outline-offset: 2px; }
.form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 20px; }
.save-state { margin-right: auto; color: var(--green-700); font-size: .65rem; }

.knowledge-list { display: grid; max-height: 620px; overflow: auto; }
.knowledge-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; padding: 17px 0; border-top: 1px solid var(--line); }
.knowledge-item:first-child { border-top: 0; }
.knowledge-item > div { display: grid; }
.knowledge-category { width: max-content; margin-bottom: 5px; color: var(--teal-700); font-size: .58rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.knowledge-item strong { font-size: .72rem; line-height: 1.45; }
.knowledge-item p { margin: 5px 0; font-size: .66rem; line-height: 1.4; }
.knowledge-item small { color: var(--muted-light); font-size: .59rem; }
.section-divider { display: flex; align-items: center; gap: 14px; margin: 34px 0 18px; color: var(--muted); font-size: .65rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.section-divider::before, .section-divider::after { height: 1px; flex: 1; content: ""; background: var(--line); }
.lab-notice .pilot-chip { margin-left: auto; flex: 0 0 auto; }

.insights-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(350px, .85fr); gap: 18px; }
.chart-card, .insight-story { padding: clamp(22px, 2.5vw, 30px); }
.chart-legend { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: .65rem; }
.chart-legend i { width: 9px; height: 9px; background: var(--teal-500); border-radius: 3px; }
.bar-chart { display: grid; height: 260px; grid-template-columns: repeat(7, 1fr); align-items: end; gap: clamp(8px, 2vw, 20px); padding-top: 24px; }
.bar-column { display: grid; height: 100%; grid-template-rows: 18px 1fr 20px; justify-items: center; gap: 7px; }
.bar-value { color: var(--muted); font-size: .62rem; font-weight: 750; }
.bar-track { position: relative; width: min(38px, 70%); height: 100%; overflow: hidden; background: var(--teal-50); border-radius: 10px 10px 5px 5px; }
.bar-track i { position: absolute; inset: auto 0 0; min-height: 3px; background: linear-gradient(180deg, #42c7b5, var(--teal-700)); border-radius: 10px 10px 5px 5px; transition: height .5s ease; }
.bar-column small { color: var(--muted); font-size: .6rem; font-weight: 750; }
.outcome-list { display: grid; gap: 17px; padding-top: 17px; }
.outcome-row { display: grid; grid-template-columns: 130px 1fr 25px; align-items: center; gap: 10px; }
.outcome-row > span { display: flex; align-items: center; gap: 8px; color: var(--ink-soft); font-size: .68rem; }
.outcome-row > span i { width: 8px; height: 8px; border-radius: 50%; }
.outcome-row > span i.success { background: var(--teal-500); }
.outcome-row > span i.warning { background: #d99829; }
.outcome-row > span i.danger { background: var(--red-700); }
.outcome-row > span i.info { background: var(--blue-600); }
.outcome-row > div { height: 7px; overflow: hidden; background: #edf2f1; border-radius: 999px; }
.outcome-row > div i { display: block; height: 100%; min-width: 3px; background: var(--teal-500); border-radius: inherit; }
.size-0 { width: 0% !important; height: 0% !important; }
.size-5 { width: 5% !important; height: 5% !important; }
.size-10 { width: 10% !important; height: 10% !important; }
.size-15 { width: 15% !important; height: 15% !important; }
.size-20 { width: 20% !important; height: 20% !important; }
.size-25 { width: 25% !important; height: 25% !important; }
.size-30 { width: 30% !important; height: 30% !important; }
.size-35 { width: 35% !important; height: 35% !important; }
.size-40 { width: 40% !important; height: 40% !important; }
.size-45 { width: 45% !important; height: 45% !important; }
.size-50 { width: 50% !important; height: 50% !important; }
.size-55 { width: 55% !important; height: 55% !important; }
.size-60 { width: 60% !important; height: 60% !important; }
.size-65 { width: 65% !important; height: 65% !important; }
.size-70 { width: 70% !important; height: 70% !important; }
.size-75 { width: 75% !important; height: 75% !important; }
.size-80 { width: 80% !important; height: 80% !important; }
.size-85 { width: 85% !important; height: 85% !important; }
.size-90 { width: 90% !important; height: 90% !important; }
.size-95 { width: 95% !important; height: 95% !important; }
.size-100 { width: 100% !important; height: 100% !important; }
.outcome-row strong { text-align: right; font-size: .7rem; }
.insight-story { grid-column: 1 / -1; display: grid; grid-template-columns: 62px minmax(0, 1fr) auto; align-items: center; gap: 20px; color: #fff; background: linear-gradient(135deg, var(--navy-950), var(--navy-800)); border: 0; }
.insight-story-icon { display: grid; width: 58px; height: 58px; place-items: center; color: #8be6d4; background: rgb(21 164 154 / 16%); border-radius: 18px; }
.insight-story-icon svg { width: 26px; height: 26px; }
.insight-story .eyebrow { color: #7fdfd0; }
.insight-story h2 { color: #fff; }
.insight-story p:last-child { margin: 0; color: rgb(255 255 255 / 60%); font-size: .72rem; }
.insight-story dl { display: flex; gap: 26px; margin: 0; }
.insight-story dl > div { display: grid; }
.insight-story dt { color: rgb(255 255 255 / 45%); font-size: .58rem; text-transform: uppercase; }
.insight-story dd { margin: 3px 0 0; color: #fff; font-size: .84rem; font-weight: 800; }

.settings-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(330px, .8fr); align-items: start; gap: 18px; }
.settings-layout > :first-child { grid-row: span 2; }
.hours-heading { display: flex; margin: 11px 0 10px; padding-top: 17px; border-top: 1px solid var(--line); }
.hours-heading > div { display: grid; }
.hours-heading strong { font-size: .74rem; }
.hours-heading small { color: var(--muted); font-size: .62rem; }
.hours-editor { display: grid; }
.hours-row { display: grid; grid-template-columns: 90px 1fr 20px 1fr 72px; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); }
.hours-row:first-child { border-top: 0; }
.hours-row strong { font-size: .68rem; }
.hours-row input[type="time"] { min-height: 38px; padding: 7px 9px; font-size: .68rem; }
.hours-row > span { color: var(--muted); font-size: .61rem; text-align: center; }
.closed-check { display: flex !important; align-items: center; gap: 6px !important; margin: 0 !important; color: var(--muted) !important; font-size: .61rem !important; }
.closed-check input { width: 15px; min-height: 15px; accent-color: var(--teal-600); }
.integration-list { display: grid; }
.integration-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 15px 0; border-top: 1px solid var(--line); }
.integration-row:first-child { border-top: 0; }
.integration-row > span:first-child { display: grid; width: 38px; height: 38px; place-items: center; color: var(--teal-700); background: var(--teal-50); border: 1px solid #d2ebe7; border-radius: 11px; font-size: .7rem; font-weight: 900; }
.integration-row > div { display: grid; }
.integration-row strong { font-size: .72rem; }
.integration-row small { color: var(--muted); font-size: .61rem; }
.security-card .check-list { grid-template-columns: 1fr; padding-top: 0; border: 0; }
.security-card .check-item { grid-template-columns: 20px 1fr auto; border-top: 1px solid var(--line); }
.security-card .check-item:first-child { border-top: 0; }
.security-card .check-item > span:nth-child(2) { color: var(--ink-soft); }
.security-card .check-item strong { display: block; color: var(--muted); font-size: .58rem; }
.security-card .check-item.passed .check-symbol { color: var(--green-700); background: var(--green-100); }
.security-card .check-item.pending .check-symbol { color: var(--amber-700); background: var(--amber-100); }

.people-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(330px, .65fr); align-items: start; gap: 18px; }
.team-list { display: grid; }
.permission-hidden { display: none !important; }
.team-row { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto auto; align-items: center; gap: 12px; min-height: 66px; padding: 10px 0; border-top: 1px solid var(--line); }
.team-row:first-child { border-top: 0; }
.team-avatar { display: grid; width: 40px; height: 40px; place-items: center; color: var(--teal-700); background: var(--teal-50); border: 1px solid #d1ebe7; border-radius: 13px; font-size: .68rem; font-weight: 850; }
.team-person { display: grid; min-width: 0; }
.team-person strong { overflow: hidden; font-size: .75rem; text-overflow: ellipsis; white-space: nowrap; }
.team-person small { overflow: hidden; color: var(--muted); font-size: .63rem; text-overflow: ellipsis; white-space: nowrap; }
.team-role-select { width: auto; min-width: 118px; min-height: 37px; padding: 7px 30px 7px 10px; font-size: .65rem; }
.team-menu-button { min-width: 78px; min-height: 36px; padding: 6px 10px; font-size: .65rem; }
.invitation-row { opacity: .82; }
.invitation-row .team-avatar { color: var(--violet-600); background: var(--violet-100); border-color: #ddd2f5; }
.role-guide { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.role-guide article { min-width: 0; padding: 11px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 12px; }
.role-guide strong { display: block; margin-bottom: 4px; color: var(--ink); font-size: .64rem; }
.role-guide p { margin: 0; color: var(--muted); font-size: .55rem; line-height: 1.45; }
.account-form { display: grid; gap: 12px; }
.account-form > div:first-child { display: grid; }
.account-form > div:first-child strong { font-size: .74rem; }
.account-form > div:first-child small { color: var(--muted); font-size: .62rem; }
.account-form input { min-height: 43px; }
.account-separator { height: 1px; margin: 23px 0; background: var(--line); }
.role-explainer { display: flex; align-items: flex-start; gap: 10px; margin: 5px 0; padding: 13px; background: var(--teal-50); border: 1px solid #d0ebe7; border-radius: 13px; }
.role-explainer > span { display: grid; width: 20px; height: 20px; flex: 0 0 auto; place-items: center; color: #fff; background: var(--teal-700); border-radius: 50%; font-size: .65rem; font-weight: 850; }
.role-explainer p { margin: 0; font-size: .68rem; }
.invite-result { position: relative; padding: 18px 4px 4px; text-align: center; }
.invite-result-close { position: absolute; top: -8px; right: -2px; }
.success-check { display: grid; width: 52px; height: 52px; margin: 0 auto 14px; place-items: center; color: var(--green-700); background: var(--green-100); border-radius: 17px; font-size: 1.2rem; font-weight: 900; }
.invite-result h3 { margin: 0 0 6px; font-size: 1.45rem; }
.invite-result p { margin-bottom: 19px; font-size: .75rem; }
.copy-link { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; text-align: left; }
.copy-link input { font-size: .68rem; }
.invite-result > .text-button { margin-top: 12px; }

.mobile-sheet, .sheet-backdrop { display: none; }
.sheet-backdrop { position: fixed; z-index: 79; inset: 0; background: rgb(3 29 39 / 43%); backdrop-filter: blur(2px); }
.mobile-sheet { position: fixed; z-index: 80; right: 0; bottom: 0; left: 0; padding: 7px 18px max(26px, env(safe-area-inset-bottom)); background: #fff; border-radius: 24px 24px 0 0; box-shadow: 0 -24px 70px rgb(5 47 59 / 22%); transform: translateY(105%); transition: transform .28s ease; }
.mobile-sheet.open { transform: translateY(0); }
.sheet-handle { width: 44px; height: 4px; margin: 2px auto 14px; background: var(--line-strong); border-radius: 999px; }
.sheet-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.sheet-heading strong { font-size: .87rem; }
.sheet-heading .icon-button { width: 36px; height: 36px; }
.sheet-links { display: grid; }
.sheet-links button { display: grid; grid-template-columns: 42px minmax(0, 1fr) 20px; align-items: center; gap: 12px; padding: 14px 4px; color: var(--ink); background: transparent; border-top: 1px solid var(--line); text-align: left; }
.sheet-links button > span:nth-child(2) { display: grid; }
.sheet-links button strong { font-size: .76rem; }
.sheet-links button small { color: var(--muted); font-size: .61rem; }
.sheet-links button > i { color: var(--teal-700); font-style: normal; }
.sheet-link-icon { display: grid; width: 40px; height: 40px; place-items: center; color: var(--teal-700); background: var(--teal-50); border-radius: 12px; }
.sheet-link-icon svg { width: 19px; height: 19px; }

.detail-dialog { width: min(620px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow: auto; padding: 28px; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 30px 90px rgb(5 47 59 / 28%); }
.detail-dialog::backdrop { background: rgb(3 29 39 / 48%); backdrop-filter: blur(4px); }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.dialog-heading h2 { margin: 0; font-size: 1.45rem; }
.dialog-close { flex: 0 0 auto; }
.dialog-status-row { display: flex; gap: 7px; margin-bottom: 18px; }
.call-detail-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.call-detail-grid > div { display: grid; gap: 3px; padding: 13px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 12px; }
.call-detail-grid small, .summary-panel > small { color: var(--muted); font-size: .57rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.call-detail-grid strong { font-size: .7rem; }
.summary-panel { margin-top: 14px; padding: 17px; background: var(--teal-50); border: 1px solid #caeae5; border-radius: 14px; }
.summary-panel p { margin: 6px 0 0; color: var(--ink-soft); font-size: .74rem; }
.privacy-note { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 13px 0; color: var(--teal-700); }
.privacy-note svg { width: 20px; height: 20px; }
.privacy-note span { display: grid; }
.privacy-note strong { font-size: .69rem; }
.privacy-note small { color: var(--muted); font-size: .59rem; }
.dialog-actions { display: flex; justify-content: flex-end; margin-top: 8px; }
.form-dialog form { display: grid; }
.approval-check { display: flex !important; align-items: center; gap: 10px !important; padding: 13px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 13px; }
.approval-check input { width: 18px; min-height: 18px; accent-color: var(--teal-600); }
.approval-check > span { display: grid; }
.approval-check small { color: var(--muted); font-size: .6rem; font-weight: 450; }

@media (max-width: 1180px) {
  .operations-grid, .receptionist-grid, .settings-layout, .people-layout { grid-template-columns: 1fr; }
  .settings-layout > :first-child { grid-row: auto; }
  .inbox-layout { grid-template-columns: 1fr; }
  .communication-card { position: static; }
  .insight-story { grid-template-columns: 58px 1fr; }
  .insight-story dl { grid-column: 1 / -1; justify-content: space-around; padding-top: 17px; border-top: 1px solid rgb(255 255 255 / 10%); }
  .role-guide { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .mini-stat-grid, .insight-metrics { grid-template-columns: repeat(2, 1fr); }
  .insights-grid { grid-template-columns: 1fr; }
  .insight-story { grid-column: auto; }
  .data-toolbar { align-items: stretch; flex-direction: column; }
  .search-control { min-width: 100%; }
}

@media (max-width: 760px) {
  .mobile-sheet, .sheet-backdrop { display: block; }
  .sheet-backdrop[hidden] { display: none; }
  .operations-grid { gap: 13px; }
  .action-centre-card, .communication-card { padding: 19px; }
  .compact-readiness { min-height: 0; }
  .mini-stat-grid, .insight-metrics { gap: 9px; }
  .mini-stat-grid article, .insight-metrics article { min-height: 100px; padding: 15px; }
  .data-toolbar { padding: 14px 17px; }
  .toolbar-filters { display: grid; grid-template-columns: 1fr 1fr; }
  .toolbar-filters select { width: 100%; min-width: 0; }
  .inbox-card { padding: 7px 18px; }
  .action-item { grid-template-columns: 11px minmax(0, 1fr); }
  .action-item > .button, .action-item > .status-tag { grid-column: 2; width: max-content; }
  .settings-card { padding: 20px; }
  .form-grid { grid-template-columns: 1fr; }
  .lab-notice { align-items: flex-start; }
  .lab-notice .pilot-chip { display: none; }
  .insight-story { grid-template-columns: 48px 1fr; }
  .insight-story-icon { width: 48px; height: 48px; border-radius: 15px; }
  .insight-story dl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .bar-chart { height: 220px; gap: 6px; }
  .hours-row { grid-template-columns: 72px 1fr 16px 1fr; }
  .hours-row .closed-check { grid-column: 2 / -1; justify-self: end; }
  .call-detail-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-dialog { padding: 21px; border-radius: 20px; }
  .team-row { grid-template-columns: 42px minmax(0, 1fr) auto; }
  .team-row .team-role-select { grid-column: 2; width: 100%; }
  .team-row .team-menu-button { grid-column: 3; grid-row: 1 / span 2; }
  .role-guide { grid-template-columns: 1fr 1fr; }
  .auth-form-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .mini-stat-grid, .insight-metrics { grid-template-columns: 1fr 1fr; }
  .mini-stat-grid article, .insight-metrics article { min-height: 92px; padding: 13px; }
  .mini-stat-grid strong, .insight-metrics strong { font-size: 1.5rem; }
  .segmented-control { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; }
  .segmented-control button { padding-inline: 6px; }
  .toolbar-filters { grid-template-columns: 1fr; }
  .hours-row { grid-template-columns: 1fr 1fr 16px 1fr; }
  .hours-row > strong { grid-column: 1 / -1; }
  .outcome-row { grid-template-columns: 105px 1fr 20px; }
  .insight-story { display: block; }
  .insight-story-icon { margin-bottom: 14px; }
  .insight-story dl { margin-top: 16px; }
}
