@import url('/css/tokens.css');

/* Shared foundation: local fonts, readable contrast and visible keyboard focus. */
* { box-sizing: border-box; }
html { font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Arial, sans-serif; color: var(--ink); background: var(--canvas); font-size: 15px; line-height: 1.5; -webkit-text-size-adjust: 100%; }
body { margin: 0; }
a { color: var(--forest); text-decoration: none; text-underline-offset: .2em; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; }
button, .button, .button-secondary { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; border: 1px solid var(--forest); background: var(--forest); color: white; border-radius: 8px; padding: 10px 17px; cursor: pointer; font-size: 14px; font-weight: 600; line-height: 1.4; text-decoration: none; transition: background-color .15s, border-color .15s; }
button:hover, .button:hover { background: var(--primary-hover); border-color: var(--primary-hover); text-decoration: none; }
button:disabled { background: #e6ecf1; border-color: #c6d1dc; color: #627487; cursor: not-allowed; }
.button-secondary { background: white; color: var(--ink); border-color: var(--input-line); }
.button-secondary:hover { background: #f0f6f6; border-color: var(--forest); color: var(--forest); text-decoration: none; }
.text-button { min-height: 40px; background: none; border-color: transparent; color: var(--forest); padding: 8px; font-size: 13px; }
.text-button:hover { background: var(--sage); border-color: transparent; }
.danger { color: var(--danger); }
.danger:hover { background: #fff1f2; color: #912538; }
input, select, textarea { width: 100%; min-width: 0; min-height: 44px; border: 1px solid var(--input-line); border-radius: 8px; padding: 10px 12px; background: white; color: var(--ink); line-height: 1.4; }
input::placeholder, textarea::placeholder { color: #627487; opacity: 1; }
select { padding-right: 30px; }
textarea { min-height: 112px; resize: vertical; }
input[type=checkbox], input[type=radio] { width: 19px; min-height: 19px; height: 19px; flex: 0 0 19px; accent-color: var(--forest); margin: 0; cursor: pointer; }
input[type=hidden], [hidden] { display: none !important; }
input:focus, select:focus, textarea:focus { border-color: var(--forest); }
:where(button,a,input,select,textarea,summary,[tabindex]):focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
label { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 600; line-height: 1.5; }
label > input, label > select, label > textarea { margin-top: 7px; }
.checkbox-label { display: flex; align-items: flex-start; gap: 10px; min-height: 28px; }
.checkbox-label input { margin-top: 2px; }
.icon { display: inline-block; width: 20px; height: 20px; flex: 0 0 20px; vertical-align: middle; }
h1, h2, h3 { color: var(--ink); text-wrap: balance; }
h1 { font-size: 30px; line-height: 1.2; letter-spacing: -.9px; margin: 8px 0 10px; font-weight: 700; }
h2 { font-size: 17px; line-height: 1.4; letter-spacing: -.25px; margin: 0 0 18px; font-weight: 650; }
h3 { font-size: 15px; margin: 0 0 7px; font-weight: 650; }
p { line-height: 1.65; }
small, .muted, .field-help { color: var(--muted); }
small, .field-help { font-size: 12px; line-height: 1.6; }
.field-help { display: block; margin: 7px 0 0; }
.field-help a, .card p a, .setting-row a { text-decoration: underline; }
hr { border: 0; border-top: 1px solid var(--line); margin: 26px 0; }
code { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
ul { padding-left: 22px; }
li { margin-block: 8px; }
dl { margin: 18px 0; }
dt { color: var(--muted); font-size: 13px; }
dd { margin: 4px 0 14px; font-weight: 600; }
.sr-only { position: absolute; clip: rect(0,0,0,0); clip-path: inset(50%); height: 1px; width: 1px; overflow: hidden; white-space: nowrap; }
.skip-link { position: fixed; left: 16px; top: -100px; z-index: 100; padding: 12px 20px; background: white; border: 1px solid var(--forest); border-radius: 8px; }
.skip-link:focus { top: 12px; }

/* Application shell. Navigation remains usable without JavaScript. */
.sidebar { width: 248px; position: fixed; inset: 0 auto 0 0; z-index: 30; background: var(--sidebar); color: white; padding: 29px 16px 16px; display: flex; flex-direction: column; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #64828d var(--sidebar); }
.sidebar-brand { padding: 0 12px 22px; }
.brand { font-size: 25px; line-height: 1.2; font-weight: 700; display: inline-flex; align-items: center; gap: 11px; letter-spacing: -.9px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark { display: grid; place-items: center; background: var(--forest); color: white; width: 37px; height: 37px; border-radius: 11px; flex: 0 0 37px; box-shadow: 0 2px 4px #00000008; }
.brand-mark .icon { width: 25px; height: 25px; stroke-width: 2.5; }
.sidebar .brand { color: white; }
.sidebar .brand-mark { background: #c4eee3; color: #145849; }
.brand-caption { display: block; margin-top: 5px; color: var(--sidebar-muted); font-size: 10px; letter-spacing: .75px; font-weight: 400; }
.nav-group { display: grid; gap: 3px; margin-bottom: 13px; }
.nav-caption, .eyebrow, .section-kicker { font-size: 10px; font-weight: 700; letter-spacing: 1.25px; text-transform: uppercase; color: var(--muted); }
.nav-caption { margin: 13px 12px 9px; color: var(--sidebar-muted); font-size: 9px; letter-spacing: 1.5px; }
.sidebar nav a { position: relative; display: flex; align-items: center; gap: 12px; min-height: 41px; padding: 9px 13px; color: #d1dfe5; font-size: 13px; border-radius: 7px; line-height: 1.4; }
.sidebar nav a .icon { opacity: .85; width: 18px; height: 18px; flex-basis: 18px; }
.sidebar nav a:hover { background: #214550; color: white; text-decoration: none; }
.sidebar nav a[aria-current=page] { background: #28515a; color: white; font-weight: 600; }
.sidebar nav a[aria-current=page]::before { content: ""; position: absolute; width: 3px; left: 0; top: 11px; bottom: 11px; border-radius: 3px; background: #9be4ce; }
.sidebar :focus-visible { outline-color: #9be4ce; }
.sidebar-footer { display: flex; gap: 10px; margin-top: auto; font-size: 12px; color: #e2efee; padding: 20px 10px 6px; border-top: 1px solid #395661; }
.sidebar-footer .icon { color: #a6d8c7; margin-top: 2px; }
.sidebar-footer small { display: block; color: var(--sidebar-muted); font-size: 10px; line-height: 1.6; margin-top: 5px; }
.mobile-menu { display: none; }
.workspace { margin-left: 248px; min-height: 100vh; display: flex; flex-direction: column; }
.topbar { min-height: 77px; border-bottom: 1px solid var(--line); padding: 14px 32px; display: flex; align-items: center; justify-content: space-between; gap: 20px; background: white; }
.workspace-context { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; }
.workspace-context strong { font-weight: 600; color: var(--ink); }
.workspace-context-icon { display: grid; place-items: center; width: 33px; height: 33px; border: 1px solid var(--line); border-radius: 9px; background: #f8fafc; }
.workspace-context-icon .icon { width: 17px; height: 17px; }
.context-divider { margin: 0 12px; color: #778799; }
.topbar-actions { display: flex; align-items: center; gap: 16px; font-size: 12px; flex-shrink: 0; }
.topbar-actions form { margin: 0; }
.language-switch { display: inline-flex; align-items: center; padding: 3px; background: #f3f6f9; border: 1px solid var(--line); border-radius: 8px; gap: 2px; }
.language-switch a { display: inline-flex; align-items: center; min-height: 32px; padding: 5px 10px; color: var(--muted); font-size: 12px; border-radius: 5px; }
.language-switch a[aria-current] { color: var(--ink); background: white; box-shadow: 0 1px 4px #18354c16; font-weight: 600; }
.language-switch a:hover { background: white; text-decoration: none; }
.workspace-switch { display: flex; align-items: center; gap: 7px; color: var(--muted); min-height: 40px; }
.workspace-switch .icon { width: 16px; height: 16px; flex-basis: 16px; }
.sign-out { color: var(--muted); font-size: 12px; }
.sign-out .icon { width: 16px; height: 16px; flex-basis: 16px; }
main { max-width: 1560px; width: 100%; min-width: 0; margin: 0 auto; padding: 32px; flex: 1; outline: none; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 25px; margin-bottom: 27px; }
.page-heading p { color: var(--muted); font-size: 13px; margin: 0; max-width: 650px; }
.page-actions { display: flex; align-items: flex-end; gap: 12px; flex-direction: column; flex-shrink: 0; }
main > .page-actions { margin-bottom: 22px; }
.schedule-date { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); }
.schedule-date .icon { width: 15px; height: 15px; }
.footer { display: flex; flex-wrap: wrap; gap: 12px; color: var(--muted); font-size: 11px; padding: 20px 32px 28px; }
.footer > span:first-child { font-weight: 700; color: var(--ink); }
.footer > span + span { border-left: 1px solid #c3ced9; padding-left: 12px; }

/* Content surfaces and forms. */
.card { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: white; padding: 25px; margin-bottom: 23px; box-shadow: var(--shadow); }
.card:has(> .card-header) { padding: 0; }
.card-header { padding: 21px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); }
.card-header h2, .card-header h3 { margin: 0; }
.card-header p { font-size: 12px; margin: 5px 0 0; }
.card-header .eyebrow { display: block; margin-bottom: 4px; }
.card-body { padding: 24px; }
.card-body > :first-child { margin-top: 0; }
.card-body > :last-child { margin-bottom: 0; }
.narrow { max-width: 580px; margin: 28px auto; }
.section-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin-bottom: 20px; }
.section-heading h2 { margin: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); align-items: start; gap: 21px 24px; }
.form-grid > button { justify-self: start; align-self: end; }
.form-stack, .stack { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.form-stack { margin-top: 24px; }
.form-stack > button { margin-top: 3px; }
.stack > .card { margin-bottom: 0; }
.field { min-width: 0; }
.field > label { margin-bottom: 7px; }
.form-section, .form-actions { grid-column: 1 / -1; }
.form-actions { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 14px; padding-top: 20px; border-top: 1px solid var(--line); }
.form-actions .field-help { margin: 0; }
.inline-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.inline-form input, .inline-form select { width: auto; min-width: 145px; }
.inline-form label { margin: 0; }
.card > form:not(.form-grid,.inline-form,.setting-row,.filter-bar) { display: grid; gap: 12px; margin-top: 18px; }
.card > form > button { justify-self: start; }
.card > form > label { margin-bottom: -5px; }
.filter-bar { padding: 18px 24px; background: #fafbfd; display: flex; align-items: flex-end; flex-wrap: wrap; gap: 12px; border-bottom: 1px solid var(--line); }
.filter-bar .field { width: 290px; max-width: 100%; }
.filter-bar label { font-size: 12px; }
.filter-bar input[type=date] { max-width: 220px; }
.filter-bar:has(input[type=date]) .field { width: auto; }
.card > .filter-bar:last-child { border-radius: 0 0 var(--radius) var(--radius); border-bottom: 0; }
.consent-panel { background: #f4f8fa; padding: 18px; border-radius: 9px; margin-top: 3px; }
.consent-panel .section-heading { justify-content: flex-start; flex-wrap: nowrap; align-items: flex-start; margin: 0; gap: 12px; }
.consent-panel .icon { color: var(--forest); }
.consent-panel h3 { margin-bottom: 2px; }
.consent-panel p { margin: 0; }
.alert, .notice { background: #fff8ed; color: #804611; border: 1px solid #e2bf86; border-radius: 9px; padding: 14px 18px; font-size: 13px; line-height: 1.6; margin: 0 0 22px; overflow-wrap: anywhere; }
.alert:empty { display: none; }
.notice { background: #eef6fc; color: #27516e; border-color: #a5c4db; }
.validation-summary-valid { display: none; }
.validation-summary-errors, .field-validation-error { color: var(--danger); }
.input-validation-error { border-color: var(--danger); }
.pill, .badge, .status-badge, .count-badge { display: inline-flex; align-items: center; justify-content: center; gap: 5px; border: 1px solid #c9e5db; background: var(--sage); color: #176150; padding: 5px 10px; border-radius: 6px; font-size: 11px; font-weight: 600; line-height: 1.4; white-space: nowrap; }
.pill { border-radius: 30px; }
.pill .icon { width: 13px; height: 13px; flex-basis: 13px; }
.status-badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.status-booked, .status-waiting { color: #25578a; background: #edf4ff; border-color: #d0e0f5; }
.status-checkedin, .status-called { color: #80500e; background: #fff6df; border-color: #eddaaa; }
.status-cancelled, .status-noshow { color: #92364b; background: #fdf0f3; border-color: #edced6; }
.status-completed { color: #176150; }
.count-badge { border-radius: 30px; min-width: 29px; height: 29px; padding: 4px 8px; }
.secret-key { display: block; padding: 20px; background: var(--sage); font-size: 17px; letter-spacing: 2px; color: var(--forest); overflow-wrap: anywhere; }

/* Overview cards, data tables and appointment queue. */
.stat-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 18px; margin-bottom: 26px; }
.stat { position: relative; min-width: 0; background: white; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.stat > .stat-icon { position: absolute; top: 20px; right: 18px; }
.stat-label { font-size: 12px; font-weight: 600; color: var(--muted); padding-right: 35px; }
.stat strong, .stat-value { color: var(--ink); font-size: 34px; font-weight: 650; letter-spacing: -1px; line-height: 1.2; margin: 18px 0 9px; font-variant-numeric: tabular-nums; }
.stat-meta { color: var(--muted); font-size: 11px; }
.stat-icon, .icon-badge { display: inline-grid; place-items: center; width: 35px; height: 35px; border-radius: 10px; background: #edf6f4; color: var(--forest); flex: 0 0 35px; }
.stat:nth-child(2) .stat-icon { background: #eff3fc; color: #4a66a0; }
.stat:nth-child(3) .stat-icon { background: #fcf3e6; color: #8e631d; }
.stat:nth-child(4) .stat-icon { background: #eff2fa; color: #655397; }
.workspace-grid { display: grid; grid-template-columns: minmax(0,1fr) 292px; gap: 22px; align-items: start; }
.table-scroll { overflow-x: auto; scrollbar-width: thin; }
.table-scroll-hint { display: none; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; }
thead th { font-size: 10px; color: var(--muted); font-weight: 650; text-transform: uppercase; letter-spacing: .7px; padding: 13px 20px; background: #fafbfd; border-bottom: 1px solid var(--line); white-space: nowrap; }
td, tbody th { padding: 19px 20px; border-bottom: 1px solid #edf1f5; font-size: 13px; line-height: 1.5; text-align: left; font-weight: 400; }
tbody tr:last-child > * { border-bottom: 0; }
tbody tr:hover { background: #fbfcfe; }
.data-table { min-width: 650px; }
.card > .table-scroll:last-child { padding-bottom: 5px; border-radius: 0 0 var(--radius) var(--radius); }
.time-cell { font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cell-primary { display: block; font-weight: 600; color: var(--ink); }
.cell-secondary { display: block; color: var(--muted); font-size: 11px; font-weight: 400; margin-top: 4px; }
.row-actions { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }
.row-actions a:not(.button-secondary) { display: inline-flex; align-items: center; gap: 4px; min-height: 36px; font-size: 12px; font-weight: 600; }
.row-actions button, .row-actions .button-secondary { min-height: 36px; padding: 7px 10px; font-size: 12px; }
.row-actions .icon { width: 16px; height: 16px; flex-basis: 16px; }
.patient-identity { display: flex; align-items: center; gap: 12px; }
.patient-avatar { display: grid; place-items: center; width: 37px; height: 37px; border-radius: 50%; flex-shrink: 0; background: #ebf1f8; color: #526b8a; }
.empty-state { text-align: center; padding: 42px 24px; color: var(--muted); }
.empty-icon { width: 52px; height: 52px; background: #f1f5f8; color: #637d8f; display: inline-grid; place-items: center; border-radius: 15px; margin-bottom: 17px; }
.empty-icon .icon { width: 25px; height: 25px; }
.empty-state h3 { color: var(--ink); font-size: 14px; margin-bottom: 6px; }
.empty-state p { max-width: 330px; margin: 0 auto 16px; font-size: 12px; }
.empty-state .button-secondary { margin-top: 7px; }
.queue-card .empty-state { padding: 10px 0 3px; }
.queue-card .empty-state p { margin-bottom: 0; }
.queue-list { display: flex; flex-direction: column; gap: 12px; }
.queue-ticket { border: 1px solid var(--line); border-radius: 9px; padding: 14px; background: #fafcfd; }
.queue-ticket-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.queue-ticket-number { font-size: 23px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.ticket { display: block; padding: 15px 24px; border: 1px solid var(--line); border-radius: 8px; font-size: 25px; color: var(--forest); }
.ticket small { display: block; }
.queue-wall { display: grid; grid-template-columns: repeat(auto-fit,minmax(240px,1fr)); gap: 24px; }
.queue-display main { max-width: none; }
.queue-number { font-size: clamp(60px,10vw,130px); font-variant-numeric: tabular-nums; }

/* Booking, settings and reports use the same controls and surface hierarchy. */
.booking-layout { display: grid; grid-template-columns: minmax(0,1fr) 310px; align-items: start; gap: 24px; }
.booking-step { display: flex; align-items: center; gap: 13px; }
.step-marker, .step-number { display: grid; place-items: center; border-radius: 50%; background: var(--sage); border: 1px solid #c6e4d8; color: #1c6c56; width: 32px; height: 32px; flex: 0 0 32px; font-size: 13px; font-weight: 650; }
.summary-list, .booking-summary { margin: 0; }
.summary-list > div, .booking-summary > div { padding: 13px 0; border-bottom: 1px solid var(--line); }
.summary-list > div:first-child, .booking-summary > div:first-child { padding-top: 0; }
.summary-list > div:last-child, .booking-summary > div:last-child { border-bottom: 0; }
.summary-list dt, .booking-summary dt { font-size: 11px; margin-bottom: 4px; }
.summary-list dd, .booking-summary dd { font-size: 13px; margin: 0; overflow-wrap: anywhere; }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(120px,1fr)); gap: 12px; margin-top: 18px; }
.slot-button { width: 100%; min-height: 76px; background: white; color: var(--forest); border-color: #7aab9d; flex-direction: column; gap: 7px; padding: 12px; }
.slot-button:hover { background: var(--sage); color: var(--primary-hover); }
.slot-button small { display: inline-flex; align-items: center; gap: 4px; color: inherit; font-size: 11px; }
.slot-button .icon { width: 13px; height: 13px; flex-basis: 13px; }
.setting-row { display: grid; grid-template-columns: minmax(220px,1.5fr) minmax(130px,1fr) minmax(160px,1fr) auto; align-items: center; gap: 18px; padding: 22px 0; border-top: 1px solid var(--line); }
.setting-row label { font-size: 13px; }
.setting-row code { display: block; margin: 5px 0; font-size: 10px; }
.setting-row a { font-size: 11px; }
.setting-row > * { min-width: 0; }
.settings-category-nav { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 0 22px; }
.settings-category-nav a { display: inline-flex; align-items: center; min-height: 34px; border: 1px solid #bdccd8; border-radius: 7px; background: white; padding: 6px 11px; color: var(--muted); font-size: 12px; }
.settings-category-nav a:hover { border-color: var(--forest); color: var(--forest); background: var(--sage); text-decoration: none; }
.settings-category-nav + section { scroll-margin-top: 20px; }
.report-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 22px; align-items: start; margin-bottom: 24px; }
.report-metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 16px; margin: 24px 0; }
.report-metrics .stat { padding: 18px; }
.report-metrics .stat strong { margin-top: 12px; font-size: 30px; }
.chart-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 15px; }
.chart-list li { margin: 0; font-size: 12px; }
.chart-label { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.chart-list meter { width: 100%; height: 13px; display: block; }
meter { accent-color: var(--forest); }
meter::-webkit-meter-bar { background: #edf1f5; border: 0; border-radius: 6px; }
meter::-webkit-meter-optimum-value { background: var(--forest); border-radius: 6px; }
.report-grid .card { height: 100%; margin: 0; }
.workflow-list { list-style: none; padding: 0; margin: 0; }
.workflow-list > li { padding: 18px 0; margin: 0; border-bottom: 1px solid var(--line); }
.workflow-list > li:first-child { padding-top: 0; }
.workflow-list > li:last-child { border-bottom: 0; }

/* Public and staff sign-in surfaces. */
.auth-shell .workspace { margin-left: 0; }
.auth-shell .topbar { max-width: none; padding-inline: max(32px, calc((100vw - 1280px) / 2)); background: white; min-height: 85px; }
.auth-shell main { max-width: 1328px; padding: 42px 24px; display: block; }
.auth-shell .footer { max-width: 1328px; width: 100%; margin-inline: auto; padding-inline: 24px; }
.auth-layout { display: grid; grid-template-columns: 1.08fr 1fr; min-height: 700px; border: 1px solid var(--line); background: white; border-radius: 22px; overflow: hidden; box-shadow: 0 12px 48px #12333f06; }
.auth-story { position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 35px; padding: 52px; background: var(--sidebar); color: #d3e4e8; overflow: hidden; }
.auth-story::before { content: ""; position: absolute; width: 430px; height: 430px; border: 1px solid #ffffff0c; border-radius: 50%; left: -190px; bottom: -280px; box-shadow: 0 0 0 55px #ffffff03, 0 0 0 110px #ffffff03; pointer-events: none; }
.auth-story-content, .auth-workspace-preview { position: relative; }
.auth-story .eyebrow { color: #acd5cb; letter-spacing: 1.8px; }
.auth-story h1 { color: white; font-size: clamp(32px,3.1vw,44px); line-height: 1.16; letter-spacing: -1.4px; margin: 21px 0 18px; max-width: 410px; }
.auth-story-content > p { color: #c4d8df; max-width: 420px; font-size: 14px; line-height: 1.85; }
.auth-benefits { list-style: none; margin: 33px 0 0; padding: 0; display: grid; gap: 24px; }
.auth-benefits li { display: flex; gap: 13px; align-items: flex-start; margin: 0; }
.auth-benefit-icon { display: grid; place-items: center; width: 36px; height: 36px; flex: 0 0 36px; border: 1px solid #436771; border-radius: 10px; background: #214653; color: #bce6d8; }
.auth-benefits strong { display: block; color: #f0f6f8; font-size: 13px; font-weight: 600; margin-bottom: 5px; }
.auth-benefits li div > span { color: #c4d8df; font-size: 12px; line-height: 1.7; display: block; }
.auth-workspace-preview { padding: 18px; border-radius: 13px; background: #ffffff09; border: 1px solid #45646e; }
.preview-calendar { display: flex; align-items: center; gap: 9px; color: white; font-size: 12px; font-weight: 600; flex-wrap: wrap; }
.preview-calendar .icon-badge { width: 30px; height: 30px; flex-basis: 30px; background: #305b63; color: #c8eadf; }
.preview-calendar .pill { margin-left: auto; background: #264d52; border-color: #537a73; color: #e0f4ec; font-size: 9px; }
.preview-schedule { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 9px; margin-top: 17px; }
.preview-appointment { display: flex; flex-direction: column; gap: 9px; font-size: 10px; color: #dfebef; padding: 12px 8px; background: #ffffff05; border: 1px solid #43616c; border-radius: 7px; }
.preview-appointment .icon-badge { background: transparent; color: #c5e6dd; width: 21px; height: 21px; flex-basis: 21px; }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 43px; }
.auth-card { width: 100%; max-width: 370px; }
.auth-panel-heading h2 { font-size: 29px; letter-spacing: -.8px; margin: 17px 0 10px; }
.auth-panel-heading p { font-size: 13px; margin: 0; }
.auth-card .form-stack { gap: 17px; }
.auth-card .form-stack label { font-size: 12px; }
.auth-card .field-help { font-size: 11px; }
.auth-card .form-stack button { min-height: 47px; margin-top: 5px; justify-content: space-between; padding-inline: 17px; }
.auth-recovery { text-align: center; font-size: 12px; margin: 19px 0; }
.auth-recovery a { text-decoration: underline; }
.auth-security-note { display: flex; gap: 9px; align-items: flex-start; border-top: 1px solid var(--line); padding-top: 18px; color: var(--muted); }
.auth-security-note .icon { width: 16px; height: 16px; flex-basis: 16px; margin-top: 2px; color: var(--forest); }
.auth-security-note p { margin: 0; font-size: 11px; }
.hero { padding: 58px 0; }
.hero h1 { font-size: clamp(34px,4.4vw,57px); line-height: 1.1; letter-spacing: -1.8px; margin: 22px 0; }
.hero p { max-width: 590px; color: var(--muted); font-size: 17px; margin-bottom: 28px; }
.welcome-hero { display: flex; gap: 50px; align-items: center; justify-content: space-between; padding: 64px; border-radius: 20px; background: #e8f3f0; border: 1px solid #d3e8e0; margin-bottom: 28px; }
.welcome-hero-content { max-width: 670px; }
.welcome-hero-symbol { width: 170px; height: 170px; display: grid; place-items: center; flex: 0 0 170px; border-radius: 44px; color: var(--forest); background: #d2e8df; transform: rotate(-7deg); }
.welcome-hero-symbol .icon { width: 85px; height: 85px; stroke-width: 1.2; }
.feature-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 24px; }
.feature-grid .icon-badge { margin-bottom: 23px; width: 43px; height: 43px; }
.feature-grid h2 { margin-bottom: 10px; }
.feature-grid p { color: var(--muted); font-size: 13px; line-height: 1.8; }
.feature-grid a { display: inline-flex; gap: 8px; align-items: center; font-size: 12px; font-weight: 600; margin-top: 14px; min-height: 32px; }

/* Patient portal. */
.patient-shell { background: var(--canvas); }
.patient-header { background: white; border-bottom: 1px solid var(--line); padding: 22px max(24px, calc((100vw - 1200px) / 2)); display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.patient-nav { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; font-size: 13px; }
.patient-shell > .patient-nav { background: white; border-bottom: 1px solid var(--line); padding: 12px max(24px, calc((100vw - 1200px) / 2)); }
.patient-nav a { display: inline-flex; align-items: center; gap: 7px; padding: 9px 12px; border-radius: 7px; color: var(--muted); }
.patient-nav a[aria-current=page] { background: var(--sage); color: var(--forest); font-weight: 600; }
.patient-main { max-width: 1248px; padding: 38px 24px; min-height: calc(100vh - 180px); }
.patient-main .inline-form { align-items: flex-start; }
.patient-main .inline-form .field { flex: 1 1 220px; }
.patient-main .inline-form .field input { width: 100%; }
.patient-main .inline-form > button { margin-top: 26px; }
.patient-shell .footer { max-width: 1248px; margin: 0 auto; padding-inline: 24px; }
.booking-steps { list-style: none; display: flex; align-items: center; gap: 22px; margin: 0 0 24px; padding: 0; font-size: 12px; color: var(--muted); }
.booking-steps .booking-step { margin: 0; gap: 8px; }
.booking-steps .step-number { width: 25px; height: 25px; flex-basis: 25px; font-size: 11px; background: white; color: var(--muted); border-color: #8796a5; }
.booking-steps .is-current { color: var(--forest); font-weight: 600; }
.booking-steps .is-current .step-number, .booking-steps .is-complete .step-number { background: var(--forest); border-color: var(--forest); color: white; }
.booking-note { display: flex; align-items: flex-start; gap: 11px; background: var(--sage); color: #285b4b; padding: 17px; border-radius: 10px; font-size: 12px; line-height: 1.7; }
.booking-note p { margin: 0; }
.booking-note .icon { margin-top: 2px; }
.choice-card { display: block; padding: 18px; border: 1px solid var(--line); border-radius: 10px; }
.booking-confirmation { border-top: 4px solid var(--forest); }
.booking-sidebar > .card > .icon-badge { margin-bottom: 17px; }
.booking-note:has(> h3) { display: block; }
.booking-note > h3 { margin-bottom: 10px; }

/* Reflow, touch targets and reduced motion. */
@media (min-width: 1550px) {
  .page-actions { flex-direction: row; align-items: center; gap: 22px; }
  .workspace-grid { grid-template-columns: minmax(0,1fr) 320px; }
}
@media (max-width: 1280px) {
  .workspace-context > span:last-child { max-width: 190px; }
  .workspace-context strong, .context-divider { display: none; }
  .workspace-grid { grid-template-columns: minmax(0,1fr); }
  .queue-card .card-body { display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
  .queue-card .card-body > .button-secondary { grid-column: 2; }
  .queue-card .empty-state, .queue-card .queue-list { grid-row: span 2; }
  .setting-row { grid-template-columns: minmax(200px,1.5fr) minmax(120px,1fr); }
  .setting-row > button { justify-self: start; }
  .report-grid { grid-template-columns: 1fr; }
  .auth-story { padding: 38px; }
}
@media (max-width: 1080px) {
  .sidebar { width: 225px; padding-inline: 12px; }
  .workspace { margin-left: 225px; }
  main { padding: 28px 24px; }
  .topbar { padding-inline: 24px; }
  .workspace-context { display: none; }
  .topbar-actions { margin-left: auto; }
  .stat-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .booking-layout { grid-template-columns: minmax(0,1fr); }
  .booking-sidebar .summary-list { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
  .booking-sidebar .summary-list > div:first-child { padding-top: 13px; }
  .page-heading { align-items: flex-start; }
  .page-actions { flex-shrink: 1; }
  .schedule-date { display: none; }
  .auth-layout { grid-template-columns: 1fr 1fr; }
  .auth-panel { padding: 35px; }
  .preview-calendar .pill { margin: 4px 0 0; }
  .welcome-hero { padding: 44px; }
  .welcome-hero-symbol { display: none; }
  .report-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 800px) {
  .table-scroll-hint { display: block; margin: 0; padding: 10px 18px; color: var(--muted); background: #fafbfd; border-bottom: 1px solid var(--line); font-size: 11px; }
  .sidebar { position: static; width: auto; padding: 16px 18px; max-height: none; }
  .sidebar-brand { padding: 0; display: flex; align-items: center; justify-content: space-between; gap: 15px; }
  .sidebar .brand { font-size: 23px; }
  .brand-caption { font-size: 9px; }
  .mobile-menu { display: inline-flex; color: white; background: #214653; border-color: #72959f; min-height: 40px; padding: 8px 10px; font-size: 12px; }
  .mobile-menu:hover { color: white; background: #2c5663; }
  .sidebar nav { margin-top: 18px; }
  .sidebar nav.collapsed { display: none; }
  .sidebar nav.expanded { display: block; }
  .sidebar nav a { min-height: 44px; }
  .nav-group { margin-bottom: 17px; }
  .sidebar-footer { display: none; }
  .workspace { margin-left: 0; }
  .topbar { min-height: 61px; padding: 10px 18px; }
  .topbar-actions { width: 100%; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
  .workspace-switch { font-size: 11px; }
  .workspace-switch .icon { display: none; }
  main { padding: 26px 18px; }
  .footer { padding: 20px 18px; }
  .page-heading { gap: 15px; margin-bottom: 22px; }
  .page-heading h1 { font-size: 27px; }
  .page-heading .button, .page-heading > .button-secondary { padding: 10px 12px; font-size: 12px; }
  .page-heading .button .icon { width: 17px; height: 17px; flex-basis: 17px; }
  .auth-shell .topbar { padding: 19px 22px; }
  .auth-shell .topbar-actions { width: auto; }
  .auth-shell main { padding: 24px 18px; }
  .auth-layout { grid-template-columns: 1fr; min-height: 0; }
  .auth-story { padding: 32px; }
  .auth-story h1 { font-size: 34px; margin-block: 13px; max-width: none; }
  .auth-story-content > p { max-width: none; margin-bottom: 0; font-size: 13px; }
  .auth-benefits, .auth-workspace-preview { display: none; }
  .auth-panel { padding: 35px 28px; }
  .auth-card { max-width: 450px; }
  .auth-panel-heading h2 { font-size: 27px; }
  .feature-grid { grid-template-columns: 1fr; gap: 0; }
  .welcome-hero { padding: 32px; }
  .hero p { font-size: 15px; }
  .patient-header { padding: 18px 22px; }
  .patient-nav { gap: 14px; }
  .patient-main { padding: 28px 18px; }
}
@media (max-width: 540px) {
  html { font-size: 14px; }
  input, select, textarea { font-size: 16px; }
  .page-heading { flex-direction: column; align-items: stretch; gap: 17px; }
  .page-heading > .button-secondary { align-self: flex-start; }
  .page-actions { align-items: flex-start; }
  .page-heading h1 { font-size: 27px; }
  .stat-grid { gap: 12px; margin-bottom: 20px; }
  .stat { padding: 17px 14px; }
  .stat > .stat-icon { position: static; width: 30px; height: 30px; margin-bottom: 14px; }
  .stat-icon .icon { width: 17px; height: 17px; }
  .stat-label { padding-right: 0; font-size: 11px; }
  .stat strong { font-size: 29px; margin: 10px 0 7px; }
  .stat-meta { font-size: 10px; }
  .card { padding: 21px 18px; border-radius: 11px; }
  .card-header, .card-body { padding: 20px 18px; }
  .card-header h2 { font-size: 16px; }
  .filter-bar { padding: 16px 18px; gap: 10px; }
  .filter-bar .field { width: 100%; flex: 1 1 160px; }
  .filter-bar:has(input[type=date]) .field { width: auto; }
  .filter-bar .button-secondary { padding-inline: 12px; }
  .form-grid { grid-template-columns: minmax(0,1fr); gap: 19px; }
  .form-actions { align-items: stretch; flex-direction: column; padding-top: 18px; }
  .form-actions > button { align-self: stretch; }
  .inline-form { align-items: stretch; }
  .inline-form input, .inline-form select { flex: 1; min-width: 120px; max-width: 100%; }
  .inline-form > label { flex-basis: 100%; }
  .inline-form > button { align-self: flex-end; }
  .queue-card .card-body { display: flex; }
  .queue-card .empty-state { padding-block: 5px 15px; }
  .setting-row { grid-template-columns: minmax(0,1fr); gap: 13px; }
  .setting-row > button { justify-self: stretch; }
  .booking-sidebar .summary-list { grid-template-columns: minmax(0,1fr); }
  .booking-steps { gap: 13px; flex-wrap: wrap; }
  .booking-steps .booking-step { font-size: 11px; }
  .auth-shell .topbar { padding: 16px 18px; gap: 12px; flex-wrap: wrap; }
  .auth-shell .brand { font-size: 23px; }
  .auth-shell .brand-mark { width: 32px; height: 32px; flex-basis: 32px; }
  .auth-shell .language-switch a { padding: 5px 8px; }
  .auth-story { padding: 28px 25px; }
  .auth-story h1 { font-size: 31px; }
  .auth-panel { padding: 29px 23px; }
  .auth-layout { border-radius: 15px; }
  .welcome-hero { padding: 28px; }
  .hero h1 { font-size: 37px; }
  .topbar-actions { gap: 6px; }
  .topbar-actions .language-switch a { padding-inline: 7px; font-size: 11px; }
  .topbar-actions .sign-out { padding-inline: 3px; font-size: 11px; }
  .sign-out .icon { display: none; }
  .patient-header { align-items: flex-start; gap: 16px; padding: 18px; }
  .patient-nav { width: 100%; justify-content: space-between; gap: 8px; }
  .patient-main .inline-form > button { margin-top: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
.sandbox-banner { display: flex; align-items: flex-start; gap: 14px; padding: 13px 28px; background: #fff3cd; color: #654d0a; border-block: 1px solid #d4b45d; font-size: 13px; line-height: 1.65; }
.sandbox-label { display: inline-flex; align-items: center; gap: 7px; font-weight: 750; white-space: nowrap; }
.sandbox-label .icon { width: 18px; height: 18px; flex-shrink: 0; }
.sandbox-code { display: inline-block; margin-inline-start: 6px; }
.sandbox-code strong { font-variant-numeric: tabular-nums; letter-spacing: .06em; }
@media (max-width: 540px) {
  .sandbox-banner { flex-direction: column; gap: 3px; padding: 12px 18px; }
  .sandbox-code { display: block; margin-inline-start: 0; }
}
@media print {
  .sidebar, .topbar, .patient-header, .footer, .skip-link, .row-actions, .page-actions { display: none !important; }
  .workspace { margin: 0; }
  main { padding: 0; }
  .card, .stat { box-shadow: none; break-inside: avoid; }
  .table-scroll { overflow: visible; }
  body, html { background: white; }
}
