:root {
  --bg: #f1eeee;
  --surface: #fffdfc;
  --surface-muted: #faf6f5;
  --ink: #241819;
  --muted: #67595a;
  --line: #e1d4d1;
  --accent: #7f1f1d;
  --accent-dark: #3f1114;
  --accent-soft: #a65a4c;
  --stable: #6f332c;
  --amber: #8a4b25;
  --red: #8f2421;
  --medium: #6f4c43;
  --shadow: 0 18px 44px rgba(63, 17, 20, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

[hidden] {
  display: none !important;
}

button,
select,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.splash-screen {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 28px;
  overflow: hidden;
  background: #271214;
  color: #fffdfc;
  padding: 32px;
}

.splash-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(90deg, rgba(184, 118, 104, 0.11) 1px, transparent 1px),
    linear-gradient(0deg, rgba(184, 118, 104, 0.08) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: 0.32;
}

.splash-screen.is-finished {
  animation: splashExit 420ms ease forwards;
  pointer-events: none;
}

.splash-stage,
.splash-copy,
.splash-progress {
  position: relative;
  z-index: 1;
}

.splash-stage {
  display: grid;
  width: min(290px, 62vw);
  aspect-ratio: 1;
  place-items: center;
  perspective: 920px;
  transform-style: preserve-3d;
}

.splash-logo {
  width: 44%;
  height: 44%;
  border: 1px solid #b87668;
  background: #2a1112;
  filter: drop-shadow(0 22px 30px rgba(0, 0, 0, 0.42));
  object-fit: contain;
  transform-style: preserve-3d;
  animation: logoSpin3d 4.6s cubic-bezier(0.2, 0.78, 0.2, 1) both;
}

.splash-orbit {
  position: absolute;
  border: 1px solid rgba(184, 118, 104, 0.78);
  transform-style: preserve-3d;
  animation: orbitGuard 4.6s ease-in-out both;
}

.splash-orbit-one {
  inset: 18%;
  transform: rotateX(68deg) rotateZ(12deg);
}

.splash-orbit-two {
  inset: 9%;
  border-color: rgba(127, 31, 29, 0.84);
  transform: rotateY(66deg) rotateZ(-18deg);
  animation-delay: 120ms;
}

.splash-orbit-three {
  inset: 2%;
  border-color: rgba(166, 90, 76, 0.56);
  transform: rotateX(28deg) rotateY(58deg);
  animation-delay: 240ms;
}

.splash-copy {
  max-width: 680px;
  text-align: center;
}

.splash-copy h1 {
  margin-bottom: 12px;
}

.splash-copy .eyebrow {
  color: #d8b6ae;
}

.splash-copy p:last-child {
  margin: 0 auto;
  max-width: 560px;
  color: #e7c8c0;
  line-height: 1.55;
}

.splash-progress {
  width: min(360px, 72vw);
  height: 5px;
  overflow: hidden;
  border: 1px solid #5b3632;
  background: #2a1112;
}

.splash-progress span {
  display: block;
  width: 100%;
  height: 100%;
  background: #a65a4c;
  transform-origin: left;
  animation: splashProgress 4.6s linear forwards;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: var(--bg);
  padding: clamp(18px, 4vw, 48px);
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  gap: 18px;
  width: min(1120px, 100%);
  align-items: stretch;
}

.login-panel,
.login-proof {
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.login-panel {
  background: var(--surface);
  padding: clamp(22px, 5vw, 48px);
}

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

.login-logo {
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  border: 1px solid #b87668;
  background: #2a1112;
  object-fit: contain;
}

.login-copy {
  max-width: 640px;
  margin: 18px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.login-form {
  display: grid;
  gap: 14px;
  margin-top: 26px;
}

.field {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-weight: 900;
}

.field span {
  color: var(--accent-dark);
  font-size: 0.75rem;
  text-transform: uppercase;
}

.field input,
.field select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  background: var(--surface-muted);
  color: var(--ink);
  padding: 10px 12px;
}

.field input:focus,
.field select:focus,
.primary-action:focus,
.secondary-action:focus,
.icon-button:focus,
.table-action:focus,
.nav-tab:focus {
  outline: 3px solid #e8c9bf;
  outline-offset: 2px;
}

.login-error {
  min-height: 20px;
  margin: 0;
  color: var(--red);
  font-size: 0.9rem;
  font-weight: 900;
}

.login-submit {
  min-height: 46px;
}

.login-proof {
  display: grid;
  align-content: center;
  background: #271214;
  color: #fffdfc;
  padding: clamp(22px, 4vw, 34px);
}

.login-proof .eyebrow {
  color: #d8b6ae;
}

.login-proof h2 {
  margin-bottom: 18px;
  font-size: 1.55rem;
}

.login-proof ul {
  display: grid;
  gap: 13px;
  margin: 0;
  padding-left: 20px;
  color: #e7c8c0;
  line-height: 1.5;
}

.app-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 276px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid #4a1a1a;
  background: #271214;
  color: #fff7f4;
  padding: 22px;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.brand-logo {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border: 1px solid #b87668;
  background: #2a1112;
  object-fit: contain;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 1.2rem;
}

.brand small {
  margin-top: 3px;
  color: #d8b6ae;
  font-size: 0.75rem;
}

.nav-tabs {
  display: grid;
  gap: 8px;
  margin-top: 34px;
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  border: 1px solid transparent;
  background: transparent;
  color: #ead6d0;
  padding: 10px 12px;
  text-align: left;
}

.nav-tab:hover,
.nav-tab.is-active {
  border-color: #a65a4c;
  background: #3a1718;
  color: #fffdfc;
}

.icon {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid #77504a;
  color: #ecd1c9;
  font-weight: 900;
  font-size: 0.72rem;
}

.sidebar-foot {
  position: absolute;
  right: 22px;
  bottom: 22px;
  left: 22px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid #5b3632;
  color: #d8b6ae;
  padding-top: 16px;
  font-size: 0.82rem;
}

.status-dot {
  width: 10px;
  height: 10px;
  background: #a65a4c;
  border: 2px solid #f4ddd5;
}

.workspace {
  min-width: 0;
  padding: 24px;
}

.topbar,
.section-heading,
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.topbar {
  min-height: 74px;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--accent-dark);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  line-height: 1.05;
}

h2 {
  margin-bottom: 0;
  font-size: 1.35rem;
}

h3 {
  margin-bottom: 4px;
  font-size: 1rem;
}

.topbar-actions,
.toolbar,
.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.session-pill {
  display: inline-flex;
  max-width: 320px;
  min-height: 32px;
  align-items: center;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  padding: 6px 10px;
  overflow: hidden;
  font-size: 0.78rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.primary-action,
.secondary-action,
.segment,
.icon-button,
select {
  min-height: 38px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  padding: 8px 12px;
}

.primary-action {
  border-color: var(--accent-dark);
  background: var(--accent-dark);
  color: #fffdfc;
  font-weight: 800;
}

.secondary-action {
  font-weight: 800;
}

.icon-button {
  width: 40px;
  padding: 0;
  font-size: 1.1rem;
  font-weight: 900;
}

.segment.is-active {
  border-color: var(--accent-dark);
  background: #f3ddd7;
  font-weight: 900;
}

.score-strip,
.master-kpis {
  display: grid;
  grid-template-columns: minmax(170px, 1.1fr) repeat(6, minmax(130px, 1fr));
  gap: 12px;
  margin: 18px 0 22px;
}

.master-kpis {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 0;
}

.score-panel,
.metric-panel,
.panel,
.endpoint-card,
.incident-card {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.score-panel,
.metric-panel {
  min-height: 98px;
  padding: 16px;
}

.score-panel {
  background: #271214;
  color: #fffdfc;
}

.score-label,
.metric-panel span {
  display: block;
  color: #776866;
  font-size: 0.78rem;
  font-weight: 800;
}

.score-panel .score-label,
.score-panel small {
  color: #d8b6ae;
}

.score-panel strong {
  display: block;
  margin-top: 6px;
  font-size: 2.5rem;
  line-height: 1;
}

.metric-panel strong {
  display: block;
  margin-top: 12px;
  font-size: 1.7rem;
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

.section-heading {
  margin-bottom: 16px;
}

.dashboard-grid,
.evidence-layout,
.launch-layout,
.master-layout,
.agent-layout,
.kev-layout,
.zero-trust-layout,
.sbom-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
  gap: 16px;
}

.evidence-layout > .panel-wide {
  grid-column: 1 / -1;
  grid-row: auto;
}

.panel {
  padding: 18px;
}

.panel-wide {
  grid-row: span 2;
}

.panel-header p {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.signal-list,
.agent-rollout,
.master-tenant-list,
.owner-access-list,
.security-baseline-list,
.kev-sla-list,
.policy-decision-list,
.vendor-risk-list,
.evidence-vault-list,
.campaign-list,
.control-list,
.radar-stack,
.incident-grid,
.endpoint-grid,
.integration-grid,
.zero-trust-grid,
.sbom-grid,
.trend-list,
.insight-list,
.tenant-list,
.launch-gates,
.tier-list {
  display: grid;
  gap: 12px;
}

.signal-item,
.agent-card,
.master-tenant-card,
.owner-seat,
.security-control,
.risk-summary-card,
.policy-decision,
.vendor-risk-card,
.evidence-vault-card,
.campaign-item,
.control-item,
.insight-item,
.tenant-row,
.launch-gate,
.tier-item,
.integration-card,
.zero-trust-card,
.sbom-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  background: var(--surface-muted);
  padding: 14px;
}

.agent-card {
  display: grid;
  gap: 12px;
}

.agent-requirement {
  border-left: 3px solid var(--accent);
  background: #f5e5df;
  color: var(--accent-dark);
  padding: 10px 12px;
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1.45;
}

.guardrail-list {
  display: grid;
  gap: 11px;
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.5;
}

.agent-layout {
  margin-bottom: 16px;
}

.master-layout {
  align-items: start;
}

.master-tenant-card,
.owner-seat {
  display: grid;
  gap: 12px;
}

.master-tenant-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

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

.tenant-progress-grid > div {
  display: grid;
  gap: 7px;
}

.tenant-progress-grid strong {
  font-size: 0.9rem;
}

.tenant-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.owner-seat span {
  color: var(--muted);
  line-height: 1.45;
}

.security-control {
  display: grid;
  gap: 7px;
}

.security-control span {
  color: var(--muted);
  line-height: 1.45;
}

.signal-top,
.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.signal-title {
  font-weight: 900;
}

.meta {
  color: var(--muted);
  font-size: 0.82rem;
}

.callout {
  border-left: 3px solid var(--accent);
  background: #f5e5df;
  color: var(--accent-dark);
  padding: 9px 10px;
  font-size: 0.9rem;
  font-weight: 800;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid var(--line);
  background: #fffdfc;
  color: var(--ink);
  padding: 3px 8px;
  font-size: 0.76rem;
  font-weight: 900;
}

.badge.critical {
  border-color: #ddb2ac;
  background: #f7e4e0;
  color: var(--red);
}

.badge.high {
  border-color: #e7c6b3;
  background: #f7ebe1;
  color: var(--amber);
}

.badge.medium {
  border-color: #dec9c1;
  background: #f3e9e5;
  color: var(--medium);
}

.badge.good {
  border-color: #d9b8ae;
  background: #f1dfd8;
  color: var(--stable);
}

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

.heat-cell {
  min-height: 76px;
  border: 1px solid var(--line);
  padding: 9px;
}

.heat-cell strong {
  display: block;
  margin-top: 10px;
  font-size: 1.25rem;
}

.heat-low {
  background: #f5ece9;
}

.heat-watch {
  background: #f7e9dd;
}

.heat-elevated {
  background: #f6e0dc;
}

.timeline {
  display: grid;
  gap: 12px;
  margin: 0;
  padding-left: 20px;
}

.timeline li {
  padding-left: 4px;
}

.timeline strong {
  display: block;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 820px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 14px;
  text-align: left;
  vertical-align: middle;
}

th {
  background: #f7f2f0;
  color: #5a4b4a;
  font-size: 0.76rem;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: none;
}

.table-action {
  border: 1px solid var(--accent-dark);
  background: #fffdfc;
  color: var(--accent-dark);
  padding: 7px 10px;
  font-weight: 900;
}

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

.integration-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.zero-trust-grid,
.sbom-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.endpoint-card,
.incident-card,
.integration-card,
.zero-trust-card,
.sbom-card {
  display: grid;
  gap: 13px;
  padding: 16px;
}

.risk-summary-card strong {
  display: block;
  margin-top: 4px;
  font-size: 1.55rem;
}

.risk-summary-card p,
.policy-decision p,
.vendor-risk-card p,
.evidence-vault-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.sbom-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.sbom-stats span {
  border: 1px solid var(--line);
  background: #fffdfc;
  padding: 9px;
  color: var(--muted);
  font-size: 0.82rem;
}

.sbom-stats strong {
  display: block;
  color: var(--ink);
  font-size: 1.2rem;
}

.progress {
  height: 9px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #efe7e4;
}

.progress > span {
  display: block;
  height: 100%;
  background: var(--accent);
}

.check-list {
  display: grid;
  gap: 8px;
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.86rem;
}

.check::before {
  content: "";
  width: 10px;
  height: 10px;
  border: 1px solid #a58f8b;
  background: #fffdfc;
}

.check.done::before {
  border-color: var(--stable);
  background: var(--stable);
}

.radar-row {
  display: grid;
  grid-template-columns: 120px 1fr 42px;
  gap: 10px;
  align-items: center;
}

.trend-row {
  display: grid;
  grid-template-columns: 84px 1fr 48px;
  gap: 10px;
  align-items: center;
}

.trend-row span,
.trend-row strong {
  font-size: 0.86rem;
}

.tenant-row {
  grid-template-columns: minmax(180px, 1.2fr) minmax(180px, 0.8fr) auto;
  align-items: center;
}

.tenant-row strong,
.tenant-row .meta {
  display: block;
}

.tenant-score {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

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

.incident-steps {
  display: grid;
  gap: 9px;
  padding: 0;
  list-style: none;
}

.incident-steps li {
  border-left: 3px solid var(--line);
  padding-left: 10px;
  color: var(--muted);
}

.incident-steps li.done {
  border-color: var(--stable);
  color: var(--ink);
}

.packet-preview {
  min-height: 360px;
  border: 1px solid var(--line);
  background: #271214;
  color: #f7e4df;
  padding: 16px;
  white-space: pre-wrap;
  font-family: "Segoe UI Mono", Consolas, monospace;
  font-size: 0.84rem;
  line-height: 1.6;
}

.differentiator-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 20px;
}

.differentiator-list li {
  color: var(--muted);
  line-height: 1.5;
}

.launch-gate p,
.tier-item p,
.insight-item p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.5;
}

.tier-item strong,
.tier-item span {
  display: block;
}

.tier-item span {
  color: var(--accent-dark);
  font-size: 0.82rem;
  font-weight: 900;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: min(420px, calc(100vw - 40px));
  border: 1px solid #b87668;
  background: #271214;
  color: #fffdfc;
  padding: 12px 14px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes logoSpin3d {
  0% {
    opacity: 0;
    transform: rotateY(-120deg) rotateX(22deg) scale(0.74);
  }
  16% {
    opacity: 1;
  }
  58% {
    transform: rotateY(420deg) rotateX(12deg) scale(1);
  }
  82% {
    transform: rotateY(708deg) rotateX(0deg) scale(1.05);
  }
  100% {
    opacity: 1;
    transform: rotateY(720deg) rotateX(0deg) scale(1);
  }
}

@keyframes orbitGuard {
  0% {
    opacity: 0;
    filter: blur(2px);
  }
  20% {
    opacity: 0.72;
  }
  62% {
    opacity: 1;
    filter: blur(0);
  }
  100% {
    opacity: 0.62;
  }
}

@keyframes splashProgress {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

@keyframes splashExit {
  to {
    opacity: 0;
    transform: scale(1.02);
  }
}

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

  .login-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    height: auto;
  }

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

  .sidebar-foot {
    position: static;
    margin-top: 18px;
  }

  .score-strip,
  .master-kpis,
  .dashboard-grid,
  .evidence-layout,
  .launch-layout,
  .master-layout,
  .agent-layout,
  .kev-layout,
  .zero-trust-layout,
  .sbom-layout,
  .endpoint-grid,
  .incident-grid,
  .integration-grid,
  .zero-trust-grid,
  .sbom-grid {
    grid-template-columns: 1fr;
  }

  .panel-wide {
    grid-row: auto;
  }
}

@media (max-width: 640px) {
  .workspace,
  .sidebar {
    padding: 16px;
  }

  .topbar,
  .section-heading,
  .panel-header,
  .signal-top,
  .row-between,
  .tenant-row {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .topbar-actions,
  .toolbar,
  .segmented {
    width: 100%;
  }

  .primary-action,
  .secondary-action,
  .segment,
  .session-pill,
  select {
    width: 100%;
  }

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

  .trend-row,
  .radar-row,
  .tenant-row,
  .tenant-score,
  .tenant-progress-grid,
  .sbom-stats {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}
