/* Shared centered modal & native <dialog> centering for VuDuyen Tools */
dialog {
  box-sizing: border-box;
  margin: auto !important;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
}

dialog::backdrop {
  background: rgba(15, 23, 42, 0.56);
  backdrop-filter: blur(4px);
}

#accountCommissionDialog {
  color-scheme: light;
  width: min(500px, calc(100vw - 32px)) !important;
  max-height: calc(100dvh - 32px);
  margin: auto !important;
  padding: 24px !important;
  border: 1px solid #dbe3ef !important;
  border-radius: 20px !important;
  background: #ffffff !important;
  color: #172033 !important;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.30) !important;
  font: 14px/1.6 Inter, system-ui, -apple-system, sans-serif;
}

#accountCommissionDialog h3 {
  margin: 0 0 10px;
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
}

#accountCommissionDialog p {
  margin: 0 0 12px;
  color: #475569;
  font-size: 13.5px;
  line-height: 1.6;
}

#accountCommissionDialog #account-commission-current {
  padding: 10px 12px;
  border-radius: 10px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e3a8a;
  font-weight: 600;
}

#accountCommissionDialog label {
  display: block;
  margin: 12px 0 6px;
  color: #1e293b;
  font-weight: 600;
  font-size: 13.5px;
}

#accountCommissionDialog input[type="number"],
#accountCommissionDialog textarea {
  display: block;
  width: 100%;
  min-height: 44px;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #ffffff;
  color: #0f172a;
  font: inherit;
}

#accountCommissionDialog textarea {
  min-height: 84px;
  resize: vertical;
}

#accountCommissionDialog input[type="checkbox"] {
  width: 18px;
  height: 18px;
  vertical-align: middle;
  margin-right: 6px;
  accent-color: #2563eb;
}

#accountCommissionDialog #account-commission-error:empty {
  display: none;
}

#accountCommissionDialog button.btn {
  min-height: 42px;
  padding: 9px 18px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
  margin-right: 8px;
}

#accountCommissionDialog button.btn-primary {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
  font-weight: 700;
}

#accountCommissionDialog button.btn-primary:hover:not(:disabled) {
  background: #1d4ed8;
}

#recovery-dialog {
  color-scheme: light;
  margin: auto !important;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.30);
}

.vdt-modal-backdrop {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  border: 0;
  margin: 0 !important;
  overflow: auto;
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(5px);
  box-sizing: border-box;
  animation: vdtModalFadeIn 0.14s ease-out;
}

.vdt-modal-backdrop:not([open]) { display: none; }
.vdt-modal-backdrop::backdrop { background: transparent; backdrop-filter: none; }

@keyframes vdtModalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.vdt-modal-card {
  box-sizing: border-box;
  width: min(460px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  margin: 0;
  padding: 22px 24px 20px;
  background: #ffffff;
  color: #172033;
  border: 1px solid #dbe3ef;
  border-radius: 20px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.32);
  font: 14px/1.6 Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-align: left;
}

.vdt-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.vdt-modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.vdt-modal-badge {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 16px;
  font-weight: 800;
  background: #eff6ff;
  color: #2563eb;
}

.vdt-modal-badge.is-confirm {
  background: #eff6ff;
  color: #1d4ed8;
}

.vdt-modal-badge.is-prompt {
  background: #f0fdf4;
  color: #15803d;
}

.vdt-modal-title {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.35;
  color: #0f172a;
}

.vdt-modal-close {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #475569;
  font-size: 20px;
  line-height: 1;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
}

.vdt-modal-close:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.vdt-modal-message {
  margin: 12px 0 0;
  color: #334155;
  font-size: 14.5px;
  line-height: 1.65;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.vdt-modal-input {
  box-sizing: border-box;
  display: block;
  width: 100%;
  min-height: 44px;
  margin-top: 14px;
  padding: 10px 13px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #ffffff;
  color: #0f172a;
  font: inherit;
}

.vdt-modal-input:focus {
  outline: 2px solid #93c5fd;
  outline-offset: 1px;
  border-color: #2563eb;
}

.vdt-modal-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.vdt-modal-btn {
  min-height: 42px;
  padding: 9px 18px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.vdt-modal-btn:hover {
  background: #f1f5f9;
}

.vdt-modal-btn-primary {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
  font-weight: 700;
}

.vdt-modal-btn-primary:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
}

.vdt-modal-btn-danger {
  background: #dc2626;
  border-color: #dc2626;
  color: #ffffff;
  font-weight: 700;
}

.vdt-modal-btn-danger:hover {
  background: #b91c1c;
  border-color: #b91c1c;
}

.vdt-modal-card :focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

@media (max-width: 480px) {
  .vdt-modal-card {
    width: calc(100vw - 24px);
    padding: 18px;
    border-radius: 16px;
  }
  .vdt-modal-actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }
  .vdt-modal-btn {
    width: 100%;
    text-align: center;
  }
}
