/* =========================================================
   Vision Therapy Software — Shared UI Design System
   File: /vt/assets/css/vt-ui.css
   Version: 1.0
========================================================= */

:root {
    --vt-bg: #eef4fb;
    --vt-panel: #ffffff;
    --vt-panel-soft: #f8fafc;

    --vt-text: #142033;
    --vt-text-soft: #344054;
    --vt-muted: #667085;
    --vt-muted-light: #98a2b3;

    --vt-line: #dce5ef;
    --vt-line-strong: #ccd8e6;

    --vt-primary: #2d5fd2;
    --vt-primary-dark: #214bac;
    --vt-primary-soft: #edf3ff;

    --vt-teal: #0e8990;
    --vt-teal-dark: #0b7076;
    --vt-teal-soft: #e9f8f7;

    --vt-navy: #142a52;
    --vt-navy-2: #1d3c72;

    --vt-success: #18794e;
    --vt-success-soft: #e9f7ef;

    --vt-warning: #946200;
    --vt-warning-soft: #fff5dc;

    --vt-danger: #a12626;
    --vt-danger-soft: #fff1f1;

    --vt-info: #2d5fd2;
    --vt-info-soft: #edf3ff;

    --vt-radius-xs: 7px;
    --vt-radius-sm: 10px;
    --vt-radius-md: 14px;
    --vt-radius-lg: 18px;
    --vt-radius-xl: 22px;

    --vt-space-1: 4px;
    --vt-space-2: 8px;
    --vt-space-3: 12px;
    --vt-space-4: 16px;
    --vt-space-5: 20px;
    --vt-space-6: 24px;
    --vt-space-7: 32px;
    --vt-space-8: 40px;

    --vt-shadow-sm: 0 5px 18px rgba(24, 40, 72, .035);
    --vt-shadow-md: 0 16px 42px rgba(20, 42, 82, .08);
    --vt-shadow-lg: 0 24px 70px rgba(13, 24, 43, .18);

    --vt-sidebar-width: 236px;

    --vt-font:
        Inter,
        ui-sans-serif,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Arial,
        sans-serif;
}


/* =========================================================
   RESET / GLOBAL
========================================================= */

*,
*::before,
*::after {
    box-sizing: border-box;
}


html {
    min-height: 100%;
    scroll-behavior: smooth;
}


body {
    min-height: 100vh;
    margin: 0;

    color: var(--vt-text);

    background:
        radial-gradient(
            circle at 88% 0%,
            rgba(45, 95, 210, .07),
            transparent 25%
        ),
        var(--vt-bg);

    font-family: var(--vt-font);
    line-height: 1.5;
}


button,
input,
select,
textarea {
    font: inherit;
}


button {
    cursor: pointer;
}


a {
    color: inherit;
}


[hidden] {
    display: none !important;
}


:focus-visible {
    outline: 3px solid rgba(45, 95, 210, .20);
    outline-offset: 2px;
}


/* =========================================================
   APP SHELL
   Canonical classes: vt-*
   Compatibility aliases support V59/V60/V61 pages.
========================================================= */

.vt-app,
.doctor-app,
.patient-app,
.admin-app {
    min-height: 100vh;

    display: grid;
    grid-template-columns:
        var(--vt-sidebar-width)
        minmax(0, 1fr);
}


.vt-main,
.doctor-main,
.patient-main,
.admin-main {
    min-width: 0;

    padding:
        24px
        clamp(20px, 3.2vw, 42px)
        46px;
}


/* =========================================================
   SIDEBAR
========================================================= */

.vt-sidebar,
.doctor-sidebar,
.patient-sidebar,
.admin-sidebar {
    position: sticky;
    top: 0;

    width: var(--vt-sidebar-width);
    height: 100vh;

    padding: 24px 18px;

    display: flex;
    flex-direction: column;

    overflow: hidden;

    color: #fff;

    background:
        linear-gradient(
            180deg,
            #11294f 0%,
            #16366a 62%,
            #17697b 100%
        );
}


.vt-sidebar::before,
.doctor-sidebar::before,
.patient-sidebar::before,
.admin-sidebar::before {
    content: "";

    position: absolute;

    width: 340px;
    height: 340px;

    top: -210px;
    right: -190px;

    border-radius: 50%;

    border: 1px solid rgba(255,255,255,.10);

    box-shadow:
        0 0 0 48px rgba(255,255,255,.022),
        0 0 0 96px rgba(255,255,255,.014);

    pointer-events: none;
}


.vt-sidebar-content,
.sidebar-content {
    position: relative;
    z-index: 1;

    min-height: 100%;

    display: flex;
    flex-direction: column;
}


.vt-brand,
.brand-lockup {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
}


.vt-brand-mark,
.brand-mark {
    width: 42px;
    height: 42px;

    flex: 0 0 42px;

    display: grid;
    place-items: center;

    border: 1px solid rgba(255,255,255,.18);
    border-radius: 13px;

    color: #c2f2ed;
    background: rgba(255,255,255,.09);
}


.vt-brand-mark svg,
.brand-mark svg {
    width: 27px;
    height: 27px;
}


.vt-brand-copy,
.brand-copy {
    min-width: 0;
}


.vt-brand-copy strong,
.brand-copy strong {
    display: block;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    font-size: 13px;
    line-height: 1.2;
}


.vt-brand-copy span,
.brand-copy span {
    display: block;
    margin-top: 3px;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    color: rgba(255,255,255,.56);

    font-size: 9px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}


.vt-sidebar-label,
.sidebar-label {
    margin: 38px 10px 9px;

    color: rgba(255,255,255,.42);

    font-size: 9px;
    font-weight: 800;
    letter-spacing: .11em;
    text-transform: uppercase;
}


.vt-nav,
.sidebar-nav {
    display: grid;
    gap: 5px;
}


.vt-nav-link,
.sidebar-link {
    min-height: 42px;

    display: flex;
    align-items: center;
    gap: 10px;

    padding: 9px 11px;

    border: 1px solid transparent;
    border-radius: 11px;

    color: rgba(255,255,255,.70);
    text-decoration: none;

    font-size: 12px;
    font-weight: 700;

    transition:
        color .15s ease,
        background .15s ease,
        border-color .15s ease,
        transform .15s ease;
}


.vt-nav-link:hover,
.sidebar-link:hover {
    color: #fff;
    background: rgba(255,255,255,.06);
}


.vt-nav-link.active,
.vt-nav-link[aria-current="page"],
.sidebar-link.active,
.sidebar-link[aria-current="page"] {
    color: #fff;

    border-color: rgba(255,255,255,.10);
    background: rgba(255,255,255,.10);
}


.vt-nav-icon,
.sidebar-icon {
    width: 28px;
    height: 28px;

    flex: 0 0 28px;

    display: grid;
    place-items: center;

    border-radius: 8px;

    background: rgba(255,255,255,.07);

    font-size: 12px;
}


.vt-nav-link.active .vt-nav-icon,
.vt-nav-link[aria-current="page"] .vt-nav-icon,
.sidebar-link.active .sidebar-icon,
.sidebar-link[aria-current="page"] .sidebar-icon {
    color: #b8f0ea;
    background: rgba(104,213,206,.12);
}


.vt-sidebar-footer,
.sidebar-footer {
    margin-top: auto;

    padding: 13px;

    border: 1px solid rgba(255,255,255,.10);
    border-radius: 13px;

    background: rgba(255,255,255,.055);
}


.vt-sidebar-footer strong,
.sidebar-footer strong {
    display: block;
    margin-bottom: 4px;
    font-size: 11px;
}


.vt-sidebar-footer span,
.sidebar-footer span {
    display: block;

    color: rgba(255,255,255,.54);

    font-size: 9px;
    line-height: 1.45;
}


.vt-sidebar-toggle {
    display: none;

    width: 38px;
    height: 38px;

    place-items: center;

    padding: 0;

    border: 1px solid rgba(255,255,255,.14);
    border-radius: 10px;

    color: #fff;
    background: rgba(255,255,255,.08);
}


/* =========================================================
   TOPBAR
========================================================= */

.vt-topbar,
.doctor-topbar,
.patient-topbar,
.admin-topbar {
    min-height: 52px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 18px;
}


.vt-eyebrow,
.topbar-eyebrow {
    color: var(--vt-primary);

    font-size: 9px;
    font-weight: 800;
    letter-spacing: .10em;
    text-transform: uppercase;
}


.vt-topbar h1,
.doctor-topbar h1,
.patient-topbar h1,
.admin-topbar h1 {
    margin: 3px 0 2px;

    font-size: 25px;
    line-height: 1.1;
    letter-spacing: -.03em;
}


.vt-topbar-subtitle,
#welcome,
#patientWelcome,
#adminWelcome {
    margin: 0;

    color: var(--vt-muted);

    font-size: 11px;
}


.vt-logout,
.logout-button,
.patient-logout {
    min-height: 39px;

    padding: 8px 13px;

    border: 1px solid var(--vt-line-strong);
    border-radius: 10px;

    color: #344054;
    background: #fff;

    font-size: 11px;
    font-weight: 800;

    transition:
        background .15s ease,
        border-color .15s ease;
}


.vt-logout:hover,
.logout-button:hover,
.patient-logout:hover {
    background: #f8fafc;
}


/* =========================================================
   HERO
========================================================= */

.vt-hero,
.doctor-hero,
.patient-hero,
.admin-hero {
    position: relative;

    min-height: 190px;

    margin-top: 20px;
    padding: 28px 31px;

    display: flex;
    align-items: center;

    overflow: hidden;

    border-radius: var(--vt-radius-xl);

    color: #fff;

    background:
        linear-gradient(
            135deg,
            #173462,
            #2453a4 58%,
            #167d86
        );

    box-shadow: 0 18px 42px rgba(20,42,82,.14);
}


.vt-hero::after,
.doctor-hero::after,
.patient-hero::after,
.admin-hero::after {
    content: "";

    position: absolute;

    width: 330px;
    height: 330px;

    right: -120px;
    top: -165px;

    border-radius: 50%;

    border: 1px solid rgba(255,255,255,.10);

    box-shadow:
        0 0 0 48px rgba(255,255,255,.025),
        0 0 0 96px rgba(255,255,255,.016);

    pointer-events: none;
}


.vt-hero-copy,
.hero-copy {
    position: relative;
    z-index: 2;

    max-width: 660px;
}


.vt-hero-label,
.hero-label {
    display: inline-flex;
    align-items: center;
    gap: 7px;

    color: #a8eee8;

    font-size: 9px;
    font-weight: 800;
    letter-spacing: .10em;
    text-transform: uppercase;
}


.vt-hero-label::before,
.hero-label::before {
    content: "";

    width: 20px;
    height: 2px;

    border-radius: 999px;

    background: #70d9d3;
}


.vt-hero h2,
.doctor-hero h2,
.patient-hero h2,
.admin-hero h2 {
    margin: 10px 0 8px;

    font-size: clamp(27px, 3.5vw, 39px);
    line-height: 1.04;
    letter-spacing: -.035em;
}


.vt-hero p,
.doctor-hero p,
.patient-hero p,
.admin-hero p {
    max-width: 590px;

    margin: 0;

    color: rgba(255,255,255,.69);

    font-size: 12px;
    line-height: 1.65;
}


.vt-hero-chart,
.hero-chart {
    position: absolute;

    right: 36px;
    bottom: 20px;

    width: 200px;

    z-index: 1;

    color: #fff;

    opacity: .07;

    font-weight: 900;
    text-align: center;

    transform: rotate(-3deg);

    pointer-events: none;
}


/* =========================================================
   METRICS
========================================================= */

.vt-metrics,
.metrics-grid,
.patient-overview {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 12px;

    margin-top: 15px;
}


.vt-metric,
.metric-card,
.patient-stat-card {
    padding: 15px 16px;

    border: 1px solid var(--vt-line);
    border-radius: 15px;

    background: #fff;

    box-shadow: var(--vt-shadow-sm);
}


.vt-metric-top,
.metric-top,
.patient-stat-top {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 8px;
}


.vt-metric-label,
.metric-label,
.patient-stat-label {
    color: var(--vt-muted);

    font-size: 10px;
    font-weight: 700;
}


.vt-metric-icon,
.metric-icon,
.patient-stat-icon {
    width: 29px;
    height: 29px;

    display: grid;
    place-items: center;

    border-radius: 9px;

    color: var(--vt-primary);
    background: var(--vt-primary-soft);

    font-size: 11px;
    font-weight: 900;
}


.vt-metric-icon.success,
.metric-icon.success,
.patient-stat-icon.success {
    color: var(--vt-success);
    background: var(--vt-success-soft);
}


.vt-metric-icon.warning,
.metric-icon.warning,
.patient-stat-icon.warning {
    color: var(--vt-warning);
    background: var(--vt-warning-soft);
}


.vt-metric-icon.teal,
.metric-icon.teal,
.patient-stat-icon.teal {
    color: var(--vt-teal);
    background: var(--vt-teal-soft);
}


.vt-metric-icon.danger,
.metric-icon.danger,
.patient-stat-icon.danger {
    color: var(--vt-danger);
    background: var(--vt-danger-soft);
}


.vt-metric-value,
.metric-value,
.patient-stat-value {
    display: block;

    margin-top: 8px;

    font-size: 25px;
    line-height: 1;
    letter-spacing: -.03em;
}


.vt-metric-note,
.metric-note,
.patient-stat-note {
    display: block;

    margin-top: 5px;

    color: var(--vt-muted-light);

    font-size: 9px;
}


/* =========================================================
   WORKSPACE / PANELS / CARDS
========================================================= */

.vt-workspace-grid,
.workspace-grid {
    display: grid;

    grid-template-columns:
        minmax(0, 1.55fr)
        minmax(300px, .72fr);

    gap: 16px;

    margin-top: 17px;

    align-items: start;
}


.vt-panel,
.workspace-card,
.patient-section {
    min-width: 0;

    padding: 20px;

    border: 1px solid var(--vt-line);
    border-radius: var(--vt-radius-lg);

    background: var(--vt-panel);

    box-shadow: var(--vt-shadow-md);
}


.vt-panel-soft {
    border: 1px solid var(--vt-line);
    border-radius: var(--vt-radius-md);

    background: var(--vt-panel-soft);
}


.vt-section-head,
.section-head,
.patient-section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 14px;

    margin-bottom: 16px;
}


.vt-section-eyebrow,
.section-eyebrow,
.patient-section-eyebrow {
    color: var(--vt-primary);

    font-size: 9px;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
}


.vt-section-head h2,
.vt-section-head h3,
.section-head h2,
.section-head h3,
.patient-section-header h2 {
    margin: 4px 0 4px;

    font-size: 19px;
    line-height: 1.15;
    letter-spacing: -.02em;
}


.vt-section-head p,
.section-head p,
.patient-section-header p {
    margin: 0;

    color: var(--vt-muted);

    font-size: 10px;
    line-height: 1.5;
}


.vt-count-badge,
.patient-count-badge,
.doctor-count-badge {
    min-width: 34px;
    height: 28px;

    padding: 0 9px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border-radius: 999px;

    color: var(--vt-primary);
    background: var(--vt-primary-soft);

    font-size: 10px;
    font-weight: 900;
}


/* =========================================================
   FORMS
========================================================= */

.vt-form {
    display: grid;
    gap: 12px;
}


.vt-field,
.form-group {
    display: grid;
    gap: 6px;
}


.vt-field label,
.form-group label {
    color: #344054;

    font-size: 10px;
    font-weight: 800;
}


.vt-input,
.vt-select,
.vt-textarea,
.vt-field input,
.vt-field select,
.vt-field textarea,
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    min-height: 42px;

    margin: 0;
    padding: 9px 11px;

    border: 1px solid #d5dfeb;
    border-radius: 10px;

    outline: none;

    color: var(--vt-text);
    background: #fff;

    font-size: 11px;

    transition:
        border-color .15s ease,
        box-shadow .15s ease,
        background .15s ease;
}


.vt-textarea,
.vt-field textarea,
.form-group textarea {
    min-height: 88px;
    resize: vertical;
}


.vt-input:focus,
.vt-select:focus,
.vt-textarea:focus,
.vt-field input:focus,
.vt-field select:focus,
.vt-field textarea:focus,
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #8eacef;

    box-shadow:
        0 0 0 3px
        rgba(45,95,210,.09);
}


.vt-help {
    color: var(--vt-muted-light);
    font-size: 9px;
    line-height: 1.45;
}


/* =========================================================
   BUTTONS
========================================================= */

.vt-btn {
    min-height: 38px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 7px;

    padding: 8px 12px;

    border: 1px solid transparent;
    border-radius: 9px;

    font-size: 10px;
    font-weight: 900;

    text-decoration: none;

    transition:
        background .15s ease,
        border-color .15s ease,
        color .15s ease,
        transform .15s ease,
        box-shadow .15s ease;
}


.vt-btn:disabled {
    cursor: not-allowed;
    opacity: .55;
}


.vt-btn-primary {
    color: #fff;

    border-color: var(--vt-primary);

    background:
        linear-gradient(
            135deg,
            var(--vt-primary),
            #376edc
        );

    box-shadow:
        0 7px 16px
        rgba(45,95,210,.13);
}


.vt-btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);

    border-color: var(--vt-primary-dark);

    background:
        linear-gradient(
            135deg,
            var(--vt-primary-dark),
            var(--vt-primary)
        );
}


.vt-btn-secondary {
    color: #344054;

    border-color: var(--vt-line-strong);

    background: #fff;
}


.vt-btn-secondary:hover:not(:disabled) {
    background: #f8fafc;
}


.vt-btn-teal {
    color: #fff;

    border-color: var(--vt-teal);

    background: var(--vt-teal);
}


.vt-btn-teal:hover:not(:disabled) {
    background: var(--vt-teal-dark);
}


.vt-btn-danger-soft {
    color: var(--vt-danger);

    border-color: #f0cfd2;

    background: var(--vt-danger-soft);
}


.vt-btn-success-soft {
    color: var(--vt-success);

    border-color: #c9e8d5;

    background: var(--vt-success-soft);
}


.vt-btn-ghost {
    color: var(--vt-text-soft);
    background: transparent;
}


.vt-btn-ghost:hover:not(:disabled) {
    background: #f2f5f9;
}


/* =========================================================
   SEARCH
========================================================= */

.vt-search {
    position: relative;
}


.vt-search input {
    width: 100%;
    min-height: 42px;

    padding:
        9px
        12px
        9px
        38px;

    border: 1px solid #d5dfeb;
    border-radius: 11px;

    outline: none;

    color: var(--vt-text);
    background: #fdfefe;

    font-size: 11px;
}


.vt-search input:focus {
    border-color: #8eacef;

    box-shadow:
        0 0 0 3px
        rgba(45,95,210,.09);
}


.vt-search-icon {
    position: absolute;

    left: 13px;
    top: 50%;

    transform: translateY(-50%);

    color: #8e9aae;

    font-size: 12px;

    pointer-events: none;
}


/* =========================================================
   STATUS PILLS / BADGES
========================================================= */

.vt-pill {
    min-height: 20px;

    padding: 3px 7px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border-radius: 999px;

    font-size: 8px;
    font-weight: 900;
}


.vt-pill-success {
    color: var(--vt-success);
    background: var(--vt-success-soft);
}


.vt-pill-warning {
    color: var(--vt-warning);
    background: var(--vt-warning-soft);
}


.vt-pill-danger {
    color: var(--vt-danger);
    background: var(--vt-danger-soft);
}


.vt-pill-info {
    color: var(--vt-primary);
    background: var(--vt-primary-soft);
}


.vt-pill-neutral {
    color: var(--vt-muted);
    background: #eef2f6;
}


/* =========================================================
   ACCOUNT / LIST CARDS
========================================================= */

.vt-list {
    display: grid;
    gap: 9px;
}


.vt-account-card {
    display: grid;
    grid-template-columns:
        minmax(0,1fr)
        auto;

    gap: 14px;
    align-items: center;

    padding: 13px;

    border: 1px solid var(--vt-line);
    border-radius: 14px;

    background: #fff;

    transition:
        transform .15s ease,
        border-color .15s ease,
        box-shadow .15s ease;
}


.vt-account-card:hover {
    transform: translateY(-1px);

    border-color: #cbd7e7;

    box-shadow:
        0 8px 22px
        rgba(24,40,72,.055);
}


.vt-account-identity {
    display: flex;
    align-items: center;
    gap: 11px;

    min-width: 0;
}


.vt-avatar {
    width: 40px;
    height: 40px;

    flex: 0 0 40px;

    display: grid;
    place-items: center;

    border-radius: 12px;

    color: var(--vt-primary);

    background:
        linear-gradient(
            145deg,
            var(--vt-primary-soft),
            #f5f8ff
        );

    font-size: 12px;
    font-weight: 900;
}


.vt-avatar.teal {
    color: var(--vt-teal);

    background:
        linear-gradient(
            145deg,
            var(--vt-teal-soft),
            #f4fbfb
        );
}


.vt-account-copy {
    min-width: 0;
}


.vt-account-name {
    display: block;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    color: var(--vt-text);

    font-size: 13px;
}


.vt-account-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;

    margin-top: 4px;
}


.vt-account-secondary {
    color: var(--vt-muted);
    font-size: 9px;
}


.vt-account-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    flex-wrap: wrap;
}


/* =========================================================
   THERAPY CARDS
========================================================= */

.vt-therapy-grid,
.patient-therapy-grid {
    display: grid !important;

    grid-template-columns:
        repeat(2, minmax(0, 1fr)) !important;

    gap: 12px !important;

    width: 100% !important;

    overflow: visible !important;
}


.vt-therapy-card,
.patient-therapy-card {
    position: relative;

    min-width: 0 !important;
    width: auto !important;

    margin: 0 !important;
    padding: 17px !important;

    overflow: hidden;

    border: 1px solid var(--vt-line) !important;
    border-radius: 15px !important;

    background:
        linear-gradient(
            180deg,
            #fff,
            #fbfdff
        ) !important;

    box-shadow:
        0 5px 16px
        rgba(24,40,72,.035) !important;

    transition:
        transform .15s ease,
        box-shadow .15s ease,
        border-color .15s ease;
}


.vt-therapy-card::before,
.patient-therapy-card::before {
    content: "";

    position: absolute;

    left: 0;
    top: 0;
    bottom: 0;

    width: 3px;

    background:
        linear-gradient(
            180deg,
            var(--vt-primary),
            var(--vt-teal)
        );
}


.vt-therapy-card:hover,
.patient-therapy-card:hover {
    transform: translateY(-1px);

    border-color: #cbd7e7 !important;

    box-shadow:
        0 9px 24px
        rgba(24,40,72,.06) !important;
}


/* =========================================================
   TABLE
========================================================= */

.vt-table-wrap {
    width: 100%;
    overflow-x: auto;

    border: 1px solid var(--vt-line);
    border-radius: var(--vt-radius-md);
}


.vt-table {
    width: 100%;

    border-collapse: collapse;

    background: #fff;

    font-size: 10px;
}


.vt-table th,
.vt-table td {
    padding: 11px 12px;

    border-bottom: 1px solid #edf1f5;

    text-align: left;
    vertical-align: middle;
}


.vt-table th {
    color: var(--vt-muted);

    background: #f8fafc;

    font-size: 9px;
    font-weight: 800;
    letter-spacing: .03em;
    text-transform: uppercase;
}


.vt-table tr:last-child td {
    border-bottom: 0;
}


/* =========================================================
   EMPTY STATE
========================================================= */

.vt-empty {
    padding: 28px 20px;

    display: grid;
    place-items: center;

    border: 1px dashed #d7e0eb;
    border-radius: 13px;

    color: var(--vt-muted);
    background: #fafbfd;

    text-align: center;
}


.vt-empty-icon {
    width: 42px;
    height: 42px;

    display: grid;
    place-items: center;

    margin-bottom: 10px;

    border-radius: 12px;

    color: var(--vt-primary);
    background: var(--vt-primary-soft);

    font-size: 17px;
    font-weight: 900;
}


.vt-empty strong {
    color: var(--vt-text);

    font-size: 12px;
}


.vt-empty p {
    max-width: 360px;

    margin: 5px 0 0;

    color: var(--vt-muted);

    font-size: 10px;
    line-height: 1.5;
}


.vt-empty .vt-btn {
    margin-top: 14px;
}


/* =========================================================
   SKELETON LOADERS
========================================================= */

.vt-skeleton {
    position: relative;

    overflow: hidden;

    background: #e9eef5 !important;
}


.vt-skeleton::after {
    content: "";

    position: absolute;
    inset: 0;

    transform: translateX(-100%);

    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(255,255,255,.65),
            transparent
        );

    animation:
        vt-shimmer
        1.25s
        infinite;
}


@keyframes vt-shimmer {
    100% {
        transform: translateX(100%);
    }
}


.vt-skeleton-line {
    height: 10px;

    border-radius: 999px;
}


.vt-skeleton-line.sm {
    width: 38%;
}


.vt-skeleton-line.md {
    width: 64%;
}


.vt-skeleton-line.lg {
    width: 92%;
}


.vt-skeleton-card {
    min-height: 92px;

    padding: 14px;

    display: grid;
    gap: 10px;

    border: 1px solid var(--vt-line);
    border-radius: 14px;

    background: #fff;
}


/* =========================================================
   MODAL / DIALOG
========================================================= */

.vt-modal {
    position: fixed;
    inset: 0;
    z-index: 3000;

    display: none;

    align-items: center;
    justify-content: center;

    padding: 20px;
}


.vt-modal.open {
    display: flex;
}


.vt-modal-backdrop {
    position: absolute;
    inset: 0;

    background: rgba(13,24,43,.50);

    backdrop-filter: blur(5px);
}


.vt-modal-card {
    position: relative;

    width: min(560px, 100%);
    max-height: calc(100vh - 40px);

    overflow: auto;

    border: 1px solid var(--vt-line);
    border-radius: 19px;

    color: var(--vt-text);
    background: #fff;

    box-shadow: var(--vt-shadow-lg);

    animation:
        vt-modal-in
        .16s ease-out;
}


@keyframes vt-modal-in {
    from {
        opacity: 0;
        transform: translateY(8px) scale(.985);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}


.vt-modal-header {
    padding: 20px 22px 0;
}


.vt-modal-body {
    padding: 14px 22px 20px;
}


.vt-modal-footer {
    padding: 0 22px 20px;

    display: flex;
    justify-content: flex-end;
    gap: 8px;
}


.vt-modal-title {
    margin: 0;

    font-size: 20px;
    line-height: 1.15;
    letter-spacing: -.025em;
}


.vt-modal-text {
    margin: 8px 0 0;

    color: var(--vt-muted);

    font-size: 11px;
    line-height: 1.6;
}


.vt-dialog-icon {
    width: 44px;
    height: 44px;

    display: grid;
    place-items: center;

    margin-bottom: 13px;

    border-radius: 13px;

    color: var(--vt-primary);
    background: var(--vt-primary-soft);

    font-size: 18px;
    font-weight: 900;
}


.vt-dialog-icon.warning {
    color: var(--vt-warning);
    background: var(--vt-warning-soft);
}


.vt-dialog-icon.danger {
    color: var(--vt-danger);
    background: var(--vt-danger-soft);
}


/* =========================================================
   TOASTS
========================================================= */

.vt-toast-region {
    position: fixed;

    right: 20px;
    bottom: 20px;

    z-index: 5000;

    width: min(360px, calc(100vw - 40px));

    display: grid;
    gap: 8px;

    pointer-events: none;
}


.vt-toast {
    width: 100%;

    padding: 12px 14px;

    display: flex;
    align-items: flex-start;
    gap: 9px;

    border: 1px solid var(--vt-line);
    border-radius: 13px;

    background: #fff;

    box-shadow:
        0 18px 55px
        rgba(13,24,43,.16);

    transform: translateY(12px);
    opacity: 0;

    pointer-events: auto;

    transition:
        opacity .18s ease,
        transform .18s ease;
}


.vt-toast.show {
    transform: translateY(0);
    opacity: 1;
}


.vt-toast-dot {
    width: 8px;
    height: 8px;

    flex: 0 0 8px;

    margin-top: 4px;

    border-radius: 50%;

    background: var(--vt-success);
}


.vt-toast.error .vt-toast-dot {
    background: var(--vt-danger);
}


.vt-toast.warning .vt-toast-dot {
    background: var(--vt-warning);
}


.vt-toast.info .vt-toast-dot {
    background: var(--vt-primary);
}


.vt-toast-copy {
    min-width: 0;
    flex: 1;
}


.vt-toast-copy strong {
    display: block;

    margin-bottom: 2px;

    color: var(--vt-text);

    font-size: 10px;
}


.vt-toast-copy span {
    display: block;

    color: var(--vt-muted);

    font-size: 9px;
    line-height: 1.45;
}


.vt-toast-close {
    width: 24px;
    height: 24px;

    display: grid;
    place-items: center;

    padding: 0;

    border: 0;
    border-radius: 7px;

    color: var(--vt-muted);
    background: transparent;
}


.vt-toast-close:hover {
    background: #f2f5f9;
}


/* =========================================================
   UTILITIES
========================================================= */

.vt-hidden {
    display: none !important;
}


.vt-flex {
    display: flex;
}


.vt-grid {
    display: grid;
}


.vt-center {
    display: grid;
    place-items: center;
}


.vt-gap-1 {
    gap: var(--vt-space-1);
}


.vt-gap-2 {
    gap: var(--vt-space-2);
}


.vt-gap-3 {
    gap: var(--vt-space-3);
}


.vt-gap-4 {
    gap: var(--vt-space-4);
}


.vt-muted {
    color: var(--vt-muted);
}


.vt-text-success {
    color: var(--vt-success);
}


.vt-text-warning {
    color: var(--vt-warning);
}


.vt-text-danger {
    color: var(--vt-danger);
}


/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 1050px) {

    :root {
        --vt-sidebar-width: 205px;
    }


    .vt-workspace-grid,
    .workspace-grid {
        grid-template-columns: 1fr;
    }
}


@media (max-width: 820px) {

    :root {
        --vt-sidebar-width: 100%;
    }


    .vt-app,
    .doctor-app,
    .patient-app,
    .admin-app {
        display: block;
    }


    .vt-sidebar,
    .doctor-sidebar,
    .patient-sidebar,
    .admin-sidebar {
        position: relative;

        width: 100%;
        height: auto;

        padding: 15px 18px;
    }


    .vt-sidebar-content,
    .sidebar-content {
        display: grid;

        grid-template-columns:
            1fr
            auto;

        align-items: center;

        min-height: 0;
    }


    .vt-sidebar-label,
    .sidebar-label,
    .vt-sidebar-footer,
    .sidebar-footer {
        display: none;
    }


    .vt-nav,
    .sidebar-nav {
        display: flex;
        gap: 5px;
    }


    .vt-nav-link,
    .sidebar-link {
        min-height: 36px;
        padding: 6px 8px;
    }


    .vt-nav-link .vt-nav-text,
    .sidebar-link span:last-child {
        display: none;
    }


    .vt-sidebar-toggle {
        display: grid;
    }


    .vt-sidebar.vt-mobile-collapsible .vt-nav,
    .vt-sidebar.vt-mobile-collapsible .vt-sidebar-footer {
        display: none;
    }


    .vt-sidebar.vt-mobile-collapsible.open .vt-sidebar-content {
        grid-template-columns: 1fr auto;
    }


    .vt-sidebar.vt-mobile-collapsible.open .vt-nav {
        grid-column: 1 / -1;

        width: 100%;

        display: grid;

        margin-top: 13px;
    }


    .vt-sidebar.vt-mobile-collapsible.open .vt-nav-link .vt-nav-text {
        display: inline;
    }


    .vt-sidebar.vt-mobile-collapsible.open .vt-sidebar-footer {
        grid-column: 1 / -1;

        display: block;

        margin-top: 13px;
    }


    .vt-main,
    .doctor-main,
    .patient-main,
    .admin-main {
        padding-top: 18px;
    }


    .vt-metrics,
    .metrics-grid,
    .patient-overview {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }
}


@media (max-width: 700px) {

    .vt-therapy-grid,
    .patient-therapy-grid {
        grid-template-columns:
            1fr !important;
    }
}


@media (max-width: 620px) {

    .vt-main,
    .doctor-main,
    .patient-main,
    .admin-main {
        padding:
            16px
            12px
            34px;
    }


    .vt-topbar h1,
    .doctor-topbar h1,
    .patient-topbar h1,
    .admin-topbar h1 {
        font-size: 21px;
    }


    .vt-hero,
    .doctor-hero,
    .patient-hero,
    .admin-hero {
        min-height: 175px;

        padding: 23px 21px;

        border-radius: 17px;
    }


    .vt-hero h2,
    .doctor-hero h2,
    .patient-hero h2,
    .admin-hero h2 {
        font-size: 28px;
    }


    .vt-hero-chart,
    .hero-chart {
        display: none;
    }


    .vt-metric,
    .metric-card,
    .patient-stat-card {
        padding: 13px;
    }


    .vt-panel,
    .workspace-card,
    .patient-section {
        padding: 15px;

        border-radius: 15px;
    }


    .vt-account-card {
        grid-template-columns: 1fr;
    }


    .vt-account-actions {
        justify-content: flex-start;
        padding-left: 51px;
    }


    .vt-modal {
        padding: 10px;
    }


    .vt-modal-card {
        border-radius: 15px;
    }
}


@media (max-width: 430px) {

    .vt-brand-copy span,
    .brand-copy span {
        display: none;
    }


    .vt-metrics,
    .metrics-grid,
    .patient-overview {
        gap: 8px;
    }


    .vt-metric-value,
    .metric-value,
    .patient-stat-value {
        font-size: 22px;
    }


    .vt-account-actions {
        width: 100%;

        display: grid;
        grid-template-columns:
            1fr
            1fr;

        padding-left: 0;
    }


    .vt-account-actions .vt-btn {
        width: 100%;
    }


    .vt-modal-footer {
        flex-direction: column-reverse;
    }


    .vt-modal-footer .vt-btn {
        width: 100%;
    }


    .vt-toast-region {
        right: 12px;
        bottom: 12px;

        width: calc(100vw - 24px);
    }
}


/* =========================================================
   REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}


/* =========================================================
   V70 — SHARED SVG ICON SYSTEM
========================================================= */

.vt-icon {
    width: 1em;
    height: 1em;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 auto;

    line-height: 0;

    vertical-align: -.12em;
}


.vt-icon > svg {
    width: 100%;
    height: 100%;

    display: block;

    overflow: visible;
}


.vt-icon-label {
    min-width: 0;
}


.vt-brand-mark .vt-icon {
    font-size: 27px;
}


.vt-nav-icon .vt-icon {
    font-size: 15px;
}


.vt-metric-icon .vt-icon,
.metric-icon .vt-icon,
.patient-stat-icon .vt-icon {
    font-size: 15px;
}


.vt-btn .vt-icon,
.vt-logout .vt-icon,
.logout-button .vt-icon,
.patient-logout .vt-icon {
    font-size: 14px;
}


.vt-sidebar-toggle .vt-icon {
    font-size: 18px;
}


.vt-search-icon .vt-icon {
    font-size: 14px;
}


.vt-pill .vt-icon {
    font-size: 11px;
}


.vt-avatar .vt-icon {
    font-size: 18px;
}


.vt-dialog-icon .vt-icon {
    font-size: 19px;
}


/* =========================================================
   V71 — PATIENT THERAPY CARDS
========================================================= */

.vt-therapy-card-v71 {
    --therapy-accent: var(--vt-primary);
    --therapy-soft: var(--vt-primary-soft);

    position: relative;

    min-width: 0;

    display: flex;
    flex-direction: column;

    overflow: hidden;

    border: 1px solid var(--vt-line);
    border-radius: 17px;

    background:
        linear-gradient(
            180deg,
            #ffffff 0%,
            #fbfdff 100%
        );

    box-shadow:
        0 8px 24px
        rgba(20, 42, 82, .055);

    transition:
        transform .16s ease,
        border-color .16s ease,
        box-shadow .16s ease;
}


.vt-therapy-card-v71::before {
    content: "";

    position: absolute;

    left: 0;
    right: 0;
    top: 0;

    height: 3px;

    background:
        var(--therapy-accent);
}


.vt-therapy-card-v71:hover {
    transform: translateY(-2px);

    border-color: #c8d6e8;

    box-shadow:
        0 14px 32px
        rgba(20, 42, 82, .085);
}


.vt-therapy-card-v71[data-status="paused"],
.vt-therapy-card-v71[data-status="unavailable"] {
    background:
        linear-gradient(
            180deg,
            #ffffff,
            #fafbfc
        );
}


.vt-therapy-card-v71[data-status="paused"] {
    --therapy-accent: #b07a11;
    --therapy-soft: #fff5dc;
}


.vt-therapy-card-v71[data-status="unavailable"] {
    --therapy-accent: #8a94a6;
    --therapy-soft: #eef2f6;
}


.vt-therapy-tone-teal {
    --therapy-accent: var(--vt-teal);
    --therapy-soft: var(--vt-teal-soft);
}


.vt-therapy-tone-violet {
    --therapy-accent: #7654c6;
    --therapy-soft: #f2edff;
}


.vt-therapy-tone-amber {
    --therapy-accent: #a86b00;
    --therapy-soft: #fff4db;
}


.vt-therapy-tone-slate {
    --therapy-accent: #52657d;
    --therapy-soft: #edf2f7;
}


.vt-therapy-card-main {
    padding: 18px 18px 15px;
}


.vt-therapy-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 13px;
}


.vt-therapy-card-identity {
    min-width: 0;

    display: flex;
    align-items: flex-start;

    gap: 12px;
}


.vt-therapy-card-icon {
    width: 44px;
    height: 44px;

    flex: 0 0 44px;

    display: grid;
    place-items: center;

    border-radius: 13px;

    color: var(--therapy-accent);
    background: var(--therapy-soft);

    box-shadow:
        inset 0 0 0 1px
        rgba(255,255,255,.45);

    font-size: 22px;
}


.vt-therapy-card-heading {
    min-width: 0;
}


.vt-therapy-card-category {
    display: block;

    margin-bottom: 3px;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    color: var(--therapy-accent);

    font-size: 8px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}


.vt-therapy-card-title {
    margin: 0;

    color: var(--vt-text);

    font-size: 17px;
    line-height: 1.2;
    letter-spacing: -.02em;
}


.vt-therapy-card-doctor {
    margin-top: 5px;

    display: inline-flex;
    align-items: center;

    gap: 5px;

    color: var(--vt-muted);

    font-size: 9px;
}


.vt-therapy-card-doctor .vt-icon {
    font-size: 12px;
}


.vt-therapy-status-pill {
    min-height: 24px;

    padding: 4px 8px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 5px;

    flex: 0 0 auto;

    border-radius: 999px;

    font-size: 8px;
    font-weight: 900;

    white-space: nowrap;
}


.vt-therapy-status-pill .vt-icon {
    font-size: 11px;
}


.vt-therapy-status-active {
    color: var(--vt-success);
    background: var(--vt-success-soft);
}


.vt-therapy-status-paused {
    color: var(--vt-warning);
    background: var(--vt-warning-soft);
}


.vt-therapy-status-unavailable {
    color: var(--vt-muted);
    background: #eef2f6;
}


.vt-therapy-card-description {
    display: -webkit-box;

    margin: 13px 0 0;

    overflow: hidden;

    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;

    color: var(--vt-muted);

    font-size: 10px;
    line-height: 1.55;
}


.vt-therapy-prescription {
    margin-top: 15px;

    padding-top: 14px;

    border-top: 1px solid #edf1f5;
}


.vt-therapy-prescription-label {
    display: flex;
    align-items: center;

    gap: 5px;

    margin-bottom: 8px;

    color: var(--vt-muted-light);

    font-size: 8px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}


.vt-therapy-prescription-label .vt-icon {
    color: var(--therapy-accent);

    font-size: 12px;
}


.vt-therapy-prescription-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 7px;
}


.vt-therapy-prescription-item {
    min-width: 0;

    padding: 9px 10px;

    border: 1px solid #e7edf4;
    border-radius: 10px;

    background: #f9fbfd;
}


.vt-therapy-prescription-item-label {
    display: flex;
    align-items: center;

    gap: 5px;

    margin-bottom: 3px;

    color: var(--vt-muted-light);

    font-size: 7px;
    font-weight: 900;
    letter-spacing: .06em;
    text-transform: uppercase;
}


.vt-therapy-prescription-item-label .vt-icon {
    color: var(--therapy-accent);

    font-size: 11px;
}


.vt-therapy-prescription-item-value {
    display: block;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    color: var(--vt-text-soft);

    font-size: 10px;
    font-weight: 800;
}


.vt-therapy-detail-chips {
    margin-top: 9px;

    display: flex;
    flex-wrap: wrap;

    gap: 5px;
}


.vt-therapy-detail-chip {
    min-height: 22px;

    padding: 4px 7px;

    display: inline-flex;
    align-items: center;

    border: 1px solid #e2e8f0;
    border-radius: 999px;

    color: #526173;
    background: #fff;

    font-size: 8px;
    font-weight: 700;
}


.vt-therapy-card-footer {
    margin-top: auto;

    padding: 12px 18px 16px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 12px;

    border-top: 1px solid #edf1f5;

    background:
        linear-gradient(
            180deg,
            rgba(248,250,252,.45),
            rgba(248,250,252,.88)
        );
}


.vt-therapy-card-readiness {
    min-width: 0;

    display: flex;
    align-items: center;

    gap: 6px;

    color: var(--vt-muted);

    font-size: 8px;
    line-height: 1.35;
}


.vt-therapy-card-readiness .vt-icon {
    flex: 0 0 auto;

    color: var(--therapy-accent);

    font-size: 13px;
}


.vt-therapy-card-action {
    min-width: 126px;
    min-height: 38px;

    flex: 0 0 auto;

    border-radius: 10px;

    font-size: 9px;
}


.vt-therapy-card-action:disabled {
    box-shadow: none;
}


@media (max-width: 700px) {

    .vt-therapy-card-main {
        padding: 16px;
    }


    .vt-therapy-card-footer {
        padding:
            11px
            16px
            15px;
    }
}


@media (max-width: 500px) {

    .vt-therapy-card-head {
        align-items: flex-start;
    }


    .vt-therapy-card-icon {
        width: 40px;
        height: 40px;

        flex-basis: 40px;

        font-size: 20px;
    }


    .vt-therapy-prescription-grid {
        grid-template-columns: 1fr 1fr;
    }


    .vt-therapy-card-footer {
        align-items: stretch;
        flex-direction: column;
    }


    .vt-therapy-card-action {
        width: 100%;
    }
}


/* =========================================================
   V73 — SHARED LOADING / EMPTY / ERROR STATES
========================================================= */

.vt-state {
    width: 100%;
    min-height: 180px;

    padding: 30px 20px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    gap: 7px;

    border:
        1px dashed
        var(--vt-line-strong);

    border-radius: 14px;

    color: var(--vt-muted);
    background:
        linear-gradient(
            180deg,
            #fbfdff,
            #f8fafc
        );

    text-align: center;
}


.vt-state-compact {
    min-height: 92px;

    padding: 18px 14px;

    border-radius: 11px;
}


.vt-state-full {
    min-height: 500px;

    border: 0;
    border-radius: 0;

    background: #fff;
}


.vt-state-icon {
    width: 42px;
    height: 42px;

    display: grid;
    place-items: center;

    margin-bottom: 3px;

    border-radius: 12px;

    color: var(--vt-primary);
    background: var(--vt-primary-soft);

    font-size: 20px;
}


.vt-state-error .vt-state-icon {
    color: var(--vt-danger);
    background: var(--vt-danger-soft);
}


.vt-state-empty .vt-state-icon {
    color: var(--vt-teal);
    background: var(--vt-teal-soft);
}


.vt-state-loading .vt-state-icon {
    background: transparent;
}


.vt-state-title {
    color: var(--vt-text);

    font-size: 13px;
    line-height: 1.3;
}


.vt-state-message {
    max-width: 48ch;

    margin: 0;

    color: var(--vt-muted);

    font-size: 10px;
    line-height: 1.55;
}


.vt-state-actions {
    margin-top: 6px;

    display: flex;
    justify-content: center;

    gap: 7px;
}


.vt-state-actions .vt-btn {
    min-height: 34px;

    padding: 7px 11px;

    font-size: 9px;
}


.vt-state-spinner {
    width: 31px;
    height: 31px;

    display: block;

    border:
        3px solid
        #e5ecf5;

    border-top-color:
        var(--vt-primary);

    border-radius: 50%;

    animation:
        vt-state-spin
        .78s
        linear
        infinite;
}


@keyframes vt-state-spin {
    to {
        transform:
            rotate(360deg);
    }
}


.vt-state-compact .vt-state-icon {
    width: 34px;
    height: 34px;

    border-radius: 10px;

    font-size: 16px;
}


.vt-state-compact .vt-state-spinner {
    width: 25px;
    height: 25px;

    border-width: 2px;
}


.vt-state-compact .vt-state-title {
    font-size: 11px;
}


.vt-state-compact .vt-state-message {
    font-size: 9px;
}


@media (prefers-reduced-motion: reduce) {

    .vt-state-spinner {
        animation-duration:
            1.4s;
    }
}


/* =========================================================
   V74 — RESPONSIVE / MOBILE REFINEMENT
========================================================= */

html {
    -webkit-text-size-adjust: 100%;
}


body {
    overflow-x: hidden;
}


img,
svg,
iframe {
    max-width: 100%;
}


.vt-main,
.doctor-main,
.patient-main,
.admin-main {
    overflow-x: clip;
}


.vt-input,
.vt-select,
.vt-textarea,
.vt-field input,
.vt-field select,
.vt-field textarea,
.form-group input,
.form-group select,
.form-group textarea {
    font-size: 16px;
}


/*
 * Keep desktop inputs visually compact while still preventing
 * automatic iOS zoom on focus.
 */
@media (min-width: 821px) {

    .vt-input,
    .vt-select,
    .vt-textarea,
    .vt-field input,
    .vt-field select,
    .vt-field textarea,
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 11px;
    }
}


/* =========================================================
   TABLET
========================================================= */

@media (max-width: 900px) {

    .vt-hero,
    .doctor-hero,
    .patient-hero,
    .admin-hero {
        min-height: 170px;

        padding:
            25px
            26px;
    }


    .vt-hero-copy,
    .hero-copy {
        max-width: 78%;
    }


    .vt-metrics,
    .metrics-grid,
    .patient-overview {
        gap: 10px;
    }


    .vt-panel,
    .workspace-card,
    .patient-section {
        box-shadow:
            0 8px 24px
            rgba(20,42,82,.055);
    }
}


/* =========================================================
   MOBILE NAVIGATION / SHELL
========================================================= */

@media (max-width: 820px) {

    .vt-sidebar,
    .doctor-sidebar,
    .patient-sidebar,
    .admin-sidebar {
        position: sticky;
        top: 0;
        z-index: 950;

        padding:
            max(
                12px,
                env(safe-area-inset-top)
            )
            max(
                15px,
                env(safe-area-inset-right)
            )
            12px
            max(
                15px,
                env(safe-area-inset-left)
            );

        box-shadow:
            0 8px 28px
            rgba(10, 29, 55, .16);
    }


    .vt-sidebar-content,
    .sidebar-content {
        width: 100%;
    }


    .vt-brand,
    .brand-lockup {
        min-height: 44px;
    }


    .vt-brand-mark,
    .brand-mark {
        width: 38px;
        height: 38px;

        flex-basis: 38px;

        border-radius: 11px;
    }


    .vt-brand-mark .vt-icon {
        font-size: 24px;
    }


    .vt-sidebar-toggle {
        width: 44px;
        height: 44px;

        border-radius: 11px;
    }


    .vt-sidebar.vt-mobile-collapsible.open {
        max-height: min(
            82dvh,
            620px
        );

        overflow-y: auto;

        overscroll-behavior: contain;
    }


    .vt-sidebar.vt-mobile-collapsible.open .vt-nav {
        gap: 7px;
    }


    .vt-sidebar.vt-mobile-collapsible.open .vt-nav-link {
        min-height: 44px;

        padding:
            9px
            11px;

        border-radius: 10px;
    }


    .vt-sidebar.vt-mobile-collapsible.open .vt-sidebar-footer {
        padding-bottom:
            max(
                2px,
                env(safe-area-inset-bottom)
            );
    }


    .vt-main,
    .doctor-main,
    .patient-main,
    .admin-main {
        padding:
            16px
            16px
            calc(
                36px
                + env(safe-area-inset-bottom)
            );
    }


    .vt-topbar,
    .doctor-topbar,
    .patient-topbar,
    .admin-topbar {
        min-height: 48px;

        gap: 10px;

        align-items: flex-start;
    }


    .vt-topbar > div:first-child,
    .doctor-topbar > div:first-child,
    .patient-topbar > div:first-child,
    .admin-topbar > div:first-child {
        min-width: 0;
    }


    .vt-topbar h1,
    .doctor-topbar h1,
    .patient-topbar h1,
    .admin-topbar h1 {
        overflow-wrap: anywhere;
    }


    .vt-topbar-subtitle,
    #welcome,
    #patientWelcome,
    #adminWelcome {
        max-width: min(
            66vw,
            430px
        );

        overflow: hidden;

        text-overflow: ellipsis;
        white-space: nowrap;
    }


    .vt-logout,
    .logout-button,
    .patient-logout {
        min-width: 44px;
        min-height: 44px;

        flex: 0 0 auto;

        padding:
            9px
            11px;
    }


    .vt-hero,
    .doctor-hero,
    .patient-hero,
    .admin-hero {
        min-height: 158px;

        margin-top: 15px;

        padding:
            23px
            24px;
    }


    .vt-hero-copy,
    .hero-copy {
        max-width: 82%;
    }


    .vt-hero h2,
    .doctor-hero h2,
    .patient-hero h2,
    .admin-hero h2 {
        font-size:
            clamp(
                27px,
                5.7vw,
                34px
            );
    }


    .vt-hero p,
    .doctor-hero p,
    .patient-hero p,
    .admin-hero p {
        max-width: 58ch;

        font-size: 11px;
        line-height: 1.55;
    }


    .vt-workspace-grid,
    .workspace-grid {
        gap: 13px;

        margin-top: 14px;
    }


    .vt-section-head,
    .section-head,
    .patient-section-header {
        gap: 10px;
    }


    .vt-search input {
        min-height: 44px;
    }


    .vt-btn {
        min-height: 42px;
    }
}


/* =========================================================
   PHONE
========================================================= */

@media (max-width: 620px) {

    .vt-main,
    .doctor-main,
    .patient-main,
    .admin-main {
        padding:
            13px
            10px
            calc(
                30px
                + env(safe-area-inset-bottom)
            );
    }


    .vt-topbar,
    .doctor-topbar,
    .patient-topbar,
    .admin-topbar {
        align-items: center;
    }


    .vt-eyebrow,
    .topbar-eyebrow {
        font-size: 8px;
    }


    .vt-topbar h1,
    .doctor-topbar h1,
    .patient-topbar h1,
    .admin-topbar h1 {
        margin-top: 2px;

        font-size: 20px;
    }


    .vt-topbar-subtitle,
    #welcome,
    #patientWelcome,
    #adminWelcome {
        max-width:
            calc(
                100vw
                - 100px
            );

        font-size: 10px;
    }


    .vt-logout,
    .logout-button,
    .patient-logout {
        width: 44px;

        padding: 0;

        overflow: hidden;

        gap: 0;

        font-size: 0;
    }


    .vt-logout .vt-icon,
    .logout-button .vt-icon,
    .patient-logout .vt-icon {
        font-size: 17px;
    }


    .vt-hero,
    .doctor-hero,
    .patient-hero,
    .admin-hero {
        min-height: 0;

        padding:
            20px
            18px;
    }


    .vt-hero-copy,
    .hero-copy {
        max-width: 100%;
    }


    .vt-hero h2,
    .doctor-hero h2,
    .patient-hero h2,
    .admin-hero h2 {
        margin-top: 7px;

        font-size: 27px;
        line-height: 1.02;
    }


    .vt-hero p,
    .doctor-hero p,
    .patient-hero p,
    .admin-hero p {
        margin-top: 10px;

        font-size: 10px;
    }


    .vt-metrics,
    .metrics-grid,
    .patient-overview {
        grid-template-columns:
            repeat(
                2,
                minmax(0, 1fr)
            );

        gap: 8px;

        margin-top: 11px;
    }


    .vt-metric,
    .metric-card,
    .patient-stat-card {
        min-width: 0;

        padding: 12px;
    }


    .vt-metric-top,
    .metric-top,
    .patient-stat-top {
        align-items: flex-start;
    }


    .vt-metric-label,
    .metric-label,
    .patient-stat-label {
        min-width: 0;

        overflow-wrap: anywhere;

        font-size: 9px;
        line-height: 1.3;
    }


    .vt-metric-icon,
    .metric-icon,
    .patient-stat-icon {
        width: 28px;
        height: 28px;

        flex: 0 0 28px;
    }


    .vt-metric-value,
    .metric-value,
    .patient-stat-value {
        margin-top: 10px;

        font-size: 23px;
    }


    .vt-metric-note,
    .metric-note,
    .patient-stat-note {
        min-height: 23px;

        font-size: 8px;
        line-height: 1.4;
    }


    .vt-panel,
    .workspace-card,
    .patient-section {
        padding: 14px;

        border-radius: 14px;
    }


    .vt-section-head,
    .section-head,
    .patient-section-header {
        flex-direction: column;

        margin-bottom: 13px;
    }


    .vt-count-badge,
    .patient-count-badge,
    .doctor-count-badge {
        align-self: flex-start;
    }


    .vt-field input,
    .vt-field select,
    .vt-field textarea,
    .vt-input,
    .vt-select,
    .vt-textarea {
        min-height: 44px;
    }


    .vt-state {
        min-height: 150px;

        padding:
            24px
            16px;
    }


    .vt-state-full {
        min-height:
            min(
                520px,
                68dvh
            );
    }


    .vt-toast-region {
        left:
            max(
                10px,
                env(safe-area-inset-left)
            );

        right:
            max(
                10px,
                env(safe-area-inset-right)
            );

        bottom:
            calc(
                10px
                + env(safe-area-inset-bottom)
            );

        width: auto;
    }


    .vt-toast {
        width: 100%;
    }


    .vt-modal {
        padding:
            max(
                8px,
                env(safe-area-inset-top)
            )
            max(
                8px,
                env(safe-area-inset-right)
            )
            max(
                8px,
                env(safe-area-inset-bottom)
            )
            max(
                8px,
                env(safe-area-inset-left)
            );
    }


    .vt-modal-card {
        max-height:
            calc(
                100dvh
                - 16px
                - env(safe-area-inset-top)
                - env(safe-area-inset-bottom)
            );

        overflow-y: auto;

        overscroll-behavior: contain;
    }
}


/* =========================================================
   NARROW PHONE
========================================================= */

@media (max-width: 390px) {

    .vt-brand-copy strong,
    .brand-copy strong {
        max-width:
            calc(
                100vw
                - 122px
            );

        font-size: 12px;
    }


    .vt-metrics,
    .metrics-grid,
    .patient-overview {
        gap: 7px;
    }


    .vt-metric,
    .metric-card,
    .patient-stat-card {
        padding:
            11px
            10px;
    }


    .vt-metric-value,
    .metric-value,
    .patient-stat-value {
        font-size: 21px;
    }


    .vt-section-head h2,
    .vt-section-head h3,
    .section-head h2,
    .section-head h3,
    .patient-section-header h2 {
        font-size: 18px;
    }
}


/* =========================================================
   MOBILE THERAPY CARDS
========================================================= */

@media (max-width: 620px) {

    .vt-therapy-card-v71 {
        border-radius: 14px;
    }


    .vt-therapy-card-main {
        padding:
            15px
            14px
            13px;
    }


    .vt-therapy-card-head {
        gap: 8px;
    }


    .vt-therapy-card-identity {
        gap: 9px;
    }


    .vt-therapy-card-title {
        font-size: 15px;
    }


    .vt-therapy-status-pill {
        min-height: 22px;

        padding:
            4px
            7px;

        font-size: 7px;
    }


    .vt-therapy-prescription {
        margin-top: 12px;

        padding-top: 12px;
    }


    .vt-therapy-prescription-grid {
        gap: 6px;
    }


    .vt-therapy-prescription-item {
        padding:
            8px
            8px;
    }


    .vt-therapy-card-footer {
        padding:
            11px
            14px
            14px;
    }


    .vt-therapy-card-action {
        min-height: 44px;

        font-size: 10px;
    }
}


@media (max-width: 390px) {

    .vt-therapy-card-head {
        display: grid;

        grid-template-columns:
            minmax(0, 1fr)
            auto;
    }


    .vt-therapy-card-icon {
        width: 38px;
        height: 38px;

        flex-basis: 38px;
    }


    .vt-therapy-prescription-grid {
        grid-template-columns: 1fr;
    }


    .vt-therapy-detail-chip {
        max-width: 100%;

        overflow: hidden;

        text-overflow: ellipsis;
        white-space: nowrap;
    }
}


/* =========================================================
   SHORT / LANDSCAPE SCREENS
========================================================= */

@media (max-height: 520px) and (orientation: landscape) {

    .vt-sidebar.vt-mobile-collapsible.open {
        max-height: 96dvh;
    }


    .vt-hero,
    .doctor-hero,
    .patient-hero,
    .admin-hero {
        min-height: 0;

        padding:
            16px
            20px;
    }


    .vt-hero p,
    .doctor-hero p,
    .patient-hero p,
    .admin-hero p {
        display: none;
    }
}


/* =========================================================
   V75 — ACCESSIBILITY / KEYBOARD INTERACTION
========================================================= */

.vt-sr-only {
    position: absolute !important;

    width: 1px !important;
    height: 1px !important;

    padding: 0 !important;
    margin: -1px !important;

    overflow: hidden !important;

    clip: rect(0, 0, 0, 0) !important;
    clip-path: inset(50%) !important;

    border: 0 !important;

    white-space: nowrap !important;
}


.vt-skip-link {
    position: fixed;

    left:
        max(
            10px,
            env(safe-area-inset-left)
        );

    top:
        max(
            10px,
            env(safe-area-inset-top)
        );

    z-index: 100000;

    padding:
        10px
        14px;

    border:
        2px solid
        #ffffff;

    border-radius: 10px;

    color: #ffffff;
    background: #10284f;

    box-shadow:
        0 8px 24px
        rgba(0,0,0,.25);

    font-size: 12px;
    font-weight: 900;

    text-decoration: none;

    transform:
        translateY(
            calc(
                -100%
                - 30px
            )
        );

    transition:
        transform
        .14s
        ease;
}


.vt-skip-link:focus {
    transform:
        translateY(0);

    outline:
        3px solid
        #8fe7df;

    outline-offset:
        3px;
}


:focus-visible {
    outline:
        3px solid
        #2d5fd2;

    outline-offset:
        3px;
}


.vt-btn:focus-visible,
.vt-logout:focus-visible,
.vt-sidebar-toggle:focus-visible,
.vt-nav-link:focus-visible,
.vt-input:focus-visible,
.vt-select:focus-visible,
.vt-textarea:focus-visible,
.vt-modal-card:focus-visible,
.therapy-modal-panel:focus-visible {
    outline:
        3px solid
        #2d5fd2;

    outline-offset:
        3px;
}


.vt-nav-link[aria-current="page"] {
    position: relative;
}


.vt-nav-link[aria-current="page"]::after {
    content: "";

    position: absolute;

    right: 9px;
    top: 50%;

    width: 6px;
    height: 6px;

    border-radius: 50%;

    background:
        currentColor;

    transform:
        translateY(-50%);
}


[aria-busy="true"] {
    cursor: progress;
}


button[disabled],
[aria-disabled="true"] {
    cursor: not-allowed;
}


/* Improve text contrast for small informational copy. */
.vt-muted,
.vt-help,
.vt-metric-note,
.vt-topbar-subtitle,
.vt-state-message {
    color: #5f6d80;
}


@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;

        animation-duration:
            .01ms !important;

        animation-iteration-count:
            1 !important;

        transition-duration:
            .01ms !important;
    }
}


@media (forced-colors: active) {

    .vt-btn,
    .vt-input,
    .vt-select,
    .vt-textarea,
    .vt-panel,
    .vt-metric,
    .vt-therapy-card-v71,
    .vt-modal-card,
    .therapy-modal-panel,
    .vt-state {
        border:
            1px solid
            CanvasText;
    }


    .vt-pill,
    .vt-therapy-status-pill,
    .progress-status {
        border:
            1px solid
            CanvasText;
    }


    .vt-state-spinner {
        border-color:
            CanvasText;

        border-top-color:
            Highlight;
    }
}


/* =========================================================
   V77 — FINAL PRODUCT POLISH
========================================================= */

/* ---------- Button loading ---------- */

.vt-btn-loading {
    position: relative;

    pointer-events: none;
}


.vt-btn-spinner {
    width: 14px;
    height: 14px;

    display: inline-block;

    flex: 0 0 14px;

    border:
        2px solid
        currentColor;

    border-right-color:
        transparent;

    border-radius: 50%;

    opacity: .86;

    animation:
        vt-btn-spin
        .72s
        linear
        infinite;
}


@keyframes vt-btn-spin {
    to {
        transform:
            rotate(360deg);
    }
}


/* ---------- Tooltips ---------- */

.vt-tooltip {
    position: fixed;
    z-index: 100001;

    left: 0;
    top: 0;

    max-width: 230px;

    padding:
        6px
        8px;

    border:
        1px solid
        rgba(255,255,255,.12);

    border-radius: 8px;

    color: #ffffff;
    background: #152945;

    box-shadow:
        0 8px 24px
        rgba(10, 26, 48, .22);

    font-size: 9px;
    font-weight: 700;
    line-height: 1.35;

    opacity: 0;

    pointer-events: none;

    transform:
        translateY(2px);

    transition:
        opacity .12s ease,
        transform .12s ease;
}


.vt-tooltip.visible {
    opacity: 1;

    transform:
        translateY(0);
}


/* ---------- Account chip ---------- */

.vt-topbar-actions {
    display: flex;
    align-items: center;

    gap: 8px;

    flex: 0 0 auto;
}


.vt-account-chip {
    min-width: 0;

    padding:
        6px
        9px
        6px
        6px;

    display: flex;
    align-items: center;

    gap: 8px;

    border:
        1px solid
        var(--vt-line);

    border-radius: 12px;

    background:
        rgba(255,255,255,.78);

    box-shadow:
        0 4px 16px
        rgba(20,42,82,.035);

    backdrop-filter:
        blur(8px);
}


.vt-account-avatar {
    width: 32px;
    height: 32px;

    display: grid;
    place-items: center;

    flex: 0 0 32px;

    border-radius: 9px;

    color: var(--vt-primary);
    background: var(--vt-primary-soft);

    font-size: 16px;
}


.vt-account-copy {
    min-width: 0;

    display: flex;
    flex-direction: column;

    gap: 1px;
}


.vt-account-role {
    color: var(--vt-muted-light);

    font-size: 7px;
    font-weight: 900;

    letter-spacing: .07em;
    text-transform: uppercase;
}


.vt-account-name {
    max-width: 150px;

    overflow: hidden;

    color: var(--vt-text-soft);

    font-size: 9px;
    font-weight: 800;

    text-overflow: ellipsis;
    white-space: nowrap;
}


/* ---------- Product footer ---------- */

.vt-product-footer {
    min-height: 42px;

    margin-top: 13px;

    padding:
        8px
        2px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 12px;

    color: var(--vt-muted-light);

    font-size: 8px;
}


.vt-product-footer-brand {
    display: inline-flex;
    align-items: center;

    gap: 5px;

    font-weight: 800;
}


.vt-product-footer-brand .vt-icon {
    color: var(--vt-primary);

    font-size: 13px;
}


.vt-product-version {
    padding:
        4px
        7px;

    border:
        1px solid
        var(--vt-line);

    border-radius: 999px;

    background: rgba(255,255,255,.66);

    font-weight: 800;

    letter-spacing: .03em;
}


/* ---------- Micro-interactions ---------- */

.vt-btn,
.vt-logout,
.vt-nav-link,
.vt-account-chip,
.vt-metric,
.vt-panel,
.vt-therapy-card-v71 {
    transition:
        transform .14s ease,
        box-shadow .14s ease,
        border-color .14s ease,
        background-color .14s ease,
        color .14s ease;
}


.vt-btn:not(:disabled):active,
.vt-logout:not(:disabled):active {
    transform:
        translateY(1px)
        scale(.99);
}


.vt-btn:not(:disabled):hover {
    box-shadow:
        0 7px 18px
        rgba(20,42,82,.09);
}


.vt-account-chip:hover {
    border-color:
        #ccd7e6;

    box-shadow:
        0 7px 20px
        rgba(20,42,82,.055);
}


/* ---------- Gentle page entry ---------- */

.vt-main,
.portal-card,
.therapy-panel {
    animation:
        vt-page-enter
        .18s
        ease-out
        both;
}


@keyframes vt-page-enter {
    from {
        opacity: .72;

        transform:
            translateY(3px);
    }

    to {
        opacity: 1;

        transform:
            none;
    }
}


/* ---------- Mobile account/footer polish ---------- */

@media (max-width: 620px) {

    .vt-topbar-actions {
        gap: 6px;
    }


    .vt-account-chip {
        max-width: 122px;

        padding:
            5px
            7px
            5px
            5px;

        gap: 6px;
    }


    .vt-account-avatar {
        width: 30px;
        height: 30px;

        flex-basis: 30px;

        font-size: 15px;
    }


    .vt-account-role {
        display: none;
    }


    .vt-account-name {
        max-width: 72px;

        font-size: 8px;
    }


    .vt-product-footer {
        min-height: 36px;

        margin-top: 8px;

        padding:
            7px
            1px;
    }


    .vt-product-footer > span:first-child {
        min-width: 0;

        overflow: hidden;

        text-overflow: ellipsis;
        white-space: nowrap;
    }
}


@media (max-width: 390px) {

    .vt-account-chip {
        max-width: 42px;

        padding: 5px;
    }


    .vt-account-copy {
        display: none;
    }


    .vt-product-footer {
        font-size: 7px;
    }
}


@media (prefers-reduced-motion: reduce) {

    .vt-btn-spinner {
        animation-duration:
            1.25s;
    }


    .vt-main,
    .portal-card,
    .therapy-panel {
        animation: none;
    }


    .vt-tooltip {
        transition: none;
    }
}
