/* UI 158: loaded last; foregrounds stay paired with the selected theme. */
html body h1,html body h2,html body h3,html body label,
html body .filter-field label,html body .admin-page-category,
html body .admin-view-guide h1,html body .notification-panel-head strong,
html body .panel-title,html body .panel .panel-title {
 color:var(--theme-text,#fff7e6)!important;
 -webkit-text-fill-color:currentColor!important;text-shadow:none!important;
}
html body .admin-page-description,html body .admin-view-guide p,
html body .admin-directory-heading p,html body .admin-directory-link small,
html body .admin-data-health-heading p,html body .admin-nav-search-empty {
 color:var(--theme-muted,#d8c9a6)!important;-webkit-text-fill-color:currentColor!important;
}
html body :is(.integration-page-tab,.kyc-filter,.cs-record-tab,.admin-directory-link) {
 background:var(--theme-surface,#190b10)!important;
 color:var(--theme-text,#fff7e6)!important;border-color:var(--border-strong)!important;
 font-size:13px!important;line-height:1.4!important;min-height:40px;
}
html body :is(.integration-page-tab,.kyc-filter,.cs-record-tab).active {
 background:var(--theme-primary,#a7192d)!important;
 color:var(--theme-button-text,#fff)!important;border-color:var(--theme-primary)!important;
}
html body :is(.integration-page-tab,.kyc-filter,.cs-record-tab) * {
 color:inherit!important;-webkit-text-fill-color:currentColor!important;
}
html body .integration-tab-count {background:transparent!important;border:1px solid currentColor!important;}
html body .topbar {
 gap:16px!important;padding:14px 20px!important;align-items:center!important;
 background:var(--theme-surface,#190b10)!important;color:var(--theme-text,#fff7e6)!important;
}
html body .topbar-copy {
 grid-template-columns:minmax(0,1fr)!important;gap:3px!important;
}
html body #currentPageTitle {font-size:18px!important;line-height:1.3!important;}
html body .admin-page-category {font-size:10px!important;margin:0!important;}
html body .admin-page-description {
 max-width:100%!important;white-space:normal!important;font-size:12px!important;
 line-height:1.5!important;margin:0!important;
}
html body .admin-page-freshness {display:none!important;}
html body .admin-cache-mode-badge {display:none!important;}
html body .topbar-actions {gap:8px!important;flex-shrink:0;align-items:center;}
html body .topbar-actions .button {
 width:auto!important;min-width:0!important;min-height:40px!important;
 padding:9px 13px!important;font-size:12px!important;white-space:nowrap!important;
 word-break:normal!important;line-height:1.4!important;
}
html body .topbar-actions .button::before {content:none!important;}
html body .topbar-actions .button::after {content:none!important;}
html body .admin-refresh-button span {display:inline!important;}
html body .admin-identity-chip {color:var(--theme-muted)!important;max-width:160px;}
html body .admin-view-guide {
 margin-bottom:18px!important;padding:12px 16px!important;gap:12px!important;
 background:var(--theme-surface,#190b10)!important;border-color:var(--border)!important;
 box-shadow:none!important;align-items:center;
}
/* The page already has a heading. Keep the useful refresh and record context. */
html body .admin-view-guide-copy {display:none!important;}
html body .admin-view-guide-meta {width:100%;min-width:0!important;justify-content:flex-start!important;gap:10px!important;}
html body .admin-context-chip {background:transparent!important;border:0!important;padding:0!important;min-width:0!important;}
html body .admin-context-chip b {color:var(--theme-muted)!important;font-size:10px!important;}
html body .admin-context-chip span {color:var(--theme-text)!important;font-size:12px!important;}
html body .admin-view-guide-meta > button {margin-left:auto;min-height:38px!important;}
html body .page-heading {gap:12px!important;margin-bottom:18px!important;align-items:flex-start;}
html body .page-heading > div:first-child {flex:1 1 auto!important;min-width:0;}
html body .page-heading h2 {font-size:clamp(22px,2vw,28px)!important;line-height:1.25!important;margin:0 0 6px!important;}
html body .page-heading p {line-height:1.6!important;max-width:850px;}
html body .panel {padding:20px!important;}
html body .panel h3 {font-size:17px!important;line-height:1.4!important;}
html body .field label,html body .filter-field label {font-size:12px!important;line-height:1.5!important;letter-spacing:.02em!important;}
html body .filter-bar {display:flex!important;flex-wrap:wrap!important;align-items:flex-end!important;gap:12px!important;}
html body .filter-field {flex:1 1 170px!important;min-width:0!important;max-width:100%;}
html body .filter-bar > .button {flex:0 0 auto;}
html body .input,html body .select {min-height:42px!important;font-size:14px!important;line-height:1.4!important;}
html body .filter-field .input,html body .filter-field .select {width:100%!important;}
html body input::placeholder,html body textarea::placeholder {color:var(--theme-muted)!important;-webkit-text-fill-color:currentColor!important;}
html body .button {min-height:38px;line-height:1.4!important;}
html body :is(.record-tabs,.segmented-control,.integration-page-tabs) {gap:8px!important;flex-wrap:wrap!important;max-width:100%;}
html body .record-tab,html body .accounting-view-tab,html body .ops-tab {min-height:40px!important;font-size:13px!important;}
html body .table-wrap {max-width:100%;overflow:auto;overscroll-behavior:contain;}
html body th,html body td {padding:12px!important;font-size:13px!important;line-height:1.5!important;}
html body .nav-button {min-height:42px!important;font-size:13px!important;padding:10px!important;}
html body .nav-button.active {border-left:3px solid var(--theme-button-text,#fff)!important;}
html body .admin-nav-search-wrap {background:var(--theme-surface,#190b10)!important;padding:8px 0 12px!important;}
html body .admin-nav-search-control {background:var(--theme-surface)!important;min-height:44px;}
html body #adminModuleSearch {background:transparent!important;border:0!important;padding:8px 0!important;min-height:40px;}
html body .admin-nav-search-control kbd {color:var(--theme-muted)!important;font-family:inherit;}
html body .admin-nav-group-label {color:var(--theme-muted)!important;letter-spacing:.08em!important;}
html body .admin-nav-search-help {display:block;margin:8px 4px 0;color:var(--theme-muted)!important;font-size:11px;line-height:1.5;}
html body .admin-directory-link {gap:12px!important;padding:11px!important;}
html body .admin-directory-link span {font-size:13px!important;}
html body .admin-directory-link small {font-size:11px!important;}
html body #view-gateway .stats-grid {display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:12px!important;}
html body #view-gateway .stat-card {padding:16px!important;}
html body #view-gateway .stat-value {font-size:21px!important;}
html body #view-gateway .ops-kpi-grid {display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:12px!important;margin:18px 0!important;}
html body #view-gateway .ops-kpi-card {min-width:0;padding:16px!important;}
html body :is(.panel,.page-heading,.topbar-copy,.form-grid,.field) {min-width:0;}
@media(max-width:1100px) {
 html body .admin-identity-chip {display:none!important;}
 html body .admin-page-description {display:none!important;}
}
@media(max-width:700px) {
 html body .topbar {display:grid!important;grid-template-columns:44px minmax(0,1fr)!important;gap:8px 12px!important;padding:12px!important;}
 html body .topbar-copy {grid-column:2;}
 html body .topbar-actions {grid-column:1/-1;justify-content:flex-end!important;width:100%;margin:0!important;}
 html body #currentPageTitle {font-size:17px!important;}
 html body .topbar-actions .button {min-height:40px!important;padding:9px 14px!important;}
 html body .notification-button {height:40px!important;width:40px!important;}
 html body .notification-panel {top:116px!important;}
 html body .admin-view-guide {padding:12px!important;}
 html body .admin-view-guide-meta {display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;gap:8px!important;}
 html body .admin-context-chip:nth-child(2) {display:none!important;}
 html body .admin-view-guide-meta > button {margin:0!important;}
 html body .panel {padding:14px!important;}
 html body .page-heading {flex-direction:column!important;}
 html body .page-heading > * {max-width:100%;}
 html body .page-heading .button {min-height:40px!important;}
 html body .filter-field {flex-basis:100%!important;}
 html body .filter-bar > .button {flex:1 1 130px;width:auto!important;min-height:42px!important;}
 html body #view-gateway .stats-grid {grid-template-columns:1fr!important;}
 html body #view-gateway .ops-kpi-grid {grid-template-columns:1fr!important;}
 html body :is(.integration-page-tab,.kyc-filter,.record-tab,.cs-record-tab) {min-height:44px!important;}
 html body .admin-directory-link {flex-wrap:wrap;}
}
