/* ── PAYOUT QR ── */
.payout-section {
  padding: 5rem 5%;
  max-width: 1080px;
  margin: 0 auto;
}

.payout-header {
  margin-bottom: 2rem;
}

.payout-panel {
  background: #fff;
  border: var(--border-thick);
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius);
  padding: 1.6rem;
}

.payout-locked {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.payout-lock-title {
  color: #000;
  font-size: 1.1rem;
  font-weight: 900;
  margin-bottom: 0.35rem;
}

.payout-locked p,
.payout-help,
.payout-file-name,
.payout-uploaded-at {
  color: #444;
  font-size: 0.82rem;
  line-height: 1.5;
  font-weight: 600;
}

.payout-form {
  display: none;
}

.payout-form.show {
  display: block;
}

.payout-locked.hide {
  display: none;
}

.payout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 1.4rem;
  align-items: start;
}

.payout-fields {
  display: grid;
  gap: 0.65rem;
}

.payout-fields label {
  color: #000;
  font-size: 0.88rem;
  font-weight: 800;
}

.payout-input,
.payout-file {
  width: 100%;
  border: var(--border-thin);
  background: #fff;
  color: #000;
  border-radius: var(--radius-sm);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 0.92rem;
  font-weight: 600;
  outline: none;
  transition: all 0.15s;
}

.payout-input {
  padding: 0.8rem 0.9rem;
}

.payout-file {
  padding: 0.7rem;
}

.payout-input:focus,
.payout-file:focus {
  box-shadow: var(--shadow-sm);
  transform: translate(-2px, -2px);
}

.payout-preview {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 1;
  background: #fff;
  border: var(--border-thick);
  border-radius: var(--radius);
  overflow: hidden;
}

.payout-preview img {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 0.7rem;
}

.payout-preview.has-image img {
  display: block;
}

.payout-preview.has-image .payout-preview-empty {
  display: none;
}

.payout-preview-empty {
  color: #777;
  font-size: 0.84rem;
  font-weight: 600;
  text-align: center;
  padding: 1rem;
}

.payout-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  margin-top: 1.5rem;
  text-align: center;
}

.payout-status {
  display: none;
  margin-top: 0.85rem;
  border-radius: 9px;
  font-size: 0.84rem;
  line-height: 1.5;
  padding: 0.65rem 0.8rem;
}

.payout-status.show {
  display: block;
}

.payout-status.success {
  background: rgba(22, 163, 74, 0.12);
  border: 1px solid rgba(74, 222, 128, 0.35);
  color: #15803d;
}

.payout-status.error {
  background: rgba(220, 38, 38, 0.1);
  border: 1px solid rgba(255, 100, 100, 0.3);
  color: #dc2626;
}

/* ── CONVERTER OVERRIDES FOR PAYOUT TAB ── */
.converter-box .payout-panel {
  background: transparent;
  border: none;
  padding: 0;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* Modal styling */
/* Dialog & Modal styling */
.payout-dialog {
  display: none;
  border: var(--border-thick);
  border-radius: var(--radius);
  padding: 0;
  background: #fff;
  max-width: 520px;
  width: 90%;
  box-shadow: var(--shadow-lg);

  /* Centering positioning */
  margin: auto !important;
  position: fixed;
  inset: 0;
  
  max-height: 85vh;
  max-height: 85dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.payout-dialog[open] {
  display: block;
  animation: fadeIn 0.3s ease both;
}

.payout-dialog::backdrop {
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
}

.modal-content {
  padding: 1.5rem;
  color: #1A0A05;
  text-align: left;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #eee;
  padding-bottom: 0.8rem;
  margin-bottom: 1.2rem;
}

.modal-header h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: #1A0A05;
  margin: 0;
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 1.8rem;
  font-weight: bold;
  color: #aaa;
  cursor: pointer;
  line-height: 1;
}

.modal-close:hover {
  color: #000;
}

/* Override labels inside modal to be dark readable color */
.modal-content label {
  color: #1A0A05;
  display: block;
  margin-top: 1rem;
  font-weight: 600;
  font-size: 0.9rem;
}

.modal-content .payout-help,
.modal-content .payout-file-name,
.modal-content .payout-uploaded-at {
  color: #555;
  font-size: 0.8rem;
  margin-top: 0.25rem;
}

.modal-content .payout-input,
.modal-content .payout-file {
  border: var(--border-thin);
  background: #fff;
  color: #000;
  width: 100%;
  padding: 0.6rem;
  margin-top: 0.4rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  box-shadow: 2px 2px 0 #000;
}

.modal-content .payout-preview {
  border: 1px solid #ddd;
  margin-top: 1rem;
  max-width: 100%;
  border-radius: 8px;
  overflow: hidden;
}

/* Setup prompt */
.payout-setup-prompt {
  display: flex;
  justify-content: center;
  width: 100%;
}

.setup-prompt-box {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  background: #fff;
  border: var(--border-thick);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.15s ease;
  width: 100%;
}

.setup-prompt-box:hover {
  background: var(--yellow);
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-md);
}

.setup-prompt-icon {
  font-size: 2.2rem;
}

.setup-prompt-text {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.setup-prompt-text strong {
  color: #fff;
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.setup-prompt-text span {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
}

/* Dashboard styles */
.payout-dashboard-layout {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.payout-summary-card {
  background: #fff;
  border: var(--border-thick);
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius);
  padding: 1.2rem 1.6rem;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
}

.summary-label {
  color: #000;
  font-size: 0.85rem;
  font-weight: 800;
  margin-bottom: 0.4rem;
}

.summary-amount {
  color: var(--orange);
  font-size: 2rem;
  font-weight: 900;
  text-shadow: 2px 2px 0 #000;
}

.payout-orders-section {
  text-align: left;
}

.orders-header {
  color: #000;
  font-size: 0.95rem;
  font-weight: 900;
  margin-bottom: 0.75rem;
}

.payout-orders-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 4px;
}

.payout-orders-list::-webkit-scrollbar {
  width: 5px;
}

.payout-orders-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
}

.payout-orders-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

.payout-order-row {
  background: #fff;
  border: var(--border-thin);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.9rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
}

.payout-order-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.payout-order-name {
  color: #000;
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.payout-order-meta {
  color: #444;
  font-size: 0.72rem;
  font-weight: 600;
}

.payout-order-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
  flex-shrink: 0;
}

.payout-order-amount {
  color: var(--orange);
  font-size: 0.86rem;
  font-weight: 900;
}

.payout-order-status {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}

/* Right layout - QR */
.payout-right {
  display: flex;
  flex-direction: column;
}

.payout-qr-card {
  background: #fff;
  border: var(--border-thick);
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
}

.payout-qr-title {
  color: #000;
  font-size: 0.82rem;
  font-weight: 800;
}

.payout-qr-image-container {
  width: 100px;
  height: 100px;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  padding: 0.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.payout-qr-image-container img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.btn-update-qr {
  background: #fff;
  border: var(--border-thin);
  box-shadow: 2px 2px 0 #000;
  color: #000;
  border-radius: var(--radius-sm);
  padding: 0.65rem 1.3rem;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.1s;
  flex-shrink: 0;
  white-space: nowrap;
}

.btn-update-qr:hover {
  background: var(--yellow);
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 #000;
}
.btn-update-qr:active {
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 #000;
}

/* ── PAYOUT SUMMARY ACTIONS ── */
.payout-summary-actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex-shrink: 0;
}

/* ── WITHDRAW MODAL ── */
.withdraw-dialog {
  max-width: 580px;
}

.withdraw-summary {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 1rem 1.2rem;
  margin-bottom: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.withdraw-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0;
}

.withdraw-summary-row.highlight {
  background: rgba(245, 166, 35, 0.12);
  border-radius: 8px;
  padding: 0.4rem 0.6rem;
  margin: 0 -0.4rem;
}

.withdraw-summary-row.highlight-green {
  background: rgba(34, 197, 94, 0.12);
  border-radius: 8px;
  padding: 0.4rem 0.6rem;
  margin: 0 -0.4rem;
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.withdraw-summary-label {
  color: #555;
  font-size: 0.85rem;
  font-weight: 500;
}

.withdraw-already-label {
  color: #888;
  font-size: 0.8rem;
}

.withdraw-summary-value {
  color: #1A0A05;
  font-size: 0.88rem;
  font-weight: 700;
  white-space: nowrap;
}

.withdraw-already-value {
  color: #888;
  font-weight: 600;
}

.withdraw-amount {
  color: #d97706;
  font-size: 1rem;
}

.withdraw-available {
  color: #15803d;
  font-size: 1.05rem;
}

/* ── Withdraw action area ── */
.withdraw-action {
  margin-bottom: 1.5rem;
}

.withdraw-note {
  color: #666;
  font-size: 0.78rem;
  line-height: 1.5;
  margin-bottom: 1.5rem;
  background: #fff8e1;
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
  border-left: 3px solid #f5a623;
}

.btn-do-withdraw {
  width: 100%;
  position: relative;
  justify-content: center;
}

.withdraw-status {
  display: none;
  margin-top: 0.7rem;
  border-radius: 9px;
  font-size: 0.84rem;
  line-height: 1.5;
  padding: 0.65rem 0.8rem;
}

.withdraw-status.show {
  display: block;
}

.withdraw-status.success {
  background: rgba(22, 163, 74, 0.12);
  border: 1px solid rgba(74, 222, 128, 0.35);
  color: #15803d;
}

.withdraw-status.error {
  background: rgba(220, 38, 38, 0.1);
  border: 1px solid rgba(255, 100, 100, 0.3);
  color: #dc2626;
}

/* ── Lịch sử rút tiền ── */
.withdraw-history-section {
  border-top: 1px solid #eee;
  padding-top: 1.5rem;
  margin-top: 2rem;
}

.withdraw-history-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #1A0A05;
  margin-bottom: 0.5rem;
}

.withdraw-history-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 200px;
  overflow-y: auto;
}

.withdraw-history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 0.55rem 0.8rem;
  gap: 0.5rem;
}

.wh-left {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.wh-date {
  color: #555;
  font-size: 0.78rem;
  font-weight: 500;
}

.wh-orders {
  color: #888;
  font-size: 0.7rem;
}

.wh-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15rem;
  flex-shrink: 0;
}

.wh-amount {
  color: #1A0A05;
  font-size: 0.88rem;
  font-weight: 700;
}

.wh-status {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
}

.wr-pending {
  background: rgba(245, 166, 35, 0.15);
  color: #b45309;
}

.wr-processing {
  background: rgba(59, 130, 246, 0.15);
  color: #1d4ed8;
}

.wr-completed {
  background: rgba(34, 197, 94, 0.15);
  color: #15803d;
}

.wr-rejected {
  background: rgba(220, 38, 38, 0.12);
  color: #dc2626;
}

/* ── Bonus row trong withdraw summary ── */
.withdraw-summary-row.withdraw-bonus-row {
  background: rgba(245, 166, 35, 0.10);
  border-radius: 8px;
  padding: 0.4rem 0.6rem;
  margin: 0 -0.4rem;
  border: 1px solid rgba(245, 166, 35, 0.28);
}

.withdraw-bonus {
  color: #b45309;
  font-size: 0.95rem;
  font-weight: 700;
}

/* ── Cảnh báo chưa đạt ngưỡng tối thiểu ── */
.withdraw-min-warning {
  background: rgba(234, 88, 12, 0.10);
  border: 1px solid rgba(234, 88, 12, 0.28);
  border-radius: 8px;
  color: #c2410c;
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.5;
  padding: 0.55rem 0.75rem;
  margin-top: 0.3rem;
}