.admin-body {
  --admin-accent: #146c5a;
  --admin-accent-strong: #0d5142;
  --admin-accent-soft: #e6f4ef;
  --admin-line: #dce6e2;
  --admin-muted: #64736e;
}

.admin-body .brand-mark {
  background: linear-gradient(145deg, #17816a, #0d5142);
}

.admin-body .app-sidebar {
  border-right-color: var(--admin-line);
}

.admin-body .app-content {
  padding-bottom: 56px;
}

.level-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.level-card {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  min-height: 116px;
  padding: 16px;
  border: 1px solid var(--admin-line);
  border-radius: 14px;
  background: #fff;
}

.level-card > .badge {
  position: absolute;
  top: 12px;
  right: 12px;
}

.level-card strong {
  display: block;
  padding-right: 72px;
  color: #1b2c27;
  font-size: 14px;
}

.level-card p {
  margin: 6px 0 0;
  color: var(--admin-muted);
  font-size: 12px;
  line-height: 1.7;
}

.level-number {
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 10px;
  background: #f0f4f2;
  color: #51605b;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
}

.level-card--done {
  border-color: #cfe4dc;
  background: linear-gradient(145deg, #fff, #f8fcfa);
}

.level-card--done .level-number {
  background: var(--admin-accent-soft);
  color: var(--admin-accent);
}

.level-card--working {
  border-color: #f1dcb1;
  background: linear-gradient(145deg, #fff, #fffcf5);
}

.level-card--working .level-number {
  background: #fff3d8;
  color: #9a651d;
}

.level-card--blocked .level-number {
  background: #f4f5f5;
  color: #7a8581;
}

.metric-list > div {
  align-items: center;
}

.metric-list > div strong {
  text-align: right;
}

.check-list {
  display: grid;
  gap: 10px;
}

.check-item {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--admin-line);
  border-radius: 12px;
  background: #fff;
}

.check-item > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.check-item strong {
  color: #21332d;
  font-size: 13px;
}

.check-item span:last-child {
  overflow: hidden;
  color: var(--admin-muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.check-mark {
  display: inline-grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
}

.check-item--ok {
  border-color: #cfe6dd;
  background: #f8fcfa;
}

.check-item--ok .check-mark {
  background: #dff1e9;
  color: #12634f;
}

.check-item--pending {
  border-color: #ecdfc5;
  background: #fffdf8;
}

.check-item--pending .check-mark {
  background: #fff0cf;
  color: #98611a;
}

.table-primary {
  color: #20332c;
  font-weight: 700;
}

.table-secondary {
  margin-top: 3px;
  color: var(--admin-muted);
  font-size: 12px;
  line-height: 1.5;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.table-actions .button {
  min-height: 30px;
  padding: 5px 9px;
}

.data-table td {
  vertical-align: middle;
}

.data-table .badge + .badge {
  margin-left: 4px;
}

.code-label {
  display: inline-block;
  max-width: 220px;
  overflow: hidden;
  padding: 3px 7px;
  border-radius: 6px;
  background: #f1f5f3;
  color: #3a4e47;
  font-family: Consolas, "Courier New", monospace;
  font-size: 11px;
  text-overflow: ellipsis;
  vertical-align: middle;
  white-space: nowrap;
}

.details-cell {
  max-width: 310px;
  color: var(--admin-muted);
  font-family: Consolas, "Courier New", monospace;
  font-size: 11px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.uuid-value {
  color: var(--admin-muted);
  font-family: Consolas, "Courier New", monospace;
  font-size: 11px;
  overflow-wrap: anywhere;
}

.number-positive {
  color: #12634f;
  font-weight: 800;
}

.number-negative {
  color: #a23c35;
  font-weight: 800;
}

.admin-plan-table td:nth-child(2),
.admin-plan-table td:nth-child(3),
.admin-plan-table td:nth-child(4),
.admin-plan-table td:nth-child(5),
.admin-plan-table td:nth-child(6),
.admin-plan-table td:nth-child(7) {
  white-space: nowrap;
}

.estimator-result {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid #cbe3da;
  border-radius: 12px;
  background: #f5fbf8;
}

.estimator-result span {
  color: var(--admin-muted);
  font-size: 12px;
}

.estimator-result strong {
  color: var(--admin-accent);
  font-size: 24px;
}

.estimator-result small {
  color: var(--admin-muted);
  font-size: 11px;
}

.detail-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 26px;
}

.detail-action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--admin-line);
}

.detail-tabs {
  display: flex;
  gap: 6px;
  margin: 18px 0 12px;
  overflow-x: auto;
  border-bottom: 1px solid var(--admin-line);
}

.detail-tabs button {
  flex: 0 0 auto;
  padding: 11px 14px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--admin-muted);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
}

.detail-tabs button:hover {
  color: var(--admin-accent);
}

.detail-tabs button.is-active {
  border-bottom-color: var(--admin-accent);
  color: var(--admin-accent);
}

.detail-tab-panel[hidden] {
  display: none;
}

.address-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.address-list a {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 15px;
  border: 1px solid var(--admin-line);
  border-radius: 11px;
  background: #fff;
  color: #244137;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.address-list a:hover {
  border-color: #a9cec1;
  background: #f7fcfa;
}

.address-list a span {
  color: var(--admin-muted);
  font-family: Consolas, "Courier New", monospace;
  font-size: 11px;
  font-weight: 400;
}

.form-message[data-type="success"] {
  color: #12634f;
}

.admin-body .dialog {
  max-height: min(88vh, 900px);
}

.admin-body .dialog-body {
  max-height: calc(88vh - 170px);
  overflow-y: auto;
}

.admin-body .page-section.is-active {
  animation: admin-fade-in 160ms ease-out;
}

@keyframes admin-fade-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1180px) {
  .level-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-info-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .check-item > div {
    display: grid;
    gap: 2px;
  }

  .check-item span:last-child {
    white-space: normal;
  }

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

@media (max-width: 680px) {
  .level-grid {
    grid-template-columns: 1fr;
  }

  .level-card {
    min-height: 104px;
  }

  .estimator-result {
    align-items: flex-start;
    flex-direction: column;
  }

  .detail-tabs {
    margin-top: 12px;
  }

  .admin-body .app-content {
    padding-bottom: 30px;
  }
}
