.payment-dialog {
  width: min(888px, 100%) !important;
  height: min(900px, calc(100vh - 24px)) !important;
  max-height: calc(100vh - 24px) !important;
  overflow: hidden !important;
}

.payment-body {
  padding: 16px 24px;
}

.payment-plan {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
  padding: 9px 12px;
  background: #071522;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

.payment-plan strong {
  color: var(--gold);
  font-size: 17px;
}

.payment-plan b {
  font-size: 20px;
}

.payment-qr-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px;
}

.payment-qr-item {
  text-align: center;
}

.payment-qr-frame {
  position: relative;
  display: grid;
  place-items: center;
  width: min(320px, 100%);
  aspect-ratio: 3 / 4;
  margin: 0 auto 7px;
  padding: 8px;
  overflow: hidden;
  background: #fff;
  border-radius: 8px;
}

.payment-qr-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.payment-qr-frame img.missing {
  display: none;
}

.payment-qr-fallback {
  display: none;
  color: #556273;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.6;
}

.payment-qr-frame img.missing + .payment-qr-fallback {
  display: block;
}

.payment-qr-mask {
  position: absolute;
  inset: 8px;
  display: grid;
  place-items: center;
  padding: 16px;
  text-align: center;
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.7;
  background: rgba(7, 18, 37, 0.88);
  border: 1px solid rgba(244, 199, 104, 0.52);
  border-radius: 5px;
  box-shadow: inset 0 0 28px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(12px);
  z-index: 1;
}

.payment-qr-mask strong {
  display: block;
  color: var(--gold);
  font-size: 17px;
}

.payment-qr-item b {
  display: block;
  font-size: 16px;
}

.payment-notice {
  margin: 10px 0;
  padding: 8px 12px;
  color: #eaf3ff;
  line-height: 1.75;
  background: rgba(244, 199, 104, 0.08);
  border: 1px solid rgba(244, 199, 104, 0.24);
  border-radius: 8px;
}

.payment-contact-notice {
  margin-top: 8px;
  color: #ffe08a;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.75;
  text-align: center;
}

.payment-note-label {
  display: block;
  color: #dcecff;
  font-size: 14px;
  font-weight: 800;
}

.payment-note-label .input {
  font-weight: 400;
}

.payment-error {
  min-height: 22px;
  margin: 8px 0 0;
  color: var(--red);
  font-size: 13px;
}

.subscription-contact-dialog {
  width: min(520px, calc(100% - 28px));
}

.subscription-contact-body {
  padding: 34px 28px 28px;
  text-align: center;
  color: #eaf3ff;
  line-height: 1.8;
}

.subscription-contact-body strong {
  display: block;
  margin-bottom: 18px;
  color: var(--gold);
  font-size: 20px;
}

.subscription-contact-body p {
  margin: 8px 0;
  font-size: 18px;
  font-weight: 800;
}

.payment-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 10px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
}

@media (max-width: 620px) {
  .subscription-contact-body {
    padding: 28px 18px 22px;
  }

  .subscription-contact-body strong {
    font-size: 18px;
  }
}

@media (max-width: 620px) {
  .payment-dialog {
    height: auto !important;
    max-height: calc(100dvh - 20px) !important;
    overflow: auto !important;
  }

  .payment-qr-grid {
    grid-template-columns: 1fr;
  }

  .payment-body,
  .payment-actions {
    padding: 14px;
  }

  .payment-qr-frame {
    width: min(220px, 100%);
  }
}

/* Mobile admin usability: keep navigation and customer actions inside the viewport. */
@media (max-width: 760px) {
  .admin-tabs { width: calc(100vw - 20px); max-width: 100%; flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; padding: 2px 2px 8px; margin-bottom: 10px; overscroll-behavior-x: contain; scrollbar-width: none; -webkit-overflow-scrolling: touch; touch-action: pan-x; }
  .admin-tabs::-webkit-scrollbar { display: none; }
  .admin-tabs .btn { flex: 0 0 auto; min-height: 44px; white-space: nowrap; }
  .admin-grid-polished > div { width: 100%; min-width: 0; }
  .admin-grid-polished { display: flex; flex-direction: column; gap: 12px; }
  .admin-grid-polished > div:first-child { order: 2; }
  .admin-grid-polished > div:last-child { order: 1; }
  .admin-user-form { display: grid; grid-template-columns: minmax(0, 1fr) !important; gap: 10px; }
  .admin-user-form .full { grid-column: auto !important; }
  .admin-panel, .admin-table-panel { width: 100%; min-width: 0; overflow: visible; }
  .admin-table-panel > .admin-actions[style*="nowrap"] { width: 100%; flex-wrap: wrap !important; align-items: stretch; gap: 8px; }
  .admin-table-panel > .admin-actions[style*="nowrap"] .input { flex: 1 1 100%; width: 100%; min-width: 0; margin: 0; }
  .admin-table-panel > .admin-actions[style*="nowrap"] .btn { flex: 1 1 auto; min-width: 0; margin: 0 !important; }
  .data-table-wrap { width: 100%; max-width: 100%; overflow-x: auto; overflow-y: visible; touch-action: pan-x; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
  .admin-table { min-width: 720px; }
  .admin-table .admin-actions { min-width: 210px; align-items: flex-start; }
  .admin-table .admin-actions .btn { flex: 0 0 auto; min-height: 44px; }
}
