:root {
  --ink: #141414;
  --paper: #faf7f0;
  --paper-strong: #fffdf8;
  --muted: #756f66;
  --line: rgba(20, 20, 20, 0.13);
  --violet: #7c3aed;
  --green: #10b981;
  --amber: #c47b20;
  --red: #c2410c;
  --shadow: 0 24px 70px rgba(20, 20, 20, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(124, 58, 237, 0.08), transparent 24%),
    linear-gradient(180deg, #fffdf8 0%, var(--paper) 46%, #f2eee5 100%);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
}

.command-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto minmax(320px, 1fr) minmax(220px, 320px) 44px;
  gap: 14px;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(250, 247, 240, 0.92);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 156px;
  color: var(--ink);
  text-decoration: none;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0;
}

.brand img {
  display: block;
  width: 44px;
  height: 44px;
}

.view-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.view-switch button,
.ghost-button,
.primary-button,
.icon-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.78);
  color: var(--ink);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.view-switch button {
  padding: 0 12px;
  white-space: nowrap;
}

.view-switch button:hover,
.ghost-button:hover,
.icon-button:hover,
.asset-card:hover {
  transform: translateY(-1px);
  border-color: rgba(124, 58, 237, 0.38);
}

.view-switch button.is-active {
  background: var(--ink);
  color: var(--paper);
}

.search-box {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 0 12px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-strong);
}

.search-box label {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.icon-button {
  width: 44px;
  padding: 0;
  font-size: 20px;
}

.workspace {
  width: min(1680px, 100%);
  margin: 0 auto;
  padding: 26px 20px 34px;
}

.screen {
  display: none;
}

.screen.is-active {
  display: block;
  animation: surface-in 220ms ease both;
}

@keyframes surface-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.headline-row,
.section-title,
.compact {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

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

h1,
h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: 0;
}

h1 {
  max-width: 760px;
  font-size: clamp(36px, 7vw, 78px);
  line-height: 0.95;
}

h2 {
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1;
}

.source-pill {
  display: grid;
  gap: 3px;
  min-width: 120px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-strong);
  text-align: right;
}

.source-pill span,
.metric span,
.metric small {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 1px;
  margin: 24px 0;
  border: 1px solid var(--line);
  background: var(--line);
}

.metric {
  display: grid;
  gap: 8px;
  min-height: 116px;
  padding: 18px;
  background: var(--paper-strong);
}

.metric strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 38px;
  line-height: 1;
}

.planner-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: start;
}

.board-panel,
.inspector,
.event-stream,
.analytics-layout > section,
.import-panel,
.public-status {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.78);
  box-shadow: var(--shadow);
}

.board-panel {
  min-width: 0;
  padding: 18px;
}

.section-title > span,
.compact > span {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.stage-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.stage-column {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
  min-height: 420px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(250, 247, 240, 0.7);
}

.stage-column header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 2px 9px;
  color: var(--muted);
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 800;
}

.stage-column header strong {
  color: var(--ink);
}

.asset-card {
  display: grid;
  gap: 10px;
  width: 100%;
  min-height: 142px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-strong);
  color: var(--ink);
  text-align: left;
}

.asset-card.is-selected {
  border-color: var(--violet);
  box-shadow: inset 0 0 0 1px var(--violet);
}

.card-top,
.card-bottom {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.card-top strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  line-height: 1.1;
}

.card-top i,
.status-item span {
  flex: 0 0 auto;
  padding: 4px 7px;
  border-radius: 999px;
  color: var(--paper-strong);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.ready {
  background: var(--green);
}

.busy,
.in_progress,
.watch {
  background: var(--amber);
}

.service,
.planned,
.review,
.medium {
  background: var(--violet);
}

.low,
.ok,
.done {
  background: var(--green);
}

.high,
.open {
  background: var(--red);
}

.card-meta,
.card-client,
.card-bottom em {
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.card-bottom b {
  font-size: 22px;
}

.empty-slot,
.empty-state {
  display: grid;
  min-height: 88px;
  place-items: center;
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.inspector {
  position: sticky;
  top: 92px;
  display: grid;
  gap: 16px;
  padding: 20px;
}

.inspector h2 {
  overflow-wrap: anywhere;
}

.asset-code {
  color: var(--muted);
  font-weight: 800;
}

.margin-dial {
  display: grid;
  place-items: center;
  width: 176px;
  height: 176px;
  margin: 4px auto;
  border: 16px solid rgba(16, 185, 129, 0.2);
  border-top-color: var(--green);
  border-right-color: var(--violet);
  border-radius: 50%;
}

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

.margin-dial small {
  color: var(--muted);
  text-transform: uppercase;
}

.detail-list {
  display: grid;
  gap: 1px;
  margin: 0;
  background: var(--line);
  border: 1px solid var(--line);
}

.detail-list div {
  display: grid;
  grid-template-columns: 118px 1fr;
  gap: 12px;
  padding: 10px;
  background: var(--paper-strong);
}

.detail-list dt {
  color: var(--muted);
}

.detail-list dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 700;
}

.care-scale {
  display: grid;
  gap: 8px;
}

.care-scale div {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(20, 20, 20, 0.1);
}

.care-scale i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--violet), var(--green));
  transition: width 260ms ease;
}

.button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.primary-button,
.ghost-button {
  padding: 0 14px;
  font-weight: 800;
}

.primary-button {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.event-stream {
  margin-top: 18px;
  padding: 18px;
}

.event-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.event-item {
  display: grid;
  gap: 8px;
  min-height: 150px;
  padding: 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--violet);
  border-radius: 8px;
  background: var(--paper-strong);
}

.event-item.ok,
.event-item.done {
  border-left-color: var(--green);
}

.event-item.open,
.event-item.high {
  border-left-color: var(--red);
}

.event-item span,
.event-item time {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.event-item p {
  margin: 0;
  color: #3f3a34;
  font-size: 13px;
  line-height: 1.35;
}

.analytics-layout {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 18px;
}

.analytics-layout > section,
.import-panel,
.public-status {
  padding: 22px;
}

.bar-list,
.risk-list,
.status-board {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.bar-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 60px;
  gap: 14px;
  align-items: center;
  min-height: 52px;
  padding: 10px 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-strong);
}

.bar-row span,
.bar-row strong {
  position: relative;
  z-index: 1;
}

.bar-row i {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 5px;
  min-width: 6px;
  background: linear-gradient(90deg, var(--violet), var(--green));
}

.risk-row,
.status-item {
  display: grid;
  grid-template-columns: 96px 1fr auto;
  gap: 12px;
  align-items: center;
  min-height: 58px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-strong);
}

.risk-row span,
.status-item p {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--muted);
}

.import-panel {
  max-width: 760px;
}

.import-panel p,
.public-status p {
  max-width: 660px;
  color: var(--muted);
  line-height: 1.55;
}

pre {
  max-width: 100%;
  margin: 18px 0 0;
  padding: 16px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #141414;
  color: #faf7f0;
}

.public-status {
  display: grid;
  grid-template-columns: minmax(240px, 0.8fr) minmax(260px, 1.2fr);
  gap: 26px;
  align-items: start;
}

.status-item {
  grid-template-columns: auto 150px 1fr;
}

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

  .view-switch,
  .search-box {
    grid-column: 1 / -1;
  }

  .planner-grid,
  .analytics-layout,
  .public-status {
    grid-template-columns: 1fr;
  }

  .inspector {
    position: static;
  }

  .stage-board {
    overflow-x: auto;
    grid-template-columns: repeat(4, minmax(220px, 1fr));
  }

  .event-list {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }
}

@media (max-width: 720px) {
  .command-bar,
  .workspace {
    padding-left: 12px;
    padding-right: 12px;
  }

  .brand {
    min-width: 0;
    font-size: 21px;
  }

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

  .view-switch button {
    min-width: 0;
    white-space: normal;
  }

  .search-box {
    grid-template-columns: 1fr;
    padding: 8px 12px;
  }

  .headline-row,
  .section-title,
  .compact {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .metric {
    min-height: 104px;
    padding: 14px;
  }

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

  .stage-column {
    min-height: 0;
  }

  .event-list {
    grid-template-columns: 1fr;
  }

  .detail-list div,
  .risk-row,
  .status-item {
    grid-template-columns: 1fr;
  }

  .button-row {
    grid-template-columns: 1fr;
  }
}

