:root {
  --ink: #22333b;
  --paper: #f2f4f3;
  --accent: #e63946;
  --aqua: #a8dadc;
  --muted: #6f7b80;
  --line: rgba(34, 51, 59, 0.13);
  --white: #ffffff;
  --shadow: 0 24px 60px rgba(34, 51, 59, 0.12);
}

* {
  box-sizing: border-box;
}

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

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

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.metrics-spine {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 18px;
  color: var(--paper);
  background: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  font-weight: 780;
  line-height: 0.95;
  letter-spacing: 0;
}

.brand img {
  flex: 0 0 auto;
}

.metrics-list {
  display: grid;
  gap: 12px;
}

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

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

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

.metric.alert strong {
  color: #ff6b76;
}

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

.spine-note {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(242, 244, 243, 0.62);
  font-size: 12px;
}

.pulse {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--aqua);
  box-shadow: 0 0 0 0 rgba(168, 218, 220, 0.6);
  animation: pulse 1.8s infinite;
}

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

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

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

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

h1 {
  margin-bottom: 0;
  font-size: clamp(32px, 5vw, 64px);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  font-size: 24px;
  line-height: 1.05;
  letter-spacing: 0;
}

h3 {
  font-size: 15px;
  line-height: 1.2;
  letter-spacing: 0;
}

.topbar-actions {
  display: flex;
  align-items: end;
  gap: 12px;
}

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

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

.search input:focus,
.create-form input:focus {
  border-color: var(--ink);
  background: var(--white);
}

.ghost-button,
.primary-button,
.ticket-actions button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0 14px;
  color: var(--ink);
  background: var(--white);
  box-shadow: inset 0 0 0 1px var(--line);
}

.primary-button {
  width: 100%;
  color: var(--white);
  background: var(--accent);
  box-shadow: none;
  font-weight: 760;
}

.tabs {
  display: flex;
  gap: 4px;
  margin: 28px 0 18px;
  border-bottom: 1px solid var(--line);
}

.tab {
  position: relative;
  border: 0;
  padding: 12px 14px;
  color: var(--muted);
  background: transparent;
  font-weight: 700;
}

.tab.active {
  color: var(--ink);
}

.tab.active::after {
  position: absolute;
  right: 12px;
  bottom: -1px;
  left: 12px;
  height: 2px;
  background: var(--accent);
  content: "";
}

.screen {
  display: none;
}

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

.kanban {
  display: grid;
  grid-template-columns: repeat(4, minmax(210px, 1fr));
  gap: 14px;
  align-items: start;
}

.kanban-column {
  min-width: 0;
  border-top: 4px solid var(--accent);
  background: rgba(255, 255, 255, 0.42);
}

.kanban-column header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 4px 12px 0;
  font-weight: 820;
}

.kanban-column header b {
  display: grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  border-radius: 999px;
  color: var(--ink);
  background: color-mix(in srgb, var(--accent) 24%, white);
}

.ticket-stack {
  display: grid;
  gap: 10px;
}

.ticket {
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(34, 51, 59, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 12px 28px rgba(34, 51, 59, 0.07);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

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

.ticket-top,
.ticket-meta,
.ticket-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.priority,
.score {
  font-size: 11px;
  font-weight: 780;
  text-transform: uppercase;
}

.priority.urgent {
  color: var(--accent);
}

.priority.normal {
  color: #457b9d;
}

.priority.low {
  color: #6a994e;
}

.score {
  color: var(--muted);
}

.ticket h3 {
  margin: 12px 0 6px;
}

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

.ticket-meta {
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 12px;
}

.ticket-actions {
  margin-top: 12px;
}

.ticket-actions button {
  flex: 1;
  min-width: 0;
  min-height: 34px;
  padding: 0 9px;
  font-size: 12px;
}

.ticket-actions button:first-child {
  color: var(--white);
  background: var(--ink);
  box-shadow: none;
}

.quick-panel {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  padding: 28px 24px;
  background: rgba(255, 255, 255, 0.72);
  border-left: 1px solid var(--line);
}

.panel-head {
  margin-bottom: 18px;
}

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

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

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.resource-strip {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.resource-strip h3 {
  margin-bottom: 12px;
}

.resource-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.resource-row b {
  color: var(--accent);
}

.section-head {
  max-width: 680px;
  margin-bottom: 22px;
}

.section-head p {
  color: var(--muted);
}

.timeline,
.workflow-grid,
.team-grid {
  display: grid;
  gap: 12px;
  max-width: 900px;
}

.timeline-item,
.workflow-step,
.team-member {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 18px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.timeline-item time {
  color: var(--accent);
  font-size: 12px;
  font-weight: 760;
}

.timeline-item p,
.timeline-item span,
.workflow-step p,
.team-member p {
  color: var(--muted);
  font-size: 13px;
}

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

.workflow-step {
  grid-template-columns: 44px minmax(0, 1fr) 58px;
  align-items: center;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.5);
}

.workflow-step b {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--aqua);
}

.switch input {
  position: absolute;
  opacity: 0;
}

.switch span {
  display: block;
  width: 48px;
  height: 28px;
  border-radius: 999px;
  background: rgba(34, 51, 59, 0.16);
  padding: 3px;
}

.switch span::before {
  display: block;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--white);
  content: "";
}

.switch input:checked + span {
  background: var(--ink);
}

.switch input:checked + span::before {
  transform: translateX(20px);
}

.team-member {
  grid-template-columns: minmax(0, 1fr) 140px 48px;
  align-items: center;
}

.load {
  height: 8px;
  border-radius: 999px;
  background: rgba(34, 51, 59, 0.12);
  overflow: hidden;
}

.load span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.empty-state {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 20;
  max-width: min(340px, calc(100vw - 32px));
  padding: 12px 14px;
  border-radius: 8px;
  color: var(--white);
  background: var(--ink);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes pulse {
  70% {
    box-shadow: 0 0 0 10px rgba(168, 218, 220, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(168, 218, 220, 0);
  }
}

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

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

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

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

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

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

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

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

  .topbar,
  .topbar-actions {
    display: grid;
    align-items: stretch;
  }

  .tabs {
    overflow-x: auto;
    padding-bottom: 1px;
  }

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

  .timeline-item,
  .team-member {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

