:root {
    --font-sans: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
    --primary: #0b7285;
    --primary-dark: #07535f;
    --primary-light: #53c5d0;
    --primary-rgb: 11, 114, 133;
    --secondary: #2563eb;
    --secondary-rgb: 37, 99, 235;
    --success: #16a34a;
    --warning: #d97706;
    --danger: #dc2626;
    --ink: #0f1f24;
    --text: #344b52;
    --muted: #6b7e86;
    --line: #d4e2e7;
    --line-strong: #bfd2d8;
    --surface: #ffffff;
    --surface-low: #f4f9fb;
    --surface-mid: #e8f2f5;
    --page: #eef6f8;
    --sidebar-bg: #082b35;
    --glass: rgba(255, 255, 255, .76);
    --glass-strong: rgba(255, 255, 255, .9);
    --glass-border: rgba(255, 255, 255, .78);
    --shadow-sm: 0 1px 2px rgba(11, 42, 52, .08);
    --shadow-md: 0 18px 38px rgba(11, 42, 52, .12), 0 4px 12px rgba(11, 42, 52, .06);
    --focus: 0 0 0 .22rem rgba(var(--primary-rgb), .22);
    --radius: 8px;
    --topbar-height: 70px;
    --sidebar-width: 286px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    font-size: 16px;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    background-color: var(--page);
    background-image:
        linear-gradient(rgba(var(--primary-rgb), .055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(var(--primary-rgb), .045) 1px, transparent 1px),
        linear-gradient(180deg, rgba(244, 249, 251, .92), rgba(232, 242, 245, .9));
    background-size: 34px 34px, 34px 34px, auto;
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.55;
    letter-spacing: 0;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4,
h5,
h6,
.navbar-brand {
    color: var(--ink);
    font-family: var(--font-sans);
    font-weight: 800;
    letter-spacing: 0;
}

a {
    color: var(--primary);
}

a:hover {
    color: var(--primary-dark);
}

.material-symbols-outlined {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.18rem;
    line-height: 1;
    vertical-align: middle;
}

.skip-link {
    position: fixed;
    top: -60px;
    left: 16px;
    z-index: 2000;
    padding: 10px 14px;
    color: #fff;
    background: var(--ink);
    border-radius: var(--radius);
}

.skip-link:focus {
    top: 12px;
}

.bg-clinical {
    background:
        linear-gradient(90deg, rgba(8, 43, 53, .98), rgba(8, 56, 66, .96)),
        var(--sidebar-bg);
    border-bottom: 1px solid rgba(255, 255, 255, .1);
    box-shadow: 0 8px 24px rgba(8, 43, 53, .18);
}

.app-topbar {
    min-height: var(--topbar-height);
    padding: 9px 26px;
}

.brand-lockup {
    display: inline-flex;
    align-items: center;
    min-height: 48px;
}

.brand-mark,
.login-mark,
.sidebar-brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.brand-mark {
    width: 44px;
    height: 44px;
    margin-right: 12px;
    color: var(--primary-dark);
    background: linear-gradient(145deg, #ffffff, #c8f5f2);
    border: 1px solid rgba(255, 255, 255, .72);
    border-radius: var(--radius);
    box-shadow: 0 8px 18px rgba(0, 0, 0, .14);
}

.brand-mark .material-symbols-outlined {
    font-size: 1.42rem;
    font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 24;
}

.brand-mark img,
.login-mark img,
.sidebar-brand-mark img {
    display: block;
    width: 78%;
    height: 78%;
    object-fit: contain;
}

.brand-copy {
    display: grid;
    line-height: 1.1;
}

.brand-title {
    color: #ffffff;
    font-size: 1rem;
    font-weight: 850;
}

.brand-subtitle {
    margin-top: 3px;
    color: rgba(255, 255, 255, .66);
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
}

.navbar-dark .navbar-text,
.navbar-dark .navbar-nav .nav-link {
    color: rgba(255, 255, 255, .82);
}

.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    max-width: 330px;
    padding: 7px 10px;
    margin-top: 1px;
    color: #ffffff;
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: var(--radius);
    line-height: 1.15;
}

.user-avatar-mini {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    color: #05333a;
    font-size: .8rem;
    font-weight: 900;
    background: #8ff3e7;
    border-radius: 50%;
}

.user-chip-name,
.user-chip-role {
    display: block;
}

.user-chip-name {
    overflow: hidden;
    font-size: .82rem;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-chip-role {
    margin-top: 2px;
    color: rgba(255, 255, 255, .58);
    font-size: .68rem;
    font-weight: 700;
}

.logout-link {
    min-height: 40px;
    padding-right: 14px !important;
    padding-left: 14px !important;
    font-weight: 700;
    border-radius: var(--radius);
}

.logout-link:hover {
    background: rgba(255, 255, 255, .1);
}

.app-shell {
    display: block;
    min-height: 100vh;
    padding-top: var(--topbar-height);
}

.sidebar {
    position: fixed;
    top: var(--topbar-height);
    bottom: 0;
    left: 0;
    z-index: 900;
    width: var(--sidebar-width);
    padding: 18px 12px;
    overflow-y: auto;
    background:
        linear-gradient(135deg, rgba(var(--primary-rgb), .22), transparent 32%),
        linear-gradient(180deg, rgba(255, 255, 255, .04), transparent 28%),
        linear-gradient(180deg, rgba(8, 43, 53, .9), rgba(8, 43, 53, .96)),
        url("../img/menu_bg.png") center / cover no-repeat,
        var(--sidebar-bg);
    border-right: 1px solid rgba(255, 255, 255, .08);
}

.sidebar-brand {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 11px;
    align-items: center;
    padding: 12px;
    margin-bottom: 15px;
    background: rgba(255, 255, 255, .055);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: var(--radius);
}

.sidebar-brand-mark {
    width: 42px;
    height: 42px;
    color: #042d36;
    background: #8ff3e7;
    border-radius: var(--radius);
}

.sidebar-brand-mark .material-symbols-outlined {
    font-size: 1.4rem;
    font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 24;
}

.sidebar-brand-title,
.sidebar-brand-sub {
    display: block;
}

.sidebar-brand-title {
    color: #fff;
    font-size: .9rem;
    font-weight: 850;
    line-height: 1.15;
}

.sidebar-brand-sub {
    margin-top: 2px;
    color: rgba(255, 255, 255, .58);
    font-size: .68rem;
    line-height: 1.3;
}

.sidebar-section {
    display: grid;
    gap: 5px;
}

.sidebar-label {
    margin: 22px 12px 9px;
    color: rgba(255, 255, 255, .44);
    font-size: .68rem;
    font-weight: 850;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.side-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 43px;
    padding: 10px 12px;
    color: rgba(255, 255, 255, .7);
    font-size: .84rem;
    font-weight: 750;
    text-decoration: none;
    border-radius: var(--radius);
    transition: color .16s ease, background-color .16s ease, transform .16s ease;
}

.side-link:hover {
    color: #fff;
    text-decoration: none;
    background: rgba(255, 255, 255, .08);
    transform: translateX(2px);
}

.side-link.active {
    color: #fff;
    background: linear-gradient(90deg, rgba(var(--primary-rgb), .9), rgba(var(--secondary-rgb), .48));
    box-shadow: 0 8px 18px rgba(0, 0, 0, .18);
}

.side-link .material-symbols-outlined {
    flex: 0 0 22px;
    font-size: 1.22rem;
}

.content {
    width: calc(100% - var(--sidebar-width));
    max-width: 1480px;
    min-height: calc(100vh - var(--topbar-height));
    padding: 28px;
    margin-left: var(--sidebar-width);
}

.login-wrapper {
    display: grid;
    min-height: 100vh;
    padding: 0;
    color: #dce9ef;
    background:
        linear-gradient(rgba(125, 236, 229, .08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(125, 236, 229, .07) 1px, transparent 1px),
        linear-gradient(90deg, #0d1724 0%, #0c1f2c 52%, #082b35 100%);
    background-size: 42px 42px, 42px 42px, auto;
}

.login-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(420px, .9fr);
    width: 100%;
    min-height: 100vh;
}

.login-hero {
    display: flex;
    align-items: center;
    min-height: 100vh;
    padding: 64px;
}

.login-hero-copy {
    max-width: 720px;
}

.login-brand-word {
    margin-bottom: 18px;
    color: #8ff3e7;
    font-family: var(--font-mono);
    font-size: .82rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.login-hero h1 {
    max-width: 780px;
    margin: 0 0 24px;
    color: #eff8fb;
    font-size: 3.25rem;
    font-weight: 850;
    line-height: 1.08;
}

.login-hero p {
    max-width: 680px;
    margin: 0 0 36px;
    color: #bdd0da;
    font-size: 1.08rem;
    line-height: 1.6;
}

.login-feature-stack {
    display: grid;
    gap: 12px;
    justify-items: start;
}

.login-feature-chip {
    display: inline-flex;
    align-items: center;
    gap: 13px;
    min-width: 318px;
    padding: 13px 18px;
    color: #eff8fb;
    background: rgba(255, 255, 255, .065);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: var(--radius);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
}

.login-feature-chip .material-symbols-outlined {
    color: #8ff3e7;
}

.login-feature-chip strong {
    font-size: .86rem;
    font-weight: 800;
}

.login-card {
    align-self: center;
    width: min(100% - 48px, 470px);
    margin: 40px auto;
    padding: 38px;
    color: #dce9ef;
    background: rgba(11, 25, 35, .72);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 18px;
    box-shadow: 0 24px 54px rgba(0, 0, 0, .32), 0 0 18px rgba(var(--primary-rgb), .1);
    backdrop-filter: blur(18px) saturate(150%);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
}

.login-brand {
    display: flex;
    gap: 14px;
    align-items: center;
    margin-bottom: 24px;
}

.login-mark {
    width: 52px;
    height: 52px;
    color: #063139;
    background: #8ff3e7;
    border-radius: var(--radius);
    box-shadow: 0 0 22px rgba(143, 243, 231, .26);
}

.login-mark .material-symbols-outlined {
    font-size: 1.55rem;
    font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 24;
}

.login-kicker {
    margin-bottom: 3px;
    color: #8ff3e7;
    font-family: var(--font-mono);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.login-card h1,
.login-card .h4 {
    color: #f4fbfd;
}

.login-card .text-muted {
    color: #a9bdc7 !important;
}

.login-card label {
    color: #dce9ef;
    font-family: var(--font-mono);
    font-size: .78rem;
    letter-spacing: .04em;
}

.login-input-shell {
    position: relative;
}

.login-input-shell .form-control {
    min-height: 54px;
    padding-right: 48px;
    color: #f4fbfd;
    background: rgba(6, 16, 25, .72);
    border-color: rgba(255, 255, 255, .16);
}

.login-input-shell .form-control:focus {
    color: #fff;
    background: rgba(6, 16, 25, .84);
    border-color: #8ff3e7;
    box-shadow: 0 0 0 1px rgba(143, 243, 231, .28), 0 0 20px rgba(143, 243, 231, .12);
}

.login-input-shell > .material-symbols-outlined {
    position: absolute;
    top: 50%;
    right: 15px;
    color: rgba(220, 233, 239, .58);
    transform: translateY(-50%);
    pointer-events: none;
}

.page-title {
    position: relative;
    isolation: isolate;
    margin-bottom: 22px;
    padding: 20px;
    overflow: hidden;
    background: var(--glass-strong);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(20px) saturate(155%);
    -webkit-backdrop-filter: blur(20px) saturate(155%);
}

.page-title::before {
    position: absolute;
    inset: 0;
    z-index: -1;
    content: "";
    background-image:
        linear-gradient(rgba(var(--primary-rgb), .08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(var(--primary-rgb), .07) 1px, transparent 1px);
    background-size: 32px 32px;
    opacity: .58;
}

.page-title-split {
    display: flex;
    gap: 18px;
    align-items: center;
    justify-content: space-between;
}

.page-title h1 {
    margin-bottom: 6px;
    font-size: 1.68rem;
    line-height: 1.15;
}

.page-title p {
    max-width: 760px;
}

.page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

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

.metric {
    position: relative;
    min-height: 140px;
    padding: 22px 20px 18px 28px;
    overflow: hidden;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
}

.metric::before {
    position: absolute;
    inset: 0 auto 0 0;
    width: 8px;
    content: "";
    background: linear-gradient(180deg, var(--primary), var(--secondary));
}

.metric-label {
    margin-bottom: 9px;
    color: var(--muted);
    font-size: .72rem;
    font-weight: 850;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.metric-value {
    color: var(--ink);
    font-size: 2.3rem;
    font-weight: 900;
    line-height: 1;
}

.metric-helper {
    margin-top: 10px;
    color: var(--muted);
    font-size: .82rem;
    font-weight: 650;
}

.panel {
    position: relative;
    margin-bottom: 22px;
    padding: 22px;
    background: var(--glass-strong);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
}

.panel h2,
.panel .h5 {
    margin-bottom: 16px;
    color: var(--ink);
    font-size: 1.05rem;
    font-weight: 850;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: -6px -6px 18px;
    padding: 0 6px 16px;
    border-bottom: 1px solid var(--line);
}

.panel-header h2 {
    margin-bottom: 0;
}

.table {
    margin-bottom: 0;
    color: var(--text);
    font-size: .86rem;
}

.table thead th {
    color: var(--muted);
    font-size: .7rem;
    font-weight: 850;
    letter-spacing: .04em;
    text-transform: uppercase;
    vertical-align: middle;
    background: rgba(244, 249, 251, .92);
    border-bottom: 1px solid var(--line-strong);
}

.table td,
.table th {
    padding: .78rem .82rem;
    vertical-align: middle;
    border-top: 1px solid var(--line);
}

.table-hover tbody tr:hover {
    background-color: rgba(var(--primary-rgb), .045);
}

.table-sm td,
.table-sm th {
    padding: .68rem .74rem;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

label {
    margin-bottom: 7px;
    color: var(--ink);
    font-size: .8rem;
    font-weight: 800;
}

.form-group {
    margin-bottom: 18px;
}

.form-control {
    min-height: 44px;
    padding: 10px 12px;
    color: var(--ink);
    background: rgba(255, 255, 255, .94);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}

.form-control:hover {
    border-color: #9fc2c9;
}

.form-control:focus {
    color: var(--ink);
    background: #fff;
    border-color: rgba(var(--primary-rgb), .72);
    box-shadow: var(--focus);
}

textarea.form-control {
    line-height: 1.55;
}

.note-textarea {
    min-height: 164px;
    resize: vertical;
}

.clinical-template-fieldsets {
    display: grid;
    gap: 18px;
}

.clinical-form-fields {
    display: block;
}

.template-intro {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px;
    margin-bottom: 18px;
    background: linear-gradient(135deg, rgba(var(--primary-rgb), .1), rgba(var(--secondary-rgb), .06));
    border: 1px solid rgba(var(--primary-rgb), .18);
    border-radius: var(--radius);
}

.template-kicker {
    display: block;
    margin-bottom: 6px;
    color: var(--primary-dark);
    font-size: .68rem;
    font-weight: 900;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.form-section-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 22px 0 12px;
    color: var(--primary-dark);
    font-size: .78rem;
    font-weight: 900;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.form-section-heading::after {
    display: block;
    flex: 1 1 auto;
    height: 1px;
    content: "";
    background: var(--line);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 42px;
    padding: 9px 16px;
    font-weight: 800;
    border-radius: var(--radius);
    transition: box-shadow .16s ease, transform .16s ease, background-color .16s ease, border-color .16s ease;
}

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

.btn:focus,
.btn.focus {
    box-shadow: var(--focus);
}

.btn-sm {
    min-height: 34px;
    padding: 6px 11px;
    font-size: .78rem;
}

.btn-clinical {
    color: #fff;
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 10px 20px rgba(var(--primary-rgb), .2);
}

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

.btn-outline-secondary,
.btn-outline-info,
.btn-outline-success,
.btn-outline-warning {
    color: var(--text);
    background: rgba(255, 255, 255, .72);
    border-color: var(--line-strong);
}

.btn-outline-secondary:hover,
.btn-outline-info:hover,
.btn-outline-success:hover,
.btn-outline-warning:hover {
    color: var(--primary-dark);
    background: rgba(var(--primary-rgb), .08);
    border-color: rgba(var(--primary-rgb), .35);
}

.btn-link {
    color: var(--primary);
    font-weight: 800;
}

.badge {
    padding: .38em .7em;
    font-weight: 800;
    border-radius: 999px;
}

.badge-success {
    color: #08733d;
    background: rgba(22, 163, 74, .14);
}

.badge-warning {
    color: #9a5800;
    background: rgba(217, 119, 6, .16);
}

.badge-secondary {
    color: #52666e;
    background: rgba(139, 157, 166, .16);
}

.alert {
    border-width: 1px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.clinical-note-block {
    padding: 16px;
    color: var(--ink);
    background: rgba(244, 249, 251, .92);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.modal-content {
    overflow: hidden;
    background: var(--glass-strong);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: 0 24px 70px rgba(11, 42, 52, .22);
    backdrop-filter: blur(18px) saturate(150%);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
}

.modal-header,
.modal-footer {
    border-color: var(--line);
}

.scan-review-dialog {
    max-width: 660px;
}

.scan-review-lead {
    margin-bottom: 14px;
    color: var(--muted);
    font-size: .88rem;
}

.scan-summary-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 14px;
}

.scan-summary-card {
    min-width: 0;
    padding: 9px 8px;
    color: var(--muted);
    text-align: center;
    background: rgba(255, 255, 255, .82);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.scan-summary-card.has-items {
    color: var(--primary-dark);
    border-color: rgba(var(--primary-rgb), .26);
}

.scan-summary-card.is-danger {
    color: #9f2424;
    background: rgba(254, 242, 242, .92);
    border-color: rgba(220, 38, 38, .24);
}

.scan-summary-value {
    display: block;
    font-size: 1.06rem;
    font-weight: 900;
    line-height: 1;
}

.scan-summary-label {
    display: block;
    margin-top: 5px;
    font-size: .62rem;
    font-weight: 850;
    line-height: 1.15;
    text-transform: uppercase;
}

.scan-detail-list {
    display: grid;
    gap: 8px;
}

.scan-review-detail {
    padding: 0;
    background: rgba(244, 249, 251, .92);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.scan-review-detail[open] {
    padding-bottom: 10px;
}

.scan-review-detail summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 12px;
    color: var(--ink);
    font-size: .88rem;
    font-weight: 900;
    cursor: pointer;
    list-style: none;
}

.scan-review-detail summary::-webkit-details-marker {
    display: none;
}

.scan-review-detail summary::after {
    margin-left: 10px;
    color: var(--muted);
    content: "+";
}

.scan-review-detail[open] summary::after {
    content: "-";
}

.scan-review-detail > *:not(summary) {
    margin-right: 12px;
    margin-left: 12px;
}

.scan-review-danger summary {
    color: #9f2424;
}

.scan-count-pill {
    min-width: 26px;
    padding: 2px 8px;
    margin-left: auto;
    color: var(--muted);
    font-size: .74rem;
    font-weight: 900;
    text-align: center;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 999px;
}

.abbr-remark-list {
    display: grid;
    gap: 14px;
    margin-bottom: 12px;
}

.abbr-remark-item {
    padding: 14px;
    background: rgba(244, 249, 251, .92);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.abbr-remark-item label {
    display: block;
    margin-bottom: 8px;
    color: var(--primary-dark);
    font-size: .92rem;
    font-weight: 850;
}

.approved-suggestion-list {
    display: grid;
    gap: 8px;
    padding-top: 12px;
    margin-top: 12px;
    border-top: 1px solid var(--line);
}

.approved-suggestion-title,
.term-evidence-title {
    color: var(--muted);
    font-size: .68rem;
    font-weight: 850;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.approved-suggestion-item {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    padding: 8px 10px;
    background: rgba(255, 255, 255, .86);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.approved-suggestion-code {
    padding: 3px 8px;
    color: var(--primary-dark);
    font-size: .75rem;
    font-weight: 900;
    background: rgba(var(--primary-rgb), .1);
    border: 1px solid rgba(var(--primary-rgb), .22);
    border-radius: 999px;
}

.approved-suggestion-meaning {
    color: var(--ink);
    font-weight: 700;
}

.approved-suggestion-source {
    color: var(--muted);
    font-size: .76rem;
}

.scan-evidence-cell {
    width: 34%;
    min-width: 290px;
    max-width: 340px;
}

.term-evidence-list {
    display: grid;
    gap: 8px;
    padding-top: 12px;
    margin-top: 12px;
    border-top: 1px solid var(--line);
}

.term-evidence-item {
    display: grid;
    gap: 6px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, .9);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.term-evidence-carousel {
    gap: 7px;
    padding-top: 0;
    margin-top: 0;
    border-top: 0;
}

.term-evidence-carousel .term-evidence-title {
    font-size: .62rem;
}

.term-evidence-track {
    display: flex;
    gap: 8px;
    max-width: 100%;
    padding-bottom: 4px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-snap-type: x proximity;
}

.term-evidence-track::-webkit-scrollbar {
    height: 7px;
}

.term-evidence-track::-webkit-scrollbar-thumb {
    background: #b7cdd3;
    border-radius: 999px;
}

.term-evidence-carousel .term-evidence-item {
    flex: 0 0 245px;
    max-height: 118px;
    overflow: hidden;
    scroll-snap-align: start;
}

.term-evidence-carousel .term-evidence-text {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.term-evidence-field {
    color: var(--primary-dark);
    font-size: .75rem;
    font-weight: 900;
}

.term-evidence-text {
    color: var(--ink);
    font-size: .82rem;
    line-height: 1.45;
}

.term-evidence-mark {
    padding: 1px 4px;
    margin: 0 2px;
    color: #5a3b00;
    font-weight: 900;
    background: #fff0a8;
    border-radius: 4px;
}

.dictionary-status {
    margin-top: 4px;
    color: var(--muted);
}

dl.row dt {
    color: var(--muted);
    font-size: .78rem;
    font-weight: 850;
    text-transform: uppercase;
}

dl.row dd {
    color: var(--ink);
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

@media (max-width: 991.98px) {
    .app-topbar {
        padding-right: 16px;
        padding-left: 16px;
    }

    .user-chip {
        width: 100%;
        max-width: none;
        margin: 12px 0 6px;
    }

    .login-shell {
        grid-template-columns: 1fr;
    }

    .login-hero {
        display: none;
    }

    .login-card {
        width: min(100% - 32px, 480px);
        margin: 86px auto 32px;
    }
}

@media (max-width: 768px) {
    .app-shell {
        display: block;
    }

    .sidebar {
        position: static;
        width: 100%;
        padding: 12px;
        border-right: 0;
        border-bottom: 1px solid rgba(255, 255, 255, .08);
    }

    .sidebar-brand {
        display: none;
    }

    .sidebar-section {
        display: flex;
        gap: 8px;
        padding-bottom: 4px;
        overflow-x: auto;
    }

    .side-link {
        flex: 0 0 auto;
        min-height: 42px;
        white-space: nowrap;
    }

    .sidebar-label {
        margin-top: 14px;
    }

    .content {
        width: 100%;
        padding: 18px 16px 28px;
        margin-left: 0;
    }

    .page-title-split {
        display: block;
    }

    .page-title h1 {
        font-size: 1.45rem;
    }

    .page-actions,
    .page-title > .btn,
    .page-title > div:last-child {
        margin-top: 14px;
    }

    .page-actions {
        justify-content: flex-start;
    }

    .panel {
        padding: 18px;
    }
}

@media (max-width: 575.98px) {
    .brand-subtitle {
        display: none;
    }

    .brand-title {
        font-size: .92rem;
    }

    .brand-mark {
        width: 38px;
        height: 38px;
    }

    .scan-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .table-responsive {
        border: 1px solid var(--line);
        border-radius: var(--radius);
    }

    .btn {
        width: 100%;
    }

    .page-actions .btn,
    .d-flex.flex-wrap .btn,
    .d-flex.flex-wrap .btn-link {
        width: 100%;
        margin-right: 0 !important;
    }

    .login-card {
        padding: 28px 22px;
    }
}

/* Past-project inspired portal skin */
:root,
[data-bs-theme="light"] {
    --font-sans: "Manrope", -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI Variable", "Segoe UI", Roboto, Arial, sans-serif;
    --font-display: "Manrope", -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI Variable", "Segoe UI", sans-serif;
    --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    --primary: #0f6fbf;
    --primary-dark: #0b4f8a;
    --primary-light: #48a6d9;
    --primary-rgb: 15, 111, 191;
    --secondary: #14b8a6;
    --secondary-rgb: 20, 184, 166;
    --sidebar-bg: #0b263f;
    --surface: #ffffff;
    --surface-low: #f1f8fb;
    --surface-mid: #e4f0f7;
    --background: #eef6fb;
    --on-surface: #0b1220;
    --body-color: #2d4054;
    --text-muted: #64748b;
    --border: #cfdce8;
    --glass-bg: rgba(255, 255, 255, 0.66);
    --glass-bg-strong: rgba(255, 255, 255, 0.82);
    --glass-border: rgba(255, 255, 255, 0.72);
    --glass-edge: rgba(255, 255, 255, 0.92);
    --glass-surface: linear-gradient(145deg, rgba(255, 255, 255, 0.84), rgba(255, 255, 255, 0.52) 52%, rgba(245, 251, 255, 0.44));
    --glass-surface-strong: linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(248, 253, 255, 0.66));
    --glass-highlight: linear-gradient(145deg, rgba(255, 255, 255, 0.64), rgba(255, 255, 255, 0.14) 46%, transparent 78%);
    --glass-shadow: 0 1.4rem 3rem rgba(11, 15, 25, 0.11), 0 0.35rem 1rem rgba(11, 15, 25, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.76);
    --radius-lg: 8px;
    --radius-xl: 16px;
    --focus-ring: rgba(var(--primary-rgb), 0.22);
    color-scheme: light;
}

[data-bs-theme="dark"] {
    --primary: #7dd3fc;
    --primary-dark: #38bdf8;
    --primary-light: #bae6fd;
    --primary-rgb: 125, 211, 252;
    --secondary: #2dd4bf;
    --secondary-rgb: 45, 212, 191;
    --sidebar-bg: #071827;
    --surface: #111c27;
    --surface-low: #172636;
    --surface-mid: #223549;
    --background: #07111d;
    --on-surface: #ffffff;
    --body-color: #d9deea;
    --text-muted: #a8afc2;
    --border: rgba(255, 255, 255, 0.14);
    --glass-bg: rgba(17, 28, 39, 0.68);
    --glass-bg-strong: rgba(17, 28, 39, 0.86);
    --glass-border: rgba(255, 255, 255, 0.12);
    --glass-edge: rgba(255, 255, 255, 0.18);
    --glass-surface: linear-gradient(145deg, rgba(29, 45, 61, 0.84), rgba(14, 24, 36, 0.66) 58%, rgba(11, 17, 29, 0.62));
    --glass-surface-strong: linear-gradient(145deg, rgba(37, 56, 75, 0.9), rgba(17, 28, 39, 0.74));
    --glass-highlight: linear-gradient(145deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.04) 42%, transparent 76%);
    --glass-shadow: 0 1.45rem 3.2rem rgba(0, 0, 0, 0.38), 0 0.35rem 1rem rgba(0, 0, 0, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    --focus-ring: rgba(var(--primary-rgb), 0.24);
    color-scheme: dark;
}

body.portal-body,
body.login-body {
    color: var(--body-color);
    background-color: var(--background);
    background-image: url("../img/menu_bg.png");
    background-position: center center;
    background-size: cover;
    background-attachment: fixed;
    font-family: var(--font-sans);
    font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
}

[data-bs-theme="dark"] body.portal-body,
[data-bs-theme="dark"] body.login-body {
    background-image:
        linear-gradient(135deg, rgba(11, 15, 25, 0.76), rgba(11, 15, 25, 0.9)),
        url("../img/menu_bg.png");
}

body.portal-body h1,
body.portal-body h2,
body.portal-body h3,
body.portal-body h4,
body.portal-body h5,
body.portal-body h6,
body.login-body h1,
body.login-body h2,
body.login-body h3,
body.login-body h4,
body.login-body h5,
body.login-body h6 {
    color: var(--on-surface);
    font-family: var(--font-display);
}

.app-shell {
    display: block;
    min-height: 100vh;
    padding-top: 0;
}

.sidebar.ohs-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    width: var(--sidebar-width);
    height: 100vh;
    padding: 18px 12px;
    overflow-y: auto;
    background:
        radial-gradient(circle at top left, rgba(var(--primary-rgb), 0.34), transparent 34%),
        radial-gradient(circle at 80% 12%, rgba(var(--secondary-rgb), 0.16), transparent 30%),
        var(--sidebar-bg);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar.ohs-sidebar .sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    margin-bottom: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-xl);
}

.brand-logo {
    flex-shrink: 0;
    width: 46px;
    height: 46px;
    padding: 5px;
    object-fit: contain;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 0.5rem 1.125rem rgba(11, 15, 25, 0.06);
}

.sidebar-brand-title.brand-title {
    color: #fff;
    font-family: var(--font-display);
    font-size: 0.92rem;
    font-weight: 800;
    line-height: 1.18;
}

.sidebar-brand-sub.brand-sub {
    margin-top: 2px;
    color: rgba(255, 255, 255, 0.58);
    font-size: 0.72rem;
    line-height: 1.25;
}

.sidebar-nav {
    flex: 0 0 auto;
    padding: 2px 0;
}

.sidebar-admin-nav {
    flex: 0 0 auto;
}

.sidebar.ohs-sidebar .nav-link,
.sidebar.ohs-sidebar .side-link {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 42px;
    padding: 0.62rem 0.75rem;
    margin-bottom: 3px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.83rem;
    font-weight: 600;
    line-height: 1.25;
    text-decoration: none;
    border-radius: var(--radius-lg);
    transition: color 0.16s ease, background 0.16s ease;
}

.sidebar.ohs-sidebar .nav-link:hover,
.sidebar.ohs-sidebar .side-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    transform: none;
}

.sidebar.ohs-sidebar .nav-link.active,
.sidebar.ohs-sidebar .side-link.active {
    color: #fff;
    background: linear-gradient(90deg, rgba(var(--primary-rgb), 0.9), rgba(var(--secondary-rgb), 0.46));
    box-shadow: 0 0.275rem 0.75rem -0.0625rem rgba(0, 0, 0, 0.2);
}

.sidebar-footer {
    padding-top: 14px;
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    margin-bottom: 8px;
}

.user-avatar {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    color: #fff;
    font-size: 0.82rem;
    font-weight: 800;
    background: var(--primary);
    border-radius: 50%;
}

.user-avatar-photo {
    padding: 3px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.58);
}

.user-avatar-photo.is-default-logo {
    background: #ffffff;
}

.user-avatar-photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.user-avatar-photo.is-default-logo img {
    object-fit: contain;
    padding: 3px;
}

.user-name {
    color: #fff;
    font-size: 0.84rem;
    font-weight: 700;
    line-height: 1.2;
}

.user-role {
    color: rgba(255, 255, 255, 0.58);
    font-size: 0.72rem;
}

.theme-switch-row {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 10px 12px;
}

.mode-switch {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    justify-items: center;
    gap: 0.75rem;
    width: min(100%, 184px);
    padding: 0.52rem 1rem;
    color: rgba(255, 255, 255, 0.68);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
}

.mode-switch input {
    width: 2.875rem;
    height: 1.5rem;
    margin: 0;
    cursor: pointer;
    background-color: var(--primary);
    background-image: radial-gradient(circle, #fff 0 0.45rem, transparent 0.48rem);
    background-repeat: no-repeat;
    background-position: left center;
    background-size: 1.5rem 1.5rem;
    border: 0;
    border-radius: 999px;
    appearance: none;
    transition: background-position 0.2s ease-in-out;
}

.mode-switch input:checked {
    background-position: right center;
}

.content.ohs-main {
    display: flex;
    flex-direction: column;
    width: auto;
    max-width: none;
    min-height: 100vh;
    padding: 0;
    margin-left: var(--sidebar-width);
}

.ohs-topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 64px;
    gap: 16px;
    padding: 0 28px;
    background: var(--glass-bg-strong);
    border-bottom: 1px solid var(--glass-border);
    box-shadow: 0 0.125rem 0.5rem rgba(11, 15, 25, 0.03);
    backdrop-filter: blur(18px) saturate(155%);
    -webkit-backdrop-filter: blur(18px) saturate(155%);
}

.topbar-title {
    color: var(--on-surface);
    font-family: var(--font-display);
    font-size: 1.08rem;
    font-weight: 800;
}

.topbar-subtitle {
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 600;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ohs-content {
    flex: 1;
    width: 100%;
    padding: 28px;
}

.page-title,
.panel,
.metric,
.modal-content,
.scan-review-detail,
.abbr-remark-item,
.template-intro,
.clinical-note-block {
    position: relative;
    isolation: isolate;
    color: var(--body-color);
    background: var(--glass-surface);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--glass-shadow);
    backdrop-filter: blur(24px) saturate(175%);
    -webkit-backdrop-filter: blur(24px) saturate(175%);
}

.page-title::before,
.panel::before,
.metric::after,
.template-intro::before,
.clinical-note-block::before {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    content: "";
    background: var(--glass-highlight);
    border-radius: inherit;
    box-shadow: inset 0 1px 0 var(--glass-edge), inset 0 -1px 0 rgba(255, 255, 255, 0.12);
}

.page-title > *,
.panel > *,
.metric > *,
.template-intro > *,
.clinical-note-block > * {
    position: relative;
    z-index: 1;
}

.page-title {
    padding: 18px 20px;
    margin-bottom: 20px;
    overflow: hidden;
}

.page-title::before {
    opacity: 1;
}

.page-title h1 {
    color: var(--on-surface);
    font-size: 1.45rem;
    font-weight: 900;
}

.panel {
    padding: 0;
    margin-bottom: 20px;
    overflow: hidden;
}

.panel > :not(.panel-header) {
    margin-right: 20px;
    margin-left: 20px;
}

.panel > form,
.panel > .table-responsive,
.panel > .row,
.panel > dl,
.panel > p,
.panel > .alert,
.panel > .clinical-note-block {
    margin-top: 20px;
    margin-bottom: 20px;
}

.panel > h2:first-child,
.panel > .h5:first-child,
.panel > h3:first-child,
.panel > .h6:first-child {
    margin: 20px 20px 8px;
}

.panel > h2:first-child + form,
.panel > .h5:first-child + form {
    margin-top: 8px;
}

.panel > .table-responsive {
    width: auto;
    max-width: calc(100% - 40px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.panel-header {
    margin: 0;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.24);
    border-bottom: 1px solid rgba(var(--primary-rgb), 0.12);
    backdrop-filter: blur(18px) saturate(150%);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
}

.panel h2,
.panel .h5,
.panel-header h2 {
    color: var(--on-surface);
    font-size: 0.96rem;
    font-weight: 800;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.metric.kpi-card,
.metric {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    min-height: auto;
    padding: 20px;
    overflow: hidden;
}

.metric::before {
    content: none;
}

.kpi-icon {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-lg);
}

.kpi-icon.blue { color: #0891b2; background: rgba(14, 165, 183, 0.12); }
.kpi-icon.green { color: var(--success); background: rgba(34, 197, 94, 0.12); }
.kpi-icon.amber { color: var(--warning); background: rgba(245, 158, 11, 0.14); }

.metric-value,
.kpi-value {
    margin-bottom: 4px;
    color: var(--on-surface);
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1;
}

.metric-label,
.kpi-label {
    margin-bottom: 0;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
}

.metric-helper {
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 0.76rem;
    font-weight: 600;
}

.portal-command {
    position: relative;
    isolation: isolate;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px 24px;
    align-items: center;
    margin-bottom: 18px;
    padding: 18px;
    overflow: hidden;
    background: var(--glass-surface-strong);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--glass-shadow);
    backdrop-filter: blur(26px) saturate(180%);
    -webkit-backdrop-filter: blur(26px) saturate(180%);
}

.portal-command::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    opacity: 0.74;
    background-image:
        linear-gradient(rgba(var(--primary-rgb), 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(var(--primary-rgb), 0.07) 1px, transparent 1px),
        linear-gradient(118deg, transparent 0 21%, rgba(var(--secondary-rgb), 0.12) 21.2% 21.8%, transparent 22% 56%, rgba(var(--primary-rgb), 0.12) 56.2% 56.8%, transparent 57%);
    background-size: 34px 34px, 34px 34px, 320px 100%;
}

.portal-command::after {
    content: "";
    position: absolute;
    right: -18px;
    bottom: 20px;
    z-index: 0;
    width: min(460px, 46%);
    height: 74px;
    background: linear-gradient(90deg, rgba(var(--primary-rgb), 0), rgba(var(--primary-rgb), 0.38), rgba(var(--secondary-rgb), 0.26), rgba(var(--primary-rgb), 0));
    clip-path: polygon(0 58%, 14% 58%, 20% 44%, 27% 74%, 36% 38%, 46% 58%, 56% 58%, 63% 24%, 72% 70%, 81% 46%, 100% 46%, 100% 57%, 84% 57%, 73% 82%, 63% 40%, 57% 68%, 45% 68%, 37% 52%, 28% 88%, 20% 58%, 14% 68%, 0 68%);
    opacity: 0.52;
}

.portal-command > * {
    position: relative;
    z-index: 1;
}

.portal-command-kicker {
    margin-bottom: 5px;
    color: var(--primary);
    font-size: 0.72rem;
    font-weight: 850;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.portal-command h1 {
    margin: 0;
    color: var(--on-surface);
    font-family: var(--font-display);
    font-size: 1.45rem;
    line-height: 1.12;
    font-weight: 900;
}

.portal-command p {
    max-width: 760px;
    margin: 5px 0 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.48;
}

.portal-command-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.table {
    color: var(--body-color);
    font-size: 0.84rem;
    border-collapse: separate;
    border-spacing: 0;
}

.table thead th {
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    background: var(--surface-low);
    border-bottom: 1px solid var(--border);
}

.table td,
.table th {
    padding: 0.78rem 0.82rem;
    border-top: 0;
    border-bottom: 1px solid var(--border);
}

.table-hover tbody tr:hover {
    background: rgba(var(--primary-rgb), 0.045);
}

.table-actions-cell {
    min-width: 142px;
    white-space: nowrap;
}

.table-actions-cell .btn {
    width: auto;
    margin: 2px;
    white-space: nowrap;
}

.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 0 18px;
    margin-top: 16px;
    margin-bottom: 4px;
    border-top: 1px solid var(--border);
}

.pagination-summary {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
}

.pagination-bar .pagination {
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0;
}

.pagination-bar .page-item {
    margin: 0 !important;
}

.pagination-bar .page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 0 16px;
    color: #202733;
    background: #ffffff;
    border: 1px solid rgba(17, 24, 39, 0.14);
    border-radius: 7px !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    font-size: 15px;
    font-weight: 500;
    line-height: 1;
    margin-left: 0 !important;
    text-align: center;
}

.pagination-bar .page-item:first-child .page-link,
.pagination-bar .page-item:last-child .page-link {
    min-width: 92px;
}

.pagination-bar .page-item:not(.active):not(.disabled) .page-link:hover,
.pagination-bar .page-item:not(.active):not(.disabled) .page-link:focus {
    color: #181d26;
    background: #f8fafc;
    border-color: rgba(17, 24, 39, 0.22);
}

.pagination-bar .page-item.active .page-link {
    color: #ffffff;
    background: #181d26;
    border-color: #181d26;
    box-shadow: none;
}

.pagination-bar .page-item.disabled .page-link {
    color: #7b8494;
    background: #ffffff;
    border-color: rgba(17, 24, 39, 0.12);
    opacity: 1;
}

@media (max-width: 640px) {
    .pagination-bar {
        align-items: flex-start;
        flex-direction: column;
    }

    .pagination-bar .pagination {
        gap: 8px;
    }

    .pagination-bar .page-link {
        min-width: 40px;
        min-height: 40px;
        padding: 0 13px;
    }

    .pagination-bar .page-item:first-child .page-link,
    .pagination-bar .page-item:last-child .page-link {
        min-width: 84px;
    }
}

label {
    color: var(--on-surface);
    font-size: 0.78rem;
    font-weight: 700;
}

.form-control {
    min-height: 44px;
    color: var(--on-surface);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    font-size: 0.9rem;
}

.form-control:focus {
    color: var(--on-surface);
    background: var(--surface);
    border-color: rgba(var(--primary-rgb), 0.55);
    box-shadow: 0 0 0 0.25rem var(--focus-ring);
}

.btn {
    min-height: 42px;
    font-size: 0.84rem;
    font-weight: 700;
    border-radius: var(--radius-lg);
}

.btn-clinical {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0.5rem 1.125rem -0.5rem rgba(var(--primary-rgb), 0.85);
}

.btn-clinical:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-outline-secondary,
.btn-outline-info,
.btn-outline-success,
.btn-outline-warning {
    color: var(--primary);
    background: rgba(255, 255, 255, 0.56);
    border-color: var(--border);
}

.badge-admin,
.badge-success,
.badge-warning,
.badge-secondary {
    padding: 0.42em 0.7em;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
}

.badge-admin {
    color: var(--primary-dark);
    background: rgba(var(--primary-rgb), 0.12);
}

.template-intro {
    display: block;
    padding: 16px;
    margin-bottom: 18px;
}

.form-section-heading {
    color: var(--primary);
    font-size: 0.72rem;
    font-weight: 850;
}

.mobile-menu-btn {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1200;
    display: none;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 64px;
    color: var(--primary);
    cursor: pointer;
    background: var(--surface);
    border: 0;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 0.125rem 0.4rem rgba(11, 15, 25, 0.05);
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 1050;
    display: none;
    pointer-events: none;
    background: rgba(11, 15, 25, 0.58);
    opacity: 0;
    transition: opacity 0.24s ease;
}

.sidebar-overlay.active {
    pointer-events: auto;
    opacity: 1;
}

body.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 16px;
}

body.login-body .login-wrapper {
    display: block;
    width: 100%;
    min-height: auto;
    padding: 0;
    color: var(--body-color);
    background: transparent;
}

.login-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.18fr) 420px;
    gap: 28px;
    align-items: stretch;
    width: 100%;
    max-width: 1120px;
    min-height: auto;
    margin: 0 auto;
}

.login-hero,
.login-card {
    color: var(--body-color);
    background: var(--glass-surface);
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    box-shadow: var(--glass-shadow);
    backdrop-filter: blur(24px) saturate(175%);
    -webkit-backdrop-filter: blur(24px) saturate(175%);
}

.login-hero {
    position: relative;
    display: grid;
    grid-template-rows: auto minmax(330px, 1fr) auto;
    gap: 20px;
    min-height: 620px;
    padding: 38px 44px 34px;
    overflow: hidden;
    isolation: isolate;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(238, 246, 251, 0.9) 48%, rgba(220, 240, 249, 0.82)),
        var(--surface);
}

.login-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    opacity: 0.5;
    background-image:
        linear-gradient(rgba(var(--primary-rgb), 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(var(--primary-rgb), 0.07) 1px, transparent 1px),
        linear-gradient(118deg, transparent 0 28%, rgba(var(--secondary-rgb), 0.13) 28.2% 28.7%, transparent 29% 62%, rgba(var(--primary-rgb), 0.12) 62.2% 62.7%, transparent 63%);
    background-size: 38px 38px, 38px 38px, 360px 100%;
    animation: login-grid-drift 18s linear infinite;
}

.login-hero > * {
    position: relative;
    z-index: 2;
}

.login-brand-word {
    max-width: 520px;
    margin-bottom: 16px;
    color: var(--primary-dark);
    font-size: 1.02rem;
    font-weight: 900;
    line-height: 1.25;
    text-transform: uppercase;
}

.login-hero h1 {
    margin: 0 0 12px;
    color: var(--on-surface);
    font-size: 34px;
    line-height: 1.08;
    font-weight: 900;
}

.login-hero p {
    max-width: 560px;
    margin: 0;
    color: #4b5368;
    font-size: 15px;
    line-height: 1.55;
}

.login-hero-visual {
    position: relative;
    z-index: 1;
    min-height: 340px;
    pointer-events: none;
}

.login-hero-visual::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0.42;
    background:
        linear-gradient(90deg, rgba(var(--primary-rgb), 0.14), transparent 28%, transparent 72%, rgba(var(--secondary-rgb), 0.12)),
        repeating-linear-gradient(135deg, transparent 0 34px, rgba(var(--primary-rgb), 0.06) 35px, transparent 36px);
    border: 1px solid rgba(var(--primary-rgb), 0.08);
    border-radius: 18px;
}

.chart-ribbon {
    position: absolute;
    left: 50%;
    top: 50%;
    width: min(640px, calc(100% + 60px));
    height: 360px;
    opacity: 0.78;
    transform: translate(-50%, -50%);
}

.chart-ribbon-line,
.chart-ribbon-pulse {
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.chart-ribbon-line {
    stroke-width: 2;
    stroke: rgba(var(--primary-rgb), 0.16);
    stroke-dasharray: 7 14;
    animation: chart-ribbon-drift 12s linear infinite;
}

.chart-ribbon-mid { stroke: rgba(var(--secondary-rgb), 0.16); animation-duration: 15s; }
.chart-ribbon-front { stroke: rgba(8, 145, 178, 0.14); animation-duration: 18s; }

.chart-ribbon-pulse {
    stroke: var(--primary);
    stroke-width: 4;
    stroke-dasharray: 76 620;
    opacity: 0.4;
    animation: chart-pulse-run 4.8s ease-in-out infinite;
}

.chart-ribbon-dot {
    fill: #fff;
    stroke: var(--primary);
    stroke-width: 4;
    opacity: 0.72;
    transform-box: fill-box;
    transform-origin: center;
    animation: chart-dot-pulse 4.8s ease-in-out infinite;
}

.chart-ribbon-dot.dot-b { animation-delay: -1.1s; }
.chart-ribbon-dot.dot-c { animation-delay: -2.2s; }

.chart-stage {
    position: absolute;
    top: 52%;
    left: 50%;
    width: min(350px, calc(100% - 160px));
    min-height: 280px;
    padding: 16px 16px 14px;
    color: var(--on-surface);
    background: rgba(255, 255, 255, 0.68);
    border: 1px solid rgba(var(--primary-rgb), 0.14);
    border-radius: 18px;
    box-shadow: 0 24px 52px rgba(15, 111, 191, 0.12);
    transform: translate3d(-50%, -50%, 0);
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    animation: chart-stage-float 9s ease-in-out infinite;
}

.chart-stage-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 850;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.chart-stage-header strong {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--secondary);
    font-size: 0.68rem;
}

.chart-stage-header strong::before {
    content: "";
    width: 7px;
    height: 7px;
    background: var(--secondary);
    border-radius: 999px;
    animation: live-dot 2.4s ease-in-out infinite;
}

.chart-stage-canvas {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
}

.chart-grid-lines path { fill: none; stroke: rgba(var(--primary-rgb), 0.11); stroke-width: 1; }
.chart-area { fill: rgba(var(--primary-rgb), 0.1); animation: chart-area-breathe 5.8s ease-in-out infinite; }
.chart-line { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.chart-line-shadow { stroke: rgba(var(--primary-rgb), 0.12); stroke-width: 12; }
.chart-line-main { stroke: var(--primary); stroke-width: 5; stroke-dasharray: 430; stroke-dashoffset: 430; animation: chart-line-draw 5.8s ease-in-out infinite; }
.chart-points circle { fill: #fff; stroke: var(--primary); stroke-width: 4; transform-box: fill-box; transform-origin: center; animation: chart-point-pop 5.8s ease-in-out infinite; }
.chart-points circle:nth-child(3) { stroke: var(--secondary); }

.chart-stage-bars {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 9px;
    align-items: end;
    height: 48px;
    margin-top: 4px;
    padding: 0 10px 4px;
}

.chart-stage-bars i {
    display: block;
    min-height: 12px;
    background: linear-gradient(180deg, var(--secondary), var(--primary));
    border-radius: 5px 5px 2px 2px;
    transform-origin: bottom;
    animation: chart-bar-rise 3.8s ease-in-out infinite;
}

.chart-stage-bars i:nth-child(1) { height: 38%; animation-delay: -0.2s; }
.chart-stage-bars i:nth-child(2) { height: 58%; animation-delay: -0.7s; }
.chart-stage-bars i:nth-child(3) { height: 46%; animation-delay: -1.2s; }
.chart-stage-bars i:nth-child(4) { height: 82%; animation-delay: -1.7s; }
.chart-stage-bars i:nth-child(5) { height: 64%; animation-delay: -2.2s; }
.chart-stage-bars i:nth-child(6) { height: 92%; animation-delay: -2.7s; }

.chart-panel {
    position: absolute;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px;
    color: var(--on-surface);
    background: rgba(255, 255, 255, 0.74);
    border: 1px solid rgba(var(--primary-rgb), 0.14);
    border-radius: 14px;
    box-shadow: 0 18px 36px rgba(15, 111, 191, 0.1);
    backdrop-filter: blur(18px) saturate(150%);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
    animation: panel-float 8s ease-in-out infinite;
}

.chart-panel-main { right: 26px; top: 10px; width: 198px; }
.chart-panel-side { left: 24px; top: 116px; width: 168px; animation-delay: -2.2s; }
.chart-panel-mini { right: 56px; bottom: 30px; flex-direction: row; align-items: center; gap: 9px; min-height: 54px; color: var(--primary-dark); font-size: 0.78rem; font-weight: 900; animation-delay: -4.4s; }
.chart-panel-donut { left: 62px; bottom: 52px; flex-direction: row; align-items: center; gap: 12px; width: 176px; animation-delay: -5.4s; }

.panel-eyebrow {
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: 850;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.panel-value {
    color: var(--on-surface);
    font-size: 1.3rem;
    font-weight: 900;
    line-height: 1;
}

.panel-bars {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
    align-items: end;
    height: 28px;
}

.panel-bars i {
    display: block;
    background: var(--primary);
    border-radius: 4px 4px 2px 2px;
}

.panel-bars i:nth-child(1) { height: 44%; }
.panel-bars i:nth-child(2) { height: 72%; background: var(--secondary); }
.panel-bars i:nth-child(3) { height: 56%; }
.panel-bars i:nth-child(4) { height: 88%; background: var(--secondary); }

.panel-progress {
    position: relative;
    display: block;
    height: 8px;
    overflow: hidden;
    background: rgba(var(--primary-rgb), 0.12);
    border-radius: 999px;
}

.panel-progress::after {
    position: absolute;
    inset: 0 34% 0 0;
    content: "";
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: inherit;
    animation: progress-breathe 3.8s ease-in-out infinite;
}

.donut-chart {
    flex: 0 0 auto;
    width: 52px;
    height: 52px;
    background:
        radial-gradient(circle, rgba(255, 255, 255, 0.96) 0 48%, transparent 49%),
        conic-gradient(var(--secondary) 0 42%, var(--primary) 42% 78%, rgba(var(--primary-rgb), 0.12) 78% 100%);
    border-radius: 999px;
    animation: donut-spin 8s linear infinite;
}

.donut-copy {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.donut-copy strong {
    color: var(--on-surface);
    font-size: 1.28rem;
    line-height: 1;
}

.donut-copy em {
    color: var(--text-muted);
    font-size: 0.66rem;
    font-style: normal;
    font-weight: 850;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.login-card {
    align-self: center;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    width: 100%;
    margin: 0;
    padding: 36px;
}

.login-card-logo {
    width: 62px;
    height: 62px;
    object-fit: contain;
    margin-bottom: 16px;
}

.login-card h2 {
    margin: 0 0 2px;
    color: var(--on-surface);
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 900;
}

.login-sub {
    margin-bottom: 28px;
    color: var(--text-muted);
    font-size: 13px;
}

.login-card-footnote {
    margin-top: 18px;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.45;
    text-align: center;
}

.login-footnote {
    color: #4b5368;
    font-size: 12px;
}

.login-mode {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 5;
    grid-template-columns: auto auto auto;
    width: auto;
    min-width: auto;
    color: var(--body-color);
    background: var(--surface);
    border-color: var(--border);
    box-shadow: 0 8px 24px rgba(18, 24, 38, 0.08);
}

.login-mode span:first-child { color: var(--on-surface); }
.login-mode span:last-child { color: var(--text-muted); }

@keyframes login-grid-drift {
    from { background-position: 0 0, 0 0; }
    to { background-position: 38px 38px, 38px 38px; }
}

@keyframes chart-ribbon-drift { to { stroke-dashoffset: -84; } }
@keyframes chart-pulse-run { 0% { stroke-dashoffset: 360; opacity: 0; } 18%, 72% { opacity: 0.48; } 100% { stroke-dashoffset: -360; opacity: 0; } }
@keyframes chart-dot-pulse { 0%, 100% { opacity: 0.42; transform: scale(0.86); } 50% { opacity: 0.9; transform: scale(1.08); } }
@keyframes chart-stage-float { 0%, 100% { transform: translate3d(-50%, -50%, 0); } 50% { transform: translate3d(-50%, -53%, 0); } }
@keyframes live-dot { 0%, 100% { box-shadow: 0 0 0 0 rgba(var(--secondary-rgb), 0.44); } 50% { box-shadow: 0 0 0 8px rgba(var(--secondary-rgb), 0); } }
@keyframes chart-area-breathe { 0%, 100% { opacity: 0.52; } 50% { opacity: 0.82; } }
@keyframes chart-line-draw { 0% { stroke-dashoffset: 430; opacity: 0.28; } 24%, 76% { stroke-dashoffset: 0; opacity: 1; } 100% { stroke-dashoffset: -430; opacity: 0.28; } }
@keyframes chart-point-pop { 0%, 100% { transform: scale(0.82); opacity: 0.58; } 48% { transform: scale(1.12); opacity: 1; } }
@keyframes chart-bar-rise { 0%, 100% { transform: scaleY(0.72); opacity: 0.72; } 50% { transform: scaleY(1); opacity: 1; } }
@keyframes donut-spin { to { transform: rotate(360deg); } }
@keyframes panel-float { 0%, 100% { transform: translate3d(0, 0, 0); } 50% { transform: translate3d(0, -8px, 0); } }
@keyframes progress-breathe { 0%, 100% { right: 42%; } 50% { right: 22%; } }

[data-bs-theme="dark"] .login-hero {
    background: var(--glass-surface);
}

[data-bs-theme="dark"] .login-hero p,
[data-bs-theme="dark"] .login-footnote {
    color: var(--text-muted);
}

[data-bs-theme="dark"] .chart-stage,
[data-bs-theme="dark"] .chart-panel {
    background: rgba(17, 28, 39, 0.78);
    border-color: rgba(255, 255, 255, 0.12);
}

@media (prefers-reduced-motion: reduce) {
    .login-hero::before,
    .chart-ribbon-line,
    .chart-ribbon-pulse,
    .chart-ribbon-dot,
    .chart-stage,
    .chart-line-main,
    .chart-area,
    .chart-points circle,
    .chart-stage-bars i,
    .chart-panel,
    .donut-chart,
    .panel-progress::after {
        animation: none !important;
    }
}

@media (max-width: 991.98px) {
    .login-shell {
        grid-template-columns: 1fr;
        max-width: 520px;
    }

    .login-hero {
        display: none;
    }

    .login-card {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: flex;
    }

    .sidebar-overlay {
        display: block;
    }

    .sidebar.ohs-sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        z-index: 1100;
        width: min(var(--sidebar-width), calc(100vw - 56px));
        height: 100vh;
        transform: translateX(-105%);
        transition: transform 0.24s ease;
    }

    .sidebar.ohs-sidebar.open {
        transform: translateX(0);
    }

    .content.ohs-main {
        width: 100%;
        min-height: 100vh;
        margin-left: 0;
    }

    .ohs-topbar {
        min-height: 64px;
        padding-left: 72px;
        padding-right: 18px;
    }

    .ohs-content {
        padding: 18px 16px 28px;
    }

    .portal-command {
        grid-template-columns: 1fr;
    }

    .portal-command-actions {
        justify-content: flex-start;
    }

    .panel > :not(.panel-header) {
        margin-right: 16px;
        margin-left: 16px;
    }
}

@media (max-width: 575.98px) {
    body.login-body {
        align-items: flex-start;
        padding: 72px 14px 18px;
    }

    .login-card {
        padding: 28px 22px;
    }

    .topbar-subtitle {
        display: none;
    }

    .portal-command h1 {
        font-size: 1.28rem;
    }
}

.clinical-entry-panel > form {
    display: grid;
    gap: 20px;
}

.entry-overview,
.document-summary-panel {
    overflow: hidden;
}

.entry-overview {
    margin-top: 20px;
    margin-bottom: 2px;
    background: rgba(255, 255, 255, 0.66);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.entry-overview-header,
.document-summary-header {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    background: linear-gradient(90deg, rgba(var(--primary-rgb), 0.1), rgba(var(--secondary-rgb), 0.045));
    border-bottom: 1px solid var(--border);
}

.entry-kicker {
    display: block;
    margin-bottom: 4px;
    color: var(--primary);
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.entry-record-pill {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 7px 11px;
    color: var(--primary-dark);
    font-size: 0.76rem;
    font-weight: 900;
    background: rgba(var(--primary-rgb), 0.1);
    border: 1px solid rgba(var(--primary-rgb), 0.22);
    border-radius: 999px;
    white-space: nowrap;
}

.entry-overview-grid {
    display: grid;
    grid-template-columns: minmax(220px, 1.2fr) minmax(180px, 0.8fr) minmax(220px, 1fr);
    gap: 16px;
    padding: 18px;
}

.entry-overview-grid .form-group {
    margin-bottom: 0;
}

.clinical-section-card {
    padding: 18px;
    margin-bottom: 18px;
    background: rgba(255, 255, 255, 0.54);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.clinical-section-card .form-section-heading {
    margin-top: 0;
}

.clinical-section-card .form-group:last-child {
    margin-bottom: 0;
}

.form-action-bar {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    margin-bottom: 20px;
    background: rgba(var(--primary-rgb), 0.07);
    border: 1px solid rgba(var(--primary-rgb), 0.16);
    border-radius: var(--radius-lg);
}

.form-action-bar strong,
.form-action-bar span {
    display: block;
}

.form-action-bar strong {
    color: var(--on-surface);
    font-size: 0.88rem;
}

.form-action-bar span {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.form-action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.document-summary-panel .document-summary-header,
.document-summary-panel .document-summary-grid {
    margin-right: 20px;
    margin-left: 20px;
}

.document-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    margin-top: 18px;
    margin-bottom: 20px;
    overflow: hidden;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.summary-item {
    min-height: 84px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.72);
}

.summary-item-wide {
    grid-column: span 2;
}

.summary-item span,
.clinical-review-label {
    display: block;
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.summary-item strong {
    display: block;
    margin-top: 6px;
    color: var(--on-surface);
    font-size: 0.96rem;
    line-height: 1.35;
}

.clinical-review-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin: 20px;
}

.clinical-review-field {
    min-height: 92px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.62);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.clinical-review-field-wide {
    grid-column: 1 / -1;
}

.clinical-review-value {
    margin-top: 8px;
    color: var(--on-surface);
    line-height: 1.62;
    white-space: pre-wrap;
}

@media (max-width: 991.98px) {
    .entry-overview-grid,
    .document-summary-grid,
    .clinical-review-grid {
        grid-template-columns: 1fr;
    }

    .summary-item-wide,
    .clinical-review-field-wide {
        grid-column: auto;
    }

    .form-action-bar {
        align-items: flex-start;
        flex-direction: column;
    }

    .form-action-buttons {
        justify-content: flex-start;
    }
}

/* Airtable DESIGN.md refresh */
:root,
[data-bs-theme="light"] {
    --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    --font-display: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    --primary: #181d26;
    --primary-dark: #0d1218;
    --primary-light: #41454d;
    --primary-rgb: 24, 29, 38;
    --secondary: #1b61c9;
    --secondary-rgb: 27, 97, 201;
    --success: #006400;
    --warning: #d9a441;
    --danger: #aa2d00;
    --ink: #181d26;
    --text: #333840;
    --muted: #41454d;
    --line: #dddddd;
    --line-strong: #9297a0;
    --surface: #ffffff;
    --surface-low: #f8fafc;
    --surface-mid: #e0e2e6;
    --background: #ffffff;
    --page: #ffffff;
    --sidebar-bg: #ffffff;
    --on-surface: #181d26;
    --body-color: #333840;
    --text-muted: #41454d;
    --border: #dddddd;
    --border-strong: #9297a0;
    --link: #1b61c9;
    --accent-coral: #aa2d00;
    --accent-forest: #0a2e0e;
    --accent-cream: #f5e9d4;
    --accent-peach: #fcab79;
    --accent-mint: #a8d8c4;
    --accent-yellow: #f4d35e;
    --accent-mustard: #d9a441;
    --glass-bg: #ffffff;
    --glass-bg-strong: #ffffff;
    --glass-border: #dddddd;
    --glass-edge: #ffffff;
    --glass-surface: #ffffff;
    --glass-surface-strong: #ffffff;
    --glass-highlight: none;
    --glass-shadow: 0 1px 0 rgba(24, 29, 38, 0.04);
    --shadow-sm: 0 1px 0 rgba(24, 29, 38, 0.04);
    --shadow-md: 0 14px 36px rgba(24, 29, 38, 0.08);
    --focus: 0 0 0 3px rgba(27, 97, 201, 0.16);
    --focus-ring: rgba(27, 97, 201, 0.16);
    --radius: 6px;
    --radius-lg: 10px;
    --radius-xl: 12px;
    color-scheme: light;
}

[data-bs-theme="dark"] {
    --primary: #f5e9d4;
    --primary-dark: #ffffff;
    --primary-light: #fcab79;
    --primary-rgb: 245, 233, 212;
    --secondary: #fcab79;
    --secondary-rgb: 252, 171, 121;
    --success: #a8d8c4;
    --warning: #f4d35e;
    --danger: #fcab79;
    --ink: #ffffff;
    --text: #e0e2e6;
    --muted: #c2c6ce;
    --line: #41454d;
    --line-strong: #9297a0;
    --surface: #1d1f25;
    --surface-low: #242832;
    --surface-mid: #333840;
    --background: #181d26;
    --page: #181d26;
    --sidebar-bg: #1d1f25;
    --on-surface: #ffffff;
    --body-color: #e0e2e6;
    --text-muted: #c2c6ce;
    --border: #41454d;
    --border-strong: #9297a0;
    --link: #fcab79;
    --glass-bg: #1d1f25;
    --glass-bg-strong: #1d1f25;
    --glass-border: #41454d;
    --glass-edge: #333840;
    --glass-surface: #1d1f25;
    --glass-surface-strong: #1d1f25;
    --glass-highlight: none;
    --glass-shadow: 0 1px 0 rgba(255, 255, 255, 0.04);
    --focus: 0 0 0 3px rgba(252, 171, 121, 0.2);
    --focus-ring: rgba(252, 171, 121, 0.2);
    color-scheme: dark;
}

body,
body.portal-body,
body.login-body {
    color: var(--body-color);
    background: var(--background) !important;
    background-image: none !important;
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.45;
    letter-spacing: 0;
    font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
}

h1,
h2,
h3,
h4,
h5,
h6,
.navbar-brand,
body.portal-body h1,
body.portal-body h2,
body.portal-body h3,
body.portal-body h4,
body.portal-body h5,
body.portal-body h6 {
    color: var(--on-surface);
    font-family: var(--font-display);
    font-weight: 400;
    letter-spacing: 0;
}

a {
    color: var(--link);
}

a:hover {
    color: var(--primary);
}

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

.bg-clinical,
.app-topbar {
    color: var(--on-surface);
    background: var(--surface) !important;
    border-bottom: 1px solid var(--border);
    box-shadow: none;
}

.app-shell {
    background: var(--background);
}

.sidebar.ohs-sidebar {
    background: var(--sidebar-bg) !important;
    background-image: none !important;
    border-right: 1px solid var(--border);
    box-shadow: none;
}

.sidebar.ohs-sidebar .sidebar-brand {
    background: var(--surface-low);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: none;
}

.brand-logo {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: none;
}

.sidebar-brand-title.brand-title,
.user-name {
    color: var(--on-surface);
    font-weight: 500;
}

.sidebar-brand-sub.brand-sub,
.user-role,
.sidebar-label {
    color: var(--text-muted);
    font-weight: 400;
    letter-spacing: 0;
}

.sidebar.ohs-sidebar .nav-link,
.sidebar.ohs-sidebar .side-link {
    color: var(--body-color);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    box-shadow: none;
    font-weight: 500;
}

.sidebar.ohs-sidebar .nav-link:hover,
.sidebar.ohs-sidebar .side-link:hover {
    color: var(--on-surface);
    background: var(--surface-low);
    border-color: var(--border);
}

.sidebar.ohs-sidebar .nav-link.active,
.sidebar.ohs-sidebar .side-link.active {
    color: #ffffff;
    background: #181d26 !important;
    border-color: #181d26;
    box-shadow: none;
}

.sidebar.ohs-sidebar .nav-link.active .material-symbols-outlined,
.sidebar.ohs-sidebar .side-link.active .material-symbols-outlined {
    color: var(--accent-peach);
}

.sidebar-footer {
    border-top: 1px solid var(--border);
}

.user-info {
    background: var(--surface-low);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.user-avatar {
    color: var(--accent-cream);
    background: #181d26;
}

.mode-switch,
.login-mode {
    color: var(--body-color);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    box-shadow: none;
    font-weight: 500;
}

.mode-switch input {
    background-color: #181d26;
    background-image: radial-gradient(circle, #ffffff 0 0.45rem, transparent 0.48rem);
}

.ohs-topbar {
    min-height: 64px;
    background: var(--surface) !important;
    border-bottom: 1px solid var(--border);
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.topbar-title {
    color: var(--on-surface);
    font-size: 15px;
    font-weight: 500;
}

.topbar-subtitle {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 400;
}

.ohs-content {
    padding: 32px 32px 56px;
    background: var(--background);
}

.page-title,
.panel,
.metric,
.modal-content,
.scan-review-detail,
.abbr-remark-item,
.template-intro,
.clinical-note-block,
.entry-overview,
.document-summary-panel,
.clinical-section-card,
.form-action-bar,
.clinical-review-field {
    color: var(--body-color);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.page-title::before,
.panel::before,
.metric::after,
.template-intro::before,
.clinical-note-block::before,
.portal-command::before,
.portal-command::after,
.login-hero-visual::before {
    display: none !important;
}

.page-title {
    padding: 24px 28px;
    border-left: 6px solid var(--accent-coral);
}

.page-title h1 {
    color: var(--on-surface);
    font-size: 24px;
    font-weight: 400;
}

.page-title p {
    color: var(--text-muted);
    font-size: 14px;
}

.panel-header {
    background: var(--surface-low);
    border-bottom: 1px solid var(--border);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.panel h2,
.panel .h5,
.panel-header h2 {
    color: var(--on-surface);
    font-size: 15px;
    font-weight: 500;
}

.portal-command {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 6px solid var(--accent-coral);
    border-radius: var(--radius-xl);
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    padding: 28px;
}

.portal-command-kicker,
.entry-kicker,
.form-section-heading {
    color: var(--accent-coral);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
}

.portal-command h1 {
    color: var(--on-surface);
    font-size: 32px;
    font-weight: 400;
    letter-spacing: 0;
}

.portal-command p {
    color: var(--body-color);
    font-size: 14px;
}

.metric.kpi-card,
.metric {
    background: var(--surface-low);
    border-color: var(--border);
    border-radius: var(--radius-lg);
}

.kpi-icon {
    border: 1px solid var(--border);
    border-radius: 8px;
}

.kpi-icon.amber {
    color: var(--accent-coral);
    background: var(--accent-cream);
}

.kpi-icon.green {
    color: var(--accent-forest);
    background: var(--accent-mint);
}

.kpi-icon.blue {
    color: var(--link);
    background: var(--surface-mid);
}

.metric-value,
.kpi-value {
    color: var(--on-surface);
    font-size: 32px;
    font-weight: 400;
}

.metric-label,
.kpi-label {
    color: var(--on-surface);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
}

.metric-helper {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 400;
}

.table {
    color: var(--body-color);
    font-size: 14px;
}

.table thead th {
    color: var(--text-muted);
    background: var(--surface-low);
    border-bottom: 1px solid var(--border-strong);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
}

.table td,
.table th {
    border-bottom: 1px solid var(--border);
    padding: 12px;
}

.table-hover tbody tr:hover {
    background: var(--accent-cream);
}

.form-control,
.custom-select,
select.form-control,
textarea.form-control {
    min-height: 44px;
    color: var(--body-color);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    box-shadow: none;
    font-size: 14px;
}

.form-control:hover,
.custom-select:hover,
select.form-control:hover,
textarea.form-control:hover {
    border-color: var(--border-strong);
}

.form-control:focus,
.custom-select:focus,
select.form-control:focus,
textarea.form-control:focus {
    color: var(--on-surface);
    background: var(--surface);
    border-color: var(--primary);
    box-shadow: var(--focus);
}

label {
    color: var(--on-surface);
    font-size: 13px;
    font-weight: 500;
}

.btn {
    min-height: 44px;
    border-radius: var(--radius-xl);
    box-shadow: none;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0;
}

.btn-clinical,
.btn-clinical:focus {
    color: #ffffff !important;
    background: #181d26;
    border-color: #181d26;
    box-shadow: none;
}

.btn-clinical:hover {
    color: #ffffff !important;
    background: #0d1218;
    border-color: #0d1218;
    box-shadow: none;
    transform: none;
}

.btn-outline-secondary,
.btn-outline-info,
.btn-outline-success,
.btn-outline-warning {
    color: var(--primary);
    background: var(--surface);
    border-color: var(--border-strong);
    box-shadow: none;
}

.btn-outline-secondary:hover,
.btn-outline-info:hover,
.btn-outline-success:hover,
.btn-outline-warning:hover {
    color: #ffffff;
    background: #181d26;
    border-color: #181d26;
}

.badge-admin,
.badge-success,
.badge-warning,
.badge-secondary,
.badge {
    border-radius: var(--radius);
    font-weight: 500;
    letter-spacing: 0;
}

.badge-admin {
    color: #ffffff;
    background: #181d26;
}

.badge-success {
    color: var(--accent-forest);
    background: var(--accent-mint);
}

.badge-warning {
    color: #181d26;
    background: var(--accent-yellow);
}

.badge-secondary {
    color: #181d26;
    background: var(--surface-mid);
}

.alert {
    border-radius: var(--radius-lg);
    box-shadow: none;
}

.alert-danger {
    color: var(--accent-coral);
    background: #fff5f0;
    border-color: var(--accent-peach);
}

.alert-warning {
    color: #181d26;
    background: #fff8dd;
    border-color: var(--accent-yellow);
}

.alert-success {
    color: var(--accent-forest);
    background: #eef8f3;
    border-color: var(--accent-mint);
}

.modal-content {
    border-radius: var(--radius-xl);
    box-shadow: 0 24px 64px rgba(24, 29, 38, 0.2);
}

.modal-header,
.modal-footer {
    background: var(--surface-low);
    border-color: var(--border);
}

.scan-summary-grid {
    gap: 12px;
}

.scan-summary-card {
    background: var(--surface-low);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: none;
}

.scan-summary-card.has-items {
    background: #fff8dd;
    border-color: var(--accent-mustard);
}

.scan-summary-card.is-danger {
    background: #fff5f0;
    border-color: var(--accent-coral);
}

.scan-summary-value {
    color: var(--on-surface);
    font-weight: 400;
}

.scan-summary-label,
.panel-eyebrow,
.summary-item span,
.clinical-review-label {
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
}

.abbr-remark-item,
.scan-review-detail {
    background: var(--surface);
    border-color: var(--border);
}

.scan-review-detail summary {
    color: var(--on-surface);
    background: var(--surface-low);
    font-weight: 500;
}

.entry-overview,
.clinical-section-card,
.document-summary-grid,
.clinical-review-field {
    background: var(--surface-low);
}

.entry-overview-header,
.document-summary-header {
    background: var(--surface-low);
    border-bottom: 1px solid var(--border);
}

.entry-record-pill {
    color: var(--accent-coral);
    background: var(--accent-cream);
    border: 1px solid var(--accent-peach);
    border-radius: var(--radius);
    font-weight: 500;
}

.form-action-bar {
    background: var(--surface-low);
    border-left: 6px solid var(--accent-forest);
}

.form-action-bar strong,
.summary-item strong,
.clinical-review-value {
    color: var(--on-surface);
}

.document-summary-grid {
    background: var(--border);
}

.summary-item {
    background: var(--surface);
}

body.login-body {
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
}

body.login-body .login-wrapper {
    color: var(--body-color);
    background: transparent;
}

.login-shell {
    grid-template-columns: minmax(0, 1fr) 392px;
    gap: 24px;
    max-width: 1120px;
}

.login-hero,
.login-card {
    color: var(--body-color);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.login-hero {
    min-height: 620px;
    padding: 48px;
}

.login-hero::before {
    display: block !important;
    inset: 0 auto auto 0;
    width: 100%;
    height: 6px;
    opacity: 1;
    background: var(--accent-coral);
    animation: none;
}

.login-brand-word {
    color: var(--accent-coral);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
}

.login-hero h1 {
    color: var(--on-surface);
    font-size: 40px;
    font-weight: 400;
    letter-spacing: 0;
}

.login-hero p,
.login-footnote,
.login-sub,
.login-card-footnote {
    color: var(--text-muted);
    font-size: 14px;
}

.login-hero-visual {
    min-height: 320px;
    overflow: hidden;
    background: var(--accent-cream);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
}

.chart-ribbon-line,
.chart-ribbon-pulse,
.chart-ribbon-dot,
.chart-stage,
.chart-area,
.chart-line-main,
.chart-points circle,
.chart-stage-bars i,
.chart-panel,
.donut-chart,
.panel-progress::after {
    animation: none !important;
}

.chart-ribbon-line {
    stroke: var(--border-strong);
    opacity: 0.5;
}

.chart-ribbon-pulse {
    stroke: var(--accent-coral);
    opacity: 0.55;
}

.chart-ribbon-dot,
.chart-points circle {
    fill: var(--surface);
    stroke: var(--accent-coral);
}

.chart-stage,
.chart-panel {
    color: var(--body-color);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.chart-area {
    fill: rgba(168, 216, 196, 0.56);
}

.chart-grid-lines path {
    stroke: rgba(65, 69, 77, 0.22);
}

.chart-line-main {
    stroke: var(--accent-forest);
    stroke-dasharray: none;
    stroke-dashoffset: 0;
}

.chart-line-shadow {
    stroke: rgba(10, 46, 14, 0.14);
}

.chart-stage-header,
.panel-eyebrow,
.donut-copy em {
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
}

.chart-stage-header strong {
    color: var(--accent-coral);
}

.chart-stage-header strong::before {
    background: var(--accent-coral);
    animation: none;
}

.chart-stage-bars i,
.panel-bars i {
    background: var(--accent-mustard);
}

.chart-stage-bars i:nth-child(2n),
.panel-bars i:nth-child(2n) {
    background: var(--accent-coral);
}

.panel-value,
.donut-copy strong {
    color: var(--on-surface);
    font-weight: 500;
}

.panel-progress {
    background: var(--surface-mid);
}

.panel-progress::after {
    background: var(--accent-coral);
}

.donut-chart {
    background: var(--accent-cream);
    border: 10px solid var(--accent-coral);
}

.login-card {
    padding: 36px;
}

.login-card h2 {
    color: var(--on-surface);
    font-size: 24px;
    font-weight: 500;
}

[data-bs-theme="dark"] .sidebar.ohs-sidebar .nav-link.active,
[data-bs-theme="dark"] .sidebar.ohs-sidebar .side-link.active {
    color: #181d26;
    background: var(--accent-cream) !important;
    border-color: var(--accent-cream);
}

[data-bs-theme="dark"] .btn-clinical,
[data-bs-theme="dark"] .btn-clinical:focus,
[data-bs-theme="dark"] .btn-clinical:hover {
    color: #181d26 !important;
    background: var(--accent-cream);
    border-color: var(--accent-cream);
}

[data-bs-theme="dark"] .badge-admin,
[data-bs-theme="dark"] .user-avatar {
    color: #181d26;
    background: var(--accent-cream);
}

[data-bs-theme="dark"] .login-hero-visual,
[data-bs-theme="dark"] .table-hover tbody tr:hover,
[data-bs-theme="dark"] .scan-summary-card.has-items,
[data-bs-theme="dark"] .scan-summary-card.is-danger,
[data-bs-theme="dark"] .alert-danger,
[data-bs-theme="dark"] .alert-warning,
[data-bs-theme="dark"] .alert-success {
    background: var(--surface-low);
}

@media (max-width: 768px) {
    .ohs-content {
        padding: 20px 16px 40px;
    }

    .page-title,
    .portal-command {
        padding: 20px;
    }

    .portal-command h1 {
        font-size: 28px;
    }
}

@media (max-width: 575.98px) {
    body.login-body {
        padding: 72px 14px 18px;
    }

    .login-card {
        padding: 28px 22px;
    }
}

/* Phase 2 consent writing workspace */
.clinical-entry-panel.consent-workspace-panel {
    padding: 0;
    overflow: visible;
    background: transparent;
    border: 0;
}

.clinical-entry-panel.consent-workspace-panel > form {
    display: block;
    gap: 0;
}

.consent-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
    gap: 20px;
    align-items: start;
}

.consent-workspace-main {
    display: grid;
    min-width: 0;
    gap: 18px;
}

.consent-entry-overview,
.consent-readiness,
.clinical-section-card,
.template-intro,
.consent-action-bar {
    box-shadow: none;
}

.consent-readiness {
    position: sticky;
    top: 84px;
    display: grid;
    gap: 16px;
    padding: 18px;
    background: var(--surface-low);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
}

.consent-readiness-header h2 {
    color: var(--on-surface);
    font-size: 18px;
    font-weight: 400;
}

.readiness-summary {
    display: grid;
    gap: 8px;
    padding: 12px;
    color: var(--on-surface);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    font-size: 13px;
    font-weight: 500;
}

.readiness-meter {
    height: 8px;
    overflow: hidden;
    background: var(--surface-mid);
    border-radius: 999px;
}

.readiness-meter span {
    display: block;
    width: 0;
    height: 100%;
    background: var(--accent-forest);
    border-radius: inherit;
    transition: width 0.18s ease;
}

.readiness-list {
    display: grid;
    gap: 10px;
}

.readiness-item {
    display: grid;
    grid-template-columns: 16px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 11px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.readiness-dot {
    width: 10px;
    height: 10px;
    margin-top: 5px;
    background: var(--surface-mid);
    border: 1px solid var(--border-strong);
    border-radius: 50%;
}

.readiness-item strong,
.readiness-item span[data-readiness-label] {
    display: block;
}

.readiness-item strong {
    color: var(--on-surface);
    font-size: 13px;
    font-weight: 500;
}

.readiness-item span[data-readiness-label] {
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.35;
}

.readiness-item.is-complete {
    border-color: rgba(10, 46, 14, 0.28);
}

.readiness-item.is-complete .readiness-dot {
    background: var(--accent-forest);
    border-color: var(--accent-forest);
}

.readiness-item.is-attention {
    border-color: var(--accent-mustard);
    background: #fff8dd;
}

.readiness-item.is-attention .readiness-dot {
    background: var(--accent-mustard);
    border-color: var(--accent-mustard);
}

.template-intro {
    align-items: flex-start;
    padding: 18px;
    background: var(--surface);
    border-radius: var(--radius-xl);
}

.consent-procedure-template .template-intro {
    background: var(--accent-cream);
    border-left: 6px solid var(--accent-coral);
}

.template-chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.template-chip {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 5px 9px;
    color: var(--accent-coral);
    background: var(--surface);
    border: 1px solid var(--accent-peach);
    border-radius: var(--radius);
    font-size: 12px;
    font-weight: 500;
}

.clinical-section-card {
    display: grid;
    gap: 14px;
    padding: 18px;
    background: var(--surface);
    border-radius: var(--radius-xl);
}

.section-card-heading {
    display: flex;
    gap: 12px;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.section-step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    color: #ffffff;
    background: #181d26;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 500;
}

.section-card-heading .form-section-heading {
    margin: 0;
    color: var(--on-surface);
    font-size: 16px;
    font-weight: 500;
}

.section-card-heading .form-section-heading::after {
    content: none;
}

.clinical-section-card .form-group {
    margin-bottom: 0;
}

.clinical-section-card .form-group + .form-group {
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.note-textarea {
    min-height: 150px;
}

.consent-action-bar {
    position: sticky;
    bottom: 16px;
    z-index: 30;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 6px solid var(--accent-forest);
    box-shadow: 0 12px 30px rgba(24, 29, 38, 0.08);
}

.consent-action-bar .form-action-buttons {
    gap: 8px;
}

@media (max-width: 1180px) {
    .consent-workspace {
        grid-template-columns: 1fr;
    }

    .consent-readiness {
        position: static;
        order: -1;
    }
}

@media (max-width: 768px) {
    .consent-action-bar {
        position: static;
    }

    .template-intro,
    .entry-overview-header,
    .form-action-bar {
        align-items: flex-start;
        flex-direction: column;
    }

    .template-chip-group {
        justify-content: flex-start;
    }
}

/* Phase 3 review checkpoint */
.review-checkpoint {
    padding: 16px 18px;
    margin-bottom: 16px;
    background: var(--accent-cream);
    border: 1px solid var(--accent-peach);
    border-left: 6px solid var(--accent-coral);
    border-radius: var(--radius-xl);
}

.review-checkpoint-kicker {
    display: block;
    margin-bottom: 5px;
    color: var(--accent-coral);
    font-size: 13px;
    font-weight: 500;
}

.review-checkpoint strong {
    display: block;
    color: var(--on-surface);
    font-size: 18px;
    font-weight: 500;
}

.review-checkpoint p {
    margin: 6px 0 0;
    color: var(--body-color);
    font-size: 14px;
}

.review-summary-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.scan-summary-card {
    align-items: flex-start;
    min-height: 104px;
}

.scan-summary-note {
    display: block;
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.3;
}

.scan-summary-card.is-choice {
    background: #fff8dd;
    border-color: var(--accent-mustard);
}

.scan-summary-card.is-review {
    background: var(--surface);
    border-color: var(--border-strong);
}

.scan-card-registered.has-items {
    background: #eef8f3;
    border-color: var(--accent-mint);
}

.scan-card-registered.has-items .scan-summary-value {
    color: var(--accent-forest);
}

.scan-card-restricted.has-items .scan-summary-note,
.scan-summary-card.is-danger .scan-summary-label {
    color: var(--accent-coral);
}

.scan-detail-list {
    display: grid;
    gap: 10px;
}

.scan-review-detail summary {
    min-height: 48px;
}

.scan-review-danger summary {
    color: var(--accent-coral);
    background: #fff5f0;
}

.scan-count-pill {
    color: var(--on-surface);
    background: var(--surface);
}

.patient-lookup-status {
    display: block;
    margin-top: 6px;
    font-size: 12px;
}

.patient-demographic-card {
    margin-top: 16px;
    padding: 16px;
    background: var(--surface-low);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.patient-demographic-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.patient-demographic-heading strong {
    color: var(--ink);
    font-size: 14px;
}

.patient-demographic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

.patient-demographic-item {
    min-width: 0;
    padding: 10px 12px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.patient-demographic-item-wide {
    grid-column: 1 / -1;
}

.patient-demographic-item span,
.legend-inline {
    line-height: 1.55;
}

.patient-demographic-item span {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

.patient-demographic-item strong {
    display: block;
    margin-top: 2px;
    color: var(--ink);
    font-size: 14px;
    font-weight: 700;
    word-break: break-word;
}

.legend-inline {
    padding: 12px 14px;
    margin-bottom: 16px;
    color: var(--ink);
    background: var(--surface-low);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.legend-inline-muted {
    color: var(--muted);
}

/* Background image visibility override - UI pages only, not generated PDFs */
body.portal-body,
body.login-body {
    background-color: var(--background) !important;
    background-image:
        linear-gradient(135deg, rgba(238, 246, 251, 0.58), rgba(238, 246, 251, 0.36)),
        url("../img/menu_bg.png") !important;
    background-position: center center !important;
    background-size: cover !important;
    background-repeat: no-repeat !important;
    background-attachment: fixed !important;
}

[data-bs-theme="dark"] body.portal-body,
[data-bs-theme="dark"] body.login-body {
    background-image:
        linear-gradient(135deg, rgba(7, 17, 29, 0.64), rgba(7, 17, 29, 0.78)),
        url("../img/menu_bg.png") !important;
}

body.portal-body .app-shell,
body.portal-body .content.ohs-main,
body.portal-body .ohs-content,
body.login-body .login-wrapper {
    background: transparent !important;
}

body.portal-body .ohs-topbar {
    background: rgba(255, 255, 255, 0.72) !important;
    backdrop-filter: blur(18px) saturate(155%);
    -webkit-backdrop-filter: blur(18px) saturate(155%);
}

[data-bs-theme="dark"] body.portal-body .ohs-topbar {
    background: rgba(17, 28, 39, 0.72) !important;
}

body.portal-body .page-title,
body.portal-body .panel,
body.portal-body .metric,
body.portal-body .modal-content,
body.portal-body .scan-review-detail,
body.portal-body .abbr-remark-item,
body.portal-body .template-intro,
body.portal-body .clinical-note-block,
body.portal-body .entry-overview,
body.portal-body .document-summary-panel,
body.portal-body .document-summary-grid,
body.portal-body .clinical-section-card,
body.portal-body .form-action-bar,
body.portal-body .consent-action-bar,
body.portal-body .clinical-review-field,
body.portal-body .consent-readiness,
body.portal-body .readiness-summary,
body.portal-body .readiness-item,
body.portal-body .patient-demographic-card,
body.portal-body .patient-demographic-item,
body.portal-body .legend-inline,
body.portal-body .review-checkpoint,
body.portal-body .scan-summary-card,
body.login-body .login-hero,
body.login-body .login-card {
    background-color: rgba(255, 255, 255, 0.78) !important;
    border-color: rgba(255, 255, 255, 0.74) !important;
    box-shadow: 0 18px 42px rgba(11, 15, 25, 0.1);
    backdrop-filter: blur(18px) saturate(150%);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
}

[data-bs-theme="dark"] body.portal-body .page-title,
[data-bs-theme="dark"] body.portal-body .panel,
[data-bs-theme="dark"] body.portal-body .metric,
[data-bs-theme="dark"] body.portal-body .modal-content,
[data-bs-theme="dark"] body.portal-body .scan-review-detail,
[data-bs-theme="dark"] body.portal-body .abbr-remark-item,
[data-bs-theme="dark"] body.portal-body .template-intro,
[data-bs-theme="dark"] body.portal-body .clinical-note-block,
[data-bs-theme="dark"] body.portal-body .entry-overview,
[data-bs-theme="dark"] body.portal-body .document-summary-panel,
[data-bs-theme="dark"] body.portal-body .document-summary-grid,
[data-bs-theme="dark"] body.portal-body .clinical-section-card,
[data-bs-theme="dark"] body.portal-body .form-action-bar,
[data-bs-theme="dark"] body.portal-body .consent-action-bar,
[data-bs-theme="dark"] body.portal-body .clinical-review-field,
[data-bs-theme="dark"] body.portal-body .consent-readiness,
[data-bs-theme="dark"] body.portal-body .readiness-summary,
[data-bs-theme="dark"] body.portal-body .readiness-item,
[data-bs-theme="dark"] body.portal-body .patient-demographic-card,
[data-bs-theme="dark"] body.portal-body .patient-demographic-item,
[data-bs-theme="dark"] body.portal-body .legend-inline,
[data-bs-theme="dark"] body.portal-body .review-checkpoint,
[data-bs-theme="dark"] body.portal-body .scan-summary-card,
[data-bs-theme="dark"] body.login-body .login-hero,
[data-bs-theme="dark"] body.login-body .login-card {
    background-color: rgba(17, 28, 39, 0.76) !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.26);
}

/* Admin user management page */
.user-page-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.user-page-title .btn,
.user-form-actions .btn,
.user-action-row .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.user-page-title .material-symbols-outlined,
.user-form-actions .material-symbols-outlined,
.user-action-row .material-symbols-outlined {
    font-size: 18px;
    line-height: 1;
}

.user-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.user-summary-card {
    display: flex;
    align-items: center;
    gap: 14px;
}

.user-summary-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    color: var(--primary);
    background: rgba(var(--primary-rgb), 0.12);
    border-radius: var(--radius-lg);
}

.user-summary-icon.is-active {
    color: var(--accent-forest);
    background: var(--accent-mint);
}

.user-summary-icon.is-admin {
    color: #181d26;
    background: var(--accent-yellow);
}

.user-summary-icon.is-muted {
    color: var(--text-muted);
    background: var(--surface-mid);
}

.user-admin-layout {
    display: grid;
    grid-template-columns: minmax(280px, 420px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.user-tab-shell {
    display: grid;
    gap: 16px;
}

.user-tabs {
    gap: 8px;
    border-bottom: 1px solid var(--border);
}

.user-tabs .nav-item {
    margin-bottom: -1px;
}

.user-tabs .nav-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 42px;
    padding: 9px 14px;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.46);
    border: 1px solid var(--border);
    border-bottom-color: transparent;
    border-radius: var(--radius) var(--radius) 0 0;
    font-weight: 700;
}

.user-tabs .nav-link:hover,
.user-tabs .nav-link:focus {
    color: var(--on-surface);
    border-color: rgba(var(--primary-rgb), 0.32);
    border-bottom-color: transparent;
}

.user-tabs .nav-link.active {
    color: var(--primary);
    background: rgba(255, 255, 255, 0.86);
    border-color: rgba(255, 255, 255, 0.86);
    border-bottom-color: rgba(255, 255, 255, 0.86);
}

.user-tabs .material-symbols-outlined {
    font-size: 18px;
    line-height: 1;
}

.user-tab-content > .tab-pane > .panel {
    margin-bottom: 0;
}

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

.user-form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 6px;
}

.user-count-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    min-height: 28px;
    padding: 4px 9px;
    color: var(--on-surface);
    background: var(--surface-low);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.user-account-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 230px;
}

.user-avatar-small {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    color: #ffffff;
    background: var(--primary);
    border-radius: 50%;
    font-size: 14px;
    font-weight: 800;
}

.user-account-cell strong,
.user-account-cell small {
    display: block;
}

.user-account-cell small {
    max-width: 280px;
    overflow: hidden;
    color: var(--text-muted);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
}

.record-action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
}

.inline-delete-form {
    display: inline-flex;
    margin: 0;
}

.btn-outline-danger {
    color: var(--accent-coral);
    background: var(--surface);
    border-color: var(--accent-peach);
    box-shadow: none;
}

.btn-outline-danger:hover {
    color: #ffffff;
    background: var(--accent-coral);
    border-color: var(--accent-coral);
}

.btn-outline-danger:disabled {
    color: var(--text-muted);
    cursor: not-allowed;
    background: var(--surface-mid);
    border-color: var(--border);
    opacity: 0.72;
}

.empty-table-message {
    padding: 24px;
    color: var(--text-muted);
    text-align: center;
}

body.portal-body .user-summary-card,
body.portal-body .user-count-pill {
    background-color: rgba(255, 255, 255, 0.78) !important;
    border-color: rgba(255, 255, 255, 0.74) !important;
    backdrop-filter: blur(18px) saturate(150%);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
}

[data-bs-theme="dark"] body.portal-body .user-summary-card,
[data-bs-theme="dark"] body.portal-body .user-count-pill {
    background-color: rgba(17, 28, 39, 0.76) !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
}

[data-bs-theme="dark"] .user-tabs .nav-link {
    background: rgba(17, 28, 39, 0.42);
}

[data-bs-theme="dark"] .user-tabs .nav-link.active {
    color: var(--accent-mint);
    background: rgba(17, 28, 39, 0.82);
    border-color: rgba(255, 255, 255, 0.12);
}

@media (max-width: 1180px) {
    .user-admin-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .user-page-title {
        align-items: stretch;
        flex-direction: column;
    }

    .user-summary-grid,
    .user-form-grid {
        grid-template-columns: 1fr;
    }

    .user-tabs {
        display: grid;
        grid-template-columns: 1fr;
    }

    .user-tabs .nav-link {
        justify-content: center;
        border-radius: var(--radius);
        border-bottom-color: var(--border);
    }

    .user-action-row {
        justify-content: flex-start;
    }
}

/* Account profile page */
.user-info-link {
    color: inherit;
    text-decoration: none;
    transition: background-color 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.user-info-link:hover,
.user-info-link:focus,
.user-info-link.active {
    color: inherit;
    text-decoration: none;
    border-color: rgba(var(--primary-rgb), 0.32);
    transform: translateY(-1px);
}

.user-info-link.active {
    background: rgba(var(--primary-rgb), 0.12);
}

.account-layout {
    display: grid;
    grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.account-summary-panel {
    position: sticky;
    top: 88px;
    padding: 30px 24px 24px;
    text-align: center;
    overflow: visible;
}

.account-summary-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 96px;
    height: 96px;
    margin: 4px auto 18px;
    padding: 6px;
    color: #ffffff;
    background: var(--surface-low);
    border: 1px solid rgba(var(--primary-rgb), 0.14);
    border-radius: 50%;
    box-shadow: 0 14px 28px rgba(11, 20, 35, 0.16);
    font-size: 28px;
    font-weight: 800;
}

.account-summary-avatar.is-default-logo {
    background: #ffffff;
}

.account-summary-avatar img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.account-summary-avatar.is-default-logo img {
    object-fit: contain;
    padding: 8px;
}

.account-summary-panel h2 {
    margin-top: 2px;
}

.profile-photo-remove-option {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 10px 0 0;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
}

.profile-photo-remove-option input {
    margin: 0;
}

.account-meta-list {
    margin: 0;
    text-align: left;
}

.account-meta-list div {
    padding: 12px 0;
    border-top: 1px solid var(--border);
}

.account-meta-list dt {
    margin-bottom: 4px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.account-meta-list dd {
    margin: 0;
    color: var(--on-surface);
    font-weight: 700;
    word-break: break-word;
}

.account-form-stack {
    display: grid;
    gap: 18px;
}

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

.account-form-wide {
    grid-column: 1 / -1;
}

.account-form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 6px;
}

.account-form-actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.account-form-actions .material-symbols-outlined {
    font-size: 18px;
    line-height: 1;
}

.account-password-note {
    padding: 10px 12px;
    margin: 2px 0 12px;
    color: var(--text-muted);
    background: var(--surface-low);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    font-size: 13px;
}

body.portal-body .account-summary-panel,
body.portal-body .account-form-panel,
body.portal-body .account-password-note {
    background-color: rgba(255, 255, 255, 0.78) !important;
    border-color: rgba(255, 255, 255, 0.74) !important;
    backdrop-filter: blur(18px) saturate(150%);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
}

[data-bs-theme="dark"] body.portal-body .account-summary-panel,
[data-bs-theme="dark"] body.portal-body .account-form-panel,
[data-bs-theme="dark"] body.portal-body .account-password-note {
    background-color: rgba(17, 28, 39, 0.76) !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
}

@media (max-width: 992px) {
    .account-layout {
        grid-template-columns: 1fr;
    }

    .account-summary-panel {
        position: static;
    }
}

@media (max-width: 640px) {
    .account-form-grid {
        grid-template-columns: 1fr;
    }

    .account-form-actions {
        justify-content: stretch;
    }

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