:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --surface2: #22263a;
  --border: #2e3347;
  --accent: #4f7cff;
  --accent2: #7c5cfc;
  --text: #e8eaf0;
  --muted: #7a80a0;
  --success: #22c55e;
  --warn: #f59e0b;
  --danger: #ef4444;
  --radius: 8px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Header */
header {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 0.75rem 2rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  white-space: nowrap;
  letter-spacing: -0.02em;
}
.logo:hover { text-decoration: none; }
.logo-icon { width: 22px; height: 22px; }

.main-nav { display: flex; gap: 0.25rem; }
.main-nav a {
  color: var(--muted);
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  font-size: 13px;
  transition: all 0.15s;
}
.main-nav a:hover { color: var(--text); background: var(--surface2); text-decoration: none; }

/* Main */
main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem 2rem 3rem;
}

h1 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 1.25rem;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text);
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

/* Breadcrumb */
.breadcrumb {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 1rem;
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--text); }

/* Dashboard cards */
.dashboard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 0.5rem;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.15s;
  text-decoration: none;
}
.card:hover { border-color: var(--accent); background: var(--surface2); text-decoration: none; }
.card-icon { font-size: 28px; }
.card-label { font-size: 16px; font-weight: 600; color: var(--text); }
.card-sub { font-size: 12px; color: var(--muted); }

/* Filter bar */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.filter-bar input {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 0.4rem 0.75rem;
  font-size: 13px;
  font-family: var(--font);
  width: 220px;
  outline: none;
  transition: border-color 0.15s;
}
.filter-bar input:focus { border-color: var(--accent); }
.filter-bar input::placeholder { color: var(--muted); }

.filter-bar button {
  background: var(--accent);
  border: none;
  border-radius: 6px;
  color: #fff;
  padding: 0.4rem 0.9rem;
  font-size: 13px;
  font-family: var(--font);
  cursor: pointer;
  transition: opacity 0.15s;
}
.filter-bar button:hover { opacity: 0.85; }

.reset {
  color: var(--muted);
  font-size: 13px;
  padding: 0.4rem 0.5rem;
}

.count {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
}

/* Table */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

thead th {
  background: var(--surface);
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  padding: 0.6rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody tr { border-bottom: 1px solid var(--border); }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--surface2); }
tbody td {
  padding: 0.55rem 0.75rem;
  vertical-align: top;
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}
tbody td:empty::after { content: '—'; color: var(--muted); }

/* Brands grid */
.brand-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
}

.brand-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  transition: all 0.15s;
}
.brand-card:hover { border-color: var(--accent); text-decoration: none; }
.brand-name { font-weight: 600; font-size: 13px; color: var(--text); }
.brand-meta { font-size: 11px; color: var(--muted); }

/* Brand detail sections */
.doc-section {
  margin-bottom: 2.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

/* Tabs */
.tab-bar {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.75rem;
}

.tab-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  font-family: var(--font);
  font-size: 12px;
  padding: 0.3rem 0.7rem;
  transition: all 0.15s;
}
.tab-btn:hover { color: var(--text); border-color: var(--accent); }
.tab-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Markdown body */
.markdown-body { color: var(--text); line-height: 1.7; }
.markdown-body h1 { font-size: 18px; margin: 1.25rem 0 0.5rem; letter-spacing: -0.02em; }
.markdown-body h2 { font-size: 15px; margin: 1.25rem 0 0.5rem; border: none; padding: 0; }
.markdown-body h3 { font-size: 13px; margin: 1rem 0 0.4rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.markdown-body p { margin-bottom: 0.75rem; }
.markdown-body ul, .markdown-body ol { padding-left: 1.5rem; margin-bottom: 0.75rem; }
.markdown-body li { margin-bottom: 0.25rem; }
.markdown-body strong { color: #fff; font-weight: 600; }
.markdown-body em { color: var(--muted); }
.markdown-body code {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 11.5px;
  padding: 0.1rem 0.35rem;
}
.markdown-body pre {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  padding: 1rem;
  margin-bottom: 1rem;
}
.markdown-body pre code { background: none; border: none; padding: 0; font-size: 12px; }
.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
  font-size: 13px;
}
.markdown-body table th {
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 0.5rem 0.75rem;
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.markdown-body table td {
  border: 1px solid var(--border);
  padding: 0.5rem 0.75rem;
  max-width: none;
  white-space: normal;
  overflow: visible;
}
.markdown-body table tr:hover td { background: var(--surface2); }
.markdown-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.5rem 0;
}
.markdown-body blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 1rem;
  color: var(--muted);
  margin: 0.75rem 0;
}
.markdown-body a { color: var(--accent); }

/* Misc */
.empty { color: var(--muted); padding: 1rem; }

@media (max-width: 700px) {
  header { padding: 0.75rem 1rem; }
  main { padding: 1rem 1rem 2rem; }
  .filter-bar input { width: 100%; }
}
