:root {
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-strong: #eef3f8;
  --text: #17202a;
  --muted: #5f6e7d;
  --line: #d9e1e8;
  --accent: #1b6f79;
  --accent-strong: #12515a;
  --ok: #18754a;
  --warn: #a15d00;
  --bad: #a93232;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 15px;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 280px minmax(0, 1fr);
}

.sidebar {
  background: #15212d;
  color: #ffffff;
  padding: 24px 18px;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 28px;
}

.brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: #213344;
  border-radius: 6px;
  font-weight: 700;
}

.brand-title {
  font-weight: 700;
  line-height: 1.25;
}

.brand-subtitle {
  color: #b9c6d1;
  font-size: 13px;
  margin-top: 3px;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav-item {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #dce5ed;
  padding: 10px 12px;
  text-align: left;
}

.nav-item:hover,
.nav-item.is-active {
  background: #26394b;
  color: #ffffff;
}

.content {
  min-width: 0;
  padding: 28px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 18px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 26px;
  line-height: 1.2;
}

h2 {
  font-size: 18px;
}

h3 {
  font-size: 16px;
}

.topbar p {
  color: var(--muted);
  margin-top: 6px;
  max-width: 780px;
}

.primary-action,
.form-panel button {
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #ffffff;
  min-height: 40px;
  padding: 0 16px;
  font-weight: 650;
}

.action-group {
  display: flex;
  gap: 10px;
  align-items: center;
}

.action-group select {
  width: 260px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  padding: 0 10px;
}

.primary-action:hover,
.form-panel button:hover {
  background: var(--accent-strong);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.metric {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.metric-label {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.metric strong {
  font-size: 28px;
}

.workspace {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 520px;
  overflow: hidden;
}

.panel {
  display: none;
  padding: 18px;
}

.panel.is-visible {
  display: block;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.panel-header.secondary {
  border-top: 1px solid var(--line);
  margin-top: 24px;
  padding-top: 18px;
}

.filter-toolbar {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr)) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
}

.filter-toolbar label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
}

.filter-toolbar select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  min-height: 38px;
  padding: 0 10px;
}

.filter-toolbar .secondary-action {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  min-height: 38px;
  padding: 0 12px;
}

.filter-toolbar .secondary-action:hover {
  background: var(--surface-strong);
}

.monitor-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.summary-metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px 12px;
}

.summary-metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.summary-metric strong {
  font-size: 20px;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
}

.split.wide-editor {
  grid-template-columns: minmax(0, 1fr) 420px;
}

.form-stack {
  display: grid;
  gap: 16px;
}

.form-panel {
  align-self: start;
  display: grid;
  gap: 12px;
  border-left: 1px solid var(--line);
  padding-left: 18px;
}

.form-panel label,
.inline-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
}

.form-panel input,
.form-panel select,
.form-panel textarea,
.inline-form input,
.inline-form select,
.inline-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 10px;
  color: var(--text);
  background: #ffffff;
}

.form-panel textarea,
.inline-form textarea {
  min-height: 86px;
  resize: vertical;
}

.form-panel select[multiple] {
  min-height: 128px;
}

.inline-form {
  display: grid;
  gap: 12px;
}

.inline-form > button {
  justify-self: start;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #ffffff;
  min-height: 40px;
  padding: 0 16px;
  font-weight: 650;
}

.inline-form > button:hover {
  background: var(--accent-strong);
}

.check-row {
  display: flex !important;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
}

.check-row input {
  width: auto;
}

.button-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.button-row.compact {
  display: flex;
  gap: 8px;
  align-items: center;
}

.form-panel .secondary-action {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--text);
}

.form-panel .secondary-action:hover {
  background: var(--surface-strong);
}

.processing-editor #processing-rule-config {
  min-height: 154px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
}

.hint {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f7f9fb;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  padding: 10px;
}

.mapping-editor {
  gap: 14px;
}

.mapping-rows {
  display: grid;
  gap: 10px;
}

.mapping-row {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #ffffff;
}

.mapping-row-header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
}

.mapping-target {
  font-weight: 700;
}

.mapping-meta {
  color: var(--muted);
  font-size: 12px;
}

table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
}

.table-scroll {
  overflow-x: auto;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px;
  text-align: left;
  vertical-align: top;
  word-break: normal;
  overflow-wrap: break-word;
}

th {
  color: var(--muted);
  background: var(--surface-strong);
  font-size: 13px;
  font-weight: 650;
}

tr:last-child td {
  border-bottom: 0;
}

.badge {
  display: inline-flex;
  border-radius: 999px;
  padding: 3px 8px;
  background: var(--surface-strong);
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.badge.ready,
.badge.approved,
.badge.completed,
.badge.passed,
.badge.accepted,
.badge.enabled,
.badge.signed,
.badge.actual,
.badge.deployed,
.badge.low,
.badge.history_event {
  background: #e3f4ec;
  color: var(--ok);
}

.badge.failed,
.badge.critical,
.badge.blocked,
.badge.rejected,
.badge.timeout,
.badge.high {
  background: #fae7e7;
  color: var(--bad);
}

.badge.major,
.badge.medium,
.badge.planned,
.badge.in_release,
.badge.duplicate,
.badge.superseded {
  background: #fff0d8;
  color: var(--warn);
}

.badge.archived,
.badge.paused,
.badge.rolled_back {
  background: #eef1f4;
  color: #64748b;
}

.command-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 16px;
  margin-bottom: 18px;
}

.command-board-main,
.overview-card,
.readiness-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.command-board-main {
  padding: 16px;
}

.compact-header {
  margin-bottom: 12px;
}

.compact-header p {
  color: var(--muted);
  margin-top: 5px;
}

.pipeline-board {
  display: grid;
  grid-template-columns: repeat(7, minmax(118px, 1fr));
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.pipeline-node {
  position: relative;
  display: grid;
  min-height: 168px;
  grid-template-rows: auto auto auto 1fr auto;
  gap: 8px;
  border: 1px solid var(--line);
  border-top: 4px solid #93a4b4;
  border-radius: 8px;
  background: #f8fafc;
  color: var(--text);
  padding: 12px;
  text-align: left;
}

.pipeline-node:hover {
  border-color: #9fb2c3;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(21, 33, 45, 0.08);
}

.pipeline-node.ready {
  border-top-color: var(--ok);
}

.pipeline-node.attention {
  border-top-color: var(--warn);
}

.pipeline-node.blocked {
  border-top-color: var(--bad);
}

.pipeline-node.missing {
  border-top-color: #8a98a7;
  opacity: 0.86;
}

.pipeline-index {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: #e7edf3;
  color: #2c3b4b;
  font-size: 12px;
  font-weight: 800;
}

.pipeline-title {
  font-weight: 800;
}

.pipeline-node strong {
  font-size: 28px;
  font-variant-numeric: tabular-nums;
}

.pipeline-node small {
  color: var(--muted);
  line-height: 1.35;
}

.pipeline-status {
  justify-self: start;
  border-radius: 999px;
  background: #eef3f8;
  color: #405163;
  font-size: 12px;
  font-weight: 750;
  padding: 4px 8px;
}

.command-board-side {
  display: grid;
  gap: 12px;
}

.readiness-card {
  display: grid;
  align-content: start;
  min-height: 128px;
  padding: 16px;
}

.readiness-card span {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.readiness-card strong {
  font-size: 34px;
  line-height: 1;
}

.readiness-card p {
  color: #405163;
  line-height: 1.4;
  margin-top: 10px;
}

.muted-card {
  background: #f8fafc;
}

.muted-card strong {
  font-size: 19px;
  line-height: 1.2;
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.overview-card {
  padding: 16px;
}

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

.signal-row {
  display: grid;
  gap: 5px;
  width: 100%;
  border: 1px solid var(--line);
  border-left: 4px solid #93a4b4;
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  padding: 10px 12px;
  text-align: left;
}

.signal-row:hover {
  background: #f8fafc;
}

.signal-row.ready {
  border-left-color: var(--ok);
}

.signal-row.attention {
  border-left-color: var(--warn);
}

.signal-row.blocked {
  border-left-color: var(--bad);
}

.signal-row.missing {
  border-left-color: #8a98a7;
}

.signal-row span {
  font-weight: 750;
}

.signal-row small {
  color: var(--muted);
  line-height: 1.35;
}
.run-list {
  display: grid;
  gap: 10px;
}

.run-row {
  display: grid;
  grid-template-columns: 100px repeat(5, minmax(100px, 1fr)) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.link-button {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  min-height: 34px;
  padding: 0 10px;
  text-decoration: none;
}

.doc-section {
  margin-bottom: 18px;
}

.doc-section > h3 {
  margin: 0 0 10px;
}

.doc-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 10px;
}

.doc-item h3 {
  margin-bottom: 8px;
}

.doc-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.doc-item pre {
  white-space: pre-wrap;
  max-height: 220px;
  overflow: auto;
  background: #f7f9fb;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
}

dialog {
  width: min(820px, calc(100vw - 32px));
  border: 0;
  border-radius: 8px;
  padding: 0;
}

dialog::backdrop {
  background: rgba(15, 24, 32, 0.48);
}

.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding: 14px 16px;
}

.dialog-header button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  font-size: 22px;
  line-height: 1;
}

#report-content {
  margin: 0;
  padding: 16px;
  max-height: 70vh;
  overflow: auto;
  white-space: pre-wrap;
}

@media (max-width: 960px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    padding: 16px;
  }

  .nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .metrics,
  .split,
  .filter-toolbar,
  .command-board,
  .overview-grid {
    grid-template-columns: 1fr;
  }

  .form-panel {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding-left: 0;
    padding-top: 18px;
  }

  .topbar {
    flex-direction: column;
  }

  .action-group {
    width: 100%;
  }

  .action-group select,
  .primary-action {
    flex: 1 1 auto;
  }
}

@media (max-width: 640px) {
  .content {
    padding: 16px;
  }

  .nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .run-row,
  .pipeline-board {
    grid-template-columns: 1fr;
  }

  .pipeline-node {
    min-height: 136px;
  }

  .action-group {
    flex-direction: column;
    align-items: stretch;
  }

  .action-group select {
    width: 100%;
  }
}
.nav-group {
  display: grid;
  gap: 5px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  margin-top: 8px;
  padding-top: 10px;
}

.nav-group-title {
  color: #91a4b5;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  padding: 0 12px 2px;
  text-transform: uppercase;
}

.nav-item.nav-item-planned {
  color: #8fa1b0;
  opacity: 0.72;
  cursor: default;
}

.nav-item.nav-item-planned:hover {
  background: transparent;
  color: #8fa1b0;
}

.landing-page {
  background: var(--bg);
  color: var(--text);
}

.landing-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(245, 247, 250, 0.96);
  padding: 14px 32px;
}

.landing-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
}

.landing-brand small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.landing-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 14px;
}

.landing-nav a,
.secondary-link {
  color: var(--text);
  text-decoration: none;
}

.landing-nav a:hover,
.secondary-link:hover {
  color: var(--accent-strong);
}

.landing-login,
.secondary-link {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 14px;
  background: #ffffff;
}

.landing-hero {
  min-height: calc(100vh - 74px);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  gap: 40px;
  align-items: center;
  padding: 56px 48px 44px;
  border-bottom: 1px solid var(--line);
  background: #edf2f6;
}

.hero-copy {
  max-width: 780px;
}

.landing-eyebrow,
.section-heading span {
  color: var(--accent-strong);
  display: block;
  font-size: 13px;
  font-weight: 750;
  margin-bottom: 12px;
  text-transform: uppercase;
}

.landing-hero h1 {
  max-width: 760px;
  font-size: 56px;
  line-height: 1.02;
}

.hero-lead {
  max-width: 760px;
  color: #334253;
  font-size: 21px;
  line-height: 1.45;
  margin-top: 22px;
}

.landing-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 28px;
}

.landing-actions .primary-action,
.demo-form .primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  text-decoration: none;
}

.hero-board {
  display: grid;
  gap: 10px;
  border: 1px solid #c9d5df;
  border-radius: 8px;
  background: #ffffff;
  padding: 18px;
  box-shadow: 0 18px 50px rgba(21, 33, 45, 0.12);
}

.board-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  border: 1px solid var(--line);
  border-left: 4px solid var(--ok);
  border-radius: 6px;
  background: #f8fafc;
  padding: 14px;
}

.board-row.warning {
  border-left-color: var(--warn);
}

.board-row span {
  font-weight: 700;
}

.board-row b {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.landing-section {
  padding: 58px 48px;
}

.section-heading {
  max-width: 900px;
  margin-bottom: 24px;
}

.section-heading h2 {
  font-size: 34px;
  line-height: 1.12;
}

.landing-grid {
  display: grid;
  gap: 14px;
}

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

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

.landing-grid article,
.demo-form,
.security-layout {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 20px;
}

.landing-grid h3 {
  margin-bottom: 8px;
}

.landing-grid p,
.security-layout p,
.security-layout li {
  color: #405163;
  line-height: 1.5;
}

.pipeline-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(112px, 1fr));
  gap: 8px;
  overflow-x: auto;
}

.pipeline-strip span {
  position: relative;
  min-height: 76px;
  display: grid;
  place-items: center;
  border: 1px solid #c7d4de;
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  font-weight: 750;
  text-align: center;
}

.pipeline-strip span:not(:last-child)::after {
  content: "";
  position: absolute;
  right: -9px;
  width: 10px;
  height: 2px;
  background: #90a6b8;
}

.security-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.6fr);
  gap: 24px;
}

.security-layout ul {
  margin: 0;
  padding-left: 20px;
}

.demo-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  max-width: 980px;
}

.demo-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.demo-form input,
.demo-form select,
.demo-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  padding: 10px;
}

.demo-form .wide,
.demo-form button,
.form-state {
  grid-column: 1 / -1;
}

.demo-form button {
  justify-self: start;
}

.consent {
  display: flex !important;
  grid-template-columns: none;
  align-items: center;
  gap: 10px;
}

.consent input {
  width: auto;
}

.hp-field {
  position: absolute;
  left: -10000px;
}

.form-state {
  color: var(--accent-strong);
  min-height: 22px;
}

.landing-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  color: var(--muted);
  padding: 24px 48px;
}

@media (max-width: 960px) {
  .landing-header,
  .landing-hero,
  .landing-section,
  .landing-footer {
    padding-left: 20px;
    padding-right: 20px;
  }

  .landing-header {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

  .landing-hero,
  .security-layout,
  .demo-form,
  .landing-grid.three,
  .landing-grid.four {
    grid-template-columns: 1fr;
  }

  .landing-hero h1 {
    font-size: 38px;
  }

  .hero-lead {
    font-size: 18px;
  }
}
