.admin-body {
  background: #f3f7f4;
}
.admin-shell {
  width: min(1180px, calc(100% - 40px));
  margin: auto;
  padding: 24px 0 70px;
}
.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}
.admin-topbar .brand small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  margin-top: 2px;
}
.btn.ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}
.icon-btn {
  display: flex;
  gap: 7px;
  align-items: center;
}
.admin-intro {
  padding: 38px 0 24px;
}
.admin-intro h1 {
  font-size: clamp(38px, 5vw, 58px);
  margin: 7px 0 8px;
}
.admin-intro p {
  margin: 0;
  color: var(--muted);
}
.login-card {
  width: min(470px, 100%);
  margin: 18px auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 30px;
}
.login-card h2 {
  font-family: Georgia, serif;
  font-size: 28px;
  margin: 6px 0;
}
.login-icon {
  width: 48px;
  height: 48px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  background: var(--mint2);
  font-size: 21px;
  margin-bottom: 18px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}
.stats article {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.stats strong {
  font-size: 26px;
  display: block;
  line-height: 1;
}
.stats article div span {
  font-size: 12px;
  color: var(--muted);
  font-weight: 650;
}
.stat-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 900;
}
.pending-dot {
  background: #fff4d6;
  color: #956900;
}
.approved-dot {
  background: var(--mint2);
  color: var(--good);
}
.inactive-dot {
  background: #fbeaea;
  color: var(--bad);
}
.total-dot {
  background: #eef0f7;
  color: #40507d;
}
.connection-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  background: var(--navy);
  color: #fff;
  border-radius: 20px;
  padding: 18px 20px;
  margin-bottom: 16px;
}
.connection-main {
  display: flex;
  align-items: center;
  gap: 14px;
}
.connection-icon {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: var(--mint);
  color: var(--navy);
  display: grid;
  place-items: center;
  font-family: Georgia, serif;
  font-size: 22px;
  font-weight: 800;
}
.connection-title {
  display: flex;
  align-items: center;
  gap: 10px;
}
.connection-title h2 {
  font-size: 16px;
  margin: 0;
}
.connection-card p {
  color: #cfe0d9;
  font-size: 12px;
  margin: 4px 0 0;
}
.connection-badge {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}
.connection-badge.connected {
  background: rgba(186, 244, 215, 0.16);
  color: var(--mint);
}
.connection-badge.disconnected {
  background: rgba(255, 210, 210, 0.15);
  color: #ffd2d2;
}
.licence-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
  overflow: hidden;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 22px;
  align-items: center;
  padding: 22px;
  border-bottom: 1px solid var(--line);
}
.panel-head h2 {
  font-family: Georgia, serif;
  font-size: 25px;
  margin: 0;
}
.panel-head p {
  font-size: 12px;
  color: var(--muted);
  margin: 5px 0 0;
}
.request-tools {
  display: flex;
  gap: 9px;
}
.search-box {
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid #cbd8d0;
  border-radius: 11px;
  padding: 0 11px;
  color: var(--muted);
}
.search-box input {
  border: 0;
  outline: 0;
  padding: 10px 0;
  font: inherit;
  width: 185px;
}
.request-tools select {
  border: 1px solid #cbd8d0;
  border-radius: 11px;
  padding: 10px 34px 10px 11px;
  background: #fff;
  font: inherit;
  color: var(--ink);
}
.licence-panel .list {
  gap: 0;
  max-height: 680px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.licence-panel .request {
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 20px 22px;
  align-items: center;
}
.licence-panel .request:last-child {
  border-bottom: 0;
}
.licence-panel.compact .request {
  padding: 0;
}
.compact-request {
  display: block !important;
}
.compact-summary {
  min-height: 42px;
  padding: 8px 14px;
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(105px, auto) auto 18px;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  list-style: none;
}
.compact-summary::-webkit-details-marker { display: none; }
.compact-email {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 750;
}
.compact-receipt {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.compact-arrow {
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  transition: transform .16s ease;
}
.compact-request[open] .compact-arrow { transform: rotate(90deg); }
.compact-expanded {
  padding: 4px 14px 14px;
  border-top: 1px dashed var(--line);
}
.compact-expanded .request-facts { margin: 10px 0; }
.compact-expanded .actions { justify-content: flex-end; }
@media (max-width: 560px) {
  .compact-summary { grid-template-columns: minmax(0, 1fr) 92px auto 14px; gap: 7px; padding-inline: 10px; }
  .compact-email { font-size: 12px; }
  .compact-receipt { font-size: 11px; }
  .compact-summary .pill { padding: 3px 6px; font-size: 9px; }
}
.compact-toggle.active {
  background: var(--navy);
  color: #fff;
}
.request-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  padding: 13px 18px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}
.request-pagination button:disabled {
  opacity: .45;
}
.request-primary {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 13px;
  min-width: 0;
}
.request-avatar {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: var(--mint2);
  color: var(--good);
  display: grid;
  place-items: center;
  font-weight: 900;
}
.request-title {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}
.request-title h3 {
  font-size: 15px;
  margin: 0;
  overflow-wrap: anywhere;
}
.request-facts {
  display: flex;
  gap: 8px 18px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
  margin-top: 6px;
}
.request-facts b {
  color: var(--ink);
}
.request-facts .verified {
  color: var(--good);
}
.pill.pending {
  background: #fff4d6;
  color: #856000;
}
.pill.deactivated {
  background: #f0f1f0;
  color: #5b625e;
}
.pill.completed {
  background: #eef0f7;
  color: #40507d;
}
.licence-key {
  font-size: 11px;
  color: var(--muted);
  margin-top: 8px;
}
.licence-key summary {
  cursor: pointer;
}
.licence-key code {
  display: inline-block;
  margin-top: 5px;
  padding: 6px 8px;
  background: #f4f6f4;
  border-radius: 7px;
  color: var(--ink);
  word-break: break-all;
}
.btn.danger.outline {
  background: #fff;
  color: var(--bad);
  border: 1px solid #efc8c8;
}
.btn.danger.solid {
  background: var(--bad);
  color: #fff;
}
.empty-state {
  text-align: center;
  padding: 54px 20px;
  color: var(--muted);
}
.empty-state > span {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: auto;
  background: #f2f5f3;
  border-radius: 14px;
  font-size: 22px;
}
.empty-state h3 {
  color: var(--ink);
  margin: 13px 0 4px;
}
.empty-state p {
  margin: 0;
  font-size: 13px;
}
.confirm-dialog {
  border: 0;
  border-radius: 22px;
  padding: 0;
  box-shadow: 0 28px 90px rgba(12, 30, 24, 0.3);
  width: min(440px, calc(100% - 28px));
}
.confirm-dialog::backdrop {
  background: rgba(9, 25, 19, 0.55);
  backdrop-filter: blur(3px);
}
.confirm-dialog form {
  padding: 28px;
  text-align: center;
}
.warning-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 15px;
  margin: 0 auto 14px;
  background: #fbeaea;
  color: var(--bad);
  font-size: 25px;
  font-weight: 900;
}
.confirm-dialog h2 {
  font-family: Georgia, serif;
  font-size: 27px;
  margin: 0 0 9px;
}
.confirm-dialog p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}
.dialog-detail {
  background: #f5f7f5;
  padding: 11px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  margin: 18px 0;
}
.dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}
.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  background: var(--navy);
  color: #fff;
  border-radius: 12px;
  padding: 13px 17px;
  box-shadow: var(--shadow);
  font-size: 13px;
  font-weight: 700;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: 0.2s;
}
.toast.show {
  opacity: 1;
  transform: none;
}
.toast.bad {
  background: var(--bad);
}
@media (max-width: 760px) {
  .admin-shell {
    width: min(100% - 22px, 1180px);
    padding-top: 14px;
  }
  .admin-intro {
    padding: 28px 2px 18px;
  }
  .stats {
    grid-template-columns: 1fr 1fr;
  }
  .stats article {
    padding: 14px;
  }
  .connection-card,
  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .connection-card .btn {
    width: 100%;
  }
  .request-tools {
    width: 100%;
    flex-direction: column;
  }
  .search-box input {
    width: 100%;
  }
  .request-tools select {
    width: 100%;
  }
  .licence-panel .request {
    padding: 17px;
  }
  .request-primary {
    grid-template-columns: 36px 1fr;
  }
  .request-avatar {
    width: 36px;
    height: 36px;
  }
  .actions {
    padding-left: 49px;
  }
  .dialog-actions {
    grid-template-columns: 1fr;
  }
  .toolbar .icon-btn span {
    display: none;
  }
}

/* Buyer recovery changes: single-column form at every viewport. */
.product-dialog.recovery-email-dialog { width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); overflow-y: auto; }
.recovery-email-dialog .field { margin-top: 16px; min-width: 0; }
.recovery-email-dialog input:not([type="checkbox"]) { width: 100%; min-width: 0; box-sizing: border-box; }
.recovery-help { font-size: 13px; line-height: 1.55; color: var(--muted, #5d6f67); }
.recovery-email-dialog .dialog-detail { overflow-wrap: anywhere; }
.recovery-confirm { display: flex; align-items: flex-start; gap: 10px; margin: 20px 0; font-size: 13px; line-height: 1.5; }
.recovery-confirm input { flex: 0 0 auto; margin-top: 3px; }
.recovery-error { color: #a12a24; font-size: 13px; }
.recovery-history { flex-basis: 100%; font-size: 12px; overflow-wrap: anywhere; }
.recovery-history summary { cursor: pointer; }
.recovery-history ol { padding-left: 20px; }
.recovery-history li { margin: 10px 0; }
.recovery-history li small, .recovery-history li span { display: block; }
