:root {
  --ink: #22333b;
  --paper: #f2f4f3;
  --accent: #e63946;
  --signal: #a8dadc;
  --muted: #718089;
  --line: rgba(34, 51, 59, 0.14);
  --white: #ffffff;
  --shadow: 0 18px 50px rgba(34, 51, 59, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
}

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

button {
  cursor: pointer;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

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

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

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 0;
}

.tabs {
  display: grid;
  gap: 8px;
}

.tab {
  width: 100%;
  border: 0;
  border-left: 3px solid transparent;
  padding: 12px 12px;
  background: transparent;
  color: rgba(242, 244, 243, 0.72);
  text-align: left;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease;
}

.tab:hover,
.tab.is-active {
  border-color: var(--accent);
  background: rgba(242, 244, 243, 0.08);
  color: var(--white);
}

.metric-spine {
  display: grid;
  gap: 12px;
  margin-top: auto;
}

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

.metric span {
  display: block;
  color: rgba(242, 244, 243, 0.62);
  font-size: 12px;
}

.metric strong {
  display: block;
  margin-top: 4px;
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1;
}

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

.metric-signal strong {
  color: var(--signal);
}

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

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 360px);
  gap: 24px;
  align-items: end;
  margin-bottom: 28px;
}

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

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

h1 {
  max-width: 880px;
  margin-bottom: 0;
  font-size: clamp(28px, 4.4vw, 54px);
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 8px;
  font-size: 22px;
}

h3 {
  margin-bottom: 6px;
}

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

.search-wrap input {
  padding: 13px 14px;
}

.search-wrap input:focus,
form input:focus,
form select:focus,
form textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.12);
}

.view {
  display: none;
  animation: rise 260ms ease both;
}

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

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

.board-head p,
.section-line p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
}

.ghost-action {
  min-width: 118px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  padding: 10px 14px;
  background: transparent;
  color: var(--ink);
  font-weight: 700;
}

.kanban {
  display: grid;
  grid-template-columns: repeat(5, minmax(190px, 1fr));
  gap: 14px;
  margin-top: 20px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.lane {
  min-width: 190px;
  border-left: 1px solid var(--line);
  padding-left: 14px;
  transition: background 160ms ease;
}

.lane.is-over {
  background: rgba(168, 218, 220, 0.24);
}

.lane header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 40px;
}

.lane header h3 {
  margin: 0;
  font-size: 14px;
  text-transform: uppercase;
}

.lane header span {
  display: grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--white);
  font-weight: 800;
}

.lane-body {
  display: grid;
  gap: 12px;
}

.ticket {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(34, 51, 59, 0.12);
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 8px 22px rgba(34, 51, 59, 0.06);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.ticket:hover {
  transform: translateY(-2px);
  border-color: rgba(230, 57, 70, 0.35);
  box-shadow: var(--shadow);
}

.ticket-top,
.ticket-actions,
.ticket dl,
.person,
.resource,
.step {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ticket-top {
  color: var(--muted);
  font-size: 12px;
}

.priority {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  background: rgba(34, 51, 59, 0.08);
  color: var(--ink);
}

.priority-high {
  background: rgba(230, 57, 70, 0.12);
  color: var(--accent);
}

.priority-low {
  background: rgba(168, 218, 220, 0.42);
}

.ticket h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.18;
}

.ticket p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.ticket dl {
  margin: 0;
  align-items: stretch;
}

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

.ticket dd {
  margin: 2px 0 0;
  font-size: 12px;
  font-weight: 700;
}

.ticket-actions {
  align-items: center;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.ticket-actions span {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
}

.ticket-actions button,
form button {
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: var(--white);
  font-weight: 800;
}

.ticket-actions button {
  flex: 0 0 auto;
  padding: 8px 10px;
  font-size: 12px;
}

.done-label {
  color: var(--ink);
  font-weight: 800;
}

.empty-lane {
  min-height: 108px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
}

.quick-panel {
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--line);
  padding: 30px 24px;
  background: rgba(255, 255, 255, 0.62);
}

.panel-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.panel-heading h2 {
  margin: 0;
}

.arch-dot {
  width: 28px;
  height: 28px;
  border: 3px solid var(--ink);
  border-bottom: 0;
  border-radius: 18px 18px 0 0;
  box-shadow: inset 0 0 0 5px var(--signal);
}

form {
  display: grid;
  gap: 14px;
}

form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

form input,
form select,
form textarea {
  min-height: 42px;
  padding: 10px 12px;
  resize: vertical;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  text-transform: none;
}

form button {
  min-height: 46px;
  margin-top: 4px;
}

.form-note {
  margin-top: 16px;
  color: var(--muted);
  font-size: 13px;
}

.form-note.is-error {
  color: var(--accent);
  font-weight: 800;
}

.timeline,
.workflow,
.people-list,
.resource-list {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.event,
.step,
.person,
.resource {
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
}

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

.event time,
.event span,
.person p,
.resource p,
.step p {
  color: var(--muted);
}

.event p,
.person p,
.resource p,
.step p {
  margin: 0;
}

.step span,
.avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: var(--signal);
  color: var(--ink);
  font-weight: 900;
}

.step strong,
.resource span,
.person em {
  flex: 0 0 auto;
  color: var(--accent);
  font-style: normal;
  font-weight: 800;
}

.team-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.86fr);
  gap: 34px;
  margin-top: 22px;
}

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

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

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

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

  .quick-panel label:last-of-type,
  .quick-panel button,
  .form-note {
    grid-column: 1 / -1;
  }
}

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

  .spine {
    position: static;
    padding: 18px;
  }

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

  .tab {
    min-height: 44px;
    text-align: center;
    border-left: 0;
    border-bottom: 3px solid transparent;
  }

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

  .workspace,
  .quick-panel {
    padding: 20px 16px;
  }

  .board-head,
  .section-line,
  .event,
  .step,
  .person,
  .resource {
    display: grid;
    grid-template-columns: 1fr;
  }

  .quick-panel form {
    grid-template-columns: 1fr;
  }
}
