:root {
  --bg: #f5f7f8;
  --surface: #ffffff;
  --surface-soft: #f8fafb;
  --line: #e6ebed;
  --line-strong: #d7e0e2;
  --ink: #1b2b2d;
  --muted: #728083;
  --teal: #176b67;
  --teal-dark: #0e514e;
  --teal-soft: #e5f3f1;
  --yellow: #f4c96b;
  --yellow-soft: #fff4d7;
  --coral: #d96f5f;
  --coral-soft: #fcebe8;
  --lavender: #7e7aba;
  --lavender-soft: #efeffa;
  --shadow: 0 16px 40px rgba(22, 47, 50, 0.08);
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); }
button, input, select { font: inherit; }
button { border: 0; cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid rgba(23, 107, 103, .22); outline-offset: 2px; }

.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: #eef4f3; }
.login-card { width: min(980px, 100%); min-height: 610px; display: grid; grid-template-columns: 1.1fr .9fr; overflow: hidden; background: var(--surface); border: 1px solid rgba(23, 107, 103, .12); border-radius: 28px; box-shadow: 0 26px 70px rgba(15, 54, 56, .13); }
.login-brand { position: relative; padding: 60px; display: flex; flex-direction: column; justify-content: space-between; background: var(--teal); color: #fff; overflow: hidden; }
.login-brand::after, .login-brand::before { content: ""; position: absolute; border-radius: 999px; border: 1px solid rgba(255,255,255,.15); pointer-events: none; }
.login-brand::before { width: 420px; height: 420px; right: -190px; top: -130px; }
.login-brand::after { width: 300px; height: 300px; right: -110px; top: -70px; }
.brand-lockup { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; color: var(--teal); background: var(--yellow); font-size: 25px; font-weight: 700; }
.brand-name { font-size: 20px; font-weight: 760; letter-spacing: -.03em; }
.brand-kicker { color: #a9d2cf; font-size: 13px; margin-top: 2px; }
.login-headline { position: relative; z-index: 1; max-width: 460px; margin: auto 0; }
.login-headline h1 { margin: 0 0 18px; font-size: clamp(38px, 5vw, 62px); line-height: .98; letter-spacing: -.065em; }
.login-headline p { margin: 0; max-width: 370px; color: #b9d6d4; font-size: 17px; line-height: 1.55; }
.login-caption { position: relative; z-index: 1; color: #a9d2cf; font-size: 13px; }
.login-form { padding: 60px 54px; display: flex; flex-direction: column; justify-content: center; }
.eyebrow { color: var(--teal); font-size: 11px; text-transform: uppercase; letter-spacing: .14em; font-weight: 780; }
.login-form h2 { margin: 12px 0 10px; font-size: 30px; letter-spacing: -.045em; }
.login-form > p { margin: 0 0 28px; color: var(--muted); line-height: 1.55; }
.field { display: grid; gap: 8px; margin-bottom: 16px; }
.field label { color: #536467; font-size: 13px; font-weight: 650; }
.field input, .field select, .search-box input { width: 100%; height: 48px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 11px; color: var(--ink); background: #fff; }
.field input::placeholder, .search-box input::placeholder { color: #9ca9ab; }
.login-demo { margin-top: 18px; padding: 14px; border: 1px solid #e8edf0; border-radius: 12px; color: var(--muted); background: var(--surface-soft); font-size: 13px; line-height: 1.45; }
.login-demo strong { color: var(--ink); }

.btn { height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 16px; border-radius: 10px; font-size: 14px; font-weight: 700; transition: transform .15s ease, background .15s ease, border-color .15s ease; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { color: white; background: var(--teal); box-shadow: 0 5px 14px rgba(23, 107, 103, .18); }
.btn-primary:hover { background: var(--teal-dark); }
.btn-secondary { color: var(--teal); background: var(--teal-soft); }
.btn-ghost { color: #536467; border: 1px solid var(--line); background: white; }
.btn-danger { color: #b95648; background: var(--coral-soft); }
.btn-icon { width: 38px; height: 38px; display: inline-grid; place-items: center; padding: 0; color: #607174; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.btn-sm { height: 34px; padding: 0 11px; font-size: 12px; border-radius: 8px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 250px minmax(0, 1fr); }
.sidebar { display: flex; flex-direction: column; padding: 26px 16px 18px; background: #fff; border-right: 1px solid var(--line); }
.sidebar .brand-lockup { padding: 0 12px 30px; }
.sidebar .brand-mark { width: 34px; height: 34px; border-radius: 10px; font-size: 20px; }
.sidebar .brand-name { font-size: 17px; }
.sidebar .brand-kicker { font-size: 11px; }
.workspace-switcher { display: flex; align-items: center; gap: 10px; padding: 11px; margin: 0 4px 23px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); }
.workspace-icon { width: 32px; height: 32px; display: grid; place-items: center; color: var(--teal); border-radius: 9px; background: var(--teal-soft); font-size: 16px; font-weight: 750; }
.workspace-copy { min-width: 0; flex: 1; }
.workspace-copy strong, .workspace-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workspace-copy strong { font-size: 12px; }
.workspace-copy span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.nav-label { padding: 0 12px 9px; color: #9aa5a7; font-size: 10px; letter-spacing: .13em; font-weight: 800; text-transform: uppercase; }
.nav { display: grid; gap: 4px; }
.nav-item { display: flex; align-items: center; gap: 11px; min-height: 42px; padding: 0 12px; color: #687779; border-radius: 10px; background: transparent; text-align: left; font-size: 14px; font-weight: 640; }
.nav-item:hover { color: var(--teal); background: #f3f8f7; }
.nav-item.active { color: var(--teal); background: var(--teal-soft); }
.nav-item svg { width: 17px; height: 17px; flex: 0 0 auto; }
.nav-badge { margin-left: auto; min-width: 22px; padding: 3px 6px; border-radius: 20px; color: #a35b10; background: var(--yellow-soft); text-align: center; font-size: 11px; }
.sidebar-bottom { margin-top: auto; }
.test-mode { display: flex; gap: 10px; padding: 14px 12px; margin: 0 4px 17px; border-radius: 12px; color: #8b6a26; background: var(--yellow-soft); }
.test-mode svg { flex: 0 0 auto; margin-top: 2px; }
.test-mode strong, .test-mode span { display: block; }
.test-mode strong { font-size: 12px; }
.test-mode span { margin-top: 4px; color: #a68543; font-size: 11px; line-height: 1.35; }
.user-chip { display: flex; align-items: center; gap: 9px; padding: 12px; border-top: 1px solid var(--line); }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: var(--teal); background: #d8eeeb; font-size: 12px; font-weight: 800; }
.user-copy { flex: 1; min-width: 0; }
.user-copy strong, .user-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-copy strong { font-size: 12px; }
.user-copy span { margin-top: 3px; color: var(--muted); font-size: 11px; }

.main { min-width: 0; }
.topbar { height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 34px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.82); backdrop-filter: blur(10px); }
.mobile-menu { display: none; }
.breadcrumb { color: var(--muted); font-size: 13px; }
.breadcrumb strong { color: var(--ink); font-weight: 700; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.date-pill { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 9px; background: #fff; font-size: 12px; }
.content { max-width: 1500px; margin: 0 auto; padding: 32px 34px 44px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.page-heading h1 { margin: 6px 0 8px; font-size: clamp(27px, 3vw, 36px); letter-spacing: -.055em; line-height: 1.05; }
.page-heading p { margin: 0; color: var(--muted); font-size: 14px; }
.heading-actions { display: flex; align-items: center; gap: 9px; }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 22px; }
.stat-card { min-height: 112px; padding: 17px 18px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
.stat-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 12px; font-weight: 650; }
.stat-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; }
.stat-card:nth-child(1) .stat-icon { color: var(--teal); background: var(--teal-soft); }
.stat-card:nth-child(2) .stat-icon { color: #9d731d; background: var(--yellow-soft); }
.stat-card:nth-child(3) .stat-icon { color: var(--lavender); background: var(--lavender-soft); }
.stat-card:nth-child(4) .stat-icon { color: var(--coral); background: var(--coral-soft); }
.stat-value { margin-top: 15px; font-size: 29px; letter-spacing: -.05em; font-weight: 780; }
.stat-foot { margin-top: 4px; color: var(--muted); font-size: 11px; }
.stat-foot .up { color: var(--teal); font-weight: 700; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, .75fr); gap: 22px; align-items: start; }
.card { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.card-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.card-heading h2 { margin: 0; font-size: 15px; letter-spacing: -.02em; }
.card-heading p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.heading-copy { min-width: 0; }
.segmented { display: inline-flex; padding: 3px; border-radius: 9px; background: var(--surface-soft); }
.segmented button { padding: 6px 9px; border-radius: 7px; color: var(--muted); background: transparent; font-size: 11px; font-weight: 700; }
.segmented button.active { color: var(--teal); background: #fff; box-shadow: 0 2px 7px rgba(24, 49, 51, .07); }
.agenda-list { padding: 6px 20px 8px; }
.appointment { position: relative; display: grid; grid-template-columns: 77px minmax(0, 1fr) auto; gap: 14px; align-items: center; min-height: 82px; padding: 13px 0; border-bottom: 1px solid #edf0f1; }
.appointment:last-child { border-bottom: 0; }
.appointment::before { content: ""; position: absolute; left: -20px; top: 16px; bottom: 16px; width: 3px; border-radius: 3px; background: var(--teal); opacity: .2; }
.appointment.current::before { opacity: 1; }
.appointment-time strong { display: block; font-size: 14px; }
.appointment-time span { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.patient-line { display: flex; align-items: center; gap: 9px; min-width: 0; }
.patient-avatar { width: 31px; height: 31px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 9px; color: var(--teal); background: #e4f2f0; font-size: 11px; font-weight: 800; }
.patient-avatar.purple { color: #6d67a2; background: #edecfa; }
.patient-avatar.gold { color: #966f23; background: #fff2ce; }
.patient-avatar.coral { color: #a65245; background: #fbe9e6; }
.patient-copy { min-width: 0; }
.patient-copy strong, .patient-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.patient-copy strong { font-size: 13px; }
.patient-copy span { margin-top: 4px; color: var(--muted); font-size: 11px; }
.appointment-status { display: inline-flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 7px; font-size: 11px; font-weight: 750; white-space: nowrap; }
.appointment-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-confirmed { color: var(--teal); background: var(--teal-soft); }
.status-pending { color: #a16f10; background: var(--yellow-soft); }
.status-cancelled { color: #b55d50; background: var(--coral-soft); }
.appointment-arrow { color: #a7b1b2; }
.appointment:hover { cursor: pointer; }
.appointment:hover .patient-copy strong { color: var(--teal); }

.right-stack { display: grid; gap: 22px; }
.next-card { overflow: hidden; }
.next-body { padding: 20px; }
.next-label { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 11px; font-weight: 700; }
.next-time { margin: 18px 0 6px; color: var(--teal); font-size: 38px; letter-spacing: -.06em; font-weight: 780; }
.next-patient { font-size: 16px; font-weight: 760; }
.next-meta { margin-top: 6px; color: var(--muted); font-size: 12px; }
.next-divider { height: 1px; margin: 20px 0; background: var(--line); }
.next-note { display: flex; gap: 8px; color: #617173; font-size: 12px; line-height: 1.45; }
.quick-actions { display: flex; gap: 8px; margin-top: 18px; }
.quick-actions .btn { flex: 1; }
.comms-card .card-heading { padding-bottom: 14px; }
.comms-list { display: grid; gap: 3px; padding: 7px 20px 15px; }
.comm-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid #edf0f1; }
.comm-row:last-child { border-bottom: 0; }
.comm-icon { width: 29px; height: 29px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 8px; color: #1c9c7b; background: #e3f6ef; font-weight: 800; }
.comm-copy { min-width: 0; flex: 1; }
.comm-copy strong, .comm-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.comm-copy strong { font-size: 12px; }
.comm-copy span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.comm-status { color: var(--teal); font-size: 11px; font-weight: 700; }
.comm-status.pending { color: #a16f10; }

.view-shell { display: grid; gap: 22px; }
.agenda-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px 16px; }
.toolbar-left, .toolbar-right { display: flex; align-items: center; gap: 9px; }
.toolbar-date { display: flex; align-items: center; gap: 8px; font-weight: 730; font-size: 14px; }
.calendar-view { overflow: hidden; }
.calendar-grid { display: grid; grid-template-columns: 60px repeat(4, minmax(150px, 1fr)); min-width: 760px; }
.calendar-grid.week { grid-template-columns: 60px repeat(7, minmax(118px, 1fr)); }
.calendar-wrap { overflow-x: auto; }
.calendar-head { min-height: 67px; padding: 12px 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface-soft); text-align: center; }
.calendar-head:first-child { background: #fff; }
.calendar-head span { display: block; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.calendar-head strong { display: block; margin-top: 7px; font-size: 13px; }
.calendar-head.today strong { color: var(--teal); }
.calendar-time-stack { min-height: 620px; background: #fff; }
.calendar-column { position: relative; min-height: 620px; border-right: 1px solid var(--line); background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 61px, #edf0f1 62px); }
.calendar-time { min-height: 62px; padding-top: 8px; border-right: 1px solid var(--line); color: var(--muted); background: #fff; text-align: right; padding-right: 8px; font-size: 10px; }
.calendar-event { position: absolute; left: 8px; right: 8px; min-height: 58px; padding: 8px; border-left: 3px solid var(--teal); border-radius: 7px; color: var(--ink); background: #e7f5f2; font-size: 11px; }
.calendar-event strong, .calendar-event span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calendar-event strong { font-size: 11px; }
.calendar-event span { margin-top: 5px; color: #55716f; font-size: 10px; }
.calendar-event.yellow { border-color: #dca733; background: #fff4d6; }
.calendar-event.purple { border-color: #8984c7; background: #efeffa; }
.calendar-event.coral { border-color: #df7566; background: #fcebe8; }
.block-banner { display: flex; align-items: center; gap: 12px; padding: 14px 18px; color: #816520; background: var(--yellow-soft); border: 1px solid #f3dfad; border-radius: 12px; }
.block-banner strong { font-size: 12px; }
.block-banner span { margin-left: auto; color: #a58339; font-size: 11px; }

.patients-layout { display: grid; grid-template-columns: minmax(270px, .7fr) minmax(0, 1.3fr); gap: 22px; align-items: start; }
.patient-list-card, .patient-detail-card { overflow: hidden; }
.search-row { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.search-box { position: relative; }
.search-box svg { position: absolute; top: 15px; left: 13px; width: 16px; color: #9ca9ab; }
.search-box input { height: 42px; padding-left: 39px; background: var(--surface-soft); }
.patient-list { padding: 5px 10px 10px; }
.patient-list-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 9px; border-radius: 11px; color: var(--ink); background: transparent; text-align: left; }
.patient-list-item:hover, .patient-list-item.active { background: var(--teal-soft); }
.patient-list-item.active .patient-copy strong { color: var(--teal); }
.patient-detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 22px; border-bottom: 1px solid var(--line); }
.detail-person { display: flex; gap: 13px; align-items: center; }
.detail-avatar { width: 50px; height: 50px; display: grid; place-items: center; border-radius: 15px; color: var(--teal); background: var(--teal-soft); font-size: 16px; font-weight: 800; }
.detail-person h2 { margin: 0; font-size: 20px; letter-spacing: -.035em; }
.detail-person p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.detail-actions { display: flex; gap: 8px; }
.patient-detail-body { padding: 22px; }
.info-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding-bottom: 21px; border-bottom: 1px solid var(--line); }
.info-cell span { display: block; color: var(--muted); font-size: 11px; }
.info-cell strong { display: block; margin-top: 5px; font-size: 13px; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 21px 0 12px; }
.section-title h3 { margin: 0; font-size: 13px; }
.section-title span { color: var(--muted); font-size: 11px; }
.operational-note { display: flex; gap: 10px; padding: 13px; border: 1px solid #cfe8e4; border-radius: 11px; color: #315d5a; background: #f1faf8; font-size: 12px; line-height: 1.45; }
.operational-note svg { flex: 0 0 auto; color: var(--teal); }
.history-row { display: grid; grid-template-columns: 84px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 12px 0; border-bottom: 1px solid #edf0f1; }
.history-row:last-child { border-bottom: 0; }
.history-row time { color: var(--muted); font-size: 11px; }
.history-row strong { display: block; font-size: 12px; }
.history-row p { margin: 4px 0 0; color: var(--muted); font-size: 11px; line-height: 1.4; }
.history-tag { padding: 4px 7px; color: var(--lavender); background: var(--lavender-soft); border-radius: 6px; font-size: 10px; font-weight: 750; }

.blocks-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(290px, .7fr); gap: 22px; align-items: start; }
.block-list { padding: 3px 20px 12px; }
.block-row { display: flex; align-items: center; gap: 13px; padding: 15px 0; border-bottom: 1px solid #edf0f1; }
.block-row:last-child { border-bottom: 0; }
.block-symbol { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: #977022; background: var(--yellow-soft); }
.block-copy { flex: 1; min-width: 0; }
.block-copy strong { display: block; font-size: 13px; }
.block-copy span { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.block-type { padding: 5px 8px; color: #8e6c22; border-radius: 6px; background: var(--yellow-soft); font-size: 10px; font-weight: 750; }
.rule-list { padding: 6px 20px 17px; }
.rule-row { display: flex; align-items: center; gap: 9px; padding: 9px 0; color: #617173; border-bottom: 1px solid #edf0f1; font-size: 12px; }
.rule-row:last-child { border-bottom: 0; }
.rule-row svg { color: var(--teal); }

.comms-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, .67fr); gap: 22px; }
.email-campaign-card { overflow: hidden; }
.preview-pill { padding: 6px 9px; color: #7f652a; border-radius: 7px; background: var(--yellow-soft); font-size: 10px; font-weight: 750; white-space: nowrap; }
.campaign-body { display: grid; grid-template-columns: 235px minmax(0, 1fr); }
.campaign-nav { padding: 11px; border-right: 1px solid var(--line); background: var(--surface-soft); }
.campaign-option { display: flex; align-items: center; gap: 9px; width: 100%; padding: 11px 9px; border-radius: 10px; color: var(--ink); background: transparent; text-align: left; }
.campaign-option:hover, .campaign-option.active { color: var(--teal); background: #fff; box-shadow: 0 2px 8px rgba(24, 49, 51, .05); }
.campaign-option > span:nth-child(2) { min-width: 0; flex: 1; }
.campaign-option strong, .campaign-option small { display: block; }
.campaign-option strong { font-size: 12px; }
.campaign-option small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.campaign-option svg { color: #a8b4b5; }
.campaign-option-icon { width: 28px; height: 28px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 8px; color: var(--teal); background: var(--teal-soft); font-size: 14px; font-weight: 800; }
.campaign-option-icon.purple { color: var(--lavender); background: var(--lavender-soft); }
.campaign-option-icon.gold { color: #9c741e; background: var(--yellow-soft); }
.campaign-editor { padding: 22px; }
.campaign-editor-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.campaign-editor h3 { margin: 7px 0 0; font-size: 19px; letter-spacing: -.035em; }
.campaign-status { padding: 6px 8px; color: #7369ab; border-radius: 7px; background: var(--lavender-soft); font-size: 10px; font-weight: 750; white-space: nowrap; }
.campaign-preview { margin-top: 18px; padding: 17px 18px; border: 1px solid #e7edef; border-radius: 12px; background: #fbfcfc; }
.mail-kicker { color: var(--muted); font-size: 10px; letter-spacing: .1em; font-weight: 800; }
.campaign-preview p { max-width: 640px; margin: 11px 0 12px; color: #4f6264; font-size: 13px; line-height: 1.5; }
.campaign-preview a { display: inline-flex; align-items: center; gap: 5px; color: var(--teal); font-size: 11px; font-weight: 750; text-decoration: none; }
.campaign-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 17px; }
.campaign-meta div { padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; }
.campaign-meta span, .campaign-meta strong { display: block; }
.campaign-meta span { color: var(--muted); font-size: 10px; }
.campaign-meta strong { margin-top: 5px; font-size: 12px; }
.campaign-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.campaign-disclaimer { margin: 10px 0 0; color: #9aa6a8; text-align: right; font-size: 10px; }
.comms-table { padding: 7px 20px 16px; }
.comm-table-head, .comm-table-row { display: grid; grid-template-columns: minmax(150px, 1.2fr) minmax(130px, 1fr) 110px 90px; gap: 12px; align-items: center; }
.comm-table-head { padding: 9px 0; color: var(--muted); border-bottom: 1px solid var(--line); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.comm-table-row { padding: 13px 0; border-bottom: 1px solid #edf0f1; font-size: 12px; }
.comm-table-row:last-child { border-bottom: 0; }
.comm-table-row strong { display: block; font-size: 12px; }
.comm-table-row span { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.channel { display: inline-flex; align-items: center; gap: 6px; color: #179578; font-weight: 700; }
.channel::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.channel.email { color: var(--lavender); }
.flow-card { padding-bottom: 18px; }
.flow { padding: 9px 20px 0; }
.flow-step { position: relative; display: flex; gap: 10px; padding: 10px 0 13px; }
.flow-step:not(:last-child)::after { content: ""; position: absolute; left: 11px; top: 31px; bottom: -1px; border-left: 1px dashed var(--line-strong); }
.flow-dot { width: 23px; height: 23px; display: grid; place-items: center; z-index: 1; flex: 0 0 auto; color: var(--teal); border: 4px solid #e2f2ef; border-radius: 50%; background: var(--teal); font-size: 0; }
.flow-dot.pending { color: #a16f10; border-color: #fff0c5; background: #e1ad40; }
.flow-step strong { display: block; font-size: 12px; }
.flow-step span { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.35; }

.modal-backdrop { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 20px; background: rgba(17, 36, 38, .32); backdrop-filter: blur(4px); }
.modal { width: min(580px, 100%); max-height: min(720px, 92vh); overflow: auto; border: 1px solid rgba(23, 107, 103, .12); border-radius: 20px; background: #fff; box-shadow: 0 30px 70px rgba(14, 49, 51, .2); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 22px 22px 17px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 18px; letter-spacing: -.035em; }
.modal-head p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.modal-body { padding: 21px 22px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 0 22px 22px; }
.modal-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.modal-grid .field { margin-bottom: 2px; }
.radio-row { display: flex; gap: 8px; margin: 6px 0 16px; }
.radio-option { flex: 1; }
.radio-option input { position: absolute; opacity: 0; }
.radio-option label { display: block; padding: 11px 10px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); text-align: center; font-size: 12px; cursor: pointer; }
.radio-option input:checked + label { color: var(--teal); border-color: #a9d7d2; background: var(--teal-soft); font-weight: 750; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 30; display: flex; align-items: center; gap: 10px; padding: 13px 15px; color: #fff; border-radius: 11px; background: #1f4648; box-shadow: 0 12px 30px rgba(11, 38, 40, .2); font-size: 13px; animation: toast-in .2s ease-out; }
@keyframes toast-in { from { transform: translateY(7px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.empty-state { padding: 44px 24px; color: var(--muted); text-align: center; font-size: 13px; }
.hidden { display: none !important; }

@media (max-width: 1080px) {
  .app-shell { grid-template-columns: 216px minmax(0, 1fr); }
  .sidebar { padding-left: 10px; padding-right: 10px; }
  .topbar, .content { padding-left: 24px; padding-right: 24px; }
  .dashboard-grid, .patients-layout, .blocks-layout, .comms-layout { grid-template-columns: 1fr; }
  .right-stack { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .login-card { grid-template-columns: 1fr; min-height: auto; }
  .login-brand { min-height: 380px; padding: 35px 30px; }
  .login-headline { margin-top: 70px; }
  .login-form { padding: 36px 30px 40px; }
  .app-shell { display: block; }
  .sidebar { position: fixed; inset: 0 auto 0 0; z-index: 15; width: 260px; transform: translateX(-105%); transition: transform .2s ease; box-shadow: 16px 0 35px rgba(12, 40, 43, .12); }
  .sidebar.open { transform: translateX(0); }
  .mobile-menu { display: inline-grid; }
  .topbar { height: 64px; padding: 0 16px; }
  .breadcrumb { font-size: 12px; }
  .top-actions .date-pill { display: none; }
  .content { padding: 24px 16px 32px; }
  .page-heading { align-items: flex-start; flex-direction: column; gap: 14px; }
  .heading-actions { width: 100%; }
  .heading-actions .btn-primary { flex: 1; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-card { min-height: 105px; }
  .right-stack { grid-template-columns: 1fr; }
  .campaign-body { grid-template-columns: 1fr; }
  .campaign-nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-right: 0; border-bottom: 1px solid var(--line); }
  .campaign-option { align-items: flex-start; }
  .campaign-option svg { display: none; }
  .campaign-editor { padding: 18px 16px; }
  .card-heading { padding-left: 16px; padding-right: 16px; }
  .agenda-list { padding-left: 16px; padding-right: 16px; }
  .appointment { grid-template-columns: 61px minmax(0, 1fr); gap: 10px; }
  .appointment > .appointment-status { grid-column: 2; justify-self: start; margin-top: -8px; }
  .appointment::before { left: -16px; }
  .calendar-grid { min-width: 700px; }
  .info-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .patient-detail-head { flex-direction: column; }
  .detail-actions { width: 100%; }
  .detail-actions .btn { flex: 1; }
  .comm-table-head { display: none; }
  .comm-table-row { grid-template-columns: minmax(0, 1fr) auto; gap: 7px; }
  .comm-table-row > :nth-child(2) { grid-column: 1; }
  .comm-table-row > :nth-child(3) { grid-column: 2; grid-row: 1 / span 2; }
  .comm-table-row > :nth-child(4) { grid-column: 1; }
  .toolbar-left .btn-ghost span { display: none; }
  .campaign-nav { grid-template-columns: 1fr; }
  .campaign-option { align-items: center; }
  .campaign-option svg { display: block; }
  .campaign-actions { flex-direction: column-reverse; }
  .campaign-actions .btn { width: 100%; }
}
