.admin-body {
  min-height: 100vh;
}

.admin-header .brand-strip {
  min-height: 76px;
}

.admin-brand-title {
  color: var(--white);
  font-family: var(--title);
  font-size: 30px;
  line-height: 1;
}

.admin-shop-link {
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 6px;
  color: var(--white);
  font-weight: 800;
  padding: 12px 18px;
  text-decoration: none;
}

.back-orders-btn {
  align-items: center;
  background: var(--white);
  border: 1px solid #8fa4b6;
  border-radius: 6px;
  color: var(--navy);
  cursor: pointer;
  display: inline-flex;
  font-weight: 900;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  text-decoration: none;
}

.detail-back-row {
  align-items: center;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 0;
  padding: 12px 14px;
}

.admin-shell {
  margin: 0 auto;
  max-width: 1600px;
  padding: 26px 32px 54px;
}

.admin-login-card,
.orders-card,
.order-detail {
  background: var(--white);
  border: 1px solid #e0e3e8;
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(24, 35, 64, 0.06);
}

.admin-login-card {
  margin: 72px auto;
  max-width: 520px;
  padding: 34px 36px 36px;
}

.admin-eyebrow {
  color: #5b6470;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  margin: 0 0 10px;
  text-transform: uppercase;
}

.admin-login-card h1,
.admin-page-title h1 {
  font-family: var(--title);
  font-size: 44px;
  line-height: 1;
  margin: 0 0 24px;
}

.login-copy {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.5;
}

.admin-login-form {
  display: grid;
  gap: 16px;
}

.admin-login-form label,
.search-field span,
.bulk-select-field span,
.notes-field span {
  font-weight: 900;
}

.admin-login-form input,
.search-field input,
.bulk-select-field select,
.notes-field textarea {
  border: 1px solid #aeb5c0;
  border-radius: 6px;
  min-height: 48px;
  padding: 12px 14px;
  width: 100%;
}

.admin-primary-btn,
.admin-secondary-btn,
.admin-danger-btn,
.detail-outline-btn {
  align-items: center;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  font-weight: 900;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  white-space: nowrap;
}

.admin-primary-btn {
  background: var(--yellow);
  border: 1px solid var(--navy);
  color: var(--ink);
}

.admin-secondary-btn,
.detail-outline-btn {
  background: var(--white);
  border: 1px solid #8fa4b6;
  color: var(--navy);
}

.admin-danger-btn {
  background: #fff2f2;
  border: 1px solid #c94a4a;
  color: #9d1f1f;
}

.admin-page-title,
.admin-toolbar,
.bulk-actions,
.admin-title-actions,
.detail-actions {
  align-items: center;
  display: flex;
  gap: 14px;
}

.admin-page-title {
  align-items: flex-end;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  justify-content: space-between;
  margin-bottom: 24px;
}

.embedded-admin {
  max-width: none;
  padding: 0;
}

#liveCount {
  color: #516070;
  font-family: var(--body);
  font-size: 24px;
}

.admin-toolbar {
  align-items: end;
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(360px, 1fr) auto;
  justify-content: stretch;
  margin-bottom: 20px;
}

.search-field {
  display: grid;
  gap: 8px;
  max-width: 470px;
  width: 100%;
}

.bulk-actions {
  align-items: end;
  display: grid;
  gap: 14px;
  grid-template-columns: 280px 92px;
  justify-content: end;
}

.bulk-select-field {
  display: grid;
  gap: 8px;
  min-width: 0;
}

#applyBulkActionBtn {
  margin-bottom: 20px;
}

.orders-layout {
  display: grid;
  gap: 22px;
  grid-template-columns: minmax(720px, 1fr);
}

.orders-card {
  overflow: auto;
}

.orders-table,
.detail-table {
  border-collapse: collapse;
  width: 100%;
}

.orders-table th,
.orders-table td,
.detail-table th,
.detail-table td {
  border-bottom: 1px solid #e1e4e8;
  padding: 18px 20px;
  text-align: left;
  vertical-align: middle;
}

.orders-table th,
.detail-table th {
  color: #33475c;
  font-size: 14px;
  font-weight: 900;
}

.orders-table tbody tr {
  cursor: pointer;
}

.orders-table tbody tr:hover,
.orders-table tbody tr.selected {
  background: #f6f8fb;
}

.check-cell {
  width: 48px;
}

.status-check {
  align-items: center;
  display: inline-flex;
  gap: 8px;
  font-weight: 800;
  min-height: 32px;
}

.delete-row-btn {
  align-items: center;
  background: #fff2f2;
  border: 1px solid #d26363;
  border-radius: 6px;
  color: #8b1e1e;
  cursor: pointer;
  display: inline-flex;
  font-weight: 900;
  justify-content: center;
  min-height: 40px;
  padding: 0 12px;
}

.admin-empty,
.admin-message,
.admin-error {
  padding: 16px;
}

.admin-message {
  background: #eef7ef;
  border: 1px solid #b7dfbd;
  border-radius: 6px;
  color: #175c24;
  margin-bottom: 16px;
}

.admin-loading-overlay {
  align-items: center;
  background: rgba(24, 35, 64, 0.42);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 24px;
  position: fixed;
  z-index: 40;
}

.admin-loading-card {
  align-items: center;
  background: var(--white);
  border: 1px solid #d9dee7;
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(8, 12, 22, 0.22);
  color: var(--navy);
  display: grid;
  gap: 10px;
  justify-items: center;
  max-width: 360px;
  padding: 28px;
  text-align: center;
  width: 100%;
}

.admin-loading-card strong {
  font-family: var(--title);
  font-size: 30px;
  line-height: 1;
}

.admin-loading-card span:last-child {
  color: var(--muted);
  line-height: 1.45;
}

.admin-loading-spinner {
  animation: admin-spin 0.85s linear infinite;
  border: 5px solid #e5e8ef;
  border-radius: 999px;
  border-top-color: var(--yellow);
  display: block;
  height: 52px;
  width: 52px;
}

@keyframes admin-spin {
  to {
    transform: rotate(360deg);
  }
}

.admin-modal-backdrop {
  align-items: center;
  background: rgba(24, 35, 64, 0.52);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 24px;
  position: fixed;
  z-index: 45;
}

.admin-confirm-modal {
  background: var(--white);
  border: 1px solid #d9dee7;
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(8, 12, 22, 0.25);
  color: var(--navy);
  max-width: 480px;
  padding: 30px;
  width: 100%;
}

.admin-confirm-modal h2 {
  font-family: var(--title);
  font-size: 38px;
  line-height: 1;
  margin: 0 0 12px;
}

.admin-confirm-modal p {
  color: var(--muted);
  line-height: 1.45;
  margin: 0;
}

.admin-confirm-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
}

.admin-error {
  color: #9d1f1f;
}

.order-detail {
  overflow: hidden;
}

.detail-hero {
  align-items: flex-start;
  background: var(--navy);
  color: var(--white);
  display: flex;
  gap: 24px;
  justify-content: space-between;
  padding: 28px;
}

.detail-hero .admin-eyebrow,
.detail-hero p {
  color: rgba(255, 255, 255, 0.82);
}

.detail-hero h2 {
  font-family: var(--title);
  font-size: 38px;
  line-height: 1;
  margin: 0 0 12px;
}

.detail-actions {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px;
}

.detail-check {
  align-items: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 6px;
  display: inline-flex;
  gap: 8px;
  font-weight: 900;
  height: 48px;
  margin: 0;
  padding: 0 14px;
}

.detail-check input {
  accent-color: var(--yellow);
}

.detail-check span {
  color: var(--white);
}

.detail-outline-btn {
  background: var(--yellow);
  border-color: var(--yellow);
  color: var(--navy);
  height: 48px;
  min-height: 48px;
}

.detail-tabs {
  background: #d8dde2;
  display: flex;
  gap: 0;
}

.detail-tab {
  background: transparent;
  border: 0;
  border-bottom: 3px solid transparent;
  color: #33475c;
  cursor: pointer;
  font-weight: 900;
  letter-spacing: 0.08em;
  min-height: 58px;
  padding: 0 28px;
  text-transform: uppercase;
}

.detail-tab.active {
  background: var(--white);
  border-bottom-color: var(--navy);
}

.detail-panel {
  display: none;
  padding: 28px;
}

.detail-panel.active {
  display: block;
}

.panel-heading {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 16px;
}

.panel-heading h3 {
  font-size: 22px;
  margin: 0;
}

.detail-list {
  display: grid;
  gap: 12px;
  grid-template-columns: 190px minmax(0, 1fr);
  max-width: 760px;
}

.detail-list dt {
  font-weight: 900;
}

.detail-list dd {
  margin: 0;
}

.notes-field {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.notes-field textarea {
  min-height: 120px;
  resize: vertical;
}

@media (max-width: 1100px) {
  .detail-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-toolbar {
    grid-template-columns: 1fr;
  }

  .admin-title-actions,
  .detail-actions {
    justify-content: flex-start;
  }

  .bulk-actions {
    grid-template-columns: minmax(220px, 1fr) 92px;
    justify-content: stretch;
  }
}

@media (max-width: 720px) {
  .admin-shell {
    padding: 18px 14px 40px;
  }

  .orders-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .orders-card,
  .order-detail {
    max-width: 100%;
  }

  .admin-brand-title {
    display: none;
  }

  .admin-page-title {
    align-items: flex-start;
    grid-template-columns: 1fr;
  }

  .admin-title-actions,
  .bulk-actions {
    align-items: stretch;
    width: 100%;
  }

  .bulk-actions {
    grid-template-columns: 1fr;
  }

  #applyBulkActionBtn {
    margin-bottom: 0;
  }

  .admin-title-actions > *,
  .bulk-actions > *,
  .bulk-select-field {
    width: 100%;
  }

  .detail-tabs {
    overflow-x: auto;
  }

  .detail-tab {
    white-space: nowrap;
  }
}
