:root {
  --ink: #1f2933;
  --paper: #fbfbf2;
  --blue: #4c6fff;
  --orange: #f9703e;
  --line: rgba(31, 41, 51, 0.16);
  --muted: #66717f;
  --green: #4d9a69;
  --yellow: #c58a1f;
  --red: #d84e43;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(31, 41, 51, 0.08) 1px, transparent 1px),
    linear-gradient(0deg, rgba(31, 41, 51, 0.06) 1px, transparent 1px),
    var(--paper);
  background-size: 48px 48px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

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

.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 18px;
  color: var(--paper);
  background: var(--ink);
  border-right: 1px solid rgba(255, 255, 255, 0.12);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--paper);
  text-decoration: none;
  font-weight: 800;
  line-height: 0.96;
  letter-spacing: 0;
}

.rail nav {
  display: grid;
  gap: 8px;
  margin-top: 36px;
}

.nav-link {
  min-height: 42px;
  padding: 0 12px;
  color: rgba(251, 251, 242, 0.72);
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--paper);
  background: rgba(251, 251, 242, 0.08);
  border-color: rgba(251, 251, 242, 0.14);
}

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

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

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

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

h1 {
  margin-bottom: 0;
  font-size: clamp(34px, 5vw, 68px);
  line-height: 0.92;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 6px;
  font-size: 22px;
  line-height: 1.1;
}

p {
  color: var(--muted);
}

.toolbar {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
}

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

input,
select,
textarea {
  width: 100%;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
}

input,
select {
  min-height: 42px;
  padding: 0 12px;
}

textarea {
  min-height: 112px;
  padding: 12px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(76, 111, 255, 0.14);
}

.summary-strip {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  margin: 0 -24px 24px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(251, 251, 242, 0.94);
  backdrop-filter: blur(12px);
}

.metric {
  min-height: 86px;
  padding: 14px 18px;
  border-right: 1px solid var(--line);
}

.metric span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.metric strong {
  display: block;
  font-size: clamp(24px, 3vw, 40px);
  line-height: 1;
  letter-spacing: 0;
}

.metric.accent {
  color: var(--blue);
}

.metric.heat {
  color: var(--orange);
}

.screen {
  display: none;
  animation: rise 240ms ease-out;
}

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

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 22px;
}

.table-panel,
.side-panel,
.request-layout {
  min-width: 0;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.section-head p {
  margin-bottom: 0;
}

.primary-action {
  min-height: 42px;
  padding: 0 16px;
  color: #fff;
  white-space: nowrap;
  background: var(--blue);
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.primary-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(76, 111, 255, 0.24);
}

.asset-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.48);
}

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

.asset-table th {
  position: sticky;
  top: 87px;
  z-index: 2;
  padding: 12px 14px;
  color: var(--muted);
  font-size: 12px;
  text-align: left;
  text-transform: uppercase;
  background: #f3f4ee;
  border-bottom: 1px solid var(--line);
}

.asset-table td {
  padding: 14px;
  vertical-align: middle;
  border-bottom: 1px solid var(--line);
}

.asset-table td span,
.asset-table small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.asset-table tr:hover {
  background: rgba(76, 111, 255, 0.06);
}

.severity {
  display: inline-flex;
  min-width: 72px;
  justify-content: center;
  padding: 5px 8px;
  color: var(--paper);
  font-size: 12px;
  font-weight: 800;
  border-radius: 999px;
}

.severity.critical {
  background: var(--red);
}

.severity.high {
  background: var(--orange);
}

.severity.medium {
  color: var(--ink);
  background: #f3c756;
}

.severity.low {
  background: var(--green);
}

.health {
  width: 120px;
  height: 8px;
  overflow: hidden;
  background: rgba(31, 41, 51, 0.12);
  border-radius: 999px;
}

.health span {
  display: block;
  height: 100%;
  margin: 0;
  background: linear-gradient(90deg, var(--orange), var(--blue));
}

.side-panel {
  padding-left: 20px;
  border-left: 1px solid var(--line);
}

.graph {
  position: relative;
  height: 240px;
  margin: 12px 0 24px;
  background:
    radial-gradient(circle at 30% 28%, rgba(76, 111, 255, 0.18), transparent 22%),
    radial-gradient(circle at 70% 72%, rgba(249, 112, 62, 0.18), transparent 24%);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.node {
  position: absolute;
  z-index: 2;
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  color: #fff;
  font-weight: 900;
  background: var(--ink);
  border: 3px solid var(--paper);
  border-radius: 50%;
  box-shadow: 0 16px 30px rgba(31, 41, 51, 0.18);
}

.node.diagnostics {
  left: 28px;
  top: 34px;
  background: var(--blue);
}

.node.parts {
  right: 34px;
  top: 54px;
}

.node.repair {
  left: 62px;
  bottom: 36px;
  background: var(--orange);
}

.node.warranty {
  right: 56px;
  bottom: 30px;
  background: var(--green);
}

.link {
  position: absolute;
  height: 2px;
  background: rgba(31, 41, 51, 0.32);
  transform-origin: left center;
}

.link-a {
  left: 76px;
  top: 72px;
  width: 150px;
  transform: rotate(7deg);
}

.link-b {
  left: 82px;
  top: 152px;
  width: 142px;
  transform: rotate(-23deg);
}

.link-c {
  left: 112px;
  top: 180px;
  width: 112px;
  transform: rotate(0deg);
}

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

.action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 52px;
  padding: 10px 12px;
  text-align: left;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  cursor: pointer;
}

.action-row.critical {
  border-left-color: var(--red);
}

.action-row.high {
  border-left-color: var(--orange);
}

.action-row strong {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.request-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 760px);
  gap: 42px;
  align-items: start;
}

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

.request-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.request-form .wide {
  grid-column: 1 / -1;
}

.form-status {
  align-self: center;
  margin: 0;
  font-weight: 700;
}

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

.document-item {
  min-height: 160px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.document-item b,
.document-item span {
  color: var(--muted);
  font-size: 12px;
}

.document-item h3 {
  margin: 18px 0 8px;
  font-size: 18px;
}

.finance-list {
  display: grid;
  max-width: 860px;
  border-top: 1px solid var(--line);
}

.finance-row {
  display: grid;
  grid-template-columns: 1fr 180px 150px;
  gap: 16px;
  align-items: center;
  min-height: 76px;
  border-bottom: 1px solid var(--line);
}

.finance-row small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
}

.finance-row strong {
  font-size: 24px;
  text-align: right;
}

.finance-row em {
  color: var(--muted);
  font-style: normal;
}

.empty {
  height: 120px;
  color: var(--muted);
  text-align: center;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

  .rail {
    position: static;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: auto;
    padding: 14px;
  }

  .rail nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    margin-top: 0;
  }

  .nav-link {
    min-height: 38px;
  }

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

  .asset-table th {
    top: 173px;
  }

  .split,
  .request-layout {
    grid-template-columns: 1fr;
  }

  .side-panel {
    padding-left: 0;
    border-left: 0;
  }

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

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

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

  .toolbar,
  .search {
    width: 100%;
  }

  .summary-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-right: -16px;
    margin-left: -16px;
  }

  .metric {
    min-height: 74px;
    padding: 12px;
  }

  .request-form,
  .document-grid,
  .finance-row {
    grid-template-columns: 1fr;
  }

  .finance-row {
    gap: 4px;
    padding: 14px 0;
  }

  .finance-row strong {
    text-align: left;
  }
}

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

