:root {
  --ink: #22333b;
  --paper: #f2f4f3;
  --accent: #e63946;
  --mint: #a8dadc;
  --soft: #ffffff;
  --line: rgba(34, 51, 59, 0.12);
  --muted: rgba(34, 51, 59, 0.64);
  --shadow: 0 18px 42px rgba(34, 51, 59, 0.12);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(168, 218, 220, 0.16), transparent 42%),
    var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

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

button {
  cursor: pointer;
}

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

.spine {
  position: sticky;
  top: 0;
  align-self: start;
  min-height: 100vh;
  padding: 28px 22px;
  color: var(--paper);
  background: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 30px;
}

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

.brand img {
  width: 46px;
  height: 46px;
}

.metricBlock {
  padding: 24px 0;
  border-top: 1px solid rgba(242, 244, 243, 0.14);
  border-bottom: 1px solid rgba(242, 244, 243, 0.14);
}

.eyebrow,
.kicker {
  margin: 0;
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

.metricBlock strong {
  display: block;
  margin: 8px 0 6px;
  color: var(--mint);
  font-size: clamp(3rem, 7vw, 5.2rem);
  line-height: 0.95;
}

.metricBlock small {
  display: block;
  max-width: 16rem;
  color: rgba(242, 244, 243, 0.72);
  line-height: 1.45;
}

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

.tab {
  width: 100%;
  min-height: 42px;
  border: 0;
  border-left: 3px solid transparent;
  padding: 10px 12px;
  color: rgba(242, 244, 243, 0.68);
  background: transparent;
  text-align: left;
  border-radius: 0 6px 6px 0;
}

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

.spineStats {
  margin-top: auto;
  display: grid;
  gap: 16px;
}

.spineStats div {
  display: grid;
  gap: 2px;
}

.spineStats b {
  color: var(--paper);
  font-size: 1.35rem;
}

.spineStats span {
  color: rgba(242, 244, 243, 0.64);
  font-size: 0.86rem;
}

.workspace {
  padding: 28px clamp(18px, 3vw, 42px) 42px;
  min-width: 0;
}

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

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 6px 0 0;
  font-size: clamp(1.8rem, 4vw, 3.8rem);
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: clamp(1.18rem, 2vw, 1.72rem);
  line-height: 1.08;
  letter-spacing: 0;
}

h3 {
  margin: 0;
  line-height: 1.15;
  letter-spacing: 0;
}

.searchWrap {
  width: min(420px, 44vw);
}

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

.searchWrap input {
  min-height: 46px;
  padding: 0 14px;
}

.searchWrap input:focus,
.quickCreate input:focus,
.quickCreate select:focus,
.quickCreate textarea:focus {
  border-color: var(--mint);
  box-shadow: 0 0 0 4px rgba(168, 218, 220, 0.28);
}

.screen {
  display: none;
}

.screen.active {
  display: block;
  animation: rise 240ms ease-out both;
}

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

.boardHeader p,
.sectionIntro p {
  max-width: 680px;
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.boardHeader .boardStatus {
  min-height: 1.25em;
  margin-top: 4px;
  color: var(--accent);
  font-size: 0.84rem;
}

.primaryAction,
.quickCreate button,
.jobFooter button {
  border: 0;
  border-radius: 8px;
  color: var(--paper);
  background: var(--accent);
  font-weight: 800;
  min-height: 40px;
  padding: 0 14px;
}

.primaryAction:hover,
.quickCreate button:hover,
.jobFooter button:hover {
  transform: translateY(-1px);
}

.operatingGrid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  gap: 20px;
  align-items: start;
}

.kanban {
  display: grid;
  grid-template-columns: repeat(4, minmax(190px, 1fr));
  gap: 12px;
  min-width: 0;
}

.lane {
  min-width: 0;
  border-top: 3px solid var(--ink);
}

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

.lane header h3 {
  font-size: 0.96rem;
}

.lane header span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: var(--ink);
  background: var(--mint);
  font-weight: 800;
  font-size: 0.82rem;
}

.laneItems {
  display: grid;
  gap: 10px;
}

.job,
.quickCreate,
.timelineItem,
.rule,
.compactList article {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.job {
  padding: 14px;
  box-shadow: 0 1px 0 rgba(34, 51, 59, 0.06);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

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

.jobTop,
.jobMeta,
.jobFooter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.jobTop span,
.jobMeta span,
.jobFooter span {
  color: var(--muted);
  font-size: 0.78rem;
}

.jobTop span {
  color: var(--accent);
  font-weight: 900;
}

.job h3 {
  margin-top: 12px;
  font-size: 1rem;
}

.job p {
  min-height: 58px;
  margin: 9px 0 14px;
  color: rgba(34, 51, 59, 0.78);
  line-height: 1.42;
  font-size: 0.9rem;
}

.jobMeta {
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.jobFooter {
  margin-top: 12px;
}

.jobFooter button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 0.78rem;
}

.jobFooter button:disabled {
  background: var(--ink);
  opacity: 0.68;
  cursor: default;
}

.priority-critical {
  border-left: 4px solid var(--accent);
}

.priority-high {
  border-left: 4px solid #ffb703;
}

.priority-normal {
  border-left: 4px solid var(--mint);
}

.emptyLane,
.apiError {
  min-height: 120px;
  display: grid;
  place-items: center;
  padding: 18px;
  color: var(--muted);
  border: 1px dashed rgba(34, 51, 59, 0.18);
  border-radius: 8px;
}

.apiError {
  grid-column: 1 / -1;
  color: var(--accent);
  background: rgba(230, 57, 70, 0.06);
}

.quickCreate {
  position: sticky;
  top: 24px;
  padding: 18px;
}

.quickCreate form {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.quickCreate label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.quickCreate input,
.quickCreate select,
.quickCreate textarea {
  min-height: 42px;
  padding: 10px 12px;
  resize: vertical;
  font-weight: 500;
}

.quickCreate button {
  margin-top: 4px;
}

.formStatus {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.timeline,
.workflowRules,
.teamGrid {
  display: grid;
  gap: 12px;
}

.timelineItem {
  display: grid;
  grid-template-columns: 180px minmax(120px, 180px) minmax(0, 1fr) minmax(120px, 220px);
  gap: 16px;
  align-items: center;
  padding: 16px;
}

.timelineItem time,
.timelineItem span {
  color: var(--muted);
  font-size: 0.86rem;
}

.timelineItem p {
  margin: 0;
}

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

.rule {
  min-height: 190px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rule b {
  color: var(--accent);
  font-size: 0.82rem;
}

.rule span {
  font-size: 1.2rem;
  font-weight: 900;
}

.rule p {
  margin: auto 0 0;
  color: var(--muted);
  line-height: 1.45;
}

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

.teamGrid h3 {
  margin-bottom: 12px;
}

.compactList {
  display: grid;
  gap: 10px;
}

.compactList article {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
}

.compactList span {
  color: var(--muted);
}

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

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

  .quickCreate {
    position: static;
  }

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

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

  .spine {
    position: static;
    min-height: auto;
    padding: 18px;
    gap: 18px;
  }

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

  .tab {
    border-left: 0;
    border-bottom: 3px solid transparent;
    border-radius: 6px 6px 0 0;
    text-align: center;
  }

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

  .workspace {
    padding: 20px 14px 34px;
  }

  .topbar,
  .boardHeader,
  .sectionIntro {
    display: grid;
    align-items: start;
  }

  .searchWrap {
    width: 100%;
  }

  .kanban,
  .workflowRules,
  .teamGrid {
    grid-template-columns: 1fr;
  }

  .timelineItem,
  .compactList article {
    grid-template-columns: 1fr;
    display: grid;
  }
}
