/* TBA_ADMIN_UI_V24: scoped, shared light/dark table and staff-dialog design.
   No pagination, hidden rows or fake records. Scroll is a viewport, not an API limit. */
:root {
  --tba24-surface:#071626; --tba24-soft:#0c2035; --tba24-hover:#102b45;
  --tba24-text:#e5eef8; --tba24-muted:#a4b8cd; --tba24-line:#294159;
  --tba24-accent:#67c9fa; --tba24-focus:#65b9f6;
  --tba24-good-bg:#0b302e; --tba24-good:#78e3bd;
}
:root[data-admin-theme="light"] {
  --tba24-surface:#fff; --tba24-soft:#edf4f9; --tba24-hover:#f4f8fc;
  --tba24-text:#153454; --tba24-muted:#536e89; --tba24-line:#d5e2ed;
  --tba24-accent:#1765b3; --tba24-focus:#2385d8;
  --tba24-good-bg:#e9f9f2; --tba24-good:#08764e;
}
.tba-v24-scope { min-width:0; width:100%; color:var(--tba24-text); }
/* Outer frame and viewport are separate. Toolbars never enter the row scroller. */
:root body .app-shell .content-shell .page .tba-v24-scope [data-tba24-table-shell="true"] {
  padding:0 !important; min-width:0; max-height:none !important;
  overflow:visible !important; border:1px solid var(--tba24-line) !important;
  border-radius:18px !important; background:var(--tba24-surface) !important;
  color:var(--tba24-text) !important; box-shadow:none !important; outline:0 !important;
}
:root body .app-shell .content-shell .page .tba-v24-scope :is(.tba-v24-table-scroll,.tba-v24-grid-scroll) {
  display:block !important; position:relative !important; width:100%; min-width:0;
  height:auto !important; max-height:clamp(280px,62vh,680px) !important;
  max-height:clamp(280px,62dvh,680px) !important;
  overflow:auto !important; overscroll-behavior:contain; scrollbar-gutter:stable;
  scrollbar-width:thin; scrollbar-color:#8daac3 transparent;
  border-radius:17px; background:var(--tba24-surface) !important;
  padding:0 !important; isolation:isolate;
}
:root body .tba-v24-scope :is(.tba-v24-table-scroll,.tba-v24-grid-scroll):focus-visible {
  outline:2px solid var(--tba24-focus) !important; outline-offset:2px;
}
:root body .tba-v24-scope .tba-v24-table-scroll table {
  display:table !important; border-collapse:separate !important; border-spacing:0 !important;
  width:100% !important; min-width:760px; margin:0 !important; table-layout:auto !important;
}
:root body .tba-v24-scope .tba-v24-table-scroll thead { display:table-header-group !important; }
:root body .tba-v24-scope .tba-v24-table-scroll tbody { display:table-row-group !important; height:auto !important; max-height:none !important; overflow:visible !important; }
:root body .tba-v24-scope .tba-v24-table-scroll tr { display:table-row !important; }
:root body .app-shell .content-shell .page .tba-v24-scope .tba-v24-table-scroll thead th,
:root body .app-shell .content-shell .page .tba-v24-scope .tba-v24-grid-scroll [data-tba24-head="true"] {
  position:sticky !important; top:0 !important; z-index:5 !important;
  color:var(--tba24-muted) !important; background:var(--tba24-soft) !important;
  background-image:none !important; opacity:1 !important; backdrop-filter:none !important;
  box-shadow:inset 0 -1px 0 var(--tba24-line) !important;
  border:0 !important; border-radius:0 !important;
  font-size:11px !important; font-weight:700 !important; letter-spacing:.055em;
  text-transform:uppercase; line-height:1.45 !important; text-align:left;
}
:root body .tba-v24-scope .tba-v24-table-scroll th { padding:15px 16px !important; white-space:nowrap; }
:root body .tba-v24-scope .tba-v24-table-scroll td {
  display:table-cell !important; padding:15px 16px !important; line-height:1.5;
  border:0 !important; border-bottom:1px solid var(--tba24-line) !important;
  color:var(--tba24-text) !important; background:var(--tba24-surface) !important;
  font-size:13px !important; vertical-align:middle;
}
:root body .tba-v24-scope .tba-v24-table-scroll tbody tr:nth-child(even) td { background:var(--tba24-hover) !important; }
:root body .tba-v24-scope .tba-v24-table-scroll tbody tr:hover td { background:var(--tba24-soft) !important; }
:root body .tba-v24-scope .tba-v24-table-scroll tr:last-child td { border-bottom:0 !important; }
/* Existing div-grid columns are retained. A shared viewport replaces page-long lists. */
:root body .tba-v24-scope .tba-v24-grid-scroll [data-tba24-head="true"],
:root body .tba-v24-scope .tba-v24-grid-scroll [data-tba24-row="true"] {
  display:grid !important; align-items:center; gap:14px !important; padding:15px 16px !important;
  width:100%; box-sizing:border-box; min-width:900px;
}
:root body .tba-v24-scope .tba-v24-grid-scroll [data-tba24-row="true"] {
  min-height:62px; line-height:1.45; border:0 !important;
  border-bottom:1px solid var(--tba24-line) !important;
  color:var(--tba24-text) !important; background:var(--tba24-surface) !important; font-size:13px;
}
:root body .tba-v24-scope .tba-v24-grid-scroll [data-tba24-row="true"]:nth-child(odd) { background:var(--tba24-hover) !important; }
:root body .tba-v24-scope .tba-v24-grid-scroll [data-tba24-row="true"]:hover { background:var(--tba24-soft) !important; }
:root body .tba-v24-scope .tba-v24-grid-scroll [data-tba24-row="true"] > * { min-width:0; }
:root body .tba-v24-scope .tba-v24-grid-scroll [data-tba24-row="true"] :is(small,.muted) { color:var(--tba24-muted) !important; opacity:1 !important; }
:root body .tba-v24-scope .tba-v24-grid-scroll :is(.operations-table-head,.operations-table-row).processing {
  min-width:1040px; grid-template-columns:140px 80px repeat(3,minmax(150px,1fr)) minmax(180px,1.2fr) !important;
}
:root body .tba-v24-scope .tba-v24-grid-scroll :is(.operations-table-head,.operations-table-row).delivery {
  min-width:1080px; grid-template-columns:85px 145px 135px 80px repeat(2,minmax(150px,1fr)) minmax(180px,1.2fr) !important;
}
:root body .tba-v24-scope .tba-v24-grid-scroll :is(.operations-table-head,.operations-table-row).benchmarks {
  min-width:1080px; grid-template-columns:minmax(200px,1.6fr) 120px 120px 145px 80px 80px minmax(160px,1fr) !important;
}
/* Captions remain readable, including raw technical identifiers shown on a second line. */
.tba-v24-code-pair { display:inline-flex; flex-direction:column; gap:4px; max-width:100%; vertical-align:middle; }
.tba-v24-code-pair > span { color:var(--tba24-text); font-weight:500; }
.tba-v24-code-pair code { color:var(--tba24-muted) !important; font-size:10px !important; line-height:1.4; background:none !important; border:0 !important; padding:0 !important; white-space:normal; overflow-wrap:anywhere; }
/* Staff screen: no dark outer frame, one toolbar, restrained actions and tabs. */
:root body .tba-v24-scope[data-tba-v24-page="managers"] :is(.manager-table-card,.manager-panel,.manager-card,.manager-history-card) {
  color:var(--tba24-text) !important; background:var(--tba24-surface) !important;
  border:1px solid var(--tba24-line) !important; border-radius:18px !important;
  box-shadow:none !important; outline:0 !important; min-width:0;
}
:root body .tba-v24-scope :is(.manager-toolbar,.manager-filters,.manager-history-filters) {
  display:flex; flex-wrap:wrap; gap:10px !important; align-items:center;
  padding:14px !important; background:var(--tba24-surface) !important; color:var(--tba24-text) !important;
  border:0 !important; border-bottom:1px solid var(--tba24-line) !important;
  border-radius:17px 17px 0 0 !important; box-shadow:none !important; outline:0 !important;
}
:root body .tba-v24-scope :is(.manager-tabs,.operations-tabs,.system-tabs) {
  display:flex; flex-wrap:wrap; gap:6px !important; align-items:center;
  background:transparent !important; border:0 !important; padding:0 !important;
  margin-bottom:18px !important; color:var(--tba24-muted) !important;
}
:root body .tba-v24-scope :is(.manager-tabs,.operations-tabs,.system-tabs) > button {
  min-height:40px; padding:9px 15px !important; border:1px solid transparent !important;
  border-radius:10px !important; background:transparent !important;
  color:var(--tba24-muted) !important; font-weight:600; line-height:1.3;
}
:root body .tba-v24-scope :is(.manager-tabs,.operations-tabs,.system-tabs) > button.active {
  color:var(--tba24-text) !important; background:var(--tba24-surface) !important;
  border-color:var(--tba24-line) !important; box-shadow:0 2px 6px rgba(20,49,80,.06) !important;
}
:root body .tba-v24-scope :is(.manager-refresh,.operations-refresh,.system-refresh) {
  min-height:40px; padding:9px 15px !important; background:var(--tba24-surface) !important;
  color:var(--tba24-text) !important; border:1px solid var(--tba24-line) !important;
  border-radius:10px !important; font-weight:600; opacity:1;
}
:root body .tba-v24-scope .manager-add-button {
  background:#1678ca !important; background-image:none !important; color:#fff !important;
  border:1px solid #1678ca !important; border-radius:10px !important;
  min-height:42px; padding:10px 16px !important; font-weight:600;
}
:root body .tba-v24-scope[data-tba-v24-page="managers"] :is(select,input),
:root body [data-tba24-modal="true"] :is(select,input,textarea) {
  color:var(--tba24-text) !important; background:var(--tba24-surface) !important;
  border:1px solid var(--tba24-line) !important; border-radius:9px !important;
  min-height:38px; padding:8px 10px; font-size:13px; max-width:100%; box-sizing:border-box;
}
:root body .tba-v24-scope[data-tba-v24-page="managers"] :is(.manager-reset,.manager-reset-button,.reset-2fa-button) {
  background:var(--tba24-soft) !important; color:var(--tba24-text) !important;
  border:1px solid var(--tba24-line) !important; border-radius:8px !important;
}
:root body .tba-v24-scope[data-tba-v24-page="managers"] :is(.manager-table-footer,.manager-history-footer) {
  color:var(--tba24-muted) !important; background:var(--tba24-soft) !important;
  padding:12px 16px !important; border:0 !important; border-radius:0 0 17px 17px;
}
/* Scoped request and staff search: no inner frame, no empty left half. */
:root body .tba-v24-scope[data-tba-v24-page="requests"] :is(.filters,.filter-bar,.toolbar,.runs-toolbar,.request-filters,.request-runs-toolbar) {
  display:flex !important; justify-content:flex-start !important; flex-wrap:wrap; gap:12px !important;
  padding:12px !important; min-height:0 !important; height:auto !important; margin-bottom:16px;
  background:var(--tba24-surface) !important; border:1px solid var(--tba24-line) !important; border-radius:14px;
}
:root body .tba-v24-scope[data-tba-v24-page="requests"] :is(.search-box,.search-field,.search-input-wrap) {
  flex:1 1 300px !important; width:auto !important; max-width:none !important; margin-left:0 !important;
}
:root body .tba-v24-scope :is(.search-box,.search-field,.search-input-wrap) input {
  border:0 !important; box-shadow:none !important; outline:0 !important;
  background:transparent !important; min-width:0 !important; width:100% !important; color:var(--tba24-text) !important;
}
:root body .tba-v24-scope :is(.search-box,.search-field,.search-input-wrap):focus-within {
  outline:2px solid var(--tba24-focus) !important; outline-offset:1px;
}
/* Actual modal surfaces are tagged by the JSX patch (including React portals). */
:root body [data-tba24-modal="true"] {
  background:var(--tba24-surface) !important; background-image:none !important;
  color:var(--tba24-text) !important; border:1px solid var(--tba24-line) !important;
  border-radius:20px !important; box-shadow:0 24px 80px rgba(0,15,34,.24) !important;
  max-height:calc(100dvh - 48px); overflow:auto;
}
:root body [data-tba24-modal="true"] :is(h1,h2,h3,h4,strong,b,label) { color:var(--tba24-text) !important; opacity:1 !important; }
:root body [data-tba24-modal="true"] :is(p,small,.muted,.help-text,.manager-help,.manager-hint) { color:var(--tba24-muted) !important; opacity:1 !important; line-height:1.55; }
:root body [data-tba24-modal="true"] :is(.modal-actions,.manager-modal-actions) { display:flex; justify-content:flex-end; gap:12px; margin-top:24px; }
:root body [data-tba24-modal="true"] button { min-height:38px; }
:root body [data-tba24-modal="true"] :is(input,select,textarea):focus-visible { outline:2px solid var(--tba24-focus) !important; outline-offset:1px; }
:root body [data-tba24-modal="true"] button:disabled { cursor:not-allowed; opacity:.5 !important; }
:root body .tba-v24-scope :is(.operations-status-card,.operations-breakdown,.operations-status-breakdown,.system-card) {
  background:var(--tba24-surface) !important; color:var(--tba24-text) !important; border-color:var(--tba24-line) !important;
}
:root body .tba-v24-scope .operations-overview :is(h3,h4,strong,[class*="title"]),
:root body .tba-v24-scope .system-page :is(h3,h4,[class*="label"]) { color:var(--tba24-text) !important; opacity:1 !important; }
:root body .tba-v24-scope :is(.operations-generated,.system-generated) { color:var(--tba24-muted) !important; }
@media (max-width:760px) {
  :root body .app-shell .content-shell .page .tba-v24-scope :is(.tba-v24-table-scroll,.tba-v24-grid-scroll) { max-height:min(64dvh,520px) !important; }
  :root body .tba-v24-scope :is(.manager-toolbar,.manager-filters,.manager-history-filters) > * { max-width:100%; }
  :root body [data-tba24-modal="true"] { max-width:calc(100vw - 24px); max-height:calc(100dvh - 24px); border-radius:15px !important; }
}

/* Strong specificity only for the explicitly tagged staff/request surfaces. */
:root[data-admin-theme="light"] body .app-shell .content-shell .page [data-tba24-modal="true"],
:root[data-admin-theme="light"] body [data-tba24-modal="true"] {
 background:#fff !important; background-image:none !important; color:#153454 !important; border-color:#d5e2ed !important;
}
:root[data-admin-theme="dark"] body .app-shell .content-shell .page [data-tba24-modal="true"],
:root[data-admin-theme="dark"] body [data-tba24-modal="true"] {
 background:#071626 !important; background-image:none !important; color:#e5eef8 !important; border-color:#294159 !important;
}
:root body .app-shell .content-shell .page .tba-v24-scope [data-tba24-head="true"] > * { color:inherit !important; opacity:1 !important; }
:root body [data-tba24-modal="true"] :is(.primary-button,.manager-create-button,.confirm-button) {
 background:#1678ca !important; background-image:none !important; color:white !important; border-radius:9px;
}
:root body [data-tba24-modal="true"] :is(.secondary-button,.cancel-button) { color:var(--tba24-text) !important; background:var(--tba24-soft) !important; }

:root body .tba-v24-scope .tba-v24-grid-scroll[data-tba24-grid-kind="managers"][data-tba24-columns="2"] :is([data-tba24-head="true"],[data-tba24-row="true"]) {
 grid-template-columns:repeat(2,minmax(140px,1fr)) !important; min-width:326px;
}

:root body .tba-v24-scope .tba-v24-grid-scroll[data-tba24-grid-kind="managers"][data-tba24-columns="3"] :is([data-tba24-head="true"],[data-tba24-row="true"]) {
 grid-template-columns:repeat(3,minmax(140px,1fr)) !important; min-width:480px;
}

:root body .tba-v24-scope .tba-v24-grid-scroll[data-tba24-grid-kind="managers"][data-tba24-columns="4"] :is([data-tba24-head="true"],[data-tba24-row="true"]) {
 grid-template-columns:repeat(4,minmax(140px,1fr)) !important; min-width:634px;
}

:root body .tba-v24-scope .tba-v24-grid-scroll[data-tba24-grid-kind="managers"][data-tba24-columns="5"] :is([data-tba24-head="true"],[data-tba24-row="true"]) {
 grid-template-columns:repeat(5,minmax(140px,1fr)) !important; min-width:788px;
}

:root body .tba-v24-scope .tba-v24-grid-scroll[data-tba24-grid-kind="managers"][data-tba24-columns="6"] :is([data-tba24-head="true"],[data-tba24-row="true"]) {
 grid-template-columns:repeat(6,minmax(140px,1fr)) !important; min-width:942px;
}

:root body .tba-v24-scope .tba-v24-grid-scroll[data-tba24-grid-kind="managers"][data-tba24-columns="7"] :is([data-tba24-head="true"],[data-tba24-row="true"]) {
 grid-template-columns:repeat(7,minmax(140px,1fr)) !important; min-width:1096px;
}

:root body .tba-v24-scope .tba-v24-grid-scroll[data-tba24-grid-kind="managers"][data-tba24-columns="8"] :is([data-tba24-head="true"],[data-tba24-row="true"]) {
 grid-template-columns:repeat(8,minmax(140px,1fr)) !important; min-width:1250px;
}

:root body .tba-v24-scope .tba-v24-grid-scroll[data-tba24-grid-kind="managers"][data-tba24-columns="9"] :is([data-tba24-head="true"],[data-tba24-row="true"]) {
 grid-template-columns:repeat(9,minmax(140px,1fr)) !important; min-width:1404px;
}

:root body .tba-v24-scope .tba-v24-grid-scroll[data-tba24-grid-kind="managers"][data-tba24-columns="10"] :is([data-tba24-head="true"],[data-tba24-row="true"]) {
 grid-template-columns:repeat(10,minmax(140px,1fr)) !important; min-width:1558px;
}

:root body .tba-v24-scope .tba-v24-grid-scroll[data-tba24-grid-kind="managers"][data-tba24-columns="11"] :is([data-tba24-head="true"],[data-tba24-row="true"]) {
 grid-template-columns:repeat(11,minmax(140px,1fr)) !important; min-width:1712px;
}

:root body .tba-v24-scope .tba-v24-grid-scroll[data-tba24-grid-kind="managers"][data-tba24-columns="12"] :is([data-tba24-head="true"],[data-tba24-row="true"]) {
 grid-template-columns:repeat(12,minmax(140px,1fr)) !important; min-width:1866px;
}

:root body .tba-v24-scope .tba-v24-grid-scroll[data-tba24-grid-kind="managers"][data-tba24-columns="7"] :is([data-tba24-head="true"],[data-tba24-row="true"]) {
 grid-template-columns:minmax(200px,1.5fr) 110px 175px 135px 165px 155px 135px !important; min-width:1191px;
}

/* Toolbar hooks are assigned from the actual input/select JSX, not assumed class names. */
:root body .app-shell .content-shell .page .tba-v24-scope [data-tba24-toolbar="true"] {
 display:flex !important; flex-wrap:wrap; justify-content:flex-start !important; align-items:center; gap:12px !important;
 padding:12px !important; min-height:0 !important; height:auto !important; background:var(--tba24-surface) !important;
 border:1px solid var(--tba24-line) !important; border-radius:14px !important; box-shadow:none !important; outline:0 !important;
}
:root body .tba-v24-scope [data-tba24-search="true"] {
 flex:1 1 280px !important; min-width:200px !important; max-width:none !important; width:auto !important; margin-left:0 !important;
}
:root body .tba-v24-scope [data-tba24-search="true"] input {
 color:var(--tba24-text) !important; background:transparent !important; border:0 !important; box-shadow:none !important; outline:0 !important;
 min-width:0 !important; width:100% !important;
}
:root body .tba-v24-scope [data-tba24-search="true"]:focus-within { outline:2px solid var(--tba24-focus) !important; outline-offset:1px; }
:root body .tba-v24-scope[data-tba-v24-page="managers"] :is(.manager-history-toolbar,.manager-history-filters-bar,.manager-filter-bar) {
 background:var(--tba24-surface) !important; color:var(--tba24-text) !important; border:0 !important; border-bottom:1px solid var(--tba24-line) !important; border-radius:17px 17px 0 0 !important; padding:14px !important;
}
:root body .tba-v24-scope[data-tba-v24-page="managers"] [data-tba24-row="true"] :is(strong,b) { color:var(--tba24-text) !important; font-size:13px !important; }
