@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=Geist:wght@300;400;500;600;700;800&display=swap');

:root {
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface2: #f8f9fc;
  --surface3: #f0f2f7;
  --border: #e5e9f2;
  --border-strong: #d0d6e4;
  --accent: #2563eb;
  --accent-light: #eff4ff;
  --accent-mid: #dbeafe;
  --accent2: #f97316;
  --accent2-light: #fff7ed;
  --green: #10b981;
  --green-light: #ecfdf5;
  --yellow: #f59e0b;
  --yellow-light: #fffbeb;
  --purple: #8b5cf6;
  --purple-light: #f5f3ff;
  --text: #0f172a;
  --text-dim: #475569;
  --text-muted: #94a3b8;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.07), 0 1px 3px rgba(0,0,0,0.04);
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Geist', 'Inter', system-ui, sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* HEADER */
.header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  display: flex; align-items: center; justify-content: space-between;
  height: 62px;
  position: sticky; top: 0; z-index: 100;
  box-shadow: var(--shadow-sm);
}
.logo { display: flex; align-items: center; gap: 12px; }
.logo-icon {
  width: 34px; height: 34px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.logo-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.logo-text { font-size: 15px; font-weight: 800; letter-spacing: -0.01em; color: var(--text); }
.logo-sub { font-size: 10px; color: var(--text-muted); font-family: 'IBM Plex Mono', monospace; margin-top: 1px; }

.badges { display: flex; gap: 8px; align-items: center; }
.live-badge {
  display: flex; align-items: center; gap: 6px;
  background: var(--green-light); border: 1px solid rgba(16,185,129,0.2);
  border-radius: 20px; padding: 5px 12px;
  font-size: 10px; font-family: 'IBM Plex Mono', monospace; color: var(--green); font-weight: 500;
}
.live-dot {
  width: 6px; height: 6px; background: var(--green); border-radius: 50%;
  animation: livepulse 2s ease-in-out infinite;
}
@keyframes livepulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.4;transform:scale(.7)} }
.state-badge {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; padding: 5px 14px;
  font-size: 10px; font-family: 'IBM Plex Mono', monospace; color: var(--text-dim); font-weight: 500;
}

/* MAIN */
.main { padding: 28px 32px; max-width: 1600px; margin: 0 auto; }

.page-title { margin-bottom: 22px; }
.page-title h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.03em; color: var(--text); margin-bottom: 4px; }
.page-title h1 span { color: var(--accent); }
.page-title p { font-size: 11px; color: var(--text-muted); font-family: 'IBM Plex Mono', monospace; }

/* STAT CARDS */
.stats-row { display: grid; grid-template-columns: repeat(5,1fr); gap: 12px; margin-bottom: 20px; }
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 18px 20px;
  box-shadow: var(--shadow-sm); transition: box-shadow 0.2s, transform 0.2s;
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.stat-icon {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; margin-bottom: 12px;
}
.stat-card.green .stat-icon { background: var(--green-light); }
.stat-card.orange .stat-icon { background: var(--accent2-light); }
.stat-card.blue   .stat-icon { background: var(--accent-light); }
.stat-card.yellow .stat-icon { background: var(--yellow-light); }
.stat-card.purple .stat-icon { background: var(--purple-light); }

.stat-label { font-size: 11px; color: var(--text-muted); font-weight: 500; margin-bottom: 4px; }
.stat-value { font-size: 28px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; margin-bottom: 4px; }
.stat-card.green  .stat-value { color: var(--green); }
.stat-card.orange .stat-value { color: var(--accent2); }
.stat-card.blue   .stat-value { color: var(--accent); }
.stat-card.yellow .stat-value { color: var(--yellow); }
.stat-card.purple .stat-value { color: var(--purple); }
.stat-sub { font-size: 10px; color: var(--text-muted); font-family: 'IBM Plex Mono', monospace; }

/* CONTROLS */
.controls { display: flex; gap: 8px; margin-bottom: 14px; align-items: center; flex-wrap: wrap; }
.search-wrap { flex: 1; min-width: 200px; position: relative; }
.search-icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; font-size: 14px; }
.search-box {
  width: 100%; background: var(--surface); border: 1px solid var(--border);
  border-radius: 9px; padding: 9px 12px 9px 34px;
  color: var(--text); font-family: inherit; font-size: 13px; outline: none;
  box-shadow: var(--shadow-sm); transition: border-color 0.2s, box-shadow 0.2s;
}
.search-box:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
.search-box::placeholder { color: var(--text-muted); }

select {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 9px; padding: 9px 28px 9px 12px;
  color: var(--text-dim); font-family: inherit; font-size: 12px; outline: none;
  cursor: pointer; box-shadow: var(--shadow-sm); transition: border-color 0.2s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2394a3b8'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }

.btn {
  padding: 9px 18px; border-radius: 9px; border: none;
  font-family: inherit; font-weight: 600; font-size: 12px;
  cursor: pointer; transition: all 0.18s; white-space: nowrap;
}
.btn-primary {
  background: var(--accent); color: white;
  box-shadow: 0 2px 8px rgba(37,99,235,0.25);
}
.btn-primary:hover { background: #1d4ed8; box-shadow: 0 4px 14px rgba(37,99,235,0.35); transform: translateY(-1px); }
.btn-outline {
  background: var(--surface); border: 1px solid var(--border); color: var(--text-dim);
  box-shadow: var(--shadow-sm);
}
.btn-outline:hover { border-color: var(--border-strong); color: var(--text); }

/* TABLE WRAPPER */
.table-wrapper { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-md); }
.table-header {
  padding: 14px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.table-title { font-size: 14px; font-weight: 700; color: var(--text); }
.table-count { font-size: 12px; color: var(--text-muted); font-family: 'IBM Plex Mono', monospace; }
.table-count strong { color: var(--accent); }

/* PROGRESS BAR */
.load-progress-bar { height: 3px; background: var(--border); display: none; }
.load-progress-bar.active { display: block; }
.load-progress-fill {
  height: 100%; background: linear-gradient(90deg, var(--accent), var(--purple));
  width: 0%; transition: width 0.5s ease; position: relative; overflow: hidden;
}
.load-progress-fill::after {
  content: ''; position: absolute; top:0; left:-50%; width:50%; height:100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
  animation: shimmer 1s ease-in-out infinite;
}
@keyframes shimmer { to { left: 150%; } }

/* TABLE */
table { width: 100%; border-collapse: collapse; }
thead th {
  padding: 10px 14px; text-align: left;
  font-size: 11px; color: var(--text-muted); font-weight: 600;
  background: var(--surface2); border-bottom: 1px solid var(--border);
  cursor: pointer; white-space: nowrap; user-select: none; transition: color 0.15s;
}
thead th:hover { color: var(--accent); }
thead th.sorted { color: var(--accent); }
thead th:nth-child(9), tbody td:nth-child(9),
thead th:nth-child(11), tbody td:nth-child(11) { text-align: center; }

tbody tr { border-bottom: 1px solid var(--border); transition: background 0.1s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--surface2); }
td { padding: 11px 14px; font-size: 12px; vertical-align: middle; }

/* CELL TYPES */
.parcel-id {
  font-family: 'IBM Plex Mono', monospace; font-size: 11px; font-weight: 500;
  color: var(--accent); background: var(--accent-light);
  border: 1px solid var(--accent-mid); border-radius: 4px;
  padding: 2px 6px; display: inline-block;
}
.owner-name { font-weight: 600; font-size: 12px; color: var(--text); }
.county-badge {
  display: inline-block; background: var(--surface3);
  border: 1px solid var(--border-strong); border-radius: 5px;
  padding: 2px 8px; font-size: 11px; font-family: 'IBM Plex Mono', monospace;
  color: var(--text-dim); font-weight: 500;
}
.acres { font-family: 'IBM Plex Mono', monospace; font-size: 12px; }
.class-badge {
  display: inline-block; padding: 3px 8px; border-radius: 5px;
  font-size: 10px; font-family: 'IBM Plex Mono', monospace;
  white-space: normal; overflow-wrap: anywhere; word-break: break-word;
  line-height: 1.3; font-weight: 500;
}
.class-residential { background:#eff6ff; border:1px solid #bfdbfe; color:#2563eb; }
.class-commercial   { background:#fff7ed; border:1px solid #fed7aa; color:#ea580c; }
.class-industrial   { background:#f5f3ff; border:1px solid #ddd6fe; color:#7c3aed; }
.class-vacant       { background:#f0fdf4; border:1px solid #bbf7d0; color:#15803d; }
.class-exempt       { background:#f8fafc; border:1px solid var(--border-strong); color:var(--text-muted); }

.auction-date { font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: #0369a1; font-weight: 500; }
.amount-cell  { font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--text-dim); }
.address-cell { font-size: 12px; color: var(--text-dim); max-width: 180px; white-space: normal; overflow-wrap: anywhere; word-break: break-word; line-height: 1.4; }

.status-badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 20px; font-size: 10px; font-family: 'IBM Plex Mono', monospace; font-weight: 500; white-space: nowrap; }
.status-upcoming { background:#f0fdf4; border:1px solid #bbf7d0; color:#15803d; }
.status-past     { background:var(--surface3); border:1px solid var(--border-strong); color:var(--text-muted); }
.status-dot { width:5px; height:5px; border-radius:50%; background:currentColor; flex-shrink:0; }
.status-upcoming .status-dot { animation: livepulse 1.5s infinite; }

.note-text { display:block; max-width:200px; white-space:normal; overflow-wrap:anywhere; word-break:break-word; line-height:1.4; font-size:12px; color:var(--text-dim); }
.note-empty { font-size:12px; color:var(--text-muted); }

.btn-note {
  background: var(--surface2); border: 1px solid var(--border-strong);
  border-radius: 6px; padding: 5px 10px; color: var(--text-dim);
  font-family: 'IBM Plex Mono', monospace; font-size: 10px; font-weight: 500;
  cursor: pointer; transition: all 0.18s; white-space: nowrap;
}
.btn-note:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }

.source-link {
  color: var(--accent); font-family: 'IBM Plex Mono', monospace; font-size: 11px;
  text-decoration: none; font-weight: 500; background: var(--accent-light);
  border: 1px solid var(--accent-mid); padding: 2px 8px; border-radius: 4px;
  display: inline-block; transition: background 0.15s;
}
.source-link:hover { background: var(--accent-mid); }

/* SKELETON */
.skeleton-row td { padding: 12px 14px; }
.skel {
  height: 12px; border-radius: 5px;
  background: linear-gradient(90deg, var(--surface2) 25%, var(--surface3) 50%, var(--surface2) 75%);
  background-size: 200% 100%;
  animation: skelPulse 1.4s ease-in-out infinite;
}
@keyframes skelPulse { 0%{background-position:200% 0} 100%{background-position:-200% 0} }
.skel-xs{width:50px} .skel-sm{width:80px} .skel-md{width:120px} .skel-lg{width:160px}

/* PAGINATION */
.pagination { display:flex; align-items:center; gap:6px; margin-top:16px; justify-content:center; flex-wrap:wrap; }
.page-btn {
  background:var(--surface); border:1px solid var(--border); border-radius:7px;
  padding:6px 13px; color:var(--text-dim); font-family:'IBM Plex Mono',monospace;
  font-size:11px; cursor:pointer; transition:all 0.18s; box-shadow:var(--shadow-sm); font-weight:500;
}
.page-btn:hover { border-color:var(--accent); color:var(--accent); }
.page-btn.active { border-color:var(--accent); background:var(--accent-light); color:var(--accent); }
.page-btn:disabled { opacity:.3; cursor:default; pointer-events:none; }
.page-info { font-family:'IBM Plex Mono',monospace; font-size:11px; color:var(--text-muted); }

/* NO RESULTS */
.no-results { text-align:center; padding:56px 24px; }
.no-results-icon { font-size:32px; margin-bottom:10px; opacity:.4; }
.no-results p { font-size:14px; font-weight:500; color:var(--text-dim); margin-bottom:4px; }
.no-results span { font-size:12px; font-family:'IBM Plex Mono',monospace; color:var(--text-muted); }

/* WATERMARK & FOOTER */
.watermark {
  text-align:center; padding:10px 16px;
  background:var(--accent-light); border:1px solid var(--accent-mid);
  border-radius:9px; margin-top:16px;
  font-size:11px; color:var(--text-muted); font-family:'IBM Plex Mono',monospace;
}
.watermark strong { color:var(--accent); }
.footer {
  margin-top:18px; padding:14px 0; border-top:1px solid var(--border);
  display:flex; align-items:center; justify-content:space-between;
  font-size:11px; color:var(--text-muted); font-family:'IBM Plex Mono',monospace;
}
.footer span { color:var(--accent); font-weight:600; }

/* UTILS */
.fade-in { animation:fadeIn .35s ease forwards; opacity:0; }
@keyframes fadeIn { to{opacity:1} }
@keyframes rowIn { from{opacity:0;transform:translateY(3px)} to{opacity:1;transform:translateY(0)} }

@media (max-width:1100px) { .stats-row{grid-template-columns:repeat(3,1fr)} }
@media (max-width:720px)  { .stats-row{grid-template-columns:repeat(2,1fr)} .main{padding:16px} .header{padding:0 16px} }

/* BACK LINK */
.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-family: 'IBM Plex Mono', monospace; font-weight: 500;
  color: var(--text-muted); text-decoration: none;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 7px; padding: 5px 12px;
  transition: color 0.15s, border-color 0.15s;
}
.back-link:hover { color: var(--accent); border-color: var(--accent); }

