/* Shared controls */
body {
    font-size: .9375rem;
    line-height: 1.55;
}

a {
    color: var(--primary);
    text-decoration: none;
}

.ui-icon {
    width: 20px;
    height: 20px;
    flex: none;
    vertical-align: middle;
}

.visually-hidden,
.skip-link:not(:focus) {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link:focus {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 200;
    padding: 10px 16px;
    background: var(--surface);
    color: var(--primary);
    border-radius: 8px;
}

.btn,
.ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    max-width: 100%;
    padding: 9px 16px;
    border: 1px solid transparent;
    border-radius: 10px;
    color: #fff;
    background: var(--primary);
    font-size: .875rem;
    line-height: 1.4;
    font-weight: 750;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}

.btn .ui-icon,
.ghost .ui-icon {
    width: 17px;
    height: 17px;
}

.btn:hover {
    color: #fff;
    background: var(--primary-hover);
}

.ghost {
    color: var(--ink);
    background: var(--surface);
    border-color: var(--line);
}

.ghost:hover {
    color: var(--primary);
    background: var(--primary-soft);
    border-color: #dae3ea;
}

.large {
    min-height: 50px;
    padding-inline: 20px;
}

button:disabled {
    cursor: not-allowed;
    opacity: .56;
}

label {
    display: block;
    margin: 16px 0 0;
    color: var(--ink);
    font-size: .875rem;
    font-weight: 700;
}

input:not([type="hidden"], [type="checkbox"], [type="radio"]),
textarea,
select {
    display: block;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid #c8ced3;
    border-radius: 9px;
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    line-height: 1.4;
    font-weight: 550;
    transition: border-color .18s ease, box-shadow .18s ease;
}

label > :is(input:not([type="checkbox"], [type="radio"]), select, textarea) {
    margin-top: 7px;
}

input::placeholder,
textarea::placeholder {
    color: var(--muted);
    opacity: 1;
}

:is(input:not([type="checkbox"], [type="radio"]), textarea, select):focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

input[type="checkbox"],
input[type="radio"] {
    accent-color: var(--primary);
}

textarea {
    resize: vertical;
}

.tablewrap {
    max-width: 100%;
    overflow: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th,
td {
    padding: 13px 16px;
    text-align: start;
    vertical-align: middle;
    border-bottom: 1px solid var(--line);
}

th {
    font-size: .75rem;
    color: var(--muted);
}

td {
    font-size: .875rem;
}

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

.section {
    width: min(100%, 1280px);
    margin-inline: auto;
    padding: clamp(24px, 5vw, 68px) clamp(16px, 4vw, 48px);
}

.panel {
    min-width: 0;
    margin-block: 0 22px;
    padding: clamp(18px, 2.5vw, 28px);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: 0 2px 9px rgb(23 43 77 / .035);
}

.narrow {
    width: min(100%, 660px);
}

.eyebrow {
    display: inline-block;
    color: var(--primary);
    font-size: .7rem;
    line-height: 1.4;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.notice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 14px auto 0;
    padding: 13px 16px;
    width: min(calc(100% - 32px), 1160px);
    background: var(--primary-soft);
    color: #405768;
    border: 1px solid #dce4ea;
    border-radius: 11px;
    font-size: .875rem;
    font-weight: 650;
    overflow-wrap: anywhere;
}

.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.site-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    width: min(100%, 1320px);
    min-height: 75px;
    margin-inline: auto;
    padding: 12px clamp(16px, 5vw, 56px);
}

.brand {
    display: inline-flex;
    align-items: center;
    flex: none;
}

.brand img {
    display: block;
    width: 154px;
    height: auto;
}

.site-navigation {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px clamp(15px, 2.5vw, 34px);
    font-size: .875rem;
    font-weight: 750;
}

.site-navigation > a:not(.btn) {
    color: var(--ink);
}

.site-navigation > a:not(.btn):hover,
.site-navigation > a[aria-current="page"]:not(.btn) {
    color: var(--primary);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    color: var(--muted);
    font-size: .84rem;
    font-weight: 750;
}

.back-link:hover {
    color: var(--primary);
}

.back-link .ui-icon {
    width: 17px;
    height: 17px;
}

.form-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 16px;
}

.form-footer {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.field-hint {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: .8rem;
}

/* Sign-in and registration */
.auth-body,
.portal-body {
    background: var(--bg);
}

.auth-body .auth {
    display: grid;
    min-height: calc(100svh - 76px);
    padding: clamp(24px, 5vw, 74px) 16px;
    align-items: center;
}

.auth-layout {
    display: grid;
    grid-template-columns: minmax(0, .86fr) minmax(0, 1.14fr);
    width: min(100%, 1060px);
    min-height: 590px;
    margin-inline: auto;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: var(--surface);
    box-shadow: 0 13px 50px rgb(22 38 80 / .075);
}

.auth-aside {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 26px;
    min-width: 0;
    overflow: hidden;
    padding: clamp(24px, 4vw, 46px);
    background: radial-gradient(circle at 55% 46%, #546f83 0, #364a59 42%, #25323b 81%);
    color: #fff;
}

.auth-aside::before,
.auth-aside::after {
    position: absolute;
    z-index: -1;
    top: 45%;
    left: 50%;
    width: min(95%, 420px);
    aspect-ratio: 1;
    border: 1px solid rgb(186 213 255 / .17);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    content: "";
}

.auth-aside::after {
    width: min(125%, 530px);
    border-color: rgb(186 213 255 / .095);
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-weight: 850;
    font-size: 1.25rem;
    letter-spacing: -.04em;
}

.auth-brand img,
.workspace-brand img,
.workspace-mobile-brand img {
    flex: none;
    display: block;
}

.auth-emblem {
    position: relative;
    display: grid;
    align-self: center;
    place-items: center;
    width: min(100%, 230px);
    aspect-ratio: 1;
    border: 1px solid rgb(186 213 255 / .24);
    border-radius: 50%;
    perspective: 520px;
    transform-style: preserve-3d;
}

.auth-emblem-core {
    display: grid;
    width: 52%;
    aspect-ratio: 1;
    align-items: center;
    justify-items: center;
    border: 1px solid rgb(216 255 249 / .55);
    border-radius: 28%;
    background: linear-gradient(145deg, rgb(182 247 235 / .34), rgb(134 171 255 / .15));
    box-shadow: 0 16px 44px rgb(7 21 64 / .4);
    color: #d2fff0;
    transform: translateZ(30px) rotateX(13deg) rotateY(-22deg) rotateZ(-8deg);
    transform-style: preserve-3d;
}

.auth-emblem-core::before {
    position: absolute;
    inset: 0;
    border: 1px solid rgb(193 230 255 / .4);
    border-radius: inherit;
    background: #425562;
    transform: translateZ(-11px);
    content: "";
}

.auth-emblem-core .ui-icon {
    width: 66%;
    height: 66%;
    transform: translateZ(8px);
}

.auth-emblem-tag {
    position: absolute;
    display: grid;
    place-items: center;
    width: 45px;
    aspect-ratio: 1;
    border: 1px solid rgb(195 225 255 / .4);
    border-radius: 12px;
    background: #516676;
    color: #ebf0f4;
}

.auth-emblem-tag-file {
    top: 9%;
    left: 4%;
    transform: rotate(-10deg);
}

.auth-emblem-tag-check {
    right: 3%;
    bottom: 10%;
    transform: rotate(13deg);
    color: #c6fff3;
}

.auth-aside-copy p {
    margin: 0;
    color: #e5ebef;
    font-size: .95rem;
    line-height: 1.6;
}

.auth-aside-copy .auth-aside-title {
    margin-bottom: 12px;
    color: #fff;
    font-size: clamp(1.65rem, 3vw, 2.45rem);
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: -.045em;
    text-wrap: balance;
}

.auth-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    padding: clamp(26px, 5vw, 65px);
}

.auth-card-heading {
    margin: 22px 0 6px;
}

.auth-card h1 {
    margin: 0;
    font-size: clamp(1.8rem, 3.8vw, 2.6rem);
    line-height: 1.12;
    letter-spacing: -.048em;
    text-wrap: balance;
}

.auth-card p {
    margin: 9px 0 0;
    color: var(--muted);
    font-size: .9rem;
}

.auth-card form > .btn {
    width: 100%;
    margin-top: 24px;
}

.auth-card > .btn {
    align-self: flex-start;
    margin-top: 20px;
}

.auth-card .auth-switch {
    margin-top: 22px;
}

.auth-switch a {
    color: var(--primary);
    font-weight: 750;
}

.auth-unavailable {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 14px;
    padding: 14px;
    border: 1px solid #f2d6ae;
    border-radius: 10px;
    background: #fff5e6;
    color: #814212;
}

.auth-unavailable p {
    margin: 0;
    color: inherit;
}

/* Workspace layout */
.workspace-body {
    --sidebar-width: 228px;
    --topbar-height: 70px;
    background: var(--bg);
}

.shell {
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    grid-template-rows: min-content 1fr;
    grid-template-areas: "sidebar topbar" "sidebar content";
    min-height: 100vh;
}

.workspace-sidebar {
    position: sticky;
    top: 0;
    grid-area: sidebar;
    display: flex;
    flex-direction: column;
    gap: 32px;
    height: 100dvh;
    min-height: 0;
    overflow: auto;
    padding: 22px 16px 18px;
    background: linear-gradient(162deg, #1c242a 44%, #29353e);
    color: #fff;
}

.workspace-brand,
.workspace-mobile-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: fit-content;
    color: #fff;
    font-size: 1.27rem;
    font-weight: 850;
    line-height: 1;
    letter-spacing: -.04em;
    text-decoration: none;
}

.workspace-brand {
    margin: 0 10px;
}

.workspace-nav {
    display: grid;
    align-content: start;
    gap: 5px;
}

.workspace-link {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    align-items: center;
    gap: 11px;
    min-height: 46px;
    padding: 9px 12px;
    border: 1px solid transparent;
    border-radius: 9px;
    color: #d5dde2;
    font-size: .875rem;
    font-weight: 700;
    line-height: 1.3;
    text-decoration: none;
    transition: color .18s ease, background-color .18s ease;
}

.workspace-link .ui-icon {
    color: #bcc5cc;
}

.workspace-link:hover {
    color: #fff;
    background: rgb(169 201 255 / .11);
}

.workspace-link[aria-current] {
    border-color: rgb(177 206 255 / .21);
    background: #3d4e5a;
    color: #fff;
    box-shadow: inset 3px 0 #b7c8d4;
}

.workspace-link[aria-current] .ui-icon {
    color: #d8e1e8;
}

.workspace-sidebar :focus-visible {
    outline-color: #c0cfda;
}

.workspace-sidebar-end {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: auto;
    padding: 15px 9px 0;
    border-top: 1px solid rgb(204 222 255 / .18);
    color: #d0d9df;
    font-size: .81rem;
    font-weight: 650;
}

.workspace-sidebar-end .ui-icon {
    color: #9de3d3;
}

.workspace-topbar {
    position: sticky;
    top: 0;
    z-index: 12;
    grid-area: topbar;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    min-width: 0;
    min-height: var(--topbar-height);
    padding: 10px clamp(18px, 3vw, 43px);
    border-bottom: 1px solid var(--line);
    background: var(--surface);
}

.workspace-mobile-brand {
    display: none;
    color: var(--ink);
}

.workspace-crumb {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: .875rem;
}

.workspace-crumb strong {
    color: var(--ink);
}

.workspace-crumb .ui-icon {
    width: 14px;
    height: 14px;
}

.workspace-account {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.person-avatar {
    display: grid;
    flex: none;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: 11px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: .8rem;
    font-weight: 850;
    line-height: 1;
    text-transform: uppercase;
}

.workspace-account-name {
    display: grid;
    max-width: min(24vw, 230px);
    color: var(--ink);
    font-size: .83rem;
    line-height: 1.3;
}

.workspace-account-name strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.workspace-account-name small {
    margin-top: 2px;
    color: var(--muted);
    font-size: .73rem;
}

.workspace-logout {
    margin-left: 5px;
    min-height: 39px;
    padding: 7px 12px;
}

.workspace-main {
    grid-area: content;
    width: min(100%, 1520px);
    min-width: 0;
    margin-inline: auto;
    padding: clamp(22px, 3.2vw, 45px) clamp(18px, 3vw, 43px) 56px;
    scroll-margin-top: calc(var(--topbar-height) + 12px);
}

.workspace-main .notice {
    width: 100%;
    margin: 0 0 20px;
}

.workspace-main h1 {
    margin: 0;
    font-size: clamp(1.95rem, 3.2vw, 2.78rem);
    font-weight: 820;
    line-height: 1.1;
    letter-spacing: -.05em;
    overflow-wrap: anywhere;
}

.workspace-main h2 {
    margin: 0;
    font-size: clamp(1.1rem, 1.6vw, 1.3rem);
    line-height: 1.25;
    font-weight: 800;
    letter-spacing: -.026em;
}

.page-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 23px;
}

.page-heading p {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: .94rem;
}

.page-back {
    margin-bottom: 17px;
}

.card-icon {
    display: grid;
    flex: none;
    width: 43px;
    height: 43px;
    place-items: center;
    border-radius: 12px;
    background: var(--primary-soft);
    color: var(--primary);
}

.card-icon-mint {
    background: var(--mint);
    color: var(--teal);
}

.card-icon-violet {
    background: #f1f4f7;
    color: #667c8b;
}

.card-icon-amber {
    background: #fff0da;
    color: #88461c;
}

.workspace-chip {
    display: inline-block;
    flex: none;
    padding: 4px 10px;
    border-radius: 99px;
    background: var(--primary-soft);
    color: #465e70;
    font-size: .72rem;
    font-weight: 760;
    line-height: 1.4;
}

.workspace-chip-pending {
    background: #fff0da;
    color: #88461c;
}

.workspace-chip-active {
    background: var(--mint);
    color: var(--teal);
}

.workspace-chip-blocked {
    background: #fbecee;
    color: #9a2c42;
}

/* Dashboard, patients and administrator lists */
.dashboard-welcome {
    position: relative;
    isolation: isolate;
    display: flex;
    align-items: center;
    min-height: clamp(213px, 20vw, 285px);
    overflow: hidden;
    margin-bottom: 20px;
    padding: clamp(24px, 3.3vw, 48px);
    border-radius: 22px;
    background: radial-gradient(ellipse at 87% 94%, #628197, transparent 60%),
        linear-gradient(109deg, #2a3843 8%, #415665 64%, #536e82);
    color: #fff;
}

.dashboard-welcome-copy {
    position: relative;
    z-index: 1;
    width: min(67%, 730px);
}

.dashboard-welcome h1 {
    font-size: clamp(1.95rem, 3.2vw, 2.9rem);
    text-wrap: balance;
}

.dashboard-welcome p {
    max-width: 500px;
    margin: 10px 0 21px;
    color: #ebf0f3;
    font-size: clamp(.86rem, 1.3vw, 1rem);
}

.dashboard-welcome-button {
    color: #445f73;
    background: #fff;
}

.dashboard-welcome-button:hover {
    color: #334857;
    background: #eff3f5;
}

.dashboard-welcome-button:focus-visible {
    outline-color: #c6d3dd;
}

.dashboard-illustration {
    position: absolute;
    z-index: 0;
    inset: 0 0 0 auto;
    width: min(46%, 500px);
    perspective: 760px;
    perspective-origin: 55% 50%;
    transform-style: preserve-3d;
}

.dashboard-illustration-tilt,
.dashboard-illustration-scene {
    position: absolute;
    inset: 0;
    transform-style: preserve-3d;
}

.dashboard-illustration-scene {
    transform: rotateX(7deg) rotateY(-11deg);
}

.dashboard-illustration-orbit {
    position: absolute;
    top: 48%;
    left: 54%;
    aspect-ratio: 1;
    border: 1px solid rgb(215 239 255 / .21);
    border-radius: 50%;
}

.orbit-outer {
    width: 104%;
    transform: translate3d(-50%, -50%, -90px) rotateX(36deg) rotateY(-8deg);
}

.orbit-middle {
    width: 81%;
    transform: translate3d(-50%, -50%, -52px) rotateX(29deg) rotateY(-6deg);
}

.orbit-inner {
    width: 59%;
    transform: translate3d(-50%, -50%, -22px) rotateX(26deg) rotateY(-6deg);
    border-color: rgb(201 248 255 / .28);
}

.dashboard-illustration-orbit::before,
.dashboard-illustration-orbit::after {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #a4f4ec;
    box-shadow: 0 0 12px #8af4ec;
    content: "";
}

.dashboard-illustration-orbit::before {
    top: 16%;
    right: 12%;
}

.dashboard-illustration-orbit::after {
    bottom: 16%;
    left: 12%;
}

.dashboard-illustration-pulse {
    position: absolute;
    top: 49%;
    left: 53%;
    width: clamp(94px, 11vw, 155px);
    aspect-ratio: 1;
    border-radius: 25%;
    transform: translate3d(-50%, -50%, 58px) rotateX(14deg) rotateY(-21deg) rotateZ(-10deg);
    transform-style: preserve-3d;
}

.dashboard-pulse-layer {
    position: absolute;
    display: grid;
    inset: 0;
    place-items: center;
    border: 1px solid rgb(186 244 255 / .5);
    border-radius: inherit;
}

.layer-back {
    transform: translateZ(-24px);
    background: #465d6d;
    box-shadow: 0 19px 42px rgb(9 27 87 / .43);
}

.layer-middle {
    transform: translateZ(-16px);
    background: #5b7486;
}

.layer-edge {
    transform: translateZ(-8px);
    background: #748a99;
}

.layer-face {
    background:
        radial-gradient(circle at 22% 13%, rgb(229 255 250 / .34), transparent 55%),
        linear-gradient(143deg, #8a9dab, #688193 51%, #5b7384);
    color: #f0fff9;
    border-color: rgb(233 255 253 / .78);
    transform-style: preserve-3d;
}

.layer-face::before {
    position: absolute;
    inset: 8px;
    border: 1px solid rgb(235 255 255 / .18);
    border-radius: 22%;
    content: "";
}

.layer-face .ui-icon {
    width: 68%;
    height: 68%;
    transform: translateZ(7px) rotateZ(7deg);
    stroke-width: 1.23;
    filter: drop-shadow(0 4px 4px rgb(13 65 113 / .35));
}

.dashboard-illustration-plus,
.dashboard-illustration-file {
    position: absolute;
    display: grid;
    width: clamp(39px, 5vw, 68px);
    aspect-ratio: 1;
    place-items: center;
    border: 1px solid rgb(190 244 249 / .52);
    border-radius: 24%;
    background: linear-gradient(145deg, #708492, #576b7a);
    color: #edf1f4;
    box-shadow: 0 13px 24px rgb(13 35 85 / .35);
}

.dashboard-illustration-plus {
    top: 16%;
    right: 15%;
    transform: translateZ(88px) rotateX(13deg) rotateY(15deg) rotateZ(13deg);
    color: #d4fff4;
}

.dashboard-illustration-file {
    bottom: 15%;
    left: 12%;
    transform: translateZ(15px) rotateX(-14deg) rotateY(-20deg) rotateZ(-12deg);
}

@media (prefers-reduced-motion: no-preference) and (min-width: 561px) {
    .dashboard-illustration-scene {
        animation: dashboard-depth 4.6s var(--ease) both;
    }

    .auth-emblem-core {
        animation: auth-emblem-depth 3.5s var(--ease) both;
    }
}

@keyframes dashboard-depth {
    0% {
        transform: rotateX(5deg) rotateY(-25deg) translateY(7px);
    }

    34% {
        transform: rotateX(-6deg) rotateY(11deg) translateY(-11px);
    }

    70% {
        transform: rotateX(11deg) rotateY(-15deg) translateY(-1px);
    }

    100% {
        transform: rotateX(7deg) rotateY(-11deg);
    }
}

@keyframes auth-emblem-depth {
    0% {
        transform: translateZ(18px) rotateX(8deg) rotateY(-29deg) rotateZ(-11deg);
    }

    42% {
        transform: translateZ(34px) rotateX(20deg) rotateY(-10deg) rotateZ(-6deg);
    }

    100% {
        transform: translateZ(30px) rotateX(13deg) rotateY(-22deg) rotateZ(-8deg);
    }
}

.workspace-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.metric-card {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    min-width: 0;
    min-height: 114px;
    padding: clamp(14px, 2vw, 23px);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: 0 2px 8px rgb(23 43 77 / .035);
}

.metric-card dl {
    min-width: 0;
    margin: 0;
}

.metric-card dt {
    color: var(--muted);
    font-size: .82rem;
    font-weight: 700;
}

.metric-card dd {
    margin: 4px 0 0;
    color: var(--ink);
    font-size: clamp(1.35rem, 2.4vw, 2rem);
    font-weight: 820;
    line-height: 1.16;
    letter-spacing: -.035em;
    overflow-wrap: anywhere;
}

.metric-card .metric-plan {
    font-size: clamp(1.1rem, 1.8vw, 1.46rem);
}

.metric-card .metric-date {
    margin-top: 5px;
    color: var(--muted);
    font-size: .73rem;
    letter-spacing: 0;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
}

.dashboard-columns {
    display: grid;
    grid-template-columns: minmax(0, 2.35fr) minmax(260px, 1fr);
    gap: 20px;
    align-items: start;
}

.workspace-list {
    padding: 0;
}

.list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 18px 21px;
}

.workspace-list .search {
    display: flex;
    align-items: stretch;
    gap: 8px;
    padding: 0 21px 17px;
}

.search-input {
    position: relative;
    flex: 1;
    min-width: 0;
    margin: 0;
}

.search-input > .ui-icon {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 18px;
    height: 18px;
    color: var(--muted);
    pointer-events: none;
}

.search-input input[type="search"] {
    margin: 0;
    padding-left: 39px;
}

.workspace-table th {
    background: #f7f9fa;
    font-size: .74rem;
    line-height: 1.3;
    font-weight: 780;
}

.workspace-table td {
    color: var(--muted);
    overflow-wrap: anywhere;
}

.workspace-table th:first-child,
.workspace-table td:first-child {
    padding-inline-start: 21px;
}

.workspace-table th:last-child,
.workspace-table td:last-child {
    padding-inline-end: 21px;
}

.workspace-table td strong {
    color: var(--ink);
    font-weight: 780;
}

.workspace-table td small {
    display: block;
    color: var(--muted);
    font-size: .76rem;
}

.workspace-table td small:empty {
    display: none;
}

.workspace-table .patient-mobile-phone {
    display: none;
}

.patient-table td:nth-child(2),
.patient-table td:nth-child(3) {
    font-variant-numeric: tabular-nums;
}

.patient-cell {
    display: flex;
    align-items: center;
    gap: 9px;
}

.patient-cell .person-avatar {
    width: 33px;
    height: 33px;
    border-radius: 9px;
    font-size: .72rem;
}

.table-link {
    display: flex;
    align-items: center;
    justify-content: end;
    gap: 7px;
    min-height: 35px;
    margin-inline-start: auto;
    color: var(--primary);
    white-space: nowrap;
    font-size: .8rem;
    font-weight: 800;
}

.table-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.table-link .ui-icon {
    width: 16px;
    height: 16px;
}

.plan-prices {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.applications-table {
    min-width: 630px;
}

.table-actions summary {
    list-style: none;
    cursor: pointer;
}

.table-actions summary::-webkit-details-marker {
    display: none;
}

.table-actions[open] summary .ui-icon {
    transform: rotate(90deg);
}

.table-actions form {
    margin-top: 9px;
    min-width: 160px;
}

.table-actions label {
    margin: 9px 0;
    font-size: .8rem;
}

.table-actions button {
    min-height: 38px;
    padding: 8px 11px;
    font-size: .76rem;
}

.button-danger {
    color: #9a2c42;
}

.button-danger:hover {
    color: #861d35;
    background: #fbecee;
    border-color: #edcad2;
}

.dashboard-tools {
    padding: 18px;
}

.dashboard-tools h2 {
    margin: 0 3px 11px;
}

.dashboard-tools > a {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-height: 63px;
    padding: 9px 5px;
    color: var(--ink);
    border-radius: 8px;
}

.dashboard-tools > a + a {
    border-top: 1px solid var(--line);
}

.dashboard-tools > a:hover {
    color: var(--primary);
    background: #fafbfc;
}

.dashboard-tools .card-icon {
    width: 37px;
    height: 37px;
    border-radius: 10px;
}

.dashboard-tools .card-icon .ui-icon {
    width: 17px;
    height: 17px;
}

.dashboard-tools strong,
.dashboard-tools small {
    display: block;
}

.dashboard-tools strong {
    font-size: .85rem;
    font-weight: 780;
}

.dashboard-tools small {
    margin-top: 2px;
    color: var(--muted);
    font-size: .73rem;
    line-height: 1.4;
}

.dashboard-tools > a > .ui-icon {
    width: 15px;
    color: var(--muted);
}

.empty-state {
    display: grid;
    justify-items: center;
    gap: 8px;
    padding: 35px 18px 37px;
    text-align: center;
}

.workspace-list .empty-state {
    border-top: 1px solid var(--line);
}

.empty-state strong {
    color: var(--ink);
}

.empty-state a {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--primary);
    font-size: .85rem;
    font-weight: 750;
}

.empty-state a .ui-icon {
    width: 15px;
    height: 15px;
}

.workspace-meta-divider {
    color: var(--primary);
    margin-inline: 4px;
}

.patient-plan {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    margin: -7px 0 18px;
    color: var(--muted);
    font-size: .84rem;
}

.patient-plan strong {
    color: var(--ink);
}

.patient-plan .ui-icon {
    width: 17px;
    height: 17px;
}

/* Patient record and visit editor */
.form-heading {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-bottom: 1px;
}

.patient-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 20px;
    padding: clamp(16px, 2.8vw, 29px);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.patient-heading-identity {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 14px;
}

.patient-heading .person-avatar {
    width: 55px;
    height: 55px;
    border-radius: 15px;
    font-size: 1rem;
}

.patient-heading h1 {
    font-size: clamp(1.65rem, 3vw, 2.45rem);
}

.patient-heading-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
}

.patient-heading-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 9px;
    border-radius: 7px;
    background: var(--bg);
    color: var(--muted);
    font-size: .78rem;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
}

.patient-heading-meta .ui-icon {
    width: 16px;
    height: 16px;
    color: var(--primary);
}

.voicebar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) minmax(125px, 165px);
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    padding: 13px;
    border: 1px solid #ebf0f3;
    border-radius: 12px;
    background: #f8fafb;
}

.voicebar-copy {
    color: var(--ink);
    font-size: .87rem;
}

.voicebar-copy p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: .8rem;
}

.voicebar label {
    margin: 0;
    font-size: .76rem;
}

.voicebar select {
    min-height: 40px;
    margin-top: 4px;
}

.visit-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 17px;
}

.visit-field :is(textarea, .dictation) {
    min-height: 123px;
}

.dictation {
    position: relative;
    margin-top: 6px;
}

.dictation textarea {
    padding-bottom: 52px;
}

.mic {
    position: absolute;
    right: 8px;
    bottom: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 35px;
    padding: 6px 11px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 750;
    font-size: .76rem;
    cursor: pointer;
}

.mic .ui-icon {
    width: 16px;
    height: 16px;
}

.mic:hover:enabled {
    border-color: #dce4ea;
    background: #eaeff2;
}

.mic.recording,
.mic.recording:hover:enabled {
    border-color: transparent;
    background: #a32d42;
    color: #fff;
}

.visit-form-footer {
    align-items: center;
    justify-content: space-between;
    gap: 13px;
}

.visit-form-footer p {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    max-width: 440px;
    margin: 0;
    color: var(--muted);
    font-size: .78rem;
}

.visit-form-footer p .ui-icon {
    width: 16px;
    height: 16px;
    color: var(--primary);
}

.visit-history .page-heading {
    margin: 27px 0 12px;
}

.visit-history h2 .workspace-chip {
    margin-left: 5px;
    vertical-align: middle;
}

.visit {
    overflow-wrap: anywhere;
}

.visit h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 15px;
    font-size: 1rem;
    font-variant-numeric: tabular-nums;
}

.visit h3 .ui-icon {
    width: 17px;
    height: 17px;
    color: var(--primary);
}

.visit dl {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px 22px;
    margin: 0;
}

.visit dt {
    color: var(--ink);
    font-weight: 750;
    font-size: .84rem;
}

.visit dd {
    margin: 4px 0 0;
    white-space: pre-wrap;
    color: var(--muted);
    font-size: .9rem;
}

.workspace-body .workspace-fallback {
    padding-inline: 0;
}

@media (max-width: 1200px) {
    .dashboard-columns {
        grid-template-columns: minmax(0, 1.9fr) minmax(245px, 1fr);
    }

    .dashboard-columns .patient-table th,
    .dashboard-columns .patient-table td {
        padding-inline: 10px;
    }

    .dashboard-columns .patient-table :is(th, td):first-child {
        padding-inline-start: 17px;
    }

    .dashboard-columns .patient-table :is(th, td):last-child {
        padding-inline-end: 17px;
    }
}

@media (min-width: 961px) and (max-width: 1150px) {
    .dashboard-columns .patient-phone-column {
        display: none;
    }

    .dashboard-columns .patient-mobile-phone {
        display: block;
    }
}

@media (max-width: 960px) {
    .dashboard-columns {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .dashboard-tools {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(143px, 1fr));
        gap: 5px;
    }

    .dashboard-tools h2 {
        grid-column: 1 / -1;
    }

    .dashboard-tools > a + a {
        border-top: 0;
    }

    .workspace-body {
        --sidebar-width: 188px;
    }

    .metric-card {
        gap: 10px;
    }
}

@media (max-width: 760px) {
    .workspace-body {
        --topbar-height: 60px;
    }

    .shell {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: min-content min-content 1fr;
        grid-template-areas: "topbar" "sidebar" "content";
    }

    .workspace-sidebar {
        position: static;
        height: auto;
        padding: 9px clamp(12px, 3vw, 22px);
        overflow: visible;
        background: #222b31;
    }

    .workspace-brand,
    .workspace-sidebar-end,
    .workspace-crumb {
        display: none;
    }

    .workspace-mobile-brand {
        display: inline-flex;
        gap: 7px;
        font-size: 1.15rem;
    }

    .workspace-nav {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 5px 7px;
    }

    .workspace-link {
        min-height: 40px;
        padding: 6px 8px;
        grid-template-columns: 17px minmax(0, 1fr);
        gap: 6px;
        font-size: .77rem;
    }

    .workspace-link .ui-icon {
        width: 17px;
        height: 17px;
    }

    .workspace-main {
        padding-top: 22px;
    }

    .auth-layout {
        min-height: 0;
    }

    .auth-aside {
        display: none;
    }

    .auth-layout {
        grid-template-columns: minmax(0, 1fr);
        width: min(100%, 550px);
    }
}

@media (max-width: 560px) {
    .auth-body .site-header-inner,
    .portal-body .site-header-inner {
        min-height: 66px;
        gap: 8px;
    }

    :is(.auth-body, .portal-body) .site-navigation-anchor {
        display: none;
    }

    :is(.auth-body, .portal-body) .brand img {
        width: 125px;
    }

    :is(.auth-body, .portal-body) .site-navigation {
        gap: 8px;
    }

    :is(.auth-body, .portal-body) .site-navigation .btn {
        padding-inline: 9px;
        gap: 3px;
        font-size: .75rem;
    }

    :is(.auth-body, .portal-body) .site-navigation .ui-icon {
        display: none;
    }

    .workspace-main {
        padding-inline: 14px;
    }

    .workspace-account {
        gap: 6px;
    }

    .workspace-account-name {
        max-width: 105px;
    }

    .workspace-account .person-avatar,
    .workspace-logout {
        width: 35px;
        height: 35px;
        min-height: 35px;
    }

    .workspace-logout {
        padding: 0;
    }

    .workspace-logout span {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
    }

    .workspace-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 9px;
        margin-bottom: 16px;
    }

    .metric-card {
        min-height: 88px;
        gap: 8px;
        padding: 12px;
    }

    .metric-card:last-child {
        grid-column: 1 / -1;
    }

    .metric-card .card-icon {
        width: 33px;
        height: 33px;
        border-radius: 9px;
    }

    .metric-card .card-icon .ui-icon {
        width: 17px;
        height: 17px;
    }

    .dashboard-welcome {
        min-height: 215px;
        margin-bottom: 12px;
        padding: 20px;
    }

    .dashboard-welcome-copy {
        width: min(82%, 335px);
    }

    .dashboard-illustration {
        width: 45%;
        perspective: 520px;
    }

    .dashboard-illustration-scene {
        transform: translate3d(4px, 10px, -41px) rotateX(9deg) rotateY(-18deg);
    }

    .dashboard-illustration-orbit {
        border-color: rgb(215 239 255 / .13);
    }

    .dashboard-illustration-pulse {
        top: 60%;
        left: 71%;
        width: clamp(65px, 17vw, 95px);
    }

    .dashboard-illustration-plus {
        top: 21%;
        right: 13%;
        transform: translateZ(30px) rotateX(13deg) rotateY(15deg) rotateZ(13deg);
    }

    .dashboard-illustration-file {
        display: none;
    }

    .list-header {
        padding: 16px 14px;
    }

    .workspace-list .search {
        padding: 0 14px 14px;
    }

    .search .btn {
        padding-inline: 12px;
    }

    .search-input input[type="search"] {
        font-size: .82rem;
    }

    .workspace-table :is(th, td):first-child,
    .dashboard-columns .patient-table :is(th, td):first-child {
        padding-inline-start: 14px;
    }

    .workspace-table :is(th, td):last-child,
    .dashboard-columns .patient-table :is(th, td):last-child {
        padding-inline-end: 14px;
    }

    .patient-table .patient-phone-column {
        display: none;
    }

    .patient-table .patient-mobile-phone {
        display: block;
    }

    .table-link {
        min-width: 35px;
        justify-content: center;
        background: var(--primary-soft);
        border-radius: 8px;
    }

    .table-link span {
        display: none;
    }

    .patient-cell .person-avatar {
        display: none;
    }

    .plan-prices {
        grid-template-columns: 1fr;
    }

    .visit-fields {
        grid-template-columns: 1fr;
    }

    .voicebar {
        grid-template-columns: auto minmax(0, 1fr);
        gap: 10px;
    }

    .voicebar label {
        grid-column: 1 / -1;
    }

    .visit dl {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 365px) {
    .workspace-topbar {
        padding-inline: 12px;
    }

    .workspace-link {
        font-size: .71rem;
        gap: 4px;
        padding-inline: 6px;
    }

    .workspace-account > .person-avatar {
        display: none;
    }

    .patient-list-layout .page-heading,
    .page-heading:has(> .btn) {
        flex-wrap: wrap;
    }

    .auth-card .form-columns {
        grid-template-columns: 1fr;
    }
}

@media print {
    .workspace-body {
        background: #fff;
    }

    .workspace-body :is(.skip-link, .workspace-topbar, .workspace-sidebar, .page-back, .notice, .print, .visit-editor) {
        display: none !important;
    }

    .shell {
        display: block;
        min-height: 0;
    }

    .workspace-main {
        width: 100%;
        padding: 0;
    }

    .patient-heading,
    .visit {
        break-inside: avoid;
        box-shadow: none;
    }

    .visit-history .page-heading {
        margin-top: 12px;
    }
}
