.customs-toolbar-actions {
  margin: -4px 0 12px;
}

.customs-importer-chip-list {
  align-items: center;
}

.customs-chip-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  flex-wrap: wrap;
}

.customs-entry-list {
  display: grid;
  gap: 8px;
}

.customs-entry-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
}

.customs-entry-main {
  width: 100%;
  min-height: 52px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 3px;
  padding: 10px 12px;
  border-radius: 14px;
  text-align: left;
}

.customs-entry-title {
  display: block;
  width: 100%;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
  word-break: break-word;
}

.customs-entry-sub {
  display: block;
  width: 100%;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  word-break: break-word;
}

.customs-entry-action {
  min-width: 64px;
  min-height: 52px;
  border-radius: 14px;
  align-self: stretch;
}

.customs-fold {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(246, 249, 247, 0.88);
  overflow: hidden;
}

.customs-fold summary {
  cursor: pointer;
  list-style: none;
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
}

.customs-fold summary::-webkit-details-marker {
  display: none;
}

.customs-run-fold,
.customs-run-status-fold {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(243, 248, 246, 0.94));
}

.customs-run-fold-summary,
.customs-run-status-fold summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.customs-run-fold-summary::after,
.customs-run-status-fold summary::after {
  content: "▾";
  font-size: 12px;
  color: var(--muted);
  transition: transform 160ms ease;
}

.customs-run-fold[open] .customs-run-fold-summary::after,
.customs-run-status-fold[open] summary::after {
  transform: rotate(180deg);
}

.customs-run-fold-body,
.customs-run-status-panel {
  padding: 0 14px 14px;
}

.customs-run-status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.customs-run-status-grid div {
  border: 1px solid rgba(15, 118, 110, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
  padding: 12px;
  display: grid;
  gap: 4px;
}

.customs-run-status-grid span,
.customs-run-task-meta span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.customs-run-status-grid strong,
.customs-run-task-head strong {
  font-size: 14px;
  line-height: 1.4;
}

.customs-runs-workbench {
  width: min(1320px, calc(100vw - 28px));
  max-width: min(1320px, calc(100vw - 28px));
}

.customs-runs-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

#customsRunsModalMeta {
  display: none;
}

.customs-runs-modal-content {
  min-height: 420px;
  max-height: calc(100vh - 220px);
  overflow: hidden;
}

.customs-runs-workbench-grid {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 18px;
  min-height: 420px;
  height: 100%;
  min-height: 0;
}

.customs-runs-sidebar {
  border: 1px solid rgba(15, 118, 110, 0.12);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(244, 249, 247, 0.96), rgba(255, 255, 255, 0.92));
  padding: 14px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  min-height: 0;
  max-height: 100%;
}

.customs-runs-sidebar-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--primary-dark);
  letter-spacing: 0.02em;
}

.customs-runs-sidebar-list {
  display: grid;
  gap: 10px;
  overflow: auto;
  padding-right: 4px;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(15, 118, 110, 0.32) rgba(215, 224, 220, 0.42);
}

.customs-runs-sidebar-list::-webkit-scrollbar,
.customs-run-task-list::-webkit-scrollbar {
  width: 10px;
}

.customs-runs-sidebar-list::-webkit-scrollbar-track,
.customs-run-task-list::-webkit-scrollbar-track {
  background: rgba(215, 224, 220, 0.42);
  border-radius: 999px;
}

.customs-runs-sidebar-list::-webkit-scrollbar-thumb,
.customs-run-task-list::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(15, 118, 110, 0.64), rgba(15, 118, 110, 0.3));
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.56);
}

.customs-run-nav {
  width: 100%;
  text-align: left;
  border: 1px solid rgba(15, 118, 110, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  padding: 12px;
  display: grid;
  gap: 6px;
  transition: border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.customs-run-nav:hover {
  transform: translateY(-1px);
  border-color: rgba(15, 118, 110, 0.26);
  box-shadow: 0 12px 24px rgba(15, 118, 110, 0.08);
}

.customs-run-nav.active {
  border-color: rgba(15, 118, 110, 0.42);
  background: linear-gradient(135deg, rgba(223, 244, 239, 0.82), rgba(255, 255, 255, 0.96));
  box-shadow: 0 16px 28px rgba(15, 118, 110, 0.12);
}

.customs-run-nav-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.customs-run-nav-main {
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
}

.customs-run-nav-sub {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.customs-runs-main {
  border: 1px solid rgba(15, 118, 110, 0.12);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 249, 247, 0.94));
  padding: 14px;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
  overflow: hidden;
  min-height: 0;
}

.customs-runs-main-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.customs-runs-main-actions {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.customs-runs-main-actions.has-resume {
  align-items: center;
}

.customs-inline-resume {
  display: flex;
  align-items: center;
  gap: 8px;
}

.customs-inline-resume-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.customs-inline-resume-manual {
  display: flex;
  align-items: center;
  gap: 8px;
}

.customs-inline-resume-manual input {
  width: 88px;
  min-height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(15, 118, 110, 0.16);
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.92);
}

.customs-runs-main-head h3 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
}

.customs-runs-main-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.customs-run-summary-inline,
.customs-task-metrics-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.customs-metric-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(15, 118, 110, 0.12);
  background: rgba(255, 255, 255, 0.84);
  min-width: 0;
}

.customs-metric-chip em {
  font-style: normal;
  color: var(--muted);
  font-size: 11px;
}

.customs-metric-chip strong {
  font-size: 14px;
  line-height: 1.2;
  color: var(--ink);
}

.customs-metric-chip.success {
  border-color: rgba(34, 197, 94, 0.2);
  background: rgba(236, 253, 243, 0.9);
}

.customs-metric-chip.warning {
  border-color: rgba(217, 119, 6, 0.2);
  background: rgba(255, 251, 235, 0.92);
}

.customs-failure-panel {
  border: 1px solid rgba(217, 119, 6, 0.16);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 251, 235, 0.96), rgba(255, 247, 237, 0.92));
  padding: 0;
  overflow: hidden;
}

.customs-failure-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  list-style: none;
  cursor: pointer;
  padding: 12px 14px;
}

.customs-failure-head::-webkit-details-marker {
  display: none;
}

.customs-failure-head strong {
  font-size: 15px;
  color: #9a3412;
}

.customs-failure-head span {
  font-size: 12px;
  color: #b45309;
}

.customs-failure-body {
  display: grid;
  gap: 12px;
  padding: 0 14px 14px;
}

.customs-failure-run-reason {
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(217, 119, 6, 0.12);
  padding: 11px 12px;
  color: #7c2d12;
  font-size: 13px;
  line-height: 1.6;
}

.customs-failure-run-reason.success {
  border-color: rgba(22, 163, 74, 0.18);
  background: rgba(240, 253, 244, 0.9);
  color: #166534;
}

.customs-failure-list {
  display: grid;
  gap: 10px;
}

.customs-failure-item {
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(217, 119, 6, 0.12);
  padding: 12px;
  display: grid;
  gap: 8px;
}

.customs-failure-item-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
}

.customs-failure-item-head strong {
  color: #9a3412;
  font-size: 14px;
}

.customs-failure-item-head span {
  color: var(--muted);
  font-size: 12px;
}

.customs-failure-item-body,
.customs-failure-empty {
  color: #7c2d12;
  font-size: 12px;
  line-height: 1.6;
  word-break: break-word;
}

.customs-runs-task-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
  min-height: 0;
  overflow: auto;
  padding-right: 6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(15, 118, 110, 0.32) rgba(215, 224, 220, 0.42);
}

.customs-runs-task-panel::-webkit-scrollbar {
  width: 8px;
}

.customs-runs-task-panel::-webkit-scrollbar-track {
  background: rgba(215, 224, 220, 0.42);
  border-radius: 999px;
}

.customs-runs-task-panel::-webkit-scrollbar-thumb {
  background: rgba(15, 118, 110, 0.32);
  border-radius: 999px;
}

.customs-runs-task-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.customs-runs-task-head strong {
  font-size: 15px;
}

.customs-runs-task-head span {
  color: var(--muted);
  font-size: 12px;
}

.customs-run-task-groups {
  display: grid;
  gap: 12px;
  min-height: 0;
}

.customs-task-tabs {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
}

.customs-task-tab {
  border: 1px solid rgba(15, 118, 110, 0.14);
  background: rgba(255, 255, 255, 0.84);
  color: var(--muted);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.customs-task-tab.active {
  border-color: rgba(15, 118, 110, 0.28);
  background: rgba(223, 244, 239, 0.88);
  color: var(--primary-dark);
}

.customs-run-task-group {
  display: grid;
  gap: 10px;
  min-height: 0;
}

.customs-run-task-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 0 4px;
}

.customs-run-task-group-head strong {
  font-size: 14px;
}

.customs-run-task-group-head span {
  color: var(--muted);
  font-size: 12px;
}

.customs-task-group-empty {
  border: 1px dashed rgba(15, 118, 110, 0.18);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  padding: 18px 16px;
  color: var(--muted);
  font-size: 13px;
}

.customs-run-task-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  min-height: 0;
}

.customs-run-task-item {
  border: 1px solid rgba(15, 118, 110, 0.12);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(244, 248, 246, 0.92));
  padding: 12px;
  display: grid;
  gap: 10px;
  min-width: 0;
}

.customs-run-task-item.is-failed {
  border-color: rgba(217, 119, 6, 0.18);
  background: linear-gradient(180deg, rgba(255, 251, 235, 0.96), rgba(255, 247, 237, 0.92));
}

.customs-run-task-item.is-success {
  border-color: rgba(34, 197, 94, 0.14);
}

.customs-run-task-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.customs-run-task-title {
  display: grid;
  gap: 4px;
}

.customs-run-task-title .sub {
  color: var(--muted);
  font-size: 12px;
}

.customs-run-task-products span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.customs-run-task-products strong {
  font-size: 15px;
  line-height: 1.4;
  color: var(--ink);
}

.customs-run-task-products {
  border: 1px dashed rgba(15, 118, 110, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  padding: 12px;
  display: grid;
  gap: 6px;
  min-width: 0;
}

.customs-run-task-products strong,
.customs-run-nav-sub,
.customs-runs-main-head h3,
.customs-runs-main-head p {
  word-break: break-word;
}

.customs-run-task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.customs-resume-grid {
  margin-top: 12px;
  align-items: end;
}

.customs-country-modal-importers {
  display: grid;
  gap: 10px;
  padding: 0 14px 14px;
}

.customs-country-modal-importer-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding-top: 10px;
  border-top: 1px dashed rgba(15, 118, 110, 0.16);
}

.customs-country-modal-importer-row strong {
  display: block;
  line-height: 1.4;
}

.customs-country-modal-importer-row p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.login-card.customs-importer-modal-panel {
  width: min(1180px, calc(100vw - 28px));
  max-width: min(1180px, calc(100vw - 28px));
  min-height: min(760px, calc(100vh - 32px));
  max-height: calc(100vh - 24px);
  padding: 24px;
  overflow: hidden;
}

.login-card.customs-runs-modal-panel {
  width: min(1320px, calc(100vw - 28px));
  max-width: min(1320px, calc(100vw - 28px));
  min-height: min(760px, calc(100vh - 32px));
  max-height: calc(100vh - 20px);
  overflow: hidden;
}

@media (max-width: 1180px) {
  .customs-runs-workbench-grid {
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .customs-run-task-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.customs-run-inline-actions {
  align-items: center;
}

.customs-importer-modal-head {
  margin-bottom: 12px;
}

.customs-importer-modal-body {
  display: grid;
  gap: 12px;
  max-height: min(72vh, 720px);
  overflow: auto;
  padding-right: 6px;
}

.customs-importer-modal-item {
  gap: 10px;
}

.customs-modal-product-card {
  border-radius: 18px;
  border: 1px solid rgba(15, 118, 110, 0.12);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 248, 246, 0.96));
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
  padding: 16px 18px;
}

.customs-modal-product-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: flex-start;
  gap: 12px;
}

.customs-modal-product-main {
  display: grid;
  gap: 4px;
}

.customs-modal-product-side {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.customs-modal-records {
  display: grid;
  gap: 10px;
  padding: 0 2px 2px;
}

.customs-modal-record {
  display: grid;
  gap: 6px;
  padding: 12px 0 0;
  border-top: 1px dashed rgba(15, 118, 110, 0.16);
}

.customs-modal-record strong {
  line-height: 1.45;
  color: var(--ink);
}

.customs-modal-record-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.customs-modal-record-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
}

.customs-modal-record-fragment {
  min-width: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(15, 118, 110, 0.06);
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.55;
  word-break: break-word;
}

.customs-modal-record-fragment.full {
  grid-column: 1 / -1;
}

.customs-modal-record-date {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

