.export-layout {
  align-items: start;
}

.category-filters { display: grid; grid-template-columns: minmax(180px, 2fr) minmax(140px, 1fr) auto auto; gap: 10px; align-items: end; margin-bottom: 24px; }
.category-table { margin: 0; }
@media (max-width: 760px) { .category-filters { grid-template-columns: 1fr 1fr; } }

.jobs-overview { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.jobs-overview .eta-card { grid-column: 1 / -1; }
.eta-card > span > span { display: inline; cursor: help; }
.eta-card strong { font-size: 24px; }
.eta-card small + small { margin-top: 5px; }
.jobs-list-panel { padding: 16px; }
.jobs-list-panel .table-wrap { margin: 0; }
.jobs-list-panel [data-poll-page-fragment] > p { font-size: 11px; }
.jobs-list-panel .panel-heading small { color: var(--muted); }
.jobs-filters { display: grid; grid-template-columns: minmax(180px, 2fr) repeat(4, minmax(110px, 1fr)) auto auto; gap: 10px; align-items: end; margin-bottom: 16px; }
.jobs-filters label { display: grid; gap: 5px; color: var(--muted); font-size: 10px; font-weight: 700; }
@media (max-width: 1100px) { .jobs-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .jobs-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); } .jobs-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.export-layout .job-form {
  display: block;
}

.export-help {
  display: grid;
  gap: 20px;
}

.help-block {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.help-block p {
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.alert.success {
  border: 1px solid #9fd6be;
  background: #eaf8f1;
  color: #155c43;
}

.results-filter-bar {
  display: grid;
  grid-template-columns: repeat(6, minmax(145px, 1fr));
  gap: 13px;
  align-items: end;
}

.results-filter-bar .search-field {
  grid-column: span 2;
}

.filter-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  grid-column: span 2;
}

.results-heading > div:first-child small {
  color: var(--muted);
}

.result-actions,
.row-actions,
.source-badges {
  display: flex;
  align-items: center;
  gap: 8px;
}

.result-actions > span {
  color: var(--muted);
  font-size: 11px;
}

.select-column {
  width: 38px;
  padding-right: 4px;
  text-align: center;
}

.select-column input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.row-actions {
  align-items: flex-start;
  flex-direction: column;
  min-width: 96px;
}

.row-actions form {
  margin: 0;
}

.delete-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--red);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.delete-link.business {
  color: #6e5149;
}

.source-badges {
  flex-wrap: wrap;
}

.source-badge {
  display: inline-flex;
  padding: 4px 7px;
  border-radius: 99px;
  background: #edf1ef;
  color: #51605a;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.source-badge.maps {
  background: #e6f0ff;
  color: var(--blue);
}

.source-badge.website {
  background: var(--green-2);
  color: var(--green);
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin: 20px 0 40px;
}

.page-numbers {
  display: flex;
  align-items: center;
  gap: 6px;
}

.page-link,
.page-number {
  display: inline-grid;
  place-items: center;
  min-width: 36px;
  height: 36px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.page-number.active {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.page-link.disabled {
  opacity: .45;
}

.page-gap {
  color: var(--muted);
}

.field-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
  color: #4c5953;
  font-size: 12px;
  font-weight: 700;
}

.field-heading small {
  color: var(--muted);
  font-weight: 400;
}

.keyword-options {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.custom-keyword-builder {
  padding-top: 5px;
}

.custom-keyword-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.custom-keyword-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.custom-keyword {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 5px 5px 5px 10px;
  border: 1px solid rgba(15, 61, 94, .22);
  border-radius: 3px;
  background: rgba(15, 61, 94, .05);
  color: var(--green);
  font-size: 11px;
  font-weight: 700;
}

.custom-keyword small {
  color: var(--muted);
  font-size: 8px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.custom-keyword button {
  display: inline-grid;
  place-items: center;
  width: 23px;
  height: 23px;
  padding: 0;
  border: 0;
  border-radius: 2px;
  background: transparent;
  color: var(--muted);
  font-size: 17px;
  cursor: pointer;
}

.custom-keyword button:hover {
  background: rgba(15, 61, 94, .09);
  color: var(--red);
}

.custom-keyword.invalid {
  border-color: #fca5a5;
  background: #fef2f2;
  color: var(--red);
}

.keyword-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: #f8faf8;
  cursor: pointer;
}

.keyword-option:has(input:checked) {
  border-color: #74b79d;
  background: var(--green-2);
  color: var(--green);
}

.keyword-option input {
  width: 15px;
  height: 15px;
  margin: 0;
}

.region-builder {
  min-width: 0;
}

.place-search > label {
  margin-bottom: 7px;
}

.input-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px;
}

.place-search-results {
  display: grid;
  gap: 6px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.place-result {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.place-result:hover,
.place-result:focus {
  border-color: #74b79d;
  background: #f4faf7;
}

.region-map {
  height: 420px;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #e9eeeb;
  z-index: 0;
}

.region-map.map-unavailable {
  display: grid;
  place-items: center;
  padding: 25px;
  color: var(--muted);
  text-align: center;
}

.map-note {
  margin: 7px 0 16px;
  color: var(--muted);
  font-size: 10px;
}

.region-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.radius-field {
  display: grid;
  grid-template-columns: auto auto minmax(130px, 1fr) 86px;
  align-items: center;
  justify-content: start;
}

.radius-field input[type="range"] {
  padding: 0;
  border: 0;
  box-shadow: none;
}

.region-add-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.form-error {
  color: var(--red);
  font-size: 12px;
}

.selected-regions {
  margin-top: 18px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
}

.selected-regions-list {
  display: grid;
  gap: 8px;
}

.selected-region {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f8faf8;
}

.selected-region strong,
.selected-region small {
  display: block;
}

.selected-region small,
.empty-inline {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.remove-region {
  padding: 5px 8px;
  border: 0;
  background: transparent;
  color: var(--red);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.label-with-help {
  display: flex;
  align-items: center;
  gap: 6px;
}

.info-button {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 1px solid #aab7b0;
  border-radius: 50%;
  background: #fff;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  cursor: help;
}

.info-button::after {
  content: attr(data-help);
  position: absolute;
  z-index: 1000;
  left: 50%;
  bottom: calc(100% + 9px);
  width: min(280px, 70vw);
  padding: 10px 12px;
  border-radius: 8px;
  background: #14211c;
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.45;
  text-align: left;
  box-shadow: 0 8px 25px rgba(0, 0, 0, .2);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 4px);
  transition: .15s ease;
  pointer-events: none;
}

.info-button:hover::after,
.info-button:focus::after {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.coverage-note {
  padding: 12px 14px;
  border-left: 3px solid var(--green);
  border-radius: 0 8px 8px 0;
  background: #f3f8f5;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.coverage-note strong {
  color: var(--ink);
}

[data-poll-error="true"]::before {
  content: "Live refresh temporarily unavailable";
  display: block;
  margin-bottom: 8px;
  color: var(--red);
  font-size: 11px;
}

@media (max-width: 1100px) {
  .results-filter-bar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .form-section > .region-builder {
    grid-column: 2;
  }
}

@media (max-width: 760px) {
  .results-filter-bar,
  .results-filter-bar .search-field,
  .filter-actions {
    grid-template-columns: 1fr;
    grid-column: auto;
  }

  .pagination {
    align-items: stretch;
    flex-direction: column;
  }

  .page-numbers {
    justify-content: center;
  }
  .form-section > .region-builder,
  .span-2 {
    grid-column: auto;
  }

  .region-map {
    height: 330px;
  }

  .region-fields,
  .radius-field {
    grid-template-columns: 1fr;
  }
}

/* Trakaria operational UI ------------------------------------------------- */
:root {
  --bg: #f8fafc;
  --panel: #ffffff;
  --ink: #0b1f2a;
  --muted: #64748b;
  --line: #e2e8f0;
  --green: #0f3d5e;
  --green-2: #e6f7f5;
  --accent: #14b8a6;
  --orange: #f59e0b;
  --red: #dc2626;
  --blue: #0ea5e9;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05);
}

body {
  color: var(--ink);
  background: var(--bg);
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.sidebar {
  width: 272px;
  padding: 0 7px 12px;
  border-right: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  box-shadow: none;
  transition: width .25s ease;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 68px;
  padding: 10px 6px;
  border-bottom: 1px solid var(--line);
}

.sidebar .brand {
  min-width: 0;
  flex: 1;
  gap: 10px;
}

.sidebar .brand-mark {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border: 1px solid rgba(15, 61, 94, .2);
  border-radius: 2px;
  background: var(--bg);
  color: var(--green);
  font-size: 18px;
}

.sidebar .brand-copy {
  min-width: 0;
}

.sidebar .brand strong {
  color: var(--green);
  font-size: 13px;
}

.sidebar .brand small {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.sidebar .brand small::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.sidebar-toggle,
.filter-drawer-close {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  border-radius: 2px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.sidebar-toggle:hover,
.sidebar-toggle:focus-visible,
.filter-drawer-close:hover,
.filter-drawer-close:focus-visible {
  background: #f1f5f9;
  color: var(--green);
  outline: 2px solid transparent;
}

.sidebar-toggle svg,
.nav-icon,
.filter-drawer svg,
.results-filter-toolbar svg,
.clear-filters svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-toggle .expand-icon {
  display: none;
}

.sidebar nav {
  gap: 2px;
  margin-top: 10px;
}

.sidebar nav a {
  display: flex;
  align-items: center;
  min-height: 42px;
  gap: 11px;
  padding: 9px 12px;
  border-radius: 2px;
  color: #475569;
  font-size: 12px;
  transition: background .15s ease, color .15s ease;
}

.sidebar nav a:hover {
  background: #f1f5f9;
  color: var(--green);
}

.sidebar nav a.active {
  background: rgba(15, 61, 94, .08);
  color: var(--green);
  box-shadow: inset 3px 0 0 var(--accent);
}

.nav-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.sidebar-footer {
  padding: 12px 10px 0;
  border-top: 1px solid var(--line);
  color: #475569;
}

.sidebar-footer .link-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
}

.sidebar-footer .link-button .nav-icon {
  width: 15px;
  height: 15px;
}

.sidebar-footer .link-button:hover {
  color: var(--green);
}

.main-shell {
  margin-left: 272px;
  max-width: none;
  padding: 32px;
  transition: margin-left .25s ease;
}

body.sidebar-collapsed .sidebar {
  width: 80px;
}

body.sidebar-collapsed .main-shell {
  margin-left: 80px;
}

body.sidebar-collapsed .sidebar-header {
  justify-content: center;
  padding-inline: 0;
}

body.sidebar-collapsed .brand,
body.sidebar-collapsed .brand-copy,
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .sidebar-toggle .collapse-icon {
  display: none;
}

body.sidebar-collapsed .sidebar-toggle {
  display: inline-grid;
  width: 100%;
  height: 100%;
}

body.sidebar-collapsed .sidebar-toggle .expand-icon {
  display: block;
}

body.sidebar-collapsed .sidebar nav a {
  justify-content: center;
  min-height: 44px;
  padding: 10px;
}

body.sidebar-collapsed .sidebar-footer {
  display: flex;
  justify-content: center;
  padding: 10px 0 0;
}

body.sidebar-collapsed .sidebar-footer > .user-dot,
body.sidebar-collapsed .sidebar-footer > .sidebar-user,
body.sidebar-collapsed .sidebar-footer > small,
body.sidebar-collapsed .sidebar-footer .signout-label {
  display: none;
}

body.sidebar-collapsed .sidebar-footer form {
  grid-column: auto;
}

body.sidebar-collapsed .sidebar-footer .link-button {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 2px;
}

body.sidebar-collapsed .sidebar-footer .link-button:hover {
  background: #f1f5f9;
}

.page-header {
  align-items: center;
  margin-bottom: 22px;
}

.page-header h1 {
  margin: 3px 0 4px;
  color: #0f172a;
  font-size: 28px;
  letter-spacing: -.025em;
}

.eyebrow {
  color: var(--green) !important;
}

.panel,
.stat-card,
.worker-card {
  border-color: var(--line);
  border-radius: 3px;
  box-shadow: var(--shadow);
}

.stat-card {
  position: relative;
  overflow: hidden;
  padding: 18px;
  background: #fff;
}

.stat-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: rgba(15, 61, 94, .18);
}

.stat-card.accent {
  border-color: var(--green);
  background: linear-gradient(145deg, #0f3d5e, #0b304b);
  color: #fff;
}

.stat-card.accent::before {
  background: var(--accent);
}

.stat-card.accent span,
.stat-card.accent small {
  color: #cbd5e1;
}

.stat-card strong {
  color: #0f172a;
}

.stat-card.accent strong {
  color: #fff;
}

table th {
  background: #f1f5f9;
  color: #64748b;
}

table td {
  background: #fff;
}

table tbody tr:hover td {
  background: #f8fafc;
}

.activity-line,
.config-grid div,
.current-task,
.selected-region,
.keyword-option,
.coverage-note {
  border-radius: 3px;
}

.activity-line,
.selected-region,
.keyword-option {
  background: #fff;
}

.section-index {
  color: rgba(15, 61, 94, .28);
}

.form-section > div > p,
label,
.field-heading {
  color: #475569;
}

.config-grid div,
.current-task {
  background: #f1f5f9;
}

.config-grid .config-keywords small {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.config-grid .config-keywords small > span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #fff;
  color: #475569;
}

.config-grid .config-keywords em {
  color: var(--accent);
  font-size: 7px;
  font-style: normal;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.keyword-option:has(input:checked) {
  border-color: rgba(20, 184, 166, .55);
  background: #ccfbf1;
  color: #0f766e;
}

.coverage-note {
  border-left-color: var(--accent);
  background: rgba(20, 184, 166, .07);
}

.info-button::after {
  background: var(--green);
}

.place-result:hover,
.place-result:focus {
  border-color: rgba(20, 184, 166, .55);
  background: rgba(20, 184, 166, .06);
}

.alert.success {
  border-color: #86efac;
  background: #f0fdf4;
  color: #166534;
}

.live-pill {
  background: #ccfbf1;
  color: #0f766e;
}

.live-pill i,
.user-dot {
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(20, 184, 166, .13);
}

.worker-card {
  background: #fff;
}

.workers-panel-heading {
  align-items: center;
}

.workers-heading-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
}

.button.compact {
  min-height: 32px;
  padding-inline: 10px;
  font-size: 10px;
}

.login-visual {
  background: var(--green);
}

.login-brand .brand-mark {
  border: 1px solid rgba(15, 61, 94, .2);
  border-radius: 2px;
  background: var(--bg);
  color: var(--green);
}

.login-visual:after {
  color: rgba(20, 184, 166, .1);
}

.visual-copy p {
  color: #cbd5e1;
}

.button {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 3px;
  font-size: 12px;
  box-shadow: none;
}

.button.primary {
  background: var(--green);
  box-shadow: none;
}

.button.primary:hover {
  background: #0b304b;
}

.button.ghost,
.button.clear-filters,
.button.filter-drawer-trigger {
  border-color: var(--line);
  background: #fff;
  color: #334155;
}

.button.ghost:hover,
.button.clear-filters:hover,
.button.filter-drawer-trigger:hover {
  border-color: #cbd5e1;
  background: #f1f5f9;
  color: var(--green);
}

input,
textarea,
select {
  border-color: #cbd5e1;
  border-radius: 3px;
  color: #0f172a;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, .13);
}

/* Results filter toolbar and drawer */
.results-filter-shell {
  position: relative;
  padding: 0;
  overflow: visible;
  border-color: rgba(15, 61, 94, .22);
  background: linear-gradient(180deg, rgba(15, 61, 94, .04), rgba(20, 184, 166, .01));
}

.results-filter-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(170px, .4fr) minmax(160px, .35fr) auto auto auto;
  align-items: center;
  gap: 9px;
  padding: 11px;
}

.results-filter-toolbar label {
  display: block;
}

.results-filter-toolbar input,
.results-filter-toolbar select {
  height: 40px;
  padding-block: 0;
  background: #fff;
  font-size: 12px;
}

.search-input-wrap {
  position: relative;
  display: block;
}

.search-input-wrap svg {
  position: absolute;
  z-index: 1;
  left: 12px;
  top: 50%;
  color: var(--muted);
  transform: translateY(-50%);
  pointer-events: none;
}

.search-input-wrap input {
  padding-left: 38px;
}

.filter-drawer-trigger {
  gap: 7px;
  height: 40px;
}

.filter-drawer-trigger > span {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 99px;
  background: var(--green);
  color: #fff;
  font-size: 10px;
}

.clear-filters {
  gap: 6px;
  height: 40px;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-size: 10px;
}

.toolbar-apply {
  height: 40px;
}

.filter-drawer-backdrop {
  position: fixed;
  z-index: 1190;
  inset: 0;
  visibility: hidden;
  padding: 0;
  border: 0;
  opacity: 0;
  background: rgba(15, 61, 94, .34);
  backdrop-filter: blur(1px);
  transition: opacity .2s ease, visibility .2s ease;
}

.filter-drawer {
  position: fixed;
  z-index: 1200;
  inset: 0 0 0 auto;
  display: flex;
  width: min(94vw, 520px);
  height: 100dvh;
  flex-direction: column;
  border-left: 1px solid rgba(15, 61, 94, .22);
  background: #fff;
  box-shadow: -24px 0 70px rgba(15, 61, 94, .18);
  transform: translateX(105%);
  transition: transform .25s ease;
}

body.filter-drawer-open {
  overflow: hidden;
}

body.filter-drawer-open .filter-drawer-backdrop {
  visibility: visible;
  opacity: 1;
}

body.filter-drawer-open .filter-drawer {
  transform: translateX(0);
}

.filter-drawer-header {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 62px;
  padding: 11px 13px;
  border-bottom: 1px solid var(--line);
}

.filter-drawer-header > div {
  min-width: 0;
  flex: 1;
}

.filter-drawer-header h2 {
  margin: 2px 0 0;
  font-size: 16px;
}

.filter-drawer-icon {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 2px;
  background: var(--green);
  color: #fff;
}

.filter-drawer-close {
  border: 1px solid rgba(15, 61, 94, .2);
  color: var(--green);
}

.filter-drawer-body {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  background: rgba(248, 250, 252, .65);
}

.filter-drawer-section {
  padding: 17px 15px;
  border-bottom: 1px solid rgba(15, 61, 94, .12);
  background: #fff;
}

.filter-drawer-section h3 {
  margin: 0 0 13px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.filter-drawer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.filter-drawer-grid label {
  color: #475569;
  font-size: 10px;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.filter-drawer-grid select {
  height: 40px;
  background: #fff;
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0;
}

.filter-drawer-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: #fff;
}

/* Operational result table */
.result-panel {
  padding: 0;
}

.result-panel .results-heading {
  min-height: 76px;
  margin: 0;
  padding: 15px 17px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.selection-toolbar {
  padding: 5px 6px 5px 11px;
  border: 1px solid rgba(15, 61, 94, .18);
  border-radius: 3px;
  background: #fff;
  box-shadow: 0 5px 18px rgba(15, 61, 94, .08);
}

.selection-toolbar .selection-clear {
  min-height: 34px;
  padding-inline: 10px;
  border: 0;
  background: transparent;
  color: var(--muted);
}

.selection-toolbar .button.danger {
  min-height: 34px;
}

.result-panel .table-wrap {
  margin: 0;
}

.operational-table {
  font-size: 12px;
}

.operational-table th {
  height: 38px;
  padding: 9px 13px;
  border-top: 0;
  border-bottom: 1px solid var(--line);
  background: #f1f5f9;
  color: #64748b;
  font-size: 9px;
  letter-spacing: .09em;
}

.operational-table td {
  padding: 11px 13px;
  border-top: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.operational-table tbody tr:last-child td {
  border-bottom: 0;
}

.operational-table tbody tr:hover td {
  background: #f8fafc;
}

.operational-table tbody tr:has([data-result-checkbox]:checked) td {
  background: rgba(20, 184, 166, .07);
}

.operational-table td strong {
  color: #0f172a;
  font-size: 12px;
}

.operational-table td small {
  margin-top: 3px;
  color: #64748b;
  font-size: 10px;
}

.operational-table .email-primary {
  color: var(--green);
}

.evidence-link {
  display: inline-block;
  margin-top: 4px;
  color: var(--green);
  font-size: 10px;
  font-weight: 700;
}

.actions-column {
  width: 68px;
  text-align: right;
}

.row-action-menu {
  position: relative;
  display: inline-block;
}

.row-action-menu summary {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #fff;
  color: #475569;
  font-weight: 800;
  letter-spacing: 1px;
  cursor: pointer;
  list-style: none;
}

.row-action-menu summary::-webkit-details-marker {
  display: none;
}

.row-action-menu summary:hover {
  background: #f1f5f9;
  color: var(--green);
}

.row-action-popover {
  position: absolute;
  z-index: 50;
  top: calc(100% + 5px);
  right: 0;
  width: 170px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .14);
  text-align: left;
}

.row-action-popover form {
  margin: 0;
}

.row-action-item {
  display: block;
  width: 100%;
  padding: 8px 9px;
  border: 0;
  border-radius: 2px;
  background: transparent;
  color: #334155;
  font-size: 11px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.row-action-item:hover {
  background: #f1f5f9;
  color: var(--green);
}

.row-action-item.destructive {
  color: var(--red);
}

.source-badge,
.status,
.size {
  border-radius: 99px;
}

.source-badge.website,
.status.completed,
.status.idle {
  background: #ccfbf1;
  color: #0f766e;
}

.status.completed_flagged {
  background: #fff7ed;
  color: #c2410c;
}

.page-link,
.page-number {
  border-radius: 3px;
}

.page-number.active {
  border-color: var(--green);
  background: var(--green);
}

/* Job task table and detail drawer */
.task-panel {
  padding: 0;
  overflow: visible;
}

.task-panel-heading {
  min-height: 74px;
  margin: 0;
  padding: 14px 17px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.task-panel-heading small {
  color: var(--muted);
}

.task-filter-shell {
  margin: 0;
  border: 0;
  border-bottom: 1px solid rgba(15, 61, 94, .18);
  border-radius: 0;
  box-shadow: none;
}

.task-filter-toolbar {
  grid-template-columns: minmax(280px, 1fr) minmax(170px, .35fr) auto auto auto;
}

.task-table-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  color: #334155;
  font-size: 11px;
}

.task-table-summary small {
  color: var(--muted);
}

.task-panel .table-wrap {
  margin: 0;
}

.task-table .task-type {
  color: #475569;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.task-table-row {
  cursor: pointer;
}

.task-table-row:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: -2px;
}

.task-table .task-row-flagged td {
  background: #fffbeb;
}

.task-table .task-row-flagged:hover td {
  background: #fff7ed;
}

.row-action-trigger {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #fff;
  color: var(--green);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.row-action-trigger:hover {
  border-color: rgba(20, 184, 166, .55);
  background: rgba(20, 184, 166, .07);
}

.task-pagination {
  margin: 0;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  background: var(--bg);
}

.detail-drawer-backdrop {
  position: fixed;
  z-index: 1210;
  inset: 0;
  visibility: hidden;
  padding: 0;
  border: 0;
  opacity: 0;
  background: rgba(15, 61, 94, .34);
  backdrop-filter: blur(1px);
  transition: opacity .2s ease, visibility .2s ease;
}

.detail-drawer {
  position: fixed;
  z-index: 1220;
  inset: 0 0 0 auto;
  width: min(96vw, 620px);
  height: 100dvh;
  border-left: 1px solid rgba(15, 61, 94, .22);
  background: #fff;
  box-shadow: -24px 0 70px rgba(15, 61, 94, .18);
  transform: translateX(105%);
  transition: transform .25s ease;
}

body.detail-drawer-open {
  overflow: hidden;
}

body.detail-drawer-open .detail-drawer-backdrop {
  visibility: visible;
  opacity: 1;
}

body.detail-drawer-open .detail-drawer {
  transform: translateX(0);
}

.detail-drawer-content {
  display: flex;
  height: 100%;
  min-height: 0;
  flex-direction: column;
}

.detail-drawer-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.detail-drawer-header > div {
  min-width: 0;
  flex: 1;
}

.detail-drawer-header h2 {
  margin: 3px 0;
  font-size: 18px;
}

.detail-drawer-header p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.detail-drawer-header svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.detail-drawer-body {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  background: rgba(248, 250, 252, .65);
}

.task-detail-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.flag-reason {
  color: #c2410c;
  font-size: 11px;
  font-weight: 700;
}

.detail-section,
.checkpoint-details {
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.detail-section h3 {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.detail-list {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 9px 14px;
  margin: 0;
}

.detail-list dt {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.detail-list dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: #334155;
  font-size: 11px;
}

.task-error-detail,
.checkpoint-details pre {
  max-height: 300px;
  margin: 0;
  padding: 12px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 10px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.checkpoint-details summary {
  margin-bottom: 10px;
  color: var(--green);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.detail-drawer-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: #fff;
}

.detail-drawer-footer form {
  margin: 0;
}

.drawer-loading {
  display: grid;
  flex: 1;
  place-items: center;
  padding: 30px;
  color: var(--muted);
  text-align: center;
}

.drawer-loading.error {
  color: var(--red);
}

@media (max-width: 1280px) {
  .results-filter-toolbar {
    grid-template-columns: minmax(240px, 1fr) minmax(150px, .5fr) minmax(145px, .45fr) auto auto;
  }

  .toolbar-apply {
    display: none;
  }
}

@media (max-width: 900px) {
  .results-filter-toolbar {
    grid-template-columns: minmax(220px, 1fr) minmax(150px, .55fr) auto;
  }

  .results-filter-toolbar .toolbar-field:nth-of-type(3),
  .results-filter-toolbar .clear-filters {
    display: none;
  }
}

@media (max-width: 760px) {
  .sidebar,
  body.sidebar-collapsed .sidebar {
    position: static;
    width: 100%;
    min-height: auto;
    padding: 0 10px 9px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .sidebar-header {
    height: 58px;
    border-bottom: 0;
  }

  .sidebar-toggle {
    display: none !important;
  }

  body.sidebar-collapsed .brand {
    display: flex;
  }

  body.sidebar-collapsed .brand-copy,
  body.sidebar-collapsed .nav-label {
    display: block;
  }

  .sidebar .brand-mark {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }

  .sidebar nav,
  body.sidebar-collapsed .sidebar nav {
    display: flex;
    gap: 4px;
    margin-top: 0;
    overflow-x: auto;
  }

  .sidebar nav a,
  body.sidebar-collapsed .sidebar nav a {
    justify-content: flex-start;
    min-width: max-content;
    min-height: 36px;
    padding: 7px 10px;
  }

  .sidebar-footer,
  body.sidebar-collapsed .sidebar-footer {
    display: none;
  }

  .main-shell,
  body.sidebar-collapsed .main-shell {
    margin-left: 0;
    padding: 22px 13px;
  }

  .results-filter-toolbar {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .task-filter-toolbar {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .results-filter-toolbar .toolbar-field,
  .results-filter-toolbar .clear-filters,
  .toolbar-apply {
    display: none;
  }

  .filter-drawer-trigger {
    min-width: 44px;
    padding-inline: 11px;
    font-size: 0;
  }

  .filter-drawer-trigger > span {
    font-size: 10px;
  }

  .filter-drawer {
    inset: auto 0 0;
    width: 100%;
    height: min(92dvh, 760px);
    border-top: 1px solid rgba(15, 61, 94, .22);
    border-left: 0;
    box-shadow: 0 -20px 60px rgba(15, 61, 94, .18);
    transform: translateY(105%);
  }

  body.filter-drawer-open .filter-drawer {
    transform: translateY(0);
  }

  .detail-drawer {
    inset: auto 0 0;
    width: 100%;
    height: min(94dvh, 820px);
    border-top: 1px solid rgba(15, 61, 94, .22);
    border-left: 0;
    box-shadow: 0 -20px 60px rgba(15, 61, 94, .18);
    transform: translateY(105%);
  }

  body.detail-drawer-open .detail-drawer {
    transform: translateY(0);
  }

  .filter-drawer-grid {
    grid-template-columns: 1fr;
  }

  .results-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .workers-panel-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .workers-heading-actions {
    width: 100%;
    justify-content: space-between;
  }

  .result-actions {
    width: 100%;
    justify-content: space-between;
  }

  .operational-table {
    display: block;
    min-width: 0;
    width: 100%;
  }

  .operational-table thead {
    display: none;
  }

  .operational-table tbody {
    display: grid;
    gap: 10px;
    padding: 10px;
  }

  .operational-table tbody tr {
    position: relative;
    display: block;
    overflow: visible;
    border: 1px solid var(--line);
    border-radius: 3px;
    background: #fff;
    box-shadow: var(--shadow);
  }

  .operational-table tbody td {
    display: grid;
    min-width: 0;
    grid-template-columns: minmax(90px, .38fr) minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    white-space: normal;
    text-align: left;
  }

  .operational-table tbody td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
  }

  .operational-table tbody td[data-label="Business"] {
    display: block;
    padding-right: 50px;
    background: rgba(15, 61, 94, .06);
  }

  .operational-table tbody td[data-label="Business"]::before {
    display: none;
  }

  .operational-table tbody .select-column {
    position: absolute;
    z-index: 2;
    top: 10px;
    right: 10px;
    display: block;
    width: auto;
    padding: 0;
    border: 0;
    background: transparent;
  }

  .operational-table tbody .select-column::before {
    display: none;
  }

  .operational-table tbody td:last-child {
    border-bottom: 0;
  }

  .actions-column {
    width: auto;
    text-align: left;
  }

  .row-action-popover {
    right: auto;
    left: 0;
  }

  .detail-list {
    grid-template-columns: 100px minmax(0, 1fr);
  }
}
.page-loading[hidden] { display: none; }
.page-loading {
  position: fixed;
  z-index: 10000;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .65rem 1rem;
  border: 1px solid #dbe2ea;
  border-radius: .6rem;
  background: #fff;
  color: #24334b;
  box-shadow: 0 6px 24px rgba(25, 40, 65, .16);
  font-weight: 600;
  pointer-events: none;
}
.page-loading-spinner {
  width: 1rem;
  height: 1rem;
  border: 2px solid #d6e0ef;
  border-top-color: #365cba;
  border-radius: 50%;
  animation: page-loading-spin .7s linear infinite;
}
@keyframes page-loading-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .page-loading-spinner { animation-duration: 1.5s; } }
