:root {
  --sidebar-bg: #1d2733;
  --sidebar-fg: #c9d3df;
  --sidebar-active: #2f6fb3;
  --page-bg: #f4f6f9;
  --card-border: #e2e7ee;
  --muted: #6b7684;
}

body {
  background: var(--page-bg);
  color: #1f2933;
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 250px;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  color: var(--sidebar-fg);
  padding: 1rem 0.75rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: #fff;
  text-decoration: none;
  padding: 0.25rem 0.5rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 0.75rem;
}

.brand i {
  font-size: 1.6rem;
}

.brand span {
  font-weight: 600;
  font-size: 1.1rem;
  line-height: 1.1;
}

.brand small {
  display: block;
  font-weight: 400;
  font-size: 0.75rem;
  color: var(--sidebar-fg);
}

.nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-list a {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 0.65rem;
  border-radius: 6px;
  color: var(--sidebar-fg);
  text-decoration: none;
  font-size: 0.93rem;
}

.nav-list a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.nav-list a.active {
  background: var(--sidebar-active);
  color: #fff;
}

/* Content */
.content {
  flex: 1;
  min-width: 0;
  padding: 1.5rem 2rem 3rem;
}

.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.page-header h1 {
  font-size: 1.5rem;
  margin: 0;
}

.page-header p {
  margin: 0.15rem 0 0;
  color: var(--muted);
}

.card {
  border-color: var(--card-border);
}

.stat-card .value {
  font-size: 1.8rem;
  font-weight: 600;
  line-height: 1.1;
}

.stat-card .label {
  color: var(--muted);
  font-size: 0.85rem;
}

.sub-nav {
  margin-bottom: 1.25rem;
}

.table td,
.table th {
  vertical-align: middle;
}

.text-break-all {
  word-break: break-all;
}

@media (max-width: 800px) {
  .app-shell {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;
    position: static;
  }

  .content {
    padding: 1rem;
  }
}

/* Equivalence justification */
.justification {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.6rem;
  margin-top: 0.15rem;
}

.attr-ok {
  color: #146c43;
}

.attr-bad {
  color: #b02a37;
}

.attr-warn {
  color: #997404;
}

.attr-missing {
  color: var(--muted);
}

.suggestion-row + .suggestion-row {
  border-top: 1px dashed var(--card-border);
}

.review-item .description {
  font-weight: 600;
}

/* Price history */
.reference-card {
  border-left: 4px solid var(--sidebar-active);
}

.reference-value {
  font-size: 1.9rem;
  font-weight: 600;
  line-height: 1.2;
}

.row-excluded td {
  color: var(--muted);
}

.chart-box {
  position: relative;
  height: 280px;
}

.ai-opinion {
  flex-basis: 100%;
  color: var(--bs-primary-text-emphasis);
}

/* Comparison map */
.map-wrapper {
  max-height: 75vh;
}

.map-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  vertical-align: middle;
  white-space: nowrap;
}

.map-table thead tr:nth-child(2) th {
  top: 2.6rem;
}

.map-table .map-desc {
  min-width: 18rem;
  max-width: 28rem;
}

.map-table .map-supplier {
  border-left: 2px solid #adb5bd;
}

.map-table td.map-best {
  background: #d1e7dd;
  font-weight: 600;
}

.map-table td.map-missing {
  background: #eef0f3;
  color: var(--muted);
}

.map-link summary {
  color: var(--sidebar-active);
  cursor: pointer;
}
