:root {
  --ink: #2d3142;
  --paper: #f7fff7;
  --line: rgba(45, 49, 66, 0.16);
  --muted: #68707f;
  --amber: #ff9f1c;
  --teal: #2ec4b6;
  --danger: #c93c3c;
  --surface: #ffffff;
  --shadow: 0 18px 50px rgba(45, 49, 66, 0.10);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(46, 196, 182, 0.08) 0 1px, transparent 1px 100%),
    linear-gradient(180deg, rgba(45, 49, 66, 0.07) 0 1px, transparent 1px 100%),
    var(--paper);
  background-size: 38px 38px;
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.command-bar {
  min-height: 74px;
  display: grid;
  grid-template-columns: minmax(230px, 1fr) auto minmax(120px, 170px);
  align-items: center;
  gap: 18px;
  padding: 12px clamp(16px, 3vw, 34px);
  border-bottom: 1px solid var(--line);
  background: rgba(247, 255, 247, 0.94);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  color: inherit;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  min-width: 0;
}

.brand strong,
h1,
h2 {
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: 0;
}

.brand strong {
  display: block;
  font-size: 21px;
  line-height: 1;
}

.brand small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.screen-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.68);
}

.tab {
  border: 0;
  color: var(--muted);
  background: transparent;
  min-height: 38px;
  padding: 0 14px;
  cursor: pointer;
}

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

.sync-state {
  justify-self: end;
  min-height: 34px;
  display: inline-grid;
  place-items: center;
  padding: 0 12px;
  color: var(--ink);
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 12px;
  font-weight: 700;
}

.sync-state[data-tone="ok"] {
  border-color: rgba(46, 196, 182, 0.55);
}

.sync-state[data-tone="demo"] {
  border-color: rgba(255, 159, 28, 0.72);
}

.sync-state[data-tone="error"] {
  border-color: rgba(201, 60, 60, 0.7);
}

.workspace {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 18px;
  padding: 18px clamp(16px, 3vw, 34px) 12px;
  align-items: stretch;
}

.panel,
.board-area {
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.rail {
  padding: 18px;
  min-height: 520px;
}

.rail-head {
  display: grid;
  gap: 8px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  color: var(--teal);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.metric-stack {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.metric {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 12px;
  min-height: 62px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.metric span {
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  font-size: 28px;
}

.metric.accent strong {
  color: #b86400;
}

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

.public-box {
  display: grid;
  grid-template-columns: 12px 1fr;
  gap: 12px;
  margin-top: 22px;
  padding: 14px;
  background: rgba(46, 196, 182, 0.12);
  border-left: 4px solid var(--teal);
}

.public-box p {
  margin: 0;
  color: #34404c;
  line-height: 1.45;
  font-size: 13px;
}

.signal {
  width: 12px;
  height: 12px;
  margin-top: 3px;
  background: var(--teal);
  border-radius: 50%;
  box-shadow: 0 0 0 6px rgba(46, 196, 182, 0.18);
}

.board-area {
  min-width: 0;
  padding: 18px;
}

.toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
}

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

h1 {
  margin-bottom: 6px;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1;
}

h2 {
  margin-bottom: 8px;
  font-size: 28px;
  line-height: 1.08;
}

.toolbar p,
.section-title + p {
  color: var(--muted);
  margin-bottom: 0;
}

.filters {
  display: grid;
  grid-template-columns: minmax(220px, 340px) 160px;
  gap: 8px;
}

input,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
}

.workflow-columns {
  display: grid;
  grid-template-columns: repeat(4, minmax(190px, 1fr));
  gap: 10px;
  min-height: 440px;
}

.workflow-column {
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  border-left: 3px solid var(--line);
  background: rgba(247, 255, 247, 0.58);
}

.workflow-column:nth-child(1) {
  border-left-color: var(--amber);
}

.workflow-column:nth-child(3) {
  border-left-color: var(--teal);
}

.column-head {
  min-height: 44px;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

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

.column-items {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 10px;
}

.work-item {
  display: grid;
  gap: 10px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.work-item:hover {
  transform: translateY(-2px);
  border-color: rgba(46, 196, 182, 0.55);
  box-shadow: 0 10px 25px rgba(45, 49, 66, 0.12);
}

.item-top {
  display: grid;
  grid-template-columns: 10px 1fr;
  gap: 8px;
}

.item-top strong {
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.25;
}

.status-dot {
  width: 10px;
  height: 10px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--teal);
}

.status-dot.edit {
  background: var(--amber);
}

.status-dot.danger {
  background: var(--danger);
}

.work-item p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.item-meta span,
.public-status,
.list-row span,
.list-row em {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 0 8px;
  background: rgba(45, 49, 66, 0.06);
  color: #404858;
  font-size: 12px;
  font-style: normal;
}

.public-status {
  justify-self: start;
  background: rgba(46, 196, 182, 0.14);
  color: #156a63;
  line-height: 1.3;
  height: auto;
  min-height: 28px;
  padding-top: 5px;
  padding-bottom: 5px;
}

.empty {
  color: var(--muted);
  font-size: 13px;
}

.side-pane {
  grid-column: 2;
  padding: 24px;
  min-height: 520px;
}

.section-title {
  max-width: 720px;
  margin-bottom: 22px;
}

.request-form {
  display: grid;
  gap: 16px;
  max-width: 740px;
}

label {
  display: grid;
  gap: 7px;
  color: #404858;
  font-size: 13px;
  font-weight: 800;
}

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

.primary-btn {
  justify-self: start;
  min-height: 44px;
  border: 0;
  padding: 0 18px;
  color: var(--ink);
  background: var(--amber);
  font-weight: 900;
  cursor: pointer;
}

.primary-btn:hover {
  filter: brightness(0.96);
}

.form-note {
  max-width: 560px;
  color: var(--muted);
  font-size: 13px;
}

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

.list-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 58px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.list-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.list-row small {
  grid-column: 2 / 4;
  color: var(--muted);
}

.finance-total {
  margin-bottom: 14px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: clamp(22px, 4vw, 34px);
  font-family: Georgia, "Times New Roman", serif;
}

.event-stream {
  min-height: 78px;
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 14px;
  align-items: stretch;
  padding: 0 clamp(16px, 3vw, 34px) 18px;
}

.stream-label {
  display: grid;
  place-items: center start;
  color: var(--muted);
  font-weight: 900;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.08em;
}

.stream-items {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(230px, 1fr);
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.stream-item {
  display: grid;
  align-content: center;
  gap: 5px;
  min-height: 70px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
}

.stream-item span {
  color: var(--amber);
  font-size: 12px;
  font-weight: 900;
}

.stream-item strong {
  font-size: 13px;
  line-height: 1.25;
}

.is-hidden {
  display: none !important;
}

@media (max-width: 1050px) {
  .command-bar,
  .workspace,
  .event-stream {
    grid-template-columns: 1fr;
  }

  .screen-tabs,
  .sync-state {
    justify-self: stretch;
  }

  .screen-tabs {
    overflow-x: auto;
  }

  .tab {
    flex: 1 0 auto;
  }

  .rail,
  .side-pane {
    min-height: auto;
  }

  .side-pane {
    grid-column: auto;
  }

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

@media (max-width: 680px) {
  .command-bar {
    gap: 10px;
    padding: 10px 12px;
  }

  .workspace {
    padding: 12px;
  }

  .toolbar,
  .filters {
    display: grid;
    grid-template-columns: 1fr;
  }

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

  .board-area,
  .side-pane,
  .rail {
    padding: 14px;
  }

  .list-row {
    grid-template-columns: 1fr;
  }

  .list-row small {
    grid-column: auto;
  }

  .event-stream {
    padding: 0 12px 12px;
  }
}

