/* BHI Research — static portal styles. */

:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --border: #e6e2db;
  --border-strong: #c9c2b6;
  --text: #1d1c1a;
  --text-muted: #6b6660;
  --accent: #b14a2c;
  --accent-soft: #f5e6df;
  --good: #2c7a4f;
  --warn: #b48a1c;
  --bad: #b13a2c;
  --shadow: 0 1px 2px rgba(20, 16, 10, 0.04), 0 8px 24px rgba(20, 16, 10, 0.04);
  --radius: 6px;
  --row-hover: #f3efe7;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.topbar__brand {
  display: flex;
  align-items: baseline;
  gap: 14px;
}
.topbar__brand a {
  color: var(--text);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.01em;
}
.topbar__tag {
  color: var(--text-muted);
  font-size: 12px;
}

.topbar__search input {
  width: 320px;
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  background: var(--surface);
}
.topbar__search input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 24px;
  padding: 24px;
  align-items: start;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: 24px;
}

.sidebar h2 {
  margin: 0 0 12px;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.filters {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

.filters form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.filters label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--text-muted);
}
.filters label span {
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.filters select {
  padding: 7px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-size: 13px;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
}
.filters select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 14px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: white;
  border-radius: var(--radius);
  font-size: 13px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.1s ease;
}
.btn:hover {
  background: #973f25;
}
.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn--ghost:hover {
  background: var(--row-hover);
}
.btn--back {
  margin-bottom: 16px;
}

.content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--shadow);
  min-height: 400px;
}
.content--hidden {
  display: none;
}

.content__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 16px;
}
.content__head h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}
.content__count {
  color: var(--text-muted);
  font-size: 13px;
}

.table-wrap {
  overflow-x: auto;
}

.entries {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.entries th,
.entries td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.entries th {
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-strong);
}
.entries tbody tr {
  cursor: pointer;
}
.entries tbody tr:hover {
  background: var(--row-hover);
}
.entries__empty td {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 12px;
  cursor: default;
}
.entries__empty:hover {
  background: transparent;
}

.col-title {
  min-width: 240px;
}

.entry-title {
  font-weight: 500;
}
.entry-summary {
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 2px;
}

.tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  background: var(--row-hover);
  color: var(--text);
  border: 1px solid var(--border);
  white-space: nowrap;
}
.tag--good {
  background: #e7f1ec;
  color: var(--good);
  border-color: #c8dfd2;
}
.tag--warn {
  background: #f6efd9;
  color: var(--warn);
  border-color: #e3d5a1;
}
.tag--bad {
  background: #f6dad5;
  color: var(--bad);
  border-color: #e6b6ad;
}

.detail h1 {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.detail__meta {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 16px;
}
.detail__meta a {
  word-break: break-all;
}
.detail__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}

.detail__section {
  margin: 24px 0;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.detail__section h2 {
  margin: 0 0 8px;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.tier2-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.tier2-grid > div h3 {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 600;
}
.tier2-grid p {
  margin: 0;
  font-size: 14px;
}

.kpi-list,
.quote-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.kpi {
  display: grid;
  grid-template-columns: 180px auto 1fr;
  gap: 8px;
  align-items: baseline;
  font-size: 13px;
}
.kpi__name {
  color: var(--text-muted);
}
.kpi__value {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.kpi__context {
  color: var(--text-muted);
  font-size: 12px;
}
.quote {
  border-left: 3px solid var(--accent);
  padding-left: 12px;
  font-size: 14px;
}
.quote__text {
  font-style: italic;
}
.quote__attr {
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 4px;
}
