/* ======== LAYOUT BASE (VERSÃO SEM TRANSIÇÕES PESADAS) ======== */
/* Removidas transições que afetam performance (all, transform, box-shadow em muitos elementos).
   Mantive apenas animações necessárias e leves (ex.: progress bar). */
:root {
  --primary: #0b5d1e;
  --primary-soft: #e6f2e8;
  --accent: #2d4a7a;
  --bg: #f4f7fb;
  --card: #ffffff;
  --border: #d0d7e1;
  --muted: #666;
  --radius: 8px;
  --shadow: 0px 2px 8px rgba(0, 0, 0, 0.1);
  --grad-subtle: linear-gradient(
    180deg,
    rgba(245, 250, 240, 1) 0%,
    rgba(230, 242, 232, 1) 50%
  );
}

body {
  font-family: "Segoe UI", Arial, sans-serif;
  margin: 0;
  padding: 0;
  background: var(--bg);
  font-size: 14px;
  overflow: hidden;
}

/* ======== TOP BAR ======== */
.top-bar {
  height: 60px;
  background: linear-gradient(180deg, var(--primary), #0a4e1a);
  color: white;
  display: flex;
  align-items: center;
  padding: 0 10px;
  font-size: 20px;
  font-weight: 600;
  box-shadow: var(--shadow);
  /* transition removida para melhorar performance */
}

.top-bar-text {
  margin-left: 10px;
}
.top-bar img {
  height: 50px;
}

/* ======== TRANSITIONS (REMOVIDAS/REDUZIDAS) ======== */
.container {
  display: flex;
  height: calc(100vh - 60px);
  background: #f7f9fc;
  border-radius: 12px;
  padding: 12px;
  gap: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  /* transition removida */
}

.table-main-container {
  background: white;
  border-radius: 12px;
  overflow: visible;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  /* transition removida */
}

.table-body td {
  padding: 12px 14px;
  border-bottom: 1px solid #f7f7f7;
  color: #2d3748;
  font-size: 14px;
}

.table-body tr:hover {
  background: #f0f0f0;
  cursor: pointer;
  /* removido hover transform/transition para reduzir repaint */
}

.table-body tr.selected {
  background: #d7e7ff;
  border-left: 4px solid #2ae863;
}

/* CONTAINER SEM/COM EMAILS */
.container:not(.with-emails) .left {
  width: 100%;
}
.container.with-emails .left {
  width: 50%;
}
.container.with-emails .emails-panel {
  width: 55%;
  display: flex;
  flex-direction: column;
  padding: 20px;
  box-sizing: border-box;
  min-width: 820px;
}

.left {
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.emails-panel {
  display: none;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 20px;
  overflow-y: hidden;
  flex-direction: column;
  /* transition removida */
}

/* ======== TABS ======== */
.tabs {
  display: flex;
  margin-bottom: 16px;
  border-bottom: none;
  gap: 8px;
  align-items: flex-end;
}
.tab {
  padding: 10px 20px;
  background: transparent;
  border: none;
  border-radius: var(--radius) var(--radius) 0 0;
  margin-right: 4px;
  cursor: pointer;
  font-weight: 600;
  color: var(--muted);
  position: relative;
  /* kept simple - no transition */
}

.tab.active {
  background: transparent;
  color: var(--primary);
}
.tab.active::after {
  content: "";
  position: absolute;
  height: 3px;
  left: 0;
  right: 0;
  bottom: -2px;
  background: var(--primary);
  border-radius: 3px;
}
.tab:hover:not(.active) {
  background: #f0f0f0;
}

.tab-content {
  display: none;
  flex: 1;
  overflow: auto;
}
.tab-content.active {
  display: flex;
  flex-direction: column;
}

/* ======== SEARCH AREA ======== */
.search-and-filters {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  gap: 16px;
}
.search-box {
  flex: 1;
  max-width: 640px;
}

.search-input-group {
  display: flex;
  gap: 8px;
  align-items: center;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px; /* removed shadow transition */
}

.search-input-group input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 14px;
  padding: 6px;
}

.search-input-group button {
  padding: 8px 12px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  white-space: nowrap;
  /* transition removed to avoid repaints on hover */
}

.search-input-group button:hover {
  background: #094a17;
}

/* ======== TABLE ======== */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
th {
  background: linear-gradient(180deg, var(--primary-soft), #f1faf4);
  color: var(--primary);
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 700;
  padding: 12px 8px;
  border-bottom: 2px solid var(--primary);
  text-align: center;
  vertical-align: middle;
}

td {
  padding: 12px 8px;
  border-bottom: 1px solid #eee;
  text-align: center;
  vertical-align: middle;
}
tr:hover {
  background: #ffffff;
  cursor: pointer;
}

/* ======== STATUS ICONS ======== */
.status-container {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 4px 0;
}
.status-icon {
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  width: 24px;
  height: 24px; /* transition removed */
}
.status-icon:hover {
  background: #e0e0e0; /* removed transform */
}
.status-icon.check {
  color: #0a4a18;
}
.status-icon.in-progress {
  color: #aa6600;
}
.status-icon.cancel {
  color: #aa3300;
}

.status-text {
  padding: 6px 12px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  cursor: pointer;
  display: inline-block; /* removed transition */
}
.status-text.treated {
  background: #c9f7d2;
  color: #0a4a18;
  border: 1px solid #0b5d1e;
}
.status-text.in-progress {
  background: #fff4d6;
  color: #aa6600;
  border: 1px solid #aa6600;
}
.status-text.untreated {
  background: #ffe6d6;
  color: #aa3300;
  border: 1px solid #cc4400;
}
.status-text:hover {
  box-shadow: none; /* removed transform/transition */
}

input[type="text"],
textarea {
  padding: 8px;
  font-size: 14px;
  width: 320px;
  border: 2px solid #ccc;
  border-radius: 6px;
}

button {
  padding: 8px 14px;
  font-size: 14px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer; /* removed transition */
}
button:hover {
  background: #094a17;
}

/* ======== DETAILS PANEL ======== */
.details-panel {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  background: white;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}
.details-panel h3 {
  margin-top: 2px;
  margin-bottom: 2px;
  font-size: 15px;
}

.process-data-box {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 18px;
  margin-bottom: 16px;
}

.details-panel table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
}
.details-panel table td:first-child {
  color: var(--primary);
  width: 140px;
  text-align: left;
  font-weight: 600;
}
.details-panel table td {
  text-align: left;
  padding: 8px 4px;
  border-bottom: 1px solid #eee;
}

.details-panel table tr:nth-child(4) td:nth-child(2) {
  text-transform: uppercase;
}
.details-panel table tr:nth-child(4) td:nth-child(2)::first-letter {
  text-transform: uppercase;
}

#detailsStatusContainer {
  margin: 16px 0;
  padding: 12px;
  border: 1px solid #e0e0e0;
  border-radius: var(--radius);
  background: #f9f9f9;
}
#detailsStatusContainer .status-container {
  justify-content: flex-start;
}
.status-timestamp {
  font-size: 12px;
  color: #666;
  font-style: italic;
  margin-top: 4px;
  padding: 4px 8px;
  background: #f5f5f5;
  border-radius: 4px;
  display: inline-block;
}

/* ======== EMAIL CONTAINER ======== */
.emails-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
  overflow-y: auto;
  padding: 0;
}
.email-card {
  width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch; /* removed transition and transform */
  flex-shrink: 0;
}
.email-card:hover {
  z-index: 2; /* removed transform */
}

.email-header {
  display: flex;
  gap: 12px;
  align-items: center;
  padding-bottom: 8px;
  border-bottom: 1px solid #e0e0e0;
  flex-wrap: wrap;
}
.email-date {
  color: var(--primary);
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
}
.email-subject {
  color: var(--accent);
  font-weight: 700;
  font-size: 13px;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

.email-body {
  white-space: pre-wrap;
  background: #ffffff;
  border: 1px solid var(--border);
  padding: 10px;
  border-radius: 8px;
  max-height: 55vh;
  overflow-y: auto;
  overflow-x: hidden;
  font-size: 13px;
  line-height: 1.4;
  color: #333;
  min-height: 80px;
}

.email-body::-webkit-scrollbar {
  width: 6px;
}
.email-body::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}
.email-body::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 3px;
}
.email-body::-webkit-scrollbar-thumb:hover {
  background: #094a17;
}

.email-card:only-child .email-body {
  text-align: center;
  color: #666;
  font-style: italic;
}

/* ======== NOTE SECTION ======== */
.note-section {
  margin-top: 16px;
}
.note-input-container {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.note-input-container textarea {
  flex: 1;
  min-height: 76px;
  max-height: 200px;
  resize: vertical;
  height: auto;
  border-radius: 8px;
  padding: 10px;
  border: 1px solid var(--border);
}
.note-input-container button {
  align-self: flex-start;
  height: fit-content;
  margin-top: 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--primary);
  color: white;
  border: none;
  cursor: pointer; /* removed transition */
}
.note-input-container button:hover {
  background: #094a17;
}

/* ======== SUMMARY SECTION ======== */
.summary-section {
  flex: 1;
  overflow-y: auto;
}
.summary-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  margin-bottom: 6px;
  background: white;
  border-radius: 6px;
  cursor: pointer; /* removed transition */
}
.summary-item:hover {
  background: #f0f0f0; /* removed transform */
}
.summary-situation {
  font-weight: 600;
  color: #0b5d1e;
  flex: 1;
}
.summary-stats {
  display: flex;
  gap: 8px;
}

.stat-badge {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  min-width: 80px;
  text-align: center;
  cursor: pointer;
}
.stat-badge:hover {
  box-shadow: none;
}

.stat-treated {
  background: #c9f7d2;
  color: #0a4a18;
  border: 1px solid #0b5d1e;
}
.stat-in-progress {
  background: #fff4d6;
  color: #aa6600;
  border: 1px solid #aa6600;
}
.stat-untreated {
  background: #ffe6d6;
  color: #aa3300;
  border: 1px solid #cc4400;
}
.stat-blank {
  background: #f0f0f0;
  color: #666;
  border: 1px solid #ccc;
}

/* ======== LOADING OVERLAY ======== */
#loadingOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgb(255, 255, 255);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  flex-direction: column;
  font-size: 20px;
  font-weight: bold;
  color: #0b5d1e;
  text-align: center;
}
.loading-content img {
  height: 500px;
  margin-bottom: 0px;
}
.loading-content div {
  font-size: 22px;
  font-weight: 600;
}

/* ======== UPLOAD ======== */
.upload-row input[type="file"] {
  border: none;
}

#orgTabsContainer {
  display: flex;
  gap: 8px;
  align-items: center;
}
.tabs-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding: 0 4px;
}

#orgTabsContainer .org-tab {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  font-size: 14px;
}
#orgTabsContainer .org-tab.active {
  background: var(--primary);
  color: white;
}
#orgTabsContainer .org-tab[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}
#orgTabsContainer .org-tab.active {
  background: var(--primary);
  color: #fff;
}

/* Document / Relatório - avaliação */
.doc-eval {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 14px;
}
.doc-check {
  width: 22px;
  height: 22px;
  border: 2px solid var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  font-size: 14px;
  line-height: 1;
}
.doc-check.checked {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.doc-status {
  text-transform: uppercase;
  color: #333;
}
.doc-check.rejected {
  background: #c40000;
  color: #fff;
  border-color: #c40000;
}

input[type="text"],
select {
  font-family: inherit;
  font-size: inherit;
  padding: 4px 8px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  background-color: white;
}
input[type="text"]:focus,
select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: none;
}

/* ======== TABLE FILTERS IMPROVEMENTS ======== */
/* Mantive estilos visuais - removi animações/entradas */
.th-with-filter {
  position: relative;
  cursor: pointer;
  padding: 12px 8px !important;
  user-select: none;
}
.th-with-filter > div:first-child {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 4px;
  gap: 4px;
}
.filter-icon {
  font-size: 12px;
  opacity: 0.7;
  margin-left: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.th-with-filter.has-filter .filter-icon {
  opacity: 1;
  color: var(--primary);
}
.th-with-filter.has-filter .filter-icon::after {
  content: "●";
  font-size: 8px;
  vertical-align: middle;
}

.th-filter-dropdown {
  display: none;
  position: absolute;
  top: calc(100% - 4px);
  left: 0;
  right: 0;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  z-index: 1000;
  padding: 12px;
  max-height: 300px;
  overflow-y: auto;
  min-width: 200px;
}
.th-filter-dropdown.active {
  display: block;
}

.filter-option {
  padding: 8px 12px;
  cursor: pointer;
  border-radius: 6px;
  font-size: 13px;
  text-align: left;
  font-weight: normal;
  transition: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.filter-option::before {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid var(--primary);
  border-radius: 3px;
  display: inline-block;
}
.filter-option.selected::before {
  background-color: var(--primary);
  border-color: var(--primary);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='14' height='14'%3E%3Cpath fill='white' d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}
.filter-option:hover {
  background: #f0f0f0;
}
.filter-option.selected {
  background: #f0f0f0;
  color: var(--primary);
  font-weight: 600;
}

.filter-search {
  width: 100%;
  padding: 8px 12px;
  margin-bottom: 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
}
.filter-search:focus {
  outline: none;
  border-color: var(--primary);
}

.clear-all-filters {
  padding: 8px 16px;
  background: #6b7280;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.clear-all-filters::before {
  content: "×";
  font-size: 16px;
  font-weight: bold;
}
.clear-all-filters:hover {
  background: #4b5563;
}

.th-with-filter.has-filter::before {
  content: "";
  position: absolute;
  top: 4px;
  right: 4px;
  width: 6px;
  height: 6px;
  background-color: var(--primary);
  border-radius: 50%;
}

.th-filter-dropdown::-webkit-scrollbar {
  width: 6px;
}
.th-filter-dropdown::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}
.th-filter-dropdown::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}
.th-filter-dropdown::-webkit-scrollbar-thumb:hover {
  background: #a0aec0;
}

/* Ajustes para colunas específicas (mantidos) */
.table-header th:nth-child(1),
.table-body td:nth-child(1) {
  width: 140px;
  min-width: 140px;
}
.table-header th:nth-child(2),
.table-body td:nth-child(2) {
  width: 100px;
  min-width: 100px;
}

.table-header th.outlook-assunto,
.table-body td.outlook-assunto {
  width: 300px;
  min-width: 300px;
}
.table-header th.outlook-assunto {
  text-align: center;
}
.table-body td.outlook-assunto {
  text-align: left;
  padding-left: 16px;
}

.table-header th.outlook-origem,
.table-body td.outlook-origem {
  width: 150px;
  min-width: 150px;
}
.table-header th.outlook-acao,
.table-body td.outlook-acao {
  width: 120px;
  min-width: 120px;
}

.table-header th.der-modalidade,
.table-body td.der-modalidade {
  width: 120px;
  min-width: 120px;
}

.table-header th.situacao,
.table-body td.situacao {
  width: 180px;
  min-width: 180px;
}
.table-header th.status,
.table-body td.status {
  width: 150px;
  min-width: 150px;
}

/* Container do gráfico */
.chart-container {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 16px;
  margin-bottom: 20px;
  height: 300px;
  position: relative;
}

.process-table-wrapper {
  flex: 1 1 auto;
  overflow: hidden;
  margin-bottom: 8px;
}
.table-body-wrapper {
  overflow-y: auto;
  max-height: calc(100vh - 260px);
}

.clear-filters-btn:hover {
  color: #ffffff;
  background: #0e7c28;
  border-color: #000000;
}

.tabs .tab {
  padding: 10px 20px;
  font-size: 15px;
  font-weight: 500;
  color: #4a5568;
  background: #e8ecf2;
  border: 1px solid #c5ccd8;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
}
.tabs .tab:not(.active):hover {
  background: #dfe4ec;
}
.tabs .tab.active {
  background: #ffffff;
  color: var(--primary);
  font-weight: 600;
  border: 1px solid #b8c1d2;
  border-bottom: 3px solid var(--primary);
}

.table-header th {
  background: linear-gradient(180deg, #f0f3f7, #e6e9ef);
  color: #2d3748;
  font-weight: 600;
  padding: 10px 14px;
  border-bottom: 1px solid #d5dbe5;
  font-size: 14px;
}

/* ============================================================
   SCRAPPER – Aba exclusiva admin & botão no painel de Detalhes
   ============================================================ */

.tabs .tab.scrapper-tab-btn {
  border-style: dashed;
  border-color: var(--primary);
  color: var(--primary);
  background: transparent;
  font-weight: 600;
  opacity: 0.85;
}
.tabs .tab.scrapper-tab-btn:hover:not(.active) {
  background: var(--primary-soft);
  opacity: 1;
}
.tabs .tab.scrapper-tab-btn.active {
  background: var(--primary);
  color: #fff;
  border-style: solid;
  border-color: var(--primary);
  opacity: 1;
}

.scrapper-details-block {
  margin-top: 18px;
  margin-bottom: 4px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.scrapper-details-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-scrapper {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.btn-scrapper:hover:not(:disabled) {
  background: #094a17;
  box-shadow: none;
}
.btn-scrapper:disabled {
  background: #b0b8c1;
  color: #fff;
  cursor: not-allowed;
  box-shadow: none;
}
.btn-scrapper-executar {
  padding: 11px 28px;
  font-size: 15px;
  width: 100%;
  justify-content: center;
}
.btn-scrapper-secondary {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: #eef2f7;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.btn-scrapper-secondary:hover {
  background: #dfe4ec;
  color: #333;
}

.scrapper-details-error {
  font-size: 13px;
  color: #c0392b;
  font-weight: 600;
  min-height: 18px;
  display: inline-block;
}

.scrapper-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  flex: 1;
  overflow-y: auto;
}
.scrapper-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.scrapper-section h3 {
  margin: 0;
  font-size: 14px;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
}

.scrapper-credentials-form {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.scrapper-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 200px;
}
.scrapper-field label {
  font-size: 13px;
  font-weight: 600;
  color: #4a5568;
}
.scrapper-field input {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
}
.scrapper-field input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: none;
}

.scrapper-nota-display {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.scrapper-nota-valor {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.5px;
}
.scrapper-nota-aviso {
  font-size: 13px;
  color: #c0392b;
  font-weight: 600;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 6px;
  padding: 5px 10px;
}

/* Progress bar kept - minimal animation (width) is fine */
.scrapper-progress-bar-track {
  width: 100%;
  height: 20px;
  background: #eef2f7;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.scrapper-progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), #22c55e);
  border-radius: 10px;
  transition: width 0.25s linear;
}
.scrapper-progress-text {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
  text-align: center;
}

.scrapper-logs-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.scrapper-logs-header h3 {
  margin: 0;
}
.scrapper-logs-container {
  background: #1e1e2e;
  border-radius: 8px;
  border: 1px solid #333;
  padding: 12px 14px;
  max-height: 260px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.scrapper-logs-container::-webkit-scrollbar {
  width: 6px;
}

.scrapper-log-entry {
  font-size: 13px;
  font-family: "Consolas", "Courier New", monospace;
  line-height: 1.5;
  padding: 2px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  white-space: pre-wrap;
  word-break: break-word;
}
.scrapper-log-entry:last-child {
  border-bottom: none;
}
.scrapper-log-info {
  color: #7ec8e3;
}
.scrapper-log-success {
  color: #6fcf97;
  font-weight: 600;
}
.scrapper-log-error {
  color: #eb5757;
  font-weight: 600;
}
.scrapper-log-progress {
  color: #f2c94c;
}
.scrapper-log-timestamp {
  color: #666;
  font-size: 11px;
  margin-right: 6px;
}

/* ================================================================
   new_design_additions.css
   Cole no final do arquivo new_design.css existente.
   ================================================================ */

/* ── Reset de box-sizing para todos os elementos da aba ─────── */
.protocolar-panel *,
.protocolar-panel *::before,
.protocolar-panel *::after {
  box-sizing: border-box;
}

/* ── Painel geral da aba ────────────────────────────────────── */
.protocolar-panel {
  padding: 16px;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
}

/* ── Box principal ──────────────────────────────────────────── */
.protocolar-box {
  background: #fff;
  border: 1px solid var(--border, #dce3ec);
  border-radius: 12px;
  padding: 20px 22px;
  max-width: 860px;
  width: 100%;
  box-shadow: 0 2px 8px rgba(0,0,0,.07);
  overflow: hidden;             /* impede estouro lateral */
}

.protocolar-box-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  border-bottom: 2px solid var(--primary, #1a5e38);
  padding-bottom: 12px;
}

.protocolar-box-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--primary, #1a5e38);
  white-space: normal;
  word-break: break-word;
}

.protocolar-box-icon { font-size: 20px; flex-shrink: 0; }

/* ── Seções internas ────────────────────────────────────────── */
.protocolar-section {
  margin-bottom: 22px;
  width: 100%;
  overflow: hidden;
}

.protocolar-section h4 {
  font-size: 11px;
  font-weight: 700;
  color: #555;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin: 0 0 10px;
}

/* ── Zona de drag-and-drop ──────────────────────────────────── */
.drop-zone {
  border: 2px dashed var(--border, #c8d6e8);
  border-radius: 10px;
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: background .2s, border-color .2s;
  background: #f8fbff;
  user-select: none;
  width: 100%;
  overflow: hidden;
}

.drop-zone:hover,
.drop-zone-hover {
  border-color: var(--primary, #1a5e38);
  background: #eef6ee;
}

.drop-zone-icon { font-size: 32px; margin-bottom: 6px; }

.drop-zone p {
  margin: 0;
  font-size: 13px;
  color: #666;
  line-height: 1.5;
  word-break: break-word;
}

.drop-status {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  font-weight: 600;
  word-break: break-word;
}
.drop-status-success { color: #1a5e38; }
.drop-status-error   { color: #c0392b; }

/* ── Grid do formulário ─────────────────────────────────────── */
.protocolar-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  width: 100%;
}

.pf-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;           /* essencial para evitar estouro em grid */
  overflow: hidden;
}

.pf-group-full {
  grid-column: 1 / -1;
}

.pf-group label {
  font-size: 10px;
  font-weight: 700;
  color: #555;
  text-transform: uppercase;
  letter-spacing: .4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pf-group input,
.pf-group select,
.pf-group textarea {
  padding: 7px 9px;
  border: 1px solid var(--border, #cdd6e2);
  border-radius: 6px;
  font-size: 13px;
  color: #222;
  background: #fff;
  transition: border-color .2s;
  resize: vertical;
  font-family: inherit;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  display: block;
}

.pf-group input:focus,
.pf-group select:focus,
.pf-group textarea:focus {
  outline: none;
  border-color: var(--primary, #1a5e38);
  box-shadow: 0 0 0 3px rgba(26,94,56,.1);
}

/* ── Grupo de coordenadas (destaque visual) ─────────────────── */
.pf-group-coord {
  background: #f0f8f4;
  border: 1px solid #b8dcc8;
  border-radius: 8px;
  padding: 8px 10px;
}

.pf-group-coord label {
  color: #1a5e38;
}

.pf-group-coord input {
  background: #fff;
  border-color: #b8dcc8;
}

.pf-group-coord input:read-only {
  background: #e8f5ee;
  color: #1a5e38;
  font-weight: 600;
  border-color: #a0cbb4;
  cursor: default;
}

/* Badge que indica auto-preenchimento */
.pf-auto-badge {
  display: inline-block;
  font-size: 9px;
  background: #1a5e38;
  color: #fff;
  border-radius: 3px;
  padding: 1px 5px;
  margin-left: 5px;
  vertical-align: middle;
  letter-spacing: .3px;
  text-transform: none;
  font-weight: 600;
}

/* ── Lista de anexos ────────────────────────────────────────── */
.anexos-list {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.anexo-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  background: #f4f8f4;
  border: 1px solid #d4e6d4;
  border-radius: 7px;
  font-size: 12px;
  min-width: 0;
  overflow: hidden;
}

.anexo-nome {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #333;
  min-width: 0;
}

.anexo-size {
  font-size: 11px;
  color: #888;
  white-space: nowrap;
  flex-shrink: 0;
}

.anexo-remove {
  background: none;
  border: none;
  color: #c0392b;
  cursor: pointer;
  font-size: 14px;
  padding: 0 3px;
  line-height: 1;
  flex-shrink: 0;
  transition: color .2s;
}
.anexo-remove:hover { color: #922b21; }

/* ── Botão executar ─────────────────────────────────────────── */
.protocolar-actions-section {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.btn-protocolar-executar {
  background: var(--primary, #1a5e38);
  color: #fff;
  border: none;
  padding: 10px 22px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s, transform .1s;
  letter-spacing: .3px;
  white-space: nowrap;
}

.btn-protocolar-executar:hover:not(:disabled) {
  background: #14482b;
  transform: translateY(-1px);
}

.btn-protocolar-executar:disabled {
  opacity: .55;
  cursor: not-allowed;
  transform: none;
}

/* ── Status de execução ─────────────────────────────────────── */
.protocolar-exec-status {
  font-size: 13px;
  font-weight: 600;
  word-break: break-word;
}
.protocolar-exec-status-info    { color: #2471a3; }
.protocolar-exec-status-success { color: #1a5e38; }
.protocolar-exec-status-error   { color: #c0392b; }

/* ── Divisor visual entre grupos UTM e lat/lon ──────────────── */
.pf-divider {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0;
  font-size: 11px;
  color: #999;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .4px;
}

.pf-divider::before,
.pf-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e0e9f0;
}

/* ============== Layout: protocolar DER (limpo & organizado) ============== */
/* Cole no final de new_design.css */

/* ---------- Variáveis locais (ajuste conforme design) ---------- */
:root {
  --primary: #0B5D1E;
  --card-bg: #fff;
  --docs-bg: #f8fbff;
  --border-light: #edf0f5;
  --muted: #888;
  --docs-width: 340px; /* altere para 380px se preferir */
  --docs-min-width: 300px;
  --box-padding: 20px;
}

/* ---------- Barra de progresso reaproveitada (preservada) ---------- */
#protocolar-progress-section {
  padding: 0;
}

/* ---------- Forçar aba ocupar mais espaço (box principal) ---------- */
/* Mantém behavior original: permite esticar além de 860px e preencher container */
#protocolar-der-tab .protocolar-box {
  max-width: none !important;                    /* intenção explícita do usuário */
  width: calc(100% - 44px) !important;           /* preenche praticamente todo o container */
  margin: 0;
  padding: var(--box-padding);
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.05);
  box-sizing: border-box;
  background: var(--card-bg);
}

/* Painel: ocupa toda a altura disponível dentro do tab */
#protocolar-der-tab .protocolar-panel {
  height: 100%;
  padding: 16px 8px;
  overflow: auto;
  box-sizing: border-box;
}

/* ---------- Grid duas-colunas (form esquerdo, docs direito) ---------- */
#protocolar-der-tab .protocolar-two-col,
.protocolar-two-col {
  display: flex;
  gap: 24px;              /* leve diferença unificada: 24px */
  align-items: flex-start;
  box-sizing: border-box;
}

/* Coluna do formulário (esquerda) */
#protocolar-der-tab .protocolar-col-form,
.protocolar-col-form {
  flex: 1 1 auto;
  min-width: 0; /* crítico para evitar overflow de inputs */
}

/* Coluna de documentos (direita) */
/* Coluna de documentos (direita) – mais espaço */
#protocolar-der-tab .protocolar-col-docs,
.protocolar-col-docs {
  flex: 0 0 750px;      /* largura base maior */
  min-width: 750px;     /* evita ficar muito estreito */
  max-width: 750px;     /* limite para não dominar a tela */
  
  max-height: calc(100vh - 220px);
  overflow-y: auto;

  border: 1px solid #edf0f5;
  border-radius: 10px;
  background: #f8fbff;
  padding: 14px;
  box-sizing: border-box;
}

/* Caso alguém use a versão sem #protocolar-der-tab (consistência) */
.protocolar-col-docs {
  max-height: 75vh; /* fallback quando usado fora do contexto do tab */
}

/* Títulos/pequenos ajustes dentro do painel de docs */
.protocolar-col-docs h4 {
  margin: 0 0 10px;
  font-size: 13px;
  color: #333;
}

/* ---------- Dropzone por linha (docs) ---------- */
.protocolar-doc-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
}
.protocolar-doc-row:last-child { border-bottom: none; }

.pf-dropzone-label {
  font-size: 11px;
  font-weight: 700;
  color: #444;
  min-width: 130px;
  flex-shrink: 0;
}

.drop-zone-row {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px dashed #c0ccd8;
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
  min-height: 36px;
  transition: background .15s, border-color .15s;
  font-size: 12px;
  color: var(--muted);
  background: var(--card-bg);
}
.drop-zone-row:hover,
.drop-zone-row.drop-zone-hover {
  border-color: var(--primary);
  background: #e6f2e8; /* leve highlight para hover */
}

.drop-zone-row .dz-icon { font-size: 16px; flex-shrink: 0; }
.drop-zone-row .dz-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Lista de arquivos anexados */
.doc-file-list {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  font-size: 11px;
  color: #555;
}
.doc-file-list li {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 1px 0;
}
.doc-file-list .anexo-remove {
  background: none;
  border: none;
  color: #c0392b;
  cursor: pointer;
  font-size: 12px;
  padding: 0 2px;
  line-height: 1;
}

/* ---------- Resumo: sub-tabs ---------- */
.resumo-subtabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border-light);
  margin-bottom: 12px;
  padding: 0 4px;
}
.resumo-subtab {
  padding: 8px 18px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all .15s;
}
.resumo-subtab:hover { color: #333; }
.resumo-subtab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.resumo-subcontent { display: none; }
.resumo-subcontent.active { display: block; }

/* ---------- Resumo por Técnico (filtros / cards / tabela) ---------- */
.resumo-tech-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.resumo-tech-select {
  padding: 7px 10px;
  border: 1px solid #cdd6e2;
  border-radius: 6px;
  font-size: 13px;
  min-width: 260px;
  background: var(--card-bg);
}
.resumo-tech-content {}

.resumo-tech-cards {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.resumo-tech-card {
  flex: 1;
  min-width: 130px;
  padding: 14px;
  border-radius: 10px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--border-light);
  background: var(--card-bg);
}
.resumo-tech-card .rtc-num {
  font-size: 28px;
  font-weight: 700;
  display: block;
  margin-bottom: 4px;
}

.resumo-tech-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.resumo-tech-table th {
  background: #f4f7fb;
  padding: 8px 10px;
  text-align: left;
  border-bottom: 2px solid #dce3ec;
}
.resumo-tech-table td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--border-light);
}
.resumo-tech-table tr:hover { background: #f8fbff; }

/* ---------- Campo "Responsável" nos detalhes ---------- */
.responsavel-select {
  width: 100%;
  padding: 4px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 13px;
  box-sizing: border-box;
}
.responsavel-readonly {
  font-size: 13px;
  color: #333;
  padding: 4px 0;
}

/* ---------- Responsividade: consolidada ---------- */
@media (max-width: 900px) {
  /* layout coluna para mobile / tablet estreito */
  #protocolar-der-tab .protocolar-two-col,
  .protocolar-two-col {
    flex-direction: column;
    gap: 12px;
  }

  #protocolar-der-tab .protocolar-col-docs,
  .protocolar-col-docs {
    width: 100%;
    flex: 0 0 auto;
    max-height: none;
  }

  #protocolar-der-tab .protocolar-box,
  .protocolar-box {
    width: 100% !important;
    padding: 14px;
  }

  .resumo-tech-select { min-width: 100%; }
}
/* ================================================================
   PROTOCOLAR DER — SUB-ABAS & CAMPOS DINÂMICOS
   ================================================================ */

/* ── Sub-abas de tipo de protocolo ────────────────────────────── */
.protocolar-subtabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid #edf0f5;
  margin-bottom: 16px;
  padding: 0 2px;
}

.protocolar-subtab {
  padding: 9px 18px;
  font-size: 12px;
  font-weight: 700;
  color: #666;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  transition: color .2s, border-color .2s, background .2s;
  text-transform: uppercase;
  letter-spacing: .3px;
  white-space: nowrap;
}

.protocolar-subtab:hover {
  color: var(--primary, #0B5D1E);
  background: rgba(11, 93, 30, 0.04);
}

.protocolar-subtab.active {
  color: var(--primary, #0B5D1E);
  border-bottom-color: var(--primary, #0B5D1E);
  background: rgba(11, 93, 30, 0.06);
}

/* ── Banner de documentos fixos ───────────────────────────────── */
.pf-docs-fixos-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: #e8f5ee;
  border: 1px solid #b8dcc8;
  border-radius: 8px;
  margin-bottom: 14px;
  font-size: 12px;
  color: #1a5e38;
}

.pf-docs-fixos-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.pf-docs-fixos-tooltip {
  cursor: help;
  font-size: 14px;
  flex-shrink: 0;
}

/* ── Header row com dados da solicitação + qtds combinada ──── */
.pf-section-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.pf-section-header-row h4 {
  margin: 0;
}

/* ── Inputs de quantidade (combinada) ─────────────────────────── */
.pf-combinada-qtd {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.pf-combinada-qtd label {
  font-size: 11px;
  font-weight: 700;
  color: #555;
  text-transform: uppercase;
  letter-spacing: .3px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pf-combinada-qtd input[type="number"] {
  width: 60px;
  padding: 5px 8px;
  border: 1px solid var(--border, #cdd6e2);
  border-radius: 6px;
  font-size: 13px;
  text-align: center;
}

.pf-combinada-qtd input[type="number"]:focus {
  outline: none;
  border-color: var(--primary, #0B5D1E);
  box-shadow: 0 0 0 3px rgba(11, 93, 30, 0.1);
}

/* ── Seções dinâmicas (Combinada) ─────────────────────────────── */
.pf-dynamic-section {
  margin-top: 16px;
  padding: 14px;
  background: #f8fbff;
  border: 1px solid #e0e9f0;
  border-radius: 10px;
}

.pf-dynamic-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary, #0B5D1E);
  text-transform: uppercase;
  letter-spacing: .4px;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid #e0e9f0;
}

/* ── Bloco de coordenadas genérico (grid dentro do form) ──── */
.pf-coord-block {
  display: contents;
}

/* ── Botão cancelar ───────────────────────────────────────────── */
.btn-protocolar-cancelar {
  background: #c0392b;
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s;
  letter-spacing: .3px;
  white-space: nowrap;
}

.btn-protocolar-cancelar:hover {
  background: #922b21;
}

/* ── Tag VM nos logs ──────────────────────────────────────────── */
.scrapper-log-tag-vm {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  background: #2471a3;
  color: #fff;
  border-radius: 3px;
  padding: 1px 5px;
  margin-right: 4px;
  vertical-align: middle;
  letter-spacing: .3px;
  text-transform: uppercase;
}

/* ── Log tipo warn ─────────────────────────────────────────── */
.scrapper-log-warn {
  color: #b7791f;
  background: #fefce8;
}

/* ── Status warn ───────────────────────────────────────────── */
.protocolar-exec-status-warn { color: #b7791f; }

/* ── Ajuste: coordenada B no longitudinal ──────────────────── */
#pf-coord-b-section .pf-coord-block {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  width: 100%;
}

/* ── Responsivo: sub-abas em telas menores ─────────────────── */
@media (max-width: 768px) {
  .protocolar-subtabs {
    flex-wrap: wrap;
  }
  .protocolar-subtab {
    flex: 1;
    text-align: center;
    min-width: 0;
    padding: 8px 10px;
    font-size: 11px;
  }
  .pf-section-header-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .pf-combinada-qtd {
    width: 100%;
  }
}
/* ── Ocupações colapsáveis (combinada) ────────────────── */
.pf-dynamic-header {
  cursor: pointer;
  user-select: none;
  padding: 10px 14px;
  background: #f0f4f8;
  border: 1px solid #d0d7e1;
  border-radius: 6px;
  font-weight: 600;
  font-size: 14px;
  color: #333;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.2s;
}
.pf-dynamic-header:hover { background: #e2e8f0; }
.pf-collapse-icon {
  font-size: 11px;
  transition: transform 0.2s;
  display: inline-block;
}
.pf-dynamic-section.collapsed .pf-collapse-icon { transform: rotate(-90deg); }
.pf-dynamic-body {
  overflow: hidden;
  max-height: 2000px;
  transition: max-height 0.3s ease, opacity 0.2s ease, padding 0.2s ease;
  opacity: 1;
  padding-top: 12px;
}
.pf-dynamic-section.collapsed .pf-dynamic-body {
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  margin: 0;
}

/* =====================================================================
   DADOS CRUZADOS — Estilos da aba de cruzamento
   ===================================================================== */

.cruzado-panel {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: calc(100vh - 140px);
  overflow-y: auto;
}

/* ── Barra de ações (upload + export) ─────────────────────────────── */

.cruzado-actions-bar {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.cruzado-action-group {
  flex: 1;
  min-width: 280px;
  background: #f7f9fc;
  border: 1px solid #d4dae4;
  border-radius: 10px;
  padding: 18px;
}

.cruzado-action-group h3 {
  margin: 0 0 6px 0;
  font-size: 15px;
  color: #1a2a3a;
}

.cruzado-hint {
  font-size: 12px;
  color: #6b7b8d;
  margin: 0 0 12px 0;
}

/* ── Drop zone ────────────────────────────────────────────────────── */

.cruzado-drop-zone {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 20px;
  border: 2px dashed #b0bec5;
  border-radius: 8px;
  background: #ffffff;
  transition: all 0.2s;
  cursor: pointer;
}

.cruzado-drop-zone.drag-active,
.cruzado-drop-zone:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.cruzado-dz-icon {
  font-size: 26px;
}

.cruzado-dz-text {
  font-size: 13px;
  color: #546e7a;
}

.cruzado-upload-btn {
  padding: 7px 18px;
  font-size: 13px;
  font-weight: 600;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}

.cruzado-upload-btn:hover {
  background: #094a18;
}

.cruzado-file-name {
  margin-top: 8px;
  font-size: 13px;
  color: #37474f;
  font-weight: 500;
}

/* ── Export button ─────────────────────────────────────────────────── */

.cruzado-export-btn {
  padding: 10px 22px;
  font-size: 13px;
  font-weight: 600;
  background: #1F4E79;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}

.cruzado-export-btn:hover {
  background: #163d5e;
}

.cruzado-export-group {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* ── Loader ────────────────────────────────────────────────────────── */

.cruzado-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 30px;
  font-size: 14px;
  color: #546e7a;
}

.cruzado-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid #cfd8dc;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: cruzadoSpin 0.7s linear infinite;
}

@keyframes cruzadoSpin {
  to { transform: rotate(360deg); }
}

/* ── Resumo cards ──────────────────────────────────────────────────── */

.cruzado-resumo {
  margin-bottom: 4px;
}

.cruzado-resumo-grid {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.cruzado-resumo-card {
  flex: 1;
  min-width: 110px;
  padding: 12px 16px;
  border-radius: 8px;
  text-align: center;
  border: 1px solid #e0e0e0;
}

.cruzado-card-number {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
}

.cruzado-card-label {
  font-size: 11px;
  color: #546e7a;
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cruzado-card-total { background: #e3f2fd; }
.cruzado-card-total .cruzado-card-number { color: #1565c0; }

.cruzado-card-der { background: #e8f5e9; }
.cruzado-card-der .cruzado-card-number { color: #2e7d32; }

.cruzado-card-fca { background: #fff8e1; }
.cruzado-card-fca .cruzado-card-number { color: #f57f17; }

.cruzado-card-nao { background: #fce4ec; }
.cruzado-card-nao .cruzado-card-number { color: #c62828; }

.cruzado-card-taxa { background: #f3e5f5; }
.cruzado-card-taxa .cruzado-card-number { color: #6a1b9a; }

.cruzado-criterios {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12px;
  color: #455a64;
  padding: 4px 0;
}

.cruzado-crit-item b {
  color: #1a2a3a;
}

/* ── Filtros ───────────────────────────────────────────────────────── */

.cruzado-filters-bar {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 0;
  border-bottom: 1px solid #e0e5ec;
}

.cruzado-filter-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.cruzado-filter-field label {
  font-size: 11px;
  font-weight: 600;
  color: #546e7a;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.cruzado-filter-field input,
.cruzado-filter-field select {
  padding: 6px 10px;
  font-size: 13px;
  border: 1px solid #c5ccd8;
  border-radius: 5px;
  background: #fff;
  min-width: 120px;
  outline: none;
  transition: border-color 0.15s;
}

.cruzado-filter-field input:focus,
.cruzado-filter-field select:focus {
  border-color: var(--primary);
}

.cruzado-download-btn {
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
  background: #375623;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  margin-left: auto;
  transition: background 0.15s;
}

.cruzado-download-btn:hover {
  background: #2a4219;
}

/* ── Contagem ──────────────────────────────────────────────────────── */

.cruzado-count {
  font-size: 12px;
  color: #78909c;
  padding: 6px 0 2px;
}

/* ── Tabela de resultados ──────────────────────────────────────────── */

.cruzado-table-container {
  flex: 1;
  overflow: hidden;
  border: 1px solid #d4dae4;
  border-radius: 8px;
}

.cruzado-table-wrapper {
  overflow: auto;
  max-height: calc(100vh - 540px);
}

.cruzado-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  font-family: Arial, sans-serif;
}

.cruzado-table thead {
  position: sticky;
  top: 0;
  z-index: 2;
}

.cruzado-table th {
  padding: 8px 10px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  text-align: left;
  white-space: nowrap;
  border-bottom: 2px solid #b0bec5;
}

.cruzado-th-excel {
  background: #1F4E79;
}

.cruzado-th-json {
  background: #375623;
}

.cruzado-th-criterio {
  background: #4A235A;
}

.cruzado-table td {
  padding: 6px 10px;
  border-bottom: 1px solid #eceff1;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

.cruzado-table tbody tr:hover {
  background: #e8eef5 !important;
}

/* Row colors */
.cruzado-row-der { background: #f1f8e9; }
.cruzado-row-fca { background: #fffde7; }
.cruzado-row-none { background: #ffffff; }
.cruzado-row-none:nth-child(even) { background: #f5f7fa; }

.cruzado-td-criterio {
  font-size: 11px;
  font-weight: 600;
  color: #4A235A;
  max-width: 260px;
}

.cruzado-td-fonte {
  font-weight: 700;
  text-align: center;
}

.fonte-der { color: #2e7d32; }
.fonte-fca { color: #e65100; }

/* ── Detalhe panel ─────────────────────────────────────────────────── */

.cruzado-detail-panel {
  margin-top: 12px;
  padding: 16px;
  border: 1px solid #d4dae4;
  border-radius: 8px;
  background: #f7f9fc;
  max-height: 350px;
  overflow-y: auto;
}

.cruzado-detail-panel h4 {
  margin: 0 0 10px 0;
  font-size: 14px;
  color: #1a2a3a;
  border-bottom: 1px solid #e0e5ec;
  padding-bottom: 6px;
}

.cruzado-detail-panel h4:not(:first-child) {
  margin-top: 16px;
}

.cruzado-detail-grid {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 4px 12px;
  font-size: 12px;
}

.cruzado-detail-label {
  font-weight: 600;
  color: #455a64;
  padding: 3px 0;
}

.cruzado-detail-value {
  color: #263238;
  padding: 3px 0;
  word-break: break-word;
}

.cruzado-emails {
  white-space: pre-wrap;
  font-size: 11px;
  max-height: 120px;
  overflow-y: auto;
  background: #fff;
  padding: 6px;
  border-radius: 4px;
  border: 1px solid #e0e0e0;
}

.cruzado-no-match {
  padding: 12px;
  color: #c62828;
  font-size: 13px;
  text-align: center;
}
