#tab-table.table-card { padding:1.5rem; overflow:visible; }
#tab-table .data-table th, #tab-table .data-table td { position:static; left:auto; right:auto; width:auto; min-width:0; max-width:none; overflow:visible; white-space:nowrap; }
#tab-nursing { background:var(--bg-secondary); border:1px solid var(--border-color); border-radius:.75rem; padding:1.25rem; box-shadow:var(--shadow-md); }
/* Scoped reference appearance: dashboard graphs, detailed table and nursing only. */
:is(#tab-table,#tab-nursing,#tab-dashboard .chart-card,#tab-dashboard .chart-visibility-bar) { --font-sans: 'Plus Jakarta Sans','Prompt',sans-serif; font-family: var(--font-sans); font-weight:400; }
:is(#tab-table,#tab-nursing,#tab-dashboard .chart-card,#tab-dashboard .chart-visibility-bar) :is(h1,h2,h3,h4,h5,h6,button,input,select,textarea,.chart-title) { font-family: 'Plus Jakarta Sans','Prompt',sans-serif; }
#tab-table .data-table { table-layout:auto; }
#tab-table .data-table :is(th,td) { text-overflow:clip; }
#tab-dashboard .chart-placeholder { position: absolute; inset: 0px; display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 0.875rem; font-family: var(--font-sans); border: 1px dashed var(--border-color); border-radius: 0.5rem; background-color: rgba(0, 0, 0, 0.05); }
#tab-dashboard .charts-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; min-width: 0px; }
#tab-dashboard .chart-card { background-color: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: 0.75rem; padding: 1.5rem; box-shadow: var(--shadow-md); min-width: 0px; }
#tab-dashboard .chart-card .chart-title,
#tab-table .chart-title { font-size: 1.125rem; font-weight: 600; margin-bottom: 1.25rem; color: var(--text-primary); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.5rem; }
#tab-dashboard .chart-container { position: relative; height: 300px; width: 100%; min-width: 0px; }
#tab-dashboard .chart-container canvas,
#tab-dashboard .chart-card canvas { touch-action: pan-y !important; }
#tab-dashboard .chart-visibility-bar { margin-bottom: 1.25rem; display: flex; justify-content: space-between; align-items: center; background-color: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: 0.5rem; padding: 0.65rem 0.85rem; position: relative; flex-wrap: wrap; gap: 0.6rem; z-index: 30; }
#tab-dashboard #dynamic-drug-charts-container { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 1.5rem; min-width: 0px; }
#tab-table .table-card { background-color: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: 0.75rem; padding: 1.5rem; box-shadow: var(--shadow-md); width: 100%; min-width: 0px; overflow: hidden; }
#tab-table .table-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; gap: 0.5rem; }
#tab-table .table-scroll-hint { display: flex; align-items: center; gap: 0.5rem; background: rgba(59, 130, 246, 0.08); border: 1px solid rgba(59, 130, 246, 0.2); padding: 0.5rem 0.75rem; border-radius: 0.5rem; font-size: 0.78rem; color: var(--color-primary); margin-bottom: 0.75rem; user-select: none; }
#tab-table .table-wrapper { overflow: auto; max-height: 65vh; border-radius: 0.5rem; border: 1px solid var(--border-color); overscroll-behavior: contain; position: relative; width: 100%; min-width: 0px; touch-action: pan-x pan-y; }
#tab-table .table-wrapper::-webkit-scrollbar { height: 8px; width: 8px; }
#tab-table .table-wrapper::-webkit-scrollbar-track { background: var(--bg-tertiary); border-radius: 4px; }
#tab-table .table-wrapper::-webkit-scrollbar-thumb { background: var(--color-primary); border-radius: 4px; }
#tab-table .table-wrapper::-webkit-scrollbar-thumb:hover { background: rgb(29, 78, 216); }
#tab-table table.data-table th.col-highlight-co,
#tab-table table.data-table th.col-highlight-ci { background-color: rgb(23, 56, 45) !important; color: rgb(74, 222, 128) !important; }
#tab-table table.data-table th.col-highlight-svr { background-color: rgb(19, 57, 69) !important; color: rgb(56, 189, 248) !important; }
#tab-table table.data-table th.col-highlight-pvr,
#tab-table table.data-table th.col-highlight-rvswi,
#tab-table table.data-table th.col-highlight-ratio,
#tab-table table.data-table th.col-highlight-papi { background-color: rgb(59, 40, 28) !important; color: rgb(251, 146, 60) !important; }
#tab-table table.data-table th.col-highlight-ionet,
#tab-table table.data-table th.col-highlight-bsa { background-color: rgb(56, 48, 24) !important; color: rgb(252, 211, 77) !important; }
body.light-theme #tab-table table.data-table th.col-highlight-co,
body.light-theme #tab-table table.data-table th.col-highlight-ci { background-color: rgb(220, 252, 231) !important; color: rgb(21, 128, 61) !important; }
body.light-theme #tab-table table.data-table th.col-highlight-svr { background-color: rgb(224, 242, 254) !important; color: rgb(3, 105, 161) !important; }
body.light-theme #tab-table table.data-table th.col-highlight-pvr,
body.light-theme #tab-table table.data-table th.col-highlight-rvswi,
body.light-theme #tab-table table.data-table th.col-highlight-ratio,
body.light-theme #tab-table table.data-table th.col-highlight-papi { background-color: rgb(255, 237, 213) !important; color: rgb(194, 65, 12) !important; }
body.light-theme #tab-table table.data-table th.col-highlight-ionet,
body.light-theme #tab-table table.data-table th.col-highlight-bsa { background-color: rgb(254, 243, 199) !important; color: rgb(180, 83, 9) !important; }
#tab-table table.data-table td.col-highlight-co,
#tab-table table.data-table td.col-highlight-ci { background-color: rgba(34, 197, 94, 0.12) !important; color: rgb(74, 222, 128) !important; }
#tab-table table.data-table td.col-highlight-svr { background-color: rgba(6, 182, 212, 0.12) !important; color: rgb(56, 189, 248) !important; }
#tab-table table.data-table td.col-highlight-pvr,
#tab-table table.data-table td.col-highlight-rvswi,
#tab-table table.data-table td.col-highlight-ratio,
#tab-table table.data-table td.col-highlight-papi { background-color: rgba(249, 115, 22, 0.12) !important; color: rgb(251, 146, 60) !important; }
#tab-table table.data-table td.col-highlight-ionet,
#tab-table table.data-table td.col-highlight-bsa { background-color: rgba(245, 158, 11, 0.12) !important; color: rgb(252, 211, 77) !important; }
body.light-theme #tab-table table.data-table td.col-highlight-co,
body.light-theme #tab-table table.data-table td.col-highlight-ci { background-color: rgb(240, 253, 244) !important; color: rgb(21, 128, 61) !important; }
body.light-theme #tab-table table.data-table td.col-highlight-svr { background-color: rgb(240, 249, 255) !important; color: rgb(3, 105, 161) !important; }
body.light-theme #tab-table table.data-table td.col-highlight-pvr,
body.light-theme #tab-table table.data-table td.col-highlight-rvswi,
body.light-theme #tab-table table.data-table td.col-highlight-ratio,
body.light-theme #tab-table table.data-table td.col-highlight-papi { background-color: rgb(255, 247, 237) !important; color: rgb(194, 65, 12) !important; }
body.light-theme #tab-table table.data-table td.col-highlight-ionet,
body.light-theme #tab-table table.data-table td.col-highlight-bsa { background-color: rgb(254, 252, 232) !important; color: rgb(180, 83, 9) !important; }
#tab-table .col-pill { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 4px; flex-shrink: 0; }
#tab-table .col-pill-co { background-color: rgb(74, 222, 128); }
#tab-table .col-pill-ci { background-color: rgb(74, 222, 128); }
#tab-table .col-pill-svr { background-color: rgb(56, 189, 248); }
#tab-table .col-pill-pvr,
#tab-table .col-pill-rvswi,
#tab-table .col-pill-ratio,
#tab-table .col-pill-papi { background-color: rgb(251, 146, 60); }
#tab-table .col-pill-ionet,
#tab-table .col-pill-bsa { background-color: rgb(252, 211, 77); }
#tab-table #table-col-dropdown-menu { display: none; position: absolute; right: 0px; top: calc(100% + 0.4rem); z-index: 1050; width: 360px; max-width: calc(-2rem + 100vw); border-radius: 0.5rem; padding: 0.65rem 0.75rem; box-sizing: border-box; background: var(--bg-secondary) !important; border: 1px solid var(--border-color) !important; box-shadow: rgba(0, 0, 0, 0.45) 0px 12px 30px, rgba(0, 0, 0, 0.3) 0px 4px 10px !important; opacity: 1 !important; }
body.light-theme #tab-table #table-col-dropdown-menu { background: rgb(255, 255, 255) !important; border-color: var(--border-color) !important; box-shadow: rgba(0, 0, 0, 0.12) 0px 12px 30px, rgba(0, 0, 0, 0.08) 0px 4px 10px !important; }
#tab-table .table-col-menu-header { display: flex; justify-content: space-between; align-items: center; padding-bottom: 0.45rem; margin-bottom: 0.5rem; border-bottom: 1px solid var(--border-color); }
#tab-table .table-col-menu-title { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
#tab-table .table-col-menu-actions { display: flex; gap: 0.35rem; }
#tab-table .btn-table-col-action { background-color: var(--bg-tertiary); color: var(--text-primary); border: 1px solid var(--border-color); border-radius: 0.25rem; font-size: 0.7rem; font-weight: 500; padding: 0.2rem 0.55rem; cursor: pointer; transition: all var(--transition-fast); }
#tab-table .btn-table-col-action:hover { background-color: var(--color-primary); color: rgb(255, 255, 255); border-color: var(--color-primary); }
#tab-table .table-col-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.25rem 0.5rem; max-height: 350px; overflow-y: auto; overscroll-behavior: contain; padding-right: 4px; }
#tab-table .table-col-grid::-webkit-scrollbar { width: 5px; }
#tab-table .table-col-grid::-webkit-scrollbar-track { background: var(--bg-tertiary); border-radius: 3px; }
#tab-table .table-col-grid::-webkit-scrollbar-thumb { background: var(--color-primary); border-radius: 3px; }
#tab-table .table-col-item { display: flex; align-items: center; gap: 0.4rem; padding: 0.3rem 0.45rem; border-radius: 0.35rem; cursor: pointer; font-size: 0.75rem; color: var(--text-primary); user-select: none; transition: background-color var(--transition-fast); background-color: transparent; box-sizing: border-box; }
#tab-table .table-col-item:hover { background-color: var(--bg-tertiary); }
#tab-table .table-col-item input[type="checkbox"] { cursor: pointer; accent-color: var(--color-primary); width: 14px; height: 14px; flex-shrink: 0; }
#tab-table .table-col-item span.col-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0px; flex: 1 1 0%; }
#tab-table #btn-table-fit-toggle.active { background-color: rgba(59, 130, 246, 0.18) !important; border-color: var(--color-primary) !important; color: var(--color-primary) !important; font-weight: 600 !important; }
#tab-table #btn-table-fit-toggle.active:hover { background-color: rgba(59, 130, 246, 0.28) !important; }
body.light-theme #tab-table #btn-table-fit-toggle.active { background-color: rgb(219, 234, 254) !important; border-color: rgb(37, 99, 235) !important; color: rgb(29, 78, 216) !important; }
#tab-table #main-table-wrapper.table-fit-page { overflow-x: hidden !important; }
#tab-table #main-table-wrapper.table-fit-page ~ #table-scroll-hint,
#tab-table .table-fit-active #table-scroll-hint { display: none !important; }
#tab-table #main-table-wrapper.table-fit-page table.data-table { min-width: 0px !important; width: 100% !important; table-layout: auto !important; }
#tab-table #main-table-wrapper.table-fit-page table.data-table th,
#tab-table #main-table-wrapper.table-fit-page table.data-table td { font-variant-numeric: tabular-nums; letter-spacing: -0.2px; padding: 0.32rem 0.16rem !important; font-size: 0.71rem !important; white-space: nowrap !important; }
#tab-table #main-table-wrapper.table-fit-page table.data-table th { font-size: 0.68rem !important; font-weight: 600 !important; white-space: normal !important; line-height: 1.15 !important; text-align: center !important; vertical-align: middle !important; word-break: normal !important; overflow-wrap: break-word !important; padding: 0.35rem 0.16rem !important; position: sticky !important; top: 0px !important; }
#tab-table #main-table-wrapper.table-fit-page table.data-table th .th-unit { display: block !important; font-size: 0.58rem !important; font-weight: 400 !important; opacity: 0.85 !important; margin-top: 1px !important; white-space: nowrap !important; }
#tab-table #main-table-wrapper.table-fit-page table.data-table td { text-align: center !important; }
#tab-table #main-table-wrapper.table-fit-page table.data-table th:nth-child(1),
#tab-table #main-table-wrapper.table-fit-page table.data-table th:nth-child(2) { position: sticky !important; top: 0px !important; left: auto !important; z-index: 45 !important; box-shadow: none !important; background-color: rgb(36, 51, 74) !important; }
body.light-theme #tab-table #main-table-wrapper.table-fit-page table.data-table th:nth-child(1),
body.light-theme #tab-table #main-table-wrapper.table-fit-page table.data-table th:nth-child(2) { background-color: rgb(226, 232, 240) !important; }
#tab-table #main-table-wrapper.table-fit-page table.data-table td:nth-child(1),
#tab-table #main-table-wrapper.table-fit-page table.data-table td:nth-child(2) { position: static !important; left: auto !important; box-shadow: none !important; }
#tab-table .col-event-cell { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; cursor: help; }
#tab-table #main-table-wrapper.table-fit-page .col-event-cell { color: var(--text-secondary); max-width: 72px !important; width: 72px !important; font-size: 0.68rem !important; }
#tab-table #main-table-wrapper.table-fit-page th[data-col="event"] { max-width: 72px !important; width: 72px !important; }
#tab-table table.data-table { width: 100%; min-width: 0px; border-collapse: separate; border-spacing: 0px; font-size: 0.8125rem; text-align: left; }
#tab-table table.data-table thead { position: sticky; top: 0px; z-index: 40; background-color: rgb(30, 41, 59); }
#tab-table table.data-table thead tr { background-color: rgb(30, 41, 59); }
body.light-theme #tab-table table.data-table thead,
body.light-theme #tab-table table.data-table thead tr { background-color: rgb(255, 255, 255); }
#tab-table table.data-table th,
#tab-table table.data-table td { padding: 0.6rem 0.5rem; border-bottom: 1px solid var(--border-color); border-right: 1px solid rgba(255, 255, 255, 0.06); }
#tab-table table.data-table td { white-space: nowrap; text-align: center; vertical-align: middle; }
#tab-table table.data-table th { color: var(--text-primary); font-family: var(--font-sans); font-weight: 600; font-size: 0.76rem; line-height: 1.25; text-align: center; vertical-align: middle; white-space: normal; word-break: normal; overflow-wrap: break-word; padding: 0.55rem 0.35rem; box-shadow: rgba(0, 0, 0, 0.25) 0px 2px 4px; letter-spacing: -0.1px; background-color: rgb(36, 51, 74) !important; position: sticky !important; top: 0px !important; z-index: 40 !important; border-bottom: 2px solid var(--border-color) !important; }
body.light-theme #tab-table table.data-table th { color: rgb(15, 23, 42); box-shadow: rgba(0, 0, 0, 0.08) 0px 2px 4px; background-color: rgb(226, 232, 240) !important; }
#tab-table table.data-table th .th-unit { display: block; font-size: 0.67rem; font-weight: 400; opacity: 0.85; margin-top: 2px; white-space: nowrap; }
#tab-table #main-table-wrapper:not(.table-fit-page) table.data-table th:nth-child(1),
#tab-table #main-table-wrapper:not(.table-fit-page) table.data-table td:nth-child(1) { position: sticky; left: 0px; z-index: 20; background-color: rgb(30, 41, 59); box-shadow: 1px 0 0 var(--border-color); }
#tab-table #main-table-wrapper:not(.table-fit-page) table.data-table th:nth-child(2),
#tab-table #main-table-wrapper:not(.table-fit-page) table.data-table td:nth-child(2) { position: sticky; left: 80px; z-index: 20; background-color: rgb(30, 41, 59); box-shadow: rgba(0, 0, 0, 0.15) 2px 0px 4px; }
#tab-table #main-table-wrapper:not(.table-fit-page) table.data-table th:nth-child(1) { top: 0px !important; left: 0px !important; z-index: 50 !important; background-color: rgb(36, 51, 74) !important; }
#tab-table #main-table-wrapper:not(.table-fit-page) table.data-table th:nth-child(2) { top: 0px !important; left: 80px !important; z-index: 50 !important; background-color: rgb(36, 51, 74) !important; }
body.light-theme #tab-table #main-table-wrapper:not(.table-fit-page) table.data-table td:nth-child(1),
body.light-theme #tab-table #main-table-wrapper:not(.table-fit-page) table.data-table td:nth-child(2) { background-color: rgb(255, 255, 255); }
body.light-theme #tab-table #main-table-wrapper table.data-table th:nth-child(1),
body.light-theme #tab-table #main-table-wrapper table.data-table th:nth-child(2) { background-color: rgb(226, 232, 240) !important; }
#tab-table table.data-table tbody tr { transition: background-color var(--transition-fast); }
#tab-table table.data-table tbody tr:hover td { background-color: rgba(255, 255, 255, 0.03); }
#tab-table table.data-table tbody tr:hover td:nth-child(1),
#tab-table table.data-table tbody tr:hover td:nth-child(2) { background-color: var(--bg-tertiary); }
#tab-table table.data-table tbody tr:last-child td { border-bottom-width: medium; border-bottom-style: none; border-bottom-color: currentcolor; }
#tab-table .table-actions { display: flex; gap: 0.5rem; }
#tab-dashboard .charts-container { width: 100%; max-width: 100%; min-width: 0px; overflow-x: hidden; box-sizing: border-box; }
@media (min-width: 1025px) {
#tab-dashboard .charts-grid { grid-template-columns: repeat(2, minmax(0px, 1fr)); gap: 1.25rem; }
}
@media (max-width: 1024px) {
#tab-dashboard .charts-grid { grid-template-columns: 1fr; gap: 1rem; width: 100%; }
#tab-dashboard .chart-card { padding: 0.85rem; min-width: 0px; max-width: 100%; overflow: hidden; box-sizing: border-box; }
#tab-dashboard .chart-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.4rem; min-width: 0px; width: 100%; }
#tab-dashboard .chart-container { height: 275px; position: relative; width: 100% !important; max-width: 100% !important; }
#tab-table .table-card { padding: 0.75rem 0.5rem; width: 100%; max-width: 100%; min-width: 0px; overflow: hidden; }
#tab-table .table-wrapper { width: 100%; max-width: 100%; max-height: 75vh; overflow-x: auto; overscroll-behavior-x: contain; border-radius: 0.5rem; }
#tab-table table.data-table { min-width: 1550px; }
}
@media (min-width: 900px) and (max-width: 1024px) {
#tab-dashboard .charts-grid { grid-template-columns: repeat(2, minmax(0px, 1fr)); gap: 1rem; }
#tab-dashboard .chart-container { height: 260px; }
}
@media (max-width: 600px) {
#tab-dashboard .charts-grid { grid-template-columns: 1fr; gap: 0.85rem; }
#tab-dashboard .chart-container { height: 240px; }
}
#tab-dashboard .chart-zoom-group { display: inline-flex; align-items: center; background: var(--bg-tertiary); border: 1px solid var(--border-color); border-radius: 0.375rem; overflow: hidden; gap: 1px; }
#tab-dashboard .btn-chart-zoom { background: transparent; border-width: medium; border-style: none; border-color: currentcolor; border-image: none; color: var(--text-secondary); padding: 0.2rem 0.45rem; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 600; transition: all var(--transition-fast); min-width: 26px; height: 24px; }
#tab-dashboard .btn-chart-zoom:hover { background: var(--border-color); color: var(--text-primary); }
#tab-dashboard .btn-chart-zoom:active { transform: scale(0.95); }
#tab-dashboard .btn-chart-zoom.btn-reset-zoom { border-left: 1px solid var(--border-color); padding: 0.2rem 0.45rem; gap: 0.25rem; font-size: 0.7rem; }
#tab-dashboard .chart-card-actions { display: inline-flex; align-items: center; gap: 0.35rem; flex-wrap: nowrap; }
#tab-table .guide-table-wrapper { overflow-x: auto; border: 1px solid var(--border-color); border-radius: 0.5rem; }
#tab-dashboard .chart-controls-wrapper { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
#tab-dashboard .chart-controls-group-time { display: inline-flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; }
#tab-dashboard .chart-controls-group-view { display: inline-flex; align-items: center; gap: 0.35rem; }
#tab-dashboard .chart-time-range-group { display: inline-flex; align-items: center; height: 32px; background: var(--surface); border: 1px solid var(--border-color); border-radius: 0.375rem; padding: 2px; gap: 2px; box-sizing: border-box; }
#tab-dashboard .chart-time-range-group .chart-range-label { font-size: 0.72rem; font-weight: 600; color: var(--text-muted); padding: 0px 0.35rem 0px 0.25rem; display: inline-flex; align-items: center; gap: 3px; user-select: none; white-space: nowrap; }
#tab-dashboard .btn-time-range { border-width: medium; border-style: none; border-color: currentcolor; border-image: none; background: transparent; color: var(--text-secondary); font-size: 0.75rem; font-weight: 600; height: 26px; line-height: 26px; padding: 0px 0.42rem; border-radius: 0.25rem; cursor: pointer; transition: all var(--transition-fast); white-space: nowrap; user-select: none; display: inline-flex; align-items: center; gap: 3px; }
#tab-dashboard .btn-time-range:hover { color: var(--text-primary); background: rgba(59, 130, 246, 0.08); }
#tab-dashboard .btn-time-range.active { background: var(--color-primary); color: rgb(255, 255, 255); box-shadow: rgba(59, 130, 246, 0.35) 0px 1px 3px; }
#tab-dashboard .custom-range-popover-wrapper { position: relative; display: inline-flex; }
#tab-dashboard #custom-range-popover { position: absolute; top: calc(100% + 6px); left: 0px; min-width: 290px; padding: 0.85rem; z-index: 1050; background: var(--bg-primary); border: 1px solid var(--border-color); border-radius: 0.5rem; box-shadow: rgba(0, 0, 0, 0.4) 0px 10px 25px -5px; box-sizing: border-box; }
#tab-dashboard #custom-range-popover input[type="date"] { color-scheme: dark; }
body.light-theme #tab-dashboard #custom-range-popover input[type="date"] { color-scheme: light; }
@media (max-width: 640px) {
#tab-dashboard #custom-range-popover { left: auto !important; right: 0px !important; max-width: 90vw !important; }
}
#tab-dashboard .chart-date-picker-group { display: inline-flex; align-items: center; height: 32px; background: var(--surface); border: 1px solid var(--border-color); border-radius: 0.375rem; padding: 2px 4px; gap: 3px; box-sizing: border-box; transition: all var(--transition-fast); }
#tab-dashboard .chart-date-picker-group.active { border-color: var(--color-primary); box-shadow: rgba(59, 130, 246, 0.25) 0px 0px 0px 2px; background: rgba(59, 130, 246, 0.05); }
#tab-dashboard .chart-date-picker-group .chart-daily-label { font-size: 0.72rem; font-weight: 600; color: var(--text-muted); display: inline-flex; align-items: center; gap: 3px; cursor: pointer; padding: 0px 0.2rem; margin: 0px; user-select: none; white-space: nowrap; }
#tab-dashboard .chart-date-picker-input { border: 1px solid var(--border-color); background: var(--bg-secondary); color: var(--text-primary); font-size: 0.75rem; font-weight: 600; padding: 0px 0.35rem; border-radius: 0.25rem; font-family: inherit; cursor: pointer; outline: none; height: 24px; width: 125px; color-scheme: dark light; }
#tab-dashboard .chart-date-picker-input:hover { border-color: var(--color-primary); }
#tab-dashboard .btn-chart-date-nav { border-width: medium; border-style: none; border-color: currentcolor; border-image: none; background: transparent; color: var(--text-secondary); cursor: pointer; height: 24px; width: 22px; padding: 0px; border-radius: 3px; display: inline-flex; align-items: center; justify-content: center; transition: all var(--transition-fast); }
#tab-dashboard .btn-chart-date-nav:hover { color: var(--text-primary); background: rgba(59, 130, 246, 0.12); }
#tab-dashboard .btn-chart-date-nav:disabled { opacity: 0.3; cursor: not-allowed; }
#tab-dashboard .btn-chart-tool { height: 32px; font-size: 0.75rem; font-weight: 500; padding: 0px 0.55rem; border-radius: 0.375rem; display: inline-flex; align-items: center; gap: 0.3rem; box-sizing: border-box; white-space: nowrap; cursor: pointer; border: 1px solid var(--border-color); background: var(--surface); color: var(--text-secondary); transition: all var(--transition-fast); }
#tab-dashboard .btn-chart-tool:hover { color: var(--text-primary); border-color: var(--color-primary); background: var(--bg-secondary); }
#tab-dashboard .btn-chart-tool.active { background: rgba(59, 130, 246, 0.12); border-color: var(--color-primary); color: var(--color-primary); }

/* Integration fixes for the current app's layout and inherited styles. */
#tab-table .data-table td.col-event-cell { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
#tab-table #main-table-wrapper:not(.table-fit-page) .data-table :is(th,td):first-child { min-width:80px; width:80px; }
#tab-table #table-col-dropdown-menu { z-index:100; }
/* Full date is visible in both scroll and fit views. */
#tab-table #main-table-wrapper:not(.table-fit-page) .data-table :is(th,td):first-child { min-width:104px; width:104px; }
#tab-table #main-table-wrapper:not(.table-fit-page) table.data-table :is(th,td):nth-child(2) { left:104px !important; }
#tab-table #main-table-wrapper.table-fit-page table.data-table :is(th,td):first-child { min-width:78px; white-space:nowrap !important; }
#table-fit-stage { display:contents; }
#table-fit-stage.active { display:block; position:relative; width:100%; overflow:hidden; }
#table-fit-stage.active > table { position:absolute; top:0; left:0; margin:0; }

#patient-pdf-save-panel {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
    flex: 1 1 100%;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    background: var(--bg-card);
    margin-top: 0.5rem;
    min-width: 0;
}
#patient-pdf-save-panel a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    flex-shrink: 0;
    white-space: nowrap;
    text-decoration: none;
    font-weight: 600;
}
#patient-pdf-save-panel span {
    flex: 1 1 200px;
    min-width: 0;
    word-break: break-word;
    color: var(--text-secondary);
    line-height: 1.4;
}


/* Mobile Responsive Optimizations (<= 640px) */
@media (max-width: 640px) {
    #tab-dashboard .chart-visibility-bar {
        padding: 0.55rem 0.5rem !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }

    #tab-dashboard .chart-controls-wrapper {
        width: 100% !important;
        max-width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.45rem !important;
    }

    #tab-dashboard .chart-controls-group-time {
        width: 100% !important;
        max-width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.4rem !important;
    }

    #tab-dashboard .chart-time-range-group {
        display: flex !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        min-height: 32px !important;
        padding: 3px !important;
        gap: 2px !important;
        box-sizing: border-box !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
    }

    #tab-dashboard .chart-time-range-group::-webkit-scrollbar {
        display: none !important;
    }

    #tab-dashboard .chart-time-range-group .chart-range-label {
        display: none !important;
    }

    #tab-dashboard .btn-time-range {
        flex: 1 1 0px !important;
        min-width: 0 !important;
        text-align: center !important;
        justify-content: center !important;
        padding: 0 3px !important;
        font-size: 0.72rem !important;
        height: 28px !important;
        line-height: 28px !important;
        white-space: nowrap !important;
    }

    #tab-dashboard .custom-range-popover-wrapper {
        flex: 1 1 0px !important;
        min-width: 0 !important;
        display: flex !important;
    }

    #tab-dashboard .custom-range-popover-wrapper .btn-time-range {
        width: 100% !important;
    }

    #tab-dashboard #custom-range-popover {
        left: auto !important;
        right: 0px !important;
        max-width: calc(100vw - 1.5rem) !important;
        min-width: 280px !important;
        box-sizing: border-box !important;
    }

    #tab-dashboard .chart-date-picker-group {
        display: flex !important;
        width: 100% !important;
        max-width: 100% !important;
        height: 34px !important;
        box-sizing: border-box !important;
        justify-content: space-between !important;
        align-items: center !important;
    }

    #tab-dashboard .chart-date-picker-group .chart-daily-label {
        font-size: 0.72rem !important;
        flex-shrink: 0 !important;
        padding: 0 0.15rem !important;
    }

    #tab-dashboard .chart-date-picker-input {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        width: auto !important;
        text-align: center !important;
        height: 26px !important;
        font-size: 0.72rem !important;
    }

    #tab-dashboard .btn-chart-date-nav {
        flex-shrink: 0 !important;
        width: 26px !important;
        height: 26px !important;
    }

    #tab-dashboard .chart-controls-group-view {
        width: 100% !important;
        max-width: 100% !important;
        display: flex !important;
        gap: 0.45rem !important;
    }

    #tab-dashboard .chart-controls-group-view .btn-chart-tool {
        flex: 1 1 50% !important;
        min-width: 0 !important;
        justify-content: center !important;
        height: 34px !important;
        font-size: 0.74rem !important;
        padding: 0 0.4rem !important;
    }

    #tab-dashboard .chart-vis-dropdown-container {
        flex: 1 1 50% !important;
        min-width: 0 !important;
        display: flex !important;
    }

    #tab-dashboard #chart-vis-dropdown-btn {
        width: 100% !important;
        justify-content: center !important;
    }
}
