/* ==========================================================================
   VIDDA LEILÃO - SYSTEM DESIGN & STYLESHEET (VANILLA CSS — TEMA CLARO VIDDA)
   ========================================================================== */

/* Mirador é licenciada (MyFonts): usa a instalada no sistema ou os arquivos em fonts/. */
@font-face {
  font-family: 'Mirador';
  src: local('Mirador'), local('Mirador Regular'), local('Mirador-Regular'),
       url('fonts/Mirador-Regular.woff2') format('woff2'),
       url('fonts/Mirador-Regular.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Mirador';
  src: local('Mirador SemiBold'), local('Mirador-SemiBold'),
       url('fonts/Mirador-SemiBold.woff2') format('woff2'),
       url('fonts/Mirador-SemiBold.woff') format('woff');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Mirador';
  src: local('Mirador Bold'), local('Mirador-Bold'),
       url('fonts/Mirador-Bold.woff2') format('woff2'),
       url('fonts/Mirador-Bold.woff') format('woff');
  font-weight: 700 800;
  font-style: normal;
  font-display: swap;
}

/* --- CSS Variables & Design Tokens --- */
:root {
  --font-body: 'Mirador', 'Source Serif 4', Georgia, serif;
  --font-heading: 'Mirador', 'Playfair Display', Georgia, serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Paleta Vidda */
  --vidda-white: #ffffff;
  --vidda-light: #6dc4cd;
  --vidda-blue: #009a9c;
  --vidda-dark: #005866;

  --bg-body: #f4f9fa;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #fbfdfd;
  --bg-input: #ffffff;
  --bg-table-stripe: rgba(109, 196, 205, 0.06);

  --border-color: rgba(0, 88, 102, 0.12);
  --border-light: rgba(0, 88, 102, 0.22);
  --border-active: var(--vidda-blue);

  /* Text Colors */
  --text-main: #12343b;
  --text-muted: #4f6b72;
  --text-dim: #7b9197;

  /* Accents */
  --color-primary: var(--vidda-blue);
  --color-primary-hover: #007c7e;
  --color-emerald: #059669;
  --color-cyan: #008a8c;
  --color-amber: #b45309;
  --color-purple: var(--vidda-dark);
  --color-rose: #e11d48;
  --color-indigo: var(--vidda-dark);

  /* Effects */
  --shadow-sm: 0 1px 3px rgba(0, 88, 102, 0.08);
  --shadow-md: 0 4px 18px rgba(0, 88, 102, 0.08);
  --shadow-lg: 0 12px 32px rgba(0, 88, 102, 0.14);
  --glass-backdrop: none;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
}

/* --- Base Reset --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

button, input, select, textarea {
  font-family: inherit;
}

html {
  color-scheme: light;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-body);
  background-image: radial-gradient(circle at 15% 15%, rgba(0, 154, 156, 0.08) 0%, transparent 45%),
    radial-gradient(circle at 85% 85%, rgba(0, 88, 102, 0.08) 0%, transparent 45%),
    radial-gradient(circle at 50% 50%, rgba(0, 154, 156, 0.04) 0%, transparent 60%);
  background-attachment: fixed;
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: lining-nums;
}

/* --- Typography Helpers --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.text-muted { color: var(--text-muted); }
.text-dim { color: var(--text-dim); }
.text-emerald { color: var(--color-emerald); }
.text-cyan { color: var(--color-cyan); }
.text-amber { color: var(--color-amber); }
.text-purple { color: var(--color-purple); }
.text-rose { color: var(--color-rose); }
.text-indigo { color: var(--color-indigo); }
.font-mono { font-family: var(--font-mono); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.hidden { display: none !important; }
.mt-3 { margin-top: 0.75rem; }

/* --- Glassmorphism Cards --- */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-backdrop);
  -webkit-backdrop-filter: var(--glass-backdrop);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.glass-card:hover {
  border-color: rgba(0, 88, 102, 0.18);
  box-shadow: 0 8px 24px rgba(0, 88, 102, 0.15);
}

/* --- Full Page Initial Loading Overlay --- */
.fullpage-loading {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.fullpage-loading.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.fullpage-spinner {
  width: 54px;
  height: 54px;
  border: 4px solid rgba(0, 154, 156, 0.15);
  border-top-color: var(--color-primary);
  border-right-color: var(--color-cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.fullpage-logo {
  width: 88px;
  height: 88px;
  object-fit: contain;
  filter: drop-shadow(0 6px 14px rgba(0, 88, 102, 0.2));
}

.fullpage-title {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--vidda-dark);
}

.fullpage-title span { color: var(--vidda-blue); }

.fullpage-sub {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* --- N8n Search Overlay Modal & Progress Bar --- */
.search-modal-card {
  width: 90%;
  max-width: 520px;
  padding: 2.25rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1rem;
  background: #ffffff;
  border: 1px solid rgba(0, 154, 156, 0.4);
  box-shadow: 0 0 40px rgba(0, 154, 156, 0.25);
  animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

.search-modal-title {
  font-size: 1.35rem;
  color: var(--color-cyan);
}

.search-overlay-term {
  font-size: 1rem;
  color: var(--text-main);
  background: rgba(0, 154, 156, 0.1);
  border: 1px solid rgba(0, 154, 156, 0.25);
  padding: 0.4rem 1rem;
  border-radius: var(--radius-full);
}

.search-overlay-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.search-progress-bg {
  width: 100%;
  height: 8px;
  background: rgba(0, 88, 102, 0.12);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-top: 0.5rem;
}

.search-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--color-cyan), var(--color-primary), var(--color-emerald));
  transition: width 0.3s linear;
}

.search-progress-text {
  font-size: 0.775rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.btn-cancel-search {
  margin-top: 0.75rem;
  color: #12343b;
  border-color: rgba(0, 88, 102, 0.42);
  background: transparent;
}

.btn-cancel-search:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.55);
  color: #b91c1c;
}

/* --- Header Bar --- */
.top-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem 0;
}

.header-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.header-search-container {
  flex: 1;
  max-width: 580px;
  margin: 0 0.5rem;
}

.suggested-brands-chips {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.4rem;
  flex-wrap: wrap;
}

.suggested-title {
  font-size: 0.7rem;
  color: var(--text-dim);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.2rem;
  text-transform: uppercase;
}

.brand-chip {
  background: rgba(236, 244, 245, 0.92);
  border: 1px solid rgba(0, 88, 102, 0.12);
  color: var(--text-muted);
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.brand-chip:hover {
  background: rgba(0, 154, 156, 0.2);
  border-color: var(--color-cyan);
  color: var(--color-cyan);
  transform: translateY(-1px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0, 88, 102, 0.18));
}

.brand-text h1 {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.08em;
  color: var(--vidda-dark);
}

.brand-text h1 span {
  color: var(--vidda-blue);
}

.brand-text .subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Date filter box in header */
.date-filter-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-input);
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.825rem;
  color: var(--text-muted);
}

.date-filter-box svg {
  width: 16px;
  height: 16px;
  color: var(--color-cyan);
}

.date-picker-input {
  max-width: 130px;
  padding: 0.25rem 0.5rem !important;
  font-size: 0.8rem !important;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
}

.btn svg {
  width: 16px;
  height: 16px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary), #007c7e);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(0, 154, 156, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #007c7e, #005866);
  box-shadow: 0 4px 14px rgba(0, 154, 156, 0.5);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(236, 244, 245, 0.92);
  color: var(--text-main);
  border-color: var(--border-color);
}

.btn-secondary:hover {
  background: rgba(236, 244, 245, 0.92);
  border-color: var(--border-light);
}

.btn-outline {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border-color);
}

.btn-outline:hover {
  background: rgba(0, 88, 102, 0.06);
  color: var(--text-main);
  border-color: var(--border-light);
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
}

.btn-icon {
  padding: 0.5rem;
}

/* Export Dropdown */
.export-dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-content {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 200px;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 50;
  overflow: hidden;
}

.dropdown-content.show {
  display: block;
  animation: fadeIn 0.15s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.export-bar {
  display: flex;
  justify-content: center;
  margin-top: 1.25rem;
}

/* Abaixo da lista, perto do fim da página: abre para cima, centralizado no botão */
.export-bar .dropdown-content {
  top: auto;
  bottom: calc(100% + 6px);
  right: auto;
  left: 50%;
  translate: -50% 0;
}

.dropdown-content a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1rem;
  color: var(--text-main);
  font-size: 0.85rem;
  text-decoration: none;
  transition: background var(--transition-fast);
}

.dropdown-content a svg {
  width: 16px;
  height: 16px;
  color: var(--color-primary);
}

.dropdown-content a:hover {
  background: rgba(0, 154, 156, 0.15);
}

/* --- Painel de Pesquisa & Filtros da Origem --- */
.table-filters-bar {
  padding: 0.85rem 1.15rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(0, 88, 102, 0.25);
  background: rgba(255, 255, 255, 0.92);
  margin-bottom: 0.85rem;
}

.table-filters-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.table-filters-title {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--text-main);
}

.table-filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 0.75rem 0.9rem;
}

.table-filter-item {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}

.table-filter-item .custom-input.input-sm {
  padding: 0.35rem 0.6rem;
}

.table-filter-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-main);
}

.table-filter-label svg {
  width: 13px;
  height: 13px;
  color: var(--color-cyan);
}

.table-filter-hint {
  font-size: 0.68rem;
  line-height: 1.3;
  color: var(--text-muted);
}

.input-sm, .select-sm {
  padding: 0.35rem 0.6rem;
  font-size: 0.78rem;
  height: auto;
}

.btn-xs {
  padding: 0.25rem 0.5rem;
  font-size: 0.72rem;
}
.search-panel-section {
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(0, 154, 156, 0.35);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(236, 244, 245, 0.92));
  box-shadow: 0 10px 30px rgba(0, 88, 102, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.search-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(0, 88, 102, 0.096);
}

.search-panel-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.search-panel-title i {
  width: 22px;
  height: 22px;
}

.search-panel-title h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}

.search-panel-subtitle {
  margin: 0.2rem 0 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.search-filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.filter-step-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.75rem;
}

.filter-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #ffffff;
  background: var(--vidda-blue);
  border: 1px solid var(--vidda-blue);
  margin-right: 0.35rem;
  flex-shrink: 0;
}

.kpi-card-priority {
  border-color: rgba(16, 185, 129, 0.35);
}

.search-filters-grid .col-span-2 {
  grid-column: span 2;
}

@media (max-width: 768px) {
  .search-filters-grid .col-span-2 {
    grid-column: span 1;
  }
}

.search-submit-bar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.6rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(0, 88, 102, 0.096);
}

.btn-search-hero {
  width: 100%;
  padding: 0.85rem 1.75rem;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  background: linear-gradient(135deg, #007c7e, #009a9c);
  box-shadow: 0 4px 15px rgba(0, 154, 156, 0.35);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.btn-search-hero:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 154, 156, 0.5);
  background: linear-gradient(135deg, #005866, #007c7e);
}

.btn-search-hero:disabled,
.btn-search-db:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.btn-search-db {
  width: 100%;
  justify-content: center;
  padding: 0.7rem 1.5rem;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: var(--radius-md);
}

.search-submit-bar .filter-hint {
  margin: 0;
  text-align: center;
}

.highlight-pulse {
  animation: highlightPulse 1.8s ease-in-out;
}

@keyframes highlightPulse {
  0% { box-shadow: 0 0 0 0 rgba(0, 154, 156, 0.7); }
  50% { box-shadow: 0 0 25px 5px rgba(0, 154, 156, 0.6); border-color: rgba(0, 154, 156, 0.8); }
  100% { box-shadow: 0 0 0 0 rgba(0, 154, 156, 0); }
}

/* --- Layout Containers --- */
.dashboard-body {
  padding: 1.5rem 0 3rem;
}

.container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

/* --- Alert Banner --- */
.alert-banner {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-md);
  color: #b91c1c;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.alert-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.alert-content h4 {
  font-size: 0.95rem;
  margin-bottom: 0.15rem;
  color: #991b1b;
}

.alert-content p {
  font-size: 0.85rem;
}

.alert-close {
  margin-left: auto;
  background: none;
  border: none;
  color: #b91c1c;
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

/* --- KPI Cards Grid --- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.kpi-card {
  padding: 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  position: relative;
  overflow: hidden;
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: transparent;
  transition: background var(--transition-normal);
}

.kpi-card:hover::before {
  background: linear-gradient(90deg, var(--color-primary), var(--color-cyan));
}

.kpi-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kpi-icon svg {
  width: 22px;
  height: 22px;
}

.icon-blue { background: rgba(0, 154, 156, 0.15); color: var(--color-primary); }
.icon-emerald { background: rgba(16, 185, 129, 0.15); color: var(--color-emerald); }
.icon-cyan { background: rgba(0, 154, 156, 0.15); color: var(--color-cyan); }
.icon-amber { background: rgba(245, 158, 11, 0.15); color: var(--color-amber); }
.icon-purple { background: rgba(0, 88, 102, 0.15); color: var(--color-purple); }
.icon-rose { background: rgba(244, 63, 94, 0.15); color: var(--color-rose); }
.icon-indigo { background: rgba(0, 88, 102, 0.15); color: var(--color-indigo); }

.kpi-data {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.kpi-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.kpi-value {
  font-size: clamp(1.05rem, 1.3vw, 1.35rem);
  font-weight: 800;
  line-height: 1.2;
  margin: 0.2rem 0;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  cursor: help;
  transition: color var(--transition-fast);
}

.kpi-value:hover {
  color: var(--color-cyan);
}

.kpi-subtext {
  font-size: 0.725rem;
  color: var(--text-dim);
}

.kpi-badge {
  font-size: 0.7rem;
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-sm);
  display: inline-block;
  max-width: max-content;
}

.badge-neutral { background: rgba(0, 88, 102, 0.096); color: var(--text-muted); }

/* --- Section Container Headers --- */
.section-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.section-title svg {
  width: 22px;
  height: 22px;
}

.section-title h3 {
  font-size: 1.15rem;
}

.section-tag {
  font-size: 0.75rem;
  background: rgba(0, 88, 102, 0.06);
  border: 1px solid var(--border-color);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  color: var(--text-muted);
}

/* --- Ranking Cards Grid --- */
.ranking-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
}

.ranking-card {
  padding: 1.25rem;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  border-top: 3px solid var(--border-color);
}

.ranking-card.rank-1 { border-top-color: var(--color-amber); background: linear-gradient(180deg, rgba(245, 158, 11, 0.06), var(--bg-card)); }
.ranking-card.rank-2 { border-top-color: #2f4f56; background: linear-gradient(180deg, rgba(203, 213, 225, 0.05), var(--bg-card)); }
.ranking-card.rank-3 { border-top-color: #b45309; background: linear-gradient(180deg, rgba(180, 83, 9, 0.05), var(--bg-card)); }

.rank-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.rank-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-gold { background: rgba(245, 158, 11, 0.2); color: #a16207; border: 1px solid rgba(245, 158, 11, 0.4); }
.badge-silver { background: rgba(203, 213, 225, 0.2); color: #12343b; border: 1px solid rgba(203, 213, 225, 0.4); }
.badge-bronze { background: rgba(180, 83, 9, 0.2); color: #c2410c; border: 1px solid rgba(180, 83, 9, 0.4); }
.badge-default { background: rgba(0, 154, 156, 0.15); color: #005866; border: 1px solid rgba(0, 154, 156, 0.3); }

.rank-lote-tag {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.rank-vehicle-title {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
}

.rank-link {
  display: inline-flex;
  flex-shrink: 0;
  margin-top: 0.1rem;
  color: var(--color-cyan);
  opacity: 0.8;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.rank-link:hover {
  opacity: 1;
  transform: translateY(-1px);
}

.rank-link svg {
  width: 16px;
  height: 16px;
}

.rank-details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  background: rgba(0, 88, 102, 0.087);
  padding: 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  font-size: 0.8rem;
}

.rank-detail-item {
  display: flex;
  flex-direction: column;
}

.rank-detail-item .lbl { font-size: 0.7rem; color: var(--text-dim); }
.rank-detail-item .val { font-weight: 700; }

.rank-score-bar-container {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.score-bar-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 600;
}

.score-progress-bg {
  width: 100%;
  height: 6px;
  background: rgba(0, 88, 102, 0.12);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.score-progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--color-cyan), var(--color-emerald));
  transition: width 0.5s ease;
}

/* --- Charts Grid --- */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.charts-grid > .chart-card:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

@media (max-width: 1024px) {
  .charts-grid {
    grid-template-columns: 1fr;
  }
}

.chart-card {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 340px;
}

.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.75rem;
}

.chart-header h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
}

.chart-header svg {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
}

.chart-body {
  position: relative;
  flex: 1;
  width: 100%;
  min-height: 250px;
}

/* --- Filters & Search Controls --- */
.filters-card {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.filters-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.search-box-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 320px;
}

.search-box {
  position: relative;
  flex: 1;
}

.search-box svg {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}

.btn-search-n8n {
  background: linear-gradient(135deg, #009a9c, #005866);
  border: none;
  color: #ffffff;
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-search-n8n:hover:not(:disabled) {
  background: linear-gradient(135deg, #007c7e, #007c7e);
  box-shadow: 0 4px 12px rgba(0, 154, 156, 0.4);
  transform: translateY(-1px);
}

.btn-search-n8n:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

/* Link Copart Button */
.btn-copart-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.65rem;
  background: rgba(0, 154, 156, 0.12);
  border: 1px solid rgba(0, 154, 156, 0.3);
  border-radius: var(--radius-sm);
  color: var(--color-cyan);
  font-size: 0.775rem;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.btn-copart-link:hover {
  background: rgba(0, 154, 156, 0.25);
  border-color: var(--color-cyan);
  color: #005866;
  transform: translateY(-1px);
}

.btn-copart-link svg {
  width: 13px;
  height: 13px;
}

/* Toast Notifications System */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 380px;
  pointer-events: none;
}

.toast-card {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius-md);
  background: #ffffff;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-lg);
  color: var(--text-main);
  animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast-card.hide {
  opacity: 0;
  transform: translateX(100%);
}

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateX(50px); }
  to { opacity: 1; transform: translateX(0); }
}

.toast-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  margin-top: 2px;
}

.toast-success { border-left: 4px solid var(--color-emerald); }
.toast-success .toast-icon { color: var(--color-emerald); }

.toast-error { border-left: 4px solid var(--color-rose); }
.toast-error .toast-icon { color: var(--color-rose); }

.toast-warning { border-left: 4px solid var(--color-amber); }
.toast-warning .toast-icon { color: var(--color-amber); }

.toast-info { border-left: 4px solid var(--color-cyan); }
.toast-info .toast-icon { color: var(--color-cyan); }

.toast-body {
  flex: 1;
}

.toast-title {
  font-size: 0.875rem;
  font-weight: 700;
  margin-bottom: 0.15rem;
}

.toast-msg {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.25rem;
  cursor: pointer;
  line-height: 1;
  padding: 0;
}

.toast-close:hover { color: var(--text-main); }

.custom-input {
  width: 100%;
  padding: 0.6rem 0.85rem 0.6rem 2.4rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.875rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.custom-input:focus {
  outline: none;
  border-color: var(--border-active);
  box-shadow: 0 0 0 3px rgba(0, 154, 156, 0.25);
}

.custom-select {
  padding: 0.6rem 2rem 0.6rem 0.85rem;
  background: var(--bg-input);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
  background-size: 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.85rem;
  appearance: none;
  cursor: pointer;
  transition: border-color var(--transition-fast);
}

.custom-select:focus {
  outline: none;
  border-color: var(--border-active);
}

.select-sm {
  padding: 0.3rem 1.8rem 0.3rem 0.65rem;
  font-size: 0.8rem;
}

.records-counter {
  font-size: 0.825rem;
  color: var(--text-muted);
  font-weight: 500;
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.85rem;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.filter-group label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* --- Interactive Data Table --- */
.table-card {
  position: relative;
  overflow: hidden;
  /* clip (e não hidden) para a barra horizontal sticky funcionar */
  overflow: clip;
  border-radius: var(--radius-lg);
}

.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(4px);
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  color: var(--text-muted);
  font-weight: 600;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(0, 154, 156, 0.2);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.empty-state {
  padding: 4rem 2rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.empty-state svg {
  width: 48px;
  height: 48px;
  color: var(--text-dim);
  margin-bottom: 1rem;
}

.empty-state h4 {
  font-size: 1.1rem;
  color: var(--text-main);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  /* A barra visível é a .table-hscroll, que acompanha a tela */
  scrollbar-width: none;
}

.table-responsive::-webkit-scrollbar {
  display: none;
}

.table-hscroll {
  position: sticky;
  bottom: 0;
  z-index: 5;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 0;
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid rgba(0, 88, 102, 0.08);
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 154, 156, 0.6) #eef5f6;
}

.table-hscroll-inner {
  height: 1px;
}

.table-hscroll::-webkit-scrollbar {
  height: 10px;
}

.table-hscroll::-webkit-scrollbar-track {
  background: #eef5f6;
  border-radius: 5px;
}

.table-hscroll::-webkit-scrollbar-thumb {
  background: rgba(0, 154, 156, 0.6);
  border-radius: 5px;
}

.table-hscroll::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary);
}

.data-table {
  width: 100%;
  min-width: 1100px;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.72rem;
}

.data-table th {
  background: rgba(255, 255, 255, 0.95);
  padding: 0.5rem 0.25rem;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.01em;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
  user-select: none;
}

.data-table th.sortable {
  cursor: pointer;
  transition: color var(--transition-fast);
}

.data-table th.sortable:hover {
  color: var(--text-main);
  background: rgba(236, 244, 245, 0.92);
}

.sort-icon {
  width: 11px;
  height: 11px;
  vertical-align: middle;
  opacity: 0.4;
  margin-left: 0.1rem;
}

.data-table th.sorted-asc .sort-icon,
.data-table th.sorted-desc .sort-icon {
  opacity: 1;
  color: var(--color-primary);
}

.data-table td {
  padding: 0.45rem 0.25rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  vertical-align: middle;
  font-size: 0.72rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 180px;
}

.data-table th {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Explicit column width percentages (13 colunas) */
.col-site { width: 7%; }
.col-lote { width: 7%; }
.col-veiculo { width: 18%; }
.col-ano { width: 5%; }
.col-motor { min-width: 96px; }
.col-monta { min-width: 112px; }
.col-cidade { width: 10%; }
.col-tipo { width: 9%; }
.col-fipe { width: 8%; }
.col-lmin { width: 8%; }
.col-latual { width: 8%; }
.col-descfipe { width: 7%; }
.col-prazo { width: 5%; }
.col-status { width: 8%; }
.col-link { width: 10%; }

/* Estilização Responsiva dos Links de Lote */
.btn-lote-link, .btn-copart-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  padding: 0.25rem 0.45rem;
  background: rgba(0, 154, 156, 0.15);
  border: 1px solid rgba(0, 154, 156, 0.4);
  color: #005866;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  max-width: 100%;
  box-sizing: border-box;
  transition: all var(--transition-fast);
}

.btn-lote-link:hover, .btn-copart-link:hover {
  background: var(--color-primary);
  color: #ffffff;
  border-color: var(--color-primary);
  box-shadow: 0 0 8px rgba(0, 154, 156, 0.4);
}

.btn-lote-link i, .btn-copart-link i {
  width: 11px;
  height: 11px;
  flex-shrink: 0;
}

.data-table tbody tr {
  transition: background var(--transition-fast);
}

.data-table tbody tr:nth-child(even) {
  background: var(--bg-table-stripe);
}

.data-table tbody tr:hover {
  background: rgba(0, 154, 156, 0.08);
}

/* Badges inside table */
.badge-tag {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.tag-damage-leve { background: rgba(16, 185, 129, 0.15); color: #047857; }
.tag-damage-media { background: rgba(245, 158, 11, 0.15); color: #a16207; }
.tag-damage-grande { background: rgba(239, 68, 68, 0.15); color: #b91c1c; }

.tag-chave-sim { background: rgba(0, 154, 156, 0.15); color: #007c7e; }
.tag-chave-nao { background: rgba(148, 163, 184, 0.15); color: #2f4f56; }

.discount-high { color: var(--color-emerald); font-weight: 700; }
.discount-med { color: var(--color-amber); font-weight: 600; }
.discount-low { color: var(--text-muted); }

/* Score Pill */
.score-pill {
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.775rem;
  font-weight: 700;
  display: inline-block;
}

.score-pill-gold { background: rgba(245, 158, 11, 0.2); color: #a16207; border: 1px solid rgba(245, 158, 11, 0.4); }
.score-pill-green { background: rgba(16, 185, 129, 0.2); color: #047857; border: 1px solid rgba(16, 185, 129, 0.4); }
.score-pill-blue { background: rgba(0, 154, 156, 0.2); color: #005866; border: 1px solid rgba(0, 154, 156, 0.4); }
.score-pill-gray { background: rgba(148, 163, 184, 0.15); color: #2f4f56; }

/* Pagination Bar */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: rgba(255, 255, 255, 0.92);
  border-top: 1px solid var(--border-color);
  gap: 1rem;
  flex-wrap: wrap;
}

.page-size {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.825rem;
  color: var(--text-muted);
}

.page-info {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.current-page-badge {
  padding: 0.3rem 0.75rem;
  background: var(--color-primary);
  color: #ffffff;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 700;
}

/* --- Modal Overlay & Card --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 46, 54, 0.45);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: fadeIn 0.2s ease-out;
}

.modal-card {
  width: 100%;
  max-width: 720px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.15rem;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

.modal-close:hover { color: var(--text-main); }

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  font-size: 0.9rem;
}

.modal-body h4 {
  color: var(--color-cyan);
  margin-top: 0.5rem;
}

.code-block {
  background: #ffffff;
  border: 1px solid var(--border-color);
  padding: 0.85rem;
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  overflow-x: auto;
  color: #005866;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
}

/* --- Custom Scrollbar --- */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #eef5f6;
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 88, 102, 0.18);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 88, 102, 0.36);
}

/* --- Media Queries for Mobile Responsiveness --- */
@media (max-width: 768px) {
  .header-container {
    flex-direction: column;
    align-items: stretch;
  }

  .header-controls {
    justify-content: space-between;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .filters-grid {
    grid-template-columns: 1fr;
  }

  .pagination-bar {
    flex-direction: column;
    align-items: center;
  }
}

@media (max-width: 480px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================================
 * ESTILOS DO SELETOR DE SITE E BADGES DOS CONECTORES
 * ============================================================================ */
.site-selector-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
  padding: 0.35rem 0.65rem;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(0, 88, 102, 0.096);
  border-radius: var(--radius-md);
  flex-wrap: wrap;
}

.site-selector-label {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.775rem;
  font-weight: 700;
  color: var(--color-cyan);
  text-transform: uppercase;
}

.site-radio-group {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.site-radio-item {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.6rem;
  background: rgba(0, 88, 102, 0.06);
  border: 1px solid rgba(0, 88, 102, 0.144);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.site-radio-item input[type="radio"] {
  accent-color: var(--color-cyan);
  cursor: pointer;
}

.site-radio-item:hover {
  background: rgba(0, 88, 102, 0.12);
  color: var(--text-main);
}

.site-radio-item.active {
  background: rgba(0, 154, 156, 0.2);
  border-color: var(--color-cyan);
  color: var(--color-cyan);
}

/* Badges de Origem do Lote */
.site-badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* Uma cor por leiloeiro: etiquetas claras (fundo suave) e sólidas (fundo cheio) para não repetir tons. */
.site-badge-default    { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; }

.site-badge-copart     { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.site-badge-freitas    { background: #ccfbf1; color: #0f766e; border: 1px solid #5eead4; }
.site-badge-lance      { background: #dbeafe; color: #1d4ed8; border: 1px solid #93c5fd; }
.site-badge-judiciais  { background: #f3e8ff; color: #7e22ce; border: 1px solid #d8b4fe; }
.site-badge-milan      { background: #e2e8f0; color: #334155; border: 1px solid #94a3b8; }
.site-badge-leilo      { background: #dcfce7; color: #15803d; border: 1px solid #86efac; }
.site-badge-vip        { background: #e0f2fe; color: #0369a1; border: 1px solid #7dd3fc; }
.site-badge-mesquita   { background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; }
.site-badge-zuk        { background: #ecfccb; color: #4d7c0f; border: 1px solid #bef264; }
.site-badge-mgl        { background: #cffafe; color: #0e7490; border: 1px solid #67e8f9; }
.site-badge-lancemaior { background: #fae8ff; color: #a21caf; border: 1px solid #f0abfc; }
.site-badge-kwara      { background: #ffedd5; color: #c2410c; border: 1px solid #fdba74; }
.site-badge-pestana    { background: #f5f5f4; color: #57534e; border: 1px solid #a8a29e; }
.site-badge-gold       { background: #fef9c3; color: #a16207; border: 1px solid #fde047; }
.site-badge-tm         { background: #ffe4e6; color: #be123c; border: 1px solid #fda4af; }

.site-badge-superbid   { background: #4f46e5; color: #fff; border: 1px solid #4338ca; }
.site-badge-sodre      { background: #059669; color: #fff; border: 1px solid #047857; }
.site-badge-victor     { background: #7c3aed; color: #fff; border: 1px solid #6d28d9; }
.site-badge-loop       { background: #db2777; color: #fff; border: 1px solid #be185d; }
.site-badge-lancetotal { background: #ea580c; color: #fff; border: 1px solid #c2410c; }
.site-badge-eleiloes   { background: #dc2626; color: #fff; border: 1px solid #b91c1c; }
.site-badge-wsp        { background: #0284c7; color: #fff; border: 1px solid #0369a1; }
.site-badge-tudo       { background: #0d9488; color: #fff; border: 1px solid #0f766e; }

/* Badges de Status da Oportunidade */
.badge-status-oportunidade {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.badge-status-alta {
  background: rgba(16, 185, 129, 0.25);
  color: #047857;
  border: 1px solid rgba(16, 185, 129, 0.5);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.3);
}

.badge-status-media {
  background: rgba(0, 154, 156, 0.25);
  color: #007c7e;
  border: 1px solid rgba(0, 154, 156, 0.5);
}

.badge-status-baixa {
  background: rgba(148, 163, 184, 0.15);
  color: #58737a;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.badge-status-revisar {
  background: rgba(245, 158, 11, 0.2);
  color: #b45309;
  border: 1px solid rgba(245, 158, 11, 0.45);
}

.badge-status-baixissima {
  background: rgba(244, 63, 94, 0.12);
  color: #be123c;
  border: 1px solid rgba(244, 63, 94, 0.35);
}

/* Motor / Monta na tabela */
.badge-tag {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  font-size: 0.68rem;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid transparent;
}

.motor-combustao { background: rgba(148, 163, 184, 0.12); color: #2f4f56; border-color: rgba(148, 163, 184, 0.3); }
.motor-hibrido { background: rgba(16, 185, 129, 0.15); color: #047857; border-color: rgba(16, 185, 129, 0.4); }
.motor-eletrico { background: rgba(0, 154, 156, 0.18); color: #005866; border-color: rgba(0, 154, 156, 0.45); }

.monta-sem { background: rgba(16, 185, 129, 0.15); color: #047857; border-color: rgba(16, 185, 129, 0.4); }
.monta-pequena { background: rgba(0, 154, 156, 0.15); color: #007c7e; border-color: rgba(0, 154, 156, 0.4); }
.monta-media { background: rgba(245, 158, 11, 0.15); color: #b45309; border-color: rgba(245, 158, 11, 0.4); }
.monta-grande { background: rgba(244, 63, 94, 0.15); color: #be123c; border-color: rgba(244, 63, 94, 0.4); }
.monta-nd { background: rgba(148, 163, 184, 0.08); color: var(--text-dim); border-color: rgba(148, 163, 184, 0.2); }

/* Estilo para Justificativas de Dados Ausentes */
.text-justificativa {
  font-size: 0.68rem;
  font-style: italic;
  color: #b45309;
  opacity: 0.9;
  display: inline-block;
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

/* --- Autenticação --- */
.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 2rem 1.75rem 1.75rem;
}

.auth-card:hover {
  transform: none;
}

.auth-brand {
  text-align: center;
  margin-bottom: 1.5rem;
}

.auth-brand .brand-icon {
  width: 84px;
  height: 84px;
  margin: 0 auto 1rem;
}

.auth-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.auth-form .filter-group label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.4rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.auth-form .filter-group label svg {
  width: 14px;
  height: 14px;
}

.btn-auth-submit {
  width: 100%;
  justify-content: center;
  margin-top: 0.35rem;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
}

.btn-auth-link {
  display: block;
  width: 100%;
  margin-top: 0.75rem;
  background: none;
  border: none;
  color: #007c7e;
  font-size: 0.85rem;
  cursor: pointer;
  text-align: center;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 0.35rem;
}

.btn-auth-link:hover {
  opacity: 0.85;
}

.btn-auth-link.hidden {
  display: none;
}

.auth-error,
.auth-success {
  font-size: 0.85rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm);
  line-height: 1.4;
}

.auth-error {
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.35);
  color: #be123c;
}

.auth-success {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #047857;
}

.user-session-box {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.45rem 0.35rem 0.65rem;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  max-width: 280px;
}

.user-session-box svg {
  width: 15px;
  height: 15px;
  color: var(--color-cyan);
  flex-shrink: 0;
}

.user-email-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 140px;
}

@media (max-width: 900px) {
  .user-session-box {
    max-width: 100%;
  }

  .user-email-label {
    max-width: 110px;
  }
}

/* --- Filtros dinâmicos (chips) --- */
.filter-block {
  padding: 0.9rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.92);
}

.filter-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.filter-block-header label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

.filter-block-header label.bulk-check {
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  padding: 0.25rem 0.55rem;
  border: 1px solid rgba(0, 88, 102, 0.25);
  border-radius: var(--radius-sm, 6px);
}

.filter-block-header label.bulk-check:hover {
  color: var(--text-main);
  border-color: var(--color-cyan);
}

.bulk-check input[type="checkbox"] {
  width: 15px;
  height: 15px;
  margin: 0;
  cursor: pointer;
  accent-color: var(--color-cyan);
}

.filter-block-header label svg {
  width: 15px;
  height: 15px;
  color: var(--color-cyan);
}

.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.bulk-check-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

#marcaChips {
  flex-direction: column;
  gap: 0.55rem;
}

.brand-group {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}

.brand-group-label {
  flex: 0 0 76px;
  padding-top: 0.4rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
}

.brand-group-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  flex: 1;
}

@media (max-width: 640px) {
  .brand-group {
    flex-direction: column;
    gap: 0.3rem;
  }

  .brand-group-label {
    flex-basis: auto;
    padding-top: 0;
  }
}

.chip-toggle {
  background: rgba(236, 244, 245, 0.92);
  border: 1px solid rgba(0, 88, 102, 0.12);
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 0.35rem 0.7rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: var(--font-body);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.chip-toggle:hover:not(:disabled) {
  border-color: var(--color-cyan);
  color: var(--color-cyan);
}

.chip-toggle.active {
  background: rgba(0, 154, 156, 0.18);
  border-color: rgba(0, 154, 156, 0.55);
  color: #007c7e;
  box-shadow: 0 0 10px rgba(0, 154, 156, 0.2);
}

.chip-toggle:disabled,
.chip-toggle.disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.chip-toggle .chip-badge {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.1rem 0.35rem;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.2);
  color: #047857;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.chip-toggle.disabled .chip-badge {
  background: rgba(148, 163, 184, 0.15);
  color: #58737a;
  border-color: rgba(148, 163, 184, 0.25);
}

.chip-add-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.chip-add-row .custom-input {
  flex: 1;
  min-width: 180px;
}

.qty-presets {
  display: flex;
  gap: 0.3rem;
  margin-top: 0.45rem;
  flex-wrap: wrap;
}

.qty-disclaimer {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
  margin-top: 0.4rem;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #92400e;
  font-size: 0.72rem;
  line-height: 1.35;
}

.qty-disclaimer svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  margin-top: 1px;
}

.qty-disclaimer.is-unlimited {
  background: rgba(220, 38, 38, 0.08);
  border-color: rgba(220, 38, 38, 0.35);
  color: #991b1b;
  font-weight: 600;
}

.qty-preset.active {
  background: rgba(0, 154, 156, 0.15);
  border-color: var(--color-cyan);
  color: var(--color-cyan);
  font-weight: 700;
}

.qty-preset-unlimited.active {
  background: rgba(220, 38, 38, 0.12);
  border-color: #dc2626;
  color: #b91c1c;
}

.confirm-overlay {
  background: rgba(15, 23, 42, 0.45);
  z-index: 10000;
}

.confirm-card {
  border-color: rgba(245, 158, 11, 0.5);
  box-shadow: 0 10px 40px rgba(15, 23, 42, 0.25);
}

.confirm-card .search-modal-title {
  color: #92400e;
}

.confirm-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(245, 158, 11, 0.15);
  color: #b45309;
}

.confirm-icon svg {
  width: 28px;
  height: 28px;
}

.confirm-warning {
  font-size: 0.85rem;
  font-weight: 600;
  color: #b91c1c;
}

.confirm-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 0.25rem;
}

.fixed-filters-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

.check-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  user-select: none;
}

.date-range-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.date-range-row .date-range-input {
  flex: 1;
  min-width: 0;
  padding: 0.55rem 0.5rem;
}

.search-encerrados-check {
  align-self: center;
}

.prazo-label-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.prazo-label-row label {
  margin-bottom: 0;
}

.prazo-radio {
  appearance: none;
  -webkit-appearance: none;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin: 0;
  border-radius: 50%;
  border: 2px solid var(--border-light);
  background: var(--bg-input);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.prazo-radio:hover {
  border-color: var(--color-primary);
}

.prazo-radio:checked {
  border-color: var(--color-primary);
  background: var(--color-primary);
  box-shadow: inset 0 0 0 2px var(--bg-input);
}

.prazo-radio:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.prazo-option.is-inactive select,
.prazo-option.is-inactive .date-range-row,
.prazo-option.is-inactive .prazo-label-row label {
  opacity: 0.5;
}

.search-filters-grid select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.info-tip {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.info-tip-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
  padding: 0;
  border: 1px solid rgba(0, 154, 156, 0.35);
  border-radius: 999px;
  background: rgba(0, 154, 156, 0.12);
  color: var(--color-cyan);
  cursor: pointer;
  flex-shrink: 0;
}

.info-tip-btn:hover,
.info-tip-btn[aria-expanded="true"] {
  background: rgba(0, 154, 156, 0.25);
  border-color: rgba(0, 154, 156, 0.55);
}

.info-tip-btn svg {
  width: 11px;
  height: 11px;
}

.info-tip-panel {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%);
  z-index: 80;
  width: min(280px, 70vw);
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(0, 154, 156, 0.35);
  background: #ffffff;
  box-shadow: var(--shadow-lg);
  color: var(--text-main);
  font-size: 0.78rem;
  line-height: 1.45;
  text-align: left;
  white-space: normal;
}

.info-tip-panel::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: rgba(0, 154, 156, 0.35);
}

.info-tip-panel strong {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--color-cyan);
  font-size: 0.82rem;
}

.info-tip-panel p {
  margin: 0 0 0.45rem;
  color: var(--text-muted);
}

.info-tip-panel ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--text-muted);
}

.info-tip-panel li {
  margin-bottom: 0.2rem;
}

.info-tip-panel li strong {
  display: inline;
  color: var(--text-main);
  font-size: inherit;
}

.check-pill input {
  accent-color: var(--color-cyan);
}

.check-pill:has(input:checked) {
  border-color: rgba(0, 154, 156, 0.45);
  color: var(--text-main);
  background: rgba(0, 154, 156, 0.1);
}

.multi-check-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.multi-check-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.multi-check-label svg {
  width: 14px;
  height: 14px;
  color: var(--color-cyan);
}

.multi-check-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.multi-check-options .check-pill {
  font-size: 0.78rem;
  padding: 0.35rem 0.65rem;
}

.filter-hint {
  margin-top: 0.65rem;
  font-size: 0.72rem;
  line-height: 1.4;
}

.filter-disclaimer {
  margin-top: 0.55rem;
  padding: 0.65rem 0.8rem;
  font-size: 0.75rem;
  line-height: 1.45;
  color: #b45309;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 8px;
}

.filter-disclaimer strong {
  color: #92400e;
}

.btn-xs {
  padding: 0.25rem 0.55rem;
  font-size: 0.72rem;
}

.mt-3 { margin-top: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }

/* Perfis de filtro */
.profile-row,
.profile-load-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.profile-row {
  margin-bottom: 0.65rem;
}

.profile-row .custom-input {
  flex: 1;
  min-width: 200px;
}

.profile-load-row .custom-select {
  flex: 1;
  min-width: 200px;
}

.btn-danger-outline {
  color: #be123c;
  border-color: rgba(244, 63, 94, 0.35);
}

.btn-danger-outline:hover {
  background: rgba(244, 63, 94, 0.12);
  color: #be123c;
  border-color: rgba(244, 63, 94, 0.5);
}

/* Abas Resultados / Histórico */
.table-section-header {
  flex-wrap: wrap;
  gap: 0.75rem;
}

.view-tabs {
  display: inline-flex;
  gap: 0.3rem;
  padding: 0.25rem;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.view-tab {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.82rem;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all var(--transition-fast);
}

.view-tab svg {
  width: 14px;
  height: 14px;
}

.view-tab.active {
  background: linear-gradient(135deg, rgba(0, 88, 102, 0.35), rgba(0, 154, 156, 0.25));
  color: var(--text-main);
  border: 1px solid rgba(0, 88, 102, 0.4);
}

.view-tab:hover:not(.active) {
  color: var(--text-main);
  background: rgba(0, 88, 102, 0.048);
}

.history-summary {
  padding: 0.85rem 1rem;
}

.history-summary-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.65rem;
  color: var(--text-main);
}

.history-summary-title svg {
  width: 15px;
  height: 15px;
  color: var(--color-indigo);
}

.history-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

/* Coluna DataHoje só no histórico */
.hist-only {
  display: none;
}

.view-historico .hist-only {
  display: table-cell;
}

.data-table-wide {
  min-width: 1600px;
}

/* Plataforma, Lote e Marca/Modelo fixas no scroll horizontal. São o 2º–4º filhos da linha
   porque o 1º é a "Data pesquisa" do Histórico (oculta fora dele). Os "left" vêm de
   updateStickyColumns(), que mede as larguras reais. As camadas de fundo repetem a
   zebra/hover da linha sobre branco para a célula fixa não ficar transparente.
   .table-float-clone é o cabeçalho flutuante (cópia do thead), que segue as mesmas regras. */
:is(#dataTable, .table-float-clone) tr > :nth-child(2),
:is(#dataTable, .table-float-clone) tr > :nth-child(3),
:is(#dataTable, .table-float-clone) tr > :nth-child(4) {
  position: sticky;
  z-index: 2;
  background: var(--bg-card);
}

:is(#dataTable, .table-float-clone) thead tr > :nth-child(-n+4) { z-index: 3; }
:is(#dataTable, .table-float-clone) tr > :nth-child(2) { left: 0; }
:is(#dataTable, .table-float-clone) tr > :nth-child(3) { left: var(--sticky-left-lote, 0px); }
:is(#dataTable, .table-float-clone) tr > :nth-child(4) {
  left: var(--sticky-left-veiculo, 0px);
  box-shadow: 6px 0 8px -6px rgba(0, 60, 70, 0.28);
}

/* Cabeçalho da tabela fixo no topo da tela (abaixo da barra superior) ao rolar a lista.
   Posição e largura vêm de positionFloatingTableHeader(); scrollLeft espelha a tabela. */
.table-float-head {
  position: fixed;
  z-index: 60;
  overflow: hidden;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 4px 10px rgba(0, 60, 70, 0.12);
}

.table-float-clone {
  border-collapse: collapse;
  margin: 0;
}

.table-float-clone th {
  background: var(--bg-card);
}

#dataTable tbody tr:nth-child(even) > :nth-child(n+2):nth-child(-n+4) {
  background: linear-gradient(var(--bg-table-stripe), var(--bg-table-stripe)), var(--bg-card);
}

#dataTable tbody tr:hover > :nth-child(n+2):nth-child(-n+4) {
  background: linear-gradient(rgba(0, 154, 156, 0.08), rgba(0, 154, 156, 0.08)), var(--bg-card);
}

:is(#dataTable, .table-float-clone) thead th.sortable:nth-child(n+2):nth-child(-n+4):hover {
  background: #ecf4f5;
}

/* Lista de lotes: +1px sobre o tamanho base de cada elemento */
:is(#dataTable, .table-float-clone) th { font-size: calc(0.68rem + 1px); }
#dataTable td { font-size: calc(0.72rem + 1px); }
#dataTable .site-badge,
#dataTable .badge-status-oportunidade,
#dataTable .btn-lote-link { font-size: calc(0.7rem + 1px); }
#dataTable .badge-tag,
#dataTable .text-justificativa { font-size: calc(0.68rem + 1px); }
#dataTable .obs-input { font-size: calc(0.75rem + 1px); }

/* Alinhamento único para todas as colunas da lista */
:is(#dataTable, .table-float-clone) th,
#dataTable td { text-align: center; }
#dataTable .obs-input { display: block; margin: 0 auto; text-align: left; }

.obs-input {
  min-width: 140px;
  max-width: 200px;
  min-height: 52px;
  resize: vertical;
  font-size: 0.75rem;
  padding: 0.4rem 0.5rem;
  line-height: 1.35;
}

.col-obs {
  min-width: 160px;
}

.cell-editable {
  cursor: text;
  border-bottom: 1px dashed currentColor;
  user-select: none;
}

.cell-editable:hover {
  opacity: 1;
  background: rgba(180, 83, 9, 0.08);
  border-radius: 3px;
}

#dataTable .inline-edit-input {
  width: 100%;
  min-width: 130px;
  max-width: 190px;
  padding: 0.3rem 0.45rem;
  font-size: calc(0.75rem + 1px);
  text-align: center;
}

.col-proc { min-width: 100px; }
.col-aval { width: 7%; }
.col-descaval { width: 6%; }
.col-enc, .col-praca { min-width: 90px; }
.col-datahoje { min-width: 100px; }
.col-uf { width: 3.5%; }

/* Seções recolhíveis */
.section-title-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.section-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}

.section-toggle:hover,
.section-toggle:focus-visible {
  background: rgba(0, 154, 156, 0.1);
  border-color: rgba(0, 154, 156, 0.3);
  color: var(--color-cyan);
  outline: none;
}

.section-title .section-toggle svg,
.section-toggle svg {
  width: 18px;
  height: 18px;
  transition: transform var(--transition-normal);
}

[data-collapsible].is-collapsed .section-toggle svg {
  transform: rotate(-90deg);
}

[data-collapsible].is-collapsed > :not(.section-header):not(.search-panel-header):not(.table-filters-header) {
  display: none !important;
}

.search-panel-section.is-collapsed .search-panel-header {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

/* Navegação rápida flutuante */
.quick-nav {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 90;
  display: flex;
  align-items: center;
}

.quick-nav-handle {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 26px;
  padding: 0.75rem 0;
  border: 1px solid rgba(0, 154, 156, 0.35);
  border-right: none;
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow-md);
  cursor: pointer;
}

.quick-nav-handle span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-cyan);
  opacity: 0.75;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.quick-nav:hover .quick-nav-handle span,
.quick-nav.is-open .quick-nav-handle span {
  opacity: 1;
  transform: scale(1.15);
}

.quick-nav-menu {
  position: absolute;
  right: 100%;
  top: 50%;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding-right: 0.5rem;
  opacity: 0;
  pointer-events: none;
  transform: translate(8px, -50%);
  transition: opacity var(--transition-normal), transform var(--transition-normal);
}

.quick-nav:hover .quick-nav-menu,
.quick-nav:has(:focus-visible) .quick-nav-menu,
.quick-nav.is-open .quick-nav-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translate(0, -50%);
}

.quick-nav-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.85rem;
  border: 1px solid rgba(0, 154, 156, 0.35);
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: var(--shadow-md);
  color: var(--text-main);
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}

.quick-nav-item svg {
  width: 16px;
  height: 16px;
  color: var(--color-cyan);
}

.quick-nav-item:hover,
.quick-nav-item:focus-visible {
  background: var(--color-cyan);
  border-color: var(--color-cyan);
  color: #fff;
  outline: none;
}

.quick-nav-item:hover svg,
.quick-nav-item:focus-visible svg {
  color: #fff;
}

