:root {
  --bg0: #06090f;
  --bg1: #0d1424;
  --fg0: rgba(244, 247, 255, 0.94);
  --fg1: rgba(244, 247, 255, 0.75);
  --muted: rgba(244, 247, 255, 0.58);
  --line: rgba(255, 255, 255, 0.1);
  --card: rgba(255, 255, 255, 0.04);
  --accent: #52e3ff;
  --ok: #69e6a8;
  --warn: #ffd27a;
  --danger: #ff8f8f;
  --built: #8dc8ff;
  --unknown: #b7bcc9;
}

* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  color: var(--fg0);
  font-family:
    "Satoshi",
    "Space Grotesk",
    system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif;
  background: radial-gradient(
      1300px 680px at 18% 12%,
      rgba(82, 227, 255, 0.14),
      transparent 58%
    ),
    radial-gradient(
      980px 520px at 78% 36%,
      rgba(255, 143, 143, 0.11),
      transparent 58%
    ),
    linear-gradient(180deg, var(--bg0), var(--bg1));
}
body.modal-open {
  overflow: hidden;
}
a {
  color: inherit;
  text-decoration: none;
}

.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
.grid {
  position: absolute;
  inset: -18%;
  background-image: linear-gradient(
      to right,
      rgba(255, 255, 255, 0.042) 1px,
      transparent 1px
    ),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.042) 1px, transparent 1px);
  background-size: 58px 58px;
  transform: perspective(920px) rotateX(60deg) translateY(-16%);
  opacity: 0.32;
  mask-image: radial-gradient(
    closest-side at 50% 10%,
    rgba(0, 0, 0, 0.96),
    transparent 75%
  );
}
.grain {
  position: absolute;
  inset: -25%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.35'/%3E%3C/svg%3E");
  opacity: 0.13;
}
.glow {
  position: absolute;
  width: 720px;
  height: 720px;
  border-radius: 50%;
  filter: blur(38px);
  opacity: 0.18;
}
.glow.a {
  left: -180px;
  top: -220px;
  background: radial-gradient(
    circle at 30% 30%,
    rgba(82, 227, 255, 0.58),
    transparent 60%
  );
}
.glow.b {
  right: -240px;
  bottom: -240px;
  background: radial-gradient(
    circle at 60% 40%,
    rgba(255, 143, 143, 0.48),
    transparent 60%
  );
}

.top {
  max-width: 1220px;
  margin: 0 auto;
  padding: 28px 16px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}
.mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(
    135deg,
    rgba(82, 227, 255, 0.95),
    rgba(255, 210, 122, 0.88)
  );
}
.kicker {
  display: block;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg1);
  font-family: "Iosevka", ui-monospace, monospace;
}
.title {
  display: block;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.meta {
  color: var(--muted);
  font-size: 12px;
}

.wrap {
  max-width: 1220px;
  margin: 0 auto;
  padding: 8px 16px 28px;
}
.panel {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 16px;
  backdrop-filter: blur(8px);
  padding: 14px;
  margin-bottom: 12px;
}
.controls {
  display: grid;
  gap: 10px;
}
.row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.view-select {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  border: 0;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.view-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.view-tab {
  font-size: 12px;
  padding: 7px 11px;
  border-radius: 999px;
  color: var(--fg1);
  border-color: rgba(255, 255, 255, 0.18);
}
.view-tab.active {
  color: var(--fg0);
  border-color: rgba(82, 227, 255, 0.62);
  background: linear-gradient(
    135deg,
    rgba(82, 227, 255, 0.22),
    rgba(255, 210, 122, 0.2)
  );
  box-shadow: 0 0 0 1px rgba(82, 227, 255, 0.22) inset;
}

.controls-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
}
label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--fg1);
  min-width: 120px;
}
label.search {
  min-width: 220px;
  flex: 1 1 260px;
}
select,
input,
button {
  background: rgba(7, 12, 20, 0.74);
  color: var(--fg0);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 13px;
}
input::placeholder {
  color: var(--muted);
}
button {
  cursor: pointer;
}
button:hover {
  border-color: rgba(82, 227, 255, 0.45);
}
button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.section-title {
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg1);
  margin-bottom: 10px;
  font-family: "Iosevka", ui-monospace, monospace;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 10px;
}
.kpi {
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 12px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.18);
  display: grid;
  gap: 3px;
}
.kpi b {
  font-size: 20px;
  line-height: 1;
  letter-spacing: -0.01em;
}
.kpi small {
  color: var(--muted);
  font-size: 11px;
}

.chart-wrap {
  width: 100%;
  height: 220px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.14);
  overflow: hidden;
}
#timeline-chart {
  width: 100%;
  height: 100%;
  display: block;
}
.grid-line {
  stroke: rgba(255, 255, 255, 0.09);
  stroke-width: 1;
}
.axis {
  fill: rgba(244, 247, 255, 0.58);
  font-size: 11px;
  font-family: "Iosevka", ui-monospace, monospace;
}
.bar-p {
  fill: rgba(82, 227, 255, 0.55);
}
.bar-c {
  fill: rgba(255, 210, 122, 0.45);
}
.line-p {
  fill: none;
  stroke: rgba(82, 227, 255, 0.92);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.line-c {
  fill: none;
  stroke: rgba(255, 210, 122, 0.84);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.stack-waiting {
  fill: rgba(255, 210, 122, 0.72);
}
.stack-approved {
  fill: rgba(105, 230, 168, 0.75);
}
.stack-rejected {
  fill: rgba(255, 143, 143, 0.72);
}
.stack-built {
  fill: rgba(141, 200, 255, 0.76);
}

.list {
  display: grid;
  gap: 10px;
}
.item {
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 12px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.15);
}
.proposal-card {
  cursor: pointer;
  transition: border-color 0.14s ease;
}
.proposal-card:hover {
  border-color: rgba(82, 227, 255, 0.42);
}
.build-card {
  cursor: pointer;
  transition: border-color 0.14s ease;
}
.build-card:hover {
  border-color: rgba(141, 200, 255, 0.46);
}
.proposal-hint {
  margin-top: 8px;
  font-size: 11px;
  color: var(--muted);
}
.head {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.id {
  font-family: "Iosevka", ui-monospace, monospace;
  font-size: 12px;
  color: var(--fg1);
}
.tag {
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  color: var(--fg1);
}
.tag.waiting {
  color: var(--warn);
  border-color: rgba(255, 210, 122, 0.36);
}
.tag.approved {
  color: var(--ok);
  border-color: rgba(105, 230, 168, 0.35);
}
.tag.rejected {
  color: var(--danger);
  border-color: rgba(255, 143, 143, 0.36);
}
.tag.built {
  color: var(--built);
  border-color: rgba(141, 200, 255, 0.4);
}
.tag.unknown {
  color: var(--unknown);
  border-color: rgba(183, 188, 201, 0.38);
}

.title2 {
  font-weight: 700;
  font-size: 15px;
  margin: 2px 0 6px;
}
.desc {
  color: var(--fg1);
  font-size: 13px;
  line-height: 1.45;
  margin: 4px 0;
}
.meta2 {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

details {
  margin-top: 8px;
  border-top: 1px dashed rgba(255, 255, 255, 0.14);
  padding-top: 8px;
}
summary {
  cursor: pointer;
  color: var(--fg1);
  font-size: 12px;
  user-select: none;
}
.samples {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 8px;
}
ul {
  margin: 8px 0 0 16px;
  padding: 0;
  color: var(--muted);
}
li {
  margin: 4px 0;
}
.events li span {
  margin-right: 8px;
}
.note {
  margin-top: 8px;
  padding: 8px;
  border-radius: 8px;
  border: 1px dashed rgba(255, 255, 255, 0.14);
  color: var(--fg1);
  font-size: 12px;
}
.actions {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.actions .act {
  font-size: 12px;
  padding: 6px 9px;
}
.actions .act.approve {
  border-color: rgba(105, 230, 168, 0.4);
  color: var(--ok);
}
.actions .act.reject {
  border-color: rgba(255, 143, 143, 0.42);
  color: var(--danger);
}
.actions .act.build {
  border-color: rgba(141, 200, 255, 0.42);
  color: var(--built);
}
.actions .act.exec {
  border-color: rgba(82, 227, 255, 0.52);
  color: var(--accent);
}
.actions .act.copied {
  border-color: rgba(82, 227, 255, 0.6);
  color: var(--accent);
}

.kanban {
  display: grid;
  grid-template-columns: repeat(4, minmax(240px, 1fr));
  gap: 10px;
  overflow: auto;
  align-items: start;
}
.kan-col {
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.18);
  min-height: 260px;
}
.kan-col.waiting {
  background: linear-gradient(
    180deg,
    rgba(255, 210, 122, 0.08),
    rgba(0, 0, 0, 0.18)
  );
}
.kan-col.approved {
  background: linear-gradient(
    180deg,
    rgba(105, 230, 168, 0.08),
    rgba(0, 0, 0, 0.18)
  );
}
.kan-col.rejected {
  background: linear-gradient(
    180deg,
    rgba(255, 143, 143, 0.08),
    rgba(0, 0, 0, 0.18)
  );
}
.kan-col.built {
  background: linear-gradient(
    180deg,
    rgba(141, 200, 255, 0.09),
    rgba(0, 0, 0, 0.18)
  );
}
.kan-col header {
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.kan-list {
  padding: 8px;
  display: grid;
  gap: 8px;
}
.kan-card {
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 10px;
  padding: 8px;
  background: rgba(0, 0, 0, 0.16);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}
.kan-empty {
  color: var(--muted);
  font-size: 12px;
  padding: 8px;
}
.item a {
  color: var(--accent);
  text-decoration: underline;
}
.project-card {
  background: linear-gradient(
    180deg,
    rgba(82, 227, 255, 0.05),
    rgba(0, 0, 0, 0.15)
  );
}
.gantt {
  margin-top: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 8px;
  background: rgba(0, 0, 0, 0.16);
}
.gantt-range {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}
.gantt-row {
  display: grid;
  grid-template-columns: 260px 1fr 220px;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
}
.gantt-label {
  font-size: 12px;
  color: var(--fg1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gantt-track {
  position: relative;
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.gantt-bar {
  position: absolute;
  top: 0;
  height: 100%;
  border-radius: 999px;
  background: rgba(82, 227, 255, 0.78);
}
.gantt-bar.todo {
  background: rgba(255, 210, 122, 0.72);
}
.gantt-bar.in_progress {
  background: rgba(82, 227, 255, 0.78);
}
.gantt-bar.blocked {
  background: rgba(255, 143, 143, 0.78);
}
.gantt-bar.done {
  background: rgba(105, 230, 168, 0.82);
}
.gantt-date {
  font-size: 11px;
  color: var(--muted);
  font-family: "Iosevka", ui-monospace, monospace;
  text-align: right;
}
.gantt-empty {
  color: var(--muted);
  font-size: 12px;
  margin-top: 8px;
}
.res-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
}
.res-table th,
.res-table td {
  border: 1px solid rgba(255, 255, 255, 0.11);
  padding: 6px 8px;
  font-size: 12px;
  text-align: left;
}
.res-table th {
  color: var(--fg0);
  background: rgba(255, 255, 255, 0.05);
}
.res-table td {
  color: var(--fg1);
}

.op-modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: none;
}
.op-modal.open {
  display: flex;
}
.op-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 5, 9, 0.78);
  backdrop-filter: blur(3px);
}
.op-modal-card {
  position: relative;
  z-index: 1;
  margin: auto;
  width: min(1120px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  background: linear-gradient(
    180deg,
    rgba(7, 13, 24, 0.95),
    rgba(4, 8, 16, 0.95)
  );
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr;
}
.op-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.op-modal-head h2 {
  margin: 0;
  font-size: 14px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--fg1);
  font-family: "Iosevka", ui-monospace, monospace;
}
.op-modal-body {
  overflow: auto;
  padding: 12px;
  display: grid;
  gap: 10px;
}
.op-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}
.op-box {
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 10px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.16);
}
.op-box b {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--fg1);
}
.op-box p {
  margin: 0;
  color: var(--fg0);
  font-size: 13px;
  line-height: 1.45;
}
.op-list {
  margin: 0;
  padding-left: 16px;
}
.op-list li {
  color: var(--fg1);
  font-size: 13px;
  line-height: 1.42;
}
.op-score-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
}
.op-score-card {
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 10px;
  padding: 9px;
  background: rgba(0, 0, 0, 0.17);
}
.op-score-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 6px;
}
.op-score-head span {
  font-size: 12px;
  color: var(--fg1);
}
.op-score-head b {
  font-size: 14px;
  color: var(--fg0);
}
.op-score-track {
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}
.op-score-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(82, 227, 255, 0.82),
    rgba(255, 210, 122, 0.82)
  );
}
.op-score-note {
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted);
}
.op-kpi-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.op-kpi {
  font-size: 11px;
  color: var(--fg1);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 3px 8px;
  background: rgba(255, 255, 255, 0.04);
}
.op-table-wrap {
  overflow: auto;
}
.op-table {
  width: 100%;
  border-collapse: collapse;
}
.op-table th,
.op-table td {
  font-size: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 6px 8px;
  text-align: left;
  white-space: nowrap;
}
.op-table th {
  color: var(--fg0);
  background: rgba(255, 255, 255, 0.05);
}
.op-table td {
  color: var(--fg1);
}
.op-pre {
  margin: 8px 0 0;
  padding: 9px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.26);
  color: rgba(244, 247, 255, 0.92);
  font-size: 12px;
  line-height: 1.4;
  font-family: "Iosevka", ui-monospace, monospace;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 340px;
  overflow: auto;
}

.pager {
  display: block;
}
.pager-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  color: var(--fg1);
  font-size: 12px;
}

@media (max-width: 820px) {
  .top {
    padding-top: 20px;
  }
  .title {
    font-size: 21px;
  }
  .view-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
  }
  .view-tab {
    flex: 0 0 auto;
  }
  .controls-row label {
    min-width: 48%;
  }
  label.search {
    min-width: 100%;
  }
  .chart-wrap {
    height: 190px;
  }
  .kanban {
    grid-template-columns: 1fr;
  }
  .gantt-row {
    grid-template-columns: 1fr;
  }
  .gantt-date {
    text-align: left;
  }
  .op-modal-card {
    width: calc(100vw - 10px);
    max-height: calc(100vh - 10px);
  }
  .op-modal-head {
    padding: 10px;
  }
  .op-modal-body {
    padding: 10px;
  }
}
