/* Chart tabs and wide tables scroll sideways inside their own box; the page itself never does (owner 10/26). Used by the admin and provider portals. */
.tabs-scroll-wrap { position: relative; }
.tabs-scroll { display: flex; flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; scrollbar-width: thin; scroll-snap-type: x proximity; }
.tabs-scroll > .chart-tab { flex: 0 0 auto; scroll-snap-align: start; }
.tabs-scroll-wrap::before, .tabs-scroll-wrap::after { content: ''; position: absolute; top: 0; bottom: 1px; width: 34px; pointer-events: none; opacity: 0; transition: opacity .15s; z-index: 2; }
.tabs-scroll-wrap::before { left: 0; background: linear-gradient(to right, var(--bg, #fff), rgba(255, 255, 255, 0)); }
.tabs-scroll-wrap::after { right: 0; background: linear-gradient(to left, var(--bg, #fff), rgba(255, 255, 255, 0)); }
.tabs-scroll-wrap.can-left::before, .tabs-scroll-wrap.can-right::after { opacity: 1; }
.tabs-arrow { position: absolute; top: 50%; transform: translateY(-50%); z-index: 3; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--border, #ccc); background: var(--bg, #fff); color: var(--text, #222); cursor: pointer; font-size: 16px; line-height: 1; padding: 0; display: none; }
.tabs-arrow.left { left: 2px; }
.tabs-arrow.right { right: 2px; }
.tabs-scroll-wrap.can-left > .tabs-arrow.left, .tabs-scroll-wrap.can-right > .tabs-arrow.right { display: block; }

.table-scroll { overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.table-scroll > table { min-width: 100%; }
.table-scroll th:first-child, .table-scroll td:first-child { position: sticky; left: 0; z-index: 1; background: var(--bg, #fff); box-shadow: 1px 0 0 var(--border, #ddd); }
.table-scroll thead th:first-child { z-index: 2; }

#admin-chart-modal { overflow-x: hidden; max-width: 100vw; }
[id^="chart-panel-"], #chart-card-panel { min-width: 0; max-width: 100%; }

/* ONE shared sideways-scroll box for every wide table (owner 10/27, hotfix 2): public/js/scroll-box.js wraps each table in .table-scroll and flags it .is-wide when it overflows. A wide box always shows its scrollbar (pinned to the bottom of the visible area,
   the box has its own height and scrolls up and down inside), fades both edges, keeps the first column and an action column (Post / Hide / Review) in view, and never lets the page behind scroll sideways. */
html, body { max-width: 100vw; }
.table-scroll {
  --scroll-h: calc(100vh - 190px);
  background:
    linear-gradient(to right, var(--bg, #fff), rgba(255, 255, 255, 0)) 0 0 / 28px 100% no-repeat local,
    linear-gradient(to left, var(--bg, #fff), rgba(255, 255, 255, 0)) 100% 0 / 28px 100% no-repeat local,
    linear-gradient(to right, rgba(0, 0, 0, 0.16), rgba(0, 0, 0, 0)) 0 0 / 12px 100% no-repeat scroll,
    linear-gradient(to left, rgba(0, 0, 0, 0.16), rgba(0, 0, 0, 0)) 100% 0 / 12px 100% no-repeat scroll;
}
.table-scroll.is-wide { overflow-x: scroll; overflow-y: auto; max-height: var(--scroll-h); }
/* Chrome and Safari draw the styled bar below (a styled bar is never the thin overlay one); Firefox takes the standard properties */
@supports (-moz-appearance: none) { .table-scroll.is-wide { scrollbar-width: auto; scrollbar-color: #8a8f98 #e6e8eb; } }
.modal .table-scroll.is-wide, .modal-inner .table-scroll.is-wide, #admin-chart-modal .table-scroll.is-wide { --scroll-h: calc(100vh - 260px); }
.table-scroll.is-wide::-webkit-scrollbar { height: 14px; width: 14px; }
.table-scroll.is-wide::-webkit-scrollbar-track { background: #e6e8eb; }
.table-scroll.is-wide::-webkit-scrollbar-thumb { background: #8a8f98; border-radius: 7px; border: 2px solid #e6e8eb; }
.table-scroll.is-wide thead th { position: sticky; top: 0; z-index: 3; background: var(--bg2, #f4f5f7); }
/* A long table (public/js/scroll-box.js marks it .is-long) scrolls up and down inside its box with its header row pinned (owner 10/30). */
.table-scroll.is-long { overflow-y: auto; max-height: var(--scroll-h); }
.modal .table-scroll.is-long, .modal-inner .table-scroll.is-long, #admin-chart-modal .table-scroll.is-long { --scroll-h: calc(100vh - 260px); }
.table-scroll.is-long thead th { position: sticky; top: 0; z-index: 3; background: var(--bg2, #f4f5f7); }
.table-scroll.is-long:not(.is-wide) thead th:first-child { position: sticky; top: 0; left: auto; z-index: 4; background: var(--bg2, #f4f5f7); }
/* the first column and the action column stay in view only while the table is wider than its box */
.table-scroll:not(.is-wide) th:first-child, .table-scroll:not(.is-wide) td:first-child { position: static; box-shadow: none; background: transparent; }
.table-scroll.is-wide th.sticky-actions, .table-scroll.is-wide td.sticky-actions { position: sticky; right: 0; z-index: 2; background: var(--bg, #fff); box-shadow: -1px 0 0 var(--border, #ddd); }
.table-scroll.is-wide thead th.sticky-actions { z-index: 4; background: var(--bg2, #f4f5f7); }
.table-scroll.is-wide thead th:first-child { z-index: 4; background: var(--bg2, #f4f5f7); }
.table-scroll th { white-space: nowrap; }
.table-scroll td { min-width: 4.5em; max-width: 420px; }
.table-scroll td .btn, .table-scroll th .btn { white-space: nowrap; }
/* a table inside a table cell (the ERA Review lines inside the ERA row): the inner box takes the cell's width instead of stretching the outer table */
td .table-scroll, th .table-scroll { width: 0; min-width: 100%; }

/* ERA list (owner 10/27, 1aa): dense rows like TherapyNotes, full payer names, search panel on one tight line */
.era-list-dense th, .era-list-dense td { padding: 6px 10px; line-height: 1.3; vertical-align: middle; }
.era-list-dense th { font-size: 12px; letter-spacing: 0.04em; white-space: normal; }
.era-list-dense td { min-width: 0; }
.era-list-dense td:nth-child(3), .era-list-dense th:nth-child(3) { min-width: 140px; }
.era-list-dense th, .era-list-dense td { padding: 5px 6px; }
.era-list-dense .pill { display: inline-block; margin-right: 6px; }
.era-list-dense .era-status-cell { white-space: nowrap; }
#era-search-panel label { font-size: 12px; letter-spacing: 0.03em; text-transform: uppercase; color: var(--mid); }
#era-search-panel input, #era-search-panel select { padding: 5px 8px; font-size: 13px; }

/* one ledger (owner 10/27, 1ad) */
.one-ledger td:nth-child(2) { white-space: nowrap; }
.one-ledger td.sticky-actions { width: 1%; }
.one-menu > summary { list-style: none; cursor: pointer; display: inline-block; }
.one-menu > summary::-webkit-details-marker { display: none; }

/* a header row of badges and buttons wraps instead of running off the screen (the page never scrolls sideways, owner 10/27) */
.note-block-header { flex-wrap: wrap; }

/* Headers are never cut off (owner 10/27): every ledger header keeps its whole longest word, so a sticky column never covers part of one. */
.one-ledger thead th { min-width: 7.5em; white-space: normal; word-break: keep-all; hyphens: none; vertical-align: bottom; }
.one-ledger thead th:first-child { min-width: 8em; }

/* the chart window is nearly the whole screen, so the data rarely needs scrolling (owner 10/27) */
#admin-chart-modal { padding: 10px; }
/* ledger and claims rows are compact (owner 10/27: rows too big) */
.one-ledger th, .one-ledger td { padding: 4px 8px; line-height: 1.25; font-size: 13px; }
.one-ledger td .btn, .one-ledger td summary.btn { padding: 2px 8px; font-size: 12px; }
.one-ledger td:nth-child(3) { min-width: 220px; }
#ac-body .chart-claims-table th, #ac-body .chart-claims-table td { padding: 4px 8px; line-height: 1.25; font-size: 13px; }
/* the row menu shows its buttons only while it is open */
.one-menu:not([open]) .one-menu-panel { display: none !important; }

/* LINE ITEM COLORS (owner 10/28), in any billing list: a charge is red, a payment green, an adjustment yellow, anything else gray. A tinted row and a bar on its left edge; the tint is a layer over the cell's own background so the sticky first column keeps it (the :not() only raises the rule's weight above the sticky column's own background). */
tr.li-charge > td:not(.li-none), tr.li-charge > th:not(.li-none) { background-image: linear-gradient(rgba(192, 57, 43, 0.10), rgba(192, 57, 43, 0.10)); }
tr.li-payment > td:not(.li-none), tr.li-payment > th:not(.li-none) { background-image: linear-gradient(rgba(39, 134, 66, 0.12), rgba(39, 134, 66, 0.12)); }
tr.li-adjustment > td:not(.li-none), tr.li-adjustment > th:not(.li-none) { background-image: linear-gradient(rgba(214, 158, 0, 0.16), rgba(214, 158, 0, 0.16)); }
tr.li-other > td:not(.li-none), tr.li-other > th:not(.li-none) { background-image: linear-gradient(rgba(120, 120, 120, 0.12), rgba(120, 120, 120, 0.12)); }
tr.li-charge > td:first-child { box-shadow: inset 5px 0 0 #c0392b; }
tr.li-payment > td:first-child { box-shadow: inset 5px 0 0 #278642; }
tr.li-adjustment > td:first-child { box-shadow: inset 5px 0 0 #d69e00; }
tr.li-other > td:first-child { box-shadow: inset 5px 0 0 #8a8a8a; }
.li-key { display: inline-flex; gap: 12px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--mid, #666); }
.li-key i { display: inline-block; width: 11px; height: 11px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }

/* VISITS TABLE (owner 10/28): each diagnosis is its own chip so hovering one reads that one; the one under the pointer is outlined. */
.vc-dx { display: inline-block; padding: 1px 6px; margin: 1px 2px; border: 1px solid var(--border, #ccc); border-radius: 10px; font-size: 13px; cursor: help; background: var(--bg2, #f4f5f7); }
.vc-dx:hover, .vc-dx:focus { outline: 2px solid var(--accent, #3b6e8f); background: var(--bg, #fff); }
.vc-cpt { cursor: help; border-bottom: 1px dotted var(--mid, #888); }
.vc-table th, .vc-table td, .vc-ins-table th, .vc-ins-table td { padding: 4px 8px; vertical-align: top; }
.vc-table tr.vc-addon > td { background-image: linear-gradient(rgba(120, 120, 120, 0.07), rgba(120, 120, 120, 0.07)); }
.vc-table tr.vc-filters th input, .vc-table tr.vc-filters th select { width: 100%; min-width: 70px; font-size: 13px; }

.uni-seg { display: inline-flex; }
.uni-seg .btn { border-radius: 0; }
.uni-seg .btn:first-child { border-radius: 4px 0 0 4px; }
.uni-seg .btn:last-child { border-radius: 0 4px 4px 0; }

/* BILLING WINDOWS (owner 11/09): the allocation tables in Assign payment, Add payment and Change type fit a laptop screen (about 1100px) without sideways scrolling; narrower columns, and the description wraps. Where a screen is still too small the table area scrolls sideways (never hidden) with a scrollbar that is always drawn, so a mouse or trackpad can use it. */
.pa-table thead th, .pa-table thead th:first-child { min-width: 0; }
.pa-table th, .pa-table td { padding: 4px 6px; }
.pa-table td:nth-child(3) { min-width: 140px; }
.ui-hscroll { overflow-x: auto; overflow-y: auto; }
.ui-hscroll::-webkit-scrollbar { height: 12px; width: 12px; }
.ui-hscroll::-webkit-scrollbar-thumb { background: #9aa39a; border-radius: 6px; border: 2px solid transparent; background-clip: content-box; }
.ui-hscroll::-webkit-scrollbar-track { background: var(--bg2, #f4f5f7); }

/* ERA lines tinted by claim status (owner 11/10): faded red denied, faded green processed, faded yellow anything else. !important so the opaque sticky first column takes the tint too. */
.view tr.era-row-denied > td { background: var(--red-light) !important; }
.view tr.era-row-processed > td { background: var(--green-light) !important; }
.view tr.era-row-review > td { background: var(--yellow-light) !important; }
