@font-face {
  font-family: "ClinicSans";
  src: url("fonts/IRANSans.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #17252b;
  --muted: #6b7c82;
  --soft: #f4f7f7;
  --line: #e3ebea;
  --white: #fff;
  --teal: #0d766e;
  --teal-dark: #095c57;
  --teal-soft: #e5f4f1;
  --blue: #3676c8;
  --orange: #dc7833;
  --violet: #7966c5;
  --red: #c94f55;
  --shadow: 0 14px 40px rgba(27, 62, 66, .08);
  --radius: 18px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: #f5f8f8;
  font-family: ClinicSans, Tahoma, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.65;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

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

.sidebar {
  position: fixed;
  inset-block: 0;
  inset-inline-start: 0;
  z-index: 20;
  width: 252px;
  padding: 24px 18px 18px;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-inline-end: 1px solid var(--line);
  overflow-y: auto;
  transition: transform .25s ease;
}

.brand { display: flex; align-items: center; gap: 12px; padding: 0 9px 28px; }
.brand-logo { width: 46px; height: 46px; flex: 0 0 auto; }
.brand strong { display: block; font-size: 20px; line-height: 1.25; }
.brand small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.brand-mark { position: relative; width: 42px; height: 42px; flex: 0 0 auto; border-radius: 13px; background: linear-gradient(145deg, #159086, #086b65); box-shadow: 0 7px 16px rgba(13,118,110,.22); }
.brand-mark span { position: absolute; inset: 10px 18px; border-radius: 4px; background: white; }
.brand-mark span:last-child { inset: 18px 10px; }

.main-nav { display: flex; flex-direction: column; flex-shrink: 0; gap: 3px; }
.nav-item {
  width: 100%;
  min-height: 38px;
  padding: 7px 11px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #5b6e73;
  background: transparent;
  border: 0;
  border-radius: 12px;
  text-decoration: none;
  text-align: start;
  font-size: 13px;
  line-height: 1.4;
  transition: .18s ease;
}
.nav-item svg { width: 19px; flex: 0 0 auto; }
.nav-item span { flex: 1; }
.nav-item:hover { color: var(--teal); background: #f3f8f7; }
.nav-item.active { color: var(--teal-dark); background: var(--teal-soft); font-weight: 700; }
.nav-item em { min-width: 25px; padding: 1px 7px; color: white; background: var(--teal); border-radius: 999px; font-size: 11px; font-style: normal; text-align: center; }
.nav-item small { color: #91a0a4; font-size: 9px; }
.coming-soon { opacity: .78; }
.sidebar-bottom { margin-top: auto; flex-shrink: 0; }
.user-card { margin-top: 16px; padding: 14px 10px 0; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.user-card strong { display: block; font-size: 12px; }
.user-card small { display: block; color: var(--muted); font-size: 10px; }
.avatar { display: grid; place-items: center; width: 58px; height: 58px; color: #0b6861; background: linear-gradient(135deg, #d8f0ed, #a8d8d2); border: 3px solid rgba(255,255,255,.8); border-radius: 20px; font-size: 19px; font-weight: 800; }
.avatar-small { width: 38px; height: 38px; border-width: 2px; border-radius: 12px; font-size: 11px; }
.online-dot { width: 8px; height: 8px; margin-inline-start: auto; border-radius: 50%; background: #2db97d; box-shadow: 0 0 0 3px #e5f7ef; }

.main-content { margin-inline-start: 252px; padding: 27px 32px 20px; min-width: 0; }
.topbar { max-width: 1500px; margin: 0 auto 22px; display: flex; align-items: center; gap: 16px; }
.topbar h1 { margin: -3px 0 0; font-size: 23px; letter-spacing: -.5px; }
.eyebrow { margin: 0 0 1px; color: var(--teal); font-size: 10px; font-weight: 700; letter-spacing: .15px; }
.topbar-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 10px; }
.logout-button { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; gap: 6px; min-height: 34px; padding: 6px 10px; color: #b42336; background: #fff4f4; border: 1px solid #efc4ca; border-radius: 8px; font-size: 11px; font-weight: 700; line-height: 1.4; white-space: nowrap; transition: background .18s ease, border-color .18s ease; }
.logout-button > span[aria-hidden] { font-family: monospace; font-size: 14px; }
.logout-button:hover { color: #941c2b; background: #ffe8eb; border-color: #d88a96; }
.logout-button:focus-visible { outline: 2px solid #b42336; outline-offset: 3px; }
@media (pointer: coarse) { .nav-item, .logout-button { min-height: 44px; } }
.local-badge { display: inline-flex; align-items: center; gap: 7px; padding: 7px 11px; color: #5a6c70; background: white; border: 1px solid var(--line); border-radius: 999px; font-size: 10px; }
.local-badge span { width: 7px; height: 7px; border-radius: 50%; background: #30b27b; box-shadow: 0 0 0 3px #e0f5ec; }
.help-button, .icon-button { display: grid; place-items: center; width: 38px; height: 38px; color: #5d7175; background: white; border: 1px solid var(--line); border-radius: 11px; }
.help-button:hover, .icon-button:hover { color: var(--teal); border-color: #b9d8d5; }
.mobile-menu { display: none; }

.metrics { max-width: 1500px; margin: 0 auto 20px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.metric-card { min-width: 0; padding: 17px 18px; display: flex; align-items: center; gap: 13px; background: white; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 5px 18px rgba(27,62,66,.035); }
.metric-icon { width: 42px; height: 42px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 13px; }
.metric-card small, .metric-card span { display: block; color: var(--muted); }
.metric-card small { font-size: 10px; font-weight: 700; }
.metric-card strong { display: inline-block; margin: -2px 0; font-size: 23px; }
.metric-card span { font-size: 9px; }
.accent-teal .metric-icon { color: var(--teal); background: var(--teal-soft); }
.accent-blue .metric-icon { color: var(--blue); background: #e8f1fb; }
.accent-orange .metric-icon { color: var(--orange); background: #fff0e6; }
.accent-violet .metric-icon { color: var(--violet); background: #f0ecfd; }

.patient-workspace { max-width: 1500px; min-height: 650px; margin: 0 auto; display: grid; grid-template-columns: 330px minmax(0, 1fr); direction: rtl; background: white; border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); overflow: hidden; }
.patient-browser { min-width: 0; padding: 21px 18px; border-inline-end: 1px solid var(--line); background: #fbfcfc; }
.browser-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.browser-header h2 { margin: 0; font-size: 17px; }
.browser-header span { display: block; margin-top: -2px; color: var(--muted); font-size: 9px; }
.primary-button, .secondary-button {
  min-height: 43px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 12px;
  border: 0;
  font-weight: 700;
  transition: .18s ease;
}
.primary-button { color: white; background: var(--teal); box-shadow: 0 6px 14px rgba(13,118,110,.18); }
.primary-button:hover { background: var(--teal-dark); transform: translateY(-1px); }
.primary-button:disabled { opacity: .6; transform: none; cursor: wait; }
.secondary-button { color: #53666b; background: white; border: 1px solid var(--line); }
.secondary-button:hover { border-color: #b4cecb; color: var(--teal); }
.primary-button.compact { min-height: 36px; padding: 0 11px; font-size: 10px; border-radius: 10px; }
.primary-button.compact svg { width: 15px; }

.search-box { height: 42px; padding: 0 12px; display: flex; align-items: center; gap: 8px; color: #849397; background: white; border: 1px solid var(--line); border-radius: 12px; transition: .18s ease; }
.search-box:focus-within { border-color: #7cb9b3; box-shadow: 0 0 0 3px rgba(13,118,110,.08); }
.search-box svg { width: 17px; }
.search-box input { width: 100%; min-width: 0; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 10px; }
.search-box input::placeholder { color: #a0acae; }
.filter-row { display: flex; gap: 6px; margin: 13px 0; }
.filter-chip { padding: 5px 11px; color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 999px; font-size: 9px; }
.filter-chip.active { color: var(--teal); background: var(--teal-soft); border-color: transparent; font-weight: 700; }
.patient-list { max-height: 525px; padding-inline-end: 3px; overflow: auto; scrollbar-width: thin; scrollbar-color: #cddcda transparent; }
.patient-card { width: 100%; padding: 13px 12px; margin-bottom: 7px; position: relative; display: grid; grid-template-columns: 43px minmax(0,1fr) auto; align-items: center; gap: 10px; color: inherit; background: white; border: 1px solid transparent; border-radius: 14px; text-align: start; transition: .16s ease; }
.patient-card:hover { border-color: #d2e4e2; transform: translateX(-1px); }
.patient-card.active { background: #edf7f5; border-color: #c5e3df; }
.patient-card .avatar { width: 43px; height: 43px; border: 0; border-radius: 13px; font-size: 13px; }
.patient-card strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.patient-card small { display: block; color: var(--muted); font-size: 9px; direction: rtl; }
.patient-card svg { width: 15px; color: #9aabad; }
.patient-card.active svg { color: var(--teal); }
.priority-dot { position: absolute; top: 11px; right: 9px; width: 7px; height: 7px; border: 2px solid white; border-radius: 50%; background: #d58339; }
.priority-dot.urgent { background: var(--red); }
.empty-list { padding: 40px 15px; color: var(--muted); text-align: center; }
.empty-list strong { display: block; margin-bottom: 3px; color: var(--ink); }

.patient-detail { min-width: 0; container: patient-record / inline-size; }
.profile-hero { padding: 24px 28px 20px; position: relative; overflow: hidden; color: white; background: linear-gradient(125deg, #0a5f5a 0%, #0e7d74 65%, #238d83 100%); }
.profile-hero::after { content: ""; position: absolute; width: 290px; height: 290px; left: -80px; top: -160px; border: 48px solid rgba(255,255,255,.055); border-radius: 50%; }
.profile-head { position: relative; z-index: 1; display: flex; align-items: center; gap: 15px; }
.profile-head .avatar { width: 64px; height: 64px; color: white; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.28); backdrop-filter: blur(6px); border-radius: 19px; }
.profile-title { min-width: 0; }
.profile-title h2 { margin: 0 0 3px; font-size: 21px; }
.profile-meta { display: flex; flex-wrap: wrap; gap: 7px 15px; color: rgba(255,255,255,.82); font-size: 10px; }
.profile-meta span { display: inline-flex; align-items: center; gap: 5px; }
.profile-meta svg { width: 13px; }
.profile-badges { margin-inline-start: auto; display: flex; gap: 7px; align-self: flex-start; }
.status-badge { padding: 5px 10px; border-radius: 999px; font-size: 9px; font-weight: 700; }
.status-badge.light { color: white; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.18); }
.status-badge.urgent { color: #ffe9e9; background: rgba(120,12,20,.28); }
.status-badge.high { color: #fff1dc; background: rgba(137,73,11,.3); }
.profile-actions { position: relative; z-index: 1; margin-top: 17px; display: flex; flex-wrap: wrap; gap: 8px; }
.hero-button { min-height: 34px; padding: 0 12px; display: inline-flex; align-items: center; gap: 6px; color: white; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.22); border-radius: 10px; font-size: 9px; }
.hero-button:hover { background: rgba(255,255,255,.21); }
.hero-button svg { width: 14px; }
.hero-button.primary { color: #0b665f; background: white; font-weight: 700; }

.detail-tabs { padding: 0 27px; display: flex; gap: 24px; border-bottom: 1px solid var(--line); }
.detail-tab { padding: 15px 1px 12px; position: relative; color: var(--muted); background: transparent; border: 0; font-size: 10px; }
.detail-tab.active { color: var(--teal); font-weight: 700; }
.detail-tab.active::after { content: ""; position: absolute; right: 0; left: 0; bottom: -1px; height: 2px; background: var(--teal); border-radius: 2px 2px 0 0; }
.tab-panel { display: none; padding: 22px 27px 28px; animation: fadeIn .18s ease; }
.tab-panel.active { display: block; }
@keyframes fadeIn { from { opacity: .4; transform: translateY(3px); } }

.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.info-card { padding: 18px; border: 1px solid var(--line); border-radius: 16px; }
.info-card.full { grid-column: 1 / -1; }
.card-heading { margin-bottom: 15px; display: flex; align-items: center; gap: 9px; }
.card-heading .heading-icon { width: 31px; height: 31px; display: grid; place-items: center; color: var(--teal); background: var(--teal-soft); border-radius: 10px; }
.card-heading svg { width: 15px; }
.card-heading h3 { margin: 0; font-size: 12px; }
.card-heading p { margin: -2px 0 0; color: var(--muted); font-size: 8px; }
.info-list { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 13px 18px; }
.info-item small { display: block; color: #8b989b; font-size: 8px; }
.info-item strong { display: block; overflow-wrap: anywhere; font-size: 10px; font-weight: 600; }
.info-item a { color: var(--teal); text-decoration: none; }
.info-item a:hover { text-decoration: underline; }
.diagnosis-bilingual b, .diagnosis-bilingual small { display: block; }
.diagnosis-bilingual small { margin-top: 2px; color: var(--muted); font-size: 8px; direction: ltr; text-align: start; }
.diagnosis-bilingual code { padding: 1px 4px; color: var(--teal); background: var(--teal-soft); border-radius: 4px; font-size: 8px; }
.ltr { direction: ltr; text-align: start; unicode-bidi: plaintext; }
.note-box { padding: 12px 14px; color: #5d5949; background: #fffbec; border: 1px solid #f1e6b9; border-radius: 12px; font-size: 10px; }
.note-box.empty { color: var(--muted); background: var(--soft); border-color: var(--line); }

.clinical-banner { margin-bottom: 16px; padding: 17px 18px; display: flex; gap: 12px; background: linear-gradient(120deg, #edf8f6, #f7fbfa); border: 1px solid #d2e9e5; border-radius: 15px; }
.clinical-banner .heading-icon { width: 36px; height: 36px; flex: 0 0 auto; display: grid; place-items: center; color: var(--teal); background: white; border-radius: 11px; box-shadow: 0 4px 10px rgba(20,80,76,.07); }
.clinical-banner h3 { margin: 0; font-size: 12px; }
.clinical-banner p { margin: 2px 0 0; color: var(--muted); font-size: 9px; }

.timeline-header { margin-bottom: 18px; display: flex; align-items: center; justify-content: space-between; }
.timeline-header h3 { margin: 0; font-size: 13px; }
.timeline-header p { margin: 0; color: var(--muted); font-size: 9px; }
.timeline { position: relative; padding: 0; }
.timeline::before { content: ""; position: absolute; left: 50%; top: 22px; bottom: 22px; width: 2px; transform: translateX(-50%); background: #d8e6e4; }
.timeline-item { position: relative; width: 50%; padding: 0 0 20px; padding-inline-end: 24px; }
.timeline-item::before { content: ""; position: absolute; inset-inline-end: 0; top: 22px; width: 24px; height: 1px; background: #d8e6e4; }
.timeline-item:nth-child(even) { margin-inline-start: 50%; padding-inline-start: 24px; padding-inline-end: 0; }
.timeline-item:nth-child(even)::before { inset-inline-start: 0; inset-inline-end: auto; }
.timeline-dot { position: absolute; inset-inline-end: -5px; top: 18px; z-index: 1; width: 10px; height: 10px; background: white; border: 2px solid var(--teal); border-radius: 50%; box-shadow: 0 0 0 4px #edf7f5; }
.timeline-item:nth-child(even) .timeline-dot { inset-inline-start: -5px; inset-inline-end: auto; }
.timeline-card { min-width: 0; padding: 14px 15px; background: #fbfcfc; border: 1px solid var(--line); border-radius: 13px; overflow-wrap: anywhere; }
.timeline-title { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 4px 8px; }
.timeline-title h4 { margin: 0; font-size: 11px; }
.timeline-title time { margin-inline-start: auto; color: var(--teal); font-size: 9px; font-weight: 700; direction: ltr; white-space: nowrap; }
.timeline-tags { margin-top: 5px; display: flex; flex-wrap: wrap; gap: 5px; }
.timeline-tags span { padding: 2px 7px; color: #66777b; background: white; border: 1px solid var(--line); border-radius: 999px; font-size: 8px; }
.timeline-card p { margin: 8px 0 0; color: var(--muted); font-size: 9px; }

@container patient-record (max-width: 520px) {
  .timeline { padding-inline-start: 8px; }
  .timeline::before { left: auto; inset-inline-start: 8px; transform: none; }
  .timeline-item, .timeline-item:nth-child(even) { width: 100%; margin-inline-start: 0; padding-inline-start: 24px; padding-inline-end: 0; }
  .timeline-item::before, .timeline-item:nth-child(even)::before { inset-inline-start: 0; inset-inline-end: auto; }
  .timeline-dot, .timeline-item:nth-child(even) .timeline-dot { inset-inline-start: -4px; inset-inline-end: auto; }
}
.next-visit { color: #8a6428 !important; }

.privacy-note { max-width: 1500px; margin: 12px auto 0; color: #8a999c; font-size: 9px; text-align: center; }

.modal { width: min(880px, calc(100vw - 30px)); max-height: calc(100vh - 30px); padding: 0; color: var(--ink); background: white; border: 0; border-radius: 22px; box-shadow: 0 30px 80px rgba(7,35,38,.25); overflow: hidden; }
.modal::backdrop { background: rgba(16,37,40,.5); backdrop-filter: blur(3px); }
.modal form { display: flex; flex-direction: column; max-height: calc(100vh - 30px); }
.modal-header { padding: 20px 24px 15px; display: flex; align-items: center; border-bottom: 1px solid var(--line); }
.modal-header h2 { margin: -3px 0 0; font-size: 18px; }
.modal-header .icon-button { margin-inline-start: auto; }
.modal-body { padding: 21px 24px; overflow-y: auto; }
.modal-footer { padding: 14px 24px; display: flex; justify-content: flex-end; gap: 9px; background: #fafcfc; border-top: 1px solid var(--line); }
.form-section + .form-section { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); }
.section-heading { margin-bottom: 15px; display: flex; gap: 10px; align-items: center; }
.section-heading > span { width: 29px; height: 29px; display: grid; place-items: center; color: var(--teal); background: var(--teal-soft); border-radius: 9px; font-size: 10px; font-weight: 800; }
.section-heading h3 { margin: 0; font-size: 12px; }
.section-heading p { margin: -2px 0 0; color: var(--muted); font-size: 8px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 13px 15px; }
.form-grid.three-cols { grid-template-columns: repeat(3, minmax(0,1fr)); }
.field { min-width: 0; display: block; }
.field > span { display: block; margin: 0 3px 5px; color: #536469; font-size: 9px; font-weight: 700; }
.field b { color: var(--red); }
.field input, .field select, .field textarea { width: 100%; padding: 9px 11px; color: var(--ink); background: white; border: 1px solid #dbe5e4; border-radius: 10px; outline: 0; font-size: 10px; transition: .16s ease; }
.field input, .field select { height: 40px; }
.field textarea { resize: vertical; min-height: 70px; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: #72b4ae; box-shadow: 0 0 0 3px rgba(13,118,110,.08); }
.field input::placeholder, .field textarea::placeholder { color: #a9b3b5; }
.span-2 { grid-column: span 2; }
.form-error { min-height: 18px; margin: 12px 0 0; color: var(--red); font-size: 9px; }
.event-modal { width: min(660px, calc(100vw - 30px)); }

.toast { position: fixed; z-index: 100; left: 28px; bottom: 25px; min-width: 260px; padding: 12px 14px; display: flex; align-items: center; gap: 10px; color: #21433f; background: white; border: 1px solid #d5e5e2; border-radius: 13px; box-shadow: 0 14px 40px rgba(16,52,55,.18); transform: translateY(100px); opacity: 0; pointer-events: none; transition: .25s ease; }
.toast.show { transform: translateY(0); opacity: 1; }
.toast.error .toast-check { color: white; background: var(--red); }
.toast-check { width: 24px; height: 24px; display: grid; place-items: center; color: white; background: var(--teal); border-radius: 50%; font-size: 12px; }
.toast p { margin: 0; font-size: 10px; font-weight: 700; }

.list-skeleton, .skeleton-line, .skeleton-block { position: relative; overflow: hidden; background: #edf2f1; }
.list-skeleton::after, .skeleton-line::after, .skeleton-block::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.7), transparent); transform: translateX(100%); animation: shimmer 1.35s infinite; }
.list-skeleton { height: 69px; margin-bottom: 7px; border-radius: 14px; }
.detail-skeleton { padding: 40px; }
.skeleton-line { width: 45%; height: 14px; margin-bottom: 12px; border-radius: 7px; }
.skeleton-line.wide { width: 70%; height: 22px; }
.skeleton-block { height: 360px; margin-top: 35px; border-radius: 18px; }
@keyframes shimmer { to { transform: translateX(-100%); } }

.mobile-overlay { display: none; }

.view-pane { display: none; }
.view-pane.active { display: block; animation: fadeIn .22s ease; }
.settings-intro { margin: 0 0 22px; }
.settings-intro h2 { margin: 0 0 5px; font-size: 23px; }
.settings-intro > p:last-child { margin: 0; color: var(--muted); font-size: 13px; }
.sms-settings-layout { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(260px, 1fr); gap: 22px; align-items: start; max-width: 1200px; }
.settings-card { min-width: 0; padding: 25px; background: white; border: 1px solid var(--line); border-radius: 18px; }
.settings-card h3 { margin: 0; font-size: 16px; }
.settings-card > p, .settings-card .field small { color: var(--muted); font-size: 12px; }
.settings-card fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.settings-card .field small { font-size: 11px; font-weight: 400; }
.settings-card .field input { min-width: 0; }
.settings-card button:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.sms-provider-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.sms-provider-heading small { color: var(--muted); }
.sms-provider-icon { display: grid; place-items: center; width: 46px; height: 46px; color: var(--teal); background: var(--teal-soft); border-radius: 14px; }
.sms-status { margin-inline-start: auto; padding: 4px 12px; color: var(--muted); background: #eef1f1; border-radius: 999px; font-size: 11px; }
.sms-status.enabled { color: var(--teal-dark); background: var(--teal-soft); }
.sms-disabled-note { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 20px; padding: 16px; background: #f5f8f7; border: 1px solid var(--line); border-radius: 12px; }
.sms-disabled-note > svg { flex-shrink: 0; color: var(--teal); }
.sms-disabled-note strong { font-size: 12px; }
.sms-disabled-note p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.sms-disabled-note[hidden], .sms-clear-key[hidden] { display: none; }
.sms-settings-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; margin-top: 19px; }
.sms-clear-key { display: flex; align-items: center; gap: 7px; margin-top: 10px; color: var(--muted); font-size: 12px; }
.sms-settings-footer { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 25px; padding-top: 20px; border-top: 1px solid var(--line); }
#smsSaveStatus { color: var(--teal); font-size: 12px; }
.settings-error { margin: 0 0 15px; color: var(--red) !important; font-size: 12px; }
.settings-error:empty { display: none; }
.sms-settings-aside { display: grid; gap: 20px; }
.sms-settings-aside a { color: var(--teal); font-size: 12px; }
.sms-settings-aside .secondary-button { margin-top: 16px; }
.sms-connection-details { margin: 18px 0; }
.sms-connection-details > div { display: flex; justify-content: space-between; gap: 12px; margin: 9px 0; font-size: 12px; }
.sms-connection-details dt { color: var(--muted); }
.sms-connection-details dd { margin: 0; }
@media (max-width: 1120px) { .sms-settings-layout { grid-template-columns: 1fr; } .sms-settings-aside { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 680px) { .sms-settings-aside, .sms-settings-fields { grid-template-columns: 1fr; } .settings-card { padding: 18px; } .settings-intro h2 { font-size: 20px; } }
.muted { color: #96a3a6; font-weight: 500; }

.date-field { position: relative; }
.date-field > svg { position: absolute; left: 11px; bottom: 10px; width: 16px; color: #799096; pointer-events: none; }
.date-field input { padding-inline-end: 36px; }
jdp-container, jdp-overlay { font-family: ClinicSans, Tahoma, sans-serif !important; }
jdp-container { border: 1px solid #d8e6e4 !important; border-radius: 15px !important; box-shadow: 0 16px 40px rgba(15,58,61,.18) !important; }

.icd-search-wrap { position: relative; }
.icd-search-wrap > svg { position: absolute; right: 11px; top: 11px; z-index: 1; width: 17px; color: #7d9095; }
.icd-search-wrap > input { padding-inline-start: 36px; }
.icd-results { position: absolute; z-index: 12; top: calc(100% + 5px); right: 0; left: 0; max-height: 235px; padding: 5px; display: none; background: white; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 14px 35px rgba(17,52,55,.16); overflow-y: auto; }
.icd-results.open { display: block; }
.icd-option { width: 100%; padding: 9px 10px; display: grid; grid-template-columns: 61px minmax(0,1fr); gap: 9px; color: inherit; background: transparent; border: 0; border-radius: 9px; text-align: start; }
.icd-option:hover { background: var(--teal-soft); }
.icd-option code { align-self: center; padding: 4px 6px; color: var(--teal-dark); background: #e9f5f3; border-radius: 7px; font-family: ui-monospace, monospace; font-size: 9px; direction: ltr; text-align: center; }
.icd-option strong, .icd-option small { display: block; }
.icd-option strong { font-size: 9px; }
.icd-option small { color: var(--muted); font-size: 8px; direction: ltr; text-align: start; }
.icd-selected { min-height: 39px; margin-top: 7px; padding: 8px 11px; display: flex; align-items: center; gap: 9px; color: var(--muted); background: #f8fafa; border: 1px dashed #cedcda; border-radius: 10px; font-size: 9px; }
.icd-selected.has-value { color: var(--ink); background: #eef8f6; border-style: solid; border-color: #c8e4e0; }
.icd-selected code { padding: 3px 7px; color: white; background: var(--teal); border-radius: 6px; font-size: 9px; }
.icd-selected div { min-width: 0; flex: 1; }
.icd-selected strong, .icd-selected small { display: block; }
.icd-selected small { color: var(--muted); direction: ltr; text-align: start; }
.icd-selected button { width: 24px; height: 24px; color: #89999c; background: white; border: 1px solid var(--line); border-radius: 7px; }
.field-help { display: block; margin-top: 5px; color: #8a989b; font-size: 7.5px; }

.team-hero { max-width: 1500px; margin: 0 auto 15px; padding: 24px 27px; position: relative; display: flex; align-items: center; gap: 20px; overflow: hidden; color: white; background: linear-gradient(120deg, #0a625c, #13867c); border-radius: 20px; box-shadow: 0 12px 30px rgba(13,118,110,.14); }
.team-hero::after { content: ""; position: absolute; width: 240px; height: 240px; left: 10%; top: -155px; border: 42px solid rgba(255,255,255,.06); border-radius: 50%; }
.team-hero > div { position: relative; z-index: 1; }
.team-hero .eyebrow { color: #bce8df; }
.team-hero h2 { margin: 0; font-size: 22px; }
.team-hero p:not(.eyebrow) { margin: 2px 0 0; color: rgba(255,255,255,.75); font-size: 10px; }
.team-hero .primary-button { position: relative; z-index: 1; margin-inline-start: auto; color: var(--teal-dark); background: white; box-shadow: none; }
.team-metrics { max-width: 1500px; margin: 0 auto 15px; display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; }
.team-metrics article { padding: 15px 17px; display: flex; align-items: center; gap: 11px; background: white; border: 1px solid var(--line); border-radius: 15px; }
.team-metrics small, .team-metrics strong { display: block; }
.team-metrics small { color: var(--muted); font-size: 9px; }
.team-metrics strong { font-size: 19px; }
.team-metric-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; }
.team-metric-icon svg { width: 17px; }
.team-metric-icon.teal { color: var(--teal); background: var(--teal-soft); }
.team-metric-icon.blue { color: var(--blue); background: #e8f1fb; }
.team-metric-icon.violet { color: var(--violet); background: #f0ecfd; }
.team-metric-icon.orange { color: var(--orange); background: #fff0e6; }
.team-toolbar { max-width: 1500px; margin: 0 auto 12px; display: flex; align-items: center; gap: 13px; }
.team-toolbar .search-box { width: min(360px, 100%); }
.team-toolbar .filter-row { margin: 0; }
.team-grid { max-width: 1500px; margin: 0 auto; display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 13px; }
.team-card { min-height: 205px; padding: 18px; position: relative; background: white; border: 1px solid var(--line); border-radius: 17px; transition: .18s ease; }
.team-card:not(.list-skeleton):hover { border-color: #bfd9d6; box-shadow: 0 10px 28px rgba(20,58,62,.07); transform: translateY(-2px); }
.team-card-head { display: flex; align-items: center; gap: 11px; }
.team-avatar { width: 46px; height: 46px; display: grid; place-items: center; color: white; background: linear-gradient(135deg, #2a938a, #0a6b64); border-radius: 14px; font-weight: 800; }
.role-nurse .team-avatar { background: linear-gradient(135deg, #788bd2, #5367b1); }
.role-psych .team-avatar { background: linear-gradient(135deg, #9b74ca, #7651ad); }
.role-social .team-avatar { background: linear-gradient(135deg, #df9256, #bf6a30); }
.team-card-head h3 { margin: 0; font-size: 12px; }
.team-card-head p { margin: -2px 0 0; color: var(--teal); font-size: 9px; }
.team-status { margin-inline-start: auto; align-self: flex-start; padding: 3px 7px; color: #247958; background: #e5f6ee; border-radius: 999px; font-size: 7px; }
.team-status.leave { color: #9a661b; background: #fff3dc; }
.team-status.inactive { color: #7f8c8f; background: #edf0f0; }
.team-card-bio { min-height: 38px; margin: 13px 0; color: var(--muted); font-size: 9px; }
.team-card-meta { padding-top: 11px; display: grid; grid-template-columns: 1fr 1fr; gap: 7px; border-top: 1px solid var(--line); }
.team-card-meta span { min-width: 0; display: flex; align-items: center; gap: 5px; color: #617378; font-size: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-card-meta svg { width: 13px; flex: 0 0 auto; color: var(--teal); }
.team-card-actions { margin-top: 12px; display: flex; justify-content: flex-end; }
.text-button { display: inline-flex; align-items: center; gap: 5px; color: var(--teal); background: transparent; border: 0; font-size: 8px; font-weight: 700; }
.text-button svg { width: 13px; }

.visit-modal { width: min(1040px, calc(100vw - 28px)); }
.visit-header > div:first-child span, .assignment-modal .modal-header span { display: block; color: var(--muted); font-size: 9px; }
.clinical-form-badge { margin-inline-start: auto; padding: 6px 9px; display: flex; align-items: center; gap: 5px; color: var(--teal); background: var(--teal-soft); border-radius: 9px; font-size: 8px; font-weight: 700; }
.clinical-form-badge svg { width: 14px; }
.visit-header .icon-button { margin-inline-start: 8px; }
.visit-section-nav { padding: 0 24px; display: flex; gap: 4px; background: #fafcfc; border-bottom: 1px solid var(--line); overflow-x: auto; }
.visit-section-nav span { padding: 10px 13px 8px; position: relative; color: #8a989b; font-size: 8px; white-space: nowrap; }
.visit-section-nav span.active { color: var(--teal); font-weight: 700; }
.visit-section-nav span.active::after { content: ""; position: absolute; right: 13px; left: 13px; bottom: 0; height: 2px; background: var(--teal); }
.visit-form-section + .visit-form-section { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); }
.vitals-grid { display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: 8px; }
.mini-field { padding: 10px; position: relative; display: block; background: #f8fafa; border: 1px solid var(--line); border-radius: 11px; }
.mini-field > span { display: block; color: #66787c; font-size: 8px; font-weight: 700; }
.mini-field > input, .mini-field > select { width: 100%; height: 28px; padding: 0; color: var(--ink); background: transparent; border: 0; outline: 0; font-size: 13px; font-weight: 700; }
.mini-field > select { font-size: 9px; }
.mini-field > small { color: #95a2a5; font-size: 7px; }
.blood-pressure { height: 28px; display: flex; align-items: center; direction: ltr; }
.blood-pressure input { width: 42%; min-width: 0; padding: 0; background: transparent; border: 0; outline: 0; font-size: 12px; font-weight: 700; text-align: center; }
.blood-pressure i { color: #9eacad; font-style: normal; }
.score-block { margin-top: 14px; padding: 16px; background: #f8fbfa; border: 1px solid #dce9e7; border-radius: 14px; }
.score-heading { display: flex; align-items: center; gap: 15px; }
.score-heading h4 { margin: 0; font-size: 11px; }
.score-heading h4 span { margin-inline-start: 5px; color: var(--muted); font-size: 8px; font-weight: 500; direction: ltr; }
.score-heading p { margin: 0; color: var(--muted); font-size: 8px; }
.score-heading output { width: 47px; height: 38px; margin-inline-start: auto; display: grid; place-items: center; color: white; background: var(--teal); border-radius: 10px; font-size: 15px; font-weight: 800; }
.pps-scale { margin: 14px 0 10px; display: grid; grid-template-columns: repeat(11, 1fr); direction: ltr; gap: 4px; }
.pps-scale button { height: 32px; padding: 0; color: #627579; background: white; border: 1px solid #d7e4e2; border-radius: 8px; font-size: 8px; }
.pps-scale button:hover { color: var(--teal); border-color: #86beb8; }
.pps-scale button.selected { color: white; background: var(--teal); border-color: var(--teal); font-weight: 800; }
.pps-description { min-height: 36px; padding: 8px 10px; display: flex; align-items: center; gap: 8px; color: #53686c; background: white; border: 1px solid var(--line); border-radius: 9px; font-size: 8px; }
.pps-description svg { width: 15px; color: var(--teal); }
.score-source { display: block; margin-top: 6px; color: #929fa2; font-size: 7px; }
.esas-summary { width: 190px; margin: -50px 0 17px; padding: 8px 10px; float: left; display: grid; grid-template-columns: 1fr auto; align-items: center; background: #edf7f5; border: 1px solid #d0e8e4; border-radius: 11px; }
.esas-summary span, .esas-summary small { color: #697d81; font-size: 7px; }
.esas-summary strong { grid-row: span 2; font-size: 20px; }
.esas-summary i { padding: 2px 6px; color: #287e65; background: white; border-radius: 999px; font-size: 7px; font-style: normal; text-align: center; }
.esas-summary i.moderate { color: #a66520; }
.esas-summary i.high { color: var(--red); }
.symptom-grid { clear: both; display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 9px; }
.symptom-scale { padding: 11px 12px 8px; background: #fbfcfc; border: 1px solid var(--line); border-radius: 11px; }
.symptom-scale > span { display: flex; align-items: center; color: #52666a; font-size: 9px; font-weight: 700; }
.symptom-scale output { width: 24px; height: 24px; margin-inline-start: auto; display: grid; place-items: center; color: var(--teal); background: var(--teal-soft); border-radius: 7px; font-size: 10px; }
.symptom-scale input[type="range"] { width: 100%; height: 5px; margin: 10px 0 5px; accent-color: var(--teal); cursor: pointer; }
.symptom-scale > small { display: flex; justify-content: space-between; color: #97a4a6; font-size: 6px; }
.symptom-scale i { font-style: normal; }
.symptom-other { margin-top: 12px; }
.check-grid { margin-top: 13px; display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 8px; }
.checkbox-card { padding: 10px; display: flex; align-items: center; gap: 8px; background: #fbfcfc; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.checkbox-card:has(input:checked) { background: #eef8f6; border-color: #b9ddd8; }
.checkbox-card input { width: 16px; height: 16px; accent-color: var(--teal); }
.checkbox-card b, .checkbox-card small { display: block; }
.checkbox-card b { font-size: 8px; }
.checkbox-card small { color: var(--muted); font-size: 6.5px; }
.visit-footer { align-items: center; }
.visit-footer > span { margin-inline-end: auto; display: flex; align-items: center; gap: 5px; color: #829194; font-size: 7px; }
.visit-footer > span svg { width: 13px; color: var(--teal); }

.assignment-help { margin: 0 0 14px; color: var(--muted); font-size: 9px; }
.assignment-list { display: grid; gap: 7px; }
.assignment-row { padding: 10px 11px; display: grid; grid-template-columns: auto 38px minmax(0,1fr) auto; align-items: center; gap: 9px; background: #fafcfc; border: 1px solid var(--line); border-radius: 11px; }
.assignment-row:has(.assign-check:checked) { background: #eef8f6; border-color: #c4e2de; }
.assignment-row input { accent-color: var(--teal); }
.assignment-row .team-avatar { width: 38px; height: 38px; border-radius: 11px; font-size: 10px; }
.assignment-row strong, .assignment-row small { display: block; }
.assignment-row strong { font-size: 9px; }
.assignment-row small { color: var(--muted); font-size: 7px; }
.primary-radio { padding: 4px 7px; color: #718185; background: white; border: 1px solid var(--line); border-radius: 8px; font-size: 7px; white-space: nowrap; }
.primary-radio:has(input:checked) { color: var(--teal); border-color: #a9d2cd; font-weight: 700; }

.care-team-strip { display: flex; flex-wrap: wrap; gap: 7px; }
.care-person { padding: 7px 9px; display: flex; align-items: center; gap: 7px; background: #f7faf9; border: 1px solid var(--line); border-radius: 10px; }
.care-person .avatar { width: 29px; height: 29px; border: 0; border-radius: 8px; font-size: 8px; }
.care-person strong, .care-person small { display: block; }
.care-person strong { font-size: 8px; }
.care-person small { color: var(--muted); font-size: 6.5px; }
.care-person em { padding: 2px 5px; color: var(--teal); background: var(--teal-soft); border-radius: 999px; font-size: 6px; font-style: normal; }
.care-team-empty { color: var(--muted); font-size: 9px; }
.card-heading .text-button { margin-inline-start: auto; }

.visit-list { display: grid; gap: 9px; }
.visit-record { padding: 14px; display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 12px; background: #fbfcfc; border: 1px solid var(--line); border-radius: 13px; }
.visit-date { width: 54px; padding: 7px 4px; color: var(--teal); background: var(--teal-soft); border-radius: 10px; font-size: 9px; font-weight: 800; text-align: center; direction: ltr; }
.visit-record h4 { margin: 0; font-size: 10px; }
.visit-record p { margin: 1px 0 0; color: var(--muted); font-size: 8px; }
.visit-scores { display: flex; gap: 5px; }
.visit-scores span { min-width: 51px; padding: 5px 7px; color: #566b70; background: white; border: 1px solid var(--line); border-radius: 8px; font-size: 7px; text-align: center; }
.visit-scores strong { display: block; color: var(--ink); font-size: 11px; }

@media (max-width: 1120px) {
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .patient-workspace { grid-template-columns: 290px minmax(0,1fr); }
  .detail-grid { grid-template-columns: 1fr; }
  .info-card.full { grid-column: auto; }
  .team-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .vitals-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
}

@media (max-width: 850px) {
  .sidebar { transform: translateX(100%); box-shadow: -20px 0 50px rgba(11,44,47,.15); }
  .sidebar.open { transform: translateX(0); }
  .mobile-overlay { position: fixed; inset: 0; z-index: 15; display: block; background: rgba(10,31,34,.35); opacity: 0; pointer-events: none; transition: .2s ease; }
  .mobile-overlay.show { opacity: 1; pointer-events: auto; }
  .main-content { margin-inline-start: 0; padding: 20px; }
  .mobile-menu { display: grid; }
  .patient-workspace { grid-template-columns: 270px minmax(0, 1fr); }
  .profile-head { align-items: flex-start; flex-wrap: wrap; }
  .profile-badges { margin-inline-start: 79px; }
  .team-metrics { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .symptom-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .check-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 680px) {
  .main-content { padding: 16px 12px; }
  .topbar { margin-bottom: 15px; }
  .topbar h1 { font-size: 19px; }
  .local-badge { display: none; }
  .metrics { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
  .metric-card { padding: 12px; gap: 9px; }
  .metric-icon { width: 36px; height: 36px; }
  .metric-card strong { font-size: 19px; }
  .metric-card span { display: none; }
  .patient-workspace { display: block; }
  .patient-browser { border-inline-end: 0; border-bottom: 1px solid var(--line); }
  .patient-list { max-height: 190px; }
  .patient-detail { min-height: 500px; }
  .profile-hero { padding: 20px 17px; }
  .profile-title h2 { font-size: 17px; }
  .profile-badges { width: 100%; margin-inline-start: 0; }
  .detail-tabs { padding: 0 16px; gap: 18px; overflow-x: auto; }
  .detail-tab { white-space: nowrap; }
  .tab-panel { padding: 18px 15px 22px; }
  .info-list { grid-template-columns: 1fr 1fr; }
  .modal { width: calc(100vw - 16px); max-height: calc(100vh - 16px); border-radius: 17px; }
  .modal form { max-height: calc(100vh - 16px); }
  .modal-header, .modal-body, .modal-footer { padding-inline-start: 16px; padding-inline-end: 16px; }
  .form-grid, .form-grid.three-cols { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .toast { right: 12px; left: 12px; bottom: 12px; min-width: 0; }
  .team-hero { padding: 19px; align-items: flex-end; }
  .team-hero h2 { font-size: 18px; }
  .team-hero p:not(.eyebrow) { display: none; }
  .team-hero .primary-button { min-height: 38px; padding: 0 11px; font-size: 9px; }
  .team-metrics { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 7px; }
  .team-metrics article { padding: 11px; }
  .team-toolbar { display: block; }
  .team-toolbar .search-box { width: 100%; }
  .team-toolbar .filter-row { margin-top: 9px; overflow-x: auto; }
  .team-grid { grid-template-columns: 1fr; }
  .vitals-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .pps-scale { grid-template-columns: repeat(6, 1fr); direction: rtl; }
  .esas-summary { width: 100%; margin: 0 0 12px; float: none; }
  .symptom-grid { grid-template-columns: 1fr; }
  .check-grid { grid-template-columns: 1fr 1fr; }
  .visit-footer > span { display: none; }
  .visit-record { grid-template-columns: auto minmax(0,1fr); }
  .visit-scores { grid-column: 1 / -1; }
}

/* Accounting and role-based access */
.module-hero { max-width: 1500px; min-height: 132px; margin: 0 auto 15px; padding: 25px 28px; position: relative; display: flex; align-items: center; gap: 22px; overflow: hidden; color: white; border-radius: 21px; box-shadow: 0 14px 34px rgba(15,63,72,.14); isolation: isolate; }
.module-hero::before, .module-hero::after { content: ""; position: absolute; z-index: -1; border: 1px solid rgba(255,255,255,.13); border-radius: 50%; }
.module-hero::before { width: 270px; height: 270px; left: 6%; top: -202px; }
.module-hero::after { width: 125px; height: 125px; left: 22%; bottom: -106px; }
.finance-hero { background: linear-gradient(120deg, #103d50, #126a72 58%, #16857b); }
.access-hero { background: linear-gradient(120deg, #193c62, #225e79 55%, #167d78); }
.family-hero { background: linear-gradient(120deg, #254f68, #176d75 56%, #178779); }
.module-hero .eyebrow { color: #bfe8e2; }
.module-hero h2 { margin: 0; font-size: 22px; }
.module-hero p:not(.eyebrow) { margin: 2px 0 0; color: rgba(255,255,255,.76); font-size: 10px; }
.hero-light-button { min-height: 42px; margin-inline-start: auto; padding: 0 16px; display: inline-flex; align-items: center; gap: 7px; color: #124c58; background: white; border: 0; border-radius: 12px; box-shadow: 0 8px 20px rgba(3,31,42,.14); font-size: 10px; font-weight: 800; transition: .2s ease; white-space: nowrap; }
.hero-light-button:hover { transform: translateY(-2px); box-shadow: 0 12px 25px rgba(3,31,42,.2); }
.hero-light-button svg { width: 16px; }

.module-metrics { max-width: 1500px; margin: 0 auto 15px; display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; }
.module-metrics article { min-width: 0; padding: 15px 16px; display: flex; align-items: center; gap: 11px; background: white; border: 1px solid var(--line); border-radius: 15px; box-shadow: 0 4px 14px rgba(24,58,64,.03); transition: .2s ease; }
.module-metrics article:hover { transform: translateY(-2px); box-shadow: 0 9px 23px rgba(24,58,64,.065); }
.module-metrics small, .module-metrics strong, .module-metrics em { display: block; }
.module-metrics small { color: var(--muted); font-size: 8.5px; }
.module-metrics strong { max-width: 170px; overflow: hidden; font-size: clamp(15px, 1.4vw, 20px); line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.module-metrics em { color: #91a0a3; font-size: 7px; font-style: normal; }
.module-metric-icon { width: 39px; height: 39px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 11px; }
.module-metric-icon svg { width: 17px; }
.module-metric-icon.teal { color: var(--teal); background: var(--teal-soft); }
.module-metric-icon.blue { color: var(--blue); background: #e9f2fc; }
.module-metric-icon.orange { color: var(--orange); background: #fff0e5; }
.module-metric-icon.violet { color: var(--violet); background: #f0edfb; }
.module-toolbar { max-width: 1500px; margin: 0 auto 11px; display: flex; align-items: center; gap: 12px; }
.module-toolbar .search-box { width: min(390px, 100%); }
.module-toolbar .filter-row { margin: 0; }

.data-table-card { max-width: 1500px; margin: 0 auto; background: white; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); overflow: hidden; }
.table-heading { padding: 17px 20px; display: flex; align-items: center; gap: 15px; border-bottom: 1px solid var(--line); }
.table-heading h3 { margin: 0; font-size: 13px; }
.table-heading p { margin: -1px 0 0; color: var(--muted); font-size: 8px; }
.table-heading > span { margin-inline-start: auto; padding: 4px 9px; color: var(--teal); background: var(--teal-soft); border-radius: 999px; font-size: 8px; font-weight: 700; }
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; min-width: 850px; border-collapse: collapse; text-align: start; }
.data-table th { padding: 10px 17px; color: #7e8e92; background: #fafcfc; border-bottom: 1px solid var(--line); font-size: 8px; font-weight: 600; }
.data-table td { padding: 12px 17px; border-bottom: 1px solid #eef2f2; color: #506268; font-size: 9px; }
.data-table tbody tr { cursor: pointer; transition: .15s ease; }
.data-table tbody tr:hover { background: #f7fbfa; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.invoice-number { color: #184f67; font-size: 8.5px; }
.table-person b, .table-person small { display: block; }
.table-person b { color: var(--ink); font-size: 9px; }
.table-person small { color: #8b999c; font-size: 7px; }
.paid-cell { color: #288060 !important; }
.balance-cell { color: #bc622f !important; font-weight: 800; }
.status-pill { width: max-content; padding: 3px 8px; display: inline-flex; color: #617276; background: #edf1f1; border-radius: 999px; font-size: 7px; font-weight: 700; white-space: nowrap; }
.status-pill.paid, .status-pill.active { color: #24795a; background: #e4f5ed; }
.status-pill.partial, .status-pill.invited { color: #9a661c; background: #fff2dc; }
.status-pill.issued { color: #28699c; background: #e8f2fb; }
.status-pill.draft, .status-pill.suspended { color: #747f82; background: #edf0f0; }
.status-pill.void { color: #9a4c51; background: #f9e9ea; }
.row-action { width: 30px; height: 30px; display: grid; place-items: center; color: #718489; background: white; border: 1px solid var(--line); border-radius: 9px; transition: .16s ease; }
.row-action:hover { color: var(--teal); border-color: #a9cfca; transform: translateY(-1px); }
.row-action svg { width: 13px; }
.table-loading { width: 35%; height: 12px; margin: 35px auto; position: relative; overflow: hidden; background: #edf2f1; border-radius: 999px; }
.table-loading::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, white, transparent); animation: shimmer 1.2s infinite; }

.access-layout { max-width: 1500px; margin: 0 auto; display: grid; grid-template-columns: 1fr; gap: 13px; align-items: start; }
.access-directory, .family-access-panel { background: white; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 8px 28px rgba(24,58,64,.05); }
.access-directory { min-width: 0; padding: 18px; }
.family-access-panel { padding: 18px; }
.panel-heading { display: flex; align-items: flex-start; gap: 10px; }
.panel-heading h3 { margin: 0; font-size: 13px; }
.panel-heading p:not(.eyebrow) { margin: -1px 0 0; color: var(--muted); font-size: 8px; }
.icon-add-button { width: 35px; height: 35px; margin-inline-start: auto; display: grid; place-items: center; color: white; background: var(--teal); border: 0; border-radius: 10px; }
.icon-add-button svg { width: 15px; }
.module-toolbar.embedded { margin: 14px 0 11px; }
.compact-select { height: 42px; padding: 0 11px; color: #5f7176; background: white; border: 1px solid var(--line); border-radius: 11px; outline: 0; font-size: 9px; }
.account-list { display: grid; gap: 7px; }
.account-row { padding: 11px; display: grid; grid-template-columns: 39px minmax(190px,1.3fr) minmax(120px,.7fr) auto auto; align-items: center; gap: 10px; background: #fafcfc; border: 1px solid #e9efee; border-radius: 12px; transition: .17s ease; }
.account-row:hover { background: white; border-color: #cce0de; transform: translateX(-2px); }
.account-avatar { width: 39px; height: 39px; flex: 0 0 auto; display: grid; place-items: center; color: white; background: linear-gradient(135deg, #17877f, #0a625e); border-radius: 11px; font-size: 9px; font-weight: 800; }
.role-administrator .account-avatar { background: linear-gradient(135deg, #426e99, #254966); }
.role-call_center .account-avatar { background: linear-gradient(135deg, #d4904f, #b56a2e); }
.role-care_coordinator .account-avatar { background: linear-gradient(135deg, #806fc0, #6552a5); }
.role-family .account-avatar { background: linear-gradient(135deg, #ce7280, #a64d61); }
.account-identity { min-width: 0; }
.account-identity h4 { margin: 0; font-size: 9.5px; }
.account-identity p { margin: -1px 0 3px; color: var(--muted); font-size: 7px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-identity div { display: flex; flex-wrap: wrap; gap: 3px; }
.account-identity div span { padding: 1px 5px; color: #4c7777; background: #edf6f4; border-radius: 5px; font-size: 5.8px; }
.account-contact span, .account-contact small { display: block; text-align: end; }
.account-contact span { color: #546a70; font-size: 8px; }
.account-contact small { min-height: 10px; color: #91a0a3; font-size: 6.5px; }
.family-count { color: var(--muted); font-size: 7px; white-space: nowrap; }
.patient-access-select { margin-top: 14px; }
.future-feature-note, .security-note { margin: 11px 0; padding: 10px; display: flex; align-items: flex-start; gap: 8px; color: #547075; background: #eef7f6; border: 1px solid #d3e8e5; border-radius: 11px; font-size: 7px; }
.future-feature-note svg, .security-note svg { width: 16px; flex: 0 0 auto; color: var(--teal); }
.future-feature-note strong, .security-note strong { display: block; color: #31585a; font-size: 8px; }
.family-list { display: grid; gap: 8px; }
.family-card { padding: 11px; background: #fbfcfc; border: 1px solid var(--line); border-radius: 12px; transition: .18s ease; }
.family-card:hover { border-color: #c5dedb; }
.family-card.revoked { opacity: .58; }
.family-card-head { display: flex; align-items: center; gap: 8px; }
.family-card-head .account-avatar { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, #cf7782, #ac5366); }
.family-card-head strong, .family-card-head small { display: block; }
.family-card-head strong { font-size: 8.5px; }
.family-card-head small { color: var(--muted); font-size: 6.5px; }
.family-card-head em { margin-inline-start: auto; padding: 2px 6px; color: #966419; background: #fff1d9; border-radius: 999px; font-size: 5.8px; font-style: normal; }
.family-card-head em.active { color: #26785b; background: #e3f5ec; }
.family-card-head em.revoked { color: #9a4c51; background: #f8e9ea; }
.family-phone { margin: 6px 0 5px; display: block; color: #526e73; font-size: 7px; text-align: start; text-decoration: none; }
.permission-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.permission-tags span { padding: 2px 6px; border-radius: 6px; font-size: 6px; }
.permission-tags .on { color: #26765d; background: #e6f5ee; }
.permission-tags .off { color: #8d989a; background: #eef1f1; text-decoration: line-through; }
.danger-text { margin-top: 8px; color: #a8555a; }

.family-workspace { max-width: 1500px; margin: 0 auto; padding: 20px; background: white; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.family-workspace-head { display: flex; align-items: flex-end; gap: 24px; }
.family-workspace-head h3 { margin: 0; font-size: 14px; }
.family-workspace-head p:not(.eyebrow) { margin: -1px 0 0; color: var(--muted); font-size: 8px; }
.family-workspace-head .patient-access-select { width: min(360px, 100%); margin: 0 auto 0 0; }
.family-workspace > .future-feature-note { margin: 14px 0; }
.family-workspace > .family-list { grid-template-columns: repeat(3, minmax(0,1fr)); }
.family-workspace .family-card { min-height: 148px; display: flex; flex-direction: column; }
.family-workspace .family-card .danger-text { margin-top: auto; align-self: flex-start; }

.wide-modal { width: min(1100px, calc(100vw - 28px)); }
.small-modal { width: min(620px, calc(100vw - 28px)); }
.invoice-detail-modal { width: min(720px, calc(100vw - 28px)); }
.invoice-lines-heading { margin: 24px 0 10px; display: flex; align-items: center; gap: 12px; }
.invoice-lines-heading h3 { margin: 0; font-size: 11px; }
.invoice-lines-heading p { margin: -1px 0 0; color: var(--muted); font-size: 7.5px; }
.invoice-lines-heading button { margin-inline-start: auto; }
.secondary-button.compact { min-height: 35px; padding: 0 11px; font-size: 8px; }
.secondary-button.compact svg { width: 14px; }
.invoice-lines { display: grid; gap: 7px; }
.invoice-line { padding: 10px; display: grid; grid-template-columns: minmax(170px,1.4fr) 70px minmax(130px,.8fr) minmax(140px,1fr) minmax(110px,.7fr) 31px; align-items: end; gap: 7px; background: #f8fafa; border: 1px solid var(--line); border-radius: 12px; animation: lineIn .2s ease; }
@keyframes lineIn { from { opacity: 0; transform: translateY(-5px); } }
.invoice-line label span { display: block; margin-bottom: 3px; color: #617579; font-size: 7px; font-weight: 700; }
.invoice-line input, .invoice-line select { width: 100%; height: 34px; padding: 0 8px; color: var(--ink); background: white; border: 1px solid #dce6e5; border-radius: 8px; outline: 0; font-size: 8px; }
.invoice-line input:focus, .invoice-line select:focus { border-color: #83bbb5; box-shadow: 0 0 0 2px rgba(13,118,110,.07); }
.remove-line { width: 31px; height: 34px; display: grid; place-items: center; color: #a25559; background: #faeeee; border: 0; border-radius: 8px; }
.remove-line svg { width: 13px; }
.invoice-live-total { margin-top: 10px; padding: 10px 13px; display: flex; align-items: baseline; justify-content: flex-end; gap: 7px; color: var(--muted); background: #f1f8f6; border-radius: 10px; font-size: 8px; }
.invoice-live-total strong { color: var(--teal-dark); font-size: 17px; }
.invoice-live-total em { font-style: normal; }
.invoice-detail-head { display: flex; align-items: flex-start; gap: 12px; }
.invoice-detail-head small, .invoice-detail-head strong, .invoice-detail-head span { display: block; }
.invoice-detail-head small { color: var(--muted); font-size: 7px; }
.invoice-detail-head strong { font-size: 14px; }
.invoice-detail-head div > span { color: var(--muted); font-size: 8px; }
.invoice-detail-head > .status-pill { margin-inline-start: auto; }
.invoice-amount-strip { margin: 16px 0; padding: 13px; display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; background: #f5f9f8; border: 1px solid var(--line); border-radius: 12px; }
.invoice-amount-strip span { padding: 0 10px; border-inline-end: 1px solid var(--line); }
.invoice-amount-strip span:last-child { border-inline-end: 0; }
.invoice-amount-strip small, .invoice-amount-strip strong { display: block; }
.invoice-amount-strip small { color: var(--muted); font-size: 7px; }
.invoice-amount-strip strong { font-size: 14px; }
.invoice-amount-strip .outstanding strong { color: #b76333; }
.detail-section-heading { margin: 16px 0 6px; display: flex; align-items: center; gap: 8px; }
.detail-section-heading h3 { margin: 0; font-size: 10px; }
.detail-section-heading span { margin-inline-start: auto; color: var(--muted); font-size: 7px; }
.invoice-detail-list, .payment-history { border: 1px solid var(--line); border-radius: 11px; overflow: hidden; }
.invoice-detail-list > div, .payment-history > div { padding: 9px 11px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); }
.invoice-detail-list > div:last-child, .payment-history > div:last-child { border-bottom: 0; }
.invoice-detail-list strong, .invoice-detail-list small, .payment-history strong, .payment-history small { display: block; }
.invoice-detail-list strong, .payment-history strong { font-size: 8px; }
.invoice-detail-list small, .payment-history small { color: var(--muted); font-size: 6.5px; }
.invoice-detail-list em { margin-inline-start: auto; font-size: 8px; font-style: normal; }
.payment-history code { margin-inline-start: auto; color: #5d7276; font-family: ui-monospace, monospace; font-size: 7px; }
.mini-empty { padding: 18px; color: var(--muted); background: #fafcfc; border: 1px dashed var(--line); border-radius: 10px; font-size: 8px; text-align: center; }
.payment-balance { margin-bottom: 14px; padding: 12px; display: flex; align-items: baseline; gap: 7px; color: var(--muted); background: #fff6e9; border: 1px solid #f4dfbd; border-radius: 11px; font-size: 8px; }
.payment-balance strong { margin-inline-start: auto; color: #a35d28; font-size: 18px; }
.payment-balance em { font-style: normal; }
.disabled-field { opacity: .5; }
.permission-picker { margin-top: 16px; padding: 13px; background: #f8fafa; border: 1px solid var(--line); border-radius: 12px; }
.permission-picker h3 { margin: 0 0 8px; font-size: 10px; }
.permission-picker > label { padding: 8px 0; display: flex; align-items: center; gap: 9px; border-top: 1px solid var(--line); cursor: pointer; }
.permission-picker input { width: 16px; height: 16px; accent-color: var(--teal); }
.permission-picker b, .permission-picker small { display: block; }
.permission-picker b { font-size: 8px; }
.permission-picker small { color: var(--muted); font-size: 6.5px; }

/* Scheduling */
.appointments-hero { background: linear-gradient(112deg,#0b5362,#0d796e 72%,#20a088); }
.appointments-metrics .module-metric-icon.blue { color: #427bc7; background: #e9f2fc; }
.appointment-calendar-card { max-width: 1500px; margin: 0 auto 12px; padding: 16px 18px 17px; background: white; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 7px 24px rgba(24,58,64,.04); }
.appointment-calendar-head { margin-bottom: 13px; display: flex; align-items: center; gap: 15px; }
.appointment-calendar-head h3 { margin: 0; font-size: 13px; }
.appointment-calendar-head .eyebrow { font-size: 8px; }
.appointment-calendar-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 5px; }
.appointment-calendar-actions button { width: 32px; height: 32px; display: grid; place-items: center; color: #547574; background: #f4f8f7; border: 1px solid #e0eae8; border-radius: 8px; font-size: 20px; line-height: 1; }
.appointment-calendar-actions button:hover { color: var(--teal); border-color: #a9d3cd; }
.appointment-calendar-actions .appointment-today-button { width: auto; padding: 0 12px; font-size: 8px; font-weight: 700; }
.appointment-week-days { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 8px; }
.appointment-day { min-height: 86px; padding: 8px; display: grid; justify-items: center; align-content: center; gap: 1px; color: #637b7d; background: #f8faf9; border: 1px solid #e9efee; border-radius: 11px; transition: .2s; }
.appointment-day:hover { background: #edf7f4; transform: translateY(-2px); }
.appointment-day.selected { color: white; background: linear-gradient(145deg,#0b756d,#139487); border-color: transparent; box-shadow: 0 7px 18px rgba(13,118,110,.17); }
.appointment-day.today:not(.selected) { color: var(--teal); border-color: #a7d7ce; }
.appointment-day small { font-size: 8px; }
.appointment-day strong { font-size: 20px; line-height: 1.2; }
.appointment-day span { min-height: 14px; color: #95a5a4; font-size: 7px; }
.appointment-day.selected span { color: #c4eee3; }
.appointment-toolbar { max-width: 1500px; margin: 0 auto 12px; display: flex; align-items: center; gap: 9px; }
.appointment-view-switch { padding: 3px; display: flex; flex: 0 0 auto; gap: 2px; background: #eaf2f0; border-radius: 10px; }
.appointment-view-switch button { min-height: 32px; padding: 0 10px; color: #66807e; background: transparent; border: 0; border-radius: 8px; font-size: 8px; white-space: nowrap; }
.appointment-view-switch button.active { color: var(--teal-dark); background: white; box-shadow: 0 2px 7px rgba(15,79,73,.08); font-weight: 800; }
.appointment-toolbar .search-box { width: min(340px,100%); margin-inline-start: auto; }
.appointment-toolbar > select { height: 40px; padding: 0 10px; color: #607779; background: white; border: 1px solid var(--line); border-radius: 10px; font-size: 8px; }
.appointment-content { max-width: 1500px; margin: 0 auto; display: grid; grid-template-columns: minmax(0,1fr) 240px; align-items: start; gap: 12px; }
.appointment-schedule, .appointment-side { background: white; border: 1px solid var(--line); border-radius: 17px; box-shadow: 0 8px 25px rgba(24,58,64,.04); }
.appointment-schedule { min-height: 370px; padding: 18px; }
.appointment-section-head { margin-bottom: 12px; display: flex; align-items: center; gap: 12px; }
.appointment-section-head h3 { margin: 0; font-size: 13px; }
.appointment-section-head p { margin: 0; color: #90a0a0; font-size: 8px; }
.appointment-section-head > span { margin-inline-start: auto; padding: 4px 8px; color: var(--teal); background: #e9f6f2; border-radius: 7px; font-size: 8px; }
.appointment-date-heading { margin: 18px 0 9px; display: flex; align-items: center; gap: 9px; }
.appointment-date-heading:first-child { margin-top: 0; }
.appointment-date-heading span { display: flex; align-items: center; gap: 6px; color: #598581; font-size: 9px; font-weight: 800; white-space: nowrap; }
.appointment-date-heading svg { width: 14px; }
.appointment-date-heading i { height: 1px; flex: 1; background: #e9efee; }
.appointment-card { margin-bottom: 8px; display: grid; grid-template-columns: 83px minmax(0,1fr); overflow: hidden; background: #fbfcfc; border: 1px solid #e5eeec; border-radius: 13px; transition: transform .18s, box-shadow .18s, border-color .18s; }
.appointment-card:hover { border-color: #bddbd5; transform: translateY(-1px); box-shadow: 0 9px 22px rgba(34,82,79,.06); }
.appointment-time { padding: 16px 9px; display: grid; align-content: center; justify-items: center; color: var(--teal); background: #edf7f4; border-inline-end: 1px solid #deece8; }
.appointment-time strong { direction: ltr; font-size: 16px; }
.appointment-time span { color: #79a29a; font-size: 7px; white-space: nowrap; }
.appointment-card.status-cancelled .appointment-time, .appointment-card.status-no_show .appointment-time { color: #8c9999; background: #f2f4f4; }
.appointment-card-main { min-width: 0; padding: 12px 14px; }
.appointment-card-heading { display: flex; align-items: flex-start; gap: 10px; }
.appointment-card-heading > div { min-width: 0; flex: 1; }
.appointment-card-heading h4 { margin: 0; font-size: 10px; }
.appointment-card-heading span:not(.appointment-status) { color: #718687; font-size: 8px; }
.appointment-status { padding: 4px 8px; border-radius: 999px; font-size: 7px; white-space: nowrap; }
.appointment-status.status-requested { color: #986220; background: #fff0d7; }
.appointment-status.status-confirmed { color: #166f66; background: #e0f3ed; }
.appointment-status.status-in_progress { color: #4e72ad; background: #e6eefb; }
.appointment-status.status-completed { color: #52795d; background: #e8f3e9; }
.appointment-status.status-cancelled, .appointment-status.status-no_show { color: #8a6b6b; background: #f5ebeb; }
.appointment-card-meta { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px 13px; }
.appointment-card-meta span { display: flex; align-items: center; gap: 4px; color: #708789; font-size: 7.5px; }
.appointment-card-meta svg { width: 12px; color: var(--teal); }
.appointment-card-meta .appointment-address { width: 100%; }
.appointment-notes, .appointment-cancel-reason { margin: 7px 0 0; color: #789091; font-size: 7.5px; }
.appointment-cancel-reason { color: #a15f5f; }
.appointment-card-actions { margin-top: 10px; padding-top: 9px; display: flex; flex-wrap: wrap; gap: 5px; border-top: 1px solid #eaf0ef; }
.appointment-action { min-height: 28px; padding: 3px 8px; display: inline-flex; align-items: center; gap: 4px; color: #65817f; background: white; border: 1px solid #dfeae8; border-radius: 7px; font-size: 7px; text-decoration: none; }
.appointment-action:hover { color: var(--teal); border-color: #a9d6cc; }
.appointment-action.primary { color: white; background: var(--teal); border-color: var(--teal); }
.appointment-action svg { width: 12px; }
.appointment-side { padding: 19px; }
.appointment-side-icon { width: 43px; height: 43px; display: grid; place-items: center; color: var(--teal); background: #e7f5f1; border-radius: 13px; }
.appointment-side-icon svg { width: 20px; }
.appointment-side h3 { margin: 13px 0 4px; font-size: 11px; line-height: 1.6; }
.appointment-side p { margin: 0; color: #789091; font-size: 8px; }
.appointment-steps { margin: 16px 0; display: grid; gap: 8px; }
.appointment-steps span { display: flex; align-items: center; gap: 7px; color: #557f7b; font-size: 8px; }
.appointment-steps b { width: 21px; height: 21px; display: grid; place-items: center; color: var(--teal); background: #e6f4f0; border-radius: 7px; font-size: 8px; }
.appointment-side .text-button { border-top: 1px solid var(--line); padding-top: 13px; }
.appointment-empty { min-height: 250px; display: grid; justify-items: center; align-content: center; color: #8aa09e; text-align: center; }
.appointment-empty > svg { width: 37px; height: 37px; margin-bottom: 8px; color: #a0ccc3; }
.appointment-empty strong { color: #56736f; font-size: 11px; }
.appointment-empty p { margin: 2px 0 13px; font-size: 8px; }
.appointment-modal { width: min(810px,calc(100vw - 30px)); }
.appointment-form-note { margin-top: 12px; padding: 9px 10px; display: flex; align-items: center; gap: 7px; color: #60857e; background: #ecf7f3; border-radius: 9px; font-size: 8px; }
.appointment-form-note svg { width: 15px; }
.appointment-modal .field[hidden] { display: none !important; }
.patient-appointment-strip { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 7px; }
.patient-appointment-strip > div { padding: 9px; background: #f6faf9; border: 1px solid #e1eeea; border-radius: 9px; }
.patient-appointment-strip span, .patient-appointment-strip strong, .patient-appointment-strip small { display: block; }
.patient-appointment-date { color: var(--teal); font-size: 8px; }
.patient-appointment-strip strong { font-size: 9px; }
.patient-appointment-strip small { color: #8aa09b; font-size: 7px; }
@media (max-width: 1050px) { .appointment-content { grid-template-columns: 1fr; } .appointment-side { display: none; } }
@media (max-width: 680px) { .appointment-calendar-card { padding: 12px; } .appointment-week-days { gap: 4px; } .appointment-day { min-height: 65px; padding: 3px; } .appointment-day small, .appointment-day span { font-size: 6px; } .appointment-day strong { font-size: 15px; } .appointment-toolbar { flex-wrap: wrap; } .appointment-view-switch { width: 100%; } .appointment-view-switch button { flex: 1; } .appointment-toolbar .search-box { flex: 1; margin: 0; } .appointment-toolbar > select { max-width: 140px; } .appointment-schedule { padding: 11px; } .appointment-card { grid-template-columns: 68px minmax(0,1fr); } .appointment-time strong { font-size: 12px; } .appointment-card-main { padding: 9px; } .appointment-card-heading { display: block; } .appointment-status { margin-top: 4px; display: inline-block; } .patient-appointment-strip { grid-template-columns: 1fr; } }

/* Care conversation: deliberately quiet backgrounds keep clinical content legible. */
.chat-intro { max-width: 1500px; min-height: 122px; margin: 0 auto 12px; padding: 21px 28px; display: flex; align-items: center; gap: 17px; color: white; background: linear-gradient(112deg,#084e5d,#0d746d 70%,#13927e); border-radius: 20px; box-shadow: 0 17px 32px rgba(8,86,91,.13); }
.chat-intro-mark { width: 62px; height: 62px; flex: 0 0 auto; display: grid; place-items: center; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.22); border-radius: 19px; }
.chat-intro-mark svg { width: 30px; stroke-width: 1.6; }
.chat-intro h2 { margin: 0; font-size: 21px; }
.chat-intro .eyebrow { margin: 0 0 2px; color: #b7eadd; font-size: 9px; }
.chat-intro p:last-child { margin: 3px 0 0; color: #d4ece8; font-size: 9px; }
.chat-live-pill { margin-inline-start: auto; padding: 7px 12px; display: flex; align-items: center; gap: 8px; white-space: nowrap; background: rgba(255,255,255,.13); border: 1px solid rgba(255,255,255,.24); border-radius: 999px; font-size: 9px; }
.chat-live-pill > span, .chat-head-badge > span { width: 7px; height: 7px; background: #78edb2; border-radius: 50%; box-shadow: 0 0 0 4px rgba(120,237,178,.13); animation: chatBreathe 2s infinite; }
.chat-live-pill b { font-weight: 500; }
.chat-live-pill.offline > span { background: #c5dad8; box-shadow: none; animation: none; }
@keyframes chatBreathe { 50% { box-shadow: 0 0 0 8px rgba(120,237,178,0); } }
.chat-demo-bar { max-width: 1500px; min-height: 47px; margin: 0 auto 12px; padding: 7px 13px; display: flex; align-items: center; gap: 9px; color: #62797a; background: #edf6f4; border: 1px solid #d7e9e6; border-radius: 12px; font-size: 8px; }
.chat-demo-bar > svg { width: 17px; flex: 0 0 auto; color: var(--teal); }
.chat-demo-bar > span { flex: 1; }
.chat-demo-bar label { white-space: nowrap; font-weight: 700; }
.chat-demo-bar select { max-width: 255px; height: 32px; padding: 0 10px; color: #26595a; background: white; border: 1px solid #c5dfdb; border-radius: 8px; font: inherit; font-weight: 700; }
.chat-workspace { max-width: 1500px; height: min(780px, calc(100vh - 280px)); min-height: 560px; margin: 0 auto; display: grid; grid-template-columns: minmax(234px, 270px) minmax(350px,1fr) minmax(190px,225px); overflow: hidden; background: white; border: 1px solid #e0eae9; border-radius: 19px; box-shadow: 0 15px 44px rgba(22,69,71,.06); }
.chat-rooms-pane, .chat-members-pane { min-width: 0; display: flex; flex-direction: column; background: #fafcfc; }
.chat-rooms-pane { border-inline-end: 1px solid var(--line); }
.chat-members-pane { padding: 20px 15px; border-inline-start: 1px solid var(--line); }
.chat-pane-title { padding: 21px 17px 14px; display: flex; align-items: center; }
.chat-kicker { color: #729195; font-size: 8px; }
.chat-pane-title h3 { margin: 2px 0 0; font-size: 13px; }
.chat-pane-title h3 span { padding: 1px 7px; color: var(--teal); background: #e5f3f0; border-radius: 7px; font-size: 9px; }
.chat-pane-decoration { width: 37px; height: 37px; margin-inline-start: auto; display: grid; place-items: center; color: var(--teal); background: #e9f5f2; border-radius: 12px; }
.chat-pane-decoration svg { width: 18px; }
.chat-search { height: 39px; display: flex; align-items: center; gap: 8px; color: #91a5a4; background: white; border: 1px solid #e2ebe9; border-radius: 10px; }
.chat-search:focus-within { border-color: #91c7bf; box-shadow: 0 0 0 3px rgba(15,126,112,.07); }
.chat-search svg { width: 15px; margin-inline-start: 10px; flex: 0 0 auto; }
.chat-search input { min-width: 0; width: 100%; height: 100%; padding: 0 0 0 8px; border: 0; outline: 0; background: transparent; font: inherit; font-size: 9px; }
.chat-rooms-pane > .chat-search { margin: 0 12px 13px; }
.chat-room-list { flex: 1; overflow-y: auto; padding: 0 8px; }
.chat-room-card { width: 100%; padding: 12px 9px; margin-bottom: 5px; position: relative; display: flex; align-items: flex-start; gap: 9px; color: var(--ink); background: transparent; border: 1px solid transparent; border-radius: 12px; text-align: start; transition: background .2s, border-color .2s, transform .2s; cursor: pointer; font: inherit; }
.chat-room-card:hover { background: white; transform: translateX(-2px); }
.chat-room-card.active { background: #eaf6f3; border-color: #d0e8e3; }
.chat-room-avatar { width: 37px; height: 37px; flex: 0 0 auto; display: grid; place-items: center; color: white; background: linear-gradient(135deg,#36ad9a,#127e7b); border-radius: 12px; font-size: 10px; font-weight: 800; }
.chat-room-body { min-width: 0; flex: 1; }
.chat-room-top { display: flex; align-items: center; gap: 5px; }
.chat-room-top strong { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 9px; }
.chat-room-top time { color: #8b9c9e; font-size: 7px; white-space: nowrap; }
.chat-room-body > small, .chat-room-excerpt { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-room-body > small { margin: 1px 0 4px; color: #618382; font-size: 7px; }
.chat-room-excerpt { color: #879799; font-size: 8px; }
.chat-unread { position: absolute; left: 9px; bottom: 12px; min-width: 19px; height: 19px; padding: 2px 4px; display: grid; place-items: center; color: white; background: var(--teal); border-radius: 50%; font-size: 8px; }
.chat-room-foot { padding: 13px; display: flex; align-items: flex-start; gap: 6px; color: #87999b; border-top: 1px solid var(--line); font-size: 7px; }
.chat-secure-dot { width: 7px; height: 7px; margin-top: 2px; flex: 0 0 auto; background: #51b994; border-radius: 50%; }
.chat-conversation { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: #fff; }
.chat-conversation-head { min-height: 72px; padding: 12px 20px; display: flex; align-items: center; gap: 11px; border-bottom: 1px solid var(--line); }
.chat-head-avatar { width: 42px; height: 42px; flex: 0 0 auto; display: grid; place-items: center; color: var(--teal); background: #e6f5f1; border-radius: 13px; }
.chat-head-avatar svg { width: 20px; }
.chat-head-info { min-width: 0; flex: 1; }
.chat-head-info h3 { margin: 0; font-size: 12px; }
.chat-head-info p { margin: 1px 0 0; color: #839598; font-size: 8px; }
.chat-head-badge { padding: 6px 9px; display: flex; align-items: center; gap: 7px; color: #267d65; background: #e8f6ef; border-radius: 8px; font-size: 8px; white-space: nowrap; }
.chat-head-badge > span { width: 6px; height: 6px; background: #48b98b; }
.chat-search-line { min-height: 55px; padding: 8px 20px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid #edf1f0; }
.chat-search-line .chat-search { max-width: 310px; flex: 1; background: #fafcfc; }
.chat-search-line > span { margin-inline-start: auto; color: #a0adac; font-size: 7px; }
.chat-messages { flex: 1; min-height: 0; padding: 19px 24px 10px; overflow-y: auto; background: radial-gradient(circle at 82% 18%,rgba(23,158,137,.035), transparent 45%), #fff; scroll-behavior: smooth; }
.chat-intro-message { width: fit-content; max-width: 100%; margin: 0 auto 15px; padding: 7px 11px; display: flex; align-items: center; gap: 7px; color: #61908c; background: #edf6f4; border-radius: 8px; font-size: 7px; }
.chat-intro-message svg { width: 13px; }
.chat-day-label { margin: 15px auto 13px; display: flex; align-items: center; gap: 12px; color: #84999b; font-size: 8px; }
.chat-day-label::before, .chat-day-label::after { height: 1px; flex: 1; background: #ecf1f0; content: ""; }
.chat-day-label span { white-space: nowrap; }
.chat-message { position: relative; max-width: 96%; margin: 0 0 10px; display: flex; align-items: flex-end; gap: 7px; animation: chatArrival .24s ease both; }
.chat-message:has(.chat-message-menu[open]) { z-index: 3; }
.chat-message.mine { margin-inline-start: auto; flex-direction: row-reverse; }
@keyframes chatArrival { from { opacity: 0; transform: translateY(7px); } }
.chat-message-avatar { width: 24px; height: 24px; flex: 0 0 auto; display: grid; place-items: center; color: white; background: #7f98ae; border-radius: 8px; font-size: 7px; font-weight: 800; }
.chat-message.mine .chat-message-avatar { background: #0d867b; }
.chat-message-content { min-width: 0; }
.chat-message-by { margin: 0 3px 3px; display: flex; align-items: center; flex-wrap: wrap; gap: 3px 7px; }
.chat-message-by strong { font-size: 8px; }
.chat-message-by small { color: #8a9b9d; font-size: 7px; }
.chat-bubble-row { display: flex; align-items: center; gap: 5px; }
.chat-message.mine .chat-bubble-row { flex-direction: row-reverse; }
.chat-bubble { min-width: 0; flex: 1; padding: 8px 12px; color: #34494e; background: #f1f5f5; border-radius: 13px 4px 13px 13px; font-size: 9px; line-height: 1.9; overflow-wrap: anywhere; }
.chat-message.mine .chat-bubble { color: white; background: linear-gradient(130deg,#168e83,#0c776f); border-radius: 4px 13px 13px 13px; box-shadow: 0 5px 13px rgba(13,118,110,.12); }
.chat-bubble p { margin: 0; white-space: pre-wrap; }
.chat-bubble p:empty { display: none; }
.chat-bubble.deleted { color: #829092; background: #f5f7f7; }
.chat-bubble em { font-style: normal; }
.chat-quoted { margin-bottom: 8px; padding: 4px 8px; display: grid; background: rgba(6,55,52,.06); border-inline-start: 2px solid #37a393; border-radius: 4px; }
.chat-message.mine .chat-quoted { background: rgba(255,255,255,.16); border-color: #b8f4de; }
.chat-quoted strong { font-size: 8px; }
.chat-quoted span { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 7px; opacity: .82; }
.chat-attachment { margin-top: 7px; padding: 6px; display: flex; align-items: center; gap: 8px; color: inherit; background: rgba(255,255,255,.2); border: 1px solid rgba(130,160,160,.15); border-radius: 9px; text-decoration: none; }
.chat-attachment img { width: 85px; height: 65px; object-fit: cover; border-radius: 5px; }
.chat-file-icon { width: 35px; height: 35px; display: grid; place-items: center; background: rgba(50,135,129,.16); border-radius: 8px; }
.chat-file-icon svg { width: 17px; }
.chat-attachment span:last-child { min-width: 0; }
.chat-attachment strong, .chat-attachment small { display: block; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-attachment strong { font-size: 8px; }
.chat-attachment small { font-size: 7px; opacity: .8; }
.chat-message-footer { margin: 3px 4px 0; display: flex; align-items: center; flex-wrap: wrap; gap: 3px 8px; }
.chat-message-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 3px 6px; color: #a0acae; font-size: 7px; }
.chat-message-receipt { display: inline-flex; width: 19px; height: 14px; color: #899b9f; direction: ltr; }
.chat-message-receipt.read { color: #2196f3; }
.chat-message-receipt svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }
body[data-role="team_member"] [data-action="new-patient"],
body[data-role="team_member"] [data-action="edit-patient"],
body[data-role="team_member"] [data-action="new-appointment"],
body[data-role="team_member"] [data-action="manage-team"],
body[data-role="team_member"] [data-appointment-edit],
body[data-role="call_center"] #patientForm .form-section:has([name="diagnosis"]) { display: none; }
.auth-hint { color: var(--muted); font-size: 11px; line-height: 1.8; }
.family-self-grid { max-width: 1500px; margin: auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 16px; }
.family-self-grid .info-card { padding: 22px; }
.family-self-grid h2 { margin: 0 0 8px; font-size: 19px; }
.family-self-grid h3 { margin-top: 22px; font-size: 13px; }
.family-self-grid p { color: #5d7579; font-size: 12px; line-height: 1.8; }
.family-plan { white-space: pre-wrap; }
.family-self-grid .primary-button { margin-top: 16px; }
.auth-activity { border-top: 1px solid var(--line); }
.auth-activity-row { padding: 12px 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); font-size: 10px; }
.auth-activity-row strong, .auth-activity-row small { display: block; }
.auth-activity-row small, .auth-activity-row time { color: var(--muted); }
.chat-message-tools { display: flex; flex-shrink: 0; align-items: center; gap: 1px; opacity: .65; transition: opacity .2s; }
.chat-message:hover .chat-message-tools, .chat-message:focus-within .chat-message-tools { opacity: 1; }
.chat-message-tools > button, .chat-message-menu summary { width: 28px; height: 28px; display: grid; place-items: center; color: #668b86; background: transparent; border: 0; border-radius: 7px; cursor: pointer; }
.chat-message-tools > button:hover, .chat-message-menu summary:hover, .chat-message-menu[open] summary { color: var(--teal); background: #edf6f4; }
.chat-message-tools button:focus-visible, .chat-message-menu summary:focus-visible { outline: 2px solid var(--teal); outline-offset: 1px; }
.chat-message-tools svg { width: 13px; }
.chat-message-menu { position: relative; }
.chat-message-menu summary { list-style: none; font-size: 20px; line-height: 1; }
.chat-message-menu summary::-webkit-details-marker { display: none; }
.chat-message-menu[open] { z-index: 5; }
.chat-message-menu-options { position: absolute; inset-inline-end: 0; top: calc(100% + 3px); min-width: 110px; padding: 4px; background: white; border: 1px solid var(--line); border-radius: 9px; box-shadow: 0 6px 20px rgba(12,58,55,.14); }
.chat-message-menu.open-up .chat-message-menu-options { top: auto; bottom: calc(100% + 3px); }
.chat-message-menu-options button { width: 100%; min-height: 32px; padding: 6px 9px; display: flex; align-items: center; gap: 7px; color: var(--ink); background: transparent; border: 0; border-radius: 5px; font: inherit; font-size: 10px; white-space: nowrap; cursor: pointer; }
.chat-message-menu-options button:hover { background: #edf6f4; }
.chat-message-menu-options [data-chat-delete] { color: #ad5555; }
@media (hover: none), (pointer: coarse) {
  .chat-message-tools { opacity: 1; }
  .chat-message-tools > button, .chat-message-menu summary { width: 32px; height: 32px; }
}
.chat-reactions { display: flex; flex-wrap: wrap; gap: 4px; }
.chat-reaction { padding: 1px 6px; color: #667d7b; background: #f3f7f6; border: 1px solid #e2ece9; border-radius: 999px; font-size: 9px; cursor: pointer; }
.chat-reaction.chosen { color: var(--teal); background: #e2f3ef; border-color: #b9dcd4; }
.chat-reaction span { font-size: 7px; }
.chat-welcome { width: min(290px,100%); margin: auto; padding: 35px 12px; color: #809496; text-align: center; }
.chat-welcome img { width: 56px; height: 56px; margin-bottom: 8px; object-fit: contain; }
.chat-welcome h3 { margin: 0; color: #376d6b; font-size: 11px; }
.chat-welcome p { margin: 4px 0; font-size: 8px; }
.chat-empty { padding: 18px; color: #879a9d; font-size: 8px; text-align: center; }
.chat-typing { min-height: 0; padding: 0 24px; color: #6ca095; font-size: 8px; }
.chat-typing:not(:empty) { min-height: 22px; }
.chat-composer-zone { padding: 12px 17px 9px; position: relative; border-top: 1px solid var(--line); background: #fff; }
.chat-composer { min-height: 53px; padding: 5px; display: flex; align-items: center; gap: 5px; background: #f7f9f9; border: 1px solid #dfeae8; border-radius: 13px; }
.chat-composer:focus-within { border-color: #92c9c0; }
.chat-composer textarea { min-width: 0; max-height: 100px; flex: 1; padding: 10px 3px; resize: none; color: var(--ink); background: transparent; border: 0; outline: 0; font: inherit; font-size: 9px; line-height: 1.7; }
.chat-tool-button, .chat-emoji-button { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; color: #7e9896; background: transparent; border: 0; border-radius: 9px; cursor: pointer; font-size: 22px; }
.chat-tool-button:hover, .chat-emoji-button:hover { color: var(--teal); background: #e8f3f0; }
.chat-tool-button.disabled { opacity: .35; pointer-events: none; }
.chat-tool-button svg { width: 17px; }
.chat-send-button { width: 40px; height: 40px; flex: 0 0 auto; display: grid; place-items: center; color: white; background: var(--teal); border: 0; border-radius: 10px; box-shadow: 0 4px 10px rgba(8,103,95,.17); cursor: pointer; transition: .2s; }
.chat-send-button:hover:not(:disabled) { transform: translateY(-2px); background: var(--teal-dark); }
.chat-send-button:disabled { opacity: .5; cursor: not-allowed; }
.chat-send-button svg { width: 17px; transform: rotate(180deg); }
.chat-compose-hint { margin: 6px 4px 0; color: #9ba9a9; font-size: 7px; }
.chat-compose-preview { margin: 0 0 7px; padding: 8px 10px; display: flex; align-items: center; gap: 10px; background: #edf6f4; border-inline-start: 2px solid #53aa9d; border-radius: 7px; }
.chat-compose-preview > span { min-width: 0; flex: 1; color: #708a89; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 8px; }
.chat-compose-preview strong { margin-inline-end: 7px; color: #216861; }
.chat-compose-preview button { width: 24px; height: 24px; color: #6a8884; background: transparent; border: 0; cursor: pointer; }
.chat-compose-preview svg { width: 13px; }
.chat-emoji-picker { position: absolute; left: 55px; bottom: 81px; z-index: 3; padding: 5px; display: flex; gap: 3px; background: white; border: 1px solid var(--line); border-radius: 9px; box-shadow: 0 11px 24px rgba(24,66,69,.13); }
.chat-emoji-picker button { padding: 5px; background: transparent; border: 0; border-radius: 5px; cursor: pointer; }
.chat-emoji-picker button:hover { background: #edf6f4; }
.chat-compose-preview[hidden], .chat-emoji-picker[hidden] { display: none !important; }
.chat-members-title { display: flex; align-items: center; gap: 8px; }
.chat-members-title h3 { margin: 0; font-size: 10px; }
.chat-members-title span { margin-inline-start: auto; color: var(--teal); font-size: 9px; }
.chat-members-pane > p { margin: 3px 0 19px; color: #92a1a1; font-size: 7px; }
.chat-member-list { flex: 1; min-height: 0; overflow-y: auto; }
.chat-member { margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.chat-member .account-avatar { width: 32px; height: 32px; flex: 0 0 auto; border-radius: 10px; font-size: 8px; }
.chat-member strong { display: block; font-size: 8px; }
.chat-member strong i { color: var(--teal); font-size: 7px; font-style: normal; }
.chat-member small { display: block; color: #91a2a2; font-size: 7px; }
.chat-member.online .account-avatar { outline: 2px solid #8ce0b7; outline-offset: 2px; }
.chat-care-note { padding: 11px; display: grid; justify-items: start; color: #69918c; background: #edf6f3; border: 1px solid #dcefe9; border-radius: 11px; }
.chat-care-note img { width: 30px; height: 30px; object-fit: contain; }
.chat-care-note strong { margin-top: 5px; color: #336d66; font-size: 8px; }
.chat-care-note span { font-size: 7px; }

@media (max-width: 1200px) { .chat-workspace { grid-template-columns: 245px minmax(0,1fr); } .chat-members-pane { display: none; } }
@media (max-width: 720px) { .chat-intro { min-height: 96px; padding: 14px; } .chat-intro-mark { width: 43px; height: 43px; border-radius: 12px; } .chat-intro-mark svg { width: 22px; } .chat-intro h2 { font-size: 14px; } .chat-intro p:last-child, .chat-live-pill { display: none; } .chat-demo-bar { display: grid; grid-template-columns: 17px 1fr; gap: 5px 8px; } .chat-demo-bar label { grid-column: 1; width: 0; overflow: hidden; } .chat-demo-bar select { max-width: none; grid-column: 2; } .chat-workspace { height: auto; min-height: 0; display: flex; flex-direction: column; } .chat-rooms-pane { max-height: 160px; border-inline-end: 0; border-bottom: 1px solid var(--line); } .chat-pane-title { padding: 10px 13px 5px; } .chat-pane-decoration, .chat-room-foot { display: none; } .chat-rooms-pane > .chat-search { margin-bottom: 6px; } .chat-room-list { overflow-y: auto; } .chat-room-card { padding: 7px; margin-bottom: 2px; } .chat-conversation { height: clamp(390px, calc(100dvh - 430px), 590px); } .chat-conversation-head { min-height: 60px; padding: 8px 12px; } .chat-search-line { min-height: 47px; padding: 5px 12px; } .chat-search-line > span, .chat-head-badge { display: none; } .chat-messages { padding: 12px; } .chat-composer-zone { padding: 8px; } .chat-message { max-width: 96%; } }
@media (prefers-reduced-motion: reduce) { .chat-live-pill > span, .chat-head-badge > span { animation: none; } .chat-message { animation: none; } }

@media (max-width: 1120px) {
  .module-metrics { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .access-layout { grid-template-columns: 1fr; }
  .family-workspace > .family-list { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .invoice-line { grid-template-columns: minmax(180px,1.5fr) 70px minmax(130px,1fr); }
  .invoice-line .remove-line { grid-column: 3; justify-self: end; }
}

@media (max-width: 680px) {
  body { overflow-x: hidden; }
  .main-content { width: 100%; overflow: hidden; }
  .topbar { min-width: 0; gap: 9px; }
  .topbar > div:not(.topbar-actions) { min-width: 0; }
  .topbar h1 { max-width: 210px; overflow: hidden; font-size: 17px; text-overflow: ellipsis; white-space: nowrap; }
  .topbar .eyebrow { display: none; }
  .module-hero { width: 100%; min-width: 0; min-height: 120px; padding: 16px; align-items: flex-end; gap: 8px; }
  .module-hero > div { min-width: 0; }
  .module-hero .eyebrow { display: block; font-size: 7px; }
  .module-hero h2 { overflow: hidden; font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
  .module-hero p:not(.eyebrow) { display: none; }
  .hero-light-button { min-height: 38px; padding: 0 10px; flex: 0 0 auto; font-size: 7.5px; }
  .module-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
  .module-metrics article { padding: 10px; gap: 8px; }
  .module-metric-icon { width: 34px; height: 34px; }
  .module-toolbar { display: block; }
  .module-toolbar .search-box { width: 100%; }
  .module-toolbar .filter-row { margin-top: 8px; overflow-x: auto; }
  .access-directory, .family-access-panel { padding: 13px; }
  .family-workspace { padding: 14px; }
  .family-workspace-head { display: block; }
  .family-workspace-head .patient-access-select { width: 100%; margin-top: 12px; }
  .family-workspace > .family-list { grid-template-columns: 1fr; }
  .module-toolbar.embedded { display: grid; grid-template-columns: 1fr; }
  .account-row { grid-template-columns: 37px minmax(0,1fr) auto; }
  .account-contact { display: none; }
  .account-row > .status-pill { grid-column: 2; }
  .family-count, .account-row > .row-action { grid-column: 3; grid-row: 1 / span 2; }
  .invoice-line { grid-template-columns: 1fr 78px; }
  .invoice-line label:not(.short-field) { grid-column: 1 / -1; }
  .invoice-line .remove-line { grid-column: 2; justify-self: end; }
  .invoice-amount-strip { gap: 0; }
  .invoice-amount-strip strong { font-size: 10px; }
}

/* Voice and video calls share the patient chat's permissions and layout. */
 .chat-call-icons { display: flex; gap: 4px; flex-shrink: 0; }
.chat-call-icon { width: 40px; height: 40px; display: grid; place-items: center; background: transparent; color: var(--teal); border: 0; border-radius: 50%; cursor: pointer; padding: 10px; }
.chat-call-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.chat-call-icon:hover { background: #eaf5f3; }
.chat-call-icon:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.chat-call-icon:disabled { opacity: .4; cursor: not-allowed; }
.call-recipient-dialog { width: min(400px, calc(100vw - 32px)); padding: 24px; border: 0; border-radius: 18px; }
.call-recipient-dialog::backdrop { background: #051a2470; }
.call-recipient-dialog h2 { font-size: 18px; margin: 0 0 10px; }
.call-recipient-dialog p { color: var(--muted); }
.call-recipient-dialog select { width: 100%; min-height: 44px; font: inherit; background: white; border: 1px solid var(--line); border-radius: 10px; padding: 8px; }
.call-recipient-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }
.call-dialog { width: min(720px, calc(100vw - 24px)); max-height: 94dvh; padding: 24px; border: 0; border-radius: 24px; background: #102e36; color: #fff; }
.call-dialog::backdrop { background: #051a24b8; }
.call-heading { text-align: center; }
.call-heading > span, .call-heading > p { font-size: 13px; color: #c2dadd; }
.call-heading h2 { margin: 10px 0; font-size: 24px; }
.call-heading bdi { display: block; min-height: 24px; }
.call-media { position: relative; display: grid; place-items: center; min-height: 180px; border-radius: 18px; overflow: hidden; background: #092129; margin: 18px 0; }
#callRemoteVideo { width: 100%; max-height: 48dvh; object-fit: contain; }
#callLocalVideo { position: absolute; bottom: 12px; inset-inline-end: 12px; width: 25%; max-height: 120px; border-radius: 10px; transform: scaleX(-1); border: 1px solid #ffffff80; }
.call-avatar { width: 100px; height: 100px; border-radius: 50%; background: #285760; display: grid; place-items: center; font-size: 32px; }
.call-controls { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; }
.call-controls button { min-height: 44px; border-radius: 12px; padding: 10px 16px; cursor: pointer; font: inherit; }
.call-controls .secondary-button { background: #244751; color: #fff; border: 1px solid #52717a; }
.call-controls button[aria-pressed="true"] { background: #745326; }
.call-end { border: none; background: #c44151; color: #fff; }
.call-dialog [hidden] { display: none !important; }

.chat-coordinator-support { display: flex; align-items: center; gap: 12px; padding: 10px 18px; background: #f0f7f6; border-bottom: 1px solid var(--line); }
.chat-coordinator-support[hidden] { display: none; }
.chat-coordinator-support > div { flex: 1; min-width: 0; }
.chat-coordinator-support strong { font-size: 12px; }
.chat-coordinator-support p { margin: 4px 0 0; font-size: 11px; line-height: 1.7; color: var(--muted); }
.chat-coordinator-support button { flex-shrink: 0; min-height: 40px; }
@media (max-width: 720px) { .chat-coordinator-support { padding: 8px 12px; gap: 5px; flex-wrap: wrap; } .chat-coordinator-support > div { flex-basis: 100%; } }

.push-preferences { display:flex; align-items:center; flex-wrap:wrap; gap:10px; margin: 10px auto 14px; max-width:1500px; font-size:11px; color:var(--muted); }
.push-preferences button:disabled { opacity:.5; }

.push-preferences .chat-live-pill { display: flex; color: var(--teal); background: #edf6f4; border-color: var(--line); }
