/* LeiloesRF — Design System v2 */
:root {
  --bg:         #0a0c10;
  --bg2:        #111318;
  --bg3:        #181c24;
  --bg4:        #1e2330;
  --border:     #252b3b;
  --border2:    #2e3650;
  --text:       #e8edf5;
  --text2:      #8892a4;
  --text3:      #4a5568;
  --primary:    #5b6ef5;
  --primary2:   #4355e8;
  --primary-bg: #5b6ef515;
  --green:      #22d07a;
  --green-bg:   #0d2a1c;
  --yellow:     #f0b429;
  --yellow-bg:  #2a2008;
  --red:        #f05252;
  --red-bg:     #2a0d0d;
  --orange:     #f97316;
  --teal:       #14b8c4;
  --teal-bg:    #0a2025;
  --purple:     #a855f7;
  --purple-bg:  #1e0a2a;
  --radius:     10px;
  --radius-lg:  16px;
  --shadow:     0 4px 24px rgba(0,0,0,.5);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { opacity: .85; }
img { max-width: 100%; }

/* ── SIDEBAR ── */
.sidebar {
  position: fixed; top: 0; left: 0;
  width: 220px; height: 100vh;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  z-index: 100; transition: transform .25s ease;
}
.sidebar-logo {
  padding: 18px 16px 14px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.sidebar-logo-icon {
  width: 32px; height: 32px;
  background: var(--primary);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
.sidebar-logo-name { font-size: 15px; font-weight: 700; letter-spacing: -.3px; }
.sidebar-logo-sub  { font-size: 10px; color: var(--text3); margin-top: 1px; }

.sidebar-nav { flex: 1; padding: 10px 8px; overflow-y: auto; }
.nav-section {
  font-size: 10px; font-weight: 600; color: var(--text3);
  text-transform: uppercase; letter-spacing: 1px;
  padding: 10px 8px 4px;
}
.nav-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: 8px;
  color: var(--text2); font-size: 13px; font-weight: 500;
  cursor: pointer; margin-bottom: 1px; transition: all .15s;
  text-decoration: none;
}
.nav-item:hover  { background: var(--bg3); color: var(--text); }
.nav-item.active { background: var(--primary-bg); color: var(--primary); }
.nav-item .ni    { font-size: 15px; width: 18px; text-align: center; flex-shrink: 0; }
.nav-item .nb    { margin-left: auto; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 20px; }
.nb-red    { background: var(--red-bg);   color: var(--red); }
.nb-green  { background: var(--green-bg); color: var(--green); }
.nb-yellow { background: var(--yellow-bg);color: var(--yellow); }

.sidebar-footer { padding: 12px; border-top: 1px solid var(--border); }
.user-card {
  display: flex; align-items: center; gap: 10px;
  padding: 8px; border-radius: var(--radius);
  background: var(--bg3);
}
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; flex-shrink: 0;
}
.user-name  { font-size: 13px; font-weight: 600; }
.plan-badge {
  font-size: 10px; font-weight: 700;
  padding: 1px 7px; border-radius: 20px; text-transform: uppercase;
}
.plan-free    { background: var(--bg4);       color: var(--text2); }
.plan-pro     { background: var(--primary-bg);color: var(--primary); }
.plan-empresa { background: var(--yellow-bg); color: var(--yellow); }

/* ── MAIN ── */
.main { margin-left: 220px; min-height: 100vh; }

.topbar {
  height: 56px; background: var(--bg2);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 24px; gap: 14px;
  position: sticky; top: 0; z-index: 90;
}
.topbar-title { font-size: 16px; font-weight: 700; flex: 1; }
.topbar-search {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 12px; width: 260px;
}
.topbar-search input {
  background: none; border: none; outline: none;
  color: var(--text); font-size: 13px; width: 100%;
}
.topbar-search input::placeholder { color: var(--text3); }
.topbar-sync { font-size: 11px; color: var(--text3); }

.page-body { padding: 24px; }

/* ── STATS GRID ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px; margin-bottom: 24px;
}
.stat-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px 20px;
}
.stat-icon  { font-size: 20px; margin-bottom: 8px; }
.stat-label {
  font-size: 11px; font-weight: 600; color: var(--text2);
  text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px;
}
.stat-value { font-size: 26px; font-weight: 800; letter-spacing: -1px; margin-bottom: 3px; }
.stat-sub   { font-size: 11px; color: var(--text3); }

/* ── CARDS ── */
.card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
}
.card-title { font-size: 13px; font-weight: 600; }
.card-body  { padding: 18px; }

/* ── GRID ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 18px; }

/* ── TAGS / BADGES ── */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; border-radius: 20px;
  font-size: 11px; font-weight: 600;
}
.tag-green  { background: var(--green-bg);  color: var(--green); }
.tag-yellow { background: var(--yellow-bg); color: var(--yellow); }
.tag-red    { background: var(--red-bg);    color: var(--red); }
.tag-blue   { background: #0d1a2e;          color: #60a5fa; }
.tag-teal   { background: var(--teal-bg);   color: var(--teal); }
.tag-gray   { background: var(--bg3);       color: var(--text2); }
.tag-purple { background: var(--purple-bg); color: var(--purple); }

/* Fonte badge */
.fonte {
  font-size: 10px; font-weight: 700;
  padding: 1px 6px; border-radius: 4px; text-transform: uppercase;
}
.fonte-rf  { background: #1a1030; color: #a78bfa; }
.fonte-cef { background: #0a1a1a; color: #2dd4bf; }
.fonte-bb  { background: #0a1520; color: #60a5fa; }

/* ── SCORE ── */
.score-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 50%;
  font-size: 13px; font-weight: 800;
  border: 2px solid currentColor; flex-shrink: 0;
}

/* ── LOTE CARD ── */
.lote-row {
  display: flex; gap: 14px;
  padding: 13px 0; border-bottom: 1px solid var(--border);
}
.lote-row:last-child { border-bottom: none; }
.lote-thumb {
  width: 58px; height: 58px; border-radius: 8px;
  object-fit: cover; flex-shrink: 0;
  background: var(--bg3);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: var(--text3);
}
.lote-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }
.lote-info { flex: 1; min-width: 0; }
.lote-title {
  font-size: 13px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 3px;
}
.lote-meta  { font-size: 11px; color: var(--text2); margin-bottom: 5px; }
.lote-tags  { display: flex; gap: 5px; flex-wrap: wrap; }
.lote-right { text-align: right; flex-shrink: 0; }
.lote-price { font-size: 14px; font-weight: 700; margin-top: 4px; }
.lote-discount { font-size: 11px; font-weight: 600; color: var(--green); }

/* ── TABELA ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  text-align: left; padding: 10px 14px;
  font-size: 11px; font-weight: 600; color: var(--text2);
  text-transform: uppercase; letter-spacing: .5px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody tr { border-bottom: 1px solid var(--border); transition: background .1s; }
tbody tr:hover { background: var(--bg3); }
tbody tr:last-child { border-bottom: none; }
tbody td { padding: 11px 14px; vertical-align: middle; font-size: 13px; }

/* ── BOTÕES ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 8px;
  font-size: 12px; font-weight: 600;
  cursor: pointer; border: none; transition: all .15s;
  white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary2); }
.btn-ghost {
  background: transparent; color: var(--text2);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg3); color: var(--text); }
.btn-green { background: var(--green-bg); color: var(--green); border: 1px solid var(--green-bg); }
.btn-red   { background: var(--red-bg);   color: var(--red);   border: 1px solid var(--red-bg); }
.btn-sm    { padding: 5px 10px; font-size: 11px; border-radius: 6px; }
.btn-lg    { padding: 10px 20px; font-size: 14px; border-radius: 10px; }

/* ── FORM ── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--text2); margin-bottom: 5px; }
.form-control {
  width: 100%; background: var(--bg3);
  border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; padding: 9px 13px;
  font-size: 13px; outline: none; transition: border .15s;
}
.form-control:focus { border-color: var(--primary); }
.form-hint { font-size: 11px; color: var(--text3); margin-top: 4px; }
.form-select { appearance: none; cursor: pointer; }

/* ── ALERTS ── */
.alert {
  padding: 11px 16px; border-radius: 8px;
  font-size: 13px; margin-bottom: 14px;
  display: flex; align-items: center; gap: 10px;
}
.alert-success { background: var(--green-bg); border: 1px solid #1a4a30; color: var(--green); }
.alert-error   { background: var(--red-bg);   border: 1px solid #4a1a1a; color: var(--red); }
.alert-info    { background: var(--primary-bg);border: 1px solid #1a2060; color: var(--primary); }
.alert-warning { background: var(--yellow-bg); border: 1px solid #4a3a10; color: var(--yellow); }

/* ── PROGRESS ── */
.progress { height: 5px; background: var(--bg3); border-radius: 99px; overflow: hidden; }
.progress-bar { height: 100%; border-radius: 99px; transition: width .5s ease; }

/* ── FILTROS ── */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.filter-input, .filter-select {
  background: var(--bg2); border: 1px solid var(--border);
  color: var(--text); border-radius: 8px; padding: 7px 12px;
  font-size: 13px; outline: none;
}
.filter-input:focus, .filter-select:focus { border-color: var(--primary); }

/* ── FOTO DO LOTE ── */
.lote-gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.lote-gallery img {
  width: 100%; aspect-ratio: 1;
  object-fit: cover; border-radius: 8px;
  cursor: pointer; transition: opacity .15s;
}
.lote-gallery img:hover { opacity: .85; }

/* ── SCORE VISUAL ── */
.score-ring {
  width: 80px; height: 80px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; border: 3px solid currentColor; flex-shrink: 0;
}
.score-ring .score-num { font-size: 24px; font-weight: 900; line-height: 1; }
.score-ring .score-of  { font-size: 10px; color: var(--text3); }

/* ── RISCO ── */
.risco-baixo { color: var(--green); }
.risco-medio { color: var(--yellow); }
.risco-alto  { color: var(--red); }

/* ── MOBILE TOGGLE ── */
.menu-toggle { display: none; background: none; border: none; color: var(--text); font-size: 22px; cursor: pointer; }
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 99; }

/* ── PAGINAÇÃO ── */
.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 20px; flex-wrap: wrap; }

/* ── EMPTY STATE ── */
.empty-state {
  text-align: center; padding: 48px 24px; color: var(--text3);
}
.empty-state .empty-icon { font-size: 40px; margin-bottom: 12px; }
.empty-state .empty-title { font-size: 15px; font-weight: 600; color: var(--text2); margin-bottom: 6px; }
.empty-state .empty-sub   { font-size: 13px; }

/* ── CHIP CATEGORIA ── */
.chip {
  display: inline-flex; align-items: center;
  background: var(--bg3); border: 1px solid var(--border);
  padding: 4px 10px; border-radius: 20px;
  font-size: 12px; color: var(--text2); cursor: pointer;
  transition: all .15s;
}
.chip:hover, .chip.active { background: var(--primary-bg); border-color: var(--primary); color: var(--primary); }

/* ── RESPONSIVO ── */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.show { display: block; }
  .main { margin-left: 0; }
  .menu-toggle { display: block; }
  .topbar { padding: 0 16px; }
  .page-body { padding: 16px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .topbar-search { width: 160px; }
}
@media (max-width: 500px) {
  .stats-grid { grid-template-columns: 1fr; }
}
