:root {
  --ink: #141414;
  --paper: #faf7f0;
  --violet: #7c3aed;
  --green: #10b981;
  --line: rgba(20, 20, 20, 0.14);
  --muted: rgba(20, 20, 20, 0.58);
  --danger: #c2410c;
  --amber: #b45309;
  --white: #ffffff;
  --shadow: 0 22px 60px rgba(20, 20, 20, 0.13);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(20, 20, 20, 0.055) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(180deg, #faf7f0 0%, #f1eee6 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.command-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(230px, 0.95fr) minmax(300px, 1.25fr) minmax(120px, 0.55fr);
  gap: 18px;
  align-items: center;
  min-height: 72px;
  padding: 12px clamp(14px, 3vw, 34px);
  border-bottom: 1px solid var(--line);
  background: rgba(250, 247, 240, 0.92);
  backdrop-filter: blur(18px);
}

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

.brand img {
  flex: 0 0 44px;
  border-radius: 12px;
  box-shadow: 0 8px 18px rgba(20, 20, 20, 0.18);
}

.brand strong,
.surface h1,
.inspector h2 {
  font-family: Georgia, "Times New Roman", serif;
}

.brand strong {
  display: block;
  font-size: 19px;
  line-height: 1;
}

.brand small,
.metric-stack small,
.row-main small,
.note small,
.public-row small,
.analytics-row small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.tabs {
  display: flex;
  gap: 6px;
  align-items: center;
  min-width: 0;
  overflow-x: auto;
}

.tab,
.ghost-action,
.primary-action {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.58);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
  white-space: nowrap;
}

.tab:hover,
.ghost-action:hover,
.primary-action:hover {
  transform: translateY(-1px);
}

.tab.is-active,
.primary-action {
  border-color: var(--ink);
  color: var(--paper);
  background: var(--ink);
}

.sync-state {
  justify-self: end;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sync-state.ok {
  color: #047857;
  border-color: rgba(16, 185, 129, 0.34);
}

.sync-state.error {
  color: var(--danger);
  border-color: rgba(194, 65, 12, 0.34);
}

.workspace {
  display: grid;
  grid-template-columns: 156px minmax(0, 1fr);
  gap: clamp(16px, 3vw, 30px);
  width: min(1520px, 100%);
  margin: 0 auto;
  padding: clamp(16px, 3vw, 34px) clamp(14px, 3vw, 34px) 132px;
}

.rail {
  position: sticky;
  top: 104px;
  height: fit-content;
}

.stamp {
  display: grid;
  place-items: center;
  width: 132px;
  height: 132px;
  border: 2px dashed rgba(20, 20, 20, 0.32);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.42);
  transform: rotate(-6deg);
}

.stamp span {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 40px;
  line-height: 1;
}

.stamp small {
  color: var(--violet);
  font-size: 10px;
  text-transform: uppercase;
}

.metric-stack {
  display: grid;
  gap: 8px;
  margin-top: 22px;
}

.metric-stack div {
  border-left: 4px solid var(--ink);
  padding: 10px 0 10px 12px;
  background: rgba(255, 255, 255, 0.36);
}

.metric-stack strong {
  display: block;
  margin-top: 2px;
  font-size: 24px;
}

.screen {
  display: none;
}

.screen.is-visible {
  display: block;
  animation: riseIn 280ms ease both;
}

.surface {
  min-width: 0;
}

.surface-head {
  display: flex;
  gap: 20px;
  justify-content: space-between;
  align-items: end;
  margin-bottom: 18px;
}

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

.surface h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(32px, 5.6vw, 72px);
  line-height: 0.96;
  letter-spacing: 0;
}

.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.filters input,
.filters select {
  min-height: 42px;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.68);
}

.filters input {
  width: min(260px, 100%);
}

.board {
  display: grid;
  grid-template-columns: minmax(420px, 1.1fr) minmax(340px, 0.9fr);
  gap: 18px;
  align-items: start;
}

.list,
.inspector,
.import-panel,
.log-output,
.analytics-row,
.public-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: var(--shadow);
}

.list {
  overflow: hidden;
}

.asset-row {
  display: grid;
  grid-template-columns: minmax(160px, 1.35fr) 106px minmax(80px, 0.55fr) 70px 88px 36px;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 74px;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 12px 14px;
  color: var(--ink);
  text-align: left;
  background: transparent;
}

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

.asset-row:hover,
.asset-row.is-selected {
  background: rgba(124, 58, 237, 0.08);
}

.asset-row.is-selected {
  box-shadow: inset 4px 0 0 var(--violet);
}

.row-main {
  min-width: 0;
}

.row-main strong,
.analytics-row strong,
.public-row strong {
  display: block;
  overflow-wrap: anywhere;
}

.stage,
.money,
.incident-count {
  font-size: 13px;
  font-weight: 800;
}

.money {
  color: var(--green);
}

.incident-count {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
}

.progress-track {
  display: block;
  height: 9px;
  border-radius: 999px;
  background: rgba(20, 20, 20, 0.12);
  overflow: hidden;
}

.progress-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--violet), var(--green));
  transition: width 260ms ease;
}

.status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 76px;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.status-risk {
  color: #7c2d12;
  background: #fed7aa;
}

.status-review {
  color: #4c1d95;
  background: #ddd6fe;
}

.status-active {
  color: #064e3b;
  background: #a7f3d0;
}

.inspector {
  padding: 20px;
}

.inspector-head h2 {
  margin: 12px 0 6px;
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1;
}

.inspector-head p,
.import-panel p,
.note p {
  color: var(--muted);
}

.care-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.care-strip div {
  border-top: 2px solid var(--ink);
  padding-top: 9px;
}

.care-strip small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.care-strip strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.checklist h3,
.split-detail h3,
.import-panel h2 {
  margin: 0 0 12px;
  font-size: 14px;
  text-transform: uppercase;
}

.task {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}

.task input {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
}

.task small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.split-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 18px;
}

.note {
  border-top: 1px solid var(--line);
  padding: 11px 0;
}

.note strong {
  display: block;
}

.severity-high {
  color: var(--danger);
}

.severity-medium {
  color: var(--amber);
}

.wide {
  width: 100%;
  margin-top: 18px;
}

.analytics-grid {
  display: grid;
  gap: 12px;
}

.analytics-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 78px 82px;
  gap: 20px;
  align-items: center;
  min-height: 118px;
  padding: 16px;
}

.bar-meter {
  display: flex;
  align-items: end;
  justify-content: center;
  height: 76px;
  border-bottom: 2px solid var(--ink);
}

.bar-meter i {
  display: block;
  width: 34px;
  min-height: 14px;
  background: linear-gradient(180deg, var(--green), var(--violet));
  transition: height 280ms ease;
}

.import-panel {
  display: flex;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
  padding: 22px;
}

.log-output {
  min-height: 120px;
  margin: 14px 0 0;
  padding: 16px;
  overflow: auto;
  color: #064e3b;
  white-space: pre-wrap;
}

.public-list {
  display: grid;
  gap: 10px;
}

.public-row {
  display: grid;
  grid-template-columns: 92px minmax(180px, 1fr) minmax(120px, 0.85fr) minmax(130px, 0.65fr) 92px;
  gap: 12px;
  align-items: center;
  min-height: 72px;
  padding: 14px;
}

.public-row > span {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
}

.event-stream {
  position: fixed;
  right: clamp(12px, 3vw, 34px);
  bottom: 14px;
  left: clamp(12px, 3vw, 34px);
  z-index: 15;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  min-height: 58px;
  border: 1px solid rgba(250, 247, 240, 0.18);
  border-radius: 8px;
  padding: 12px 16px;
  color: var(--paper);
  background: rgba(20, 20, 20, 0.94);
  box-shadow: 0 20px 60px rgba(20, 20, 20, 0.26);
}

.event-stream > div {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  white-space: nowrap;
}

.event-stream span {
  color: rgba(250, 247, 240, 0.72);
  font-size: 13px;
}

.event-stream b {
  color: var(--green);
}

.empty-state {
  padding: 18px;
  color: var(--muted);
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1100px) {
  .command-bar {
    grid-template-columns: 1fr;
  }

  .sync-state {
    justify-self: start;
  }

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

  .rail {
    position: static;
    display: grid;
    grid-template-columns: 118px minmax(0, 1fr);
    gap: 16px;
    align-items: center;
  }

  .stamp {
    width: 106px;
    height: 106px;
  }

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

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

@media (max-width: 760px) {
  .command-bar {
    position: static;
  }

  .workspace {
    padding-bottom: 178px;
  }

  .surface-head,
  .import-panel {
    display: grid;
    align-items: start;
  }

  .filters {
    justify-content: start;
  }

  .filters input,
  .filters select {
    width: 100%;
  }

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

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

  .asset-row {
    grid-template-columns: minmax(0, 1fr) 72px;
    gap: 8px;
  }

  .asset-row .stage,
  .asset-row .progress-track,
  .asset-row .money,
  .asset-row .status {
    grid-column: 1 / -1;
  }

  .incident-count {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }

  .care-strip,
  .split-detail,
  .analytics-row,
  .public-row {
    grid-template-columns: 1fr;
  }

  .event-stream {
    grid-template-columns: 1fr;
    align-items: start;
  }
}

