:root {
  color-scheme: light;
  --bg: #f7f9fc;
  --panel: #ffffff;
  --panel-soft: #f9fbff;
  --line: #d9e3f2;
  --line-strong: #b8c7dc;
  --text: #07142f;
  --muted: #60708c;
  --soft: #8a98ae;
  --blue: #2563eb;
  --blue-soft: #eaf1ff;
  --green: #16a36b;
  --green-soft: #e7f7ef;
  --purple: #7658dc;
  --purple-soft: #f0ecff;
  --amber: #de7f08;
  --amber-soft: #fff4df;
  --red: #d92d20;
  --shadow: 0 18px 60px rgba(23, 37, 70, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 68% 0%, rgba(37, 99, 235, 0.08), transparent 32%),
    linear-gradient(180deg, #fbfdff 0%, var(--bg) 52%, #f4f7fb 100%);
  color: var(--text);
}

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

button,
input,
select {
  font: inherit;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 28px 20px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(20px);
}

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

.brand img {
  width: 54px;
  height: 54px;
  object-fit: contain;
}

.brand strong {
  display: block;
  font-size: 28px;
  letter-spacing: 0;
}

.brand span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.34em;
  text-transform: uppercase;
}

.nav-group {
  margin: 28px 0;
}

.nav-title {
  margin: 0 0 12px 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  margin: 4px 0;
  padding: 0 14px;
  border-radius: 8px;
  color: #263957;
  font-weight: 650;
}

.nav-item.active {
  background: var(--blue-soft);
  color: var(--blue);
}

.nav-count {
  min-width: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #dbe7ff;
  color: var(--blue);
  text-align: center;
  font-size: 12px;
  font-weight: 800;
}

.sidebar-card {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 28px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.main {
  min-width: 0;
  padding: 32px 28px 40px;
}

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

.page-title h1 {
  margin: 0 0 6px;
  font-size: 28px;
  line-height: 1.08;
}

.page-title p {
  margin: 0;
  color: var(--muted);
}

.search {
  width: min(440px, 100%);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: white;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
}

.search input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--text);
}

.filters,
.actions,
.chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.filters {
  padding: 16px 0;
}

.filter,
.button,
.chip,
.status {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: #233650;
  padding: 0 14px;
  font-weight: 750;
  white-space: nowrap;
}

.button.primary {
  border-color: var(--blue);
  background: var(--blue);
  color: white;
}

.button.disabled,
.filter:disabled,
.button:disabled,
.action-card.disabled {
  opacity: 0.52;
  cursor: not-allowed;
  pointer-events: none;
}

.chip.blue {
  background: var(--blue-soft);
  color: var(--blue);
}

.chip.green,
.status.good {
  background: var(--green-soft);
  color: var(--green);
  border-color: #aee5ca;
}

.chip.purple {
  background: var(--purple-soft);
  color: var(--purple);
}

.chip.amber,
.status.warn {
  background: var(--amber-soft);
  color: var(--amber);
  border-color: #f5c77f;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.evidence-grid {
  display: grid;
  grid-template-columns: minmax(360px, 0.82fr) minmax(520px, 1.18fr);
  gap: 24px;
  align-items: start;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

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

.panel-head h2,
.card h2 {
  margin: 0;
  font-size: 17px;
}

.session-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 14px;
  padding: 18px;
  border-bottom: 1px solid #e7edf6;
}

.session-row.active {
  background: #f2f7ff;
  outline: 1px solid #9ec2ff;
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #dbe7ff;
  color: var(--blue);
  font-weight: 850;
}

.row-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
  font-weight: 850;
}

.row-meta,
.muted {
  color: var(--muted);
  font-size: 13px;
}

.detail {
  padding: 22px;
}

.detail-title {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.detail-title h2 {
  margin: 0 0 8px;
  font-size: 26px;
}

.tabs {
  display: flex;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  margin: 12px 0 20px;
  overflow-x: auto;
}

.tab {
  padding: 13px 0;
  border-bottom: 3px solid transparent;
  color: #314763;
  font-weight: 800;
  white-space: nowrap;
}

.tab.active {
  color: var(--blue);
  border-color: var(--blue);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.metric {
  min-height: 140px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.metric strong {
  display: block;
  margin: 8px 0 4px;
  font-size: 26px;
}

.spark {
  height: 36px;
  margin-top: 16px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.14), rgba(36, 190, 177, 0.12));
  position: relative;
  overflow: hidden;
}

.spark::after {
  content: "";
  position: absolute;
  inset: 10px 8px;
  border-top: 3px solid currentColor;
  color: var(--blue);
  transform: skewY(-10deg);
}

.card-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr;
  gap: 18px;
  margin-top: 18px;
}

.card-grid.two-col {
  grid-template-columns: 1fr 1fr;
}

.card-grid.compact-metrics {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 18px;
}

.raw-frame {
  max-height: 520px;
  overflow: auto;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
  color: #223653;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.text-area {
  width: 100%;
  min-height: 150px;
  resize: vertical;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--text);
  background: white;
  font: inherit;
}

.signal-chart {
  height: 178px;
  border-radius: 8px;
  border: 1px solid #e2e8f3;
  background:
    linear-gradient(to right, transparent 24%, #e7edf6 24.4%, transparent 24.8%, transparent 49%, #e7edf6 49.4%, transparent 49.8%, transparent 74%, #e7edf6 74.4%, transparent 74.8%),
    linear-gradient(to bottom, transparent 31%, #e7edf6 31.4%, transparent 31.8%, transparent 63%, #e7edf6 63.4%, transparent 63.8%),
    linear-gradient(180deg, #fff, #f8fbff);
  position: relative;
}

.signal-chart::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  top: 50px;
  height: 56px;
  border-radius: 50%;
  border-top: 4px solid #1d8cff;
  border-bottom: 3px solid #8b5cf6;
  transform: skewX(-18deg);
}

.timeline {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 12px;
}

.timeline span {
  height: 8px;
  border-radius: 999px;
  background: var(--blue);
}

.timeline span:nth-child(2) { background: #24beb1; }
.timeline span:nth-child(3) { background: var(--amber); }
.timeline span:nth-child(4) { background: var(--purple); }

.vault-main {
  display: grid;
  grid-template-columns: 1fr;
  gap: 26px;
}

.vault-hero {
  padding: 28px;
}

.vault-status {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.trust-item {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.icon-circle {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green);
  font-weight: 900;
  font-size: 24px;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
}

.action-card {
  min-height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.action-card h2 {
  font-size: 18px;
  margin: 14px 0 8px;
}

.changes-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 20px;
}

.list-line {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid #e7edf6;
}

.auth-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.auth-form label {
  display: block;
  margin: 14px 0 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.auth-form input {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 12px 14px;
  background: white;
  color: var(--text);
}

.footer-note {
  margin-top: 26px;
  color: var(--muted);
  font-size: 13px;
}

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

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .sidebar-card {
    position: static;
    margin-top: 24px;
  }

  .evidence-grid,
  .card-grid,
  .changes-grid,
  .auth-grid {
    grid-template-columns: 1fr;
  }

  .metric-grid,
  .vault-status,
  .action-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .main,
  .sidebar {
    padding: 20px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .metric-grid,
  .vault-status,
  .action-grid {
    grid-template-columns: 1fr;
  }
}
