:root {
  --ink: #22333b;
  --paper: #f2f4f3;
  --accent: #e63946;
  --mist: #a8dadc;
  --white: #ffffff;
  --muted: #66747a;
  --line: rgba(34, 51, 59, 0.14);
  --soft-line: rgba(34, 51, 59, 0.08);
  --shadow: 0 24px 70px rgba(34, 51, 59, 0.13);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(90deg, rgba(168, 218, 220, 0.18), transparent 36%),
    var(--paper);
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.metrics-spine,
.quick-panel {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 28px;
}

.metrics-spine {
  display: flex;
  flex-direction: column;
  gap: 28px;
  background: var(--ink);
  color: var(--paper);
}

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

.brand img {
  width: 44px;
  height: 44px;
  border-radius: 12px;
}

.brand strong {
  display: block;
  font-size: 18px;
  line-height: 1;
  letter-spacing: 0;
}

.brand small {
  display: block;
  margin-top: 5px;
  color: rgba(242, 244, 243, 0.68);
  font-size: 12px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.metric-block {
  padding: 22px 0;
  border-top: 1px solid rgba(242, 244, 243, 0.18);
  border-bottom: 1px solid rgba(242, 244, 243, 0.18);
}

.metric-block strong {
  display: block;
  font-size: 64px;
  line-height: 0.95;
  letter-spacing: 0;
}

.metric-block span,
.spine-list span {
  color: rgba(242, 244, 243, 0.7);
  font-size: 13px;
}

.spine-list {
  display: grid;
  gap: 14px;
}

.spine-list div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}

.spine-list strong {
  color: var(--mist);
  font-size: 18px;
}

.screen-nav {
  display: grid;
  gap: 8px;
  margin-top: auto;
}

.nav-button {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(242, 244, 243, 0.16);
  border-radius: 8px;
  background: transparent;
  color: rgba(242, 244, 243, 0.74);
  text-align: left;
  padding: 10px 12px;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.nav-button:hover,
.nav-button.is-active {
  background: var(--paper);
  color: var(--ink);
  transform: translateX(2px);
}

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

.workspace-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
}

.workspace-header h1 {
  max-width: 760px;
  margin: 0;
  font-size: 34px;
  line-height: 1.04;
  letter-spacing: 0;
}

.search-box {
  display: grid;
  gap: 7px;
  min-width: 250px;
}

.search-box span,
.create-form span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.search-box input,
.create-form input,
.create-form select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  outline: none;
  padding: 0 12px;
}

.search-box input:focus,
.create-form input:focus,
.create-form select:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(168, 218, 220, 0.45);
}

.screen {
  display: none;
}

.screen.is-visible {
  display: block;
  animation: surfaceIn 260ms ease both;
}

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

.alert {
  display: grid;
  gap: 5px;
  min-height: 94px;
  border: 1px solid rgba(230, 57, 70, 0.26);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
  padding: 14px;
  text-align: left;
  box-shadow: 0 10px 30px rgba(230, 57, 70, 0.08);
}

.alert span,
.alert em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.35;
}

.alert.is-calm {
  border-color: rgba(168, 218, 220, 0.8);
  border-left-color: var(--mist);
}

.alert.is-danger {
  border-color: rgba(230, 57, 70, 0.42);
}

.board {
  display: grid;
  grid-template-columns: repeat(5, minmax(178px, 1fr));
  gap: 12px;
  align-items: start;
  overflow-x: auto;
  padding-bottom: 10px;
}

.kanban-column {
  min-width: 178px;
  border-top: 2px solid var(--ink);
  padding-top: 12px;
}

.kanban-column header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 28px;
  margin-bottom: 10px;
}

.kanban-column header span {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.kanban-column header strong {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--mist);
  font-size: 13px;
}

.kanban-items {
  display: grid;
  gap: 10px;
}

.work-card {
  min-height: 238px;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  padding: 14px;
  box-shadow: 0 12px 34px rgba(34, 51, 59, 0.08);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.work-card:hover {
  border-color: rgba(34, 51, 59, 0.26);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.card-topline {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.priority-critical .card-topline span,
.priority-high .card-topline span,
.anomaly {
  color: var(--accent);
}

.work-card h3 {
  margin: 0 0 8px;
  font-size: 16px;
  line-height: 1.22;
  letter-spacing: 0;
}

.zone,
.anomaly {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.work-card dl {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
}

.work-card dl div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--soft-line);
  padding-top: 8px;
}

.work-card dt {
  color: var(--muted);
  font-size: 11px;
}

.work-card dd {
  max-width: 55%;
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  text-align: right;
  overflow-wrap: anywhere;
}

.ghost-action,
.primary-action {
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  font-weight: 800;
}

.ghost-action {
  background: var(--ink);
  color: var(--paper);
}

.primary-action {
  background: var(--accent);
  color: var(--white);
  box-shadow: 0 16px 38px rgba(230, 57, 70, 0.22);
}

.closed-label {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
  margin-bottom: 20px;
}

.section-heading h2,
.panel-header h2 {
  margin: 0;
  font-size: 24px;
  letter-spacing: 0;
}

.section-heading span {
  max-width: 420px;
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.timeline,
.workflow-grid,
.people-list,
.resource-list {
  display: grid;
  gap: 10px;
}

.timeline-row,
.workflow-rule,
.person-row,
.resource-row {
  display: grid;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
}

.timeline-row {
  grid-template-columns: 104px minmax(0, 1fr);
}

.timeline-row time,
.timeline-row span,
.timeline-row p,
.workflow-rule p,
.workflow-rule em,
.person-row span,
.person-row em,
.resource-row span,
.resource-row em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  line-height: 1.45;
}

.timeline-row p {
  margin: 6px 0 0;
}

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

.workflow-rule strong {
  font-size: 28px;
}

.workflow-rule span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.team-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(230px, 0.48fr);
  gap: 28px;
}

.person-row {
  grid-template-columns: minmax(0, 1fr) 132px 116px;
  align-items: center;
}

meter {
  width: 100%;
  height: 10px;
}

.resource-list {
  align-self: start;
  border-left: 1px solid var(--line);
  padding-left: 24px;
}

.resource-list h3 {
  margin: 0 0 8px;
}

.quick-panel {
  display: flex;
  flex-direction: column;
  gap: 24px;
  border-left: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.54);
  backdrop-filter: blur(18px);
}

.create-form {
  display: grid;
  gap: 16px;
}

.create-form label {
  display: grid;
  gap: 7px;
}

.form-note {
  min-height: 36px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.recommendation {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.recommendation span {
  display: block;
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.recommendation strong {
  display: block;
  font-size: 17px;
  line-height: 1.35;
}

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

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

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

  .quick-panel {
    grid-column: 1 / -1;
    position: static;
    height: auto;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .create-form {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: end;
  }

  .form-note {
    grid-column: 1 / -1;
  }
}

@media (max-width: 860px) {
  .app-shell {
    display: block;
  }

  .metrics-spine {
    position: static;
    height: auto;
    padding: 20px;
  }

  .screen-nav {
    display: flex;
    overflow-x: auto;
    margin-top: 0;
  }

  .nav-button {
    min-width: 116px;
    text-align: center;
  }

  .workspace {
    padding: 20px;
  }

  .workspace-header,
  .section-heading {
    display: grid;
  }

  .workspace-header h1 {
    font-size: 28px;
  }

  .search-box {
    min-width: 0;
  }

  .alert-strip,
  .workflow-grid,
  .team-layout,
  .create-form {
    grid-template-columns: 1fr;
  }

  .board {
    grid-template-columns: repeat(5, minmax(214px, 1fr));
  }

  .section-heading span {
    text-align: left;
  }

  .person-row,
  .timeline-row {
    grid-template-columns: 1fr;
  }

  .resource-list {
    border-left: 0;
    padding-left: 0;
  }

  .quick-panel {
    padding: 20px;
  }
}
