:root {
  --font-weight-medium: 500;
  --font-weight-semibold: 600;

  font-family: Inter, "Segoe UI", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
  color: #1e3430;
  background: #f4f6f3;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

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

button {
  cursor: pointer;

  padding: 0.625rem 0.9375rem;
  border: 1px solid #d4ddd5;
  border-radius: 0.5rem;

  color: #23443a;

  background: #fff;
}

button:hover {
  background: #edf3eb;
}

button:disabled {
  cursor: wait;
  opacity: 0.5;
}

button.primary {
  border-color: #235a43;
  color: #fff;
  background: #235a43;
}

button.primary:hover {
  background: #16442f;
}

input, select, textarea {
  width: 100%;
  padding: 0.625rem;
  border: 1px solid #d7dfd8;
  border-radius: 0.4375rem;

  color: #173a2d;

  background: #fcfdfb;
}

textarea {
  resize: vertical;
  min-height: 5rem;
}

input:focus, select:focus, textarea:focus {
  outline: 2px solid #a5c4ac;
  outline-offset: 1px;
}

label {
  display: grid;
  gap: 0.375rem;
  margin: 0.875rem 0;
  font-size: 0.875rem;
}

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

h1 {
  margin-bottom: 0;
  font-size: 1.625rem;
  font-weight: var(--font-weight-semibold);
}

h2 {
  font-size: 1.125rem;
  font-weight: var(--font-weight-semibold);
}

p {
  line-height: 1.7;
}

small {
  font-size: 0.75rem;
}

.shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;

  display: flex;
  flex-direction: column;
  flex-shrink: 0;

  width: 15rem;
  padding: 2rem 1.125rem;

  color: #e9f0e7;

  background: #132e27;
}

.identity {
  display: flex;
  gap: 0.625rem;
  align-items: center;

  font-size: 0.8125rem;
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.08rem;
}

.identity small {
  display: block;
  margin-top: 0.375rem;
  color: #afc1b5;
  letter-spacing: 0.02rem;
}

.logo {
  display: grid;
  place-items: center;

  width: 2.6875rem;
  height: 2.6875rem;
  border-radius: 0.625rem;

  font-size: 1.625rem;
  color: #163b28;

  background: #d0e8a0;
}

.navLabel {
  margin: 2.8125rem 0 0.8125rem 0.625rem;
  font-size: 0.6875rem;
  color: #95b0a1;
}

.navItem {
  display: block;

  width: 100%;
  margin: 0.3125rem 0;
  padding: 0.875rem;
  border: 0;

  color: #c6d7cd;
  text-align: left;

  background: transparent;
}

.navItem.active, .navItem:hover {
  color: #e9f2df;
  background: #2c493b;
}

.sidebarFoot {
  margin-top: auto;
  padding: 2rem 0.5rem 0;
  font-size: 0.8125rem;
  color: #c0d0c4;
}

.sidebarFoot small {
  display: block;
  margin-top: 0.6875rem;
  line-height: 1.6;
  color: #8daa98;
}

.dot {
  display: inline-block;

  width: 0.4375rem;
  height: 0.4375rem;
  margin-right: 0.375rem;
  border-radius: 50%;

  background: #c1da83;
}

.main {
  width: calc(100% - 15rem);
  max-width: 110rem;
  margin-left: 15rem;
  padding: 2rem 2.5rem;
}

.header, .headerActions, .cardTitle, .actions {
  display: flex;
  gap: 0.6875rem;
  align-items: center;
}

.header {
  justify-content: space-between;
  margin-bottom: 2rem;
}

.headerActions {
  flex-wrap: wrap;
  font-size: 0.75rem;
  color: #6b7b70;
}

.eyebrow {
  margin-bottom: 0.5625rem;
  font-size: 0.625rem;
  color: #728475;
  letter-spacing: 0.13rem;
}

.intro {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;

  margin-bottom: 1.5rem;
  padding: 1.5rem 1.6875rem;
  border: 1px solid #dce5cc;
  border-radius: 0.8125rem;

  background: #e8eedc;
}

.intro h2 {
  margin-bottom: 0.4375rem;
  font-size: 1.375rem;
}

.intro p {
  margin-bottom: 0;
  font-size: 0.875rem;
  color: #64745d;
}

.pill {
  padding: 0.5rem 0.8125rem;
  border: 1px solid #c6d2b6;
  border-radius: 2rem;

  font-size: 0.75rem;
  white-space: nowrap;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.metric {
  padding: 1.3125rem;
  border: 1px solid #e0e5dc;
  border-radius: 0.6875rem;
  background: #fff;
}

.metric span {
  font-size: 0.8125rem;
  color: #697c6d;
}

.metric strong {
  display: block;
  margin: 0.8125rem 0;
  font-size: 2.3125rem;
  font-weight: var(--font-weight-semibold);
}

.metric small {
  color: #7f8a7c;
}

.twoColumns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.375rem;
  align-items: start;
}

.card {
  min-width: 0;
  margin-bottom: 1.375rem;
  padding: 1.5rem;
  border: 1px solid #e0e5dd;
  border-radius: 0.75rem;

  background: #fff;
}

.cardTitle {
  justify-content: space-between;
  margin-bottom: 0.8125rem;
}

.cardTitle h2 {
  margin-bottom: 0;
}

.badge {
  display: inline-block;

  padding: 0.3125rem 0.625rem;
  border-radius: 1rem;

  font-size: 0.6875rem;
  color: #687969;
  white-space: nowrap;

  background: #f0f3ed;
}

.badge.running, .badge.ready, .badge.approved, .badge.succeeded, .badge.accepted {
  color: #326143;
  background: #e6f2e2;
}

.badge.uncertain, .badge.blocked, .badge.error, .badge.review {
  color: #925e25;
  background: #fff0df;
}

.details {
  margin: 1.3125rem 0;
}

.details div {
  display: flex;
  justify-content: space-between;

  padding: 0.6875rem 0;
  border-bottom: 1px solid #edf0e9;

  font-size: 0.875rem;
}

.details dt {
  color: #758374;
}

.details dd {
  margin-left: 1rem;
}

.readiness {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.readiness span, .readiness strong {
  display: block;
  font-size: 0.8125rem;
}

.readiness span {
  margin-bottom: 0.6875rem;
  color: #7a8876;
}

.muted {
  color: #778471;
}

.small {
  font-size: 0.75rem;
}

.empty {
  padding: 2rem 1rem;

  font-size: 0.875rem;
  line-height: 1.8;
  color: #8a9484;
  text-align: center;
}

.fieldRow {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8125rem;
}

.checkbox {
  display: flex;
  align-items: flex-start;
  line-height: 1.6;
}

.checkbox input {
  width: 1rem;
  height: 1rem;
  margin-top: 0.1875rem;
}

.actions {
  flex-wrap: wrap;
}

.notice {
  margin-bottom: 1.1875rem;
  padding: 0.875rem 1rem;
  border-radius: 0.5rem;

  font-size: 0.875rem;

  background: #e5efdd;
}

.error {
  color: #9a4a2b;
}

.notice.error {
  background: #f9eade;
}

.qrPanel {
  text-align: center;
}

.qrPanel canvas {
  display: block;
  margin: 1rem auto;
}

.resource {
  padding: 1rem 0;
  border-top: 1px solid #edf0e9;
}

.resource summary {
  cursor: pointer;

  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
}

.resource small {
  display: block;
  margin-top: 0.5rem;
  color: #7c8975;
}

.resource strong {
  font-size: 0.875rem;
}

.contentItem {
  padding: 1.1875rem 0;
  border-top: 1px solid #edf0e9;
}

.messageText {
  font-size: 0.875rem;
  white-space: pre-wrap;
}

.inboxGrid {
  display: grid;
  grid-template-columns: 19rem 1fr;
  gap: 1.3125rem;
}

.leadItem {
  display: grid;
  gap: 0.4375rem;

  width: 100%;
  padding: 1rem 0.5rem;
  border: 0;
  border-bottom: 1px solid #edf0e9;
  border-radius: 0;

  text-align: left;
}

.leadItem small {
  color: #7c8975;
}

.leadItem.selected {
  background: #edf4e7;
}

.messages {
  overflow-y: auto;
  min-height: 10rem;
  max-height: 30rem;
  padding: 1rem 0;
}

.bubble {
  max-width: 90%;
  margin: 0.8125rem 0;
  padding: 0.8125rem 1rem;
  border-radius: 0.625rem;

  overflow-wrap: anywhere;

  background: #f0f3ec;
}

.bubble.out {
  margin-left: auto;
  background: #e1efd9;
}

.bubble small {
  color: #6f8069;
}

.bubble p {
  margin: 0.4375rem 0 0;
  font-size: 0.875rem;
  white-space: pre-wrap;
}

.codeInput {
  font-family: Consolas, monospace;
  font-size: 0.75rem;
}

.issue {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;

  padding: 1rem 0;
  border-top: 1px solid #edf0e9;
}

.issue small {
  display: block;
  margin-top: 0.5rem;
  color: #829078;
  overflow-wrap: anywhere;
}

.tableWrap {
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.8125rem;
}

th, td {
  padding: 0.875rem 0.625rem;
  border-bottom: 1px solid #edf0e9;
  text-align: left;
}

th {
  font-weight: var(--font-weight-medium);
  color: #7d8b75;
  white-space: nowrap;
}

td:last-child {
  max-width: 22rem;
  overflow-wrap: anywhere;
}

dialog {
  width: 28rem;
  max-width: calc(100% - 2rem);
  padding: 2rem;
  border: 1px solid #dce3d7;
  border-radius: 1rem;

  color: #1e3430;
}

dialog::backdrop {
  background: #183a2be0;
}

[hidden] {
  display: none !important;
}

@media (max-width: 1150px) {
  .sidebar {
    width: 12rem;
  }
  .main {
    width: calc(100% - 12rem);
    margin-left: 12rem;
    padding: 1.5rem;
  }
  .metrics, .readiness {
    grid-template-columns: repeat(2, 1fr);
  }
  .inboxGrid {
    grid-template-columns: 15rem 1fr;
  }
}

@media (max-width: 800px) {
  .shell {
    display: block;
  }
  .sidebar {
    position: static;
    width: 100%;
    padding: 1rem;
  }
  .sidebar nav {
    overflow-x: auto;
    display: flex;
    margin-top: 1rem;
  }
  .navItem {
    width: auto;
    white-space: nowrap;
  }
  .navLabel, .sidebarFoot {
    display: none;
  }
  .main {
    width: 100%;
    margin: 0;
    padding: 1rem;
  }
  .header {
    gap: 1rem;
    align-items: flex-start;
  }
  .headerActions {
    justify-content: flex-end;
  }
  .twoColumns, .inboxGrid {
    grid-template-columns: 1fr;
  }
  .intro {
    padding: 1.1875rem;
  }
  .pill {
    display: none;
  }
  .card {
    padding: 1.125rem;
  }
}
