.admin-page {
  width: min(1540px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.admin-header,
.admin-stats {
  display: flex;
}

.admin-header {
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.table-filter {
  display: grid;
  gap: 6px;
  min-width: 220px;
}

.table-filter span {
  color: #91a0bd;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.table-filter select {
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid rgba(141, 85, 27, 0.15);
  border-radius: 14px;
  background: #fff;
  color: #20324d;
  font: inherit;
}

.table-toolbar {
  display: flex;
  justify-content: flex-start;
  margin: 24px 0 14px;
}

.table-toolbar .table-filter {
  min-width: min(360px, 100%);
}

.admin-kicker {
  display: inline-block;
  color: #9aabc7;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.admin-header h1 {
  margin: 8px 0 0;
  font-size: clamp(2rem, 4vw, 3rem);
}

.back-link {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 14px;
  background: #fff;
  color: #8d551b;
  text-decoration: none;
  font-weight: 800;
  border: 1px solid rgba(141, 85, 27, 0.15);
}

.admin-stats {
  gap: 16px;
  margin-bottom: 26px;
}

.admin-stats article {
  flex: 1;
  padding: 18px;
  border-radius: 24px;
  background: #f7f9fd;
  box-shadow: var(--shadow);
}

.admin-stats strong {
  display: block;
  font-size: 2rem;
}

.admin-stats span {
  color: var(--muted);
}

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

.order-card {
  padding: 20px;
  border-radius: 24px;
  background: #f9fbff;
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow);
}

.order-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  font-weight: 800;
}

.order-content {
  display: grid;
  gap: 10px;
}

.order-items {
  display: grid;
  gap: 10px;
}

.order-item-line {
  display: flex;
  gap: 10px;
}

.qty-badge {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  background: #e9eef7;
  font-size: 0.84rem;
  font-weight: 800;
}

.tag,
.note-box,
.payment-tag {
  padding: 10px 12px;
  border-radius: 14px;
}

.tag {
  background: #eef3fb;
  color: #677895;
}

.payment-tag {
  background: #fff3d6;
  color: #8d551b;
}

.note-box {
  background: #fff5de;
  color: #9b6929;
}

.order-footer {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

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

.status-btn {
  min-height: 44px;
  border: 0;
  border-radius: 14px;
  font-weight: 800;
  cursor: pointer;
}

.status-btn.primary {
  background: #fff0ca;
  color: #9b640f;
}

.status-btn.success {
  background: #dff7ea;
  color: #24754f;
}

.status-btn.muted {
  background: #eef3fb;
  color: #7d8fae;
}

.completed-wrap {
  margin-top: 24px;
  overflow: auto;
  border-radius: 24px;
  border: 1px solid var(--line-soft);
  background: #fff;
  box-shadow: var(--shadow);
}

.orders-table-block + .orders-table-block {
  margin-top: 28px;
}

.orders-table-head h2 {
  margin: 0 0 12px;
  font-size: clamp(1.2rem, 2vw, 1.6rem);
}

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

th,
td {
  padding: 16px 18px;
  text-align: left;
  border-bottom: 1px solid var(--line-soft);
}

tfoot td {
  border-bottom: 0;
}

.orders-total-row {
  background: #f8fbff;
}

.orders-total-label,
.orders-total-value {
  font-weight: 800;
  color: #20324d;
}

th {
  color: #91a0bd;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

@media (max-width: 900px) {
  .admin-header,
  .admin-stats,
  .orders-grid,
  .status-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .back-link {
    width: 100%;
    justify-content: center;
  }

  .table-toolbar,
  .table-filter {
    width: 100%;
  }
}
