body.login-page {
    background: url('background.webp') no-repeat center center fixed;
    background-size: cover;
    animation: moveBackground 30s infinite alternate linear;
}

@keyframes moveBackground {
    0% { background-position: center top; }
    25% { background-position: top right; }
    50% { background-position: center bottom; }
    75% { background-position: bottom left; }
    100% { background-position: center top; }
}

.login-box {
    background-color: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    max-width: 400px;
    margin: auto;
}

.logo {
    display: block;
    margin: 0 auto 10px;
    width: 150px;
    filter: drop-shadow(2px 4px 6px rgba(0, 0, 0, 0.3));
}


.footer {
    background: rgba(0, 0, 0, 0.9);
    color: white;
    width: 100%;
    text-align: center;
    padding: 6px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: auto;
    z-index: 1000;
}


.logo-footer {
    width: 50px;
    height: auto;
    display: block;
    margin: 0;
    padding: 0;
    line-height: 0;
    vertical-align: middle;
    object-fit: contain;
}

.footer p {
    margin: 0;
    font-size: 10px;
    line-height: 1.2;
}



html, body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

body > .container,
body > .main-content {
    flex: 1;
}

.footer-wrapper {
    width: 100%;
    margin-top: auto;
    min-height: 10vh; /* 10% of the viewport height */

}


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


@media (max-width: 767.98px) {
  .table-mobile-sortable thead {
    display: none;
  }

  .table-mobile-sortable tr {
    display: block;
    margin-bottom: 1rem;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 0.5rem;
  }

  .table-mobile-sortable td {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem;
    border: none;
    border-bottom: 1px solid #eee;
  }

  .table-mobile-sortable td:last-child {
    border-bottom: none;
  }

  .table-mobile-sortable td::before {
    content: attr(data-label);
    font-weight: bold;
    text-align: left;
    flex: 1;
  }

  .table-mobile-sortable td > * {
    flex: 1;
    text-align: right;
  }
}

/* Updated mock charting interface */
.demo-credentials {
    background: rgba(13, 110, 253, 0.08);
    border: 1px solid rgba(13, 110, 253, 0.18);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 0.9rem;
}

.charting-navbar .user-toggle {
    font-weight: 700;
    text-decoration: none;
}

.user-detail-panel {
    max-width: 420px;
}

.metric-card {
    background: #ffffff;
    border: 1px solid #e3e7ee;
    border-radius: 10px;
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.metric-label {
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.75rem;
    font-weight: 700;
}

.metric-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.1;
}

.patient-list-table td,
.patient-list-table th {
    text-align: left;
}

.charting-screen .card-header,
.admin-add-patient-form h5 {
    font-weight: 700;
}

.patient-info-box p {
    margin-bottom: 0.45rem;
}

.patient-avatar {
    width: 64px;
    height: 64px;
    margin: 0 auto 0.5rem;
    border-radius: 50%;
    background: #343a40;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.5rem;
}

.person-model {
    width: 100%;
    max-width: 620px;
    min-height: 520px;
    border: 1px solid #e3e7ee;
    border-radius: 10px;
    background: #fff;
}

.chart-note {
    border-left: 4px solid #007bff;
    background: #f8f9fa;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    border-radius: 0 8px 8px 0;
}

.chart-note-list {
    max-height: 520px;
    overflow-y: auto;
}

.sticky-sidebar {
    position: sticky;
    top: 1rem;
}

body:not(.login-page) .footer.fixed-bottom {
    position: static !important;
}

body:not(.login-page) {
    background: #f5f7fa;
}

body:not(.login-page) .main-content {
    padding-bottom: 1.5rem;
}

@media (max-width: 991.98px) {
    .sticky-sidebar {
        position: static;
    }

    .person-model {
        min-height: 420px;
    }
}

@media (max-width: 767.98px) {
    .nav-tabs.chart-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        white-space: nowrap;
    }

    .metric-value {
        font-size: 1.5rem;
    }
}

.api-source-note {
    font-size: 0.9rem;
    color: #6c757d;
}

.readonly-disabled form,
form :disabled {
    cursor: not-allowed;
}

/* Time-series charting enhancements */
.timeseries-scroll,
.mar-scroll,
.lab-results-scroll,
.vent-scroll {
    overflow-x: auto;
    overflow-y: visible;
    border-radius: 0 0 0.25rem 0.25rem;
}

.timeseries-table,
.lab-results-table,
.mar-timeline-table,
.vent-table {
    min-width: 980px;
    border-collapse: separate;
    border-spacing: 0;
    background: #fff;
}

.timeseries-table thead th,
.lab-results-table thead th,
.mar-timeline-table thead th,
.vent-table thead th {
    background: #e8f2f8;
    color: #25465f;
    font-size: 0.78rem;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 5;
}

.sticky-col {
    position: sticky;
    left: 0;
    z-index: 4;
    background: #ffffff;
    box-shadow: 2px 0 0 rgba(0, 0, 0, 0.05);
}

.label-col,
.vent-label-col {
    min-width: 210px;
    max-width: 260px;
}

.lab-test-col {
    min-width: 180px;
    max-width: 220px;
}

.lab-range-col {
    left: 180px;
    min-width: 120px;
    max-width: 140px;
    background: #fbfcfd;
    z-index: 4;
}

.lab-group-row th {
    background: #38485a !important;
    color: #fff;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.abnormal-cell {
    background: #fff7dc !important;
    color: #7a4c00;
}

.lab-flag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.2rem;
    height: 1.2rem;
    margin-left: 0.25rem;
    border-radius: 50%;
    background: #b85b00;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
}

.mar-toolbar {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid #d9e5ee;
    background: #f7fbfd;
}

.mar-timeline-table {
    min-width: 1280px;
}

.mar-med-col {
    min-width: 320px;
    max-width: 380px;
    background: #fff !important;
}

.mar-med-name {
    color: #1b6d9b;
    font-weight: 700;
    line-height: 1.25;
}

.mar-timeline-table th,
.mar-timeline-table td {
    vertical-align: top;
}

.mar-time {
    font-weight: 700;
    color: #2d6587;
}

.mar-cell {
    min-width: 118px;
    height: 74px;
    padding: 0.25rem !important;
    background: #eaf7fc;
}

.mar-cell.empty-slot {
    background-image: repeating-linear-gradient(135deg, #f0f3f5 0, #f0f3f5 9px, #e3e7ec 9px, #e3e7ec 18px);
    opacity: 0.8;
}

.mar-event {
    display: block;
    padding: 0.25rem 0.35rem;
    border-radius: 0.3rem;
    font-size: 0.72rem;
    line-height: 1.15;
    text-align: center;
    min-height: 38px;
    border: 1px solid rgba(0,0,0,0.12);
}

.status-given .mar-event,
.legend-dot.status-given {
    background: #ccefb8;
    color: #315c1e;
}

.status-due .mar-event,
.legend-dot.status-due {
    background: #0d6efd;
    color: #ffffff;
}

.status-held .mar-event,
.legend-dot.status-held {
    background: #ffe0a6;
    color: #704600;
}

.status-not-given .mar-event,
.legend-dot.status-not-given {
    background: #f7b7b7;
    color: #7a1f1f;
}

.status-neutral .mar-event,
.legend-dot.status-neutral {
    background: #e4e9ef;
    color: #394b5c;
}

.legend-dot {
    display: inline-block;
    width: 0.85rem;
    height: 0.85rem;
    border-radius: 50%;
    vertical-align: -0.12rem;
    border: 1px solid rgba(0,0,0,0.18);
}

.mar-legend {
    padding: 0 0.75rem 0.75rem;
}

.imaging-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}

.imaging-card {
    border: 1px solid #dce3ea;
    border-radius: 0.5rem;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.imaging-thumb {
    min-height: 180px;
    background: #08111c;
    display: flex;
    align-items: center;
    justify-content: center;
}

.imaging-thumb img {
    width: 100%;
    height: 210px;
    object-fit: cover;
    display: block;
}

.imaging-placeholder {
    color: #9fb4c6;
    font-weight: 700;
}

.imaging-body {
    padding: 0.85rem;
}

.imaging-body h6 {
    font-weight: 700;
    color: #25465f;
}

.imaging-body p {
    font-size: 0.9rem;
    min-height: 3.2rem;
}

.airway-summary {
    padding: 0.75rem;
    border: 1px solid #d7e9d0;
    background: #f5fff2;
    border-radius: 0.35rem;
}

.vent-table {
    min-width: 1180px;
}

.vent-table .vent-section-row th,
.vent-table .vent-section-row td {
    background: #d7dee7 !important;
    color: #263647;
    font-weight: 700;
}

.vent-table td,
.vent-table th {
    white-space: nowrap;
    font-size: 0.8rem;
}

.chart-tabs .nav-link {
    font-weight: 600;
}

@media (max-width: 767.98px) {
    .lab-range-col {
        left: 160px;
    }
    .lab-test-col {
        min-width: 160px;
    }
    .mar-med-col {
        min-width: 250px;
    }
}

/* v5 usability fixes */
.timeseries-scroll,
.mar-scroll,
.lab-results-scroll,
.vent-scroll,
.spreadsheet-scroll {
    overflow-x: auto;
    overflow-y: auto;
    max-width: 100%;
}
.mar-scroll {
    max-height: 620px;
    border: 1px solid #d9e5ee;
    background: #f7fbfd;
}
.mar-timeline-table {
    min-width: 1700px;
    table-layout: fixed;
}
.mar-timeline-table thead th {
    z-index: 10;
}
.mar-timeline-table thead .mar-med-col,
.mar-med-col {
    width: 360px;
    min-width: 360px;
    max-width: 360px;
    left: 0;
    z-index: 12 !important;
}
.mar-cell {
    width: 145px;
    min-width: 145px;
    max-width: 145px;
    overflow: hidden;
}
.mar-event {
    width: 100%;
    max-width: 132px;
    margin: 0 auto;
    white-space: normal;
    word-break: normal;
    overflow-wrap: anywhere;
}
button.mar-event,
.mar-admin-button {
    border: 1px solid rgba(0,0,0,0.18);
    cursor: pointer;
}
.status-overdue .mar-event,
.legend-dot.status-overdue {
    background: #ffd0c2;
    color: #7b220d;
    box-shadow: inset 0 0 0 2px rgba(123,34,13,0.08);
}
.status-future .mar-event,
.legend-dot.status-future {
    background: #e4e7ea;
    color: #6c757d;
    opacity: 0.82;
}
.spreadsheet-card .card-body {
    background: #fbfdff;
}
.spreadsheet-table {
    min-width: 1320px;
}
.spreadsheet-table th {
    white-space: nowrap;
    font-size: 0.78rem;
}
.spreadsheet-table .form-control {
    min-width: 105px;
}
.spreadsheet-table input[name="vital_time[]"],
.spreadsheet-table input[name="entry_date_time[]"] {
    min-width: 170px;
}
.gap-2 > * {
    margin-right: 0.5rem;
    margin-bottom: 0.35rem;
}
.breath-sound-card audio {
    max-height: 42px;
}
.imaging-thumb img {
    object-fit: contain;
    background: #08111c;
}
.allergy-banner {
    border-left: 4px solid #b00020;
    background: #fff4f5;
    padding: 0.6rem;
    border-radius: 0.25rem;
    color: #5b1118;
}

/* v5.1 MAR/timeline overlap fixes */
.mar-scroll {
    overflow-x: auto !important;
    overflow-y: hidden !important;
    max-width: 100%;
    position: relative;
    padding-bottom: 0.25rem;
}
.mar-timeline-table {
    min-width: 1780px !important;
    table-layout: fixed !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
}
.mar-timeline-table th,
.mar-timeline-table td {
    position: relative;
    white-space: normal !important;
    vertical-align: top;
}
.mar-timeline-table thead th {
    z-index: 20 !important;
}
.mar-med-col {
    width: 365px !important;
    min-width: 365px !important;
    max-width: 365px !important;
    z-index: 22 !important;
}
.mar-timeline-table thead .mar-med-col {
    z-index: 24 !important;
}
.mar-cell {
    width: 150px !important;
    min-width: 150px !important;
    max-width: 150px !important;
    min-height: 78px;
    height: auto !important;
    overflow: visible !important;
}
.mar-event {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    min-height: 52px;
    box-sizing: border-box;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
    line-height: 1.2;
    margin: 0;
}
button.mar-event {
    appearance: none;
    text-align: center;
}
.mar-admin-button:hover,
.mar-admin-button:focus {
    outline: 2px solid rgba(13, 110, 253, 0.35);
    outline-offset: 1px;
}
.status-overdue .mar-event {
    background: #dc3545 !important;
    color: #fff !important;
}
.status-future .mar-event {
    background: #e7edf3 !important;
    color: #68717a !important;
    border-style: dashed;
}
.spreadsheet-scroll {
    max-width: 100%;
    overflow-x: auto !important;
    overflow-y: visible !important;
}
.spreadsheet-table td,
.spreadsheet-table th {
    vertical-align: middle;
    white-space: nowrap;
}
.worklist-filter-bar select {
    min-width: 9rem;
}
.worklist-table td {
    vertical-align: middle;
}
.browser-local-row,
.browser-practice-row {
    background: #f4fbff;
}

/* v6 MAR and diagnostic refinements */
.login-page .logo {
    width: 190px;
    max-height: 120px;
    object-fit: contain;
}
.mar-scroll {
    overflow-x: auto !important;
    overflow-y: auto !important;
    max-height: 68vh;
    isolation: isolate;
}
.mar-timeline-table {
    border-collapse: separate !important;
    border-spacing: 0 !important;
}
.mar-timeline-table thead th {
    position: sticky !important;
    top: 0;
    z-index: 30 !important;
    background: #dfeff8 !important;
}
.mar-timeline-table .mar-med-col {
    position: sticky !important;
    left: 0;
    z-index: 32 !important;
    background: #ffffff !important;
    box-shadow: 3px 0 0 rgba(0,0,0,0.08);
}
.mar-timeline-table thead .mar-med-col {
    z-index: 40 !important;
    background: #dfeff8 !important;
}
.mar-cell {
    padding: 0.2rem !important;
    overflow: visible !important;
}
.mar-event {
    min-height: 56px;
    font-size: 0.7rem;
}
.mar-by {
    display: block;
    font-size: 0.64rem;
    opacity: 0.9;
}
.diagnostic-group-title {
    padding: 0.45rem 0.65rem;
    background: #25465f;
    color: #fff;
    border-radius: 0.35rem;
    letter-spacing: 0.02em;
}
.diagnostic-report-panel {
    min-height: 180px;
    background: #f6f9fb;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 1rem;
    border-bottom: 1px solid #e2e8ef;
}
.diagnostic-modality {
    display: inline-block;
    margin-bottom: 0.75rem;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    background: #e8f2f8;
    color: #25465f;
    font-weight: 700;
    width: fit-content;
}
.breath-region-status {
    border-left: 4px solid #1b6d9b;
    background: #f2f9fd;
    border-radius: 0.25rem;
    padding: 0.55rem;
    margin-top: 0.5rem;
}

/* v6 refinements: color footer logo, MAR modal workflow, diagnostics */
body.login-page .login-logo {
    width: 245px;
    max-width: 82%;
    height: auto;
    object-fit: contain;
    filter: none !important;
}
body.login-page .login-footer-logo,
body.login-page .logo-footer {
    width: 95px;
    height: auto;
    filter: none !important;
}
body.login-page .footer {
    background: rgba(0, 0, 0, 0.78);
}
.mar-scroll {
    overflow-x: auto !important;
    overflow-y: auto !important;
    max-height: 700px;
}
.mar-timeline-table {
    border-collapse: separate !important;
    border-spacing: 0 !important;
}
.mar-timeline-table thead th {
    position: sticky;
    top: 0;
    z-index: 30 !important;
}
.mar-timeline-table .mar-med-col {
    position: sticky !important;
    left: 0 !important;
    background: #fff !important;
    z-index: 35 !important;
    box-shadow: 4px 0 7px rgba(37, 70, 95, 0.12);
}
.mar-timeline-table thead .mar-med-col {
    background: #e8f2f8 !important;
    z-index: 42 !important;
}
.mar-cell {
    width: 154px !important;
    min-width: 154px !important;
    max-width: 154px !important;
    padding: 0.28rem !important;
}
.mar-event {
    min-height: 60px !important;
    font-size: 0.71rem !important;
    line-height: 1.18 !important;
}
.mar-by,
.mar-event-meta {
    display: block;
    font-size: 0.66rem;
    opacity: 0.78;
    margin-top: 0.08rem;
}
.mar-order-line {
    color: #25465f;
    font-size: 0.74rem;
}
.diagnostic-card {
    display: flex;
    flex-direction: column;
}
.diagnostic-group-title {
    color: #25465f;
    font-weight: 800;
    border-left: 4px solid #0d6efd;
    padding-left: 0.5rem;
    margin: 1rem 0 0.75rem;
}
.diagnostic-report-panel {
    min-height: 180px;
    background: #f4f8fb;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0.75rem;
}
.diagnostic-modality {
    font-weight: 800;
    color: #25465f;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.78rem;
    margin-bottom: 0.35rem;
}
.breath-sound-card audio {
    max-height: 44px;
}
.breath-sound-click,
#personOutline {
    cursor: pointer;
}
/* v6 final contrast fix */
.diagnostic-group-title {
    background: #e8f2f8 !important;
    color: #25465f !important;
    border-left: 4px solid #1b6d9b !important;
}

/* v7 scroll/spreadsheet refinements */
.mar-scroll {
    width: 100%;
    overflow: auto !important;
    max-height: 72vh;
}
.mar-timeline-table {
    min-width: 2200px !important;
    width: max-content !important;
    table-layout: fixed !important;
}
.mar-timeline-table .mar-med-col,
.mar-timeline-table thead .mar-med-col {
    width: 430px !important;
    min-width: 430px !important;
    max-width: 430px !important;
}
.mar-timeline-table th:not(.mar-med-col),
.mar-timeline-table td.mar-cell {
    width: 174px !important;
    min-width: 174px !important;
    max-width: 174px !important;
}
.mar-cell {
    padding: 0.35rem !important;
}
.mar-event {
    min-width: 150px;
    max-width: 100%;
}
.diagnostic-media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.55rem;
    background: #08111c;
    padding: 0.55rem;
    border-bottom: 1px solid #203247;
}
.diagnostic-media-item {
    background: #0f1a28;
    border-radius: 0.35rem;
    padding: 0.35rem;
    text-align: center;
}
.diagnostic-media-item img {
    width: 100%;
    height: 190px;
    object-fit: contain;
    background: #000;
    border-radius: 0.25rem;
}
.diagnostic-media-caption {
    min-height: 1.2em;
    margin-top: 0.25rem;
}
.vent-entry-scroll {
    max-height: 520px;
    overflow: auto !important;
}
.vent-spreadsheet-table {
    min-width: 5400px !important;
    width: max-content !important;
    table-layout: auto !important;
}
.vent-spreadsheet-table th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: #e8f2f8;
}
.vent-spreadsheet-table td,
.vent-spreadsheet-table th {
    white-space: nowrap;
}
.vent-spreadsheet-table .form-control {
    min-width: 92px;
}
.vent-spreadsheet-table input[name="entry_date_time[]"] {
    min-width: 170px;
}


/* v8 UI refinements: tab separators, settings, MAR grid, diagnostics, ventilator column view */
.nav-session-controls .btn { min-width: 92px; }
.chart-settings-launch { line-height: 1.1; }
.nav-tabs.chart-tabs {
    background: #eaf3f1;
    border: 1px solid #b8d8d5;
    border-radius: 0.35rem 0.35rem 0 0;
    padding: 0.25rem 0.25rem 0;
    gap: 0.15rem;
}
.nav-tabs.chart-tabs .nav-item { margin-bottom: 0; }
.nav-tabs.chart-tabs .nav-link {
    border: 1px solid #a8c8c4;
    border-bottom: 0;
    background: #f8fbfb;
    color: #25465f;
    font-weight: 700;
    margin-right: 0.12rem;
    border-radius: 0.3rem 0.3rem 0 0;
}
.nav-tabs.chart-tabs .nav-link.active {
    background: #ffffff;
    color: #0f5132;
    border-top: 3px solid #198754;
}
.tab-content {
    border: 1px solid #b8d8d5;
    border-top: 0;
    background: #fff;
    padding: 1rem;
}
.theme-clinical:not(.login-page) { background: #f2f7f7; }
.theme-clinical .navbar.bg-dark { background: #25465f !important; }
.theme-clinical .card-header, .theme-clinical .thead-light th { background: #e8f2f8 !important; color: #25465f; }
.theme-slate:not(.login-page) { background: #1d2630; color: #e9eef3; }
.theme-slate .navbar.bg-dark { background: #111820 !important; }
.theme-slate .card, .theme-slate .tab-content, .theme-slate .patient-info-box, .theme-slate .modal-content { background: #263442 !important; color: #e9eef3; border-color: #4b5d6d; }
.theme-slate .card-header, .theme-slate .thead-light th, .theme-slate .nav-tabs.chart-tabs { background: #18222d !important; color: #e9eef3; border-color: #526a7e; }
.theme-slate .nav-tabs.chart-tabs .nav-link { background: #2e4052; color: #e9eef3; border-color: #526a7e; }
.theme-slate .nav-tabs.chart-tabs .nav-link.active { background: #3e5368; color: #ffffff; border-top-color: #76d7c4; }
.theme-slate .text-muted, .theme-slate .small.text-muted { color: #c8d1d8 !important; }
.theme-slate .table { color: #e9eef3; }
.theme-slate .table-bordered td, .theme-slate .table-bordered th { border-color: #506474; }
.theme-contrast:not(.login-page) { background: #ffffff; }
.theme-contrast .navbar.bg-dark { background: #000000 !important; }
.theme-contrast .card-header, .theme-contrast .thead-light th { background: #ffffff !important; color: #000000; border-bottom: 2px solid #000; }
.theme-contrast .nav-tabs.chart-tabs { background: #fff; border-color: #000; }
.theme-contrast .nav-tabs.chart-tabs .nav-link { background: #fff; color: #000; border-color: #000; }
.theme-contrast .nav-tabs.chart-tabs .nav-link.active { border-top: 4px solid #000; }
.tab-order-settings-list { max-height: 280px; overflow-y: auto; }
.mar-toolbar { padding: 0.65rem; background: #f8fbfb; border-bottom: 1px solid #d6e4e8; }
.mar-scan-launcher { max-width: 460px; }
.mar-timeline-table tr.mar-row-dc .mar-med-col,
.mar-timeline-table tr.mar-row-dc td { background-image: repeating-linear-gradient(-45deg, #e9ecef, #e9ecef 10px, #d8dde2 10px, #d8dde2 20px) !important; }
.mar-timeline-table tr.mar-row-inactive .mar-med-col,
.mar-timeline-table tr.mar-row-inactive td { background: #fff3cd !important; }
.mar-empty-event { color: transparent; min-height: 52px; }
.mar-empty-event .mar-empty-time { color: #6c757d; opacity: 0.4; }
.mar-empty-event:hover { color: #25465f; background: rgba(13,110,253,0.08); }
.mar-event { white-space: normal !important; overflow: hidden; }
.diagnostic-table th, .diagnostic-table td { vertical-align: top; }
.diagnostic-report-text { white-space: pre-wrap; background: #f8f9fa; border: 1px solid #e2e8ef; border-radius: 0.35rem; padding: 0.75rem; min-height: 160px; font-family: inherit; }
.diagnostic-media-list .btn { text-align: left; }
.note-category-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0.75rem; }
.note-category-card { border: 1px solid #dde6ec; border-radius: 0.45rem; padding: 0.75rem; background: #fff; }
.note-category-card h6 { font-weight: 800; color: #25465f; border-bottom: 1px solid #e3e7ee; padding-bottom: 0.35rem; }
.orders-table td, .orders-table th { vertical-align: middle; }
.vent-column-scroll { width: 100%; max-height: 68vh; overflow: auto; }
.vent-column-table, .vent-column-entry-table, .vent-table { min-width: 1200px; width: max-content; border-collapse: separate; border-spacing: 0; }
.vent-column-table thead th, .vent-column-entry-table thead th, .vent-table thead th { position: sticky; top: 0; background: #e8f2f8; z-index: 20; }
.vent-label-col { left: 0; width: 260px; min-width: 260px; max-width: 260px; background: #ffffff !important; z-index: 30 !important; box-shadow: 3px 0 6px rgba(37,70,95,.12); }
.vent-doc-header, .vent-doc-cell, .vent-column-table td, .vent-table td { min-width: 190px; max-width: 240px; }
.vent-doc-cell .form-control { min-width: 170px; }
.vent-section-row th { background: #25465f !important; color: #fff !important; font-weight: 800; }
.gap-2 { gap: .5rem; }
@media (max-width: 767.98px) {
    .nav-session-controls { flex-direction: row !important; gap: .25rem; }
    .nav-session-controls .btn { min-width: auto; }
    .tab-content { padding: .65rem; }
}

/* v9 Epic-style shell, fixed footer, settings themes, flowsheet grids */
body:not(.login-page) .footer.fixed-bottom,
.footer.fixed-bottom {
    position: fixed !important;
    left: 0;
    right: 0;
    bottom: 0;
}
body:not(.login-page) { padding-bottom: 88px; }
body.login-page { padding-bottom: 92px; }
body:not(.login-page) .main-content { padding-bottom: 2.75rem; }
.navbar-brand-logo {
    width: 116px;
    max-height: 44px;
    object-fit: contain;
    filter: none !important;
}
.charting-navbar .navbar-brand span { font-weight: 800; letter-spacing: .02em; }

/* Epic-blue default, with prior clinical theme preserved in settings */
body.theme-epic:not(.login-page) { background: #e8f5fd; color: #1f2e3b; }
.theme-epic .navbar.bg-dark { background: linear-gradient(#55bdf1, #1f8ed1) !important; border-bottom: 1px solid #096ca5; }
.theme-epic .navbar-dark .navbar-nav .nav-link,
.theme-epic .navbar-dark .navbar-brand,
.theme-epic .navbar-dark .text-light { color: #072b44 !important; text-shadow: none; }
.theme-epic .nav-tabs.chart-tabs { background: #bfe8fb; border-color: #75b9dc; }
.theme-epic .nav-tabs.chart-tabs .nav-link { background: #dff4ff; color: #064d7a; border-color: #7ab7d9; }
.theme-epic .nav-tabs.chart-tabs .nav-link.active { background: #ffffff; color: #005b94; border-top-color: #0092d4; }
.theme-epic .card-header, .theme-epic .thead-light th { background: #dff4ff !important; color: #063e63 !important; }
.theme-epic .tab-content { border-color: #75b9dc; }
.theme-mint:not(.login-page) { background: #effbf5; }
.theme-mint .navbar.bg-dark { background: #1f8c73 !important; }
.theme-mint .card-header, .theme-mint .thead-light th, .theme-mint .nav-tabs.chart-tabs { background: #dff7ed !important; color: #0b513f !important; }
.theme-mint .nav-tabs.chart-tabs .nav-link.active { border-top-color: #1f8c73; color: #0b513f; }
.theme-lavender:not(.login-page) { background: #f5f0fb; }
.theme-lavender .navbar.bg-dark { background: #654ea3 !important; }
.theme-lavender .card-header, .theme-lavender .thead-light th, .theme-lavender .nav-tabs.chart-tabs { background: #ebe1fb !important; color: #3c246d !important; }
.theme-lavender .nav-tabs.chart-tabs .nav-link.active { border-top-color: #654ea3; color: #3c246d; }
.theme-slate .flowsheet-table,
.theme-slate .flowsheet-table th,
.theme-slate .flowsheet-table td,
.theme-slate .vent-column-table,
.theme-slate .vent-column-entry-table,
.theme-slate .mar-timeline-table,
.theme-slate .lab-results-table { color: #f5f9fc !important; }
.theme-slate .flowsheet-table td,
.theme-slate .flowsheet-table th { background-color: #314252; }
.theme-slate .flowsheet-table .flowsheet-value-cell { background: #38495a; color: #ffffff !important; }
.theme-slate .flowsheet-table .flowsheet-section-row th { background: #4d6578 !important; color: #ffffff !important; }
.theme-slate .sticky-col { background: #263442 !important; }

.chart-tabs .nav-link { min-height: 40px; display: flex; align-items: center; justify-content: center; }
.custom-chart-tab .nav-link { font-style: italic; }

.flowsheet-workspace {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr) 300px;
    gap: 0.75rem;
    align-items: start;
}
.flowsheet-sidebar,
.flowsheet-detail-panel {
    border: 1px solid #b8c8d8;
    background: #f9fcff;
    min-height: 540px;
}
.flowsheet-sidebar { max-height: 70vh; overflow-y: auto; }
.flowsheet-sidebar-header { padding: .55rem .7rem; border-bottom: 1px solid #c9d8e5; background: #e6f3fb; font-weight: 800; color: #064d7a; }
.flowsheet-section-toggle { display: block; padding: .35rem .55rem; border-bottom: 1px solid #edf2f6; font-size: .92rem; color: #1f2e3b; }
.flowsheet-section-toggle input { margin-right: .4rem; }
.flowsheet-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    align-items: center;
    padding: .45rem .55rem;
    border: 1px solid #b8c8d8;
    border-bottom: 0;
    background: #f5fbff;
}
.flowsheet-scroll {
    overflow: auto;
    max-height: 72vh;
    border: 1px solid #b8c8d8;
    background: #fff;
}
.flowsheet-table {
    border-collapse: separate !important;
    border-spacing: 0 !important;
    min-width: 1080px;
    width: max-content;
    background: #fff;
    color: #172a3a;
}
.flowsheet-table th,
.flowsheet-table td { border-color: #aeb9c3 !important; font-size: .84rem; }
.flowsheet-table thead th {
    position: sticky;
    top: 0;
    z-index: 15;
    background: #f4f6f8 !important;
    color: #0e2b44 !important;
    text-align: center;
}
.flowsheet-row-label {
    position: sticky;
    left: 0;
    width: 240px;
    min-width: 240px;
    max-width: 240px;
    background: #ffffff !important;
    z-index: 12;
    text-align: left !important;
    color: #172a3a !important;
    font-weight: 600;
}
.flowsheet-table thead .flowsheet-row-label { z-index: 22; background: #f4f6f8 !important; }
.flowsheet-section-row th {
    background: #f8fbfd !important;
    color: #005b94 !important;
    text-align: center !important;
    font-weight: 800;
    letter-spacing: .03em;
    text-transform: uppercase;
    border-top: 2px solid #6e9fbd !important;
}
.flowsheet-value-cell { min-width: 136px; background: #eef6fc; }
.flowsheet-value-cell input,
.flowsheet-value-cell select,
.flowsheet-value-cell textarea {
    border: 0;
    background: transparent;
    width: 100%;
    min-width: 120px;
    text-align: center;
    color: #13283b;
    font-size: .82rem;
    padding: .2rem .25rem;
}
.flowsheet-value-cell input:focus,
.flowsheet-value-cell select:focus { outline: 2px solid #80bdff; background: #ffffff; }
.flowsheet-time-header input { max-width: 160px; font-size: .8rem; }
.flowsheet-detail-panel { padding: .75rem; color: #1d3550; }
.flowsheet-detail-panel h6 { color: #005b94; font-weight: 800; }
.flowsheet-detail-field { border: 1px solid #c7d6e2; min-height: 32px; background: #fff; padding: .25rem .45rem; margin-bottom: .45rem; }
@media (max-width: 1199.98px) { .flowsheet-workspace { grid-template-columns: 1fr; } .flowsheet-sidebar, .flowsheet-detail-panel { min-height: auto; } }

.result-actionbar,
.diagnostics-actionbar,
.notes-actionbar,
.orders-actionbar { background: #f7fbff; border: 1px solid #d5e2ec; padding: .5rem; border-radius: .35rem; }
.critical-note-card { border-left: 5px solid #dc3545; background: #fff7f7; }
.critical-note-card h6 { color: #a11222; }

.mar-timeline-table th:not(.mar-med-col),
.mar-timeline-table td.mar-cell { width: 190px !important; min-width: 190px !important; max-width: 190px !important; }
.mar-timeline-table .mar-med-col,
.mar-timeline-table thead .mar-med-col { width: 470px !important; min-width: 470px !important; max-width: 470px !important; }
.mar-event { min-width: 166px; }

.diagnostic-table .diagnostic-media-list .btn { min-width: 118px; }
.diagnostic-service-section { margin-bottom: 1.4rem; }

.resp-intervention-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(260px,1fr)); gap: .75rem; }
.resp-intervention-card { border: 1px solid #d7e3ec; border-left: 4px solid #0092d4; background: #fff; border-radius: .35rem; padding: .75rem; }

/* v9: Epic-style blue default, fixed footer, flowsheet layout, extra theme options */
body:not(.login-page) {
    padding-bottom: 92px;
}
body:not(.login-page) .footer.fixed-bottom,
body:not(.login-page) footer.footer.fixed-bottom {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 1030 !important;
}
body.login-page .footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
}
.navbar-brand-logo,
.nav-colossal-logo {
    width: 126px;
    height: auto;
    max-height: 44px;
    object-fit: contain;
    filter: none !important;
    background: rgba(255,255,255,0.9);
    border-radius: 3px;
    padding: 2px 5px;
}
.chart-brand span,
.navbar-brand span {
    line-height: 1.1;
}
.theme-epic:not(.login-page) {
    background: #e9f6ff;
}
.theme-epic .navbar.bg-dark {
    background: #116e9e !important;
    border-bottom: 3px solid #0786c7;
}
.theme-epic .card-header,
.theme-epic .thead-light th {
    background: #cfefff !important;
    color: #044f83 !important;
}
.theme-epic .nav-tabs.chart-tabs {
    background: #b9e6fb;
    border-color: #77bde2;
}
.theme-epic .nav-tabs.chart-tabs .nav-link {
    background: #e5f6ff;
    color: #004e7c;
    border-color: #77bde2;
}
.theme-epic .nav-tabs.chart-tabs .nav-link.active {
    background: #ffffff;
    color: #006cae;
    border-top-color: #008fd5;
}
.theme-mint:not(.login-page) { background: #effcf8; }
.theme-mint .navbar.bg-dark { background: #087b67 !important; }
.theme-mint .card-header,
.theme-mint .thead-light th { background: #d9f6ed !important; color: #075e50 !important; }
.theme-mint .nav-tabs.chart-tabs { background: #dff7ef; border-color: #84ccb7; }
.theme-mint .nav-tabs.chart-tabs .nav-link { background: #f6fffb; color: #075e50; border-color: #84ccb7; }
.theme-mint .nav-tabs.chart-tabs .nav-link.active { color: #075e50; border-top-color: #14a77f; }
.theme-lavender:not(.login-page) { background: #f7f2ff; }
.theme-lavender .navbar.bg-dark { background: #5a3f8f !important; }
.theme-lavender .card-header,
.theme-lavender .thead-light th { background: #ece2ff !important; color: #4a3478 !important; }
.theme-lavender .nav-tabs.chart-tabs { background: #eadfff; border-color: #b399dc; }
.theme-lavender .nav-tabs.chart-tabs .nav-link { background: #fbf8ff; color: #4a3478; border-color: #b399dc; }
.theme-lavender .nav-tabs.chart-tabs .nav-link.active { color: #4a3478; border-top-color: #7a55bf; }
.theme-slate .flowsheet-grid-table,
.theme-slate .flowsheet-grid-table td,
.theme-slate .flowsheet-grid-table th,
.theme-slate .flowsheet-section-panel,
.theme-slate .flowsheet-detail-panel {
    color: #142433 !important;
}
.theme-slate .flowsheet-entry-cell,
.theme-slate .flowsheet-grid-table td {
    background: #f6fbff !important;
}
.theme-slate .flowsheet-label-col,
.theme-slate .flowsheet-grid-table .sticky-col {
    background: #e7f3fb !important;
}
.theme-slate .flowsheet-group-row th {
    background: #cfe4f3 !important;
    color: #004e7c !important;
}
.visible-tab-settings-list { max-height: 190px; overflow-y: auto; }
.epic-card .card-body { background: #ffffff; }
.epic-flowsheet-shell {
    font-size: 0.92rem;
}
.flowsheet-toolbar {
    background: #edf8ff;
    border: 1px solid #b6dbee;
    border-radius: 0.35rem;
    padding: 0.45rem;
}
.flowsheet-insert-time {
    max-width: 210px;
}
.flowsheet-section-panel {
    border: 1px solid #b6dbee;
    background: #f5fbff;
    max-height: 660px;
    overflow-y: auto;
    padding: 0.65rem;
}
.flowsheet-section-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
    width: 100%;
    padding: 0.36rem 0.4rem;
    border-bottom: 1px solid #d7eaf5;
    color: #111;
    font-weight: 600;
    margin: 0;
}
.flowsheet-section-toggle:hover {
    background: #d5efff;
}
.flowsheet-grid-scroll {
    max-height: 660px;
    overflow: auto;
    border: 1px solid #a9cfe3;
    background: #fff;
}
.flowsheet-grid-table {
    min-width: 1080px;
    width: max-content;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    color: #111;
}
.flowsheet-grid-table thead th {
    position: sticky;
    top: 0;
    z-index: 15;
    background: #ffffff !important;
    color: #111 !important;
    border-color: #9baebb !important;
    text-align: center;
}
.flowsheet-label-col {
    left: 0;
    width: 270px !important;
    min-width: 270px !important;
    max-width: 270px !important;
    background: #ffffff !important;
    z-index: 16 !important;
    color: #111;
}
.flowsheet-grid-table thead .flowsheet-label-col {
    z-index: 25 !important;
}
.flowsheet-time-col {
    width: 155px;
    min-width: 155px;
    background: #f8fcff !important;
}
.flowsheet-time {
    display: block;
    font-weight: 800;
    color: #006cae;
}
.flowsheet-group-row th {
    background: #ffffff !important;
    color: #006cae !important;
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: .02em;
    border-top: 2px solid #a9cfe3 !important;
    border-bottom: 1px solid #a9cfe3 !important;
}
.flowsheet-entry-cell {
    min-width: 155px;
    height: 34px;
    padding: 0.18rem 0.3rem !important;
    background: #eaf6fd;
    color: #111;
    text-align: left !important;
    cursor: pointer;
}
.flowsheet-entry-cell:nth-child(even) {
    background: #dff1fb;
}
.flowsheet-entry-cell:hover,
.flowsheet-entry-cell:focus {
    outline: 2px solid #008fd5;
    outline-offset: -2px;
    background: #c7eaff;
}
.flowsheet-cell-input {
    min-width: 130px;
    height: calc(1.5em + .35rem + 2px);
    padding: .15rem .3rem;
}
.flowsheet-detail-panel {
    background: #f8fcff;
    border: 1px solid #b6dbee;
    padding: 0.55rem;
    min-height: 48px;
}
.critical-note {
    border-left-color: #dc3545 !important;
    background: #fff8e1 !important;
}
.mar-scroll {
    min-width: 100%;
}
.mar-timeline-table .mar-med-col,
.mar-timeline-table thead .mar-med-col {
    width: 470px !important;
    min-width: 470px !important;
    max-width: 470px !important;
}
.mar-timeline-table th:not(.mar-med-col),
.mar-timeline-table td.mar-cell {
    width: 182px !important;
    min-width: 182px !important;
    max-width: 182px !important;
}
@media (max-width: 991.98px) {
    .flowsheet-section-panel { max-height: 280px; }
    .flowsheet-label-col { width: 220px !important; min-width: 220px !important; }
}
.footer {
    position: fixed !important;
    left: 0;
    right: 0;
    bottom: 0;
}
.critical-note { border-left-color: #dc3545 !important; background: #fff4f4 !important; }
.critical-note strong { color: #a11222; }

/* v9 final readability override for Dark Slate flowsheets */
.theme-slate .flowsheet-table,
.theme-slate .flowsheet-table th,
.theme-slate .flowsheet-table td {
    color: #13283b !important;
}
.theme-slate .flowsheet-table td,
.theme-slate .flowsheet-table th {
    background: #f6fbff !important;
}
.theme-slate .flowsheet-table .flowsheet-row-label {
    background: #e7f3fb !important;
    color: #13283b !important;
}
.theme-slate .flowsheet-table .flowsheet-section-row th {
    background: #cfe4f3 !important;
    color: #004e7c !important;
}
.theme-slate .flowsheet-value-cell input,
.theme-slate .flowsheet-time-input {
    color: #13283b !important;
    background: #ffffff !important;
}

/* v10 refinements */
.navbar-brand-logo,
.nav-colossal-logo {
    background: transparent !important;
    border-radius: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
}
body:not(.login-page).theme-clinical { background: #f2f7f7; }
.theme-clinical .navbar.bg-dark { background: #25465f !important; border-bottom: 3px solid #3aa5a0; }
.theme-clinical .nav-tabs.chart-tabs { background: #d7ecee; border-color: #7ebdc2; }
.theme-clinical .nav-tabs.chart-tabs .nav-link { background: #eef8f8; color: #25465f; border-color: #7ebdc2; }
.theme-clinical .nav-tabs.chart-tabs .nav-link.active { background: #fff; color: #143242; border-top-color: #3aa5a0; }
.summary-board { border: 1px solid #a9cfe3; background: #f7fcff; box-shadow: 0 2px 8px rgba(0,0,0,.05); }
.summary-board-header { display:flex; justify-content:space-between; align-items:center; gap:1rem; padding:.75rem 1rem; background:#cfefff; border-bottom:1px solid #a9cfe3; color:#063e63; }
.summary-code { background:#ffdd52; color:#3b3000; font-weight:800; padding:.25rem .65rem; border-radius:.25rem; white-space:nowrap; }
.summary-tile-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap:.65rem; padding:.75rem; }
.summary-tile { background:#fff; border:1px solid #d7e8f2; border-left:4px solid #008fd5; border-radius:.35rem; padding:.65rem; min-height:92px; }
.summary-tile h6 { color:#044f83; font-weight:800; margin-bottom:.35rem; }
.summary-tile-alert { border-left-color:#dc3545; background:#fff8f8; }
.summary-vital-row { display:flex; flex-wrap:wrap; gap:.45rem; }
.summary-vital-row span { background:#eef8ff; border:1px solid #c6e4f5; border-radius:.25rem; padding:.2rem .4rem; font-weight:700; }
.summary-number { font-size:1.85rem; line-height:1; font-weight:800; color:#064d7a; }
.note-category-card { border-left-width: 6px; }
.note-style-admission-notes { border-left-color:#2f80ed; background:#f4f9ff; }
.note-style-progress-notes { border-left-color:#6f42c1; background:#fbf8ff; }
.note-style-rounding-notes { border-left-color:#17a2b8; background:#f3fcfd; }
.note-style-nursing-notes { border-left-color:#28a745; background:#f7fff9; }
.note-style-critical-result-notes { border-left-color:#dc3545; background:#fff5f5; }
.note-style-respiratory-notes { border-left-color:#fd7e14; background:#fff8f1; }
.note-style-consults { border-left-color:#20c997; background:#f4fffb; }
.note-style-pt-ot-notes { border-left-color:#795548; background:#fffaf6; }
.note-style-education { border-left-color:#ffc107; background:#fffdf2; }
.note-style-discharge-planning { border-left-color:#607d8b; background:#f7fafb; }
.note-style-case-management { border-left-color:#e83e8c; background:#fff6fb; }
.io-bar-legend { display:flex; gap:1rem; font-size:.85rem; font-weight:800; margin-bottom:.5rem; }
.io-legend-intake::before, .io-legend-output::before { content:''; display:inline-block; width:12px; height:12px; margin-right:.3rem; vertical-align:-1px; border-radius:2px; }
.io-legend-intake::before, .io-bar-intake { background:#3aa5a0; }
.io-legend-output::before, .io-bar-output { background:#1f8ed1; }
.io-bar-grid { display:flex; gap:.65rem; overflow-x:auto; min-height:190px; align-items:flex-end; padding-bottom:.35rem; }
.io-bar-set { min-width:95px; text-align:center; }
.io-bars { height:125px; display:flex; justify-content:center; align-items:flex-end; gap:.25rem; border-bottom:1px solid #9fb9c8; }
.io-bar { width:24px; min-height:4px; border-radius:3px 3px 0 0; }
.io-bar-label { font-size:.75rem; margin-top:.25rem; line-height:1.25; }
.orders-table .ack-scope-button:disabled { cursor:not-allowed; opacity:.45; }
.flowsheet-grid-table .flowsheet-user-col { background:#d7efff !important; }
.flowsheet-grid-table .flowsheet-user-entry { background:#fffef2 !important; }
.flowsheet-grid-table .flowsheet-historical-cell { background:#eaf6fd; }
.flowsheet-cell-input { background:#fff !important; }
.diagnostic-table th:nth-child(5), .diagnostic-table td:nth-child(5) { min-width:220px; }
.diagnostic-table th:nth-child(6), .diagnostic-table td:nth-child(6) { min-width:240px; }

/* v10 note color fallback classes */
.chart-note.note-admission{border-left:6px solid #2457a6;background:#edf4ff;}
.chart-note.note-progress{border-left:6px solid #188754;background:#effaf3;}
.chart-note.note-nursing{border-left:6px solid #0d8ea8;background:#ecfbff;}
.chart-note.note-respiratory{border-left:6px solid #d97706;background:#fff7e8;}
.chart-note.note-consult{border-left:6px solid #7c3aed;background:#f6f0ff;}
.chart-note.note-rounding{border-left:6px solid #0f766e;background:#eefdfa;}
.chart-note.note-pt_ot{border-left:6px solid #be185d;background:#fff0f6;}
.chart-note.note-education{border-left:6px solid #0369a1;background:#eef8ff;}
.chart-note.note-discharge_planning{border-left:6px solid #64748b;background:#f5f7fb;}
.chart-note.note-case_management{border-left:6px solid #92400e;background:#fff7ed;}
.chart-note.critical-note{border-left:6px solid #dc2626;background:#fff1f2;}
.flowsheet-table .flowsheet-doc-cell{background:#eef8ff;min-width:145px;}
.flowsheet-table .flowsheet-history-cell{background:#f8fbfd;color:#1f2937;}


/* v10 completion refinements */
.login-logo.transparent-logo,
.navbar-brand-logo {
    background: transparent !important;
    object-fit: contain;
}
.login-logo.transparent-logo {
    max-width: 210px;
    height: auto;
    padding: 0 !important;
}
.navbar-brand-logo {
    width: 118px;
    max-height: 42px;
}
.note-admission { border-left-color:#2f80ed !important; background:#f4f9ff !important; }
.note-progress { border-left-color:#6f42c1 !important; background:#fbf8ff !important; }
.note-rounding { border-left-color:#17a2b8 !important; background:#f3fcfd !important; }
.note-nursing { border-left-color:#28a745 !important; background:#f7fff9 !important; }
.note-critical { border-left-color:#dc3545 !important; background:#fff5f5 !important; }
.note-respiratory { border-left-color:#fd7e14 !important; background:#fff8f1 !important; }
.note-consult { border-left-color:#20c997 !important; background:#f4fffb !important; }
.note-therapy { border-left-color:#795548 !important; background:#fffaf6 !important; }
.note-education { border-left-color:#ffc107 !important; background:#fffdf2 !important; }
.note-discharge { border-left-color:#607d8b !important; background:#f7fafb !important; }
.note-case-management { border-left-color:#e83e8c !important; background:#fff6fb !important; }
.note-general { border-left-color:#9aa8b5 !important; background:#fbfcfd !important; }
.note-category-card.chart-note,
.chart-note.note-admission,
.chart-note.note-progress,
.chart-note.note-rounding,
.chart-note.note-nursing,
.chart-note.note-critical,
.chart-note.note-respiratory,
.chart-note.note-consult,
.chart-note.note-therapy,
.chart-note.note-education,
.chart-note.note-discharge,
.chart-note.note-case-management,
.chart-note.note-general {
    border-left-width: 6px;
}
.note-category-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(270px,1fr)); gap:.75rem; }
.note-category-card { border:1px solid #d7e8f2; border-left-width:6px; border-radius:.35rem; padding:.65rem; }
.chart-note { border:1px solid rgba(0,0,0,.08); border-left:6px solid #9aa8b5; border-radius:.35rem; padding:.55rem; margin-bottom:.5rem; }
.summary-lower-grid { display:grid; grid-template-columns: minmax(280px,1.1fr) minmax(260px,.9fr); gap:.75rem; }
.summary-mini-panel { background:#fff; border:1px solid #d7e8f2; border-radius:.35rem; padding:.65rem; }
.summary-note-line { border-bottom:1px solid #edf2f5; padding:.35rem 0; }
.io-bar-graph { display:flex; gap:.6rem; min-height:180px; align-items:flex-end; overflow-x:auto; padding:.5rem .25rem; border:1px solid #d7e8f2; background:#fff; }
.io-bar-group { min-width:96px; text-align:center; }
.io-bar-group .io-bars { height:120px; display:flex; justify-content:center; align-items:flex-end; gap:.25rem; border-bottom:1px solid #a9b8c3; }
.io-bar-group .io-bar { width:22px; min-height:4px; border-radius:3px 3px 0 0; }
.io-intake { background:#3aa5a0 !important; }
.io-output { background:#1f8ed1 !important; }
.io-bar-values { display:flex; justify-content:center; gap:.35rem; font-size:.75rem; }
.io-key { display:inline-block; width:12px; height:12px; border-radius:2px; margin-right:.25rem; vertical-align:-2px; }
.io-key-intake { background:#3aa5a0; }
.io-key-output { background:#1f8ed1; }
.theme-slate .flowsheet-workspace,
.theme-slate .flowsheet-table,
.theme-slate .flowsheet-table th,
.theme-slate .flowsheet-table td,
.theme-slate .flowsheet-detail-panel { color:#111 !important; }
@media (max-width: 991.98px) { .summary-lower-grid { grid-template-columns:1fr; } }


/* v10 final polish */
.navbar-brand-logo, .login-card img { background: transparent !important; mix-blend-mode: normal; }
.summary-tile-wide { grid-column: span 2; }
@media (max-width: 900px) { .summary-tile-wide { grid-column: span 1; } }
.epic-flowsheet-shell .flowsheet-grid-scroll { border: 1px solid #a7c7d8; background: #fff; }
.flowsheet-grid-table th, .flowsheet-grid-table td { color: #1b2f3a; }
.flowsheet-grid-table .flowsheet-label-col { min-width: 235px; background: #f8fbfd !important; z-index: 3; }
.flowsheet-grid-table .flowsheet-time-col { min-width: 118px; background: #eef8ff; color: #064d7a; text-align: center; }
.flowsheet-grid-table .flowsheet-group-row th { background: #e7f6fc !important; color: #005b8d !important; font-weight: 800; letter-spacing: .04em; }
.flowsheet-grid-table .flowsheet-entry-cell { min-width: 118px; height: 34px; vertical-align: middle; }
.io-bar-graph { padding: .65rem; min-height: 190px; }
.io-bar-graph .io-bar-group { min-width: 90px; text-align:center; }
.io-bar-graph .io-bars { height: 120px; }
.io-bar-graph .io-bar.io-intake { background:#3aa5a0; }
.io-bar-graph .io-bar.io-output { background:#1f8ed1; }
.io-key { display:inline-block; width:12px; height:12px; border-radius:2px; vertical-align:-1px; }
.io-key-intake { background:#3aa5a0; }
.io-key-output { background:#1f8ed1; }
.diagnostic-table th:nth-child(4), .diagnostic-table td:nth-child(4) { min-width: 165px; }
.diagnostic-table th:nth-child(5), .diagnostic-table td:nth-child(5) { min-width: 260px; }
.note-category-card.note-admission, .chart-note.note-admission { border-left-color:#2457a6; background:#edf4ff; }
.note-category-card.note-progress, .chart-note.note-progress { border-left-color:#188754; background:#effaf3; }
.note-category-card.note-nursing, .chart-note.note-nursing { border-left-color:#0d8ea8; background:#ecfbff; }
.note-category-card.note-respiratory, .chart-note.note-respiratory { border-left-color:#d97706; background:#fff7e8; }
.note-category-card.note-consult, .chart-note.note-consult { border-left-color:#7c3aed; background:#f6f0ff; }
.note-category-card.note-critical, .chart-note.note-critical { border-left-color:#dc2626; background:#fff1f2; }
body.theme-slate .flowsheet-grid-table th, body.theme-slate .flowsheet-grid-table td { color:#142638 !important; }
body.theme-slate .flowsheet-grid-table .flowsheet-entry-cell { background:#eef6fb !important; }
body.theme-slate .flowsheet-grid-table .flowsheet-group-row th { background:#d3e9f3 !important; color:#073b55 !important; }


/* v11 fixes: durable note color variables, positive/negative I/O graph, and MAR override warning state */
.note-category-card,
.chart-note {
    border-left-color: var(--note-color, #9aa8b5) !important;
    background: var(--note-bg, #fbfcfd) !important;
}
.note-category-card h6 {
    color: var(--note-color, #25465f) !important;
}
.chart-note .note-meta {
    color: color-mix(in srgb, var(--note-color, #25465f) 75%, #222) !important;
    font-weight: 700;
}
.io-bipolar-graph {
    position: relative;
    display: flex;
    gap: .65rem;
    min-height: 260px;
    overflow-x: auto;
    padding: 1.15rem .75rem .75rem 3.25rem;
    border: 1px solid #d7e8f2;
    background: #fff;
}
.io-bipolar-graph::before {
    content: '';
    position: absolute;
    left: 2.75rem;
    right: .75rem;
    top: calc(50% - 1px);
    height: 2px;
    background: #526a7e;
}
.io-axis-label {
    position: absolute;
    left: .55rem;
    font-size: .72rem;
    font-weight: 800;
    color: #496574;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.io-axis-label-positive { top: .5rem; }
.io-axis-label-negative { bottom: 2.2rem; }
.io-bipolar-group {
    min-width: 92px;
    text-align: center;
    display: grid;
    grid-template-rows: 92px 2px 92px auto auto;
    align-items: end;
    z-index: 1;
}
.io-positive-half,
.io-negative-half {
    height: 92px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}
.io-negative-half {
    align-items: flex-start;
}
.io-zero-line { height: 2px; background: #526a7e; }
.io-bipolar-bar {
    width: 26px;
    min-height: 4px;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.12);
}
.io-bipolar-bar.io-intake { border-radius: 4px 4px 0 0; background:#3aa5a0 !important; }
.io-bipolar-bar.io-output { border-radius: 0 0 4px 4px; background:#1f8ed1 !important; }
.io-bipolar-group .io-bar-values {
    display: flex;
    justify-content: center;
    gap: .35rem;
    font-size: .75rem;
    font-weight: 700;
    margin-top: .2rem;
}
.io-bipolar-group .io-bar-label {
    font-size: .72rem;
    line-height: 1.2;
    margin-top: .15rem;
    color: #496574;
}
#medAdminModal.med-modal-override .modal-content {
    background: #fff8d7;
    border: 3px solid #e0a800;
    box-shadow: 0 0 0 .25rem rgba(255, 193, 7, .35);
}
#medAdminModal.med-modal-override .modal-header {
    background: #ffe08a;
    color: #3b3000;
    border-bottom-color: #e0a800;
}
#medAdminModal.med-modal-override .override-fields select,
#medAdminModal.med-modal-override .override-fields textarea {
    border-color: #c69500;
    background: #fffef2;
}


/* v11 fixes: distinct note colors, diverging I/O graph, and BCMA override warning state */
#notes .note-category-card.note-admission, #notes .chart-note.note-admission,
.chart-note-list .note-category-card.note-admission, .chart-note-list .chart-note.note-admission { border-left-color:#2457a6 !important; background:#edf4ff !important; }
#notes .note-category-card.note-progress, #notes .chart-note.note-progress,
.chart-note-list .note-category-card.note-progress, .chart-note-list .chart-note.note-progress { border-left-color:#188754 !important; background:#effaf3 !important; }
#notes .note-category-card.note-rounding, #notes .chart-note.note-rounding,
.chart-note-list .note-category-card.note-rounding, .chart-note-list .chart-note.note-rounding { border-left-color:#0f766e !important; background:#eefdfa !important; }
#notes .note-category-card.note-nursing, #notes .chart-note.note-nursing,
.chart-note-list .note-category-card.note-nursing, .chart-note-list .chart-note.note-nursing { border-left-color:#0d8ea8 !important; background:#ecfbff !important; }
#notes .note-category-card.note-critical, #notes .chart-note.note-critical,
.chart-note-list .note-category-card.note-critical, .chart-note-list .chart-note.note-critical { border-left-color:#dc2626 !important; background:#fff1f2 !important; }
#notes .note-category-card.note-respiratory, #notes .chart-note.note-respiratory,
.chart-note-list .note-category-card.note-respiratory, .chart-note-list .chart-note.note-respiratory { border-left-color:#d97706 !important; background:#fff7e8 !important; }
#notes .note-category-card.note-consult, #notes .chart-note.note-consult,
.chart-note-list .note-category-card.note-consult, .chart-note-list .chart-note.note-consult { border-left-color:#7c3aed !important; background:#f6f0ff !important; }
#notes .note-category-card.note-therapy, #notes .chart-note.note-therapy,
.chart-note-list .note-category-card.note-therapy, .chart-note-list .chart-note.note-therapy { border-left-color:#be185d !important; background:#fff0f6 !important; }
#notes .note-category-card.note-education, #notes .chart-note.note-education,
.chart-note-list .note-category-card.note-education, .chart-note-list .chart-note.note-education { border-left-color:#0369a1 !important; background:#eef8ff !important; }
#notes .note-category-card.note-discharge, #notes .chart-note.note-discharge,
.chart-note-list .note-category-card.note-discharge, .chart-note-list .chart-note.note-discharge { border-left-color:#64748b !important; background:#f5f7fb !important; }
#notes .note-category-card.note-case-management, #notes .chart-note.note-case-management,
.chart-note-list .note-category-card.note-case-management, .chart-note-list .chart-note.note-case-management { border-left-color:#92400e !important; background:#fff7ed !important; }
#notes .note-category-card.note-clinical-document, #notes .chart-note.note-clinical-document,
.chart-note-list .note-category-card.note-clinical-document, .chart-note-list .chart-note.note-clinical-document { border-left-color:#475569 !important; background:#f8fafc !important; }
#notes .note-category-card.note-medication-reference, #notes .chart-note.note-medication-reference,
.chart-note-list .note-category-card.note-medication-reference, .chart-note-list .chart-note.note-medication-reference { border-left-color:#0891b2 !important; background:#ecfeff !important; }
#notes .note-category-card.note-general, #notes .chart-note.note-general,
.chart-note-list .note-category-card.note-general, .chart-note-list .chart-note.note-general { border-left-color:#9aa8b5 !important; background:#fbfcfd !important; }
#notes .note-category-card h6 { color:#142638; }
#notes .note-category-card, #notes .chart-note { border-left-width:6px !important; }

.io-diverging-graph { align-items:stretch !important; min-height:245px !important; padding:.65rem .75rem 1rem !important; }
.io-diverging-group { min-width:106px !important; display:flex; flex-direction:column; justify-content:flex-end; }
.io-diverging-bars { height:170px; display:flex; flex-direction:column; justify-content:center; position:relative; }
.io-positive-wrap, .io-negative-wrap { height:78px; display:flex; justify-content:center; gap:.25rem; }
.io-positive-wrap { align-items:flex-end; }
.io-negative-wrap { align-items:flex-start; }
.io-zero-axis { border-top:2px solid #64748b; height:0; margin:.15rem 0; }
.io-diverging-bars .io-bar { width:28px; min-height:0; }
.io-diverging-bars .io-intake { border-radius:4px 4px 0 0; }
.io-diverging-bars .io-output { border-radius:0 0 4px 4px; }
.io-value-in { color:#167a73; font-weight:700; }
.io-value-out { color:#0b5f99; font-weight:700; }

#medAdminModal .modal-content.mar-override-active { background:#fff8db !important; border:2px solid #ffc107; box-shadow:0 0 0 .25rem rgba(255,193,7,.18); }
#medAdminModal .modal-content.mar-override-active .modal-header { background:#ffe69c; border-bottom-color:#ffc107; color:#3b3100; }
#medAdminModal .mar-override-panel { background:#fffdf5; border:1px solid #f4d06f; }
#medAdminModal .modal-content.mar-override-active .mar-override-panel { background:#fff3cd; border-color:#ffc107; }
#adminOverrideWarning { border-left:6px solid #b7791f; }

#medAdminModal.med-modal-override .modal-content { background:#fff8db !important; border:2px solid #ffc107; box-shadow:0 0 0 .25rem rgba(255,193,7,.18); }
#medAdminModal.med-modal-override .modal-header { background:#ffe69c; border-bottom-color:#ffc107; color:#3b3100; }


/* v12 workspace tabs, note review table, sticky notes, and isolation badges */
.navbar-brand-logo,
.login-logo.transparent-logo,
.login-card img.logo-footer,
.login-card img.login-footer-logo {
    background: transparent !important;
    box-shadow: none !important;
    border: 0 !important;
}
.master-workspace-tabs {
    display: flex;
    align-items: center;
    gap: .35rem;
    overflow-x: auto;
    background: rgba(255,255,255,.14);
}
.workspace-tab {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    max-width: 280px;
    padding: .26rem .55rem;
    border: 1px solid rgba(255,255,255,.35);
    border-radius: .35rem .35rem 0 0;
    background: rgba(255,255,255,.78);
    color: #11354a !important;
    font-size: .82rem;
    font-weight: 700;
    white-space: nowrap;
    text-decoration: none !important;
}
.workspace-tab:hover { background: #fff; color: #003b61 !important; }
.workspace-tab-active { background: #fff7d7; border-color: #e6be35; }
.workspace-tab-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #9b1c1c;
    font-size: 1rem;
    line-height: 1;
    text-decoration: none !important;
}
.workspace-tab-close:hover { background: #ffe7e7; color: #6d0000; }
.sticky-note-launch { border-color: #d39e00; background: #fff3cd; color: #4f3b00 !important; }
.sticky-note-launch.has-sticky-note { background: #ffe08a; box-shadow: inset 0 -3px 0 #c69500; }
.sticky-note-dot { width: .65rem; height: .65rem; border-radius: 50%; background: #ffc107; border: 1px solid #9c7600; }
.sticky-note-modal-content { background: #fff9db; border: 2px solid #e0ad17; }
.sticky-note-textarea { background: #fffdf0; border-color: #d9b245; }
.isolation-badge {
    display: inline-block;
    padding: .18rem .48rem;
    border-radius: .25rem;
    font-weight: 800;
    border: 1px solid transparent;
    color: #111;
}
.isolation-none { background: #f1f5f9; border-color: #cbd5e1; color: #334155; }
.isolation-contact { background: #ffeb77; border-color: #d2a900; color: #3d3200; }
.isolation-airborne { background: #dc2626; border-color: #991b1b; color: #fff; }
.isolation-reverse { background: #fb923c; border-color: #c2410c; color: #1f1300; }
.isolation-droplet { background: #fcd34d; border-color: #d97706; color: #422006; }
.isolation-other { background: #e0f2fe; border-color: #0284c7; color: #083344; }
.flowsheet-sidebar-hint {
    margin-top: .35rem;
    font-size: .72rem;
    line-height: 1.2;
    font-weight: 500;
    color: #16415f;
}
.notes-review-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, .8fr);
    gap: .75rem;
    align-items: start;
}
.notes-toolbar {
    display: flex;
    align-items: center;
    padding: .45rem .55rem;
    border: 1px solid #bfd7e6;
    border-bottom: 0;
    background: #e7f6ff;
    color: #064d7a;
}
.notes-table-scroll { max-height: 56vh; overflow: auto; border: 1px solid #bfd7e6; }
.notes-review-table th { position: sticky; top: 0; z-index: 2; }
.notes-review-row { cursor: pointer; border-left: 8px solid transparent !important; }
.notes-review-row.active { outline: 2px solid #056aa2; outline-offset: -2px; }
.note-type-pill {
    display: inline-block;
    padding: .12rem .4rem;
    border-radius: .35rem;
    font-weight: 800;
    border-left: 5px solid currentColor;
    background: rgba(255,255,255,.78);
}
.notes-preview-panel {
    min-height: 260px;
    max-height: 62vh;
    overflow: auto;
    border: 1px solid #bfd7e6;
    background: #fff;
    padding: .8rem;
}
.notes-preview-type {
    display: inline-block;
    padding: .2rem .5rem;
    margin-bottom: .5rem;
    border-left: 6px solid #9aa8b5;
    font-size: .8rem;
    font-weight: 800;
}
.notes-preview-body { white-space: pre-wrap; line-height: 1.35; }
.notes-review-table .note-admission, .notes-preview-type.note-admission, .note-type-pill.note-admission { border-left-color:#2457a6 !important; background:#edf4ff !important; color:#123f80; }
.notes-review-table .note-progress, .notes-preview-type.note-progress, .note-type-pill.note-progress { border-left-color:#188754 !important; background:#effaf3 !important; color:#0d5c37; }
.notes-review-table .note-rounding, .notes-preview-type.note-rounding, .note-type-pill.note-rounding { border-left-color:#0f766e !important; background:#eefdfa !important; color:#0a5953; }
.notes-review-table .note-nursing, .notes-preview-type.note-nursing, .note-type-pill.note-nursing { border-left-color:#0d8ea8 !important; background:#ecfbff !important; color:#075c6c; }
.notes-review-table .note-critical, .notes-preview-type.note-critical, .note-type-pill.note-critical { border-left-color:#dc2626 !important; background:#fff1f2 !important; color:#991b1b; }
.notes-review-table .note-respiratory, .notes-preview-type.note-respiratory, .note-type-pill.note-respiratory { border-left-color:#d97706 !important; background:#fff7e8 !important; color:#92400e; }
.notes-review-table .note-consult, .notes-preview-type.note-consult, .note-type-pill.note-consult { border-left-color:#7c3aed !important; background:#f6f0ff !important; color:#5b21b6; }
.notes-review-table .note-therapy, .notes-preview-type.note-therapy, .note-type-pill.note-therapy { border-left-color:#be185d !important; background:#fff0f6 !important; color:#9d174d; }
.notes-review-table .note-education, .notes-preview-type.note-education, .note-type-pill.note-education { border-left-color:#0369a1 !important; background:#eef8ff !important; color:#075985; }
.notes-review-table .note-discharge, .notes-preview-type.note-discharge, .note-type-pill.note-discharge { border-left-color:#64748b !important; background:#f5f7fb !important; color:#334155; }
.notes-review-table .note-case-management, .notes-preview-type.note-case-management, .note-type-pill.note-case-management { border-left-color:#92400e !important; background:#fff7ed !important; color:#78350f; }
.notes-review-table .note-clinical-document, .notes-preview-type.note-clinical-document, .note-type-pill.note-clinical-document { border-left-color:#334155 !important; background:#f8fafc !important; color:#1e293b; }
.notes-review-table .note-medication-reference, .notes-preview-type.note-medication-reference, .note-type-pill.note-medication-reference { border-left-color:#0891b2 !important; background:#ecfeff !important; color:#155e75; }
@media (max-width: 1100px) { .notes-review-shell { grid-template-columns: 1fr; } .notes-preview-panel { max-height: none; } }

/* v12: chart workspace tabs, notes review table, sticky notes, isolation colors */
.epic-master-tabs {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    min-height: 34px;
    padding: 4px 6px 0;
    background: linear-gradient(#c9edf9, #a4d9f0);
    border: 1px solid #73b9d7;
    border-bottom: 2px solid #2295c7;
    overflow-x: auto;
    white-space: nowrap;
}
.epic-master-tab {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .35rem .7rem;
    border: 1px solid #70b6d0;
    border-bottom: 0;
    background: #e8f8ff;
    color: #064d70;
    font-weight: 700;
    border-radius: 6px 6px 0 0;
    text-decoration: none !important;
}
.epic-master-tab:hover { background: #ffffff; color: #004d73; }
.epic-master-tab-active {
    background: #ffffff;
    color: #002f4b;
    min-width: 210px;
}
.epic-master-close {
    margin-left: .5rem;
    color: #106b91;
    font-size: 1.2rem;
    line-height: 1;
    text-decoration: none !important;
}
.epic-master-close:hover { color: #b00020; }

.isolation-badge {
    display: inline-block;
    border-radius: 4px;
    padding: .15rem .45rem;
    font-weight: 800;
    border: 1px solid rgba(0,0,0,.18);
    color: #111;
}
.isolation-none { background: #edf2f7; color: #334155; }
.isolation-contact { background: #ffe866; color: #111; border-color: #d6b800; }
.isolation-airborne { background: #d90429; color: #fff; border-color: #9f001d; }
.isolation-reverse { background: #ff9f1c; color: #111; border-color: #c56c00; }
.isolation-droplet { background: #ffd166; color: #111; border-color: #d49100; }
.isolation-other { background: #d8f3dc; color: #153b21; border-color: #95d5a2; }

.flowsheet-sidebar-help {
    margin: .35rem .45rem .65rem;
    padding: .45rem .55rem;
    border: 1px solid #b7d4e5;
    background: #f4fbff;
    color: #16415f;
    font-size: .78rem;
    line-height: 1.25;
}

.note-review-layout {
    display: grid;
    grid-template-columns: minmax(420px, 1.2fr) minmax(310px, .8fr);
    gap: 0;
    min-height: 520px;
    background: #fff;
}
.note-review-table-wrap {
    max-height: 620px;
    overflow: auto;
    border-right: 1px solid #b6cbd9;
}
.note-review-table th, .note-review-table td { vertical-align: middle; text-align: left; }
.note-review-row { cursor: pointer; border-left: 7px solid transparent; }
.note-review-row.active { outline: 2px solid #0b78a4; outline-offset: -2px; }
.note-review-row:hover { filter: saturate(1.05) brightness(.985); }
.note-type-chip {
    display: inline-block;
    border-radius: 999px;
    padding: .18rem .48rem;
    font-weight: 800;
    font-size: .75rem;
    border: 1px solid rgba(0,0,0,.14);
    white-space: nowrap;
}
.note-detail-pane {
    padding: 1rem;
    background: #f8fbfd;
    border-left: 1px solid #d3e4ee;
    max-height: 620px;
    overflow: auto;
}
.note-detail-header {
    border-bottom: 1px solid #c9dce8;
    margin-bottom: .75rem;
    padding-bottom: .75rem;
}
.note-detail-body {
    white-space: pre-wrap;
    font-size: .95rem;
    color: #192b36;
    line-height: 1.4;
}
.note-preview { max-width: 420px; }
.note-type-chip.note-admission { background:#edf4ff; color:#123a78; }
.note-type-chip.note-progress { background:#effaf3; color:#11613c; }
.note-type-chip.note-nursing { background:#ecfbff; color:#066777; }
.note-type-chip.note-critical { background:#fff1f2; color:#b91c1c; }
.note-type-chip.note-respiratory { background:#fff7e8; color:#9a4f00; }
.note-type-chip.note-consult { background:#f6f0ff; color:#5b21b6; }
.note-type-chip.note-therapy { background:#fff0f6; color:#9d174d; }
.note-type-chip.note-education { background:#eef8ff; color:#075985; }
.note-type-chip.note-discharge { background:#f5f7fb; color:#475569; }
.note-type-chip.note-case-management { background:#fff7ed; color:#7c2d12; }
.note-type-chip.note-clinical-document { background:#f8fafc; color:#334155; }
.note-type-chip.note-medication-reference { background:#ecfeff; color:#155e75; }
.note-type-chip.note-general { background:#f3f4f6; color:#374151; }

.sticky-notes-box {
    border: 1px solid #d8bd54;
    background: #fff9db;
    border-radius: 8px;
    padding: .6rem;
}
.sticky-note-list { max-height: 260px; overflow-y: auto; }
.sticky-note-card {
    border: 1px solid rgba(0,0,0,.16);
    box-shadow: 0 2px 4px rgba(0,0,0,.08);
    border-radius: 6px;
    padding: .5rem .55rem;
    margin-bottom: .45rem;
    font-size: .85rem;
}
.sticky-note-card strong { display: block; margin-bottom: .2rem; }
.sticky-note-card span.small { display: block; margin-top: .25rem; color: rgba(0,0,0,.58); }
.sticky-note-yellow { background: #fff2a8; }
.sticky-note-blue { background: #dff3ff; }
.sticky-note-green { background: #ddf8df; }
.sticky-note-pink { background: #ffdff0; }
.sticky-note-purple { background: #efe3ff; }
.sticky-note-modal-content { background: #fff9db; }

@media (max-width: 991.98px) {
    .note-review-layout { grid-template-columns: 1fr; }
    .note-review-table-wrap { border-right: 0; border-bottom: 1px solid #b6cbd9; }
    .note-detail-pane { max-height: none; }
}

/* v14: header chart tabs, mobile bottom tabs, role-colored tilted sticky notes */
.logo-footer {
    object-fit: contain;
}
.footer .logo-footer,
.login-footer-logo {
    filter: grayscale(1) contrast(1.05) brightness(.92);
}
#chartWorkspaceTabs.master-workspace-tabs {
    gap: .4rem;
    align-items: center;
    padding-top: .4rem !important;
    padding-bottom: .35rem !important;
}
.workspace-base-tab {
    background: rgba(255,255,255,.86) !important;
    border-color: rgba(255,255,255,.55) !important;
}
.workspace-chart-slot {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
}
.workspace-chart-tab {
    background: #fff !important;
    border-color: #72b7d6 !important;
    color: #063e63 !important;
    min-width: 110px;
    justify-content: space-between;
    box-shadow: inset 0 -3px 0 #65b8df;
}
.workspace-chart-tab.workspace-tab-active {
    background: #fff7d7 !important;
    border-color: #e6be35 !important;
    box-shadow: inset 0 -3px 0 #e0a800;
}
.workspace-chart-tab .workspace-tab-close,
.workspace-chart-close {
    color: #c30000 !important;
    background: #fff0f0;
    border: 1px solid #f3b6b6;
    font-weight: 900;
}
.workspace-chart-tab .workspace-tab-close:hover,
.workspace-chart-close:hover {
    color: #fff !important;
    background: #c30000;
    border-color: #8b0000;
}
.patient-open-header {
    background: linear-gradient(90deg, rgba(232,248,255,.98), rgba(255,255,255,.92));
    border: 1px solid #9fd0e3;
    border-radius: .65rem;
    box-shadow: 0 2px 6px rgba(0,0,0,.08);
    padding: .7rem .85rem;
}
.patient-open-name-block {
    min-width: 260px;
}
.patient-avatar-sm {
    width: 42px !important;
    height: 42px !important;
    line-height: 42px !important;
    font-size: 1.1rem !important;
    flex: 0 0 auto;
}
.patient-header-sticky-board {
    min-height: 86px;
    border-left: 3px solid #62b6d2;
    padding-left: .85rem;
}
.sticky-note-list-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: .55rem;
    min-height: 54px;
    overflow: visible;
}
.sticky-note-list-header .sticky-empty {
    align-self: center;
    padding: .35rem .5rem;
}
.sticky-note-card {
    position: relative;
    transform-origin: 50% 10%;
    transition: transform .12s ease, box-shadow .12s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,.18);
    border: 1px solid rgba(0,0,0,.12);
    overflow-wrap: anywhere;
}
.sticky-note-card:hover {
    transform: rotate(0deg) scale(1.03) !important;
    z-index: 4;
    box-shadow: 0 7px 14px rgba(0,0,0,.2);
}
.sticky-note-list-header .sticky-note-card {
    width: 154px;
    min-height: 64px;
    max-height: 112px;
    overflow: hidden;
    padding: .45rem .5rem;
    font-size: .78rem;
}
.sticky-note-list-header .sticky-note-card strong {
    font-size: .81rem;
    line-height: 1.05;
}
.sticky-note-list-header .sticky-note-card div {
    line-height: 1.15;
}
.sticky-note-card .sticky-role-badge {
    display: inline-block;
    margin-right: .15rem;
    padding: .05rem .28rem;
    border-radius: 999px;
    background: rgba(255,255,255,.55);
    border: 1px solid rgba(0,0,0,.12);
    font-weight: 800;
    font-size: .68rem;
}
.sticky-note-role-nursing { border-top: 4px solid #1d8fc1; }
.sticky-note-role-respiratory { border-top: 4px solid #1b8f54; }
.sticky-note-role-pca { border-top: 4px solid #d89a00; }
.sticky-note-role-provider { border-top: 4px solid #7c3aed; }
.sticky-note-role-pharmacy { border-top: 4px solid #be185d; }
.sticky-note-role-therapy { border-top: 4px solid #0f766e; }
.sticky-note-yellow { background: #fff2a8 !important; }
.sticky-note-blue { background: #dff3ff !important; }
.sticky-note-green { background: #ddf8df !important; }
.sticky-note-pink { background: #ffdff0 !important; }
.sticky-note-purple { background: #efe3ff !important; }
.sticky-note-mint { background: #dafaf1 !important; }
.epic-notes-layout {
    border: 1px solid #b6cbd9;
    background: #fff;
}
.epic-note-toolbar {
    gap: .3rem;
    flex-wrap: wrap;
}
.notes-filter-pill {
    display: inline-block;
    padding: .18rem .45rem;
    border: 1px solid #bfd7e6;
    border-radius: .25rem;
    background: #f9fdff;
    color: #064d7a;
    font-size: .78rem;
    font-weight: 700;
}
.notes-filter-pill.active {
    background: #fff7d7;
    border-color: #e6be35;
    color: #5a4300;
}
.note-status-pill {
    display: inline-block;
    padding: .16rem .44rem;
    border-radius: 999px;
    font-size: .74rem;
    font-weight: 800;
    border: 1px solid rgba(0,0,0,.15);
    white-space: nowrap;
}
.note-status-signed { background: #e8f8ef; color: #12613a; }
.note-status-pended { background: #fff3cd; color: #7a5700; }
.note-review-table .notes-review-row td,
.notes-review-table .notes-review-row td {
    vertical-align: middle;
}
.note-detail-pane h5 {
    color: #12384e;
    font-weight: 800;
}
.note-detail-pane .notes-preview-type {
    border-left-width: 7px;
}
@media (max-width: 991.98px) {
    .patient-open-header {
        align-items: stretch !important;
    }
    .patient-header-sticky-board {
        border-left: 0;
        border-top: 3px solid #62b6d2;
        padding-left: 0;
        padding-top: .6rem;
    }
    .sticky-note-list-header {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: .2rem;
    }
    .sticky-note-list-header .sticky-note-card {
        flex: 0 0 150px;
    }
}
@media (max-width: 767.98px) {
    body:not(.login-page) {
        padding-bottom: 84px !important;
    }
    body:not(.login-page) .footer.fixed-bottom,
    body:not(.login-page) footer.footer.fixed-bottom {
        display: none !important;
    }
    .charting-navbar {
        padding-bottom: .25rem !important;
    }
    #chartWorkspaceTabs.master-workspace-tabs {
        position: fixed !important;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1060;
        background: rgba(255,255,255,.98) !important;
        border-top: 1px solid #8bbfd7;
        border-bottom: 0;
        box-shadow: 0 -3px 10px rgba(0,0,0,.14);
        padding: .35rem .45rem .5rem !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }
    #chartWorkspaceTabs .workspace-tab {
        min-height: 48px;
        min-width: 76px;
        max-width: 145px;
        justify-content: center;
        border-radius: 10px;
        font-size: .74rem;
        line-height: 1.1;
        padding: .35rem .45rem;
        flex: 0 0 auto;
    }
    #chartWorkspaceTabs .workspace-base-tab::before {
        display: block;
        font-size: 1rem;
        line-height: 1;
        margin-bottom: .1rem;
    }
    #chartWorkspaceTabs [data-master-tab="patients"]::before { content: "👥"; }
    #chartWorkspaceTabs [data-master-tab="units"]::before { content: "🏥"; }
    #chartWorkspaceTabs [data-master-tab="worklist"]::before { content: "✓"; }
    .workspace-chart-slot {
        display: inline-flex;
        gap: .35rem;
    }
    .workspace-chart-tab {
        min-width: 112px !important;
        flex-direction: row;
        justify-content: space-between !important;
    }
    .sticky-note-launch {
        min-width: 92px !important;
    }
    .patient-open-header {
        padding: .55rem;
        margin-left: -.25rem;
        margin-right: -.25rem;
    }
    .patient-open-name-block {
        min-width: 0;
    }
    .patient-open-name-block h4 {
        font-size: 1.05rem;
    }
    .main-content,
    .charting-screen {
        padding-left: .5rem !important;
        padding-right: .5rem !important;
    }
    .patient-info-box.sticky-sidebar {
        position: static !important;
    }
    .nav-tabs.chart-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    .nav-tabs.chart-tabs .nav-item {
        flex: 0 0 auto;
        min-width: 120px;
    }
    .note-review-layout,
    .notes-review-shell {
        display: block !important;
    }
    .note-review-table-wrap,
    .notes-table-scroll {
        max-height: 50vh;
        overflow: auto;
        border-right: 0;
        border-bottom: 1px solid #b6cbd9;
    }
    .note-detail-pane,
    .notes-preview-panel {
        max-height: none;
        min-height: 220px;
    }
    .note-preview {
        max-width: none;
    }
    .table-responsive {
        -webkit-overflow-scrolling: touch;
    }
    .modal-dialog {
        margin: .5rem;
    }
    .modal-content {
        max-height: calc(100vh - 1rem);
        overflow-y: auto;
    }
}

/* v15 refinements: header placement, compact sticky board, flowsheet section controls, labs arrows, and orders tags */
.top-primary-tabs {
    display: flex;
    align-items: center;
    gap: .55rem;
    flex-wrap: nowrap;
}
.top-primary-tab {
    color: rgba(255,255,255,.92) !important;
    font-weight: 800;
    text-decoration: none !important;
    padding: .34rem .62rem;
    border-radius: .35rem;
    border: 1px solid rgba(255,255,255,.25);
    background: rgba(255,255,255,.10);
}
.top-primary-tab:hover {
    background: rgba(255,255,255,.22);
    color: #fff !important;
}
.open-chart-tab-row {
    background: linear-gradient(#d9f1fa, #c5e6f2) !important;
    border-top: 1px solid rgba(255,255,255,.35);
    border-bottom: 1px solid #8cbfd5;
}
.workspace-open-label {
    font-size: .78rem;
    font-weight: 900;
    color: #064d70;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-right: .25rem;
}
.workspace-empty-hint {
    color: #44606f;
    font-size: .76rem;
    white-space: nowrap;
}
.main-workspace-nav .nav-link[href$="#patients"],
.main-workspace-nav .nav-link[href$="#units"],
.main-workspace-nav .nav-link[href$="#worklist"] { display: none; }
.patient-sidebar-identity {
    border-bottom: 1px solid #d9e6ed;
    padding-bottom: .55rem;
}
.patient-sidebar-name-row {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: left;
}
.patient-sidebar-name-text { min-width: 0; }
.patient-sidebar-sticky {
    background: #fff9df;
    border: 1px solid #e5ca5c;
    border-radius: .5rem;
    padding: .45rem .5rem;
}
.patient-sidebar-sticky strong { color: #5d4400; }
.sticky-note-list-patient {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: .45rem;
    overflow: visible;
    max-height: none;
}
.sticky-note-list-patient .sticky-note-card {
    width: 112px;
    min-height: 58px;
    max-height: 92px;
    overflow: hidden;
    font-size: .72rem;
    padding: .38rem .43rem;
    margin-bottom: 0;
}
.sticky-note-list-patient .sticky-note-card strong {
    font-size: .74rem;
    line-height: 1.05;
}
.sticky-note-list-patient .sticky-note-card div { line-height: 1.08; }
.sticky-note-overflow {
    align-self: center;
    min-width: 58px;
    padding: .38rem .46rem;
    border-radius: 999px;
    background: #fff;
    border: 1px dashed #b08b00;
    color: #6a5000;
    font-weight: 900;
    font-size: .72rem;
    text-align: center;
}
.flowsheet-section-toggle-block {
    border-bottom: 1px solid #e1edf3;
    background: #fbfdff;
}
.flowsheet-section-toggle-block:nth-child(even) { background: #f2f9fd; }
.flowsheet-section-toggle-block .flowsheet-section-toggle {
    display: flex;
    align-items: center;
    gap: .38rem;
    padding: .42rem .52rem .2rem;
    margin: 0;
    font-weight: 850;
    color: #123f58;
}
.flowsheet-section-toggle-block .flowsheet-section-toggle span { flex: 1; }
.flowsheet-subsection-list {
    padding: 0 .55rem .38rem 1.65rem;
    display: grid;
    gap: .08rem;
}
.flowsheet-subsection-item {
    font-size: .74rem;
    color: #415b6b;
    line-height: 1.16;
}
.flowsheet-table tbody tr:not(.flowsheet-section-row):nth-child(odd) .flowsheet-value-cell,
.flowsheet-grid-table tbody tr:not(.flowsheet-group-row):nth-child(odd) .flowsheet-entry-cell,
.vent-column-table tbody tr:not(.vent-section-row):nth-child(odd) td,
.vent-column-entry-table tbody tr:not(.vent-section-row):nth-child(odd) td,
.timeseries-table tbody tr:nth-child(odd) td {
    background-color: #f7fbfd !important;
}
.flowsheet-table tbody tr:not(.flowsheet-section-row):nth-child(even) .flowsheet-value-cell,
.flowsheet-grid-table tbody tr:not(.flowsheet-group-row):nth-child(even) .flowsheet-entry-cell,
.vent-column-table tbody tr:not(.vent-section-row):nth-child(even) td,
.vent-column-entry-table tbody tr:not(.vent-section-row):nth-child(even) td,
.timeseries-table tbody tr:nth-child(even) td {
    background-color: #eef7fc !important;
}
.flowsheet-doc-cell,
.flowsheet-user-entry,
.flowsheet-table .flowsheet-doc-cell { background-color: #fffef2 !important; }
.lab-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.1rem;
    height: 1.1rem;
    margin-left: .25rem;
    border-radius: 999px;
    font-weight: 900;
    font-size: .9rem;
    line-height: 1;
}
.lab-arrow-up { color: #b91c1c; background: #fee2e2; }
.lab-arrow-down { color: #1d4ed8; background: #dbeafe; }
.lab-arrow-critical {
    color: #fff !important;
    background: #991b1b !important;
    box-shadow: 0 0 0 2px rgba(153,27,27,.16);
}
.notes-review-table .notes-review-row td:first-child {
    border-left: 10px solid var(--note-color, #9aa8b5) !important;
}
.notes-review-table .notes-review-row.note-admission td:first-child { --note-color:#2457a6; }
.notes-review-table .notes-review-row.note-progress td:first-child { --note-color:#188754; }
.notes-review-table .notes-review-row.note-rounding td:first-child { --note-color:#0f766e; }
.notes-review-table .notes-review-row.note-nursing td:first-child { --note-color:#0d8ea8; }
.notes-review-table .notes-review-row.note-critical td:first-child { --note-color:#dc2626; }
.notes-review-table .notes-review-row.note-respiratory td:first-child { --note-color:#d97706; }
.notes-review-table .notes-review-row.note-consult td:first-child { --note-color:#7c3aed; }
.notes-review-table .notes-review-row.note-therapy td:first-child { --note-color:#be185d; }
.notes-review-table .notes-review-row.note-education td:first-child { --note-color:#0369a1; }
.notes-review-table .notes-review-row.note-discharge td:first-child { --note-color:#64748b; }
.notes-review-table .notes-review-row.note-case-management td:first-child { --note-color:#92400e; }
.notes-review-table .notes-review-row.note-clinical-document td:first-child { --note-color:#334155; }
.notes-review-table .notes-review-row.note-medication-reference td:first-child { --note-color:#0891b2; }
.order-detail-cell {
    position: relative;
    overflow: hidden;
}
.order-background-tags {
    display: inline-flex;
    gap: .28rem;
    margin-right: .35rem;
    opacity: .82;
}
.order-detail-cell strong { position: relative; z-index: 1; }
.footer .logo-footer {
    filter: none !important;
}
@media (max-width: 991.98px) {
    .top-primary-tabs {
        width: 100%;
        order: 4;
        margin: .45rem 0 0 !important;
        overflow-x: auto;
    }
    .top-primary-tab { flex: 0 0 auto; }
}
@media (max-width: 767.98px) {
    .open-chart-tab-row {
        position: sticky !important;
        top: 0;
        z-index: 1050;
    }
    .workspace-empty-hint { display: none; }
    .patient-sidebar-name-row { justify-content: flex-start; }
    .sticky-note-list-patient { flex-wrap: nowrap; overflow-x: auto; }
    .sticky-note-list-patient .sticky-note-card { flex: 0 0 112px; }
}


/* v15 final polish */
.order-detail-cell { position: relative !important; overflow: hidden !important; }
.order-background-tags {
    position: absolute !important;
    right: .35rem !important;
    top: .25rem !important;
    display: inline-flex !important;
    gap: .25rem !important;
    opacity: .16 !important;
    pointer-events: none !important;
    z-index: 0 !important;
}
.order-detail-cell > strong,
.order-detail-cell > .small { position: relative; z-index: 1; }
.order-background-tags .badge { font-size: .78rem; padding: .25rem .5rem; }
.footer .logo-footer, .login-footer-logo { filter: none !important; }
.sticky-note-overflow { text-transform: none; }
@media (min-width: 768px) {
  .main-workspace-nav .nav-link[href$="#patients"],
  .main-workspace-nav .nav-link[href$="#units"],
  .main-workspace-nav .nav-link[href$="#worklist"] { display:none !important; }
}

/* v15 refinements */
.patient-sidebar-identity {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(112px, auto);
    gap: .55rem;
    align-items: start;
}
.patient-sidebar-identity .patient-sidebar-name-row { justify-content: flex-start; }
.patient-sidebar-sticky {
    background: transparent !important;
    border: 0 !important;
    padding: .15rem .1rem !important;
}
.sticky-sidebar-add { font-weight: 800; }
.sticky-note-list-patient .sticky-empty,
.sticky-note-list-header .sticky-empty {
    background: #fff8bd;
    border: 1px dashed #d0a700;
    border-radius: .45rem;
    padding: .35rem .5rem;
    color: #6b5300 !important;
}
@media (max-width: 1199.98px) {
    .patient-sidebar-identity { grid-template-columns: 1fr; }
}
.flowsheet-subsection-item {
    display: flex;
    align-items: center;
    gap: .28rem;
    margin: 0;
    cursor: pointer;
}
.flowsheet-subsection-item input { flex: 0 0 auto; }

/* v16 flowsheet, lab, ventilator, respiratory polish */
.workspace-empty-hint { display: none !important; }
.master-workspace-tabs.open-chart-tab-row { order: 2; }
.flowsheet-workspace-combined { grid-template-columns: minmax(0, 1fr) 300px !important; }
.flowsheet-combined-table .flowsheet-row-label,
.resp-intervention-flow-table .flowsheet-row-label,
.vent-column-entry-table .flowsheet-row-label {
    width: 310px !important;
    min-width: 310px !important;
    max-width: 310px !important;
}
.flowsheet-inline-section-toggle,
.flowsheet-inline-row-toggle {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    width: 100%;
    cursor: pointer;
}
.flowsheet-inline-section-toggle input,
.flowsheet-inline-row-toggle input { width: 1rem; height: 1rem; flex: 0 0 auto; }
.flowsheet-inline-section-toggle span { font-size: .95rem; font-weight: 900; letter-spacing: .03em; }
.flowsheet-inline-row-toggle span { font-weight: 700; color: #123246; }
.flowsheet-row-disabled .flowsheet-row-label { background: #f3f6f8 !important; color: #7a8a96 !important; }
.flowsheet-row-disabled .flowsheet-inline-row-toggle span { text-decoration: line-through; color: #7a8a96 !important; }
.flowsheet-row-disabled td { background: #f7f9fa !important; }
.flowsheet-table tbody tr.flowsheet-data-row:nth-of-type(odd) .flowsheet-row-label,
.flowsheet-table tbody tr.flowsheet-data-row:nth-of-type(odd) .flowsheet-value-cell { background-color: #f7fbfd !important; }
.flowsheet-table tbody tr.flowsheet-data-row:nth-of-type(even) .flowsheet-row-label,
.flowsheet-table tbody tr.flowsheet-data-row:nth-of-type(even) .flowsheet-value-cell { background-color: #eef7fc !important; }
.flowsheet-table .flowsheet-doc-cell { background-color: #fffef2 !important; }
.flowsheet-table select.form-control-sm { min-width: 118px; padding: .15rem .25rem; height: calc(1.45em + .4rem + 2px); }
.resp-intervention-flow-table .flowsheet-inline-row-toggle span:has(+ *) { color: inherit; }
.charge-marker,
.resp-intervention-flow-table .flowsheet-row-label:has(label span) { }
.vent-column-entry-table .vent-doc-header,
.vent-column-entry-table td.vent-doc-cell { min-width: 190px !important; }
.vent-column-entry-table .flowsheet-section-row th { background: #dff4ff !important; color: #064d7a !important; text-align: center !important; }
.vent-flowsheet-toolbar { border-top: 1px solid #b8c8d8; }
.lab-arrow {
    min-width: 1.55rem !important;
    height: 1.55rem !important;
    font-size: 1.25rem !important;
    margin-left: .38rem !important;
    border: 2px solid currentColor;
    vertical-align: middle;
}
.lab-arrow-critical {
    min-width: 1.75rem !important;
    height: 1.75rem !important;
    font-size: 1.15rem !important;
    border: 2px solid #7f1d1d !important;
    box-shadow: 0 0 0 3px rgba(153,27,27,.18) !important;
}
.lab-flag { display: none !important; }
@media (max-width: 1199.98px) {
  .flowsheet-workspace-combined { grid-template-columns: 1fr !important; }
}
@media (max-width: 767.98px) {
  .flowsheet-combined-table .flowsheet-row-label,
  .resp-intervention-flow-table .flowsheet-row-label,
  .vent-column-entry-table .flowsheet-row-label {
      width: 240px !important;
      min-width: 240px !important;
      max-width: 240px !important;
  }
}

/* v16 footer: keep login/header logo color, but footer itself uses the original grayscale mark. */
.footer .logo-footer { filter: grayscale(1) saturate(0) !important; opacity: .92; }
body.login-page .login-footer-logo, .navbar-brand-logo { filter: none !important; }

/* v16 integrated flowsheet table controls */
.flowsheet-workspace-integrated { grid-template-columns: minmax(0, 1fr) 300px !important; }
.flowsheet-main-full { min-width: 0; }
.flowsheet-integrated-table .flowsheet-row-label,
.resp-intervention-flow-table .flowsheet-row-label {
    width: 325px !important;
    min-width: 325px !important;
    max-width: 325px !important;
}
.flowsheet-section-control-header { background: #e6f3fb !important; color: #064d7a !important; }
.flowsheet-section-control .flowsheet-section-toggle,
.flowsheet-control-row .flowsheet-subsection-item {
    display: inline-flex !important;
    align-items: center !important;
    gap: .45rem;
    width: 100%;
    padding: 0 !important;
    border: 0 !important;
    margin: 0 !important;
    cursor: pointer;
}
.flowsheet-section-control input,
.flowsheet-control-row input,
.resp-intervention-flow-table .flowsheet-inline-section-toggle input,
.resp-intervention-flow-table .flowsheet-inline-row-toggle input {
    width: 1rem; height: 1rem; flex: 0 0 auto;
}
.flowsheet-section-control span { font-size: .96rem; font-weight: 900; }
.flowsheet-control-row .flowsheet-row-title { font-weight: 750; color: #123246; }
.flowsheet-charge-row .flowsheet-row-title,
.resp-intervention-flow-table .flowsheet-row-label:has(span:nth-child(1)) { color: #3f5c08; }
.flowsheet-data-row.flowsheet-row-disabled .flowsheet-row-label { background: #f3f6f8 !important; color: #7a8a96 !important; }
.flowsheet-data-row.flowsheet-row-disabled .flowsheet-row-title { text-decoration: line-through; color: #7a8a96 !important; }
.flowsheet-data-row.flowsheet-row-disabled td { background: #f7f9fa !important; }
.charge-input { max-width: 90px; text-align: center; }
@media (max-width: 1199.98px) { .flowsheet-workspace-integrated { grid-template-columns: 1fr !important; } }
@media (max-width: 767.98px) {
  .flowsheet-integrated-table .flowsheet-row-label,
  .resp-intervention-flow-table .flowsheet-row-label { width: 245px !important; min-width: 245px !important; max-width: 245px !important; }
}

/* v16 refinements: combined flowsheet controls, stronger lab arrows, respiratory therapy charges, and open-chart row cleanup */
.workspace-empty-hint { display: none !important; }
#chartWorkspaceTabs.open-chart-tab-row {
    display: flex;
    align-items: center;
    gap: .45rem;
    min-height: 38px;
    padding-top: .35rem !important;
    padding-bottom: .35rem !important;
}
.flowsheet-workspace-integrated {
    grid-template-columns: minmax(0, 1fr) 300px !important;
}
.flowsheet-main-full { min-width: 0; }
.flowsheet-integrated-table .flowsheet-section-control-header,
.flowsheet-integrated-table .flowsheet-row-label,
.resp-intervention-flow-table .flowsheet-row-label,
.vent-flow-table .flowsheet-row-label {
    width: 300px !important;
    min-width: 300px !important;
    max-width: 300px !important;
}
.flowsheet-section-control-header {
    vertical-align: top !important;
    background: #e9f5fb !important;
    color: #0a4262 !important;
}
.flowsheet-section-control {
    background: #e5f4fb !important;
    color: #075985 !important;
    text-align: left !important;
    font-size: .95rem !important;
}
.flowsheet-section-control .flowsheet-section-toggle,
.flowsheet-inline-section-toggle {
    display: inline-flex !important;
    align-items: center;
    gap: .45rem;
    padding: 0 !important;
    border: 0 !important;
    font-weight: 900;
    text-transform: none;
    letter-spacing: 0;
}
.flowsheet-control-row {
    background: #fff !important;
    vertical-align: middle !important;
}
.flowsheet-control-row .flowsheet-subsection-item,
.flowsheet-inline-row-toggle {
    display: flex !important;
    align-items: center;
    gap: .38rem;
    color: #123f58;
    font-weight: 800;
    line-height: 1.2;
}
.flowsheet-control-row input[type="checkbox"],
.flowsheet-section-control input[type="checkbox"],
.resp-intervention-flow-table input[type="checkbox"] {
    width: 17px;
    height: 17px;
}
.flowsheet-table tbody tr.flowsheet-data-row:nth-of-type(odd) > th,
.flowsheet-table tbody tr.flowsheet-data-row:nth-of-type(odd) > td,
.resp-intervention-flow-table tbody tr.flowsheet-data-row:nth-of-type(odd) > th,
.resp-intervention-flow-table tbody tr.flowsheet-data-row:nth-of-type(odd) > td,
.vent-flow-table tbody tr.flowsheet-data-row:nth-of-type(odd) > th,
.vent-flow-table tbody tr.flowsheet-data-row:nth-of-type(odd) > td {
    background-color: #ffffff !important;
}
.flowsheet-table tbody tr.flowsheet-data-row:nth-of-type(even) > th,
.flowsheet-table tbody tr.flowsheet-data-row:nth-of-type(even) > td,
.resp-intervention-flow-table tbody tr.flowsheet-data-row:nth-of-type(even) > th,
.resp-intervention-flow-table tbody tr.flowsheet-data-row:nth-of-type(even) > td,
.vent-flow-table tbody tr.flowsheet-data-row:nth-of-type(even) > th,
.vent-flow-table tbody tr.flowsheet-data-row:nth-of-type(even) > td {
    background-color: #f1f8fd !important;
}
.flowsheet-charge-row > th,
.flowsheet-charge-row > td {
    background: #fff9df !important;
}
.charge-input,
.flowsheet-charge-row input {
    font-weight: 900 !important;
    color: #6b4b00 !important;
}
.resp-intervention-flow-table .flowsheet-section-row th,
.vent-flow-table .flowsheet-section-row th,
.vent-flow-table .vent-section-row th {
    background: #e5f4fb !important;
    color: #075985 !important;
    text-align: left !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
}
.vent-flow-table .vent-doc-cell input,
.vent-flow-table .vent-doc-cell select,
.vent-flow-table .vent-doc-cell textarea,
.resp-intervention-flow-table .flowsheet-doc-cell input,
.resp-intervention-flow-table .flowsheet-doc-cell select,
.resp-intervention-flow-table .flowsheet-doc-cell textarea {
    min-width: 128px;
}
.lab-results-table .lab-flag { display: none !important; }
.lab-arrow {
    min-width: 1.65rem !important;
    height: 1.65rem !important;
    margin-left: .4rem !important;
    border-radius: .35rem !important;
    font-size: 1.35rem !important;
    font-weight: 1000 !important;
    line-height: 1 !important;
    border: 2px solid currentColor !important;
    box-shadow: 0 1px 3px rgba(0,0,0,.18) !important;
}
.lab-arrow-critical {
    min-width: 2.05rem !important;
    height: 1.75rem !important;
    font-size: 1.45rem !important;
    border-color: #7f1d1d !important;
}
.notes-review-table .notes-review-row td:first-child {
    border-left-width: 0 !important;
    box-shadow: inset 11px 0 0 var(--note-color, #9aa8b5) !important;
    padding-left: 18px !important;
}
.notes-review-table .notes-review-row.active td {
    outline: 2px solid rgba(0, 123, 255, .35);
    outline-offset: -2px;
}
@media (max-width: 1199.98px) {
    .flowsheet-workspace-integrated { grid-template-columns: 1fr !important; }
}
@media (max-width: 767.98px) {
    #chartWorkspaceTabs.open-chart-tab-row {
        position: static !important;
        overflow-x: auto;
        flex-wrap: nowrap;
    }
    .flowsheet-workspace-integrated { display: block !important; }
    .flowsheet-detail-panel { margin-top: .75rem; }
}

/* v16b: combined flowsheet controls and respiratory/ventilator spreadsheet alignment */
#chartWorkspaceTabs .workspace-open-label { margin-right: .5rem; }
#chartWorkspaceTabs .workspace-empty-hint { display: none !important; }
.flowsheet-combined-table .flowsheet-section-row th,
.resp-intervention-flow-table .flowsheet-section-row th,
.vent-flow-table .flowsheet-section-row th {
    text-align: left !important;
    background: #e8f6fd !important;
    border-top: 3px solid #70a8c9 !important;
    color: #073c5a !important;
}
.flowsheet-combined-table .flowsheet-data-row .flowsheet-row-label,
.resp-intervention-flow-table .flowsheet-data-row .flowsheet-row-label,
.vent-flow-table .flowsheet-data-row .flowsheet-row-label {
    border-bottom: 2px solid #b5c2cd !important;
}
.flowsheet-combined-table .flowsheet-data-row .flowsheet-value-cell,
.resp-intervention-flow-table .flowsheet-data-row .flowsheet-value-cell,
.vent-flow-table .flowsheet-data-row .flowsheet-value-cell {
    border-bottom: 2px solid #b5c2cd !important;
}
.resp-intervention-flow-table .charge-row .flowsheet-row-label,
.resp-intervention-flow-table .charge-row .flowsheet-value-cell {
    background: #fff9df !important;
}
.charge-badge,
.charge-input-group .input-group-text {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.35rem;
    height: 1.35rem;
    border-radius: 999px;
    background: #facc15;
    color: #4a3800;
    font-weight: 900;
    border: 1px solid #d5a500;
}
.charge-input-group .input-group-text {
    min-width: 2rem;
    height: auto;
    border-radius: .25rem 0 0 .25rem;
}
.resp-intervention-flow-table select.form-control-sm,
.vent-flow-table select.form-control-sm { min-width: 132px; }
.vent-flow-toolbar { border-top: 1px solid #b8c8d8; }
.vent-flow-table .vent-label-col,
.vent-flow-table .flowsheet-row-label { background: #fff !important; }
.vent-flow-table td.vent-doc-cell,
.resp-intervention-flow-table td.flowsheet-doc-cell { background: #fffef2 !important; }
.lab-results-table .lab-flag { display: none !important; }
.lab-results-table .lab-arrow {
    font-size: 1.45rem !important;
    font-weight: 1000 !important;
    min-width: 1.75rem !important;
    height: 1.75rem !important;
    border-width: 2px !important;
}
.lab-results-table .lab-arrow-critical {
    font-size: 1.35rem !important;
    letter-spacing: -0.08em;
    min-width: 2rem !important;
    height: 2rem !important;
}
.footer .logo-footer { filter: grayscale(1) saturate(0) !important; opacity: .9 !important; }
.charge-row > th,
.charge-row > td { background: #fff9df !important; }
.charge-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 999px;
    background: #f59e0b;
    color: #fff;
    font-weight: 1000;
    margin-right: .25rem;
}

/* v17: section-level flowsheet controls, cleaner open-chart row, and note-preview refinements */
#chartWorkspaceTabs.open-chart-tab-row.no-open-charts {
    display: none !important;
}
#chartWorkspaceTabs.open-chart-tab-row {
    padding-left: .75rem !important;
    padding-right: .75rem !important;
}
#chartWorkspaceTabs .workspace-chart-slot {
    display: flex;
    align-items: center;
    gap: .35rem;
    overflow-x: auto;
    white-space: nowrap;
    width: 100%;
}
.flowsheet-combined-table .flowsheet-data-row > th.flowsheet-row-label,
.resp-intervention-flow-table .flowsheet-data-row > th.flowsheet-row-label,
.vent-flow-table .flowsheet-data-row > th.flowsheet-row-label {
    background: #ffffff !important;
    color: #123246 !important;
    font-weight: 800 !important;
    border-right: 2px solid #8fb2c7 !important;
}
.flowsheet-combined-table .flowsheet-data-row:nth-of-type(even) > th.flowsheet-row-label,
.resp-intervention-flow-table .flowsheet-data-row:nth-of-type(even) > th.flowsheet-row-label,
.vent-flow-table .flowsheet-data-row:nth-of-type(even) > th.flowsheet-row-label {
    background: #ffffff !important;
}
.flowsheet-combined-table .flowsheet-data-row:nth-of-type(even) > td,
.resp-intervention-flow-table .flowsheet-data-row:nth-of-type(even) > td,
.vent-flow-table .flowsheet-data-row:nth-of-type(even) > td {
    background: #eef7fc !important;
}
.flowsheet-combined-table .flowsheet-data-row:nth-of-type(odd) > td,
.resp-intervention-flow-table .flowsheet-data-row:nth-of-type(odd) > td,
.vent-flow-table .flowsheet-data-row:nth-of-type(odd) > td {
    background: #ffffff !important;
}
.flowsheet-section-row th {
    border-top: 3px solid #6fa8c8 !important;
    background: #e8f6fd !important;
}
.flowsheet-section-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    vertical-align: middle;
}
.flowsheet-row-title {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
}
.resp-intervention-break th {
    background: #dff2fb !important;
    color: #073c5a !important;
}
.flowsheet-file-button {
    font-weight: 800;
}
body[data-user-role="viewer"] .flowsheet-file-button {
    color: #7a4e00;
    border-color: #f0ad4e;
    background: #fff7dd;
}
.notes-review-row td:first-child {
    box-shadow: inset 12px 0 0 currentColor !important;
}
.note-status-by {
    line-height: 1.1;
    margin-top: .15rem;
}
.notes-preview-stack {
    display: grid;
    grid-template-columns: 1fr;
    gap: .3rem;
    padding: .5rem .65rem;
    border: 1px solid #d4e3ec;
    background: #ffffff;
    border-radius: .35rem;
}
.notes-preview-stack div {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    gap: .5rem;
    align-items: start;
}
.notes-preview-stack span:first-child,
.notes-preview-stack div > span:first-child {
    color: #516776;
    font-weight: 700;
}
.notes-preview-stack strong {
    color: #102e42;
    font-weight: 800;
}
.patient-sidebar-sticky:empty,
.sticky-note-list:empty {
    display: none;
}
@media (max-width: 767.98px) {
    #chartWorkspaceTabs.open-chart-tab-row:not(.no-open-charts) {
        display: flex !important;
        min-height: 34px;
    }
    .flowsheet-combined-table .flowsheet-row-label,
    .resp-intervention-flow-table .flowsheet-row-label,
    .vent-flow-table .flowsheet-row-label {
        width: 220px !important;
        min-width: 220px !important;
        max-width: 220px !important;
    }
}

/* v17 refinements: section-only flowsheet toggles, empty Sticky board, note stack, and compact open chart row */
.open-chart-divider { border-color: rgba(255,255,255,.22) !important; }
.open-chart-tab-row.has-open-chart { min-height: 32px !important; padding-top: .2rem !important; padding-bottom: .2rem !important; }
.workspace-open-label { display: none !important; }
.sticky-note-list-patient:empty,
.sticky-note-list-header:empty { min-height: 0 !important; }
.sticky-empty { display: none !important; }
.flowsheet-table .flowsheet-data-row > th.flowsheet-row-label,
.flowsheet-combined-table .flowsheet-data-row > th.flowsheet-row-label,
.resp-intervention-flow-table .flowsheet-data-row > th.flowsheet-row-label,
.vent-flow-table .flowsheet-data-row > th.flowsheet-row-label,
.vent-flow-table .vent-label-col {
    background: #ffffff !important;
    color: #143447 !important;
    font-weight: 800;
}
.flowsheet-table .flowsheet-data-row:nth-of-type(even) > td,
.resp-intervention-flow-table .flowsheet-data-row:nth-of-type(even) > td,
.vent-flow-table .flowsheet-data-row:nth-of-type(even) > td {
    background: #f1f8fd !important;
}
.flowsheet-table .flowsheet-data-row:nth-of-type(odd) > td,
.resp-intervention-flow-table .flowsheet-data-row:nth-of-type(odd) > td,
.vent-flow-table .flowsheet-data-row:nth-of-type(odd) > td {
    background: #ffffff !important;
}
.flowsheet-subgroup-row th,
.resp-subgroup-row th {
    background: #f8fafc !important;
    color: #24516b !important;
    border-top: 2px solid #9ec7da !important;
    font-weight: 900;
    text-transform: uppercase;
    font-size: .78rem;
    letter-spacing: .04em;
}
.flowsheet-section-toggle input[type="checkbox"] { transform: scale(1.05); }
.flowsheet-row-title { padding-left: .15rem; }
.notes-preview-stack {
    display: grid;
    grid-template-columns: 1fr;
    gap: .35rem;
    margin-top: .4rem;
}
.notes-preview-stack > div {
    display: flex;
    justify-content: space-between;
    gap: .75rem;
    border: 1px solid #d6e2ea;
    background: #ffffff;
    padding: .35rem .5rem;
    border-radius: .25rem;
}
.notes-preview-stack span {
    color: #64748b;
    font-size: .78rem;
    font-weight: 800;
    text-transform: uppercase;
}
.notes-preview-stack strong { color: #17364a; text-align: right; }
body[data-user-role="viewer"] .browser-practice-form .btn-success {
    background: #facc15 !important;
    border-color: #d4a900 !important;
    color: #3b2f00 !important;
}
body[data-user-role="viewer"] .browser-practice-form .btn-success::after {
    content: "";
}
@media (max-width: 767.98px) {
    .open-chart-tab-row.has-open-chart {
        position: static !important;
        border-radius: 0;
        overflow-x: auto;
    }
    .flowsheet-integrated-table .flowsheet-row-label,
    .resp-intervention-flow-table .flowsheet-row-label,
    .vent-flow-table .flowsheet-row-label {
        width: 230px !important;
        min-width: 230px !important;
        max-width: 230px !important;
    }
}

/* v17 final refinements: section-only flowsheet controls, unbanded label columns, local-practice cues */
.flowsheet-table .flowsheet-data-row > th.flowsheet-row-label,
.flowsheet-combined-table .flowsheet-data-row > th.flowsheet-row-label,
.resp-intervention-flow-table .flowsheet-data-row > th.flowsheet-row-label,
.vent-flow-table .flowsheet-data-row > th.flowsheet-row-label,
.vent-flow-table .vent-label-col,
.resp-intervention-flow-table th.flowsheet-row-label {
    background-color: #ffffff !important;
    color: #143447 !important;
    font-weight: 800 !important;
    border-right: 2px solid #8fb2c7 !important;
}
.flowsheet-table .flowsheet-data-row:nth-of-type(odd) > th.flowsheet-row-label,
.flowsheet-table .flowsheet-data-row:nth-of-type(even) > th.flowsheet-row-label,
.resp-intervention-flow-table .flowsheet-data-row:nth-of-type(odd) > th.flowsheet-row-label,
.resp-intervention-flow-table .flowsheet-data-row:nth-of-type(even) > th.flowsheet-row-label,
.vent-flow-table .flowsheet-data-row:nth-of-type(odd) > th.flowsheet-row-label,
.vent-flow-table .flowsheet-data-row:nth-of-type(even) > th.flowsheet-row-label {
    background-color: #ffffff !important;
}
.flowsheet-table .flowsheet-section-row th,
.resp-intervention-flow-table .flowsheet-section-row th,
.vent-flow-table .flowsheet-section-row th {
    background: #e8f6fd !important;
    color: #073c5a !important;
    border-top: 3px solid #70a8c9 !important;
    text-align: left !important;
}
.flowsheet-table .flowsheet-section-toggle,
.resp-intervention-flow-table .flowsheet-section-toggle,
.vent-flow-table .flowsheet-section-toggle {
    display: inline-flex !important;
    align-items: center;
    gap: .45rem;
    font-weight: 900;
}
.flowsheet-data-row.flowsheet-section-hidden { display: none !important; }
.custom-flow-section th { background: #eaf7ef !important; }
.resp-intervention-flow-table .resp-intervention-break th {
    background: #eff8fc !important;
    border-top: 3px solid #74b5d4 !important;
}
body[data-user-role="viewer"] .flowsheet-file-button,
body[data-user-role="viewer"] .vent-flow-toolbar .flowsheet-file-button,
body[data-user-role="viewer"] #respInterventionForm .flowsheet-toolbar button:first-child {
    background: #fff7dc !important;
    border-color: #e0a300 !important;
    color: #654500 !important;
    font-weight: 900 !important;
}
.patient-sidebar-sticky:empty,
.sticky-note-list:empty,
.sticky-note-list-patient:empty,
.sticky-note-list-header:empty { display: none !important; }
.sticky-empty { display: none !important; }
.notes-review-row { cursor: pointer; }
.notes-review-row.active td { background: #fffde8 !important; }
.notes-preview-stack { align-items: stretch; }
.notes-preview-stack > div { min-height: 2.1rem; }

/* v18 refinements: mobile-safe header, bottom chart-tab scroller, vertical notes preview, and unbanded row labels */
.footer .logo-footer {
    filter: none !important;
    opacity: .96 !important;
}
.workspace-scroll-arrow {
    display: none;
    align-items: center;
    justify-content: center;
    border: 1px solid #9ec9dd;
    background: #ffffff;
    color: #064d7a;
    font-weight: 1000;
    border-radius: .45rem;
    width: 34px;
    height: 34px;
    line-height: 1;
}
#chartWorkspaceTabs.open-chart-tab-row.has-open-chart {
    background: transparent !important;
    border-top: 0 !important;
    border-bottom: 0 !important;
    box-shadow: none !important;
    min-height: 42px !important;
    padding-top: .35rem !important;
    padding-bottom: .35rem !important;
}
#chartWorkspaceTabs .workspace-chart-slot {
    gap: .5rem !important;
}
#chartWorkspaceTabs .workspace-chart-tab {
    min-width: 152px !important;
    min-height: 38px;
    padding: .42rem .62rem !important;
    font-size: .92rem !important;
    border-radius: .45rem .45rem 0 0 !important;
}
#chartWorkspaceTabs .workspace-chart-close,
#chartWorkspaceTabs .workspace-tab-close {
    width: 22px !important;
    height: 22px !important;
    font-size: 1.05rem !important;
}
.note-review-layout.epic-notes-layout {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    min-height: 0 !important;
}
.note-review-layout.epic-notes-layout .note-review-table-wrap {
    max-height: 380px !important;
    overflow: auto !important;
    border-right: 0 !important;
    border-bottom: 1px solid #b6cbd9 !important;
}
.note-review-layout.epic-notes-layout .notes-preview-panel,
.note-review-layout.epic-notes-layout .note-detail-pane {
    border-left: 0 !important;
    border-top: 0 !important;
    max-height: none !important;
    min-height: 250px !important;
    overflow: visible !important;
    background: #ffffff !important;
}
.note-review-layout.epic-notes-layout .note-preview {
    max-width: 520px !important;
}
.flowsheet-table .flowsheet-data-row > th.flowsheet-row-label,
.flowsheet-combined-table .flowsheet-data-row > th.flowsheet-row-label,
.resp-intervention-flow-table .flowsheet-data-row > th.flowsheet-row-label,
.vent-flow-table .flowsheet-data-row > th.flowsheet-row-label,
.vent-flow-table .vent-label-col,
.resp-intervention-flow-table th.flowsheet-row-label,
.flowsheet-table .flowsheet-control-row,
.flowsheet-integrated-table .flowsheet-control-row {
    background: #ffffff !important;
    background-color: #ffffff !important;
    color: #143447 !important;
    font-weight: 800 !important;
}
.flowsheet-table .flowsheet-data-row:nth-of-type(odd) > th.flowsheet-row-label,
.flowsheet-table .flowsheet-data-row:nth-of-type(even) > th.flowsheet-row-label,
.flowsheet-combined-table .flowsheet-data-row:nth-of-type(odd) > th.flowsheet-row-label,
.flowsheet-combined-table .flowsheet-data-row:nth-of-type(even) > th.flowsheet-row-label,
.resp-intervention-flow-table .flowsheet-data-row:nth-of-type(odd) > th.flowsheet-row-label,
.resp-intervention-flow-table .flowsheet-data-row:nth-of-type(even) > th.flowsheet-row-label,
.vent-flow-table .flowsheet-data-row:nth-of-type(odd) > th.flowsheet-row-label,
.vent-flow-table .flowsheet-data-row:nth-of-type(even) > th.flowsheet-row-label {
    background: #ffffff !important;
    background-color: #ffffff !important;
}
@media (max-width: 767.98px) {
    body:not(.login-page) {
        padding-bottom: 92px !important;
    }
    .charting-navbar > .w-100:first-child {
        flex-wrap: wrap !important;
        align-items: center !important;
        gap: .35rem !important;
        padding: .35rem .55rem !important;
    }
    .charting-navbar .navbar-brand {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: .45rem !important;
        font-size: 1rem !important;
        line-height: 1.05 !important;
    }
    .charting-navbar .navbar-brand-logo {
        width: 76px !important;
        max-height: 34px !important;
        margin-bottom: 0 !important;
    }
    .charting-navbar .navbar-toggler {
        order: 2 !important;
        padding: .2rem .4rem !important;
    }
    .charting-navbar .nav-session-controls {
        order: 3 !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: .3rem !important;
        margin-left: 0 !important;
        width: auto !important;
    }
    .charting-navbar .nav-session-controls .btn {
        margin-bottom: 0 !important;
        padding: .22rem .42rem !important;
        font-size: .72rem !important;
    }
    .top-primary-tabs {
        order: 4 !important;
        width: 100% !important;
        margin: .25rem 0 0 0 !important;
        overflow-x: auto !important;
        flex-wrap: nowrap !important;
        -webkit-overflow-scrolling: touch;
        padding-bottom: .08rem;
    }
    .top-primary-tab {
        flex: 0 0 auto !important;
        min-width: 92px !important;
        text-align: center !important;
        padding: .32rem .48rem !important;
        font-size: .86rem !important;
    }
    .chart-user-strip {
        padding: .35rem .55rem !important;
        font-size: .78rem !important;
    }
    .chart-user-strip .small {
        font-size: .78rem !important;
    }
    #chartWorkspaceTabs.open-chart-tab-row.has-open-chart {
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        z-index: 1060 !important;
        display: grid !important;
        grid-template-columns: 38px minmax(0, 1fr) 38px !important;
        align-items: center !important;
        gap: .35rem !important;
        min-height: 68px !important;
        padding: .42rem .46rem calc(.42rem + env(safe-area-inset-bottom)) !important;
        background: rgba(248, 250, 252, .98) !important;
        border-top: 1px solid #93bdd2 !important;
        box-shadow: 0 -4px 14px rgba(0,0,0,.18) !important;
        overflow: hidden !important;
    }
    #chartWorkspaceTabs.open-chart-tab-row.no-open-charts {
        display: none !important;
    }
    #chartWorkspaceTabs .workspace-scroll-arrow {
        display: inline-flex !important;
        flex: 0 0 38px !important;
        width: 38px !important;
        height: 48px !important;
        font-size: 1.65rem !important;
    }
    #workspaceChartSlot.workspace-chart-slot {
        display: flex !important;
        flex-wrap: nowrap !important;
        gap: .4rem !important;
        width: 100% !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        scroll-snap-type: x proximity;
    }
    #workspaceChartSlot.workspace-chart-slot::-webkit-scrollbar { display: none; }
    #chartWorkspaceTabs .workspace-chart-tab {
        flex: 0 0 132px !important;
        min-width: 132px !important;
        max-width: 158px !important;
        min-height: 48px !important;
        border-radius: .65rem !important;
        scroll-snap-align: start;
        justify-content: space-between !important;
    }
    .open-chart-divider { display: none !important; }
    .note-review-layout.epic-notes-layout .note-review-table-wrap {
        max-height: 46vh !important;
    }
    .notes-review-table {
        min-width: 760px;
    }
}

/* v18 refinements: unbanded label columns, stacked notes preview, transparent chart tabs, mobile navigation, and light-gray footer mark */
.footer .logo-footer,
.login-footer-logo {
    filter: none !important;
    opacity: .96 !important;
}

/* Keep the first/label column clean white; only value cells use banding. */
.flowsheet-combined-table tbody tr.flowsheet-data-row > th.flowsheet-row-label,
.flowsheet-integrated-table tbody tr.flowsheet-data-row > th.flowsheet-row-label,
.resp-intervention-flow-table tbody tr.flowsheet-data-row > th.flowsheet-row-label,
.vent-flow-table tbody tr.flowsheet-data-row > th.flowsheet-row-label,
.vent-column-entry-table tbody tr.flowsheet-data-row > th.flowsheet-row-label,
.timeseries-table tbody tr > th.sticky-col,
.lab-results-table tbody tr > th.sticky-col {
    background: #ffffff !important;
    background-color: #ffffff !important;
    color: #123246 !important;
    box-shadow: none !important;
}
.flowsheet-combined-table tbody tr.flowsheet-data-row:nth-child(odd) > th.flowsheet-row-label,
.flowsheet-combined-table tbody tr.flowsheet-data-row:nth-child(even) > th.flowsheet-row-label,
.resp-intervention-flow-table tbody tr.flowsheet-data-row:nth-child(odd) > th.flowsheet-row-label,
.resp-intervention-flow-table tbody tr.flowsheet-data-row:nth-child(even) > th.flowsheet-row-label,
.vent-flow-table tbody tr.flowsheet-data-row:nth-child(odd) > th.flowsheet-row-label,
.vent-flow-table tbody tr.flowsheet-data-row:nth-child(even) > th.flowsheet-row-label {
    background: #ffffff !important;
    background-color: #ffffff !important;
}
.flowsheet-combined-table tbody tr.flowsheet-data-row:nth-child(odd) > td,
.resp-intervention-flow-table tbody tr.flowsheet-data-row:nth-child(odd) > td,
.vent-flow-table tbody tr.flowsheet-data-row:nth-child(odd) > td {
    background: #ffffff !important;
}
.flowsheet-combined-table tbody tr.flowsheet-data-row:nth-child(even) > td,
.resp-intervention-flow-table tbody tr.flowsheet-data-row:nth-child(even) > td,
.vent-flow-table tbody tr.flowsheet-data-row:nth-child(even) > td {
    background: #edf7fc !important;
}
.flowsheet-section-row th .flowsheet-section-toggle span {
    font-size: 1rem;
    font-weight: 900;
}

/* Notes list first, preview below it. */
.note-review-layout,
.epic-notes-layout {
    display: block !important;
}
.note-review-table-wrap {
    width: 100% !important;
    border-right: 0 !important;
    border-bottom: 1px solid #b6cbd9 !important;
}
.note-detail-pane,
.notes-preview-panel {
    width: 100% !important;
    max-height: none !important;
    margin-top: .75rem !important;
    border-left: 0 !important;
    border-top: 3px solid #6aaed0 !important;
}
.notes-preview-body {
    max-height: none !important;
}

/* Chart tabs under the navbar should look like tabs, not a background panel. */
.open-chart-divider {
    display: none !important;
}
#chartWorkspaceTabs.master-workspace-tabs.open-chart-tab-row {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    min-height: 42px !important;
    padding-top: .25rem !important;
    padding-bottom: .25rem !important;
}
#chartWorkspaceTabs .workspace-chart-slot {
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: thin;
}
#chartWorkspaceTabs .workspace-chart-tab {
    min-width: 148px !important;
    min-height: 36px !important;
    padding: .42rem .62rem !important;
    font-size: .95rem !important;
    border-radius: .45rem .45rem 0 0 !important;
}
.workspace-scroll-arrow {
    display: none;
    width: 34px;
    height: 34px;
    border: 1px solid #80bbd3;
    border-radius: 999px;
    background: #ffffff;
    color: #06577f;
    font-size: 1.6rem;
    line-height: 1;
    font-weight: 900;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}
.workspace-scroll-arrow:hover {
    background: #e8f6fd;
}

/* Mobile-friendly header and bottom chart-tab scroller. */
@media (max-width: 767.98px) {
    body:not(.login-page) {
        padding-bottom: 74px !important;
    }
    .charting-navbar > .w-100:first-child {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "brand session"
            "tabs tabs";
        gap: .35rem .55rem;
        align-items: center !important;
        padding-left: .55rem !important;
        padding-right: .55rem !important;
    }
    .charting-navbar .navbar-brand {
        grid-area: brand;
        min-width: 0;
        font-size: 1rem !important;
        line-height: 1.1;
    }
    .charting-navbar .navbar-brand-logo {
        max-width: 84px !important;
        max-height: 34px !important;
        object-fit: contain;
    }
    .charting-navbar .top-primary-tabs {
        grid-area: tabs;
        display: flex !important;
        width: 100%;
        overflow-x: auto;
        gap: .3rem;
        margin: 0 !important;
        padding-bottom: .15rem;
        -webkit-overflow-scrolling: touch;
    }
    .charting-navbar .top-primary-tab {
        flex: 0 0 auto;
        min-width: 92px;
        padding: .45rem .65rem !important;
        text-align: center;
        font-size: .92rem;
    }
    .charting-navbar .navbar-toggler,
    .charting-navbar .collapse.navbar-collapse {
        display: none !important;
    }
    .charting-navbar .nav-session-controls {
        grid-area: session;
        margin-left: 0 !important;
        align-items: flex-end !important;
    }
    .charting-navbar .nav-session-controls .btn {
        padding: .22rem .42rem !important;
        font-size: .72rem !important;
        white-space: nowrap;
    }
    .chart-user-strip {
        padding: .35rem .55rem !important;
    }
    #chartWorkspaceTabs.master-workspace-tabs.open-chart-tab-row:not(.no-open-charts) {
        position: fixed !important;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1060;
        display: flex !important;
        align-items: center;
        gap: .35rem;
        background: rgba(246, 250, 252, .98) !important;
        border-top: 1px solid #8bbfd7 !important;
        padding: .35rem .4rem !important;
        min-height: 62px !important;
    }
    #chartWorkspaceTabs .workspace-chart-slot {
        display: flex !important;
        overflow-x: auto;
        gap: .38rem;
        flex: 1 1 auto;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
    }
    #chartWorkspaceTabs .workspace-chart-tab {
        min-width: 138px !important;
        min-height: 46px !important;
        border-radius: .65rem !important;
        flex: 0 0 auto !important;
        justify-content: space-between !important;
        box-shadow: inset 0 -4px 0 #65b8df, 0 1px 4px rgba(0,0,0,.12) !important;
    }
    .workspace-scroll-arrow {
        display: inline-flex !important;
    }
    .footer.fixed-bottom {
        display: none !important;
    }
    .note-review-table-wrap {
        overflow-x: auto;
    }
    .notes-review-table {
        min-width: 720px;
    }
}

/* v18 refinements: unbanded label columns, notes preview below list, transparent open-chart strip, mobile header/tab footer */
.open-chart-tab-row.has-open-chart,
#chartWorkspaceTabs.open-chart-tab-row.has-open-chart {
    background: transparent !important;
    border-top: 0 !important;
    border-bottom: 0 !important;
    box-shadow: none !important;
    min-height: 44px !important;
    padding: .35rem .85rem .2rem !important;
}
#chartWorkspaceTabs .workspace-chart-slot {
    gap: .55rem !important;
}
#chartWorkspaceTabs .workspace-chart-tab {
    min-width: 142px !important;
    min-height: 36px !important;
    padding: .42rem .75rem !important;
    font-size: .94rem !important;
    border-radius: .42rem !important;
}
#chartWorkspaceTabs .workspace-chart-close,
#chartWorkspaceTabs .workspace-tab-close {
    margin-left: .45rem !important;
    min-width: 1.35rem;
    min-height: 1.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Keep the label/measure column clean: only data cells receive row banding. */
.flowsheet-table tbody tr.flowsheet-data-row > th.flowsheet-row-label,
.flowsheet-combined-table tbody tr.flowsheet-data-row > th.flowsheet-row-label,
.resp-intervention-flow-table tbody tr.flowsheet-data-row > th.flowsheet-row-label,
.vent-flow-table tbody tr.flowsheet-data-row > th.flowsheet-row-label,
.vent-flow-table tbody tr.flowsheet-data-row > th.vent-label-col,
.timeseries-table tbody tr > th.label-col,
.vent-column-table tbody tr > th.vent-label-col {
    background: #ffffff !important;
    background-color: #ffffff !important;
    color: #143447 !important;
}
.flowsheet-table tbody tr.flowsheet-data-row:nth-of-type(odd) > th.flowsheet-row-label,
.flowsheet-table tbody tr.flowsheet-data-row:nth-of-type(even) > th.flowsheet-row-label,
.resp-intervention-flow-table tbody tr.flowsheet-data-row:nth-of-type(odd) > th.flowsheet-row-label,
.resp-intervention-flow-table tbody tr.flowsheet-data-row:nth-of-type(even) > th.flowsheet-row-label,
.vent-flow-table tbody tr.flowsheet-data-row:nth-of-type(odd) > th.flowsheet-row-label,
.vent-flow-table tbody tr.flowsheet-data-row:nth-of-type(even) > th.flowsheet-row-label {
    background: #ffffff !important;
    background-color: #ffffff !important;
}
.flowsheet-table tbody tr.flowsheet-data-row:nth-of-type(odd) > td,
.resp-intervention-flow-table tbody tr.flowsheet-data-row:nth-of-type(odd) > td,
.vent-flow-table tbody tr.flowsheet-data-row:nth-of-type(odd) > td {
    background: #ffffff !important;
}
.flowsheet-table tbody tr.flowsheet-data-row:nth-of-type(even) > td,
.resp-intervention-flow-table tbody tr.flowsheet-data-row:nth-of-type(even) > td,
.vent-flow-table tbody tr.flowsheet-data-row:nth-of-type(even) > td {
    background: #eef7fc !important;
}
.flowsheet-table tbody tr.flowsheet-data-row > td.flowsheet-doc-cell,
.resp-intervention-flow-table tbody tr.flowsheet-data-row > td.flowsheet-doc-cell,
.vent-flow-table tbody tr.flowsheet-data-row > td.vent-doc-cell {
    background: #fffef2 !important;
}
.flowsheet-section-row th,
.resp-intervention-flow-table .flowsheet-section-row th,
.vent-flow-table .flowsheet-section-row th {
    position: relative;
    z-index: 9;
}
.flowsheet-section-row .flowsheet-section-toggle input[type="checkbox"] {
    margin-right: .45rem;
}

/* Notes: table first, preview/reading pane below it in a vertical stack. */
.note-review-layout.epic-notes-layout,
.epic-notes-layout {
    display: block !important;
}
.note-review-table-wrap {
    width: 100% !important;
    border-right: 0 !important;
    border-bottom: 1px solid #b6cbd9 !important;
}
.note-detail-pane.notes-preview-panel,
.notes-preview-panel {
    border-left: 0 !important;
    border-top: 1px solid #b6cbd9 !important;
    margin-top: 0 !important;
    max-height: none !important;
    min-height: 280px;
    background: #f8fbfd;
}
.notes-preview-body {
    background: #ffffff;
    border: 1px solid #d6e2ea;
    border-radius: .35rem;
    padding: .75rem;
    min-height: 150px;
}
.notes-review-table .notes-review-row td:first-child {
    box-shadow: inset 12px 0 0 var(--note-color, #9aa8b5) !important;
}

/* Footer logo: white / light-grey mark on the dark footer. */
.footer .logo-footer {
    filter: none !important;
    opacity: .98 !important;
}
.footer {
    background: rgba(20, 24, 28, .96) !important;
}

.mobile-chart-tab-arrow { display: none; }

@media (max-width: 767.98px) {
    body:not(.login-page) {
        padding-bottom: 112px !important;
    }
    .charting-navbar {
        position: sticky;
        top: 0;
        z-index: 1045;
    }
    .charting-navbar > .w-100.d-flex {
        flex-wrap: wrap !important;
        align-items: flex-start !important;
        padding-left: .6rem !important;
        padding-right: .6rem !important;
        gap: .3rem;
    }
    .charting-navbar .navbar-brand {
        flex: 1 1 auto;
        min-width: 150px;
        max-width: calc(100% - 112px);
    }
    .navbar-brand-logo,
    .nav-colossal-logo {
        width: 86px !important;
        max-height: 34px !important;
    }
    .charting-navbar .navbar-brand span {
        font-size: 1rem;
        line-height: 1.05;
    }
    .nav-session-controls {
        order: 2;
        flex-direction: row !important;
        align-items: center !important;
        gap: .35rem;
        margin-left: auto !important;
    }
    .nav-session-controls .btn {
        margin-bottom: 0 !important;
        padding: .22rem .42rem;
        font-size: .72rem;
    }
    .charting-navbar .navbar-toggler {
        order: 3;
        margin-left: auto;
        padding: .2rem .45rem;
    }
    .top-primary-tabs {
        order: 4;
        width: 100% !important;
        margin: .25rem 0 0 !important;
        padding-bottom: .15rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: .35rem;
    }
    .top-primary-tab {
        flex: 0 0 auto;
        padding: .3rem .55rem;
        font-size: .8rem;
    }
    #navbarNav {
        order: 5;
        flex-basis: 100%;
        width: 100%;
    }
    .chart-user-strip {
        padding: .35rem .6rem !important;
        line-height: 1.15;
    }
    .chart-user-strip .small { font-size: .72rem; }
    .main-content.charting-screen {
        margin-top: .55rem !important;
        padding-left: .45rem !important;
        padding-right: .45rem !important;
    }
    #chartWorkspaceTabs.open-chart-tab-row.has-open-chart {
        min-height: 38px !important;
        padding: .18rem .45rem !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    #chartWorkspaceTabs .workspace-chart-tab {
        min-width: 124px !important;
        min-height: 34px !important;
        font-size: .82rem !important;
    }
    .nav-tabs.chart-tabs {
        position: fixed !important;
        left: 44px !important;
        right: 44px !important;
        bottom: 0 !important;
        height: 60px;
        z-index: 1065 !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        flex-wrap: nowrap !important;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        background: rgba(248, 252, 255, .98) !important;
        border: 1px solid #88bed8 !important;
        border-bottom: 0 !important;
        border-radius: .55rem .55rem 0 0;
        padding: .32rem .25rem !important;
        box-shadow: 0 -4px 14px rgba(0,0,0,.18);
    }
    .nav-tabs.chart-tabs .nav-item {
        flex: 0 0 auto !important;
        min-width: 104px !important;
    }
    .nav-tabs.chart-tabs .nav-link {
        height: 46px;
        min-height: 46px;
        padding: .35rem .55rem !important;
        font-size: .78rem;
        border-radius: .45rem !important;
        white-space: nowrap;
    }
    .mobile-chart-tab-arrow {
        position: fixed;
        bottom: 0;
        z-index: 1070;
        width: 42px;
        height: 60px;
        display: flex;
        align-items: center;
        justify-content: center;
        border: 1px solid #88bed8;
        border-bottom: 0;
        background: #e7f5fd;
        color: #064d7a;
        font-size: 1.6rem;
        font-weight: 900;
        box-shadow: 0 -4px 14px rgba(0,0,0,.14);
    }
    .mobile-chart-tab-arrow-left { left: 0; border-radius: .55rem 0 0 0; }
    .mobile-chart-tab-arrow-right { right: 0; border-radius: 0 .55rem 0 0; }
    body:not(.login-page) .footer.fixed-bottom,
    body:not(.login-page) footer.footer.fixed-bottom {
        display: none !important;
    }
    .flowsheet-scroll { max-height: 62vh; }
    .note-detail-pane.notes-preview-panel { min-height: 220px; }
}

/* v19 MOBILE-ONLY REPAIR
   Scope: responsive layout only. This block intentionally overrides older mobile rules that accumulated across prior versions. */
@media (max-width: 767.98px) {
    html,
    body {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }

    body:not(.login-page) {
        padding-bottom: calc(82px + env(safe-area-inset-bottom)) !important;
        background: #f3f9fc !important;
    }

    /* Header: compact, touch-friendly, no Bootstrap collapse on phones. */
    .charting-navbar {
        position: sticky !important;
        top: 0 !important;
        z-index: 1045 !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        overflow: visible !important;
    }

    .charting-navbar > .w-100.d-flex,
    .charting-navbar > .w-100:first-child {
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: .35rem !important;
        padding: .4rem .55rem !important;
        max-width: 100% !important;
    }

    .charting-navbar .navbar-brand {
        flex: 1 1 calc(100% - 138px) !important;
        min-width: 0 !important;
        max-width: calc(100% - 138px) !important;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: .42rem !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .charting-navbar .navbar-brand-logo,
    .charting-navbar .nav-colossal-logo {
        width: 74px !important;
        max-width: 74px !important;
        max-height: 32px !important;
        margin: 0 !important;
        object-fit: contain !important;
        flex: 0 0 auto !important;
        background: transparent !important;
        box-shadow: none !important;
        border: 0 !important;
        padding: 0 !important;
    }

    .charting-navbar .navbar-brand span {
        display: block !important;
        min-width: 0 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        font-size: .98rem !important;
        line-height: 1.05 !important;
    }

    .charting-navbar .navbar-toggler,
    .charting-navbar .collapse.navbar-collapse,
    .charting-navbar #navbarNav {
        display: none !important;
    }

    .charting-navbar .nav-session-controls {
        flex: 0 0 auto !important;
        width: 128px !important;
        max-width: 128px !important;
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: .28rem !important;
        align-items: stretch !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .charting-navbar .nav-session-controls .btn {
        min-width: 0 !important;
        width: 100% !important;
        margin: 0 !important;
        padding: .28rem .32rem !important;
        font-size: .66rem !important;
        line-height: 1.1 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .charting-navbar .top-primary-tabs {
        order: 10 !important;
        flex: 0 0 100% !important;
        width: 100% !important;
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: .3rem !important;
        margin: .1rem 0 0 !important;
        padding: 0 !important;
        overflow: visible !important;
    }

    .charting-navbar .top-primary-tab {
        min-width: 0 !important;
        width: 100% !important;
        padding: .42rem .35rem !important;
        text-align: center !important;
        font-size: .84rem !important;
        line-height: 1.05 !important;
        border-radius: .5rem !important;
    }

    .chart-user-strip {
        width: 100% !important;
        padding: .34rem .6rem !important;
        font-size: .74rem !important;
        line-height: 1.15 !important;
        max-height: 46px !important;
        overflow: hidden !important;
    }

    .chart-user-strip .small,
    .chart-user-strip .badge,
    .chart-user-strip .btn-link {
        font-size: .74rem !important;
        line-height: 1.15 !important;
    }

    /* Open patient chart tabs: under the header, compact, horizontally scrollable, not a footer. */
    #chartWorkspaceTabs.master-workspace-tabs.open-chart-tab-row,
    #chartWorkspaceTabs.open-chart-tab-row.has-open-chart {
        position: static !important;
        display: flex !important;
        align-items: center !important;
        gap: .3rem !important;
        width: 100% !important;
        min-height: 42px !important;
        padding: .25rem .55rem !important;
        margin: 0 !important;
        background: transparent !important;
        border: 0 !important;
        box-shadow: none !important;
        overflow: hidden !important;
    }

    #chartWorkspaceTabs.open-chart-tab-row.no-open-charts {
        display: none !important;
    }

    #workspaceChartSlot.workspace-chart-slot,
    #chartWorkspaceTabs .workspace-chart-slot {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        width: auto !important;
        display: flex !important;
        flex-wrap: nowrap !important;
        gap: .38rem !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
    }

    #workspaceChartSlot.workspace-chart-slot::-webkit-scrollbar {
        display: none !important;
    }

    #chartWorkspaceTabs .workspace-scroll-arrow {
        display: inline-flex !important;
        flex: 0 0 34px !important;
        width: 34px !important;
        height: 34px !important;
        min-width: 34px !important;
        min-height: 34px !important;
        border-radius: 999px !important;
        font-size: 1.45rem !important;
        line-height: 1 !important;
    }

    #chartWorkspaceTabs .workspace-chart-tab {
        flex: 0 0 auto !important;
        min-width: 128px !important;
        max-width: 168px !important;
        min-height: 36px !important;
        padding: .36rem .48rem !important;
        font-size: .82rem !important;
        line-height: 1.1 !important;
        border-radius: .55rem !important;
        justify-content: space-between !important;
        overflow: hidden !important;
    }

    #chartWorkspaceTabs .workspace-chart-tab span {
        min-width: 0 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    #chartWorkspaceTabs .workspace-chart-close,
    #chartWorkspaceTabs .workspace-tab-close {
        flex: 0 0 22px !important;
        width: 22px !important;
        height: 22px !important;
        min-width: 22px !important;
        min-height: 22px !important;
        margin-left: .35rem !important;
        font-size: 1rem !important;
        line-height: 1 !important;
    }

    /* Main chart body: no horizontal page overflow. Tables/flowsheets scroll inside their own panels. */
    .main-content.charting-screen,
    .main-content,
    .charting-screen {
        width: 100% !important;
        max-width: 100% !important;
        margin-top: .5rem !important;
        padding-left: .45rem !important;
        padding-right: .45rem !important;
        overflow-x: hidden !important;
    }

    .charting-screen > .row,
    .charting-screen .row {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .charting-screen [class^="col-"],
    .charting-screen [class*=" col-"] {
        padding-left: .25rem !important;
        padding-right: .25rem !important;
        max-width: 100% !important;
    }

    .patient-info-box.sticky-sidebar,
    .sticky-sidebar {
        position: static !important;
    }

    .patient-info-box {
        padding: .75rem !important;
    }

    .patient-sidebar-identity {
        grid-template-columns: 1fr !important;
        gap: .35rem !important;
    }

    .sticky-note-list-patient {
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    .sticky-note-list-patient .sticky-note-card {
        flex: 0 0 112px !important;
    }

    /* Chart section tabs: true mobile footer with side arrows. */
    .nav-tabs.chart-tabs {
        position: fixed !important;
        left: 42px !important;
        right: 42px !important;
        bottom: 0 !important;
        z-index: 2060 !important;
        height: 66px !important;
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        gap: .25rem !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        white-space: nowrap !important;
        -webkit-overflow-scrolling: touch !important;
        background: rgba(248, 252, 255, .99) !important;
        border: 1px solid #88bed8 !important;
        border-bottom: 0 !important;
        border-radius: .6rem .6rem 0 0 !important;
        padding: .36rem .28rem calc(.36rem + env(safe-area-inset-bottom)) !important;
        box-shadow: 0 -5px 16px rgba(0,0,0,.18) !important;
        scrollbar-width: none !important;
    }

    .nav-tabs.chart-tabs::-webkit-scrollbar {
        display: none !important;
    }

    .nav-tabs.chart-tabs .nav-item {
        flex: 0 0 auto !important;
        min-width: 104px !important;
        margin: 0 !important;
    }

    .nav-tabs.chart-tabs .nav-link {
        height: 48px !important;
        min-height: 48px !important;
        width: 100% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: .36rem .54rem !important;
        font-size: .78rem !important;
        line-height: 1.05 !important;
        text-align: center !important;
        border-radius: .5rem !important;
        white-space: nowrap !important;
    }

    .mobile-chart-tab-arrow {
        position: fixed !important;
        bottom: 0 !important;
        z-index: 2070 !important;
        width: 42px !important;
        height: 66px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        border: 1px solid #88bed8 !important;
        border-bottom: 0 !important;
        background: #e7f5fd !important;
        color: #064d7a !important;
        font-size: 1.8rem !important;
        font-weight: 900 !important;
        line-height: 1 !important;
        box-shadow: 0 -5px 16px rgba(0,0,0,.14) !important;
        padding-bottom: env(safe-area-inset-bottom) !important;
    }

    .mobile-chart-tab-arrow-left {
        left: 0 !important;
        border-radius: .6rem 0 0 0 !important;
    }

    .mobile-chart-tab-arrow-right {
        right: 0 !important;
        border-radius: 0 .6rem 0 0 !important;
    }

    .tab-content {
        margin-top: .5rem !important;
        padding: .55rem !important;
        max-width: 100% !important;
        overflow: visible !important;
    }

    .tab-pane,
    .card,
    .card-body,
    .summary-board,
    .epic-flowsheet-shell,
    .flowsheet-main-full,
    .diagnostic-service-section,
    .notes-actionbar,
    .orders-actionbar,
    .result-actionbar {
        max-width: 100% !important;
    }

    .summary-board-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: .35rem !important;
        padding: .6rem .7rem !important;
    }

    .summary-tile-grid {
        grid-template-columns: 1fr !important;
        padding: .55rem !important;
    }

    .flowsheet-workspace,
    .flowsheet-workspace-combined,
    .flowsheet-workspace-integrated {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .flowsheet-detail-panel {
        margin-top: .55rem !important;
        min-height: auto !important;
    }

    .flowsheet-scroll,
    .flowsheet-grid-scroll,
    .mar-scroll,
    .lab-results-scroll,
    .vent-scroll,
    .vent-column-scroll,
    .vent-entry-scroll,
    .spreadsheet-scroll,
    .table-responsive,
    .note-review-table-wrap,
    .diagnostic-table-wrap,
    .orders-table-wrap {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: auto !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    .flowsheet-scroll,
    .flowsheet-grid-scroll,
    .vent-column-scroll,
    .vent-entry-scroll {
        max-height: 58vh !important;
    }

    .flowsheet-table,
    .flowsheet-grid-table,
    .flowsheet-combined-table,
    .flowsheet-integrated-table,
    .resp-intervention-flow-table,
    .vent-flow-table,
    .vent-column-table,
    .vent-column-entry-table,
    .lab-results-table,
    .mar-timeline-table,
    .spreadsheet-table,
    .diagnostic-table,
    .orders-table,
    .notes-review-table {
        min-width: 880px !important;
        width: max-content !important;
    }

    .mar-timeline-table {
        min-width: 1800px !important;
    }

    .flowsheet-row-label,
    .flowsheet-integrated-table .flowsheet-row-label,
    .flowsheet-combined-table .flowsheet-row-label,
    .resp-intervention-flow-table .flowsheet-row-label,
    .vent-flow-table .flowsheet-row-label,
    .vent-label-col {
        width: 206px !important;
        min-width: 206px !important;
        max-width: 206px !important;
        left: 0 !important;
        background: #ffffff !important;
    }

    .flowsheet-time-col,
    .flowsheet-value-cell,
    .flowsheet-entry-cell,
    .vent-doc-cell {
        min-width: 128px !important;
        width: 128px !important;
    }

    .mar-timeline-table .mar-med-col,
    .mar-timeline-table thead .mar-med-col {
        width: 260px !important;
        min-width: 260px !important;
        max-width: 260px !important;
    }

    .mar-timeline-table th:not(.mar-med-col),
    .mar-timeline-table td.mar-cell {
        width: 138px !important;
        min-width: 138px !important;
        max-width: 138px !important;
    }

    .mar-event {
        min-width: 0 !important;
        font-size: .68rem !important;
    }

    .diagnostic-table th,
    .diagnostic-table td,
    .orders-table th,
    .orders-table td,
    .notes-review-table th,
    .notes-review-table td {
        white-space: nowrap !important;
    }

    .note-review-layout,
    .epic-notes-layout,
    .notes-review-shell {
        display: block !important;
        max-width: 100% !important;
    }

    .note-detail-pane,
    .notes-preview-panel {
        min-height: 210px !important;
        margin-top: .6rem !important;
        overflow: visible !important;
    }

    .modal-dialog {
        width: auto !important;
        max-width: calc(100vw - 1rem) !important;
        margin: .5rem !important;
    }

    .modal-content {
        max-height: calc(100vh - 1rem) !important;
        overflow-y: auto !important;
    }

    body:not(.login-page) .footer.fixed-bottom,
    body:not(.login-page) footer.footer.fixed-bottom,
    body:not(.login-page) .footer-wrapper {
        display: none !important;
    }
}

@media (max-width: 420px) {
    .charting-navbar .navbar-brand {
        flex-basis: calc(100% - 112px) !important;
        max-width: calc(100% - 112px) !important;
    }

    .charting-navbar .navbar-brand-logo,
    .charting-navbar .nav-colossal-logo {
        width: 60px !important;
        max-width: 60px !important;
    }

    .charting-navbar .navbar-brand span {
        font-size: .86rem !important;
    }

    .charting-navbar .nav-session-controls {
        width: 106px !important;
        max-width: 106px !important;
    }

    .charting-navbar .nav-session-controls .btn {
        font-size: .61rem !important;
        padding-left: .2rem !important;
        padding-right: .2rem !important;
    }

    .charting-navbar .top-primary-tab {
        font-size: .78rem !important;
        padding-left: .2rem !important;
        padding-right: .2rem !important;
    }

    .nav-tabs.chart-tabs .nav-item {
        min-width: 96px !important;
    }

    .nav-tabs.chart-tabs .nav-link {
        font-size: .72rem !important;
    }
}


/* v20 mobile overlay fix: chart section tabs are no longer fixed overlays. */
@media (max-width: 767.98px) {
    body:not(.login-page) {
        padding-bottom: calc(1rem + env(safe-area-inset-bottom)) !important;
        overflow-x: hidden !important;
    }

    /* Open patient chart tabs remain directly below the header and do not cover chart content. */
    #chartWorkspaceTabs.master-workspace-tabs.open-chart-tab-row,
    #chartWorkspaceTabs.open-chart-tab-row.has-open-chart,
    #chartWorkspaceTabs.open-chart-tab-row:not(.no-open-charts) {
        position: static !important;
        left: auto !important;
        right: auto !important;
        top: auto !important;
        bottom: auto !important;
        z-index: auto !important;
        display: flex !important;
        grid-template-columns: none !important;
        align-items: center !important;
        gap: .35rem !important;
        min-height: 42px !important;
        padding: .25rem .55rem !important;
        margin: 0 !important;
        background: transparent !important;
        border: 0 !important;
        box-shadow: none !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow: hidden !important;
    }

    #chartWorkspaceTabs.open-chart-tab-row.no-open-charts,
    #chartWorkspaceTabs.master-workspace-tabs.open-chart-tab-row.no-open-charts {
        display: none !important;
    }

    #chartWorkspaceTabs .workspace-scroll-arrow {
        display: inline-flex !important;
        flex: 0 0 32px !important;
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        min-height: 32px !important;
        position: static !important;
        z-index: auto !important;
    }

    #workspaceChartSlot.workspace-chart-slot,
    #chartWorkspaceTabs .workspace-chart-slot {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        width: auto !important;
        display: flex !important;
        flex-wrap: nowrap !important;
        gap: .38rem !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
    }

    #workspaceChartSlot.workspace-chart-slot::-webkit-scrollbar {
        display: none !important;
    }

    #chartWorkspaceTabs .workspace-chart-tab {
        flex: 0 0 auto !important;
        min-width: 128px !important;
        max-width: 168px !important;
        min-height: 36px !important;
        padding: .36rem .48rem !important;
        font-size: .82rem !important;
        line-height: 1.1 !important;
        border-radius: .55rem !important;
        justify-content: space-between !important;
        overflow: hidden !important;
    }

    /* Chart section tabs stay in normal page flow on phones so they cannot hide the active chart. */
    #chartTabs.nav-tabs.chart-tabs,
    .nav-tabs.chart-tabs {
        position: relative !important;
        left: auto !important;
        right: auto !important;
        top: auto !important;
        bottom: auto !important;
        z-index: 3 !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: stretch !important;
        gap: .28rem !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: .45rem 0 .65rem 0 !important;
        padding: .36rem !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        white-space: nowrap !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: thin !important;
        background: #e8f6fd !important;
        border: 1px solid #88bed8 !important;
        border-radius: .55rem !important;
        box-shadow: none !important;
    }

    #chartTabs.nav-tabs.chart-tabs .nav-item,
    .nav-tabs.chart-tabs .nav-item {
        flex: 0 0 auto !important;
        min-width: 104px !important;
        margin: 0 !important;
    }

    #chartTabs.nav-tabs.chart-tabs .nav-link,
    .nav-tabs.chart-tabs .nav-link {
        position: static !important;
        height: auto !important;
        min-height: 40px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 100% !important;
        padding: .42rem .58rem !important;
        font-size: .78rem !important;
        line-height: 1.1 !important;
        text-align: center !important;
        border-radius: .46rem !important;
        white-space: nowrap !important;
    }

    /* The old section-tab footer arrows were viewport overlays; hide them. Users can swipe/scroll the tab row. */
    .mobile-chart-tab-arrow,
    .mobile-chart-tab-arrow-left,
    .mobile-chart-tab-arrow-right {
        display: none !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }

    .tab-content {
        margin-top: .4rem !important;
        padding-bottom: .75rem !important;
    }

    .main-content.charting-screen,
    .main-content,
    .charting-screen {
        padding-bottom: .75rem !important;
    }

    body:not(.login-page) .footer.fixed-bottom,
    body:not(.login-page) footer.footer.fixed-bottom,
    body:not(.login-page) .footer-wrapper {
        display: none !important;
    }
}

/* v21 mobile restore: keep the previous mobile chart-tab footer, but limit mobile workspace to one open chart. */
@media (max-width: 767.98px) {
    html,
    body {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }

    body:not(.login-page) {
        padding-bottom: calc(94px + env(safe-area-inset-bottom)) !important;
        overflow-x: hidden !important;
    }

    .charting-navbar {
        position: sticky !important;
        top: 0 !important;
        z-index: 1045 !important;
    }

    .charting-navbar .top-primary-tabs {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        width: 100% !important;
        gap: .3rem !important;
        margin-top: .2rem !important;
    }

    .charting-navbar .top-primary-tab {
        display: block !important;
        min-width: 0 !important;
        text-align: center !important;
        font-size: .82rem !important;
        line-height: 1.1 !important;
        padding: .42rem .3rem !important;
        border-radius: .5rem !important;
    }

    #chartWorkspaceTabs.master-workspace-tabs.open-chart-tab-row,
    #chartWorkspaceTabs.open-chart-tab-row.has-open-chart,
    #chartWorkspaceTabs.open-chart-tab-row:not(.no-open-charts) {
        position: static !important;
        display: flex !important;
        width: 100% !important;
        max-width: 100% !important;
        min-height: 42px !important;
        padding: .25rem .55rem !important;
        margin: 0 !important;
        background: transparent !important;
        border: 0 !important;
        box-shadow: none !important;
        overflow: hidden !important;
    }

    #chartWorkspaceTabs.open-chart-tab-row.no-open-charts,
    #chartWorkspaceTabs.master-workspace-tabs.open-chart-tab-row.no-open-charts {
        display: none !important;
    }

    #chartWorkspaceTabs.mobile-single-chart-workspace .workspace-scroll-arrow,
    #chartWorkspaceTabs .workspace-scroll-arrow {
        display: none !important;
    }

    #workspaceChartSlot.workspace-chart-slot,
    #chartWorkspaceTabs .workspace-chart-slot {
        flex: 1 1 auto !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: hidden !important;
        overflow-y: hidden !important;
    }

    #chartWorkspaceTabs .workspace-chart-tab {
        flex: 0 1 auto !important;
        min-width: 150px !important;
        max-width: calc(100vw - 1.2rem) !important;
        min-height: 38px !important;
        padding: .4rem .58rem !important;
        font-size: .86rem !important;
        line-height: 1.1 !important;
        border-radius: .55rem !important;
        justify-content: space-between !important;
    }

    /* Return the chart section tabs to the prior mobile footer view. */
    #chartTabs.nav-tabs.chart-tabs,
    .nav-tabs.chart-tabs {
        position: fixed !important;
        left: 42px !important;
        right: 42px !important;
        bottom: 0 !important;
        z-index: 2060 !important;
        height: 66px !important;
        min-height: 66px !important;
        max-height: 66px !important;
        width: auto !important;
        max-width: none !important;
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        gap: .25rem !important;
        margin: 0 !important;
        padding: .36rem .28rem calc(.36rem + env(safe-area-inset-bottom)) !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        white-space: nowrap !important;
        -webkit-overflow-scrolling: touch !important;
        background: rgba(248, 252, 255, .99) !important;
        border: 1px solid #88bed8 !important;
        border-bottom: 0 !important;
        border-radius: .6rem .6rem 0 0 !important;
        box-shadow: 0 -5px 16px rgba(0,0,0,.16) !important;
        scrollbar-width: none !important;
    }

    #chartTabs.nav-tabs.chart-tabs::-webkit-scrollbar,
    .nav-tabs.chart-tabs::-webkit-scrollbar {
        display: none !important;
    }

    #chartTabs.nav-tabs.chart-tabs .nav-item,
    .nav-tabs.chart-tabs .nav-item {
        flex: 0 0 auto !important;
        min-width: 104px !important;
        margin: 0 !important;
    }

    #chartTabs.nav-tabs.chart-tabs .nav-link,
    .nav-tabs.chart-tabs .nav-link {
        position: static !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        height: 48px !important;
        min-height: 48px !important;
        width: 100% !important;
        padding: .38rem .55rem !important;
        text-align: center !important;
        font-size: .76rem !important;
        line-height: 1.1 !important;
        border-radius: .5rem !important;
        white-space: nowrap !important;
    }

    .mobile-chart-tab-arrow {
        position: fixed !important;
        bottom: 0 !important;
        z-index: 2070 !important;
        width: 42px !important;
        height: 66px !important;
        display: flex !important;
        visibility: visible !important;
        pointer-events: auto !important;
        align-items: center !important;
        justify-content: center !important;
        border: 1px solid #88bed8 !important;
        border-bottom: 0 !important;
        background: #e7f5fd !important;
        color: #064d7a !important;
        font-size: 1.8rem !important;
        font-weight: 900 !important;
        line-height: 1 !important;
        box-shadow: 0 -5px 16px rgba(0,0,0,.14) !important;
        padding-bottom: env(safe-area-inset-bottom) !important;
    }

    .mobile-chart-tab-arrow-left {
        left: 0 !important;
        border-radius: .6rem 0 0 0 !important;
    }

    .mobile-chart-tab-arrow-right {
        right: 0 !important;
        border-radius: 0 .6rem 0 0 !important;
    }

    .tab-content {
        margin-top: .5rem !important;
        padding-bottom: calc(94px + env(safe-area-inset-bottom)) !important;
    }

    .main-content.charting-screen,
    .main-content,
    .charting-screen {
        padding-bottom: calc(94px + env(safe-area-inset-bottom)) !important;
    }

    .tab-pane {
        scroll-margin-bottom: calc(94px + env(safe-area-inset-bottom)) !important;
    }
}

@media (max-width: 420px) {
    #chartTabs.nav-tabs.chart-tabs .nav-item,
    .nav-tabs.chart-tabs .nav-item {
        min-width: 96px !important;
    }

    #chartTabs.nav-tabs.chart-tabs .nav-link,
    .nav-tabs.chart-tabs .nav-link {
        font-size: .72rem !important;
        padding-left: .42rem !important;
        padding-right: .42rem !important;
    }
}
