body.control-units-page .control-units-content {
  width: min(1480px, calc(100% - 36px));
  margin: 24px auto 42px;
  padding: 0;
}

body.control-units-page #statusCard {
  display: none !important;
}

body.control-units-page .units-base-updated-row {
  margin: 0;
}

body.control-units-page .units-scope-toolbar {
  display: flex;
  margin-bottom: 12px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

body.control-units-page .units-scope-toolbar #unitsExcelBtn {
  flex: 0 0 auto;
  min-height: 40px;
}

body.control-units-page .units-scope-summary {
  display: inline-flex;
  flex-basis: 100%;
  width: fit-content;
  margin: 0 0 12px;
  padding: 7px 10px;
  align-items: center;
  gap: 6px;
  border-left: 3px solid #2563eb;
  border-radius: 4px;
  background: #eff6ff;
  color: #475569;
  font-size: 13px;
  font-weight: 700;
}

body.control-units-page .units-scope-summary strong {
  color: #1d4ed8;
  font-size: 14px;
  font-weight: 900;
}

body.control-units-page #unitsScopeSection .scope-grid > div {
  display: flex;
  min-height: 88px;
  padding: 13px 10px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
}

body.control-units-page #unitsScopeSection .scope-grid span {
  min-height: 32px;
  margin: 0 0 7px;
  color: #475569;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
}

body.control-units-page #unitsScopeSection .scope-grid strong {
  display: block;
  width: 100%;
  color: #1d4ed8;
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
}

body.control-units-page .pending-detail-btn,
body.control-units-page .completion-status {
  box-shadow: none !important;
  filter: none;
  text-shadow: none;
}

body.control-units-page .unit-modal-close {
  display: grid;
  flex: 0 0 36px;
  padding: 0 !important;
  place-items: center;
  box-shadow: none !important;
  line-height: 1;
}

body.control-units-page #unitLotsSection .table-pagination,
body.control-units-page #unitDetailsSection .table-pagination {
  margin: 12px 0 0;
}

body.control-units-page .control-units-polygon-switch {
  margin: 0 0 12px;
}

body.control-units-page .units-empty-state {
  padding: 28px 22px;
  text-align: center;
}

body.control-units-page .units-empty-state h2 {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 900;
}

body.control-units-page .units-empty-state p {
  margin: 0;
  color: #64748b;
}

body.control-units-page .server-managed-fields {
  display: none !important;
}

body.control-units-page .query-card {
  border-radius: 8px;
}

.server-credential-status {
  margin: 0 0 18px;
  padding: 10px 12px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  color: #1e40af;
  font-size: 13px;
  font-weight: 750;
}

.server-credential-status.is-ready {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.server-credential-status.is-missing {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.units-title-actions {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.units-title-actions h2 {
  margin: 0;
  color: #0f172a;
  font-size: 21px;
  font-weight: 900;
  line-height: 1.2;
}

body.dark-theme.control-units-page .units-title-actions h2 {
  color: #f8fafc;
}

@media (max-width: 700px) {
  body.control-units-page .units-scope-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  body.control-units-page .units-scope-toolbar #unitsExcelBtn {
    width: 100%;
  }
}

body.control-units-page #uTotalPendientes {
  color: #dc2626 !important;
  font-weight: 900;
}

body.control-units-page #unitLotsSection .custom-select {
  width: 100%;
}

body.control-units-page .unit-modal-backdrop {
  z-index: 0;
}

body.control-units-page .modal-panel {
  z-index: 1;
  border-radius: 8px;
}

body.dark-theme.control-units-page .server-credential-status {
  border-color: #334155;
  background: #111827;
  color: #cbd5e1;
}

body.dark-theme.control-units-page .server-credential-status.is-ready {
  border-color: rgba(74, 222, 128, .42);
  background: rgba(22, 101, 52, .2);
  color: #bbf7d0;
}

body.dark-theme.control-units-page .server-credential-status.is-missing {
  border-color: rgba(248, 113, 113, .42);
  background: rgba(127, 29, 29, .22);
  color: #fecaca;
}

body.dark-theme.control-units-page .units-scope-summary {
  border-left-color: #60a5fa;
  background: #0b244f;
  color: #cbd5e1;
}

body.dark-theme.control-units-page .units-scope-summary strong {
  color: #bfdbfe;
}

body.dark-theme.control-units-page #unitsScopeSection .scope-grid span {
  color: #cbd5e1;
}

body.dark-theme.control-units-page .graphic-file-picker,
body.dark-theme.control-units-page .scope-grid > div,
body.dark-theme.control-units-page .unit-lot-filters,
body.dark-theme.control-units-page .table-pagination,
body.dark-theme.control-units-page .modal-head,
body.dark-theme.control-units-page .modal-summary > div,
body.dark-theme.control-units-page .modal-empty {
  border-color: #334155;
  background: #0b1220;
  color: #e5edf8;
}

body.dark-theme.control-units-page .graphic-scope-options label,
body.dark-theme.control-units-page .compact-filter > span,
body.dark-theme.control-units-page .page-size-control,
body.dark-theme.control-units-page .completion-detail,
body.dark-theme.control-units-page .pending-list li,
body.dark-theme.control-units-page .modal-section h3 {
  color: #cbd5e1;
}

body.dark-theme.control-units-page tbody tr:nth-child(even),
body.dark-theme.control-units-page tbody tr:hover {
  background: #111827;
}

body.dark-theme.control-units-page #unitLotsSection .table-wrap {
  border-color: #475569 !important;
  background: #0b1220 !important;
}

body.dark-theme.control-units-page #unitLotsSection th {
  border-bottom: 1px solid #526078;
  background: #172033 !important;
  color: #e5edf8 !important;
}

body.dark-theme.control-units-page #unitLotsSection td {
  border-top-color: #3b4a60 !important;
  background: #0b1220;
  color: #e5edf8 !important;
}

body.dark-theme.control-units-page #unitLotsSection th + th,
body.dark-theme.control-units-page #unitLotsSection td + td {
  border-left-color: #3b4a60 !important;
}

body.dark-theme.control-units-page #unitLotsSection tbody tr:nth-child(even) td {
  background: #101827;
}

body.dark-theme.control-units-page #unitLotsSection tbody tr:hover td {
  background: #172036;
}

body.dark-theme.control-units-page #unitLotsSection th.ua-count-heading {
  background: #153158 !important;
  color: #bfdbfe !important;
}

body.dark-theme.control-units-page #unitLotsSection th.bc-heading {
  background: #153a36 !important;
  color: #a7f3d0 !important;
}

body.dark-theme.control-units-page td.ua-count-cell,
body.dark-theme.control-units-page td.bc-cell {
  background: #132033 !important;
  color: #bfdbfe !important;
}

body.control-units-page td.bc-cell.missing-bc-cell {
  color: var(--error) !important;
  font-weight: 900;
}

body.dark-theme.control-units-page td.bc-cell.missing-bc-cell {
  background: #35191d !important;
  color: #fca5a5 !important;
}

body.dark-theme.control-units-page td.use-missing {
  background: #35191d !important;
  color: #fecaca !important;
}

body.dark-theme.control-units-page .advance-cell.complete .advance-value,
body.dark-theme.control-units-page .completion-detail.complete {
  color: #86efac !important;
}

body.dark-theme.control-units-page .advance-cell.high .advance-value {
  color: #6ee7b7 !important;
}

body.dark-theme.control-units-page .advance-cell.medium .advance-value,
body.dark-theme.control-units-page .advance-unverified {
  color: #fcd34d !important;
}

body.dark-theme.control-units-page .advance-cell.low .advance-value,
body.dark-theme.control-units-page .completion-detail-count,
body.dark-theme.control-units-page .completion-detail.unavailable {
  color: #fca5a5 !important;
}

body.dark-theme.control-units-page .completion-detail-group strong {
  color: #bfdbfe;
}

body.dark-theme.control-units-page .completion-detail-group span {
  border-left-color: #f87171;
  background: #2b171b;
  color: #fecaca;
}

body.dark-theme.control-units-page .completion-detail-expand {
  border-top-color: #475569;
}

body.dark-theme.control-units-page .completion-detail-expand summary {
  color: #93c5fd;
}

body.dark-theme.control-units-page .pending-detail-btn {
  border-color: #a16207;
  background: #38280f;
  color: #fde68a;
}

body.dark-theme.control-units-page .pending-detail-btn:hover {
  border-color: #d97706;
  background: #493314;
}

body.dark-theme.control-units-page .lot-observation-cell.has-observations.oc {
  background: #3b2a12 !important;
  color: #fbd38d !important;
}

body.dark-theme.control-units-page .lot-observation-cell.has-observations.sicun {
  background: #172554 !important;
  color: #bfdbfe !important;
}

body.dark-theme.control-units-page .lot-observation-count {
  background: transparent !important;
  color: inherit !important;
}

body.dark-theme.control-units-page .completion-cell.complete {
  background: #123523 !important;
}

body.dark-theme.control-units-page .completion-cell.high {
  background: #152f25 !important;
}

body.dark-theme.control-units-page .completion-cell.medium {
  background: #38280f !important;
}

body.dark-theme.control-units-page .completion-cell.low,
body.dark-theme.control-units-page .completion-cell.unverified {
  background: #35191d !important;
}

body.dark-theme.control-units-page .completion-cell.empty {
  background: #0b1220 !important;
}

body.dark-theme.control-units-page .unit-table-sort-btn:hover,
body.dark-theme.control-units-page .unit-table-sort-btn.active {
  background: #1e293b;
  color: #93c5fd;
}

body.dark-theme.control-units-page .modal-panel,
body.dark-theme.control-units-page .unit-modal-close,
body.dark-theme.control-units-page .page-button {
  border-color: #334155;
  background: #111827;
  color: #e5edf8;
}

body.dark-theme.control-units-page .pending-group,
body.dark-theme.control-units-page .pending-group-title {
  border-color: #334155;
  background: #162033;
  color: #bfdbfe;
}

@media (max-width: 700px) {
  body.control-units-page .control-units-content {
    width: min(100% - 20px, 1480px);
    margin-top: 14px;
  }

  body.control-units-page .card {
    padding: 16px;
  }

  body.control-units-page #unitLotsSection,
  body.control-units-page #unitDetailsSection {
    min-width: 0;
    overflow: hidden;
  }

  body.control-units-page #unitLotsSection .table-wrap,
  body.control-units-page #unitDetailsSection .table-wrap {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y;
  }

  body.control-units-page #unitLotsSection table,
  body.control-units-page #unitDetailsSection table {
    display: table;
    min-width: 1380px;
  }

  .units-title-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .units-title-actions .btn {
    width: 100%;
  }
}
