:root {
  --bg: #0b0e14;
  --panel: #131722;
  --border: #232838;
  --text: #dfe4ee;
  --text-dim: #8892a6;
  --accent: #4fc3f7;
  --positive: #4caf82;
  --header-bg: #10131c;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
}

header {
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  padding: 20px 32px;
}

header h1 {
  margin: 0;
  font-size: 22px;
  color: var(--accent);
  letter-spacing: 0.02em;
}

.subtitle {
  margin: 4px 0 0;
  color: var(--text-dim);
  font-size: 13px;
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 32px 60px;
}

.search-section {
  position: relative;
  margin-bottom: 32px;
}

#search {
  width: 100%;
  padding: 12px 14px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 14px;
}

.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-top: 4px;
  max-height: 240px;
  overflow-y: auto;
  z-index: 10;
}

.search-results:empty { display: none; }

.search-result-item {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
}

.search-result-item:hover { background: #1a1f2e; }

.item-detail {
  margin-top: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px;
}

.item-detail.hidden { display: none; }

.item-detail h3 { margin-top: 0; color: var(--accent); }

.item-detail table { width: 100%; }

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

.section-header h2 { font-size: 16px; margin: 0; color: var(--text); }

.controls {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--text-dim);
}

.controls input {
  width: 60px;
  padding: 6px 8px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
}

button {
  padding: 8px 16px;
  background: var(--accent);
  color: #06121a;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  font-size: 13px;
}

button:hover { opacity: 0.9; }

.last-sync {
  color: var(--text-dim);
  font-size: 12px;
  margin-bottom: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

th, td {
  padding: 10px 12px;
  text-align: left;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
}

th {
  color: var(--text-dim);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.04em;
}

td.spread-pct { color: var(--positive); font-weight: 600; }

tbody tr:hover { background: #171c29; }

tbody tr:last-child td { border-bottom: none; }

.filter-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 14px;
  margin-bottom: 14px;
}

.filter-panel details { padding: 8px 0; }
.filter-panel details + details { border-top: 1px solid var(--border); }

.filter-panel summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
}

.filter-search {
  width: 100%;
  margin: 8px 0;
  padding: 6px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-size: 12px;
}

.filter-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 8px;
}

.filter-list-scroll {
  max-height: 220px;
  overflow-y: auto;
  display: block;
}

.filter-item {
  display: block;
  font-size: 12px;
  color: var(--text);
  white-space: nowrap;
  padding: 2px 0;
}

.filter-count { color: var(--text-dim); }
