:root {
  color-scheme: dark;
  --chaga-red: #ff4b4b;
  --chaga-red-dark: #c90808;
  --success: #22d47b;
  --error-soft: #ff8b91;
  --sky: #5ec8ff;
  --gold: #ffd36a;
  --ink: #f2eeee;
  --muted: #a9a09a;
  --line: rgba(255, 255, 255, 0.11);
  --page: #11100f;
  --surface: #1a1918;
  --surface-soft: #232120;
  --surface-raised: #201e1d;
  --shadow: 0 18px 46px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button,
input,
select {
  font: inherit;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.landing {
  max-width: 960px;
  margin: 0 auto;
  padding: 52px 24px;
  display: grid;
  gap: 28px;
}

.landing.single-access {
  min-height: 100vh;
  place-content: center;
}

.landing-header {
  display: flex;
  align-items: center;
  gap: 16px;
}

.landing-header p:last-child {
  margin: 8px 0 0;
  color: var(--muted);
}

.sidebar {
  background: #111111;
  color: #fff;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

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

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--chaga-red);
  display: grid;
  place-items: center;
  font-weight: 800;
}

.brand-name {
  font-size: 17px;
  font-weight: 800;
}

.brand-subtitle {
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav-item {
  width: 100%;
  border: 0;
  border-radius: 8px;
  padding: 11px 12px;
  background: transparent;
  color: rgba(255, 255, 255, 0.76);
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  text-align: left;
}

.nav-item.active,
.nav-item:hover {
  background: rgba(255, 75, 75, 0.16);
  color: #fff;
}

.nav-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
}

.access-box {
  margin-top: auto;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.05);
}

.access-label {
  color: var(--gold);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.access-text {
  margin-top: 4px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.74);
}

.main {
  padding: 28px;
  display: grid;
  gap: 20px;
  align-content: start;
}

.support-page {
  max-width: 1440px;
  margin: 0 auto;
  padding: 28px;
  display: grid;
  gap: 18px;
}

.support-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.support-brand {
  align-items: flex-start;
}

.support-brand h1 {
  margin-bottom: 6px;
}

.support-brand p:last-child {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
}

.support-search-panel {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 12px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.support-search-field input {
  min-height: 48px;
  font-size: 15px;
}

.support-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.support-grid {
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.support-results {
  padding: 12px;
  display: grid;
  gap: 10px;
}

.support-result {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-raised);
  color: var(--ink);
  display: grid;
  gap: 5px;
  text-align: left;
  cursor: pointer;
}

.support-result:hover,
.support-result.selected {
  border-color: rgba(255, 75, 75, 0.34);
  background: rgba(255, 75, 75, 0.08);
}

.support-result span {
  color: var(--chaga-red);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.support-result strong {
  font-size: 14px;
}

.support-result small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--chaga-red);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 28px;
  line-height: 1.15;
}

h2 {
  margin-bottom: 4px;
  font-size: 16px;
}

.status-strip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
}

.status-dot.warning {
  background: var(--chaga-red);
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 180px 180px;
  gap: 12px;
}

.field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.field input,
.field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  min-height: 42px;
  padding: 0 12px;
  outline: none;
}

.field input:focus,
.field select:focus {
  border-color: var(--chaga-red);
  box-shadow: 0 0 0 3px rgba(255, 75, 75, 0.14);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

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

.metric-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.metric-value {
  margin-top: 8px;
  font-size: 26px;
  font-weight: 800;
}

.metric-change {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  min-width: 0;
}

.panel-header {
  padding: 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.panel-header p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
}

.ghost-button {
  border: 1px solid rgba(255, 75, 75, 0.32);
  background: rgba(255, 75, 75, 0.08);
  color: var(--chaga-red);
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 800;
}

.danger-button {
  border: 1px solid rgba(255, 75, 75, 0.38);
  background: var(--chaga-red-dark);
  color: #fff;
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 800;
}

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

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
  font-size: 13px;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

tbody tr {
  cursor: pointer;
}

tbody tr:hover,
tbody tr.selected {
  background: rgba(255, 75, 75, 0.08);
}

.muted-line {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.confidence {
  width: 120px;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.confidence span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--chaga-red), var(--gold));
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  text-transform: capitalize;
}

.badge.critical {
  background: rgba(255, 75, 75, 0.16);
  color: #ffb1b1;
}

.badge.high {
  background: rgba(255, 125, 129, 0.18);
  color: #ffc0c4;
}

.badge.medium {
  background: rgba(254, 184, 22, 0.18);
  color: #ffe0a0;
}

.badge.low {
  background: rgba(94, 200, 255, 0.14);
  color: #a8e2ff;
}

.details {
  padding: 18px;
  display: grid;
  gap: 14px;
}

.risk-score {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-radius: 8px;
  padding: 16px;
  color: #fff;
  background: #242424;
}

.risk-score.critical {
  background: var(--chaga-red-dark);
}

.risk-score.high {
  background: #7d242b;
}

.risk-score.medium {
  background: #70511c;
}

.risk-score.low {
  background: #1c5b70;
}

.risk-score h3 {
  margin: 4px 0 0;
  font-size: 18px;
}

.risk-score .detail-title {
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.72);
}

.risk-score strong {
  font-size: 26px;
}

.detail-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--surface-soft);
}

.detail-title {
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
}

.detail-text {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
}

.support-search-note {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(255, 75, 75, 0.28);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 75, 75, 0.08);
  color: var(--ink);
  font-size: 13px;
}

.support-search-note strong {
  color: var(--chaga-red);
}

.kv {
  display: grid;
  gap: 10px;
  margin: 0;
}

.kv div {
  display: grid;
  grid-template-columns: 94px minmax(0, 1fr);
  gap: 10px;
  align-items: baseline;
}

.kv dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.kv dd {
  margin: 0;
  font-size: 13px;
}

.activity-list,
.audit-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-size: 13px;
}

.audit-list {
  padding-left: 0;
  list-style: none;
}

.audit-list li {
  display: grid;
  gap: 3px;
  border-left: 3px solid rgba(255, 75, 75, 0.36);
  padding-left: 10px;
}

.audit-list span {
  color: var(--muted);
}

.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 12px 0;
}

.compare-grid.selfies {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.evidence-title {
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.score-strip {
  display: grid;
  grid-template-columns: 120px 120px minmax(0, 1fr);
  gap: 10px;
  margin-top: 12px;
}

.score-strip div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--surface-raised);
  display: grid;
  gap: 4px;
}

.score-strip span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.score-strip strong {
  font-size: 13px;
  overflow-wrap: anywhere;
}

.compare-tile {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--surface-raised);
  display: grid;
  gap: 8px;
}

.compare-tile strong {
  font-size: 13px;
}

.compare-tile span {
  color: var(--muted);
  font-size: 12px;
}

.evidence-image {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
}

.mock-document {
  height: 110px;
  border-radius: 6px;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 75, 75, 0.18), rgba(94, 200, 255, 0.12)),
    var(--surface-soft);
}

.mock-document::before,
.mock-document::after {
  content: "";
  position: absolute;
  background: rgba(255, 255, 255, 0.16);
}

.id-doc::before {
  left: 12px;
  top: 16px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
}

.id-doc::after {
  left: 68px;
  right: 14px;
  top: 20px;
  height: 10px;
  box-shadow: 0 20px 0 rgba(255, 255, 255, 0.12), 0 40px 0 rgba(255, 255, 255, 0.1);
}

.id-front::before {
  left: 12px;
  top: 16px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
}

.id-front::after {
  left: 68px;
  right: 14px;
  top: 20px;
  height: 10px;
  box-shadow: 0 20px 0 rgba(255, 255, 255, 0.12), 0 40px 0 rgba(255, 255, 255, 0.1);
}

.id-back::before {
  left: 14px;
  right: 14px;
  top: 18px;
  height: 14px;
  border-radius: 3px;
  box-shadow: 0 28px 0 rgba(255, 255, 255, 0.13), 0 56px 0 rgba(255, 255, 255, 0.1);
}

.id-back::after {
  right: 16px;
  bottom: 14px;
  width: 48px;
  height: 28px;
  border-radius: 4px;
}

.selfie-doc::before,
.selfie-center::before,
.selfie-left::before,
.selfie-right::before {
  left: 50%;
  top: 22px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  transform: translateX(-50%);
}

.selfie-doc::after,
.selfie-center::after,
.selfie-left::after,
.selfie-right::after {
  left: 30%;
  right: 30%;
  bottom: 18px;
  height: 24px;
  border-radius: 999px 999px 0 0;
}

.selfie-left::before {
  transform: translateX(-62%) rotate(-6deg);
}

.selfie-right::before {
  transform: translateX(-38%) rotate(6deg);
}

.kyc-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 8px 0 12px;
}

@media (max-width: 980px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 14px;
  }

  .nav {
    grid-template-columns: 1fr 1fr;
  }

  .access-box {
    display: none;
  }

  .toolbar,
  .metrics,
  .support-metrics,
  .support-grid,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .support-page {
    padding: 18px;
  }

  .support-topbar,
  .support-search-panel {
    display: grid;
    grid-template-columns: 1fr;
  }

  .compare-grid.selfies,
  .score-strip {
    grid-template-columns: 1fr;
  }
}
