/* ---------- Vorwerk web fonts ---------- */
@font-face {
  font-family: "Vorwerk";
  src: url("/static/fonts/Vorwerk-Light.woff2") format("woff2"),
    url("/static/fonts/Vorwerk-Light.woff") format("woff");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Vorwerk";
  src: url("/static/fonts/Vorwerk-Regular.woff2") format("woff2"),
    url("/static/fonts/Vorwerk-Regular.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Vorwerk";
  src: url("/static/fonts/Vorwerk-Medium.woff2") format("woff2"),
    url("/static/fonts/Vorwerk-Medium.woff") format("woff");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Vorwerk";
  src: url("/static/fonts/Vorwerk-Bold.woff2") format("woff2"),
    url("/static/fonts/Vorwerk-Bold.woff") format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ---------- Brand tokens + Bootstrap variable overrides ---------- */
:root {
  --vw-green: #00AC46;
  --vw-anthracite: #23282A;
  --vw-orange: #F5A01E;
  --vw-red: #F0415F;
  --vw-purple: #734BA5;
  --vw-blue: #3782CD;

  --bg: #F7F8F9;
  --surface: #FFFFFF;
  --surface-2: #ECEEF0;
  --border: #DDE1E4;
  --text: #23282A;
  --text-muted: #7A8085;
  --text-secondary: #3D4347;

  --shadow: 0 1px 2px rgba(35, 40, 42, 0.04), 0 4px 12px rgba(35, 40, 42, 0.06);

  /* Override Bootstrap CSS variables so components inherit Vorwerk palette */
  --bs-primary: var(--vw-green);
  --bs-primary-rgb: 0, 172, 70;
  --bs-secondary: var(--vw-anthracite);
  --bs-success: var(--vw-green);
  --bs-warning: var(--vw-orange);
  --bs-danger: var(--vw-red);
  --bs-info: var(--vw-blue);
  --bs-body-bg: var(--bg);
  --bs-body-color: var(--text);
  --bs-body-font-family: "Vorwerk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --bs-border-color: var(--border);
}

[data-theme="dark"] {
  --vw-green: #1FC25E;
  --bg: #15191B;
  --surface: #1E2326;
  --surface-2: #262C30;
  --border: #3A4045;
  --text: #ECEEF0;
  --text-muted: #9DA3A8;
  --text-secondary: #C7CCD0;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 12px rgba(0, 0, 0, 0.35);

  --bs-primary: var(--vw-green);
  --bs-primary-rgb: 31, 194, 94;
  --bs-body-bg: var(--bg);
  --bs-body-color: var(--text);
  --bs-border-color: var(--border);
  --bs-emphasis-color: var(--text);
  --bs-secondary-color: var(--text-muted);
}

/* ---------- Base ---------- */
body {
  font-family: var(--bs-body-font-family);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1 0 auto;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ---------- Buttons: force Vorwerk green ---------- */
.btn-primary {
  --bs-btn-bg: var(--vw-green);
  --bs-btn-border-color: var(--vw-green);
  --bs-btn-hover-bg: #009b3f;
  --bs-btn-hover-border-color: #009b3f;
  --bs-btn-active-bg: #008a37;
  --bs-btn-active-border-color: #008a37;
  --bs-btn-disabled-bg: var(--vw-green);
  --bs-btn-disabled-border-color: var(--vw-green);
  --bs-btn-color: #fff;
  --bs-btn-hover-color: #fff;
  --bs-btn-active-color: #fff;
  --bs-btn-disabled-color: #fff;
}

.btn-primary:focus-visible,
.btn-primary:focus {
  box-shadow: 0 0 0 0.25rem rgba(0, 172, 70, 0.35);
}

/* ---------- Topbar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar .brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar .brand .logo {
  height: 28px;
}

.topbar .brand .title {
  font-weight: 500;
  font-size: 18px;
  letter-spacing: 0.2px;
}

.topbar .right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Logo theme swap. Default-hide the dark/white logo so any moment where
   data-theme is unset (first paint pre-script, or an unexpected stored
   value) doesn't render both logos stacked. The light logo is the safe
   fallback; the dark one is only revealed in explicit dark theme. */
.logo-dark {
  display: none;
}
[data-theme="dark"] .logo-light {
  display: none;
}
[data-theme="dark"] .logo-dark {
  display: revert;
}

/* ---------- Stage pill (EXPERIMENTAL / BETA) ---------- */
.stage-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--vw-orange);
  color: #fff;
  border: 1px solid var(--vw-orange);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.stage-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  background: #fff;
  border-radius: 50%;
  display: inline-block;
}

.stage-beta {
  background: var(--vw-blue);
  border-color: var(--vw-blue);
}

/* ---------- Theme toggle ---------- */
.theme-toggle {
  border-color: var(--border);
  color: var(--text-secondary);
  padding: 4px 10px;
  font-size: 14px;
  line-height: 1;
}

.theme-toggle:hover {
  background: var(--surface-2);
}

[data-theme="light"] .theme-icon-dark,
[data-theme="dark"] .theme-icon-light {
  display: none;
}

/* ---------- User chip ---------- */
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.user-chip .avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--vw-green);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 11px;
}

/* ---------- Hero ---------- */
.hero {
  padding: 48px 32px 24px;
  max-width: 1280px;
  margin: 0 auto;
}

.hero h1 {
  font-size: 36px;
  font-weight: 700;
  margin: 0 0 8px;
  letter-spacing: -0.3px;
}

.hero .lede {
  font-size: 16px;
  color: var(--text-muted);
  max-width: 720px;
  margin: 0;
}

.hero .accent {
  color: var(--vw-green);
}

/* ---------- Section ---------- */
.section {
  padding: 24px 32px;
  max-width: 1280px;
  margin: 0 auto;
}

.section h2 {
  font-size: 20px;
  font-weight: 500;
  margin: 0 0 16px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.section h2 .count {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 400;
}

/* ---------- Catalog grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.card-link {
  color: inherit;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.15s ease, border-color 0.15s ease;
  box-shadow: var(--shadow);
  height: 100%;
}

.card:hover {
  transform: translateY(-2px);
  border-color: var(--vw-green);
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.card-title {
  font-size: 17px;
  font-weight: 700;
  margin: 0;
  line-height: 1.3;
  color: var(--text);
}

.card-desc {
  font-size: 13.5px;
  color: var(--text-secondary);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 60px;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.3px;
  border: 1px solid transparent;
}

.badge-live {
  background: rgba(0, 172, 70, 0.12);
  color: var(--vw-green);
  border-color: rgba(0, 172, 70, 0.25);
}

.badge-soon {
  background: rgba(245, 160, 30, 0.14);
  color: var(--vw-orange);
  border-color: rgba(245, 160, 30, 0.3);
}

.badge-planned {
  background: rgba(115, 75, 165, 0.14);
  color: var(--vw-purple);
  border-color: rgba(115, 75, 165, 0.3);
}

[data-theme="dark"] .badge-live {
  background: rgba(31, 194, 94, 0.15);
}

[data-theme="dark"] .badge-soon {
  background: rgba(245, 160, 30, 0.18);
}

[data-theme="dark"] .badge-planned {
  background: rgba(155, 115, 205, 0.18);
  color: #B89BE0;
  border-color: rgba(155, 115, 205, 0.35);
}

.badge-stage,
.badge-version,
.badge-server {
  background: var(--surface-2);
  color: var(--text-secondary);
  border-color: var(--border);
  font-family: monospace;
  font-size: 10.5px;
}

.badge-server {
  font-family: inherit;
  font-size: 11px;
}

[data-theme="dark"] .badge-stage,
[data-theme="dark"] .badge-version,
[data-theme="dark"] .badge-server {
  background: rgba(255, 255, 255, 0.08);
  color: #DDE1E4;
  border-color: rgba(255, 255, 255, 0.14);
}

.badge-status-active {
  background: rgba(0, 172, 70, 0.12);
  color: var(--vw-green);
  border-color: rgba(0, 172, 70, 0.25);
}

.badge-status-draft {
  background: rgba(115, 75, 165, 0.12);
  color: var(--vw-purple);
  border-color: rgba(115, 75, 165, 0.25);
}

.badge-status-deprecated {
  background: rgba(245, 160, 30, 0.14);
  color: var(--vw-orange);
  border-color: rgba(245, 160, 30, 0.3);
}

.badge-status-retired {
  background: rgba(35, 40, 42, 0.07);
  color: var(--text-muted);
  border-color: var(--border);
}

[data-theme="dark"] .badge-status-active {
  background: rgba(31, 194, 94, 0.18);
}

[data-theme="dark"] .badge-status-deprecated {
  background: rgba(245, 160, 30, 0.2);
}

[data-theme="dark"] .badge-status-draft {
  background: rgba(155, 115, 205, 0.2);
  color: #B89BE0;
}

[data-theme="dark"] .badge-status-retired {
  background: rgba(255, 255, 255, 0.06);
  color: #9CA0A5;
}

.badge-latest {
  background: var(--vw-green);
  color: #FFFFFF;
  border-color: var(--vw-green);
  font-weight: 600;
}

[data-theme="dark"] .badge-latest {
  background: #1FC25E;
  border-color: #1FC25E;
  color: #0B1A12;
}

.version-selector {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 14px;
  max-width: 360px;
}

.version-selector label {
  white-space: nowrap;
  margin-bottom: 0;
}

.version-selector select {
  max-width: 280px;
}

.sla-table {
  margin-top: 6px;
}

.badge-class-public {
  background: rgba(55, 130, 205, 0.12);
  color: var(--vw-blue);
  border-color: rgba(55, 130, 205, 0.25);
}

.badge-class-internal {
  background: rgba(35, 40, 42, 0.07);
  color: var(--text-secondary);
  border-color: var(--border);
}

.badge-class-confidential {
  background: rgba(245, 160, 30, 0.12);
  color: var(--vw-orange);
  border-color: rgba(245, 160, 30, 0.25);
}

.badge-class-secret {
  background: rgba(240, 65, 95, 0.12);
  color: var(--vw-red);
  border-color: rgba(240, 65, 95, 0.25);
}

[data-theme="dark"] .badge-class-internal {
  background: rgba(255, 255, 255, 0.06);
}

.badge-dpclass-source-aligned {
  background: rgba(55, 130, 205, 0.08);
  color: var(--vw-blue);
  border-color: rgba(55, 130, 205, 0.2);
}

.badge-dpclass-curated {
  background: rgba(0, 172, 70, 0.1);
  color: var(--vw-green);
  border-color: rgba(0, 172, 70, 0.22);
}

.badge-dpclass-analytics {
  background: rgba(115, 75, 165, 0.1);
  color: var(--vw-purple);
  border-color: rgba(115, 75, 165, 0.22);
}

.badge-dpclass-applied-ai {
  background: rgba(240, 65, 95, 0.1);
  color: var(--vw-red);
  border-color: rgba(240, 65, 95, 0.22);
}

[data-theme="dark"] .badge-dpclass-analytics {
  color: #B89BE0;
}

.card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border);
  padding-top: 10px;
  margin-top: auto;
  gap: 12px;
  min-height: 36px;
}

.entities {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  font-size: 16px;
}

.entities .icon-globe {
  font-size: 18px;
}

.entities .icon-group {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: var(--vw-green);
}

.entities .flag {
  font-size: 16px;
  line-height: 1;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.08));
}

.entities .more {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--surface-2);
  border-radius: 999px;
  padding: 2px 7px;
}

.owner {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.owner .dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--vw-purple);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9.5px;
  font-weight: 700;
}

/* ---------- Topbar nav ---------- */
.topbar-nav {
  display: flex;
  gap: 16px;
}

.topbar-nav-link {
  font-size: 14px;
  color: var(--text-secondary);
  padding: 6px 10px;
  border-radius: 6px;
  text-decoration: none;
}

.topbar-nav-link:hover {
  background: var(--surface-2);
  color: var(--text);
}

.topbar-nav-link.active {
  color: var(--vw-green);
  font-weight: 500;
}

/* Hamburger toggle that replaces the inline nav below md. The dropdown panel
   itself reuses .dropdown-menu styling (caret, hover, shadow). */
.topbar-menu {
  position: relative;
}

.topbar-menu-toggle {
  color: var(--text-secondary);
  font-size: 22px;
  line-height: 1;
  padding: 0 4px;
  background: transparent;
  transition: color 0.12s ease, background-color 0.12s ease;
  border-radius: 6px;
}

.topbar-menu-toggle:hover,
.topbar-menu-toggle:focus-visible {
  color: var(--text);
  background: var(--surface-2);
  outline: none;
}

.topbar-menu-toggle .hamburger-icon {
  display: inline-block;
}

/* Active nav item inside the hamburger dropdown — match the inline nav's
   green-accent treatment so it stays visually consistent. */
.topbar-menu .dropdown-item.active {
  color: var(--vw-green);
  background: transparent;
  font-weight: 500;
}

.topbar-menu .dropdown-item.active:hover {
  background: var(--surface-2);
}

/* ---------- Catalog page ---------- */
.catalog-section {
  padding-top: 32px;
}

.catalog-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 24px;
}

.catalog-header h1 {
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 4px;
}

.catalog-search {
  flex: 0 1 360px;
}

.catalog-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 32px;
}

@media (max-width: 768px) {
  .catalog-layout {
    grid-template-columns: 1fr;
  }
}

.catalog-filters {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  height: fit-content;
  position: sticky;
  top: 80px;
}

.filter-group {
  border-bottom: 1px solid var(--border);
  padding: 8px 0;
}

.filter-group:last-of-type {
  border-bottom: 0;
}

.filter-group summary {
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 0;
  color: var(--text);
}

.filter-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  padding: 4px 0;
  cursor: pointer;
}

.filter-check input {
  accent-color: var(--vw-green);
}

.filter-actions {
  margin-top: 16px;
}

.active-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.active-filters-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-right: 4px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  font-size: 12.5px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
  transition: background-color 0.15s, border-color 0.15s;
}

.filter-chip:hover {
  background: var(--vw-green);
  border-color: var(--vw-green);
  color: #fff;
}

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

.filter-chip:hover .filter-chip-group {
  color: rgba(255, 255, 255, 0.85);
}

.filter-chip-x {
  font-weight: 700;
  font-size: 14px;
  line-height: 1;
}

.filter-chip-clear {
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: underline;
  margin-left: auto;
}

.filter-chip-clear:hover {
  color: var(--vw-green);
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 24px;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 12px;
  color: var(--text-muted);
}

.pagination-nav {
  margin-top: 24px;
  text-align: center;
}

/* ---------- Detail page ---------- */
.detail-section {
  padding-top: 24px;
  max-width: 1100px;
}

.detail-breadcrumb {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
  display: flex;
  gap: 6px;
  align-items: center;
}

.detail-breadcrumb a {
  color: var(--vw-green);
}

.detail-breadcrumb a:hover {
  text-decoration: underline;
}

.detail-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px 24px;
  margin-bottom: 24px;
  align-items: start;
}

.detail-title {
  min-width: 0;
}

.detail-cta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .detail-header {
    grid-template-columns: 1fr;
  }

  .detail-cta {
    align-items: flex-start;
    text-align: left;
  }
}

.detail-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 32px;
  padding: 12px 16px;
  margin-bottom: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 13px;
}

.detail-fact {
  display: flex;
  align-items: center;
  gap: 8px;
}

.detail-fact .label {
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.04em;
}

.detail-fact .value {
  color: var(--text);
  font-weight: 500;
}

.detail-fact .value.entities {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.detail-fact .tag {
  display: inline-block;
  padding: 2px 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 400;
  margin-right: 4px;
}

.detail-title h1 {
  font-size: 32px;
  font-weight: 700;
  margin: 0 0 8px;
}

.detail-title .lede {
  font-size: 16px;
  color: var(--text-secondary);
  margin: 0 0 16px;
}

.detail-aside {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}

.detail-aside-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.detail-aside-row:last-child {
  border-bottom: 0;
}

.detail-aside-row .label {
  color: var(--text-muted);
}

.detail-aside-row .value {
  color: var(--text);
  font-weight: 500;
  text-align: right;
}

.detail-aside-row .tag {
  display: inline-block;
  background: var(--surface-2);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 11px;
  margin-left: 4px;
}

.detail-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.detail-tabs .tab {
  background: transparent;
  border: 0;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

.detail-tabs .tab.active {
  color: var(--vw-green);
  border-bottom-color: var(--vw-green);
}

.detail-tabs .tab:hover:not(.disabled) {
  color: var(--text);
}

.detail-tabs .tab.disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.detail-tabs .tab .muted {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
}

.tab-panel {
  display: none;
}

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

.tab-panel h3 {
  font-size: 18px;
  font-weight: 500;
  margin: 24px 0 8px;
}

.tab-panel h4 {
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.overview-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
}

.overview-block p:last-child {
  margin-bottom: 0;
}

.overview-block ul {
  padding-left: 18px;
  margin-bottom: 0;
}

.stakeholders {
  list-style: none;
  padding: 0;
  margin: 0;
}

.stakeholders li {
  padding: 4px 0;
  font-size: 13.5px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  display: inline-block;
  background: var(--surface-2);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 11.5px;
  color: var(--text-secondary);
}

.prio-table {
  width: 100%;
  font-size: 13px;
}

.prio-table th {
  font-weight: 400;
  color: var(--text-secondary);
  padding: 4px 0;
  text-align: left;
}

.prio-table td {
  text-align: right;
  padding: 4px 0;
}

.rating {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.4px;
}

.rating-high {
  background: rgba(0, 172, 70, 0.15);
  color: var(--vw-green);
}

.rating-medium {
  background: rgba(245, 160, 30, 0.15);
  color: var(--vw-orange);
}

.rating-low {
  background: rgba(240, 65, 95, 0.15);
  color: var(--vw-red);
}

.request-access-cta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-top: 24px;
}

.schema-block {
  margin-bottom: 32px;
}

.schema-block h3 .muted {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 14px;
  font-family: monospace;
}

.schema-table {
  width: 100%;
  font-size: 13.5px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  border-collapse: separate;
  border-spacing: 0;
}

.schema-table thead th {
  background: var(--surface-2);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.schema-table tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

.schema-table tbody tr:last-child td {
  border-bottom: 0;
}

.schema-table code {
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12.5px;
}

.type-pill {
  display: inline-block;
  background: var(--surface-2);
  padding: 1px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-family: monospace;
  color: var(--text-secondary);
}

.pk-mark {
  color: var(--vw-orange);
  font-weight: 700;
  font-size: 11px;
}

/* ---------- Auth pages (login / logged out) ---------- */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 32px;
}

/* Override the global `main { flex: 1 0 auto }` so auth pages can vertically
   center the shell. Without this, main grows to full viewport height and the
   logo + card cluster at the top. */
.auth-page > main {
  flex: 0 0 auto;
}

.auth-shell {
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.auth-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin: 0;
}

.auth-brand-logo {
  height: 90px;
}

.auth-brand h1 {
  font-size: 22px;
  font-weight: 500;
  margin: 0;
  letter-spacing: 0.2px;
  color: var(--text);
}

.auth-card {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.auth-card .login-hint {
  text-align: center;
}

/* ---------- Dropdown menu (theme-aware Bootstrap override) ---------- */
.dropdown-menu {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 6px;
  margin-top: 10px;
  min-width: 180px;
  color: var(--text);
}

/* Caret pointing up at the user-chip trigger. Two stacked triangles so the
   border colour wraps the fill. Centered horizontally on the menu —
   `left: 50%` is enough because the element is 0-width, so the triangle
   (drawn by the borders) sits symmetrically around the center point. */
.dropdown-menu::before,
.dropdown-menu::after {
  content: "";
  position: absolute;
  width: 0;
  height: 0;
  border-style: solid;
  left: 50%;
}

.dropdown-menu::before {
  top: -8px;
  border-width: 0 8px 8px;
  border-color: transparent transparent var(--border);
}

.dropdown-menu::after {
  top: -7px;
  border-width: 0 7px 7px;
  border-color: transparent transparent var(--surface);
}

/* Caret anchored to the right edge for dropdowns that open from a
   right-aligned trigger (user-chip uses `dropdown-menu-end`). */
.user-dropdown .dropdown-menu::before,
.user-dropdown .dropdown-menu::after {
  left: auto;
  right: 14px;
}

/* Caret anchored to the left edge for dropdowns that open from a
   left-aligned trigger (hamburger sits on the left of the topbar). */
.topbar-menu .dropdown-menu::before,
.topbar-menu .dropdown-menu::after {
  left: 14px;
}

.dropdown-item {
  color: var(--text);
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 14px;
  transition: background-color 0.12s ease, color 0.12s ease;
}

.dropdown-item:hover,
.dropdown-item:focus,
.dropdown-item:focus-visible {
  background: var(--surface-2);
  color: var(--text);
  outline: none;
}

.dropdown-item:active {
  background: var(--surface-2);
  color: var(--text);
}

.dropdown-divider {
  border-color: var(--border);
  margin: 6px 4px;
}

/* External link in the user dropdown: label on the left, arrow on the right. */
.dropdown-item-external {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dropdown-item-external .external-arrow {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1;
  transition: transform 0.12s ease, color 0.12s ease;
}

.dropdown-item-external:hover .external-arrow {
  color: var(--vw-green);
  transform: translate(2px, -2px);
}

[data-theme="dark"] .dropdown-divider {
  border-color: var(--border);
}

.user-chip.btn:focus {
  box-shadow: none;
}

/* ---------- Footer ---------- */
.footer {
  flex-shrink: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 16px 32px;
  margin-top: 48px;
  color: var(--text-muted);
  font-size: 12.5px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Row 1: centered text with the theme toggle right-aligned. Three-column
   grid keeps the text dead-centered even though the toggle sits on the
   right edge. */
.footer .footer-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
}

.footer .footer-text {
  grid-column: 2;
  text-align: center;
}

.footer .footer-theme-toggle {
  grid-column: 3;
  justify-self: end;
}

.footer .footer-heart {
  color: #e25563;
  margin: 0 2px;
}

/* Row 2: logo, centered under the text. */
.footer .footer-logo-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
}

.footer .footer-logo {
  height: 20px;
  opacity: 0.85;
}

/* ---------- Stakeholder cards (detail Overview) ---------- */
.stakeholder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.stakeholder-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
}

.stakeholder-avatar {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.5px;
  background: var(--text-muted);
}

.stakeholder-card[data-role="owner"] .stakeholder-avatar {
  background: var(--vw-green);
}

.stakeholder-card[data-role="data_product_owner"] .stakeholder-avatar {
  background: var(--vw-blue);
}

.stakeholder-card[data-role="steward"] .stakeholder-avatar {
  background: var(--vw-purple);
}

.stakeholder-card[data-role="platform_owner"] .stakeholder-avatar {
  background: var(--vw-orange);
}

.stakeholder-card[data-role="producer"] .stakeholder-avatar {
  background: var(--vw-red);
}

.stakeholder-card.stakeholder-empty .stakeholder-avatar {
  background: transparent;
  border: 1px dashed var(--border);
  color: var(--text-muted);
}

.stakeholder-meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.stakeholder-meta .role-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.stakeholder-meta .name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stakeholder-meta .entity-chip {
  display: inline-block;
  width: fit-content;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0 6px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.3px;
  margin-top: 2px;
}