/* ============================================================
   MF Leilões | Design System — main.css
   ============================================================ */

/* ── Variáveis ─────────────────────────────────────────────── */
:root {
  --navy:        #0b2c49;
  --navy-mid:    #12416e;
  --navy-light:  #1e5c9b;
  --gold:        #e8a020;
  --gold-light:  #fef3d8;
  --bg:          #f0f2f6;
  --surface:     #ffffff;
  --surface-2:   #f7f8fb;
  --border:      #e2e6ed;
  --text:        #1a2535;
  --text-muted:  #6b7a90;
  --success:     #1ca97b;
  --warning:     #f59e0b;
  --danger:      #e05252;
  --info:        #3b82f6;
  --radius:      10px;
  --radius-sm:   6px;
  --shadow-sm:   0 1px 4px rgba(0,0,0,.07);
  --shadow:      0 4px 16px rgba(11,44,73,.10);
  --shadow-md:   0 8px 28px rgba(11,44,73,.13);
  --transition:  .18s ease;
  --font:        'Inter', system-ui, -apple-system, sans-serif;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; -webkit-font-smoothing: antialiased; }
body { font-family: var(--font); background: var(--bg); color: var(--text); min-height: 100vh; }
a { color: inherit; text-decoration: none; }

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c5cdd9; border-radius: 99px; }

/* ============================================================
   HEADER
   ============================================================ */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--navy);
  height: 70px;
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,.25);
}

/* Botão toggle sidebar */
.sidebar-toggle {
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: var(--radius-sm);
  color: #fff;
  width: 45px; height: 45px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 1.9rem;
  transition: background var(--transition);
  flex-shrink: 0;
}
.sidebar-toggle:hover { background: rgba(255,255,255,.22); }

/* Logo centralizado (absolute) */
.logo-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  pointer-events: none;
  user-select: none;
}
.logo-center .header-logo {
  height: 36px;
  width: auto;
  object-fit: contain;
  display: block;
  /* mantém as cores originais da marca — o fundo do header é escuro */
}
.logo-center .header-subtitle {
  font-size: 1.68rem;
  color: rgba(255,255,255,.55);
  margin-top: 2px;
}

/* Grupo direito */
.header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .9rem;
  color: rgba(255,255,255,.65);
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 99px;
  padding: 4px 12px;
  cursor: default;
  white-space: nowrap;
}

.header-badge .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse 2s infinite;
  flex-shrink: 0;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .4; }
}

/* ============================================================
   LAYOUT BODY + SIDEBAR
   ============================================================ */
.layout-body {
  display: flex;
  min-height: calc(100vh - 56px);
}

.sidebar {
  width: 260px;
  min-width: 260px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: width .22s ease, min-width .22s ease;
  overflow: hidden;
  flex-shrink: 0;
  /* Fixo no viewport — não desce com o scroll */
  position: sticky;
  top: 70px;
  height: calc(100vh - 70px);
  align-self: flex-start;
  z-index: 50;
}

body.sidebar-collapsed .sidebar {
  width: 0;
  min-width: 0;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--navy);
  flex-shrink: 0;
  white-space: nowrap;
  gap: 8px;
}
.sidebar-header i { color: var(--navy-light); }

.sidebar-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0 2px;
  transition: color var(--transition);
  flex-shrink: 0;
}
.sidebar-close:hover { color: var(--danger); }

/* ── Seleções Ativas (Chips) ─────────────── */
.active-selections {
  padding: 12px 16px;
  background: linear-gradient(135deg, rgba(30,92,155,.05) 0%, rgba(232,160,32,.03) 100%);
  border-bottom: 1px solid var(--border);
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.active-selections-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: .85rem;
  font-weight: 600;
  color: var(--navy);
}

.active-selections-header i {
  color: var(--success);
  font-size: .9rem;
}

.btn-clear-all {
  background: var(--danger);
  color: white;
  border: none;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: .72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-clear-all:hover {
  background: #c92a2a;
  transform: scale(1.05);
}

.selection-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: white;
  border: 1px solid rgba(30,92,155,.2);
  padding: 4px 8px 4px 10px;
  border-radius: 14px;
  font-size: .75rem;
  font-weight: 500;
  color: var(--navy);
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
  animation: chipIn 0.2s ease;
  transition: all 0.2s ease;
}

@keyframes chipIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.chip:hover {
  border-color: var(--danger);
  box-shadow: 0 2px 6px rgba(224,82,82,.2);
}

.chip-icon {
  font-size: .7rem;
  opacity: 0.7;
}

.chip-remove {
  background: rgba(224,82,82,.1);
  border: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease;
  padding: 0;
  font-size: .65rem;
  color: var(--danger);
  font-weight: bold;
}

.chip-remove:hover {
  background: var(--danger);
  color: white;
}

.sidebar-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.filter-section { 
  transition: all 0.3s ease;
}

.filter-section.collapsed .leilao-widget,
.filter-section.collapsed .filter-field {
  display: none;
}

.filter-section-title {
  font-size: .9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .55px;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.2s ease;
  border-radius: var(--radius-sm);
}

.filter-section-title:hover {
  background: rgba(30,92,155,.03);
}

.filter-title-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.collapse-icon {
  font-size: .85rem;
  color: var(--text-muted);
  transition: transform 0.3s ease;
}

.filter-section.collapsed .collapse-icon {
  transform: rotate(-90deg);
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 8px;
}

.filter-field label {
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 500;
}

.filter-field input[type="date"],
.sidebar select {
  font-family: var(--font);
  font-size: 1rem;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  outline: none;
  width: 100%;
  transition: border-color var(--transition), box-shadow var(--transition);
  cursor: pointer;
}

.filter-field input[type="date"]:focus,
.sidebar select:focus {
  border-color: var(--navy-light);
  box-shadow: 0 0 0 3px rgba(30,92,155,.12);
}

.sidebar select[multiple] {
  height: 100px;
  padding: 4px;
}

.sidebar select[multiple] option {
  padding: 3px 6px;
  border-radius: 3px;
}

/* ── Leilão widget (busca + lista + footer) ─────────────── */
.leilao-widget {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface);
}

/* input de busca */
.leilao-search {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.leilao-search i {
  color: var(--text-muted);
  font-size: .85rem;
  flex-shrink: 0;
}
.leilao-search input[type="text"] {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-family: var(--font);
  font-size: .82rem;
  color: var(--text);
  padding: 0;
}
.leilao-search input[type="text"]::placeholder { color: var(--text-muted); }

/* lista de itens */
.leilao-list-box {
  max-height: 190px;
  overflow-y: auto;
}
.leilao-list-box::-webkit-scrollbar { width: 4px; }
.leilao-list-box::-webkit-scrollbar-track { background: transparent; }
.leilao-list-box::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.leilao-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 11px;
  font-size: .81rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  user-select: none;
  transition: background var(--transition);
  gap: 6px;
}
.leilao-item:last-child { border-bottom: none; }
.leilao-item:hover { background: rgba(30,92,155,.05); }
.leilao-item.selected { background: rgba(30,92,155,.09); }
.leilao-item.selected .leilao-item-name { color: var(--navy); font-weight: 600; }
.leilao-item-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.3;
}
.leilao-item-code {
  font-size: .70rem;
  color: var(--text-muted);
  flex-shrink: 0;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  font-weight: 600;
}
.leilao-item.selected .leilao-item-code {
  background: rgba(30,92,155,.12);
  border-color: rgba(30,92,155,.25);
  color: var(--navy);
}
.leilao-item-check {
  color: var(--navy);
  font-size: .78rem;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity var(--transition);
}
.leilao-item.selected .leilao-item-check { opacity: 1; }

.leilao-empty {
  padding: 14px 11px;
  font-size: .80rem;
  color: var(--text-muted);
  text-align: center;
}

/* footer: contagem + botão limpar */
.leilao-widget-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 10px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  min-height: 28px;
  gap: 6px;
}
#leilao-sel-count {
  font-size: .74rem;
  color: var(--text-muted);
  font-weight: 500;
  flex: 1;
  text-align: center;
}
.leilao-clear-btn {
  background: none;
  border: none;
  font-size: .74rem;
  color: var(--navy);
  cursor: pointer;
  padding: 0;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color var(--transition);
}
.leilao-clear-btn:hover { color: var(--danger); }

/* badge no título da seção */
.filter-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.leilao-count-badge {
  font-size: .72rem;
  font-weight: 600;
  color: var(--navy);
  background: rgba(30,92,155,.10);
  border: 1px solid rgba(30,92,155,.20);
  border-radius: 10px;
  padding: 1px 8px;
  white-space: nowrap;
}

/* controles Todos | Limpar no título dos filtros de select */
.filter-sel-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.filter-sel-btn {
  background: none;
  border: none;
  font-size: .72rem;
  font-weight: 600;
  color: var(--navy);
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color var(--transition);
  font-family: var(--font);
  text-transform: none;
  letter-spacing: 0;
}
.filter-sel-btn:hover { color: var(--danger); }
.filter-sel-sep {
  font-size: .65rem;
  color: var(--border);
  user-select: none;
}

/* ── Botões de filtro ───────────────────────────────────── */
.filter-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ── Legenda do mapa (escala térmica) ───────────────────── */
.map-legend {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 8px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .75rem;
  color: var(--text-muted);
}

.map-legend-label {
  white-space: nowrap;
  font-weight: 600;
  font-size: .72rem;
  color: var(--text-muted);
  min-width: 32px;
}

.map-legend-bar {
  flex: 1;
  height: 12px;
  border-radius: 99px;
  background: linear-gradient(
    to right,
    rgb(219,234,254),
    rgb(34,211,238),
    rgb(250,204,21),
    rgb(249,115,22),
    rgb(220,38,38)
  );
  border: 1px solid var(--border);
}

.map-legend-ticks {
  display: flex;
  justify-content: space-between;
  margin-top: 3px;
  font-size: .68rem;
  color: var(--text-muted);
}

.map-legend-wrap {
  flex: 1;
}

.map-legend-title {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* Overlay para mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 180;
  background: rgba(0,0,0,.4);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

.btn {
  font-family: var(--font);
  font-size: .82rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 18px;
  cursor: pointer;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.btn-primary {
  background: var(--navy);
  color: #fff;
}
.btn-primary:hover { background: var(--navy-mid); transform: translateY(-1px); box-shadow: var(--shadow-sm); }

.btn-outline {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-outline:hover { background: var(--surface-2); color: var(--text); }

.btn-gold {
  background: var(--gold);
  color: #fff;
}
.btn-gold:hover { background: #d4921a; }

/* ============================================================
   CONTEÚDO PRINCIPAL
   ============================================================ */
.page-content {
  flex: 1;
  min-width: 0;
  padding: 20px 24px 40px;
  transition: padding .2s ease;
}

/* ── Seção ─────────────────────────────────────────────────── */
.section-title {
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--text-muted);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ============================================================
   KPI CARDS
   ============================================================ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

.kpi-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  border-left: 4px solid var(--navy-light);
  display: flex;
  align-items: center;
  gap: 14px;
  transition: box-shadow var(--transition), transform var(--transition);
  position: relative;
  overflow: hidden;
}

.kpi-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.kpi-card::before {
  content: '';
  position: absolute;
  right: -12px; top: -12px;
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--border);
  opacity: .5;
}

.kpi-card .kpi-icon {
  width: 40px; height: 40px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.kpi-card .kpi-body { flex: 1; min-width: 0; }

.kpi-card .kpi-label {
  font-size: .68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kpi-card .kpi-value {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--navy);
  line-height: 1.2;
  letter-spacing: -.5px;
}

.kpi-card .kpi-value.sm { font-size: 1.2rem; }

/* Variações de cor */
.kpi-c1 { border-left-color: var(--navy-light); }
.kpi-c1 .kpi-icon { background: rgba(30,92,155,.1); color: var(--navy-light); }
.kpi-c2 { border-left-color: var(--success); }
.kpi-c2 .kpi-icon { background: rgba(28,169,123,.1); color: var(--success); }
.kpi-c3 { border-left-color: var(--gold); }
.kpi-c3 .kpi-icon { background: rgba(232,160,32,.12); color: var(--gold); }
.kpi-c4 { border-left-color: var(--info); }
.kpi-c4 .kpi-icon { background: rgba(59,130,246,.1); color: var(--info); }
.kpi-c5 { border-left-color: var(--danger); }
.kpi-c5 .kpi-icon { background: rgba(224,82,82,.1); color: var(--danger); }

/* ============================================================
   GRÁFICOS
   ============================================================ */
.charts-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.charts-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.chart-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.chart-card.full-width {
  grid-column: 1 / -1;
}

.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.chart-header h3 {
  font-size: .9rem;
  font-weight: 700;
  color: var(--text);
}

.chart-header p {
  font-size: .75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.chart-controls {
  display: flex;
  gap: 4px;
}

.chart-tab {
  font-family: var(--font);
  font-size: .72rem;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-muted);
  border-radius: 5px;
  padding: 4px 10px;
  cursor: pointer;
  transition: all var(--transition);
}

.chart-tab.active, .chart-tab:hover {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}

.chart-wrap {
  position: relative;
  width: 100%;
  height: 280px;  /* altura padrão (gráficos grandes) */
}

/* Gráficos da linha secundária (charts-row) — menores */
.charts-row .chart-wrap {
  height: 210px;
}

/* Doughnut de raças — manter altura padrão mas limitar legenda */
.charts-grid .chart-card:last-child .chart-wrap {
  height: 280px;
}

.chart-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}

/* ── Mapa ──────────────────────────────────────────────────── */
#map-leaflet {
  height: 580px;
  border-radius: 8px;
  overflow: hidden;
  background: #e8edf2;
}

/* ============================================================
   TABELA DE VENDAS
   ============================================================ */
.table-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.table-toolbar {
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
}

.table-toolbar h3 {
  font-size: .9rem;
  font-weight: 700;
  flex: 1;
}

.table-toolbar .search-box {
  position: relative;
}

.table-toolbar .search-box input {
  font-family: var(--font);
  font-size: .82rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 10px 6px 30px;
  outline: none;
  width: 200px;
  transition: all var(--transition);
}
.table-toolbar .search-box input:focus {
  border-color: var(--navy-light);
  box-shadow: 0 0 0 3px rgba(30,92,155,.1);
}

.table-toolbar .search-box .icon {
  position: absolute;
  left: 9px; top: 50%;
  transform: translateY(-50%);
  font-size: .85rem;
  color: var(--text-muted);
  pointer-events: none;
}

.table-toolbar select {
  font-family: var(--font);
  font-size: .82rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  outline: none;
  cursor: pointer;
}

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .82rem;
}

thead tr {
  background: var(--navy);
}

thead th {
  color: rgba(255,255,255,.9);
  font-weight: 600;
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 11px 14px;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: background var(--transition);
}
thead th:hover { background: var(--navy-mid); }
thead th .sort-icon { opacity: .4; margin-left: 4px; font-size: .6rem; }
thead th.sorted .sort-icon { opacity: 1; }

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
tbody tr:hover { background: var(--surface-2); }
tbody tr:last-child { border-bottom: none; }

tbody td {
  padding: 10px 14px;
  color: var(--text);
  white-space: nowrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: .3px;
}

.badge-lance    { background: rgba(59,130,246,.12); color: var(--info); }
.badge-pre      { background: rgba(232,160,32,.15); color: #c07a0a; }
.badge-arremate { background: rgba(28,169,123,.12); color: var(--success); }
.badge-danger   { background: rgba(224,82,82,.12);  color: var(--danger); }
.badge-none     { background: #f1f5f9;              color: #94a3b8; }

.valor-cell { font-weight: 700; color: var(--navy); }

/* ── Paginação ─────────────────────────────────────────────── */
.table-footer {
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.table-info {
  font-size: .75rem;
  color: var(--text-muted);
  flex: 1;
}

.pagination {
  display: flex;
  gap: 4px;
}

.page-btn {
  font-family: var(--font);
  font-size: .78rem;
  font-weight: 600;
  width: 30px; height: 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
}
.page-btn:hover, .page-btn.active {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}
.page-btn:disabled { opacity: .35; pointer-events: none; }

/* ============================================================
   SKELETON LOADER
   ============================================================ */
@keyframes shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position:  600px 0; }
}

.skeleton {
  animation: shimmer 1.4s infinite linear;
  background: linear-gradient(90deg, #e8ebf0 25%, #f4f5f8 50%, #e8ebf0 75%);
  background-size: 1200px 100%;
  border-radius: 5px;
  display: inline-block;
}

.kpi-value.skeleton { width: 80px; height: 28px; }
.kpi-label.skeleton { width: 100px; height: 12px; margin-bottom: 4px; }

/* ============================================================
   TOAST
   ============================================================ */
#toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 9999;
}

.toast {
  background: var(--navy);
  color: #fff;
  font-size: .82rem;
  font-weight: 500;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  opacity: 0; transform: translateY(10px);
  transition: all .25s ease;
  max-width: 320px;
  display: flex; align-items: center; gap: 10px;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: var(--danger); }
.toast.success { background: var(--success); }

/* ============================================================
   RESPONSIVIDADE
   ============================================================ */
@media (max-width: 1200px) {
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
  #kpi-grid-2 { grid-template-columns: repeat(3, 1fr) !important; }
  .charts-row { grid-template-columns: 1fr 1fr; }
  .charts-row .chart-wrap { height: 200px; }
}

@media (max-width: 900px) {
  /* sidebar vira overlay em mobile */
  .sidebar {
    position: fixed;
    top: 70px;
    left: 0;
    height: calc(100vh - 70px);
    width: 260px !important;
    min-width: 260px !important;
    transform: translateX(-110%);
    box-shadow: var(--shadow-md);
    z-index: 200;
    transition: transform .25s ease;
  }
  body.sidebar-collapsed .sidebar { width: 260px !important; min-width: 260px !important; }
  body.sidebar-open .sidebar { transform: translateX(0); }
  body.sidebar-open .sidebar-overlay { display: block; }
  .kpi-grid   { grid-template-columns: repeat(2, 1fr); }
  #kpi-grid-2 { grid-template-columns: repeat(2, 1fr) !important; }
  .charts-grid { grid-template-columns: 1fr; }
  .charts-grid .chart-wrap { height: 260px; }
  .charts-row  { grid-template-columns: 1fr; }
  .charts-row .chart-wrap { height: 200px; }
  .page-content { padding: 14px 16px 40px; }
}

@media (max-width: 560px) {
  .kpi-grid   { grid-template-columns: 1fr 1fr; }
  #kpi-grid-2 { grid-template-columns: 1fr 1fr !important; }
  .kpi-card .kpi-value { font-size: 1.2rem; }
  .header-badge { display: none; }
}
