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

:root {
  --bg: #0e0e0e;
  --bg-surface: #161616;
  --bg-hover: #1e1e1e;
  --border: rgba(255, 255, 255, 0.08);
  --border-mid: rgba(255, 255, 255, 0.14);
  --text-primary: #e8e8e6;
  --text-secondary: #888884;
  --text-muted: #555552;
  --accent: #c8a96e;
  --accent-bg: rgba(200, 169, 110, 0.12);
  --green: #5a9e6f;
  --green-bg: rgba(90, 158, 111, 0.12);
  --blue: #5a8fc4;
  --blue-bg: rgba(90, 143, 196, 0.12);
  --mark-bg: rgba(200, 169, 110, 0.25);
  --mark-text: #c8a96e;
  --radius-sm: 5px;
  --radius-md: 8px;
  --radius-lg: 11px;
  --font: "Inter", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Mono", "Menlo", monospace;
  --header-height: 52px;
  --sidebar-width: 196px;
}

html,
body {
  height: 100%;
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── Header ── */

.header {
  position: sticky;
  top: 0;
  z-index: 10;
  height: var(--header-height);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-title {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--text-primary);
}

.header-count {
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* ── Layout ── */

.layout {
  display: flex;
  min-height: calc(100vh - var(--header-height));
}

/* ── Sidebar ── */

.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.sidebar-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.search-input {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-md);
  padding: 6px 10px;
  font-size: 13px;
  font-family: var(--font);
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-input:focus {
  border-color: var(--accent);
}

.filter-group {
  display: flex;
  flex-direction: column;
}

.chip {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-family: var(--font);
  color: var(--text-secondary);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  margin-bottom: 1px;
  transition:
    background 0.1s,
    color 0.1s;
}

.chip:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.chip.active {
  background: var(--bg-surface);
  color: var(--text-primary);
  font-weight: 500;
}

/* ── Main ── */

.main {
  flex: 1;
  padding: 1.25rem;
  min-width: 0;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

/* ── Cards ── */

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.1rem;
  transition: border-color 0.15s;
}

.card:hover {
  border-color: var(--border-mid);
}

.card-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 2px;
  font-variant-numeric: tabular-nums;
}

.card-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.card-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
}

.card-row:last-of-type {
  border-bottom: none;
}

.card-row-label {
  color: var(--text-secondary);
}

/* ── Badges ── */

.badge {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.badge-neutral {
  background: var(--bg-hover);
  color: var(--text-secondary);
}

.badge-success {
  background: var(--green-bg);
  color: var(--green);
}

.badge-info {
  background: var(--blue-bg);
  color: var(--blue);
}

/* ── OE tags ── */

.oe-list {
  margin-top: 9px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.oe-tag {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  background: var(--bg-hover);
  color: var(--text-muted);
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

/* ── Misc ── */

.muted {
  color: var(--text-muted);
}

.empty {
  color: var(--text-secondary);
  font-size: 13px;
  padding: 2rem 0;
  grid-column: 1 / -1;
}

mark {
  background: var(--mark-bg);
  color: var(--mark-text);
  border-radius: 2px;
  padding: 0 1px;
}

/* ── Scrollbar ── */

::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--border-mid);
  border-radius: 3px;
}
