:root {
  color-scheme: light;
  --ink: #193247;
  --muted: #687c8d;
  --line: #e1e5e8;
  --canvas: #f8f9fa;
  --surface: #fff;
  --navy: #183b56;
  --blue: #2674a6;
  --blue-soft: #eaf4fa;
  --teal: #2b857c;
  --shadow: 0 1px 3px rgb(25 50 71 / 9%);
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--canvas); font: 15px/1.55 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: inherit; text-decoration: none; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: .45rem; font-size: clamp(1.65rem, 3vw, 2.15rem); line-height: 1.2; letter-spacing: -.035em; }
h2 { margin-bottom: 0; font-size: 1.16rem; letter-spacing: -.015em; }
.muted, .stat-note, small { color: var(--muted); }
.eyebrow { margin-bottom: .35rem; color: var(--teal); font-size: .72rem; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
.app-header { min-height: 76px; display: flex; align-items: center; gap: 2.5rem; padding: .7rem max(1.5rem, calc((100% - 1240px) / 2)); color: #fff; background: var(--navy); box-shadow: 0 3px 12px rgb(22 49 69 / 15%); }
.header-brand { display: flex; align-items: center; gap: .7rem; min-width: 220px; }
.header-brand strong, .header-brand small { display: block; }
.header-brand strong { font-size: .95rem; }
.header-brand small { color: #b8ccd9; font-size: .75rem; }
.brand-mark { width: 54px; height: 54px; display: grid; place-items: center; border: 1px solid #cce8e4; border-radius: 16px; color: #fff; background: linear-gradient(145deg, #398f88, #2374a4); font-weight: 800; letter-spacing: .04em; box-shadow: 0 5px 15px rgb(21 70 91 / 12%); }
.brand-mark-small { width: 42px; height: 42px; border-color: rgb(255 255 255 / 20%); border-radius: 12px; font-size: .82rem; box-shadow: none; }
.main-nav { display: flex; align-self: stretch; align-items: stretch; gap: .35rem; }
.main-nav a { display: flex; align-items: center; padding: 0 1rem; border-bottom: 3px solid transparent; color: #ccdae4; font-size: .9rem; font-weight: 600; }
.main-nav a:hover, .main-nav a.active { color: #fff; border-bottom-color: #78c8bc; }
.header-context { margin-left: auto; color: #b8ccd9; font-size: .78rem; }
.header-account { display: flex; align-items: center; gap: .9rem; margin-left: auto; }
.header-account .header-context { margin-left: 0; }
.logout-button { padding: .35rem .65rem; border: 1px solid rgb(255 255 255 / 35%); border-radius: 5px; color: #fff; background: transparent; font: inherit; font-size: .78rem; cursor: pointer; }
.logout-button:hover { background: rgb(255 255 255 / 10%); }
.content-container { width: min(1200px, calc(100% - 3rem)); min-height: calc(100vh - 142px); margin: 0 auto; padding: 2rem 0 3rem; }
.app-footer { display: flex; justify-content: space-between; padding: 1.2rem max(1.5rem, calc((100% - 1240px) / 2)); border-top: 1px solid var(--line); color: var(--muted); background: #fff; font-size: .78rem; }
.welcome-panel, .page-heading { display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; margin-bottom: 2rem; padding: 1.5rem 1.75rem; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: var(--shadow); }
.welcome-panel h1, .page-heading h1 { color: var(--navy); }
.welcome-panel p:last-child { margin-bottom: 0; }
.button { min-height: 40px; display: inline-flex; justify-content: center; align-items: center; gap: .5rem; padding: .5rem 1.15rem; border: 1px solid transparent; border-radius: 5px; font: inherit; font-weight: 650; cursor: pointer; transition: background .15s, border-color .15s; }
.button-primary { color: #fff; background: var(--blue); }
.button-primary:hover { background: #1d638f; }
.button-secondary { border-color: #cbd2d8; color: #354958; background: #fff; }
.button-secondary:hover { border-color: var(--blue); color: var(--blue); background: #f8fbfd; }
.button-wide { width: 100%; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.stat-card, .panel { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); }
.stat-card { min-height: 150px; padding: 1rem 1.15rem; border-top: 3px solid var(--blue); }
.stat-card-link { display: block; color: inherit; cursor: pointer; transition: border-color .15s, box-shadow .15s, background .15s; }
.stat-card-link:hover, .stat-card-link:focus-visible { border-color: #8dbbd2; border-top-color: var(--blue); outline: none; background: #fbfdfe; box-shadow: 0 3px 10px rgb(25 50 71 / 12%); }
.stat-card-link:focus-visible { outline: 3px solid rgb(38 116 166 / 40%); outline-offset: 2px; }
.stat-card-top { display: flex; justify-content: space-between; align-items: center; }
.stat-icon, .action-icon { display: grid; place-items: center; color: var(--blue); background: var(--blue-soft); }
.stat-icon { width: 36px; height: 36px; border-radius: 10px; font-size: 1.2rem; font-weight: 700; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: .25rem .55rem; font-size: .7rem; font-weight: 700; }
.badge-muted { color: #667985; background: #eef2f4; }
.stat-label { margin: .65rem 0 .05rem; color: var(--muted); font-size: .85rem; font-weight: 600; }
.stat-value { margin: 0; color: var(--navy); font-size: 1.8rem; font-weight: 700; letter-spacing: -.035em; }
.stat-note { margin: .1rem 0 0; font-size: .73rem; }
.dashboard-lower { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; margin-top: 2rem; }
.panel { padding: 1.35rem; }
.panel > .section-heading { margin: -1.35rem -1.35rem 1rem; padding: 1rem 1.35rem; border-bottom: 1px solid var(--line); }
.panel > .section-heading h2 { color: var(--navy); font-size: 1.12rem; }
.dashboard-appointment-panel { padding: 0; overflow: hidden; }
.dashboard-card-header { min-height: 78px; display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: 1rem 1.2rem; border-bottom: 1px solid var(--line); background: #fff; }
.dashboard-card-header h2 { color: var(--navy); font-size: 1.12rem; }
.dashboard-card-header .eyebrow { margin-bottom: .15rem; }
.dashboard-header-actions { display: flex; align-items: center; gap: .5rem; }
.dashboard-header-actions .button { min-height: 36px; padding: .4rem .8rem; font-size: .8rem; white-space: nowrap; }
.dashboard-appointment-list { display: grid; padding: .55rem .85rem .85rem; }
.dashboard-appointment-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: .35rem; min-width: 0; min-height: 67px; padding: .65rem .4rem; border-bottom: 1px solid #e7eaed; color: var(--ink); }
.dashboard-appointment-row:last-child { border-bottom: 0; }
.dashboard-appointment-row:hover, .dashboard-appointment-row:focus-visible { outline: none; background: #f3f8fb; }
.dashboard-appointment-primary, .dashboard-appointment-secondary { display: flex; align-items: center; justify-content: space-between; gap: .65rem; min-width: 0; }
.dashboard-appointment-primary { flex-wrap: wrap; }
.dashboard-appointment-person { flex: 1 1 12rem; min-width: 0; }
.dashboard-appointment-person strong { display: block; overflow-wrap: break-word; word-break: normal; font-size: .83rem; }
.dashboard-appointment-examination { display: inline-flex; flex: 0 1 auto; align-items: center; flex-wrap: wrap; gap: .35rem; min-width: 0; font-size: .75rem; }
.dashboard-appointment-time { flex: 0 0 auto; min-width: 0; font-size: .78rem; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.dashboard-appointment-row .communication-indicators { flex: 0 0 auto; justify-content: flex-end; }
.dashboard-appointment-row .status-dot { width: 22px; height: 22px; flex-basis: 22px; font-size: .55rem; }
.dashboard-state { padding: .1rem .35rem; font-size: .64rem; }
.dashboard-list-empty { min-height: 170px; }
.action-row { display: flex; align-items: center; gap: .85rem; padding: 1rem 0; border-top: 1px solid #edf1f3; }
.action-row:first-of-type { border-top: 0; }
.action-row:hover strong { color: var(--blue); }
.action-row span:nth-child(2) { display: grid; gap: .12rem; }
.action-row strong { font-size: .9rem; }
.action-row small { font-size: .77rem; }
.action-icon { width: 38px; height: 38px; flex: 0 0 auto; border-radius: 10px; font-size: 1.15rem; }
.row-arrow { margin-left: auto; color: #8296a3; font-size: 1.1rem; }
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 160px; padding: 1.2rem; color: var(--muted); text-align: center; }
.empty-state p { max-width: 34rem; margin-bottom: 0; }
.empty-icon { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: .7rem; border-radius: 50%; color: var(--blue); background: var(--blue-soft); font-size: 1.4rem; }
.page-heading { display: block; margin-bottom: 1.5rem; }
.overview-heading { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.page-heading .eyebrow { margin-bottom: .3rem; }
.page-heading p:last-child { margin-bottom: 0; }
.large-empty { min-height: 300px; }
.large-empty h2 { margin-bottom: .3rem; color: var(--ink); }
.large-empty .button { margin-top: 1.25rem; }
.alert { margin-bottom: 1.25rem; padding: .85rem 1rem; border: 1px solid; border-radius: 8px; }
.alert-info { border-color: #bad9e8; color: #245777; background: #eef8fc; }
.alert-error { border-color: #f1c6bf; color: #8c3327; background: #fff3f0; }
.form-panel { max-width: 760px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-field { display: grid; gap: .4rem; }
.form-field.full { grid-column: 1 / -1; }
.form-field label { color: #294459; font-size: .85rem; font-weight: 700; }
.form-control { width: 100%; min-height: 45px; padding: .65rem .75rem; border: 1px solid #cbd7df; border-radius: 7px; outline: none; color: var(--ink); background: #fff; font: inherit; }
.readonly-value { display: flex; align-items: center; }
.form-control:focus { border-color: #428db6; box-shadow: 0 0 0 3px rgb(38 116 166 / 13%); }
.form-help { color: var(--muted); font-size: .76rem; }
.form-actions { display: flex; justify-content: flex-end; gap: .7rem; margin-top: 1.4rem; padding-top: 1.1rem; border-top: 1px solid #edf1f3; }
.success-mark { display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 1rem; border-radius: 50%; color: #1b735d; background: #e7f5ef; font-size: 1.6rem; }
.details-grid { display: grid; grid-template-columns: minmax(150px, .6fr) 1.4fr; gap: .65rem 1.2rem; margin: 1.5rem 0; }
.details-grid dt { color: var(--muted); font-size: .85rem; }
.details-grid dd { margin: 0; font-weight: 650; overflow-wrap: anywhere; }
.entry-page { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; background: radial-gradient(ellipse at 50% 15%, #e5f3f3, transparent 55%), var(--canvas); }
.entry-card { width: min(100%, 430px); padding: 2.5rem; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: 0 20px 60px rgb(24 59 86 / 11%); text-align: center; }
.entry-card .brand-mark { margin: 0 auto 1.2rem; }
.entry-card h1 { margin-bottom: .5rem; }
.entry-card .muted { margin-bottom: 1.8rem; }
.login-form { display: grid; gap: 1rem; text-align: left; }
.login-form .button { margin-top: .35rem; }
.entry-note { margin: 1.4rem 0 0; color: #80909b; font-size: .72rem; }
.appointment-table-wrap, .communication-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); }
.appointment-table, .communication-table { width: 100%; border-collapse: separate; border-spacing: 0; text-align: left; }
.appointment-table { min-width: 980px; }
.appointment-table th, .communication-table th { padding: .95rem .72rem; border-bottom: 1px solid #d8dee3; color: #314d61; background: #f1f3f5; font-size: .76rem; font-weight: 700; white-space: nowrap; }
.appointment-table th:first-child { padding-left: 1.1rem; }
.appointment-table th:nth-child(3) { min-width: 180px; }
.appointment-table th:nth-child(4) { min-width: 125px; }
.appointment-table th:nth-child(5) { min-width: 125px; }
.appointment-table th:nth-child(n+6) { width: 52px; text-align: center; }
.appointment-table td { height: 68px; padding: .8rem .72rem; border-bottom: 1px solid #e5e8eb; color: #294459; font-size: .85rem; vertical-align: middle; }
.appointment-table td:first-child { padding-left: 1.1rem; }
.appointment-table tbody tr:nth-child(even) { background: #fafbfc; }
.appointment-table tbody tr:hover, .appointment-table tbody tr:focus { outline: none; background: #edf5f9; cursor: pointer; }
.appointment-table tbody tr:focus-visible { box-shadow: inset 0 0 0 2px #2674a6; }
.appointment-table tbody tr:last-child td { border-bottom: 0; }
.appointment-date-link { color: var(--blue); font-weight: 700; white-space: nowrap; }
.appointment-date-link:hover { text-decoration: underline; }
.appointment-time { white-space: nowrap; font-variant-numeric: tabular-nums; }
.patient-name { color: #193247; font-size: .9rem; font-weight: 750; }
.appointment-state { display: inline-block; padding: .18rem .48rem; border-radius: 5px; color: #405c70; background: #edf2f5; font-size: .75rem; font-weight: 700; white-space: nowrap; }
.indicator-cell { text-align: center; }
.communication-indicators { display: inline-flex; align-items: center; justify-content: center; gap: 0; }
.communication-indicator-missing { display: inline-block; min-width: 24px; color: #647581; font-size: .95rem; font-weight: 600; line-height: 1.5; text-align: center; }
.confirmation-dialog { width: min(32rem, calc(100vw - 2rem)); padding: 1.4rem; border: 1px solid #cbd2d8; border-radius: 8px; color: var(--ink); background: var(--canvas); box-shadow: 0 18px 55px rgb(15 36 51 / 24%); }
.confirmation-dialog::backdrop { background: rgb(13 31 44 / 64%); }
.confirmation-dialog h2 { margin: 0 0 .8rem; }
.confirmation-dialog p { line-height: 1.55; }
.confirmation-dialog .form-actions { justify-content: flex-end; margin-top: 1.2rem; }
.no-script-confirmation { display: block; margin: 1rem 0; }
.contact-validation-error { margin: 0; color: #923d32; font-size: .88rem; font-weight: 700; }
.status-dot { width: 24px; height: 24px; display: inline-grid; flex: 0 0 24px; place-items: center; border: 1px solid currentColor; border-radius: 50%; font-size: .59rem; font-weight: 800; line-height: 1; }
.appointment-table .status-dot { margin: auto; }
.upcoming-row .status-dot { width: 25px; height: 25px; flex-basis: 25px; font-size: .61rem; }
.status-dot[title] { cursor: help; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); }
.status-tag { display: inline-flex; align-items: center; padding: .18rem .55rem; border-radius: 999px; font-size: .76rem; font-weight: 700; }
.status-green { color: #176346; background: #e4f3eb; }
.status-yellow { color: #805a08; background: #fff3cf; }
.status-red { color: #923d32; background: #fde9e6; }
.status-gray { color: #647581; background: #edf1f3; }
.back-link { margin-bottom: 1.1rem; color: var(--blue); font-size: .88rem; font-weight: 650; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.detail-heading { margin: 0 0 1rem; }
.appointment-detail-content .communication-panel { margin-top: 1rem; }
.appointment-detail-content .detail-panel { box-shadow: none; }
.public-id-label, .public-id-value { margin-top: .5rem; color: #8394a0 !important; font-size: .74rem !important; font-weight: 500 !important; }
.communication-table-wrap { margin-top: .4rem; box-shadow: none; }
.communication-table { min-width: 750px; }
.communication-table th, .communication-table td { padding: .65rem .7rem; border-bottom: 1px solid #e8eef1; font-size: .78rem; vertical-align: middle; }
.communication-table thead th { position: sticky; top: 0; z-index: 1; }
.communication-table tbody tr:last-child th, .communication-table tbody tr:last-child td { border-bottom: 0; }
.communication-table tbody th { color: var(--ink); background: #fff; text-align: left; }
.technical-details { margin-top: .9rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .78rem; }
.technical-details summary { width: fit-content; padding: .7rem 0; color: var(--blue); cursor: pointer; font-weight: 700; }
.technical-list { padding-bottom: .6rem; }
.appointment-dialog { width: min(960px, calc(100vw - 2rem)); max-width: 960px; max-height: min(90vh, 900px); padding: 0; overflow: hidden; border: 1px solid #cbd2d8; border-radius: 8px; color: var(--ink); background: var(--canvas); box-shadow: 0 18px 55px rgb(15 36 51 / 24%); }
.appointment-dialog::backdrop { background: rgb(13 31 44 / 64%); backdrop-filter: blur(2px); }
.appointment-dialog-header { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem 1.4rem; border-bottom: 1px solid var(--line); background: #fff; }
.appointment-dialog-header h2 { margin: 0; }
.dialog-close { min-height: 40px; padding: .45rem .8rem; border: 1px solid #cbd7df; border-radius: 7px; color: var(--ink); background: #fff; font: inherit; font-size: .83rem; font-weight: 700; cursor: pointer; }
.dialog-close:hover, .dialog-close:focus-visible { border-color: var(--blue); color: var(--blue); }
.appointment-dialog-body { max-height: calc(90vh - 68px); padding: 1.4rem; overflow: auto; }
.appointment-dialog-body .appointment-detail-content { display: block; }
.appointment-dialog-body .detail-heading { margin-bottom: 1rem; }
.appointment-dialog-body .page-heading { margin-bottom: 1rem; }
.appointment-dialog-body .detail-grid { gap: .8rem; }
.detail-panel h2, .communication-panel > h2 { margin-bottom: 1rem; }
.detail-list { display: grid; grid-template-columns: minmax(145px, .8fr) 1.2fr; gap: .55rem 1rem; margin: 0; }
.detail-list dt { color: var(--muted); font-size: .83rem; }
.detail-list dd { margin: 0; overflow-wrap: anywhere; font-size: .88rem; font-weight: 600; }
.communication-panel { margin-top: 1rem; }
.communication-item { padding: 1rem 0; border-top: 1px solid var(--line); }
.communication-title { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: .8rem; }
.communication-title h3 { margin: 0; font-size: .98rem; }
.communication-details { grid-template-columns: minmax(190px, .65fr) 1.35fr; }
.text-link { color: var(--blue); font-size: .82rem; font-weight: 700; }
.upcoming-list { display: grid; gap: .55rem; }
.upcoming-row { display: grid; grid-template-columns: 112px minmax(120px, 1fr) 150px; align-items: center; gap: .75rem; min-height: 68px; padding: .65rem .75rem; border: 1px solid #e5e8eb; border-radius: 6px; background: #fff; }
.upcoming-row:hover, .upcoming-row:focus-visible { outline: 2px solid #8dbbd2; outline-offset: -2px; background: #f5fafc; }
.upcoming-when, .upcoming-patient { display: grid; gap: .05rem; }
.upcoming-when strong, .upcoming-patient strong { font-size: .79rem; }
.upcoming-when small, .upcoming-patient small { font-size: .71rem; }
.dashboard-appointment-time { display: block; }
.upcoming-empty { min-height: 130px; gap: .5rem; }
.upcoming-empty .button { min-height: 38px; margin-top: .2rem; font-size: .8rem; }
@media (max-width: 760px) {
  .dashboard-lower { grid-template-columns: 1fr; }
  .dashboard-appointment-row .communication-indicators { justify-content: flex-end; }
}
@media (max-width: 900px) { .app-header { gap: 1rem; flex-wrap: wrap; padding: .65rem 1.25rem 0; } .header-brand { min-width: auto; margin-right: auto; } .header-context { display: none; } .main-nav { width: 100%; min-height: 44px; order: 2; } .main-nav a { padding: 0 .75rem; font-size: .83rem; } .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .content-container { width: min(100% - 2rem, 1200px); padding-top: 1.25rem; } .welcome-panel { align-items: flex-start; flex-direction: column; padding: 1.25rem; margin-bottom: 1.5rem; } .page-heading { padding: 1.2rem 1.25rem; margin-bottom: 1.25rem; } .dashboard-lower { grid-template-columns: 1fr; gap: 1rem; margin-top: 1.4rem; } .dashboard-card-header { align-items: flex-start; flex-direction: column; } .dashboard-header-actions { width: 100%; } .dashboard-header-actions .button { flex: 1; } .dashboard-appointment-row { padding: .7rem .25rem; } .stat-card { min-height: 140px; padding: .85rem; } .stat-note { font-size: .68rem; } .app-footer { gap: .5rem; padding: 1rem; font-size: .7rem; } .panel { padding: 1.1rem; } .panel > .section-heading { margin: -1.1rem -1.1rem 1rem; padding: .9rem 1.1rem; } .detail-grid { grid-template-columns: 1fr; } .detail-list { grid-template-columns: minmax(120px, .7fr) 1.3fr; } .appointment-dialog-body { padding: 1rem; } }
@media (max-width: 460px) { .dashboard-appointment-secondary { align-items: flex-start; flex-wrap: wrap; } .dashboard-appointment-time { margin-left: auto; } }
@media (max-width: 460px) { .stats-grid { grid-template-columns: 1fr 1fr; gap: .65rem; } .stat-card { min-height: 150px; } .form-grid { grid-template-columns: 1fr; } .form-field.full { grid-column: auto; } .form-actions { flex-direction: column-reverse; } .form-actions .button { width: 100%; } .entry-card { padding: 2rem 1.4rem; } .details-grid { grid-template-columns: 1fr; gap: .2rem; } .details-grid dd { margin-bottom: .7rem; } }

/* Hide confirmation actions disabled by JavaScript. */
.button[hidden] {
    display: none;
}
