.nvmr-wrapper * {
    box-sizing: border-box;
}

.nvmr-wrapper {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    color: #334155;
    background: #f8fafc;
    min-height: 100vh;
    padding: 20px;
}

/* Dashboard Header */
.nvmr-dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 0 20px;
}

.nvmr-dashboard-header h2 {
    color: #1e293b;
    font-size: 28px;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.nvmr-dashboard-header h2 i {
    color: #667eea;
}

.nvmr-user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.nvmr-welcome {
    color: #64748b;
    font-size: 14px;
}

.nvmr-balance {
    color: #059669;
    font-size: 16px;
    font-weight: 600;
}

/* Enhanced KPI Grid */
/* === KPI grid: 4 cột desktop -> 2 cột mobile === */
.nvmr-kpi-grid{
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}
@media (max-width: 1024px){
  /* tablet & phone: 2 cột */
  .nvmr-kpi-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* nếu máy rất nhỏ vẫn giữ 2 cột */
@media (max-width: 390px){
  .nvmr-kpi-grid{ grid-template-columns: 1fr 1fr; }
}

/* chắc chắn card co giãn tốt trong grid */
.nvmr-kpi-card{ min-width: 0; }


.nvmr-kpi-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(226, 232, 240, 0.8);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 16px;
}

.nvmr-kpi-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
}

.nvmr-kpi-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

.nvmr-kpi-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    flex-shrink: 0;
}

.nvmr-kpi-icon.orders {
    background: linear-gradient(135deg, #3b82f6, #1e40af);
}

.nvmr-kpi-icon.revenue {
    background: linear-gradient(135deg, #10b981, #059669);
}

.nvmr-kpi-icon.commission {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.nvmr-kpi-icon.payout {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.nvmr-kpi-content {
    flex: 1;
}

.nvmr-kpi-label {
    display: block;
    color: #64748b;
    font-size: 13px;
    margin-bottom: 6px;
    font-weight: 500;
    line-height: 1.3;
}

.nvmr-kpi-value {
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
    display: block;
    line-height: 1.2;
}

.nvmr-kpi-pending {
    display: block;
    color: #f59e0b;
    font-size: 12px;
    margin-top: 4px;
    font-weight: 500;
}

/* Cards */
.nvmr-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 32px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    margin: 20px 0;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.nvmr-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
}

.nvmr-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.15);
}

/* Action Section */
.nvmr-action-section {
    background: white;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(226, 232, 240, 0.8);
}

.nvmr-payout-btn {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    color: white !important;
    border: none !important;
    padding: 11px 32px !important;
    border-radius: 12px !important;
    font-weight: 600 !important;
    font-size: 16px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.3) !important;
    margin-bottom: 20px;
}

.nvmr-payout-btn:hover:not(:disabled) {
    transform: translateY(-2px) !important;
    box-shadow: 0 15px 40px rgba(16, 185, 129, 0.4) !important;
}

.nvmr-payout-btn:disabled {
    background: #94a3b8 !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
}

.nvmr-tips {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border-left: 4px solid #3b82f6;
    padding: 16px;
    border-radius: 8px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 14px;
    line-height: 1.5;
}

.nvmr-tips i {
    color: #3b82f6;
    font-size: 16px;
    margin-top: 2px;
}

/* Section Styling */
.nvmr-section {
    background: white;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(226, 232, 240, 0.8);
}

.nvmr-section h3 {
    color: #1e293b;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f1f5f9;
}

/* Enhanced Table */
.nvmr-table-responsive {
    overflow-x: auto;
    margin: 0 -24px;
    padding: 0 24px;
}

.nvmr-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.nvmr-table thead {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.nvmr-table th {
    color: white;
    padding: 16px 20px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
}

.nvmr-table td {
    padding: 16px 20px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
    font-size: 14px;
}

.nvmr-table tbody tr:hover {
    background-color: #f8fafc;
}

.nvmr-table tbody tr:last-child td {
    border-bottom: none;
}

/* Enhanced Badges */
.nvmr-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f1f5f9;
    border-radius: 20px;
    padding: 6px 12px;
    font-weight: 500;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nvmr-badge.active {
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    color: #166534;
}

.nvmr-badge.success {
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    color: #166534;
}

.nvmr-badge.pending {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #92400e;
}

.nvmr-badge.secondary {
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    color: #475569;
}

.nvmr-badge.suspended {
    background: linear-gradient(135deg, #fecaca, #fca5a5);
    color: #991b1b;
}

.nvmr-badge.expired {
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    color: #64748b;
}

/* Enhanced Modals — FIXED */
.nvmr-modal {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  z-index: 999999;
  padding: 0;
  margin: 0;
  overflow-y: auto;
}
.nvmr-modal.nvmr-hidden { display: none !important; }

/* Lock body scroll when modal open */
body.nvmr-modal-open {
  overflow: hidden !important;
  position: fixed !important;
  width: 100% !important;
  height: 100vh !important;
}

.nvmr-modal-content {
  position: relative;
  background: #fff;
  border-radius: 20px;
  width: 100%;
  max-width: 600px;
  margin: 20px;                     /* khoảng cách an toàn xung quanh hộp */
  max-height: calc(100vh - 40px);   /* tránh tràn khi màn hình thấp */
  overflow: auto;                   /* cuộn trong khung nếu dài */
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.3);
  transform: scale(0.9);
  animation: nvmrModalSlideIn 0.3s ease forwards;
  padding: 15px;
  text-align: center;
  z-index: 1000000;
}

@keyframes nvmrModalSlideIn { to { transform: scale(1); } }

.nvmr-modal-header {
  padding: 24px 24px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #f1f5f9;
  margin-bottom: 24px;
}

.nvmr-modal-header h3 {
  color: #1e293b;
  font-size: 20px;
  font-weight: 600;
  margin: 0;
}

.nvmr-modal-close {
  background: none;
  border: none;
  font-size: 20px;
  color: #64748b;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: all 0.2s ease;
}
.nvmr-modal-close:hover { background: #f1f5f9; color: #1e293b; }
.nvmr-modal-body { padding: 0 24px 24px; }

/* Amount Input */
.nvmr-amount-input {
    margin-bottom: 24px;
}

.nvmr-amount-input label {
    display: block;
    color: #374151;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 8px;
}

.nvmr-amount-input input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.nvmr-amount-input input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Payout Options */
.nvmr-payout-options {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.nvmr-option-btn {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 16px;
    text-align: left;
    width: 100%;
}

.nvmr-option-btn:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.nvmr-option-btn.withdraw:hover {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
}

.nvmr-option-btn.convert:hover {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
}

.nvmr-option-btn i {
    font-size: 24px;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.nvmr-option-btn.withdraw i {
    background: linear-gradient(135deg, #3b82f6, #1e40af);
		
}

.nvmr-option-btn.convert i {
    background: linear-gradient(135deg, #10b981, #059669);
}

.nvmr-option-btn strong {
    display: block;
    color: #1e293b;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.nvmr-option-btn small {
    color: #64748b;
    font-size: 12px;
}

.nvmr-bonus-preview {
    background: #f0fdf4;
    padding: 8px 12px;
    border-radius: 6px;
    margin-top: 8px;
    border-left: 3px solid #10b981;
    font-size: 13px;
    color: #166534;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.nvmr-bonus-preview strong {
    font-weight: 700;
    color: #065f46;
}

/* Success Modal */
.nvmr-success-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #10b981, #059669);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: white;
    font-size: 32px;
}

/* Forms */
.nvmr-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.nvmr-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #374151;
    font-size: 14px;
}

.nvmr-form input, 
.nvmr-form select, 
.nvmr-form textarea {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #f8fafc;
    font-family: inherit;
}

.nvmr-form input:focus, 
.nvmr-form select:focus, 
.nvmr-form textarea:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Grid Layouts */
.nvmr-grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.nvmr-grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

/* Commission Options */
.nvmr-commission-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.nvmr-option-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 20px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.nvmr-option-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #3b82f6, #1e40af);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.nvmr-option-card:hover {
    border-color: #667eea;
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

.nvmr-option-card:hover::before {
    transform: scaleX(1);
}

.nvmr-option-card h4 {
    color: #1e293b;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nvmr-option-card h4 i {
    color: #667eea;
}

/* Commission Summary */
.nvmr-commission-summary {
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
    border-radius: 12px;
    padding: 16px;
    margin-top: 20px;
}

.nvmr-commission-summary h4 {
    color: #1e293b;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e2e8f0;
}

.nvmr-commission-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 14px;
}

.nvmr-commission-item span {
    color: #64748b;
}

.nvmr-commission-item strong {
    color: #1e293b;
    font-weight: 600;
}

/* Conversion Preview */
.nvmr-conversion-preview {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border: 2px solid #10b981;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    margin: 16px 0;
    font-size: 14px;
}

.nvmr-conversion-preview div {
    margin: 4px 0;
}

.nvmr-arrow {
    font-size: 20px;
    color: #10b981;
    font-weight: bold;
    margin: 8px 0;
}

.nvmr-bonus {
    color: #166534;
    font-weight: 600;
}

/* Notice Styles */
.nvmr-notice {
    padding: 16px 20px;
    border-radius: 10px;
    margin: 20px 0;
    border-left: 4px solid;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-weight: 500;
}

.nvmr-notice.info {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border-left-color: #3b82f6;
    color: #1e40af;
}

.nvmr-notice.warning {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    border-left-color: #f59e0b;
    color: #92400e;
}

.nvmr-notice.success {
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    border-left-color: #10b981;
    color: #065f46;
}

.nvmr-notice.error {
    background: linear-gradient(135deg, #fef2f2, #fecaca);
    border-left-color: #ef4444;
    color: #991b1b;
}

.nvmr-notice i {
    font-size: 18px;
    margin-top: 1px;
    flex-shrink: 0;
}

/* Buttons */
.nvmr-wrapper .button,
.nvmr-wrapper .button-primary,
.nvmr-wrapper button[type="submit"] {
    background: linear-gradient(135deg, #667eea, #764ba2) !important;
    color: white !important;
    border: none !important;
    padding: 16px 32px !important;
    border-radius: 12px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    font-size: 16px !important;
    line-height: 1 !important;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3) !important;
}

.nvmr-wrapper .button:hover,
.nvmr-wrapper .button-primary:hover,
.nvmr-wrapper button[type="submit"]:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.4) !important;
}

.nvmr-wrapper .button.success {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3) !important;
}

/* Progress bar */
.nvmr-registration-progress {
    background: #e2e8f0;
    border-radius: 10px;
    height: 8px;
    margin-bottom: 30px;
    overflow: hidden;
}

.nvmr-registration-progress-fill {
    background: linear-gradient(90deg, #667eea, #764ba2);
    height: 100%;
    width: 100%;
    border-radius: 10px;
    animation: nvmrProgressFill 2s ease-in-out;
}

@keyframes nvmrProgressFill {
    from { width: 0%; }
    to { width: 100%; }
}

/* Hide elements */
.nvmr-hidden {
    display: none !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nvmr-wrapper {
        padding: 12px;
    }
    
    .nvmr-dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        padding: 0 12px;
    }
    
    .nvmr-dashboard-header h2 {
        font-size: 24px;
    }
    
    .nvmr-user-info {
        align-items: flex-start;
    }
    
    .nvmr-kpi-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .nvmr-kpi-card {
        padding: 16px;
    }
    
    .nvmr-kpi-icon {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }
    
    .nvmr-kpi-value {
        font-size: 18px;
    }
    
    .nvmr-section, .nvmr-action-section {
        padding: 16px;
        margin-bottom: 16px;
    }
    
    .nvmr-table-responsive {
        margin: 0 -16px;
        padding: 0 16px;
    }
    
    .nvmr-table th,
    .nvmr-table td {
        padding: 12px 8px;
        font-size: 12px;
    }
    
    .nvmr-modal-content {
        margin: 20px;
        max-height: calc(100vh - 40px);
    }
    
    .nvmr-payout-options {
        gap: 12px;
    }
    
    .nvmr-option-btn {
        padding: 16px;
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }
    
    .nvmr-commission-options {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .nvmr-grid-2, 
    .nvmr-grid-3 {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .nvmr-kpi-card {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }
    
    .nvmr-table {
        font-size: 11px;
    }
    
    .nvmr-table th,
    .nvmr-table td {
        padding: 8px 4px;
    }
    
    .nvmr-modal-header,
    .nvmr-modal-body {
        padding: 16px;
    }
    
    .nvmr-card {
        padding: 20px;
        margin: 10px 0;
    }
}

/* Animations */
@keyframes nvmrFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.nvmr-kpi-card {
    animation: nvmrFadeIn 0.5s ease forwards;
}

.nvmr-kpi-card:nth-child(1) { animation-delay: 0.1s; }
.nvmr-kpi-card:nth-child(2) { animation-delay: 0.2s; }
.nvmr-kpi-card:nth-child(3) { animation-delay: 0.3s; }
.nvmr-kpi-card:nth-child(4) { animation-delay: 0.4s; }