/* Every data table gets one independent scroll area and the same sticky layers. */
.geoarr-table-scroll { overflow: auto; max-width: 100%; max-height: 65vh; position: relative; }
body .geoarr-table-scroll table { width: max-content; min-width: 100% !important; table-layout: auto; border-collapse: separate; border-spacing: 0; }
body .geoarr-table-scroll th, body .geoarr-table-scroll td { white-space: nowrap; padding: 6px 10px; background: #fff; }
body .geoarr-table-scroll th { position: sticky; top: 0; z-index: 3; background: #f3f7f5; }
body .geoarr-table-scroll th:first-child, body .geoarr-table-scroll td:first-child { position: sticky; left: 0; z-index: 2; background: #fff; }
body .geoarr-table-scroll th:first-child { z-index: 5; background: #f3f7f5; }
body .geoarr-table-scroll button { min-height: 0; padding: 3px 7px; }
.geoarr-table-search { display: block; margin: 8px 0; }
.geoarr-table-search input { max-width: 24rem; }

body:not([data-page="glovo"]) .geoarr-table-scroll :is(a,button) { min-width: 0; min-height: 0; padding: 3px 7px; }
body .geoarr-table-scroll td > small, body .geoarr-table-scroll td > a { display: inline; }

#rsge-collection-status .collection-overview { position: sticky; top: 0; z-index: 6; background: #fff; padding: .5rem 0; }
#collection-batch-table progress { width: 8rem; vertical-align: middle; }

/* The selection box scrolls away; the first data column remains visible. */
body .geoarr-table-scroll table[data-identity-column="2"] td:first-child { position: static; }
body .geoarr-table-scroll table[data-identity-column="2"] th:first-child { left: auto; z-index: 3; }
body .geoarr-table-scroll table[data-identity-column="2"] :is(th,td):nth-child(2) { position: sticky; left: 0; z-index: 2; background: #fff; }
body .geoarr-table-scroll table[data-identity-column="2"] th:nth-child(2) { z-index: 5; background: #f3f7f5; }
.stage-toolbar { display: flex; align-items: center; gap: 8px; overflow-x: auto; max-width: 100%; padding: 6px 0; }
.stage-toolbar::-webkit-scrollbar { height: 7px; }
.stage-toolbar::-webkit-scrollbar-thumb { background: #9bb5a6; border-radius: 6px; }
.stage-toolbar form, .stage-toolbar section { display: flex; align-items: center; gap: 6px; flex: none; }
.stage-toolbar label { display: inline-flex; align-items: center; gap: 4px; margin: 0; white-space: nowrap; }
.stage-toolbar select { width: auto; max-width: 150px; min-width: 90px; margin: 0; padding: 5px; }
.stage-toolbar button { flex: none; white-space: nowrap; padding: 6px 9px; }
.stage-toolbar span { white-space: nowrap; }
.mobile-menu { display: none; }
/* Review 29.11: below 1200 px (768 included) the side navigation collapses into a top bar with an accessible menu
   button, so the page content starts at the top and tables get the full width. */
@media (max-width: 1199px) {
  body .sidebar.geoarr-sidebar { position: relative !important; inset: auto; width: 100% !important; display: flex !important; flex-direction: row !important; align-items: center; gap: 12px; padding: 8px 14px !important; }
  body .sidebar.geoarr-sidebar > .brand { margin: 0 !important; font-size: 18px; }
  body .sidebar.geoarr-sidebar > .desktop-menu { display: none; }
  body .sidebar.geoarr-sidebar .mobile-menu { display: block; margin-left: auto; position: relative; }
  body .sidebar.geoarr-sidebar .mobile-menu summary { cursor: pointer; padding: 9px 12px; border: 1px solid #dce5df; border-radius: 8px; }
  body .sidebar.geoarr-sidebar .mobile-menu nav { position: absolute; right: 0; top: 100%; z-index: 30; min-width: 220px; display: block; padding: 8px; background: #fff; border: 1px solid #dce5df; box-shadow: 0 5px 18px #16241d22; }
  body .sidebar.geoarr-sidebar .sidebar-bottom { position: static; margin: 0; padding: 0; border: 0; }
  body .sidebar.geoarr-sidebar .sidebar-bottom p, body .sidebar.geoarr-sidebar .sidebar-bottom span { display: none; }
  body .sidebar.geoarr-sidebar .sidebar-bottom button { padding: 8px; }
  body .workspace { margin-left: 0; max-width: 100%; padding: 0 24px 30px; }
  body .sidebar.geoarr-sidebar { height: auto !important; bottom: auto !important; overflow: visible !important; border-right: 0 !important; border-bottom: 1px solid #E2E8E5; z-index: 120 !important; }
  body .sidebar.geoarr-sidebar .global-upload-button { margin: 0; width: auto; min-height: 40px; padding: 6px 14px; }
  body .sidebar.geoarr-sidebar .mobile-menu summary { list-style: none; min-height: 40px; display: flex; align-items: center; gap: 6px; font-weight: 600; background: #fff; }
  body .sidebar.geoarr-sidebar .mobile-menu summary::-webkit-details-marker { display: none; }
  body .sidebar.geoarr-sidebar .mobile-menu[open] summary { background: #E6F1EB; border-color: #1F6B4A; }
  body .sidebar.geoarr-sidebar .mobile-menu summary:focus-visible { outline: 3px solid #1F6B4A; outline-offset: 2px; }
  body .sidebar.geoarr-sidebar .mobile-menu nav { border-radius: 12px; }
  body .sidebar.geoarr-sidebar .mobile-menu .nav-item { margin: 0 0 4px; }
}
@media (max-width: 700px) { body .workspace { padding: 0 14px 30px; } body .sidebar.geoarr-sidebar .global-upload-button { padding: 6px 10px; } }
.work-plan { margin: 12px 0; min-width: 0; }
.work-plan .panel-heading { display: flex; flex-wrap: wrap; gap: 8px; }
.work-plan .panel-heading h1 { font-size: 21px; margin: 0; }
.work-plan .plan-note { margin: 4px 0; font-size: 12px; }
.plan-filters { display: flex; align-items: end; flex-wrap: wrap; gap: 8px; }
body:not([data-page="glovo"]) .plan-filters label { margin: 0; }
body:not([data-page="glovo"]) .plan-filters :is(input:not([type="checkbox"]), select) { min-height: 34px; padding: 4px 8px; margin: 2px 0 0; width: auto; max-width: 180px; }
body:not([data-page="glovo"]) .plan-filters .plan-check { min-height: 34px; }
body:not([data-page="glovo"]) .plan-filters button { min-height: 34px; padding: 5px 9px; }
#plan-table th button { font-weight: 600; background: transparent; border: 0; }
#plan-table .plan-group td { background: #e8f1ec; font-weight: 600; }
#plan-table .plan-blocker { color: #9d1c1c; font-weight: 700; }
.plan-stage-bar { display: flex; height: 7px; min-width: 120px; overflow: hidden; border-radius: 4px; }
.plan-stage-bar span { flex-basis: 0; } .plan-stage-1 { background: #89a5aa; } .plan-stage-2 { background: #db8e42; }
.plan-stage-3 { background: #bdaf43; } .plan-stage-4 { background: #56a9a2; } .plan-stage-5 { background: #a57cbf; }
.plan-stage-6 { background: #6990c7; } .plan-stage-7 { background: #d07668; } .plan-stage-8 { background: #46885e; }
.plan-stage-counts { font-size: 11px; }
body[data-page="workspace"] .pipeline-columns { display: flex; flex-wrap: nowrap; gap: 6px; overflow-x: auto; }
body[data-page="workspace"] .pipeline-column { flex: 0 0 auto; padding: 3px; }
body[data-page="workspace"] .pipeline-column button { display: flex; align-items: center; gap: 8px; min-height: 36px; white-space: nowrap; font-size: 13px; }
body[data-page="workspace"] .pipeline-column button :is(strong,span) { display: inline; }
#collection-shell { margin: 12px 0; }
#collection-shell > summary { cursor: pointer; background: #e8f1ec; padding: 8px 12px; border-radius: 8px; }

#plan-table .plan-original { font-size: 12px; font-weight: normal; white-space: normal; min-width: 220px; }
#plan-table .plan-original summary { cursor: pointer; }
#plan-table .plan-original section { padding: 5px; border-top: 1px solid #dce5df; }
#plan-table .plan-original section div { white-space: pre-wrap; overflow-wrap: anywhere; }
#plan-table .plan-original-unavailable { display: block; color: #66736c; font-size: 11px; }
#plan-table .plan-source-header { display: flex; gap: 4px; overflow-x: auto; }
#plan-table .plan-source-header span { flex: none; white-space: pre-wrap; border-right: 1px solid #dce5df; padding: 0 3px; }

#plan-table [data-plan-original][hidden] { display: none !important; }
#plan-table [data-plan-info][hidden] { display: none !important; }
#plan-table .plan-info-first { border-left: 3px solid #54796a; }
#plan-table .plan-original-value { display: block; white-space: pre-wrap; }
#plan-table .plan-original-value + .plan-original-value { border-top: 1px solid #e3e9e5; }
.plan-original-toggle { display: inline-flex; gap: 6px; align-items: center; margin: 6px 0; }
.work-plan label.plan-original-toggle { width: auto; margin-right: 18px; }
.work-plan label.plan-original-toggle input[type="checkbox"] { width: auto; margin: 0; flex: 0 0 auto; }
body :is(th[data-preserve-original], th[data-preserve-original] button, [data-preserve-original] th) { text-transform: none; }

#plan-table .plan-group-toggle { color: inherit; background: transparent; border: 0; padding: 0; font-weight: 700; white-space: nowrap; }
#plan-table tr[data-group-collapsed="true"] { display: none; }

/* Keep the disabled pager explanation available to assistive technology. */
.plan-pagination .geoarr-disabled-reason { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
body .geoarr-table-scroll tr.manual-grid-mismatch td { background: #fee2e2; color: #7f1d1d; }
#stage3-table .stage3-outlier { margin-top: 4px; white-space: normal; }
#stage3-table .stage3-outlier-comment { display: inline-flex; align-items: center; gap: 5px; margin: 0; }
#stage3-table .stage3-outlier-comment input { width: 16rem; max-width: 100%; margin: 0; padding: 4px 6px; }
#stage3-table .stage3-outlier button { min-height: 0; padding: 4px 8px; font-size: 12px; }
#stage3-table .stage3-outlier-error { color: #a32626; font-weight: 600; }
