:root {
    --sidebar-width: 238px;
    --hc-bg: #f4f7f9;
    --hc-surface: #ffffff;
    --hc-surface-strong: #ffffff;
    --hc-ink: #102033;
    --hc-muted: #64748b;
    --hc-line: #e2e8f0;
    --hc-primary: #0f766e;
    --hc-secondary: #2563eb;
    --hc-accent: #f26a4f;
    --hc-violet: #7c3aed;
    --hc-danger: #d73562;
    --hc-sidebar: #102a2d;
    --hc-sidebar-2: #12383a;
    --hc-sky: #e7f6ff;
    --hc-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 6px 18px rgba(15, 23, 42, .045);
    --hc-radius: 10px;
}

[data-bs-theme="dark"] {
    --hc-bg: #0b1623;
    --hc-surface: rgba(19, 34, 52, .88);
    --hc-surface-strong: #142237;
    --hc-ink: #f7fbff;
    --hc-muted: #b7c6d8;
    --hc-line: rgba(255, 255, 255, .12);
    --hc-sidebar: #07180f;
    --hc-sidebar-2: #064b45;
    --hc-shadow: 0 20px 44px rgba(0, 0, 0, .32);
}

body {
    width: 100%;
    min-height: 100vh;
    overflow-x: hidden;
    background: var(--hc-bg);
    color: var(--hc-ink);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

[data-bs-theme="dark"] body {
    background:
        linear-gradient(135deg, rgba(0, 167, 167, .18) 0%, transparent 34%),
        linear-gradient(215deg, rgba(242, 106, 79, .12) 0%, transparent 32%),
        linear-gradient(45deg, rgba(124, 58, 237, .16) 0%, transparent 26%),
        repeating-linear-gradient(90deg, rgba(255, 255, 255, .035) 0 1px, transparent 1px 78px),
        linear-gradient(135deg, #0b1623 0%, #10283e 50%, #0b3135 100%);
}

a { text-decoration: none; }

.app-shell {
    display: block;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    height: 100vh;
    height: 100dvh;
    padding: .7rem .65rem;
    background:
        radial-gradient(circle at 15% 8%, rgba(94, 234, 212, .14), transparent 28%),
        radial-gradient(circle at 100% 82%, rgba(37, 99, 235, .12), transparent 34%),
        linear-gradient(180deg, var(--hc-sidebar), var(--hc-sidebar-2));
    color: #fff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 1040;
    isolation: isolate;
    box-shadow: 8px 0 28px rgba(7, 31, 33, .12);
}

.sidebar::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: linear-gradient(90deg, rgba(255, 255, 255, .025), transparent 35%); }

.brand {
    display: flex;
    gap: .75rem;
    align-items: center;
    color: #fff;
    min-height: 58px;
    padding: .55rem .6rem;
    border: 1px solid rgba(255, 255, 255, .09);
    border-radius: 10px;
    background: rgba(255, 255, 255, .055);
    box-shadow: inset 0 1px rgba(255, 255, 255, .05);
}

.brand-logo {
    width: 34px;
    height: 34px;
    display: block;
    object-fit: contain;
}

.brand-logo-lg {
    width: 54px;
    height: 54px;
}

.brand-mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, .1));
    color: #d4fff9;
    backdrop-filter: blur(12px);
}

.brand-mark-logo,
.brand-mark-light {
    background: #fff;
    color: var(--hc-primary);
    box-shadow: 0 12px 28px rgba(7, 24, 15, .18);
}

.brand small,
.user-chip small,
.topbar-kicker {
    display: block;
    font-size: .75rem;
    color: var(--hc-muted);
}

.brand small { color: rgba(255, 255, 255, .78); }
.brand strong { display: block; max-width: 145px; overflow: hidden; font-size: .9rem; text-overflow: ellipsis; white-space: nowrap; }

.sidebar-nav {
    display: grid;
    align-content: start;
    gap: .72rem;
    margin-top: .65rem;
    overflow-y: auto;
    padding: .05rem .2rem .55rem 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, .18) transparent;
}

.sidebar-nav-section { display: grid; gap: .18rem; }
.sidebar-nav-label { padding: 0 .62rem .18rem; color: rgba(207, 250, 245, .48); font-size: .58rem; font-weight: 800; letter-spacing: .105em; text-transform: uppercase; }

.sidebar-nav a {
    position: relative;
    display: flex;
    align-items: center;
    gap: .58rem;
    color: rgba(255, 255, 255, .88);
    min-height: 38px;
    padding: .38rem .48rem;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: .2s ease;
}

.sidebar-nav a:hover {
    background: rgba(255, 255, 255, .08);
    border-color: rgba(255, 255, 255, .08);
    color: #fff;
    transform: translateX(2px);
}

.sidebar-nav a.active {
    color: #fff;
    background: linear-gradient(90deg, rgba(94, 234, 212, .2), rgba(255, 255, 255, .095));
    border-color: rgba(153, 246, 228, .2);
    box-shadow: inset 3px 0 #5eead4, 0 4px 14px rgba(0, 0, 0, .08);
}

.sidebar-nav-icon { display: grid; place-items: center; width: 28px !important; height: 28px; flex: 0 0 28px !important; border-radius: 7px; color: #bffaf1; background: rgba(255, 255, 255, .065); font-size: .9rem !important; }
.sidebar-nav-icon { position: relative; border: 1px solid rgba(255, 255, 255, .13); box-shadow: inset 0 1px rgba(255, 255, 255, .18), 0 3px 8px rgba(0, 0, 0, .13); text-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
.sidebar-nav-icon.icon-tone-cyan { color: #a5f3fc; background: linear-gradient(145deg, rgba(8, 145, 178, .42), rgba(14, 116, 144, .18)); }
.sidebar-nav-icon.icon-tone-blue { color: #bfdbfe; background: linear-gradient(145deg, rgba(37, 99, 235, .48), rgba(30, 64, 175, .18)); }
.sidebar-nav-icon.icon-tone-violet { color: #ddd6fe; background: linear-gradient(145deg, rgba(124, 58, 237, .5), rgba(91, 33, 182, .18)); }
.sidebar-nav-icon.icon-tone-rose { color: #fecdd3; background: linear-gradient(145deg, rgba(225, 29, 72, .5), rgba(159, 18, 57, .18)); }
.sidebar-nav-icon.icon-tone-indigo { color: #c7d2fe; background: linear-gradient(145deg, rgba(79, 70, 229, .5), rgba(55, 48, 163, .18)); }
.sidebar-nav-icon.icon-tone-red { color: #fecaca; background: linear-gradient(145deg, rgba(220, 38, 38, .5), rgba(153, 27, 27, .18)); }
.sidebar-nav-icon.icon-tone-amber { color: #fde68a; background: linear-gradient(145deg, rgba(217, 119, 6, .5), rgba(146, 64, 14, .18)); }
.sidebar-nav-icon.icon-tone-teal { color: #99f6e4; background: linear-gradient(145deg, rgba(13, 148, 136, .5), rgba(15, 118, 110, .18)); }
.sidebar-nav-icon.icon-tone-emerald { color: #a7f3d0; background: linear-gradient(145deg, rgba(5, 150, 105, .5), rgba(4, 120, 87, .18)); }
.sidebar-nav-icon.icon-tone-orange { color: #fed7aa; background: linear-gradient(145deg, rgba(234, 88, 12, .5), rgba(154, 52, 18, .18)); }
.sidebar-nav-icon.icon-tone-slate { color: #e2e8f0; background: linear-gradient(145deg, rgba(100, 116, 139, .52), rgba(51, 65, 85, .2)); }
.sidebar-nav a.active .sidebar-nav-icon { color: #fff; filter: brightness(1.18) saturate(1.08); box-shadow: inset 0 1px rgba(255, 255, 255, .28), 0 4px 11px rgba(0, 0, 0, .18); }
.sidebar-active-arrow { width: auto !important; margin-left: auto; color: #99f6e4 !important; font-size: .66rem !important; }

.sidebar-account { display: grid; grid-template-columns: 34px minmax(0, 1fr) 32px; align-items: center; gap: .5rem; margin-top: auto; padding: .55rem; border: 1px solid rgba(255, 255, 255, .1); border-radius: 9px; background: rgba(5, 23, 25, .24); }
.sidebar-account-avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; color: #d5fff8; background: linear-gradient(135deg, rgba(94, 234, 212, .26), rgba(37, 99, 235, .22)); font-size: .7rem; font-weight: 800; }
.sidebar-account-copy { min-width: 0; }
.sidebar-account-copy strong,
.sidebar-account-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-account-copy strong { color: #fff; font-size: .72rem; }
.sidebar-account-copy small { color: rgba(255, 255, 255, .58); font-size: .61rem; }
.sidebar-logout { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 7px; color: #fecdd3; background: rgba(225, 29, 72, .09); transition: .2s ease; }
.sidebar-logout:hover { color: #fff; background: rgba(225, 29, 72, .25); }

.sidebar-backdrop {
    display: none;
}

.app-main {
    width: calc(100% - var(--sidebar-width));
    min-height: 100vh;
    min-height: 100dvh;
    margin-left: var(--sidebar-width);
    padding: 1rem 1.25rem 1.5rem;
    overflow-x: hidden;
    min-width: 0;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 52px;
    margin-bottom: .85rem;
    padding-bottom: .75rem;
    border-bottom: 1px solid var(--hc-line);
    min-width: 0;
}

.topbar h1 {
    margin: 0;
    font-size: clamp(1.15rem, 1.6vw, 1.45rem);
    font-weight: 700;
    letter-spacing: 0;
    color: #102a43;
}

[data-bs-theme="dark"] .topbar h1 {
    color: var(--hc-ink);
}

.topbar-actions {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    gap: .6rem;
}

.btn-icon {
    width: 36px;
    height: 36px;
    display: inline-grid;
    place-items: center;
    border-radius: 8px;
    border: 1px solid var(--hc-line);
    background: var(--hc-surface);
    color: var(--hc-ink);
    box-shadow: none;
}

.user-chip,
.glass-card,
.table-panel,
.form-panel {
    background: var(--hc-surface);
    border: 1px solid var(--hc-line);
    box-shadow: var(--hc-shadow);
    border-radius: var(--hc-radius);
}

.user-chip {
    padding: .38rem .7rem;
    line-height: 1.1;
}

.glass-card {
    padding: .9rem;
    min-height: 96px;
    transition: transform .18s ease, box-shadow .18s ease;
}

.glass-card:hover {
    transform: translateY(-1px);
}

.metric {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.metric .icon {
    position: relative;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    flex: 0 0 42px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .32);
    border-radius: 11px;
    color: #fff;
    background: linear-gradient(135deg, var(--hc-primary), #38bdf8);
    box-shadow: inset 0 1px rgba(255, 255, 255, .34), 0 7px 15px rgba(15, 118, 110, .18);
}

.metric .icon::after {
    content: "";
    position: absolute;
    inset: 1px 1px 48% 1px;
    border-radius: 9px 9px 50% 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, .25), transparent);
}

.metric .icon .bi { position: relative; z-index: 1; font-size: 1.15rem; text-shadow: 0 2px 3px rgba(0, 0, 0, .2); }

.row > [class*="col"]:nth-child(3n+2) .metric .icon {
    background: linear-gradient(135deg, var(--hc-secondary), var(--hc-violet));
    box-shadow: inset 0 1px rgba(255, 255, 255, .34), 0 7px 15px rgba(79, 70, 229, .18);
}

.row > [class*="col"]:nth-child(3n+3) .metric .icon {
    background: linear-gradient(135deg, var(--hc-accent), #f59e0b);
    box-shadow: inset 0 1px rgba(255, 255, 255, .34), 0 7px 15px rgba(234, 88, 12, .18);
}

.metric strong {
    margin-top: .2rem;
    font-size: 1.35rem;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: 0;
}

.form-panel,
.table-panel {
    padding: .9rem;
    max-width: 100%;
    overflow: hidden;
}

.dashboard-quick-actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.table-panel .table-responsive,
.form-panel .table-responsive {
    max-width: 100%;
}

.section-title {
    display: flex;
    align-items: center;
    gap: .55rem;
    font-size: .94rem;
    font-weight: 700;
    margin-bottom: .75rem;
}

.section-title .ms-auto {
    text-align: right;
}

.section-title > .bi {
    width: 1.7rem;
    height: 1.7rem;
    min-width: 1.7rem;
    display: inline-grid;
    place-items: center;
    border: 1px solid rgba(15, 118, 110, .18);
    border-radius: 8px;
    color: #fff;
    background: linear-gradient(135deg, var(--hc-primary), var(--hc-secondary));
    box-shadow: inset 0 1px rgba(255, 255, 255, .32), 0 4px 9px rgba(15, 118, 110, .14);
    font-size: .82rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .18);
}

.service-check > .bi {
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    border-radius: 8px;
    color: #fff;
    background: linear-gradient(145deg, var(--hc-primary), #0891b2);
    box-shadow: inset 0 1px rgba(255, 255, 255, .3), 0 4px 9px rgba(15, 118, 110, .14);
}

.btn > .bi { vertical-align: -.08em; text-shadow: 0 1px 1px rgba(15, 23, 42, .1); }
.btn-primary > .bi, .btn-success > .bi, .btn-danger > .bi, .btn-warning > .bi { text-shadow: 0 1px 2px rgba(0, 0, 0, .2); }

.section-title > .brand-logo {
    width: 1.8rem;
    height: 1.8rem;
}

.required-dot::after {
    content: "*";
    color: var(--hc-danger);
    margin-left: .2rem;
}

.service-check {
    display: flex;
    align-items: center;
    gap: .65rem;
    height: 100%;
    padding: .85rem;
    border: 1px solid var(--hc-line);
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(255, 255, 255, .78), rgba(231, 246, 255, .64));
    cursor: pointer;
    transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

[data-bs-theme="dark"] .service-check {
    background: rgba(255, 255, 255, .04);
}

.service-check:hover {
    border-color: rgba(0, 167, 167, .38);
    transform: translateY(-1px);
}

.service-check:has(input:checked) {
    border-color: rgba(0, 167, 167, .62);
    background: linear-gradient(135deg, rgba(0, 167, 167, .13), rgba(49, 87, 215, .1));
}

.service-check input {
    flex: 0 0 auto;
    accent-color: var(--hc-primary);
    margin: 0;
}

.service-check i {
    width: 1.45rem;
    height: 1.45rem;
    min-width: 1.45rem;
    color: var(--hc-primary);
}

.status-pill {
    border-radius: 999px;
    padding: .35rem .58rem;
}

.table {
    --bs-table-bg: transparent;
}

.table td,
.table th {
    vertical-align: middle;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(34px, 1fr));
    gap: .35rem;
}

.calendar-cell {
    min-height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid var(--hc-line);
    border-radius: 8px;
    background: rgba(255, 255, 255, .36);
    font-weight: 700;
}

.calendar-cell.today {
    color: #fff;
    background: linear-gradient(135deg, var(--hc-primary), var(--hc-accent));
}

.notification-dot {
    position: absolute;
    top: 9px;
    right: 9px;
    width: 8px;
    height: 8px;
    border-radius: 99px;
    background: var(--hc-accent);
    box-shadow: 0 0 0 4px rgba(242, 106, 79, .18);
}

.login-page {
    position: relative;
    isolation: isolate;
    display: grid;
    place-items: center;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    padding: clamp(1rem, 3vw, 2.5rem);
    background:
        radial-gradient(circle at 8% 8%, rgba(45, 212, 191, .2), transparent 28%),
        radial-gradient(circle at 92% 88%, rgba(59, 130, 246, .17), transparent 31%),
        linear-gradient(135deg, #ecfdf9 0%, #f7fbff 47%, #eef4ff 100%);
}

.login-page::before,
.login-page::after {
    content: "";
    position: fixed;
    z-index: -1;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(2px);
}

.login-page::before {
    top: -150px;
    right: -100px;
    width: 420px;
    height: 420px;
    border: 1px solid rgba(37, 99, 235, .1);
    box-shadow: inset 0 0 0 55px rgba(255, 255, 255, .2), inset 0 0 0 110px rgba(37, 99, 235, .025);
}

.login-page::after {
    left: -110px;
    bottom: -180px;
    width: 390px;
    height: 390px;
    background: rgba(15, 118, 110, .055);
    box-shadow: 0 0 0 48px rgba(15, 118, 110, .025);
}

.login-shell {
    position: relative;
    z-index: 1;
    width: min(100%, 1080px);
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(380px, .88fr);
    align-items: stretch;
    gap: 0;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, .86);
    border-radius: 24px;
    background: rgba(255, 255, 255, .72);
    box-shadow: 0 30px 80px rgba(15, 42, 54, .14), 0 8px 24px rgba(15, 42, 54, .07);
    backdrop-filter: blur(18px);
}

.login-card {
    width: 100%;
    min-height: auto;
    align-self: center;
    padding: clamp(1.75rem, 4vw, 3.25rem);
    border: 0;
    background: transparent;
    box-shadow: none;
}

.login-visual {
    position: relative;
    min-height: 625px;
    overflow: hidden;
    border-radius: 18px;
    box-shadow: 0 14px 34px rgba(7, 52, 50, .18);
    background: #dff5f1;
}

.login-visual img:not(.brand-logo) {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: 50% center;
}

.login-visual::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(4, 47, 46, .04), transparent 38%, rgba(4, 31, 34, .86) 100%);
    pointer-events: none;
}

.login-visual-shade {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(90deg, rgba(15, 118, 110, .08), transparent 45%);
    pointer-events: none;
}

.login-visual-copy {
    position: absolute;
    left: 1.5rem;
    right: 1.5rem;
    bottom: 1.45rem;
    z-index: 2;
    display: grid;
    gap: .85rem;
    color: #fff;
}

.login-care-badge {
    justify-self: start;
    display: inline-flex;
    align-items: center;
    gap: .42rem;
    padding: .38rem .68rem;
    border: 1px solid rgba(255, 255, 255, .24);
    border-radius: 99px;
    color: rgba(255, 255, 255, .94);
    background: rgba(255, 255, 255, .12);
    font-size: .7rem;
    font-weight: 650;
    backdrop-filter: blur(12px);
}

.login-care-badge .bi { color: #99f6e4; }
.login-visual-brand { display: flex; align-items: center; gap: .85rem; }
.login-visual-logo { display: grid; place-items: center; width: 50px; height: 50px; flex: 0 0 50px; overflow: hidden; border-radius: 13px; background: #fff; box-shadow: 0 8px 22px rgba(0, 0, 0, .22); }
.login-visual-logo .brand-logo-lg { width: 42px; height: 42px; }

.login-visual-copy strong,
.login-visual-copy span {
    display: block;
}

.login-visual-copy strong {
    font-size: 1.15rem;
    line-height: 1.1;
}

.login-visual-copy span {
    color: rgba(255, 255, 255, .82);
    font-size: .88rem;
}

.login-visual-copy .login-care-badge { display: inline-flex; font-size: .7rem; }
.login-visual-copy .login-visual-logo { display: grid; }

.login-card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 2rem; }
.login-card-logo { width: 50px; height: 50px; border: 1px solid rgba(15, 118, 110, .12); border-radius: 13px; box-shadow: 0 8px 20px rgba(15, 118, 110, .12); }
.login-security-pill { display: inline-flex; align-items: center; gap: .38rem; padding: .36rem .62rem; border: 1px solid rgba(15, 118, 110, .14); border-radius: 99px; color: var(--hc-primary); background: rgba(204, 251, 241, .48); font-size: .68rem; font-weight: 700; }
.login-security-pill .bi { font-size: .82rem; }
.login-welcome { margin-bottom: 1.55rem; }
.login-eyebrow { display: block; margin-bottom: .35rem; color: var(--hc-primary); font-size: .68rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.login-welcome h1 { margin: 0 0 .45rem; color: #102a43; font-size: clamp(1.7rem, 3vw, 2.15rem); font-weight: 780; letter-spacing: -.035em; }
.login-welcome p { max-width: 355px; margin: 0; color: var(--hc-muted); font-size: .86rem; line-height: 1.6; }
.login-form { gap: 1rem !important; }
.login-form .form-label { margin-bottom: .42rem; font-size: .78rem; }
.login-input-wrap { position: relative; }
.login-input-wrap > .bi { position: absolute; top: 50%; left: .9rem; z-index: 2; color: #78909c; font-size: .9rem; transform: translateY(-50%); pointer-events: none; }
.login-input-wrap .form-control { min-height: 48px; padding-left: 2.75rem; border-color: #dbe6eb; border-radius: 10px; background: rgba(248, 250, 252, .78); font-size: .84rem; box-shadow: inset 0 1px 2px rgba(15, 23, 42, .025); }
.login-input-wrap .form-control::placeholder { color: #9aa9b5; }
.login-input-wrap:focus-within > .bi { color: var(--hc-primary); }
.login-input-wrap .form-control:focus { border-color: rgba(15, 118, 110, .52); background: #fff; box-shadow: 0 0 0 4px rgba(15, 118, 110, .09); }
.login-submit { min-height: 49px; margin-top: .25rem; display: flex; align-items: center; justify-content: space-between; padding-inline: 1.15rem; border: 0; border-radius: 10px; background: linear-gradient(135deg, #0f766e, #0d9488); box-shadow: 0 10px 22px rgba(15, 118, 110, .2); font-size: .86rem; font-weight: 700; }
.login-submit:hover { background: linear-gradient(135deg, #0b655f, #0f766e); transform: translateY(-1px); box-shadow: 0 13px 26px rgba(15, 118, 110, .25); }
.login-submit .bi { font-size: .9rem; transition: transform .18s ease; }
.login-submit:hover .bi { transform: translateX(3px); }
.login-patient-link { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-top: 1.35rem; padding-top: 1.1rem; border-top: 1px solid var(--hc-line); }
.login-patient-link > span { display: flex; align-items: center; gap: .45rem; color: var(--hc-muted); }
.login-patient-link > span .bi { color: var(--hc-primary); }
.login-patient-link small { font-size: .72rem; }
.login-patient-link a { display: inline-flex; align-items: center; gap: .2rem; color: var(--hc-primary); font-size: .73rem; font-weight: 700; }
.login-patient-link a:hover { color: #0b5f59; }
.login-patient-link a .bi { width: .9em; min-width: .9em; font-size: .76rem; }

.setup-logo-preview {
    width: 100%;
    min-height: 178px;
    display: grid;
    place-items: center;
    border: 1px dashed rgba(0, 167, 167, .42);
    border-radius: var(--hc-radius);
    background: linear-gradient(135deg, rgba(255, 255, 255, .82), rgba(231, 246, 255, .68));
}

.database-tool-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: .9rem;
    border: 1px solid var(--hc-line);
    border-radius: 8px;
    background: color-mix(in srgb, var(--hc-surface) 94%, var(--hc-primary));
}

[data-bs-theme="dark"] .setup-logo-preview {
    background: rgba(255, 255, 255, .04);
}

.setup-logo-preview img {
    max-width: min(76%, 220px);
    max-height: 130px;
    object-fit: contain;
}

.print-actions {
    position: sticky;
    top: 1rem;
    z-index: 3;
}

.print-actions .btn {
    border-radius: 8px;
    font-weight: 700;
}

.rx-paper,
.invoice-paper,
.report-paper {
    background: #fff;
    color: #111827;
    border-radius: 8px;
    border: 1px solid rgba(15, 23, 42, .08);
    padding: clamp(1.1rem, 3vw, 2.35rem);
    box-shadow: var(--hc-shadow);
    position: relative;
    overflow: hidden;
    max-width: 1120px;
    margin-inline: auto;
}

.rx-paper::before,
.invoice-paper::before,
.report-paper::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 8px;
    background: linear-gradient(90deg, var(--hc-primary), var(--hc-secondary) 52%, var(--hc-accent));
}

.document-head {
    display: flex;
    justify-content: space-between;
    gap: 1.25rem;
    align-items: flex-start;
    padding-bottom: 1.25rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid #d9e4ea;
}

.invoice-pro-head {
    display: flex;
    justify-content: space-between;
    gap: 1.25rem;
    align-items: flex-start;
    padding: .25rem 0 1.35rem;
    margin-bottom: 1.25rem;
    border-bottom: 2px solid #102033;
}

.invoice-pro-brand {
    display: flex;
    gap: 1rem;
    min-width: 0;
}

.invoice-pro-logo {
    width: 68px;
    height: 68px;
    min-width: 68px;
    display: grid;
    place-items: center;
    border: 1px solid #d9e4ea;
    border-radius: 8px;
    background: #ffffff;
}

.invoice-pro-logo .brand-logo {
    width: 46px;
    height: 46px;
}

.invoice-pro-org h2 {
    margin: .1rem 0 .15rem;
    color: #102033;
    font-size: clamp(1.35rem, 2vw, 1.9rem);
    font-weight: 900;
    line-height: 1.08;
}

.invoice-pro-org p {
    margin: 0 0 .35rem;
    color: #627186;
}

.invoice-contact-lines {
    display: grid;
    gap: .12rem;
    color: #48576b;
    font-size: .88rem;
}

.invoice-pro-title {
    display: grid;
    justify-items: end;
    gap: .5rem;
    min-width: 220px;
    text-align: right;
}

.invoice-pro-title strong {
    color: #102033;
    font-size: 1.35rem;
    line-height: 1.1;
    overflow-wrap: anywhere;
}

.invoice-pro-label {
    color: #64748b;
    font-size: .72rem;
    font-weight: 850;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.invoice-pro-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr);
    gap: 1rem;
    margin-bottom: 1.3rem;
}

.invoice-party-card,
.invoice-detail-card,
.invoice-terms {
    border: 1px solid #d9e4ea;
    border-radius: 8px;
    background: #fbfdff;
}

.invoice-party-card {
    padding: 1rem;
}

.invoice-party-card h3 {
    margin: .25rem 0 .75rem;
    color: #102033;
    font-size: 1.2rem;
    font-weight: 850;
}

.invoice-party-card dl,
.invoice-party-card dd {
    margin: 0;
}

.invoice-party-card dl {
    display: grid;
    gap: .45rem;
}

.invoice-party-card dl div {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr);
    gap: .75rem;
}

.invoice-party-card dt {
    color: #64748b;
    font-size: .74rem;
    font-weight: 850;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.invoice-party-card dd {
    color: #111827;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.invoice-detail-card {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: hidden;
}

.invoice-detail-card > div {
    padding: .85rem .95rem;
    border-right: 1px solid #d9e4ea;
    border-bottom: 1px solid #d9e4ea;
}

.invoice-detail-card > div:nth-child(2n) {
    border-right: 0;
}

.invoice-detail-card > div:nth-last-child(-n+2) {
    border-bottom: 0;
}

.invoice-detail-card span {
    display: block;
    color: #64748b;
    font-size: .72rem;
    font-weight: 850;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.invoice-detail-card strong {
    display: block;
    margin-top: .22rem;
    color: #111827;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.document-brand {
    display: flex;
    gap: .9rem;
    align-items: flex-start;
    min-width: 0;
}

.document-logo-frame {
    width: 58px;
    height: 58px;
    min-width: 58px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    border: 1px solid #d9e4ea;
    background: linear-gradient(135deg, #ffffff, #eefafa);
}

.document-logo-frame .brand-logo {
    width: 40px;
    height: 40px;
}

.document-kicker {
    display: block;
    color: #607086;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.document-title {
    margin: .1rem 0 .2rem;
    font-size: clamp(1.25rem, 2vw, 1.75rem);
    font-weight: 850;
    line-height: 1.12;
    color: #102033;
}

.document-contact {
    display: grid;
    gap: .12rem;
    max-width: 620px;
    color: #627186;
    font-size: .86rem;
}

.document-meta {
    display: grid;
    gap: .55rem;
    min-width: 210px;
    text-align: right;
}

.document-meta-card {
    border: 1px solid #d9e4ea;
    border-radius: 8px;
    padding: .65rem .75rem;
    background: #f7fbfd;
}

.document-meta-label,
.info-label,
.total-label {
    display: block;
    color: #64748b;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.document-meta-value,
.info-value {
    display: block;
    color: #111827;
    font-weight: 800;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.document-status {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 32px;
    padding: .38rem .72rem;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.document-status.is-paid,
.document-status.is-complete {
    color: #047857;
    background: #dcfce7;
}

.document-status.is-due,
.document-status.is-pending {
    color: #a44b11;
    background: #ffedd5;
}

.document-info-grid,
.record-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: .75rem;
    margin-bottom: 1.25rem;
}

.record-detail-grid.mb-0 {
    margin-bottom: 0;
}

.info-box {
    min-height: 74px;
    padding: .75rem .85rem;
    border: 1px solid #d9e4ea;
    border-radius: 8px;
    background: #fbfdff;
}

.info-box-wide {
    grid-column: span 2;
}

.document-section {
    margin-top: 1.25rem;
}

.document-section-title {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin: 0 0 .75rem;
    color: #102033;
    font-size: .98rem;
    font-weight: 850;
}

.document-section-title i {
    color: var(--hc-primary);
}

.document-note {
    min-height: 76px;
    padding: .9rem 1rem;
    border: 1px solid #d9e4ea;
    border-left: 4px solid var(--hc-primary);
    border-radius: 8px;
    background: #fbfdff;
}

.document-note p,
.report-section p {
    margin-bottom: 0;
    white-space: normal;
    overflow-wrap: anywhere;
}

.document-table {
    overflow: hidden;
    border: 1px solid #d9e4ea;
    border-radius: 8px;
    background: #fff;
}

.document-table .table {
    margin-bottom: 0;
}

.document-table .table > :not(caption) > * > * {
    padding: .78rem .9rem;
    border-color: #e5edf2;
}

.document-table thead th,
.document-table tbody th {
    color: #334155;
    background: #f1f7fb;
    font-size: .76rem;
    font-weight: 850;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.invoice-summary {
    width: min(100%, 420px);
    margin-left: auto;
    border: 1px solid #d9e4ea;
    border-radius: 8px;
    overflow: hidden;
    align-self: start;
}

.invoice-total-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: .65rem .85rem;
    border-bottom: 1px solid #e5edf2;
    background: #fff;
}

.invoice-total-row:last-child {
    border-bottom: 0;
}

.invoice-total-row.grand {
    color: #0f766e;
    background: #e6f8f5;
    font-size: 1.08rem;
    font-weight: 850;
}

.invoice-total-row.balance-due {
    color: #b42318;
    background: #fff7ed;
    font-weight: 850;
}

.invoice-total-row.balance-clear {
    color: #047857;
    background: #f0fdf4;
    font-weight: 850;
}

.total-value {
    font-weight: 850;
    white-space: nowrap;
}

.invoice-line-table td,
.invoice-line-table th {
    white-space: nowrap;
}

.invoice-line-table td:nth-child(2),
.invoice-line-table th:nth-child(2) {
    white-space: normal;
}

.invoice-item-no {
    color: #64748b;
    font-weight: 850;
}

.invoice-pro-bottom {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
    gap: 1rem;
    align-items: start;
    margin-top: 1rem;
}

.invoice-terms {
    padding: 1rem;
}

.invoice-terms h3 {
    margin: 0 0 .45rem;
    color: #102033;
    font-size: .95rem;
    font-weight: 850;
}

.invoice-terms p {
    margin: 0;
    color: #48576b;
}

.invoice-bank-note {
    margin-top: .9rem;
    padding-top: .75rem;
    border-top: 1px solid #d9e4ea;
}

.invoice-bank-note strong {
    display: block;
    color: #111827;
}

.invoice-pro-footer {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-end;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #d9e4ea;
    color: #48576b;
}

.invoice-pro-footer strong,
.invoice-pro-footer span {
    display: block;
}

.invoice-signature {
    min-width: 190px;
    padding-top: 2.4rem;
    border-top: 1px solid #111827;
    text-align: center;
    color: #111827;
    font-weight: 800;
}

/* Modern care invoice */
.invoice-modern {
    --invoice-pad: clamp(1.1rem, 3vw, 2.35rem);
    padding: var(--invoice-pad);
    border-color: #dbe5e8;
    border-radius: 12px;
}

.invoice-modern::before { display: none; }

.invoice-modern .invoice-modern-head {
    margin: calc(var(--invoice-pad) * -1) calc(var(--invoice-pad) * -1) 1.25rem;
    padding: 1.25rem var(--invoice-pad);
    border: 0;
    color: #fff;
    background: linear-gradient(120deg, #0b3438, #0f766e 72%, #15978d);
}

.invoice-modern .invoice-pro-logo {
    border-color: rgba(255, 255, 255, .26);
    background: #fff;
    box-shadow: 0 8px 18px rgba(0, 0, 0, .12);
}

.invoice-modern .invoice-pro-org h2,
.invoice-modern .invoice-pro-title strong { color: #fff; }

.invoice-modern .invoice-pro-org p,
.invoice-modern .invoice-contact-lines,
.invoice-modern .document-kicker,
.invoice-modern .invoice-pro-title > .invoice-pro-label {
    color: rgba(255, 255, 255, .76);
}

.invoice-modern .invoice-pro-title > .invoice-pro-label { letter-spacing: .13em; }

.invoice-modern .invoice-pro-title .document-status {
    color: #fff;
    background: rgba(255, 255, 255, .15);
    border: 1px solid rgba(255, 255, 255, .22);
}

.invoice-modern-amount {
    min-width: 178px;
    margin-top: .2rem;
    padding-top: .55rem;
    border-top: 1px solid rgba(255, 255, 255, .22);
}

.invoice-modern-amount span,
.invoice-modern-amount b { display: block; }
.invoice-modern-amount span {
    color: rgba(255, 255, 255, .68);
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.invoice-modern-amount b { margin-top: .1rem; color: #fff; font-size: 1.2rem; }

.invoice-modern .invoice-party-card,
.invoice-modern .invoice-detail-card {
    border-color: #dce7e9;
    border-radius: 9px;
    background: #f8fbfb;
}

.invoice-modern .invoice-party-card { border-left: 4px solid #0f766e; }
.invoice-modern .invoice-party-card h3 { color: #103b3d; }
.invoice-modern .invoice-detail-card > div { border-color: #dce7e9; }

.invoice-modern .document-section-title {
    padding-bottom: .5rem;
    border-bottom: 1px solid #dce7e9;
    color: #103b3d;
}

.invoice-modern .document-table {
    border-color: #d5e3e5;
    border-radius: 9px;
}

.invoice-modern .document-table thead th {
    color: #fff;
    background: #164e52;
}

.invoice-modern .invoice-line-table tbody tr:nth-child(even) td { background: #f8fbfb; }
.invoice-modern .invoice-line-table td:last-child { color: #103b3d; font-size: .86rem; }

.invoice-modern .invoice-terms {
    border: 0;
    border-left: 3px solid #9ccbc6;
    border-radius: 0;
    background: #f8fbfb;
}

.invoice-modern .invoice-terms h3 { color: #103b3d; }

.invoice-modern .invoice-summary {
    border-color: #bdd7d4;
    border-radius: 9px;
}

.invoice-modern .invoice-total-row.grand {
    color: #fff;
    background: #0f766e;
}

.invoice-modern .invoice-total-row.balance-due {
    color: #9a3412;
    background: #fff4e8;
}

.invoice-modern .invoice-total-row.balance-clear {
    color: #047857;
    background: #ecfdf5;
}

.invoice-modern .invoice-payment-history .document-table thead th { background: #eaf3f3; color: #385b5d; }

.invoice-modern .invoice-pro-footer {
    border-top: 2px solid #164e52;
    color: #536b6d;
}

.invoice-modern .invoice-signature { color: #103b3d; border-top-color: #103b3d; }

.rx-symbol {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    color: #fff;
    background: linear-gradient(135deg, var(--hc-primary), var(--hc-secondary));
    font-size: 1.35rem;
    font-weight: 850;
}

.rx-care-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(260px, .75fr);
    gap: 1rem;
}

.signature-block {
    min-height: 118px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    text-align: right;
}

.signature-line {
    padding-top: .65rem;
    border-top: 1px solid #111827;
    font-weight: 800;
}

.verification-block {
    display: flex;
    justify-content: flex-end;
}

.report-section-list {
    display: grid;
    gap: .75rem;
}

.report-section {
    padding: .85rem 1rem;
    border: 1px solid #d9e4ea;
    border-left: 4px solid var(--hc-secondary);
    border-radius: 8px;
    background: #fbfdff;
}

.report-section strong {
    display: block;
    margin-bottom: .35rem;
    color: #102033;
    font-size: .82rem;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.visit-time-input {
    display: grid;
    grid-template-columns: minmax(72px, 1fr) minmax(68px, .85fr) minmax(72px, .8fr);
    gap: .35rem;
}

.clinical-report {
    max-width: 960px;
    padding: clamp(1.25rem, 3vw, 2.4rem);
    font-family: Arial, Helvetica, sans-serif;
}

.clinical-report::before {
    height: 5px;
    background: #0f766e;
}

.clinical-report-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid #17324d;
}

.clinical-report-brand {
    display: flex;
    align-items: flex-start;
    gap: .85rem;
}

.clinical-report-brand .brand-logo {
    width: 54px;
    height: 54px;
}

.clinical-report-brand h2 {
    margin: 0 0 .2rem;
    color: #102033;
    font-size: 1.35rem;
    font-weight: 800;
}

.clinical-contact {
    display: grid;
    color: #526275;
    font-size: .78rem;
    line-height: 1.35;
}

.clinical-report-type {
    display: grid;
    justify-items: end;
    text-align: right;
}

.clinical-report-type span,
.clinical-report-type small {
    color: #64748b;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.clinical-report-type strong {
    margin: .12rem 0 .2rem;
    color: #102033;
    font-size: 1.22rem;
}

.clinical-report-type small { color: #08745f; }

.clinical-report-type em {
    margin-top: .15rem;
    color: #64748b;
    font-size: .68rem;
    font-style: normal;
    overflow-wrap: anywhere;
}

.clinical-demographics {
    width: 100%;
    margin-bottom: 1.1rem;
    border-collapse: collapse;
    border-top: 1px solid #cbd5df;
    border-bottom: 1px solid #cbd5df;
    font-size: .84rem;
}

.clinical-demographics th,
.clinical-demographics td {
    padding: .55rem .65rem;
    border-bottom: 1px solid #e2e8ee;
    text-align: left;
    vertical-align: top;
}

.clinical-report .document-section-title {
    padding-bottom: .35rem;
    border-bottom: 1px solid #aebbc7;
    color: #263b50;
    font-size: .76rem;
    letter-spacing: .075em;
    text-transform: uppercase;
}

.clinical-demographics tr:last-child > * { border-bottom: 0; }
.clinical-demographics th {
    width: 15%;
    color: #526275;
    background: #f4f7f9;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.clinical-demographics td {
    width: 35%;
    color: #15283c;
    font-weight: 600;
}

.clinical-table-wrap {
    border-top: 1px solid #cbd5df;
    border-bottom: 1px solid #cbd5df;
}

.clinical-vitals-table tbody th {
    width: 32%;
    color: #35475a;
    background: #f4f7f9;
    font-size: .7rem;
    letter-spacing: .035em;
}

.clinical-notes-list {
    border-top: 1px solid #cbd5df;
}

.clinical-note-row {
    display: grid;
    grid-template-columns: minmax(150px, 24%) minmax(0, 1fr);
    gap: 1rem;
    padding: .65rem .25rem;
    border-bottom: 1px solid #e2e8ee;
}

.clinical-note-row strong {
    color: #405267;
    font-size: .7rem;
    letter-spacing: .045em;
    text-transform: uppercase;
}

.clinical-note-row p {
    margin: 0;
    color: #17283b;
    line-height: 1.5;
    white-space: normal;
    overflow-wrap: anywhere;
}

.clinical-follow-up-date {
    margin: 0;
    padding: .65rem 0;
    border-top: 1px solid #cbd5df;
    border-bottom: 1px solid #cbd5df;
    color: #17283b;
    font-weight: 700;
}

.clinical-signatures {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4rem;
    margin-top: 3rem;
}

.clinical-signatures > div {
    display: grid;
    gap: .18rem;
    padding-top: .45rem;
    border-top: 1px solid #64748b;
}

.clinical-signatures span,
.clinical-signatures small { color: #64748b; font-size: .7rem; }
.clinical-signatures strong { min-height: 1.2rem; color: #17283b; }

.prescription-diagnosis { border-top: 1px solid #cbd5df; }

.prescription-rx-heading {
    display: flex;
    align-items: baseline;
    gap: .7rem;
    margin: 1.2rem 0 .45rem;
}

.prescription-rx-heading span {
    color: #0f766e;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 2rem;
    font-style: italic;
    font-weight: 700;
    line-height: 1;
}

.prescription-rx-heading strong {
    color: #263b50;
    font-size: .76rem;
    letter-spacing: .075em;
    text-transform: uppercase;
}

.prescription-medication-table thead th {
    color: #35475a;
    background: #f4f7f9;
    font-size: .7rem;
    letter-spacing: .045em;
}

.prescription-medication-table td {
    min-height: 64px;
    padding-block: .85rem !important;
    vertical-align: top;
    line-height: 1.5;
}

.prescription-footer {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 2rem;
    margin-top: 2.5rem;
    padding-top: 1rem;
    border-top: 1px solid #cbd5df;
}

.prescription-verification {
    display: flex;
    align-items: center;
    gap: .65rem;
}

.prescription-verification .qr-box { width: 58px; height: 58px; }
.prescription-verification .qr-image { width: 100%; height: 100%; }
.prescription-verification strong,
.prescription-verification span { display: block; }
.prescription-verification strong { color: #263b50; font-size: .75rem; }
.prescription-verification span { color: #64748b; font-size: .65rem; overflow-wrap: anywhere; }

.prescription-signature {
    min-width: 220px;
    padding-top: 2.5rem;
    border-bottom: 1px solid #64748b;
    text-align: center;
}

.prescription-signature strong,
.prescription-signature span { display: block; }
.prescription-signature strong { color: #17283b; }
.prescription-signature span { margin-top: .25rem; color: #64748b; font-size: .7rem; }

.lab-test-picker { padding: .85rem; border: 1px solid var(--hc-line); border-radius: 8px; background: rgba(15, 118, 110, .025); }
.lab-selected-tests-table tfoot th { background: #f8fafc; color: #17283b; }
.lab-setup-list-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .8rem; }
.lab-setup-search { width: min(100%, 310px); }
.lab-entry-form { width: min(100%, 1080px); margin-inline: auto; }
.lab-entry-form textarea[name="notes"] { min-height: 58px; }
.lab-simple-entry { overflow: hidden; border: 1px solid var(--hc-line); border-radius: 9px; background: #f8fafc; }
.lab-simple-entry-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .58rem .75rem; border-bottom: 1px solid var(--hc-line); background: #eef3f5; }
.lab-simple-entry-head strong { display: block; color: #23394d; font-size: .78rem; }
.lab-simple-entry-head span { display: block; margin-top: .08rem; color: #718096; font-size: .65rem; }
.lab-simple-entry-head small { color: var(--hc-primary); font-size: .68rem; font-weight: 800; white-space: nowrap; }
.lab-simple-entry-body { display: grid; gap: .65rem; padding: .65rem; }
.lab-simple-entry-panel { overflow: hidden; border: 1px solid #d8e1e7; border-radius: 7px; background: #fff; }
.lab-simple-entry-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .45rem; padding: .5rem; }
.lab-simple-entry-row { display: grid; grid-template-columns: minmax(125px, .9fr) minmax(145px, 1.1fr); gap: .55rem; align-items: center; min-width: 0; padding: .45rem .55rem; border: 1px solid #e1e8ed; border-radius: 6px; background: #fbfcfd; }
.lab-simple-entry-group { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .42rem .65rem; border-bottom: 1px solid var(--hc-line); background: rgba(15, 118, 110, .07); }
.lab-simple-entry-group strong { color: #12324a; font-size: .78rem; letter-spacing: .025em; }
.lab-simple-entry-group span { color: #607184; font-size: .68rem; white-space: nowrap; }
.lab-simple-entry-row label { min-width: 0; margin: 0; }
.lab-simple-entry-row label strong { display: block; color: #17283b; font-size: .84rem; overflow-wrap: anywhere; }
.lab-simple-entry-row label small { display: block; margin-top: .18rem; color: #718096; font-size: .68rem; }
.lab-simple-entry-row > div { min-width: 0; }
.lab-simple-entry-row .form-control,
.lab-simple-entry-row .input-group-text { min-height: 34px; padding-block: .32rem; }
.lab-simple-entry-row .input-group-text { min-width: 48px; justify-content: center; color: #526377; background: #f8fafc; }
.lab-billing-breakdown { padding: .8rem; border: 1px solid var(--hc-line); border-radius: 8px; background: rgba(15, 118, 110, .035); }
.lab-billing-breakdown > strong { display: block; margin-bottom: .45rem; }
.lab-billing-breakdown > div { display: flex; justify-content: space-between; gap: 1rem; padding: .3rem 0; border-top: 1px solid var(--hc-line); }
.lab-report-meta-grid { display: grid; grid-template-columns: 1.4fr .8fr .8fr; margin-bottom: 1rem; border-top: 1px solid #aebbc7; border-left: 1px solid #aebbc7; }
.lab-report-meta { min-width: 0; padding: .48rem .58rem; border-right: 1px solid #aebbc7; border-bottom: 1px solid #aebbc7; }
.lab-report-meta span { display: block; margin-bottom: .15rem; color: #607184; font-size: .62rem; font-weight: 800; letter-spacing: .045em; text-transform: uppercase; }
.lab-report-meta strong { display: block; color: #14283c; font-size: .8rem; line-height: 1.35; overflow-wrap: anywhere; }
.lab-report-meta-wide { grid-column: span 2; }
.lab-report-meta-full { grid-column: 1 / -1; }
.lab-report-results-wrap { overflow: visible; }
.lab-report-table { width: 100%; margin: 0; border-collapse: collapse; table-layout: fixed; }
.lab-report-table .lab-col-test { width: 29%; }
.lab-report-table .lab-col-result { width: 15%; }
.lab-report-table .lab-col-unit { width: 12%; }
.lab-report-table .lab-col-range { width: 27%; }
.lab-report-table .lab-col-remarks { width: 17%; }
.lab-report-table th { padding: .55rem .48rem; border-bottom: 1px solid #8796a5; color: #35475a; background: #edf2f5; font-size: .64rem; font-weight: 800; letter-spacing: .04em; text-align: left; text-transform: uppercase; vertical-align: bottom; }
.lab-report-table td { padding: .68rem .48rem; border-bottom: 1px solid #d9e1e7; color: #26384b; font-size: .76rem; line-height: 1.35; overflow-wrap: anywhere; text-align: left; vertical-align: middle; }
.lab-report-table tbody tr:last-child td { border-bottom: 0; }
.lab-report-table .lab-report-panel-row td { padding: .42rem .48rem; border-top: 1px solid #91a3af; border-bottom: 1px solid #b7c4cc; color: #183c52; background: #e6f0f1; font-size: .68rem; font-weight: 800; letter-spacing: .045em; text-transform: uppercase; }
.lab-result-value { color: #102033; font-size: .95rem; font-weight: 800; }
.lab-report-disclaimer { margin: 1rem 0 0; padding-top: .65rem; border-top: 1px solid #cbd5df; color: #64748b; font-size: .68rem; line-height: 1.4; }

.attender-visit-form { width: min(100%, 920px); margin-inline: auto; }
.attender-time-panel { padding: .9rem; border: 1px solid var(--hc-line); border-radius: 9px; background: rgba(15, 118, 110, .03); }
.attender-duration-card { display: grid; align-content: center; min-height: 100%; padding: .65rem .8rem; border: 1px solid #c9d9df; border-radius: 8px; background: #fff; }
.attender-duration-card span { color: #607184; font-size: .68rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.attender-duration-card strong { margin: .12rem 0; color: var(--hc-primary); font-size: 1.05rem; }
.attender-duration-card small { color: #718096; font-size: .68rem; }

.reports-page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .9rem; }
.reports-page-head p { margin: 0; color: var(--hc-muted); font-size: .8rem; }
.reports-catalog { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .55rem; }
.reports-catalog-item { display: flex; align-items: center; gap: .6rem; min-width: 0; padding: .65rem .7rem; border: 1px solid var(--hc-line); border-radius: 8px; color: #31465a; background: #fff; text-decoration: none; transition: border-color .15s ease, background .15s ease, transform .15s ease; }
.reports-catalog-item:hover { border-color: rgba(15, 118, 110, .45); color: #123b44; transform: translateY(-1px); }
.reports-catalog-item.active { border-color: var(--hc-primary); color: #0c554f; background: rgba(15, 118, 110, .07); box-shadow: inset 0 0 0 1px rgba(15, 118, 110, .1); }
.reports-catalog-item > i { display: grid; place-items: center; flex: 0 0 34px; width: 34px; height: 34px; border-radius: 7px; color: var(--hc-primary); background: rgba(15, 118, 110, .1); }
.reports-catalog-item span { min-width: 0; }
.reports-catalog-item strong { display: block; font-size: .75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reports-catalog-item small { display: block; margin-top: .12rem; color: #718096; font-size: .62rem; line-height: 1.25; }
.reports-filter-panel { padding-block: .8rem; }
.reports-summary-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .6rem; }
.reports-summary-grid section { position: relative; min-width: 0; padding: .72rem .8rem; overflow: hidden; border: 1px solid var(--hc-line); border-radius: 8px; background: #fff; }
.reports-summary-grid span { display: block; color: #718096; font-size: .66rem; font-weight: 700; text-transform: uppercase; }
.reports-summary-grid strong { display: block; margin-top: .12rem; color: #17283b; font-size: 1rem; overflow-wrap: anywhere; }
.reports-summary-grid i { position: absolute; right: .65rem; bottom: .35rem; color: rgba(15, 118, 110, .13); font-size: 1.7rem; }
.reports-result-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .75rem; }
.reports-result-head small { color: #718096; font-size: .68rem; }
.reports-export-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .45rem; }
.reports-data-table th { white-space: nowrap; }
.reports-data-table td { max-width: 280px; overflow-wrap: anywhere; }

.app-credit-footer { display: flex; align-items: center; justify-content: center; gap: .45rem; margin-top: 1.2rem; padding: .65rem 0 .15rem; color: #8a98a8; font-size: .64rem; letter-spacing: .025em; text-align: center; }
.app-credit-footer i { width: 3px; height: 3px; border-radius: 50%; background: #aeb9c5; }

.patient-profile-card {
    margin-bottom: .85rem;
    overflow: hidden;
    border: 1px solid var(--hc-line);
    border-radius: var(--hc-radius);
    background: var(--hc-surface);
    box-shadow: var(--hc-shadow);
}

.patient-profile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.1rem;
    border-bottom: 1px solid var(--hc-line);
    background: linear-gradient(90deg, rgba(15, 118, 110, .055), transparent 55%);
}

.patient-profile-identity {
    display: flex;
    align-items: center;
    gap: .85rem;
    min-width: 0;
}

.patient-profile-identity > div:last-child { min-width: 0; }

.patient-profile-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: .45rem;
    flex: 0 0 auto;
}

.patient-avatar {
    width: 48px;
    height: 48px;
    min-width: 48px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #0f766e;
    background: #ccfbf1;
    border: 1px solid #99e9dc;
    font-weight: 750;
    font-size: 1.05rem;
}

.patient-record-id {
    color: var(--hc-muted);
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .045em;
    text-transform: uppercase;
}

.patient-record-name {
    margin: .08rem 0 .25rem;
    color: var(--hc-ink);
    font-size: clamp(1.15rem, 1.8vw, 1.45rem);
    font-weight: 750;
    line-height: 1.2;
}

.patient-record-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem .9rem;
}

.patient-record-meta span {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    color: var(--hc-muted);
    font-size: .76rem;
    font-weight: 550;
}

.patient-record-meta i { color: var(--hc-primary); }

.patient-profile-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(245px, .34fr);
}

.patient-details-block,
.patient-summary-block {
    padding: .95rem 1.1rem 1.05rem;
}

.patient-summary-block {
    border-left: 1px solid var(--hc-line);
    background: rgba(248, 250, 252, .72);
}

.profile-block-title {
    margin: 0 0 .7rem;
    color: var(--hc-ink);
    font-size: .76rem;
    font-weight: 700;
    letter-spacing: .045em;
    text-transform: uppercase;
}

.patient-detail-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .25rem 1rem;
}

.patient-detail-item {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    align-items: start;
    gap: .45rem;
    min-height: 58px;
    padding: .48rem 0;
}

.patient-detail-item > i {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 6px;
    color: var(--hc-primary);
    background: rgba(15, 118, 110, .08);
}

.patient-detail-item span,
.patient-last-activity span {
    display: block;
    margin-bottom: .1rem;
    color: var(--hc-muted);
    font-size: .68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .035em;
}

.patient-detail-item strong {
    display: block;
    color: var(--hc-ink);
    font-size: .82rem;
    font-weight: 600;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.patient-detail-wide { grid-column: span 2; }

.patient-summary-list { display: grid; }

.patient-summary-list > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    min-height: 40px;
    border-bottom: 1px solid var(--hc-line);
}

.patient-summary-list span {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    color: var(--hc-muted);
    font-size: .78rem;
}

.patient-summary-list i {
    width: 1rem;
    color: var(--hc-primary);
    text-align: center;
}

.patient-summary-list strong {
    color: var(--hc-ink);
    font-size: .86rem;
    font-weight: 700;
    text-align: right;
}

.patient-summary-list .has-due strong { color: #b42318; }

.patient-last-activity {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    padding-top: .7rem;
}

.patient-last-activity span { margin: 0; }
.patient-last-activity strong { font-size: .8rem; }

[data-bs-theme="dark"] .patient-profile-header {
    background: linear-gradient(90deg, rgba(45, 212, 191, .07), transparent 55%);
}

[data-bs-theme="dark"] .patient-summary-block {
    background: rgba(255, 255, 255, .025);
}

[data-bs-theme="dark"] .patient-avatar {
    color: #99f6e4;
    background: rgba(15, 118, 110, .25);
    border-color: rgba(94, 234, 212, .2);
}

.history-table .table {
    margin-bottom: 0;
}

.history-table thead th {
    color: var(--hc-muted);
    font-size: .76rem;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.history-table tbody tr {
    border-top: 1px solid var(--hc-line);
}

.history-table tbody td {
    padding-block: .8rem;
}

.visit-note-details { min-width: 190px; }
.visit-note-details summary {
    color: var(--hc-primary);
    cursor: pointer;
    font-size: .78rem;
    font-weight: 650;
}
.visit-note-details[open] summary { margin-bottom: .55rem; }
.visit-note-details > div {
    margin-bottom: .45rem;
    padding-left: .65rem;
    border-left: 2px solid rgba(15, 118, 110, .2);
}
.visit-note-details > div:last-child { margin-bottom: 0; }
.visit-note-details span {
    display: block;
    color: var(--hc-muted);
    font-size: .66rem;
    font-weight: 700;
    letter-spacing: .035em;
    text-transform: uppercase;
}
.visit-note-details p {
    margin: .1rem 0 0;
    max-width: 520px;
    color: var(--hc-ink);
    font-size: .78rem;
    white-space: normal;
}

.bill-preview-cell {
    display: flex;
    flex-wrap: wrap;
    gap: .65rem;
    align-items: center;
    justify-content: space-between;
    min-width: 260px;
}

.bill-action-group {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    white-space: nowrap;
}

.bill-action-group .btn {
    width: 34px;
    height: 34px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    border-radius: 8px;
}

.text-truncate-soft {
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.qr-box {
    width: 112px;
    height: 112px;
    display: grid;
    place-items: center;
    border: 1px solid #111827;
    background:
        linear-gradient(90deg, #111827 50%, transparent 50%) 0 0/18px 18px,
        linear-gradient(#111827 50%, transparent 50%) 0 0/18px 18px,
        #fff;
    color: #fff;
    font-size: 0;
}

.qr-image {
    width: 112px;
    height: 112px;
    object-fit: cover;
}

/* Nursing assessment workflow */
.assessment-form-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: .85rem;
}

.assessment-form-head p { font-size: .8rem; }

.assessment-patient-strip {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .65rem .75rem;
    border: 1px solid rgba(15, 118, 110, .18);
    border-radius: 8px;
    background: rgba(15, 118, 110, .055);
}

.assessment-patient-icon {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    flex: 0 0 32px;
    border-radius: 50%;
    color: var(--hc-primary);
    background: var(--hc-surface);
    border: 1px solid rgba(15, 118, 110, .15);
}

.assessment-patient-strip small,
.assessment-patient-strip strong { display: block; }
.assessment-patient-strip small { color: var(--hc-muted); font-size: .68rem; }
.assessment-patient-strip strong { font-size: .88rem; }

.assessment-patient-id {
    margin-left: auto;
    padding: .25rem .5rem;
    border-radius: 6px;
    color: var(--hc-primary);
    background: var(--hc-surface);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .035em;
}

.assessment-section {
    padding: 1rem 0 .2rem;
    border-bottom: 1px solid var(--hc-line);
}

.assessment-section:last-of-type { border-bottom: 0; }

.assessment-section-head {
    display: flex;
    align-items: flex-start;
    gap: .65rem;
    margin-bottom: .75rem;
}

.assessment-section-head > span {
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    flex: 0 0 26px;
    border-radius: 6px;
    color: var(--hc-primary);
    background: rgba(15, 118, 110, .09);
    font-size: .68rem;
    font-weight: 750;
}

.assessment-section-head h3 {
    margin: 0;
    font-size: .9rem;
    font-weight: 700;
}

.assessment-section-head p {
    margin: .08rem 0 0;
    color: var(--hc-muted);
    font-size: .72rem;
}

.vitals-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .6rem;
}

.vital-field {
    display: block;
    min-width: 0;
    padding: .55rem;
    border: 1px solid var(--hc-line);
    border-radius: 8px;
    background: rgba(248, 250, 252, .65);
}

.vital-field-label {
    display: flex;
    align-items: center;
    gap: .35rem;
    margin-bottom: .35rem;
    color: var(--hc-muted);
    font-size: .72rem;
    font-weight: 600;
}

.vital-field-label i { color: var(--hc-primary); }
.vital-field .form-control { min-width: 0; }
.vital-field .input-group-text {
    min-height: 36px;
    padding-inline: .45rem;
    color: var(--hc-muted);
    background: var(--hc-surface);
    font-size: .68rem;
}

.assessment-section textarea.form-control { min-height: 68px; }

.assessment-form-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: .45rem;
    padding-top: .9rem;
}

[data-bs-theme="dark"] .assessment-patient-strip {
    background: rgba(45, 212, 191, .055);
}

[data-bs-theme="dark"] .vital-field {
    background: rgba(255, 255, 255, .025);
}

/* User management */
.user-stats-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .5rem;
}

.user-stats-row > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    min-height: 60px;
    padding: .7rem .85rem;
    border: 1px solid var(--hc-line);
    border-radius: var(--hc-radius);
    background: var(--hc-surface);
    box-shadow: var(--hc-shadow);
}

.user-stats-row span {
    color: var(--hc-muted);
    font-size: .76rem;
    font-weight: 600;
}

.user-stats-row strong {
    color: var(--hc-primary);
    font-size: 1.15rem;
}

.user-form-panel { position: sticky; top: .75rem; }

.user-directory-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: .7rem;
}

.user-directory-head .form-control { width: min(100%, 220px); }

.user-list-identity {
    display: flex;
    align-items: center;
    gap: .6rem;
    min-width: 210px;
}

.user-list-identity > span {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    flex: 0 0 32px;
    border-radius: 50%;
    color: var(--hc-primary);
    background: rgba(15, 118, 110, .1);
    font-size: .76rem;
    font-weight: 750;
}

.user-list-identity strong,
.user-list-identity small { display: block; }
.user-list-identity strong { font-size: .82rem; }
.user-list-identity small { color: var(--hc-muted); font-size: .72rem; }

.user-role-label {
    display: inline-block;
    padding: .24rem .45rem;
    border-radius: 5px;
    color: #334155;
    background: #f1f5f9;
    font-size: .72rem;
    font-weight: 600;
    white-space: nowrap;
}

[data-bs-theme="dark"] .user-role-label {
    color: var(--hc-ink);
    background: rgba(255, 255, 255, .07);
}

.user-row-actions {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
}

.user-row-actions form { margin: 0; }
.user-row-actions .btn {
    width: 30px;
    padding: 0;
    display: inline-grid;
    place-items: center;
}

/* Patient portal */
.portal-page { background: var(--hc-bg); }
.portal-document-page { padding: 1rem; }

.portal-topbar {
    min-height: 62px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .6rem max(1rem, calc((100vw - 1240px) / 2));
    border-bottom: 1px solid var(--hc-line);
    background: var(--hc-surface);
    box-shadow: 0 1px 4px rgba(15, 23, 42, .04);
}

.portal-brand {
    display: flex;
    align-items: center;
    gap: .55rem;
    color: var(--hc-ink);
}

.portal-brand .brand-mark { width: 36px; height: 36px; }
.portal-brand strong,
.portal-brand small { display: block; }
.portal-brand strong { font-size: .86rem; }
.portal-brand small { color: var(--hc-muted); font-size: .68rem; }

.portal-topbar nav { display: flex; align-items: center; gap: .25rem; }
.portal-topbar nav a {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    min-height: 34px;
    padding: .35rem .55rem;
    border-radius: 7px;
    color: var(--hc-muted);
    font-size: .78rem;
    font-weight: 600;
}
.portal-topbar nav a:hover { color: var(--hc-primary); background: rgba(15, 118, 110, .07); }

.portal-main {
    width: min(100%, 1272px);
    min-height: calc(100vh - 62px);
    margin-inline: auto;
    padding: 1rem;
}

.portal-auth-main {
    display: grid;
    place-items: center;
    min-height: 100vh;
}

.portal-login-card {
    width: min(100%, 410px);
    padding: 1.25rem;
    border: 1px solid var(--hc-line);
    border-radius: 12px;
    background: var(--hc-surface);
    box-shadow: var(--hc-shadow);
}

.portal-login-brand {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: 1.2rem;
}
.portal-login-brand h1 { margin: 0; font-size: 1.2rem; font-weight: 750; }
.portal-login-brand p { margin: .12rem 0 0; color: var(--hc-muted); font-size: .76rem; }
.portal-login-help { margin: 1rem 0 0; color: var(--hc-muted); font-size: .72rem; text-align: center; }

.portal-page-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: .85rem;
}
.portal-page-heading > div > span { color: var(--hc-muted); font-size: .7rem; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; }
.portal-page-heading h1 { margin: .05rem 0; font-size: 1.4rem; font-weight: 750; }
.portal-page-heading p { margin: 0; color: var(--hc-muted); font-size: .78rem; }
.portal-patient-chip { display: flex; align-items: center; gap: .4rem; color: var(--hc-primary); font-size: .76rem; font-weight: 650; }

.portal-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .5rem;
    margin-bottom: .8rem;
}
.portal-stats > div {
    position: relative;
    min-height: 82px;
    padding: .75rem;
    overflow: hidden;
    border: 1px solid var(--hc-line);
    border-radius: var(--hc-radius);
    background: var(--hc-surface);
    box-shadow: var(--hc-shadow);
}
.portal-stats span,
.portal-stats strong { display: block; }
.portal-stats span { color: var(--hc-muted); font-size: .72rem; }
.portal-stats strong { margin-top: .25rem; font-size: 1.15rem; }
.portal-stats i { position: absolute; right: .75rem; bottom: .7rem; color: rgba(15, 118, 110, .28); font-size: 1.2rem; }
.portal-stats .has-due strong { color: #b42318; }

.portal-section-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .6rem;
}

.portal-password-card { width: min(100%, 520px); }

.patient-portal-admin-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: .75rem;
}
.patient-portal-admin-form {
    display: grid;
    grid-template-columns: minmax(180px, .75fr) minmax(240px, 1fr) auto auto;
    align-items: end;
    gap: .6rem;
}
.patient-portal-active { align-self: center; margin: 1.25rem .2rem .35rem; white-space: nowrap; }

/* Compact application controls */
h1, h2, h3, h4, h5, h6 {
    color: var(--hc-ink);
    letter-spacing: -.012em;
}

.topbar-kicker {
    margin-bottom: .05rem;
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: .045em;
    text-transform: uppercase;
}

.sidebar-nav a i {
    width: 1.15rem;
    flex: 0 0 1.15rem;
    text-align: center;
    font-size: 1rem;
}

.sidebar-nav a span {
    font-size: .86rem;
    font-weight: 550;
}

.form-label {
    margin-bottom: .3rem;
    color: var(--hc-ink);
    font-size: .8rem;
    font-weight: 600;
}

.form-control,
.form-select,
.input-group-text {
    min-height: 38px;
    border-color: var(--hc-line);
    border-radius: 7px;
    font-size: .86rem;
}

textarea.form-control { min-height: 82px; }

.form-control:focus,
.form-select:focus {
    border-color: rgba(15, 118, 110, .65);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, .1);
}

.btn {
    min-height: 36px;
    padding: .42rem .75rem;
    border-radius: 7px;
    font-size: .84rem;
    font-weight: 600;
}

.btn-sm {
    min-height: 30px;
    padding: .28rem .55rem;
    font-size: .78rem;
}

.btn-lg {
    min-height: 42px;
    padding: .55rem .9rem;
    font-size: .9rem;
}

.btn-primary {
    --bs-btn-bg: var(--hc-primary);
    --bs-btn-border-color: var(--hc-primary);
    --bs-btn-hover-bg: #0b625c;
    --bs-btn-hover-border-color: #0b625c;
    --bs-btn-active-bg: #09534e;
    --bs-btn-active-border-color: #09534e;
}

.btn-outline-primary {
    --bs-btn-color: var(--hc-primary);
    --bs-btn-border-color: #9ccbc6;
    --bs-btn-hover-bg: var(--hc-primary);
    --bs-btn-hover-border-color: var(--hc-primary);
}

.table {
    margin-bottom: 0;
    color: var(--hc-ink);
    font-size: .83rem;
}

.table > :not(caption) > * > * {
    padding: .62rem .65rem;
    border-bottom-color: var(--hc-line);
}

.table thead th {
    color: var(--hc-muted);
    background: #f8fafc;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    white-space: nowrap;
}

[data-bs-theme="dark"] .table thead th {
    background: rgba(255, 255, 255, .035);
}

.table tbody tr:last-child > * { border-bottom-width: 0; }
.table tbody tr:hover > * { background: rgba(15, 118, 110, .035); }

.status-pill,
.badge {
    padding: .3rem .48rem;
    font-size: .7rem;
    font-weight: 650;
}

.alert {
    padding: .7rem .85rem;
    border-radius: 8px;
    font-size: .84rem;
}

.text-muted { color: var(--hc-muted) !important; }

.calendar-grid { gap: .25rem; }
.calendar-cell {
    min-height: 34px;
    border-radius: 6px;
    font-size: .78rem;
    font-weight: 600;
}

.notification-dot {
    top: 7px;
    right: 7px;
    width: 6px;
    height: 6px;
}

@media (min-width: 1400px) {
    .app-main { padding-inline: 1.5rem; }
}

@media (max-width: 991.98px) {
    body.sidebar-open {
        overflow: hidden;
    }
    .app-shell {
        display: block;
        width: 100%;
    }
    .app-main {
        width: 100%;
        margin-left: 0;
        padding: .9rem 1rem 1.25rem;
    }
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        width: min(82vw, 260px);
        transform: translateX(-105%);
        transition: transform .2s ease;
        box-shadow: 18px 0 48px rgba(15, 23, 42, .22);
    }
    .sidebar.is-open { transform: translateX(0); }
    .sidebar-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, .45);
        z-index: 1030;
    }
    .sidebar-backdrop.is-open { display: block; }
    .topbar { align-items: flex-start; }
    .topbar-actions { margin-left: auto; }
    .user-chip { display: none; }
    .login-shell {
        grid-template-columns: 1fr;
        width: min(100%, 520px);
        padding: 7px;
    }
    .login-visual {
        min-height: 300px;
    }
    .login-visual img:not(.brand-logo) { object-position: center 42%; }
    .login-card { padding: 1.65rem; }
    .document-head,
    .invoice-pro-head,
    .rx-care-grid {
        grid-template-columns: 1fr;
    }
    .document-head {
        display: grid;
    }
    .invoice-pro-head,
    .invoice-pro-grid,
    .invoice-pro-bottom {
        display: grid;
        grid-template-columns: 1fr;
    }
    .invoice-pro-title {
        justify-items: start;
        min-width: 0;
        text-align: left;
    }
    .document-meta {
        min-width: 0;
        text-align: left;
    }
    .verification-block {
        justify-content: flex-start;
    }
    .patient-detail-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .vitals-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .portal-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .patient-portal-admin-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .patient-portal-active { margin-top: .4rem; }
    .lab-result-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .reports-catalog { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .reports-summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .invoice-modern .invoice-modern-head { display: grid; }
    .invoice-modern .invoice-pro-title { justify-items: start; text-align: left; }
}

@media (max-width: 575.98px) {
    .app-main { padding: .75rem; }
    .topbar {
        flex-wrap: wrap;
    }
    .topbar { gap: .65rem; }
    .topbar-actions { gap: .35rem; }
    .btn-icon { width: 34px; height: 34px; min-height: 34px; }
    .form-panel, .table-panel, .glass-card { padding: .75rem; }
    .visit-time-input { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .clinical-report-head { flex-direction: column; }
    .clinical-report-type { justify-items: start; text-align: left; }
    .clinical-demographics tr {
        display: grid;
        grid-template-columns: 105px minmax(0, 1fr);
    }
    .clinical-demographics th,
    .clinical-demographics td { width: auto; }
    .clinical-note-row { grid-template-columns: 1fr; gap: .25rem; }
    .clinical-signatures { gap: 1.5rem; }
    .prescription-footer { align-items: stretch; flex-direction: column; }
    .prescription-signature { width: 100%; min-width: 0; }
    .lab-simple-entry-grid { grid-template-columns: 1fr; }
    .lab-simple-entry-row { grid-template-columns: minmax(110px, .85fr) minmax(130px, 1.15fr); }
    .lab-setup-list-head { align-items: stretch; flex-direction: column; }
    .lab-setup-search { width: 100%; }
    .lab-report-meta-grid { grid-template-columns: 1fr; }
    .lab-report-meta-wide,
    .lab-report-meta-full { grid-column: auto; }
    .lab-report-results-wrap { overflow-x: auto; }
    .lab-report-table { min-width: 680px; }
    .reports-page-head,
    .reports-result-head { align-items: stretch; flex-direction: column; }
    .reports-catalog { grid-template-columns: 1fr; }
    .reports-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .reports-export-actions { justify-content: stretch; }
    .reports-export-actions .btn { flex: 1 1 auto; }
    .section-title {
        flex-wrap: wrap;
    }
    .section-title .ms-auto {
        width: 100%;
        margin-left: 0 !important;
        text-align: left;
    }
    .rx-paper, .invoice-paper, .report-paper { padding: 1rem; }
    .rx-paper::before,
    .invoice-paper::before,
    .report-paper::before { height: 6px; }
    .document-brand,
    .invoice-pro-brand {
        flex-wrap: wrap;
    }
    .document-info-grid,
    .record-detail-grid {
        grid-template-columns: 1fr;
    }
    .patient-profile-header {
        align-items: flex-start;
        flex-direction: column;
        padding: .85rem;
    }
    .patient-profile-actions {
        width: 100%;
        justify-content: stretch;
    }
    .patient-profile-actions .btn { flex: 1 1 auto; }
    .patient-profile-content { grid-template-columns: 1fr; }
    .patient-details-block,
    .patient-summary-block { padding: .8rem .85rem; }
    .patient-summary-block {
        border-top: 1px solid var(--hc-line);
        border-left: 0;
    }
    .patient-detail-list { grid-template-columns: 1fr; }
    .patient-detail-wide { grid-column: auto; }
    .patient-record-meta { gap: .3rem .65rem; }
    .vitals-grid { grid-template-columns: 1fr; }
    .assessment-form-actions .btn { flex: 1 1 auto; }
    .user-stats-row { grid-template-columns: 1fr; }
    .user-stats-row > div { min-height: 48px; }
    .user-directory-head { align-items: stretch; flex-direction: column; }
    .user-directory-head .form-control { width: 100%; }
    .user-form-panel { position: static; }
    .portal-topbar { padding-inline: .75rem; }
    .portal-topbar nav a span { display: none; }
    .portal-main { padding: .75rem; }
    .portal-page-heading { align-items: flex-start; }
    .portal-patient-chip { display: none; }
    .portal-stats { grid-template-columns: 1fr 1fr; }
    .portal-section-grid { grid-template-columns: 1fr; }
    .patient-portal-admin-head { align-items: flex-start; flex-direction: column; }
    .patient-portal-admin-form { grid-template-columns: 1fr; }
    .patient-portal-active { margin: .2rem 0; }
    .invoice-modern { --invoice-pad: 1rem; }
    .invoice-modern .invoice-modern-head { padding-block: 1rem; }
    .invoice-modern-amount { width: 100%; min-width: 0; }
    .info-box-wide {
        grid-column: auto;
    }
    .document-table {
        overflow-x: auto;
    }
    .invoice-detail-card {
        grid-template-columns: 1fr;
    }
    .invoice-detail-card > div,
    .invoice-detail-card > div:nth-child(2n),
    .invoice-detail-card > div:nth-last-child(-n+2) {
        border-right: 0;
        border-bottom: 1px solid #d9e4ea;
    }
    .invoice-detail-card > div:last-child {
        border-bottom: 0;
    }
    .invoice-party-card dl div {
        grid-template-columns: 1fr;
        gap: .12rem;
    }
    .invoice-pro-footer {
        display: grid;
    }
    .invoice-signature {
        justify-self: stretch;
    }
    .bill-preview-cell {
        min-width: 220px;
    }
    .text-truncate-soft {
        max-width: 190px;
    }
    .login-page { padding: .85rem; }
    .login-visual { min-height: 235px; }
    .login-visual-copy { left: 1rem; right: 1rem; bottom: 1rem; gap: .55rem; }
    .login-care-badge { display: none !important; }
    .login-visual-logo { width: 42px; height: 42px; flex-basis: 42px; }
    .login-visual-logo .brand-logo-lg { width: 35px; height: 35px; }
    .login-visual-copy strong { font-size: 1rem; }
    .login-visual-copy span { font-size: .75rem; }
    .login-card { padding: 1.25rem .9rem; }
    .login-card-head { margin-bottom: 1.3rem; }
    .login-patient-link { align-items: flex-start; flex-direction: column; }
}

@media print {
    @page {
        size: A4;
        margin: 10mm;
    }
    body {
        background: #fff !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        color-adjust: exact;
    }
    body.portal-document-page { padding: 0; }
    .invoice-paper,
    .invoice-paper * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
        forced-color-adjust: none !important;
    }
    .sidebar,
    .topbar,
    .print-actions,
    .app-credit-footer,
    .reports-catalog,
    .reports-filter-panel,
    .alert,
    .sidebar-backdrop { display: none !important; }
    .app-shell { display: block; }
    .app-main {
        width: 100%;
        margin-left: 0;
        padding: 0;
    }
    .rx-paper,
    .report-paper {
        box-shadow: none;
        border-radius: 0;
        border: 0;
        padding: 0;
        max-width: none;
    }
    .clinical-report {
        font-family: Arial, Helvetica, sans-serif;
        font-size: 10px;
        line-height: 1.35;
    }
    .clinical-report-head,
    .clinical-demographics,
    .clinical-table-wrap,
    .clinical-note-row,
    .clinical-signatures {
        break-inside: avoid;
    }
    .clinical-report-head { margin-bottom: .7rem; padding-bottom: .7rem; }
    .clinical-demographics { margin-bottom: .75rem; }
    .clinical-demographics th,
    .clinical-demographics td { padding: .38rem .48rem; }
    .clinical-note-row { padding: .4rem .15rem; }
    .clinical-signatures { margin-top: 2rem; }
    .lab-report-meta-grid,
    .lab-report-results-wrap,
    .lab-report-table tr { break-inside: avoid; }
    .lab-report-meta-grid { grid-template-columns: 1.4fr .8fr .8fr; }
    .lab-report-meta-wide { grid-column: span 2; }
    .lab-report-meta-full { grid-column: 1 / -1; }
    .lab-report-results-wrap { overflow: visible; }
    .lab-report-table { min-width: 0; }
    .lab-report-table th { padding: .42rem .38rem; font-size: 8px; }
    .lab-report-table td { padding: .5rem .38rem; font-size: 9px; }
    .lab-result-value { font-size: 10px; }
    .prescription-footer,
    .prescription-medication-table tr { break-inside: avoid; }
    .prescription-footer { margin-top: 1.5rem; }
    .invoice-paper {
        width: 100%;
        max-width: none;
        margin: 0 auto;
        padding: .95rem;
        border: 1px solid #d9e4ea;
        border-radius: 8px;
        box-shadow: none;
        overflow: hidden;
        font-family: Arial, Helvetica, sans-serif;
        font-size: 11px;
        line-height: 1.34;
        box-sizing: border-box;
    }
    .invoice-paper.invoice-modern { --invoice-pad: .95rem; }
    .invoice-paper.invoice-modern::before { display: none; }
    .rx-paper::before,
    .report-paper::before {
        display: none;
    }
    .invoice-paper::before {
        display: block;
        height: 8px;
    }
    .invoice-pro-head,
    .invoice-pro-grid,
    .invoice-pro-bottom,
    .invoice-pro-footer {
        break-inside: avoid;
    }
    .invoice-pro-head {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: .85rem;
        padding: .15rem 0 .75rem;
        margin-bottom: .8rem;
    }
    .invoice-pro-brand {
        gap: .7rem;
        flex-wrap: nowrap;
    }
    .invoice-pro-logo {
        width: 52px;
        height: 52px;
        min-width: 52px;
    }
    .invoice-pro-logo .brand-logo {
        width: 34px;
        height: 34px;
    }
    .invoice-pro-org h2 {
        margin-bottom: .08rem;
        font-size: 1.22rem;
        line-height: 1.05;
    }
    .invoice-pro-org p,
    .invoice-contact-lines {
        font-size: .72rem;
    }
    .document-kicker,
    .invoice-pro-label,
    .document-meta-label,
    .info-label,
    .total-label {
        font-size: .62rem;
        letter-spacing: .055em;
    }
    .invoice-pro-title {
        gap: .32rem;
        justify-items: end;
        min-width: 190px;
        text-align: right;
    }
    .invoice-pro-title strong {
        font-size: 1.05rem;
    }
    .document-status {
        min-height: 24px;
        padding: .2rem .5rem;
        font-size: .62rem;
    }
    .invoice-pro-grid {
        display: grid;
        grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
        gap: .7rem;
        margin-bottom: .82rem;
    }
    .invoice-pro-bottom {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 42%);
        gap: .7rem;
        margin-top: .7rem;
    }
    .invoice-party-card,
    .invoice-terms {
        padding: .68rem;
    }
    .invoice-party-card h3 {
        margin: .15rem 0 .48rem;
        font-size: .96rem;
    }
    .invoice-party-card dl {
        gap: .28rem;
    }
    .invoice-party-card dl div {
        grid-template-columns: 68px minmax(0, 1fr);
        gap: .55rem;
    }
    .invoice-party-card dt,
    .invoice-detail-card span {
        font-size: .62rem;
    }
    .invoice-party-card dd,
    .invoice-detail-card strong {
        font-size: .82rem;
    }
    .invoice-detail-card > div {
        padding: .58rem .68rem;
    }
    .invoice-detail-card {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .invoice-detail-card > div {
        border-right: 1px solid #d9e4ea;
        border-bottom: 1px solid #d9e4ea;
    }
    .invoice-detail-card > div:nth-child(2n) {
        border-right: 0;
    }
    .invoice-detail-card > div:nth-last-child(-n+2) {
        border-bottom: 0;
    }
    .document-section {
        margin-top: .78rem;
    }
    .document-section-title {
        gap: .35rem;
        margin-bottom: .45rem;
        font-size: .82rem;
    }
    .document-table .table > :not(caption) > * > * {
        padding: .48rem .58rem;
    }
    .invoice-paper .document-table,
    .invoice-paper .table-responsive {
        width: 100%;
        overflow: visible;
    }
    .invoice-paper table {
        width: 100%;
        max-width: 100%;
        table-layout: fixed;
    }
    .invoice-paper th,
    .invoice-paper td {
        min-width: 0;
        overflow-wrap: anywhere;
    }
    .invoice-paper .table-responsive .invoice-line-table {
        font-size: 8px;
    }
    .invoice-paper .table-responsive .invoice-line-table > :not(caption) > * > * {
        padding: .3rem .22rem;
    }
    .invoice-paper .table-responsive .invoice-line-table th:nth-child(1) { width: 5%; }
    .invoice-paper .table-responsive .invoice-line-table th:nth-child(2) { width: 27%; }
    .invoice-paper .table-responsive .invoice-line-table th:nth-child(3) { width: 9%; }
    .invoice-paper .table-responsive .invoice-line-table th:nth-child(4) { width: 11%; }
    .invoice-paper .table-responsive .invoice-line-table th:nth-child(5) { width: 12%; }
    .invoice-paper .table-responsive .invoice-line-table th:nth-child(6) { width: 13%; }
    .invoice-paper .table-responsive .invoice-line-table th:nth-child(7) { width: 10%; }
    .invoice-paper .table-responsive .invoice-line-table th:nth-child(8) { width: 13%; }
    .invoice-paper thead { display: table-header-group; }
    .invoice-paper .document-section,
    .invoice-paper .document-table,
    .invoice-paper .table-responsive,
    .invoice-paper table,
    .invoice-paper tbody {
        break-inside: auto !important;
        page-break-inside: auto !important;
    }
    .invoice-paper tr { break-inside: avoid; page-break-inside: avoid; }
    .document-table thead th,
    .document-table tbody th {
        font-size: .62rem;
        letter-spacing: .035em;
    }
    .invoice-line-table small {
        font-size: .68rem;
    }
    .invoice-terms h3 {
        margin-bottom: .3rem;
        font-size: .82rem;
    }
    .invoice-terms p {
        font-size: .78rem;
        line-height: 1.36;
    }
    .invoice-bank-note {
        margin-top: .55rem;
        padding-top: .5rem;
    }
    .invoice-summary {
        width: min(100%, 380px);
    }
    .invoice-total-row {
        padding: .42rem .58rem;
        font-size: .78rem;
    }
    .invoice-total-row.grand {
        font-size: .9rem;
    }
    .invoice-pro-footer {
        margin-top: .9rem;
        padding-top: .65rem;
        font-size: .75rem;
    }
    .invoice-signature {
        min-width: 160px;
        padding-top: 1.65rem;
        font-size: .78rem;
    }
    .document-meta-card,
    .info-box,
    .document-note,
    .invoice-summary,
    .invoice-party-card,
    .invoice-detail-card,
    .invoice-terms,
    .report-section {
        break-inside: avoid;
    }
    .invoice-pro-head {
        border-bottom-color: #111827;
    }
}
/* Premium clinical visit summary */
.premium-clinical {
    --clinical-navy: #183b65;
    --clinical-ink: #26364d;
    --clinical-muted: #6d7d90;
    --clinical-line: #d9e1ea;
    width: min(100%, 960px);
    margin: 0 auto;
    padding: clamp(1.25rem, 3.5vw, 2.75rem);
    color: var(--clinical-ink);
    border: 1px solid #e1e7ed;
    background: #fff;
    box-shadow: 0 18px 42px rgba(25, 50, 77, .1);
}
.premium-clinical::before { display: none; }

.premium-clinical-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    padding-bottom: 1.15rem;
    border-bottom: 2px solid var(--clinical-navy);
}

.premium-clinical-brand { display: flex; align-items: center; gap: 1rem; min-width: 0; }
.premium-logo { display: grid; place-items: center; width: 82px; height: 82px; flex: 0 0 82px; border-radius: 4px; background: #eef3f6; }
.premium-logo img { width: 66px; height: 66px; object-fit: contain; }
.premium-clinical-brand h2 { margin: 0; color: var(--clinical-navy); font-size: 1.35rem; font-weight: 900; letter-spacing: .02em; }
.premium-clinical-brand p { margin: .18rem 0 .35rem; color: var(--clinical-muted); font-size: .78rem; }
.premium-clinical-brand div div { display: flex; flex-wrap: wrap; gap: .2rem .65rem; color: #7c8997; font-size: .68rem; }
.premium-clinical-title { display: grid; justify-items: end; text-align: right; }
.premium-clinical-title strong { color: var(--clinical-navy); font-size: 1.65rem; font-weight: 900; letter-spacing: .025em; text-transform: uppercase; }
.premium-clinical-title span { color: #7b888e; font-size: .8rem; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.premium-clinical-title small { margin-top: .45rem; color: var(--clinical-muted); font-weight: 700; }

.premium-section { margin-top: 1.7rem; break-inside: avoid; }
.premium-section > h3 { margin: 0 0 .8rem; padding-bottom: .55rem; color: var(--clinical-navy); border-bottom: 1px solid var(--clinical-line); font-size: .98rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.premium-profile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--clinical-line); background: #fbfcfe; }
.premium-profile-grid > div { display: grid; grid-template-columns: 120px minmax(0, 1fr); align-items: center; min-height: 44px; border-bottom: 1px solid var(--clinical-line); }
.premium-profile-grid > div:nth-child(odd) { border-right: 1px solid var(--clinical-line); }
.premium-profile-grid > div:nth-last-child(-n+2) { border-bottom: 0; }
.premium-profile-grid span { align-self: stretch; display: flex; align-items: center; padding: .45rem .65rem; color: #3c4c62; background: #f3f6f9; font-size: .75rem; font-weight: 850; }
.premium-profile-grid strong { padding: .45rem .7rem; font-size: .81rem; }
.premium-profile-grid strong small { display: block; margin-top: .15rem; color: var(--clinical-muted); font-weight: 600; }

.premium-callout { padding: 1rem 1.15rem; border-left: 4px solid var(--clinical-navy); background: #f6f8fb; }
.premium-callout-copy { display: grid; gap: .55rem; }
.premium-callout-copy > div { font-size: .85rem; line-height: 1.55; }
.premium-callout-copy strong { margin-right: .3rem; color: #34445a; }
.premium-vitals { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .7rem; margin-top: 1rem; }
.premium-vital-card { position: relative; display: grid; justify-items: center; align-content: center; min-height: 116px; padding: .85rem .55rem; overflow: hidden; border: 1px solid #e1e6ec; border-radius: 5px; text-align: center; background: #fff; box-shadow: 0 4px 12px rgba(30, 55, 80, .05); }
.premium-vital-card::before { position: absolute; inset: 0 0 auto; height: 3px; content: ""; background: #718297; }
.premium-vital-card.is-alert { background: #fffafa; }
.premium-vital-card.is-alert::before { background: #b5232b; }
.premium-vital-card > span { color: #687b91; font-size: .66rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.premium-vital-card > strong { margin: .45rem 0 .25rem; color: #1d2738; font-size: 1.05rem; font-weight: 900; }
.premium-vital-card.is-alert > strong, .premium-vital-card.is-alert > small { color: #ad1f27; }
.premium-vital-card > small { color: #718096; font-size: .62rem; }

.premium-detail-list { display: grid; gap: .75rem; padding-left: 1rem; border-left: 4px solid #7189a4; }
.premium-detail-list > div { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 1rem; padding: .65rem .75rem; background: #fbfcfd; }
.premium-detail-list span { color: var(--clinical-navy); font-size: .78rem; font-weight: 850; }
.premium-detail-list p, .premium-outcome p { margin: 0; font-size: .84rem; line-height: 1.55; }
.premium-outcome { display: grid; gap: .85rem; padding: 1rem 1.15rem; border-left: 4px solid #16a573; background: #effbf5; }
.premium-outcome strong { display: block; margin-bottom: .3rem; color: #087b59; font-size: .74rem; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; }
.premium-next-visit { display: flex; justify-content: space-between; align-items: center; margin-top: .8rem; padding: .75rem 1rem; color: #684d05; border: 1px solid #f2df9a; background: #fff9e8; }
.premium-next-visit span { font-size: .76rem; font-weight: 800; text-transform: uppercase; }
.premium-empty { padding: .9rem 1rem; color: var(--clinical-muted); border-left: 3px solid #cbd5df; background: #f8fafc; font-size: .82rem; }
.premium-medicine-table { border: 1px solid var(--clinical-line); }
.premium-medicine-table .table { margin: 0; }
.premium-medicine-table th { color: var(--clinical-navy); background: #f3f6f9; font-size: .7rem; text-transform: uppercase; }
.premium-medicine-table td { font-size: .8rem; }
.premium-medicine-table td small { display: block; color: var(--clinical-muted); }

.premium-clinical-footer { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 2rem; align-items: end; margin-top: 2rem; padding-top: 1.2rem; border-top: 1px solid var(--clinical-line); }
.premium-clinical-footer > div:first-child { color: #68778b; font-size: .7rem; line-height: 1.5; }
.premium-clinical-footer > div:first-child strong { color: #46586f; }
.premium-clinical-footer span { display: block; }
.premium-signature { padding-top: 1rem; border-top: 1px solid #97a4b2; text-align: right; }
.premium-signature strong { color: var(--clinical-navy); font-size: 1rem; }
.premium-signature span { font-size: .72rem; }
.premium-signature small { color: #7386a0; }

@media (max-width: 767.98px) {
    .premium-clinical-head { align-items: flex-start; flex-direction: column; }
    .premium-clinical-title { justify-items: start; text-align: left; }
    .premium-profile-grid { grid-template-columns: 1fr; }
    .premium-profile-grid > div, .premium-profile-grid > div:nth-child(odd) { border-right: 0; border-bottom: 1px solid var(--clinical-line); }
    .premium-profile-grid > div:last-child { border-bottom: 0; }
    .premium-vitals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .premium-detail-list > div { grid-template-columns: 1fr; gap: .25rem; }
    .premium-clinical-footer { grid-template-columns: 1fr; }
}

@media print {
    @page { size: A4; margin: 8mm; }
    .premium-clinical, .premium-clinical * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; color-adjust: exact !important; }
    html, body { width: 100%; background: #fff !important; }
    .premium-clinical { width: 100%; max-width: 960px; margin: 0 auto; padding: 10mm 11mm; overflow: visible !important; border: 1px solid #e1e7ed; border-radius: 0; box-shadow: none; font-family: Arial, Helvetica, sans-serif; }
    .premium-clinical-head { display: flex !important; align-items: center !important; flex-direction: row !important; justify-content: space-between !important; }
    .premium-clinical-title { justify-items: end !important; text-align: right !important; }
    .premium-profile-grid { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    .premium-profile-grid > div:nth-child(odd) { border-right: 1px solid var(--clinical-line) !important; }
    .premium-detail-list > div { display: grid !important; grid-template-columns: 190px minmax(0, 1fr) !important; }
    .premium-clinical-footer { display: grid !important; grid-template-columns: minmax(0, 1fr) 260px !important; }
    .premium-section { break-inside: auto; }
    .premium-profile-grid, .premium-vital-card, .premium-callout, .premium-detail-list > div, .premium-outcome, .premium-medicine-table, .premium-clinical-footer { break-inside: avoid; }
    .premium-vitals { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .premium-medicine-table { overflow: visible !important; }
    .premium-medicine-table thead { display: table-header-group; }
    .premium-medicine-table tr { break-inside: avoid; }
}
/* Calm, consolidated dashboard */
.dashboard-page .app-main {
    background:
        radial-gradient(circle at 96% 3%, rgba(14, 165, 164, .08), transparent 25rem),
        linear-gradient(145deg, #f8fbfc 0%, #f4f8fb 48%, #f7faf8 100%);
}
.dashboard-page .topbar { border-bottom-color: #dce8eb; }
.dashboard-page .metric {
    min-height: 88px;
    border-color: #dce8eb;
    background: linear-gradient(135deg, rgba(255,255,255,.98), rgba(242,249,249,.96));
    box-shadow: 0 7px 20px rgba(25, 67, 76, .055);
}
.dashboard-secondary-strip {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    overflow: hidden;
    border: 1px solid #dce7ec;
    border-radius: 10px;
    background: rgba(255, 255, 255, .72);
    box-shadow: 0 6px 18px rgba(29, 64, 78, .04);
}
.dashboard-secondary-strip > div { display: flex; align-items: center; gap: .55rem; min-width: 0; padding: .7rem .75rem; border-right: 1px solid #e3ecef; }
.dashboard-secondary-strip > div:last-child { border-right: 0; }
.dashboard-secondary-icon { display: grid; place-items: center; width: 29px; height: 29px; flex: 0 0 29px; border-radius: 8px; color: #267477; background: #e4f4f2; }
.dashboard-secondary-strip small, .dashboard-secondary-strip strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-secondary-strip small { color: #71818f; font-size: .61rem; }
.dashboard-secondary-strip strong { margin-top: .08rem; color: #183346; font-size: .82rem; }

.dashboard-pharmacy-panel {
    overflow: hidden;
    border: 1px solid #cfe5df;
    border-radius: 12px;
    background: linear-gradient(125deg, rgba(238,250,246,.96), rgba(244,249,255,.96));
    box-shadow: 0 9px 24px rgba(25, 89, 74, .065);
}
.dashboard-pharmacy-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .85rem 1rem; border-bottom: 1px solid rgba(173, 208, 198, .55); }
.dashboard-pharmacy-head > div { display: flex; align-items: center; gap: .65rem; }
.dashboard-pharmacy-head strong, .dashboard-pharmacy-head small { display: block; }
.dashboard-pharmacy-head strong { color: #154b48; font-size: .94rem; }
.dashboard-pharmacy-head small { margin-top: .08rem; color: #6b8583; font-size: .66rem; }
.dashboard-pharmacy-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; color: #fff; background: linear-gradient(135deg, #0f766e, #2ba79b); }
.dashboard-pharmacy-metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); padding: .35rem .65rem; }
.dashboard-pharmacy-metrics > div { display: flex; align-items: center; gap: .55rem; min-width: 0; padding: .65rem .55rem; }
.dashboard-pharmacy-metrics > div + div { border-left: 1px solid rgba(173, 208, 198, .5); }
.dashboard-pharmacy-metrics > div > i { color: #4d8d88; font-size: 1rem; }
.dashboard-pharmacy-metrics small, .dashboard-pharmacy-metrics strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-pharmacy-metrics small { color: #708683; font-size: .61rem; text-transform: uppercase; }
.dashboard-pharmacy-metrics strong { margin-top: .08rem; color: #173d3a; font-size: .9rem; }
.dashboard-low-stock { display: flex; align-items: center; gap: 1rem; padding: .65rem 1rem; border-top: 1px solid rgba(232, 188, 125, .42); background: rgba(255, 248, 231, .65); }
.dashboard-low-stock-title { display: flex; align-items: center; flex: 0 0 auto; gap: .35rem; color: #805b15; font-size: .72rem; }
.dashboard-low-stock-title span { color: #9b7b43; font-size: .62rem; }
.dashboard-low-stock-items { display: flex; flex-wrap: wrap; gap: .4rem; }
.dashboard-low-stock-items > span { padding: .3rem .55rem; border-radius: 999px; color: #77551b; background: rgba(255,255,255,.7); font-size: .66rem; }
.dashboard-low-stock-items strong { margin-right: .25rem; }
.dashboard-low-stock-items small { color: #9a7432; }

[data-bs-theme="dark"] .dashboard-page .app-main { background: var(--hc-bg); }
[data-bs-theme="dark"] .dashboard-secondary-strip,
[data-bs-theme="dark"] .dashboard-pharmacy-panel { background: var(--hc-surface); border-color: var(--hc-line); }
[data-bs-theme="dark"] .dashboard-secondary-strip strong,
[data-bs-theme="dark"] .dashboard-pharmacy-head strong,
[data-bs-theme="dark"] .dashboard-pharmacy-metrics strong { color: var(--hc-ink); }

@media (max-width: 1199.98px) {
    .dashboard-secondary-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .dashboard-secondary-strip > div:nth-child(3n) { border-right: 0; }
    .dashboard-pharmacy-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .dashboard-pharmacy-metrics > div:nth-child(4) { border-left: 0; }
}
@media (max-width: 767.98px) {
    .dashboard-secondary-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-secondary-strip > div:nth-child(3n) { border-right: 1px solid #e3ecef; }
    .dashboard-secondary-strip > div:nth-child(2n) { border-right: 0; }
    .dashboard-pharmacy-head, .dashboard-low-stock { align-items: flex-start; flex-direction: column; }
    .dashboard-pharmacy-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-pharmacy-metrics > div:nth-child(odd) { border-left: 0; }
}
