:root {
  color: #18231f;
  background: #f2f4f1;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
  letter-spacing: 0;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-width: 320px;
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

.topbar {
  display: flex;
  min-height: 104px;
  padding: 24px clamp(20px, 5vw, 72px);
  align-items: center;
  justify-content: space-between;
  background: #21483b;
  color: #fff;
}

.topbar h1,
.workspace h2,
.audit-band h2,
.auth-band h2,
.order-dialog h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.25;
}

.brand-place,
.section-kicker {
  margin: 0 0 6px;
  color: #c4472d;
  font-size: 12px;
  font-weight: 750;
}

.brand-place {
  color: rgba(255, 255, 255, 0.62);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.connection {
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
}

.connection.online {
  color: #bfe6d4;
}

.icon-button {
  display: inline-grid;
  width: 40px;
  height: 40px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font-size: 24px;
}

main {
  width: min(1440px, 100%);
  margin: 0 auto;
}

.auth-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 440px);
  gap: 48px;
  padding: 48px clamp(20px, 5vw, 72px);
  background: #fff;
  border-bottom: 1px solid #dce2dd;
}

.auth-band p {
  max-width: 620px;
  margin: 12px 0 0;
  color: #68716c;
  line-height: 1.65;
}

.auth-form,
.status-form {
  display: grid;
  gap: 10px;
}

label {
  color: #55605a;
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cdd5d0;
  border-radius: 6px;
  background: #fff;
  color: #18231f;
}

input,
select {
  height: 42px;
  padding: 0 12px;
}

textarea {
  min-height: 92px;
  padding: 11px 12px;
  resize: vertical;
}

.primary-button {
  min-height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 6px;
  background: #c4472d;
  color: #fff;
  font-weight: 750;
}

.metric-band {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid #dce2dd;
  background: #fff;
}

.metric {
  display: flex;
  min-height: 120px;
  padding: 26px clamp(20px, 3vw, 38px);
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid #dce2dd;
}

.metric:last-child {
  border-right: 0;
}

.metric span {
  color: #68716c;
  font-size: 13px;
}

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

.metric-attention strong {
  color: #a86913;
}

.metric-active strong {
  color: #2b6b4f;
}

.workspace,
.audit-band {
  margin-top: 18px;
  background: #fff;
  border-top: 1px solid #dce2dd;
  border-bottom: 1px solid #dce2dd;
}

.workspace-head {
  display: flex;
  min-height: 92px;
  padding: 22px clamp(20px, 4vw, 48px);
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid #dce2dd;
}

.filters {
  display: inline-flex;
  padding: 4px;
  border: 1px solid #d7ddd9;
  border-radius: 6px;
  background: #f2f4f1;
}

.filter {
  min-height: 34px;
  padding: 0 15px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #68716c;
  font-size: 13px;
}

.filter.active {
  background: #21483b;
  color: #fff;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 16px 20px;
  border-bottom: 1px solid #e6eae7;
  text-align: left;
  vertical-align: middle;
}

th {
  color: #68716c;
  background: #fafbfa;
  font-size: 12px;
  font-weight: 700;
}

td {
  font-size: 14px;
}

.cell-main,
.cell-sub {
  display: block;
}

.cell-main {
  font-weight: 700;
}

.cell-sub {
  margin-top: 5px;
  color: #78817c;
  font-size: 12px;
}

.status-badge {
  display: inline-flex;
  min-height: 28px;
  padding: 0 9px;
  align-items: center;
  border-radius: 4px;
  background: #e7efe9;
  color: #2b6b4f;
  font-size: 12px;
  font-weight: 700;
}

.status-badge.pending {
  background: #fff1dc;
  color: #80500e;
}

.row-button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid #bac5bf;
  border-radius: 5px;
  background: #fff;
  color: #21483b;
  font-size: 12px;
  font-weight: 700;
}

.empty-state {
  padding: 64px 20px;
  color: #78817c;
  text-align: center;
}

.audit-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 28px;
  padding: 8px clamp(20px, 4vw, 48px) 28px;
}

.audit-item {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid #e6eae7;
  font-size: 13px;
}

.audit-time {
  color: #78817c;
  font-size: 12px;
}

.order-dialog {
  width: min(680px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(17, 28, 23, 0.28);
}

.order-dialog::backdrop {
  background: rgba(13, 24, 19, 0.55);
}

.dialog-head {
  display: flex;
  padding: 22px 26px;
  align-items: center;
  justify-content: space-between;
  background: #21483b;
  color: #fff;
}

.order-detail,
.status-form {
  padding: 24px 26px;
}

.detail-warning {
  margin-bottom: 18px;
  padding: 12px 14px;
  border-left: 4px solid #a86913;
  background: #fff4e4;
  color: #6c5539;
  font-size: 12px;
  line-height: 1.55;
}

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

.detail-field span,
.detail-field strong {
  display: block;
}

.detail-field span {
  color: #78817c;
  font-size: 12px;
}

.detail-field strong {
  margin-top: 5px;
  overflow-wrap: anywhere;
  font-size: 14px;
}

.status-form {
  border-top: 1px solid #dce2dd;
  background: #f7f8f6;
}

.toast {
  position: fixed;
  z-index: 50;
  right: 22px;
  bottom: 22px;
  max-width: 360px;
  padding: 12px 16px;
  border-radius: 6px;
  background: #18231f;
  color: #fff;
  font-size: 13px;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: 160ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 760px) {
  .auth-band {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .metric-band {
    grid-template-columns: repeat(2, 1fr);
  }

  .metric:nth-child(2) {
    border-right: 0;
  }

  .workspace-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .filters {
    width: 100%;
    overflow-x: auto;
  }

  .filter {
    flex: 1 0 auto;
  }

  .table-wrap {
    padding: 14px;
    overflow: visible;
  }

  table,
  tbody,
  tr,
  td {
    display: block;
    width: 100%;
  }

  thead {
    display: none;
  }

  tbody tr {
    margin-bottom: 14px;
    padding: 8px 16px 16px;
    border: 1px solid #dce2dd;
    border-radius: 7px;
  }

  tbody tr:last-child {
    margin-bottom: 0;
  }

  td {
    position: relative;
    min-height: 58px;
    padding: 26px 0 10px;
    border-bottom: 1px solid #e6eae7;
  }

  td::before {
    position: absolute;
    top: 8px;
    left: 0;
    content: attr(data-label);
    color: #78817c;
    font-size: 11px;
    font-weight: 700;
  }

  td:last-child {
    min-height: 48px;
    padding-top: 14px;
    border-bottom: 0;
  }

  .row-button {
    width: 100%;
  }

  .audit-list,
  .detail-grid {
    grid-template-columns: 1fr;
  }
}
