/* Enhanced Affiliate Dashboard Styles */

/* Icon spacing inside buttons */
.copy-btn .di-icon,
.btn .di-icon {
    margin-right: 6px;
    vertical-align: middle;
}

/* Spinning animation for loading states */
.spinning {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Standalone Dashboard Styles */
.dimi-standalone-dashboard {
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden;
}

.dimi-standalone-dashboard * {
    box-sizing: border-box;
}

.dimi-standalone-dashboard .dimi-affiliate-dashboard-container {
    width: 100vw !important;
    height: 100vh !important;
    margin: 0 !important;
    max-width: none !important;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Sidebar Layout - NS Affiliate Style */
.dimi-affiliate-dashboard-container {
    display: flex;
    min-height: 100vh;
    background: #f5f6fa;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}

/* Sidebar Styles */
.dashboard-sidebar {
    width: 250px;
    background: #ffffff;
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.05);
}

/* Mobile Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
}

/* Mobile Sidebar States */
@media (max-width: 768px) {
    .dashboard-sidebar {
        position: fixed;
        top: 0;
        left: -250px;
        width: 250px;
        height: 100vh;
        z-index: 999;
        transition: left 0.3s ease;
        flex-direction: column;
    }
    
    .dashboard-sidebar.active {
        left: 0;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .sidebar-overlay {
        display: block;
    }
}

.sidebar-header {
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid #e5e7eb;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--di-primary, #2563EB);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
}

/* Admin-uploaded brand logo — sole brand element in the sidebar header
   (label is suppressed when a logo exists). Bound the size so a 4000px
   logo doesn't blow up the sidebar; allow non-square logos to render
   at their natural ratio. */
.logo-img {
    max-width: 100%;
    max-height: 48px;
    width: auto;
    height: auto;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 6px;
    display: block;
}

/* Icon-only brand mark beside the brand name (admin set a Brand Name).
   Scoped to .logo-section so it outranks the container's
   `.dimi-affiliate-dashboard-container :where(img)` reset (same 0,0,1,0
   specificity would otherwise lose on source order → logo renders huge). */
.logo-section .logo-mark {
    height: 40px;
    width: auto;
    max-width: 60px;
    object-fit: contain;
    flex-shrink: 0;
    display: block;
}
/* Same guard for the full/custom logo image. */
.logo-section .logo-img {
    max-height: 48px;
    max-width: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    flex-shrink: 0;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
    /* Keep the label from pushing the logo image off-screen on narrow
       sidebars when the brand name is long. */
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-content {
    flex: 1;
    padding: 1rem 0;
}

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--di-primary-soft, rgba(37, 99, 235, 0.10));
    color: var(--di-primary, #2563EB);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid color-mix(in srgb, var(--di-primary, #2563EB) 18%, transparent);
}

.user-avatar-initial {
    font-family: var(--di-font-heading, 'Be Vietnam Pro', system-ui, sans-serif);
    font-weight: 600;
    font-size: 0.9375rem;
    line-height: 1;
    letter-spacing: 0.01em;
}

.user-details {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--di-text, #0F172A);
    margin-bottom: 0.125rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-code {
    font-size: 0.75rem;
    color: var(--di-text-muted, #475569);
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-actions {
    flex-shrink: 0;
}

.sidebar-actions .logout-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 8px;
    color: var(--di-text-muted, #475569);
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background 150ms ease-out, color 150ms ease-out, border-color 150ms ease-out;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.sidebar-actions .logout-btn:hover {
    background: var(--di-danger-soft, rgba(239, 68, 68, 0.10));
    color: var(--di-danger, #EF4444);
    border-color: color-mix(in srgb, var(--di-danger, #EF4444) 20%, transparent);
}

.sidebar-actions .logout-btn:focus-visible {
    outline: 2px solid var(--di-primary, #2563EB);
    outline-offset: 2px;
}

/* Main Content Area */
.dashboard-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.main-header {
    background: var(--di-surface, #FFFFFF);
    border-bottom: 1px solid var(--di-border, #E2E8F0);
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-height: 56px;
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: saturate(180%) blur(8px);
    -webkit-backdrop-filter: saturate(180%) blur(8px);
}

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 10px;
    color: var(--di-text, #0F172A);
    cursor: pointer;
    transition: background 150ms ease-out, border-color 150ms ease-out;
    flex-shrink: 0;
    padding: 0;
}

.mobile-menu-toggle:hover {
    background: var(--di-surface-alt, #F1F5F9);
    border-color: var(--di-border, #E2E8F0);
}

.mobile-menu-toggle:focus-visible {
    outline: 2px solid var(--di-primary, #2563EB);
    outline-offset: 2px;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--di-text, #0F172A);
}

.breadcrumb-home {
    display: inline-flex;
    color: var(--di-text-muted, #475569);
    flex-shrink: 0;
}

.breadcrumb-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.main-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--di-primary, #2563EB);
    color: #fff;
    border: 1px solid transparent;
    padding: 0.5rem 1rem;
    min-height: 40px;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    transition: background 150ms ease-out, box-shadow 150ms ease-out, transform 80ms ease-out;
}

.share-btn:hover {
    background: var(--di-primary-hover, #1D4ED8);
}

.share-btn:active {
    transform: translateY(1px);
}

.share-btn:focus-visible {
    outline: 2px solid var(--di-primary, #2563EB);
    outline-offset: 2px;
}

.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.dashboard-content {
    max-width: none;
}

/* Mobile Sidebar Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Mobile Sidebar States */
.dashboard-sidebar.active {
    transform: translateX(0);
}

/* OLD HEADER STYLES - COMMENTED OUT FOR NEW SIDEBAR LAYOUT
.dashboard-header {
    background: var(--di-primary, #2563EB);
    color: #fff;
    padding: 2rem 0;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.header-content {
    width: 100%;
    margin: 0;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dashboard-title {
    margin: 0 0 0.5rem 0;
    font-size: 2.25rem;
    font-weight: 700;
    color: #fff;
}

.welcome-text {
    margin: 0;
    font-size: 1.1rem;
    opacity: 0.9;
}

.affiliate-code {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-weight: 600;
}

.header-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.header-actions .regular-btn,
.header-actions .clean-btn,
.header-actions .standalone-btn,
.header-actions .logout-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    text-decoration: none;
    padding: 0.75rem 1.25rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.9rem;
}

.header-actions .regular-btn:hover,
.header-actions .clean-btn:hover,
.header-actions .standalone-btn:hover,
.header-actions .logout-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
}
*/

/* Header action icons */
.header-actions ion-icon {
    display: inline-block !important;
    width: auto;
    height: auto;
    font-size: inherit;
    vertical-align: middle;
    margin-right: 0.5rem;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Specific logout button icon styles */
.logout-btn ion-icon,
.header-actions .logout-btn ion-icon {
    display: inline-block !important;
    visibility: visible !important;
    width: 16px !important;
    height: 16px !important;
    font-size: 16px !important;
    margin-right: 0.5rem !important;
    vertical-align: middle;
    color: inherit;
}

/* Ensure logout icon shows in fallback mode */
.ionicons-fallback .logout-btn ion-icon[name="log-out-outline"]:before,
.ionicons-fallback .header-actions .logout-btn ion-icon[name="log-out-outline"]:before {
    content: "\f2f5";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    display: inline-block !important;
    visibility: visible !important;
    margin-right: 0.5rem;
}

/* Force all header action icons to be visible */
.header-actions ion-icon,
.header-actions .logout-btn ion-icon,
.header-actions .regular-btn ion-icon {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 16px;
    height: 16px;
    font-size: 16px;
    margin-right: 0.5rem;
    vertical-align: middle;
}

/* Specific logout icon overrides */
ion-icon[name="log-out-outline"] {
    display: inline-block !important;
    visibility: visible !important;
    width: 16px !important;
    height: 16px !important;
    font-size: 16px !important;
}

/* Logout button specific styling */
.logout-btn {
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
}

.logout-btn ion-icon {
    flex-shrink: 0 !important;
}

/* OLD DASHBOARD LAYOUT - COMMENTED OUT FOR NEW SIDEBAR LAYOUT
.dashboard-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
    width: 100%;
    margin: 0;
    padding: 0 2rem 2rem;
}

.dashboard-sidebar {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    height: fit-content;
    position: sticky;
    top: 2rem;
}
*/

.sidebar-nav {
    padding: 0;
}

.nav-tabs {
    list-style: none;
    margin: 0;
    padding: 0 1rem;
}

.nav-item {
    margin: 0 0 0.25rem 0;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: #6b7280;
    text-decoration: none;
    transition: all 0.2s ease;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.875rem;
}

.nav-link:hover {
    background: #f3f4f6;
    color: #374151;
    text-decoration: none;
}

.nav-link.active {
    background: var(--di-primary, #2563EB);
    color: #ffffff;
}

.nav-icon {
    width: 18px;
    height: 18px;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Ensure Ionicons display properly in navigation */
.nav-icon ion-icon {
    width: 18px;
    height: 18px;
    font-size: 18px;
    display: block;
    visibility: visible !important;
}

/* Force all nav icons to be visible */
.nav-link ion-icon {
    opacity: 1 !important;
    visibility: visible !important;
    display: inline-block !important;
}

/* Active nav link icon styling */
.nav-link.active .nav-icon ion-icon {
    color: #ffffff;
}

.nav-text {
    font-size: 0.95rem;
}

/* OLD MAIN CONTENT STYLES - COMMENTED OUT FOR NEW SIDEBAR LAYOUT
.dashboard-main {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.dashboard-content {
    padding: 2rem;
}
*/

.tab-title {
    margin: 0 0 1.5rem 0;
    font-size: 1.75rem;
    font-weight: 700;
    color: #1e293b;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.2rem;
    /* display: flex; */
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: currentColor;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.stat-card-primary { --stat-accent: var(--di-primary, #2563EB);   --stat-accent-soft: var(--di-primary-soft, rgba(37,99,235,0.10)); color: var(--stat-accent); }
.stat-card-success { --stat-accent: var(--di-success, #10B981);   --stat-accent-soft: var(--di-success-soft, rgba(16,185,129,0.10)); color: var(--stat-accent); }
.stat-card-info    { --stat-accent: var(--di-info, #06B6D4);      --stat-accent-soft: rgba(6,182,212,0.10); color: var(--stat-accent); }
.stat-card-warning { --stat-accent: var(--di-warning, #F59E0B);   --stat-accent-soft: var(--di-warning-soft, rgba(245,158,11,0.10)); color: var(--stat-accent); }

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    background: var(--stat-accent-soft, rgba(37,99,235,0.10));
    color: var(--stat-accent, var(--di-primary, #2563EB));
    transition: background 200ms ease-out, transform 200ms ease-out;
    flex-shrink: 0;
}

.stat-card:hover .stat-icon {
    background: var(--stat-accent, var(--di-primary, #2563EB));
    color: #fff;
    transform: scale(1.04);
}

.stat-icon .di-icon {
    width: 24px;
    height: 24px;
    stroke-width: 2;
}

/* ========================================
   OVERVIEW TAB SPECIFIC STAT CARDS
   ======================================== */

/* Scoped stat-cards for overview tab only */
.overview-tab .stat-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.overview-tab .stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: currentColor;
}

.overview-tab .stat-card:hover {
    transform: translateY(-2px);
    opacity: 0.95;
    transition: all 0.3s ease;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.overview-tab .stat-card:hover .stat-icon {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Overview tab stat card variants */
.overview-tab .stat-card-primary {
    --stat-accent: var(--di-primary, #2563EB);
    --stat-accent-soft: var(--di-primary-soft, rgba(37,99,235,0.10));
    color: var(--stat-accent);
    background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%);
    border-color: rgba(37,99,235,0.25);
}

.overview-tab .stat-card-success {
    --stat-accent: var(--di-success, #10B981);
    --stat-accent-soft: var(--di-success-soft, rgba(16,185,129,0.10));
    color: var(--stat-accent);
    background: linear-gradient(135deg, #ECFDF5 0%, #D1FAE5 100%);
    border-color: rgba(16,185,129,0.25);
}

.overview-tab .stat-card-info {
    --stat-accent: var(--di-info, #06B6D4);
    --stat-accent-soft: rgba(6,182,212,0.10);
    color: var(--stat-accent);
    background: linear-gradient(135deg, #F0FDFF 0%, #CFFAFE 100%);
    border-color: rgba(6,182,212,0.25);
}

.overview-tab .stat-card-warning {
    --stat-accent: var(--di-warning, #F59E0B);
    --stat-accent-soft: var(--di-warning-soft, rgba(245,158,11,0.10));
    color: var(--stat-accent);
    background: linear-gradient(135deg, #FFFBEB 0%, #FEF3C7 100%);
    border-color: rgba(245,158,11,0.25);
}

/* Overview tab stat icons */
.overview-tab .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--stat-accent-soft, rgba(37,99,235,0.10));
    color: var(--stat-accent, var(--di-primary, #2563EB));
    flex-shrink: 0;
    transition: background 200ms ease-out, transform 200ms ease-out;
}

.overview-tab .stat-card:hover .stat-icon {
    background: var(--stat-accent, var(--di-primary, #2563EB));
    color: #fff;
    transform: scale(1.04);
}

.overview-tab .stat-icon .di-icon {
    width: 24px;
    height: 24px;
    stroke-width: 2;
}

/* Overview tab stat content */
.overview-tab .stat-content {
    flex: 1;
    min-width: 0;
}

.overview-tab .stat-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: #64748b;
    margin: 0 0 0.25rem 0;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.overview-tab .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1;
    margin: 0;
}

/* Icons now use inline SVG via .di-icon — no Font Awesome / Ionicons fallback needed */

.stat-content {
    flex: 1;
}

.stat-title {
    margin: 0 0 0.5rem 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1.875rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1;
}

/* Section Titles */
.section-title {
    margin: 2rem 0 1.5rem 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #374151;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 0.5rem;
}

/* Quick Actions */
.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.action-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
}

.action-card h3 {
    margin: 0 0 1rem 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #374151;
}

.action-description {
    margin: 0 0 1rem 0;
    color: #6b7280;
    font-size: 0.875rem;
}

/* Input Groups */
.input-group {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.dimi-affiliate-dashboard-container .affiliate-link-input,
.dimi-affiliate-dashboard-container input.affiliate-link-input {
    flex: 1;
    min-width: 0;
    padding: 0.6875rem 0.875rem;
    border: 1px solid var(--di-border, #E2E8F0);
    border-radius: 10px;
    background: var(--di-surface, #FFFFFF);
    font-family: inherit;
    font-size: 0.9375rem;
    line-height: 1.4;
    color: var(--di-text, #0F172A);
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02);
    transition: border-color 150ms ease-out, box-shadow 150ms ease-out;
    margin: 0;
    max-width: none;
}

.dimi-affiliate-dashboard-container .affiliate-link-input:hover {
    border-color: var(--di-border-strong, #CBD5E1);
}

.dimi-affiliate-dashboard-container .affiliate-link-input:focus {
    outline: none;
    border-color: var(--di-primary, #2563EB);
    box-shadow: 0 0 0 3px var(--di-primary-soft, rgba(37, 99, 235, 0.12));
}

.dimi-affiliate-dashboard-container .affiliate-link-input[readonly] {
    cursor: copy;
}

.copy-btn {
    background: var(--di-primary, #2563EB);
    color: #fff;
    border: none;
    padding: 0.4rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.copy-btn:hover {
    background: var(--di-primary, #2563EB);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.875rem;
}

.btn-primary {
    background: var(--di-primary, #2563EB);
    color: #fff;
}

.btn-primary:hover {
    background: var(--di-primary, #2563EB);
    color: #fff;
    text-decoration: none;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1rem;
}

/* Activity Grid */
.activity-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.activity-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
}

.activity-card h3 {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
}

/* Summary Items */
.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #e5e7eb;
}

.summary-item:last-child {
    border-bottom: none;
}

.item-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.item-date {
    font-size: 0.875rem;
    color: #6b7280;
}

.item-amount {
    font-weight: 600;
    color: #374151;
}

.item-status {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.view-all-link {
    display: inline-block;
    margin-top: 1rem;
    color: var(--di-primary, #2563EB);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
}

.view-all-link:hover {
    text-decoration: underline;
}

/* Status Badges */
.status-badge,
.item-status {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    letter-spacing: 0.5px;
}

.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.status-confirmed,
.status-completed,
.status-paid {
    background: #d1fae5;
    color: #065f46;
}

.status-cancelled,
.status-rejected {
    background: #fee2e2;
    color: #991b1b;
}

.status-active {
    background: #dbeafe;
    color: var(--di-primary-hover, #1D4ED8);
}

/* Data Tables */
.data-table-container {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    /* overflow-x:auto so wide tables (e.g. Payout History on mobile or
       narrow desktops) get a horizontal scrollbar instead of being
       clipped silently — matches .referrals-table-wrapper. overflow-y
       stays hidden to keep the rounded corners crisp. */
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    margin-top: 1rem;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    background: #f9fafb;
    color: #374151;
    font-weight: 600;
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid #f3f4f6;
    color: #6b7280;
}

.data-table tr:hover {
    background: #f9fafb;
}

/* Payout Sections */
.payout-request-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.payout-balance-card {
    background: var(--di-primary, #2563EB);
    color: #fff;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
}

.payout-balance-card h3 {
    margin: 0 0 1rem 0;
    font-size: 1.125rem;
    opacity: 0.9;
}

.balance-amount {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.balance-description {
    margin: 0;
    opacity: 0.8;
    font-size: 0.875rem;
}

.payout-status-card,
.payout-action-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
}

.payout-status-card.pending {
    background: #fef3c7;
    border-color: #f59e0b;
    color: #92400e;
}

.payout-status-card.insufficient {
    background: #fee2e2;
    border-color: #ef4444;
    color: #991b1b;
}

.payout-status-card .dashicons {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

/* Profile Sections */
.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.profile-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.profile-field label {
    font-weight: 600;
    color: #374151;
    font-size: 0.875rem;
}

.profile-field span {
    color: #6b7280;
}

/* Form Elements */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #374151;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    color: #374151;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--di-primary, #2563EB);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Payment Method Styling */
.payment-method-section {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.payment-method-section h4 {
    margin: 0 0 1rem 0;
    color: #1e293b;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.payment-method-section h4 ion-icon {
    color: var(--di-primary, #2563EB);
    font-size: 1.2rem;
}

.payment-method-options {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.payment-method-option {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 140px;
}

.payment-method-option:hover {
    border-color: var(--di-primary, #2563EB);
    background: #f0f9ff;
}

.payment-method-option.selected {
    border-color: var(--di-primary, #2563EB);
    background: #eff6ff;
}

.payment-method-option input[type="radio"] {
    margin-right: 0.5rem;
    width: auto;
}

.payment-method-option label {
    margin: 0;
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.payment-method-option ion-icon {
    font-size: 1.1rem;
    color: #64748b;
}

.payment-method-option.selected ion-icon {
    color: var(--di-primary, #2563EB);
}

/* Payment Fields */
.paypal-fields,
.bank-fields {
    transition: all 0.3s ease;
}

.bank-fields {
    display: none; /* Initially hidden, shown via JavaScript */
}

.bank-fields.show,
.paypal-fields.show {
    display: block;
}

.bank-account-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.bank-account-grid .form-group.full-width {
    grid-column: 1 / -1;
}

/* Bank Account Specific Styling */
.bank-field-group {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.bank-field-group h5 {
    margin: 0 0 0.75rem 0;
    color: #374151;
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.bank-field-group h5 ion-icon {
    color: #6b7280;
    font-size: 1rem;
}

.bank-info-notice {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 6px;
    padding: 0.75rem;
    margin-bottom: 1rem;
    color: #92400e;
    font-size: 0.875rem;
}

.bank-info-notice ion-icon {
    color: #f59e0b;
    margin-right: 0.5rem;
    vertical-align: middle;
}

.bank-info-notice strong {
    display: block;
    margin-bottom: 0.25rem;
}

/* Input field enhancements for bank fields */
.bank-fields input[type="text"],
.bank-fields input[type="email"] {
    font-family: 'Roboto Mono', monospace;
    letter-spacing: 0.5px;
}

.bank-fields input[name="account_number"],
.bank-fields input[name="routing_number"],
.bank-fields input[name="swift_code"] {
    text-transform: uppercase;
}

/* Responsive design for payment fields */
@media (max-width: 768px) {
    .payment-method-options {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .payment-method-option {
        min-width: auto;
        width: 100%;
    }
    
    .bank-account-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
}

/* Bank Account Management Styles */
.bank-accounts-section {
    margin-top: 2rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-header h4 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #1e293b;
    font-size: 1.1rem;
}

.section-header h4 ion-icon {
    color: var(--di-primary, #2563EB);
    font-size: 1.2rem;
}

/* Bank Account Cards */
.bank-account-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: all 0.2s ease;
}

.bank-account-card:hover {
    border-color: var(--di-primary, #2563EB);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

.account-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.account-info h5 {
    margin: 0 0 0.25rem 0;
    color: #1e293b;
    font-size: 1rem;
    font-weight: 600;
}

.account-details {
    color: #64748b;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.default-badge {
    display: inline-block;
    background: #10b981;
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.account-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.account-actions .btn {
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.account-actions .text-danger {
    color: #dc2626;
}

.account-actions .text-danger:hover {
    color: #b91c1c;
    background-color: #fef2f2;
}

/* Account Details Expansion */
.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.detail-item label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.detail-item span {
    color: #1e293b;
    font-size: 0.875rem;
}

/* No Bank Accounts State */
.no-bank-accounts {
    text-align: center;
    padding: 3rem 2rem;
    color: #64748b;
}

.no-bank-accounts ion-icon {
    font-size: 3rem;
    color: #94a3b8;
    margin-bottom: 1rem;
}

.no-bank-accounts p {
    margin: 0.5rem 0;
}

/* Bank Account Modal */
.bank-account-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* .modal-content {
    background: #ffffff;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
} */

.bank-account-form {
    padding: 1.5rem;
}

.bank-account-form .form-row {
    display: grid;
    /* grid-template-columns: 1fr 1fr; */
    gap: 1rem;
    margin-bottom: 1rem;
}

.bank-account-form .form-group {
    margin-bottom: 1rem;
}

.bank-account-form label {
    display: block;
    margin-bottom: 0.5rem;
    color: #374151;
    font-weight: 500;
    font-size: 0.9rem;
}

.bank-account-form input[type="text"],
.bank-account-form input[type="email"],
.bank-account-form select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    background: white;
}

.bank-account-form input:focus,
.bank-account-form select:focus {
    outline: none;
    border-color: var(--di-primary, #2563EB);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--di-primary, #2563EB) 10%, transparent);
}

.bank-account-form .field-help {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.8rem;
    color: #6b7280;
}

.bank-account-form .btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    min-width: 100px;
    justify-content: center;
}

.bank-account-form .btn-secondary {
    background: #f8fafc;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.bank-account-form .btn-secondary:hover {
    background: #f1f5f9;
    color: #475569;
    border-color: #cbd5e1;
}

.bank-account-form .btn-primary {
    background: var(--di-primary, #2563EB);
    color: white;
}

.bank-account-form .btn-primary:hover {
    background: var(--di-primary-hover, #1D4ED8);
    transform: translateY(-1px);
}

.bank-account-form .form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

/* Form Validation Styles */
.bank-account-form input.error,
.bank-account-form select.error {
    border-color: #ef4444 !important;
    background: #fef2f2 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

.bank-account-form input.error:focus,
.bank-account-form select.error:focus {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2) !important;
}

.error-message {
    color: #ef4444 !important;
    font-size: 0.8rem !important;
    margin-top: 0.25rem !important;
    display: block;
    font-weight: 500;
}

/* Loading and disabled states */
.bank-account-form .btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    pointer-events: none;
}

.bank-account-form .btn:disabled ion-icon {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Payment Info Notice */
.payment-info-notice {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 2rem;
    display: flex;
    gap: 0.75rem;
}

.payment-info-notice ion-icon {
    color: var(--di-primary, #2563EB);
    font-size: 1.25rem;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.payment-info-notice h5 {
    margin: 0 0 0.5rem 0;
    color: #1e293b;
    font-size: 0.95rem;
    font-weight: 600;
}

.payment-info-notice p {
    margin: 0;
    color: #475569;
    font-size: 0.875rem;
    line-height: 1.5;
}

/* PayPal Section */
.paypal-section {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.paypal-section h4 {
    margin: 0 0 1rem 0;
    color: #1e293b;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.paypal-section h4 ion-icon {
    color: #0070ba;
    font-size: 1.2rem;
}

/* Responsive Design for Bank Account Management */
@media (max-width: 768px) {
    .section-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .account-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .account-actions {
        justify-content: flex-start;
    }
    
    .details-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .bank-account-form .form-row {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    
    .bank-account-form .form-actions {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .bank-account-form .form-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

/* No Data Messages */
.no-data {
    text-align: center;
    color: #9ca3af;
    font-style: italic;
    padding: 2rem;
    background: #f9fafb;
    border-radius: 8px;
    margin: 1rem 0;
}

/* OLD RESPONSIVE DESIGN - COMMENTED OUT FOR NEW SIDEBAR LAYOUT
@media (max-width: 1024px) {
    .dimi-affiliate-dashboard-container {
        width: 100vw;
        margin-left: calc(50% - 50vw);
        margin-right: calc(50% - 50vw);
    }
    
    .dashboard-layout {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0 1rem 1rem;
    }
    
    .dashboard-sidebar {
        position: static;
    }
    
    .sidebar-nav {
        padding: 1rem;
    }
    
    .nav-tabs {
        display: flex;
        overflow-x: auto;
        gap: 0.5rem;
    }
    
    .nav-item {
        flex-shrink: 0;
    }
    
    .nav-link {
        white-space: nowrap;
        padding: 0.75rem 1rem;
        border: 1px solid #e2e8f0;
        border-radius: 6px;
        border-left: 3px solid transparent;
    }
    
    .nav-link.active {
        border-left-color: var(--di-primary, #2563EB);
    }
}
*/

/* OLD RESPONSIVE STYLES CONTINUE BELOW - ALSO COMMENTED OUT */
/*
@media (max-width: 768px) {
    .dimi-affiliate-dashboard-container {
        width: 100vw;
        margin-left: calc(50% - 50vw);
        margin-right: calc(50% - 50vw);
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
        padding: 0 1rem;
        text-align: center;
    }
    
    .dashboard-title {
        font-size: 1.75rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .quick-actions-grid,
    .activity-grid {
        grid-template-columns: 1fr;
    }

    .payout-request-section {
        grid-template-columns: 1fr;
    }

    .profile-grid {
        grid-template-columns: 1fr;
    }

    .data-table-container {
        overflow-x: auto;
    }

    .dashboard-content {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .dimi-affiliate-dashboard-container {
        width: 100vw;
        margin-left: calc(50% - 50vw);
        margin-right: calc(50% - 50vw);
    }
    
    .dashboard-layout {
        padding: 0 1rem 1rem;
    }
    
    .header-content {
        padding: 0 1rem;
    }
    
    .nav-text {
        display: none;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .copy-btn {
        align-self: flex-start;
    }
}
*/

/* Enhanced Statistics Tab Styles */

/* Stats Header */
.stats-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e5e7eb;
}

.stats-title-section h2 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0 0 0.5rem 0;
    font-size: 1.875rem;
    font-weight: 700;
    color: #1e293b;
}

.stats-title-section h2 ion-icon {
    color: var(--di-primary, #2563EB);
    font-size: 2rem;
}

.stats-subtitle {
    margin: 0;
    color: #64748b;
    font-size: 1rem;
}

.stats-filters {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    background: #f8fafc;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    margin-bottom: 2rem;
}

.time-period-selector {
    flex: 1;
}

.filter-label {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.75rem;
}

.filter-label ion-icon {
    color: var(--di-primary, #2563EB);
    font-size: 1rem;
}

.period-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.quick-periods {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.period-btn {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    color: #374151;
    font-weight: 500;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    white-space: nowrap;
    line-height: 1;
}

.period-btn:hover {
    border-color: var(--di-primary, #2563EB);
    color: var(--di-primary, #2563EB);
    transform: translateY(-1px);
}

.period-btn.active {
    background: var(--di-primary, #2563EB);
    border-color: var(--di-primary, #2563EB);
    color: #fff;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.custom-range-btn {
    background: var(--di-primary, #2563EB) !important;
    border-color: var(--di-primary, #2563EB) !important;
    color: #fff !important;
}

.custom-range-btn:hover {
    background: var(--di-primary, #2563EB) !important;
    border-color: var(--di-primary, #2563EB) !important;
}

.date-range-picker {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.date-inputs {
    display: flex;
    align-items: end;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.date-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.date-input-group label {
    font-size: 0.75rem;
    font-weight: 500;
    color: #374151;
}

.date-input {
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: #fff;
    color: #374151;
    font-size: 0.8rem;
    min-width: 120px;
}

.apply-custom-range {
    background: #10b981;
    color: #fff;
    border: none;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-weight: 500;
    font-size: 0.8rem;
    transition: all 0.3s ease;
    height: fit-content;
}

.apply-custom-range:hover {
    background: #059669;
}

.stats-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stats-refresh-btn {
    background: var(--di-primary, #2563EB);
    color: #fff;
    border: none;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-weight: 500;
    font-size: 0.8rem;
    transition: all 0.3s ease;
    white-space: nowrap;
    min-width: 100px;
    justify-content: center;
}

.stats-refresh-btn:hover {
    background: var(--di-primary, #2563EB);
}

/* Legacy support for backward compatibility */
.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
}

.stats-filter-select {
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    color: #374151;
    font-size: 0.875rem;
    min-width: 150px;
}

/* KPI Section */
.kpi-section {
    margin-bottom: 2rem;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.kpi-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: currentColor;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

/* ========================================
   KPI CARDS - CONSOLIDATED STYLES
   ======================================== */

/* Base KPI Icon Styling */
.kpi-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    color: #fff; /* SVG strokes inherit white on colored bg */
}

.kpi-icon .di-icon {
    width: 20px;
    height: 20px;
    stroke-width: 2;
}

/* KPI Card Base Styles */
.kpi-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

/* KPI Primary (Blue) */
.kpi-card.kpi-primary {
    color: var(--di-primary, #2563EB) !important;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%) !important;
    border-color: #60a5fa !important;
}

.kpi-card.kpi-primary::before {
    background: var(--di-primary, #2563EB) !important;
}

.kpi-card.kpi-primary .kpi-icon {
    background: var(--di-primary, #2563EB) !important;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3) !important;
}

/* KPI Success (Green) */
.kpi-card.kpi-success {
    color: #10b981 !important;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%) !important;
    border-color: #34d399 !important;
}

.kpi-card.kpi-success::before {
    background: #10b981 !important;
}

.kpi-card.kpi-success .kpi-icon {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3) !important;
}

/* KPI Info (Cyan) */
.kpi-card.kpi-info {
    color: #0891b2 !important;
    background: linear-gradient(135deg, #f0fdff 0%, #e6fffa 100%) !important;
    border-color: #22d3ee !important;
}

.kpi-card.kpi-info::before {
    background: #06b6d4 !important;
}

.kpi-card.kpi-info .kpi-icon {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%) !important;
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3) !important;
}

/* KPI Warning (Orange) */
.kpi-card.kpi-warning {
    color: #f59e0b !important;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%) !important;
    border-color: #fbbf24 !important;
}

.kpi-card.kpi-warning::before {
    background: #f59e0b !important;
}

.kpi-card.kpi-warning .kpi-icon {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3) !important;
}

.kpi-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.kpi-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 0.75rem;
}

.kpi-trend {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8rem;
    font-weight: 500;
}

.kpi-trend .di-icon {
    width: 12px;
    height: 12px;
    stroke-width: 2.25;
    margin-right: 4px;
}

.kpi-trend.positive {
    color: #059669;
}

.kpi-trend.negative {
    color: #dc2626;
}

.kpi-trend.neutral {
    color: #6b7280;
}

.trend-text {
    font-size: 0.8rem;
}

/* Analytics Cards */
.detailed-analytics {
    margin-bottom: 3rem;
}

.analytics-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.analytics-row:last-child {
    grid-template-columns: 1fr;
}

.analytics-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.analytics-card.full-width {
    grid-column: 1 / -1;
}

.card-header {
    background: #f8fafc;
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.card-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #374151;
}

.card-title ion-icon {
    color: var(--di-primary, #2563EB);
    font-size: 1.25rem;
}

.card-content {
    padding: 1.5rem;
}

/* Progress Stats */
.progress-stats {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.progress-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

.progress-value {
    font-weight: 700;
    color: #1e293b;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--di-primary, #2563EB), #06b6d4);
    border-radius: 4px;
    transition: width 1s ease-in-out;
}

/* Funnel Chart */
.funnel-chart {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.funnel-step {
    position: relative;
}

.funnel-bar {
    background: linear-gradient(90deg, var(--di-primary, #2563EB), #06b6d4);
    border-radius: 8px;
    padding: 1rem 1.5rem;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: width 1s ease-in-out;
    position: relative;
}

/* Funnel bar icon styling */
.funnel-bar ion-icon {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    color: #ffffff !important;
    background: transparent !important;
    font-size: 14px !important;
    width: 14px !important;
    height: 14px !important;
    margin-right: 6px !important;
    filter: brightness(1.1) drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

.funnel-bar::after {
    content: '';
    position: absolute;
    right: -10px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid var(--di-primary, #2563EB);
    border-top: 25px solid transparent;
    border-bottom: 25px solid transparent;
}

.funnel-label {
    font-weight: 600;
}

.funnel-value {
    font-weight: 700;
}

/* Financial Overview */
.financial-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.financial-item {
    display: flex;
    flex-direction: column;
    align-items: left;
    gap: 1rem;
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.financial-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.financial-icon.earnings {
    background: linear-gradient(135deg, #10b981, #059669);
}

.financial-icon.paid {
    background: var(--di-primary, #2563EB);
}

.financial-icon.pending {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.financial-icon.average {
    background: linear-gradient(135deg, var(--di-primary, #2563EB), var(--di-primary, #2563EB));
}

.financial-icon ion-icon {
    font-size: 24px;
    width: 24px;
    height: 24px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.financial-content h5 {
    margin: 0 0 0.5rem 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.financial-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.25rem;
}

.financial-detail {
    font-size: 0.8rem;
    color: #6b7280;
}

/* Performance Metrics */
.performance-metrics {
    margin-bottom: 2rem;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.metric-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.metric-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.metric-icon {
    color: var(--di-primary, #2563EB);
    font-size: 1.5rem;
}

.metric-header h4 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #374151;
}

.score-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 6px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    position: relative;
}

.score-value {
    font-size: 2rem;
    font-weight: 800;
    color: #1e293b;
}

.score-label {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 600;
}

.score-description {
    font-size: 0.875rem;
}

.score-excellent {
    color: #059669;
    font-weight: 600;
}

.score-good {
    color: #0d9488;
    font-weight: 600;
}

.score-average {
    color: #f59e0b;
    font-weight: 600;
}

.score-poor {
    color: #dc2626;
    font-weight: 600;
}

/* Achievements */
.achievements-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.achievement {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.achievement.unlocked {
    background: #d1fae5;
    color: #065f46;
}

.achievement.locked {
    background: #f3f4f6;
    color: #9ca3af;
}

.achievement-icon {
    font-size: 1.25rem;
}

.achievement-text {
    font-weight: 500;
}

/* Responsive Enhancements for Stats */
@media (max-width: 1024px) {
    .stats-header {
        margin-bottom: 1rem;
    }
    
    .stats-filters {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
        padding: 0.75rem;
    }
    
    .stats-actions {
        flex-direction: row;
        justify-content: flex-end;
        gap: 0.5rem;
    }
    
    .analytics-row {
        grid-template-columns: 1fr;
    }
    
    .kpi-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
}

/* OLD RESPONSIVE STYLES - COMMENTED OUT FOR NEW SIDEBAR LAYOUT */
/*
@media (max-width: 768px) {
    .stats-filters {
        padding: 0.75rem;
    }
    
    .quick-periods {
        grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
        display: grid;
        gap: 0.25rem;
    }
    
    .period-btn {
        padding: 0.375rem 0.5rem;
        font-size: 0.75rem;
        justify-content: center;
    }
    
    .filter-label {
        font-size: 0.8rem;
        margin-bottom: 0.5rem;
    }
    
    .stats-actions {
        flex-direction: row;
        width: 100%;
        gap: 0.5rem;
    }
    
    .stats-refresh-btn {
        flex: 1;
        min-width: auto;
        font-size: 0.75rem;
        padding: 0.375rem 0.5rem;
    }
    
    .date-inputs {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .date-input-group {
        width: 100%;
    }
    
    .date-input {
        min-width: auto;
        width: 100%;
        font-size: 0.75rem;
        padding: 0.375rem;
    }
    
    .apply-custom-range {
        width: 100%;
        justify-content: center;
        font-size: 0.75rem;
        padding: 0.375rem;
    }
    
    .filter-group {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
    
    .kpi-grid {
        grid-template-columns: 1fr;
    }
    
    .financial-grid {
        grid-template-columns: 1fr;
    }
    
    .metrics-grid {
        grid-template-columns: 1fr;
    }
}
*/

/* Enhanced Links Tab Styles */

/* Links Header */
.links-tab .stats-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e5e7eb;
}

.links-tab .stats-title-section h2 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0 0 0.5rem 0;
    font-size: 1.875rem;
    font-weight: 700;
    color: #1e293b;
}

.links-tab .stats-title-section h2 ion-icon {
    color: var(--di-primary, #2563EB);
    font-size: 2rem;
}

.links-tab .stats-subtitle {
    margin: 0;
    color: #64748b;
    font-size: 1rem;
}

/* Links Tab Content Sections */
.links-tab .link-section {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    margin-bottom: 1.5rem;
}

.links-tab .link-section h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 1rem 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #374151;
}

.links-tab .guidelines-section {
    background: #fef3c7;
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid #f59e0b;
    margin-bottom: 1.5rem;
}

.links-tab .guidelines-section h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 1rem 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #92400e;
}

.links-tab .guidelines-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.links-tab .guidelines-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #374151;
}

.links-tab .link-description {
    margin-top: 0.75rem;
    font-size: 0.9rem;
    color: #64748b;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    line-height: 1.5;
}

/* Enhanced Referrals Tab Styles */

/* Referrals Header */
.referrals-tab .stats-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e5e7eb;
}

.referrals-tab .stats-title-section h2 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0 0 0.5rem 0;
    font-size: 1.875rem;
    font-weight: 700;
    color: #1e293b;
}

.referrals-tab .stats-title-section h2 ion-icon {
    color: #10b981;
    font-size: 2rem;
}

.referrals-tab .stats-subtitle {
    margin: 0;
    color: #64748b;
    font-size: 1rem;
}

/* Enhanced Payouts Tab Styles */

/* Payouts Header */
.payouts-tab .stats-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e5e7eb;
}

.payouts-tab .stats-title-section h2 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0 0 0.5rem 0;
    font-size: 1.875rem;
    font-weight: 700;
    color: #1e293b;
}

.payouts-tab .stats-title-section h2 ion-icon {
    color: #f59e0b;
    font-size: 2rem;
}

.payouts-tab .stats-subtitle {
    margin: 0;
    color: #64748b;
    font-size: 1rem;
}

/* Enhanced Profile Tab Styles */

/* Profile Header */
.profile-tab .stats-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e5e7eb;
}

.profile-tab .stats-title-section h2 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0 0 0.5rem 0;
    font-size: 1.875rem;
    font-weight: 700;
    color: #1e293b;
}

.profile-tab .stats-title-section h2 ion-icon {
    color: var(--di-primary, #2563EB);
    font-size: 2rem;
}

.profile-tab .stats-subtitle {
    margin: 0;
    color: #64748b;
    font-size: 1rem;
}

/* Enhanced Overview Tab Styles */

/* Overview Header */
.overview-tab .stats-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e5e7eb;
}

.overview-tab .stats-title-section h2 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0 0 0.5rem 0;
    font-size: 1.875rem;
    font-weight: 700;
    color: #1e293b;
}

.overview-tab .stats-title-section h2 ion-icon {
    color: var(--di-primary, #2563EB);
    font-size: 2rem;
}

.overview-tab .stats-subtitle {
    margin: 0;
    color: #64748b;
    font-size: 1rem;
}

/* Enhanced Status Display Styles */
.dimi-affiliate-status-container {
    max-width: 1000px;
    margin: 2rem auto;
    padding: 0 1rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.status-header {
    display: flex;
    align-items: center;
    padding: 2rem;
    border-radius: 12px 12px 0 0;
    margin-bottom: 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.status-header.pending {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
}

.status-header.rejected {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
}

.status-header.suspended {
    background: linear-gradient(135deg, var(--di-primary, #2563EB) 0%, var(--di-primary, #2563EB) 100%);
    color: white;
}

.status-icon {
    font-size: 3rem;
    margin-right: 1.5rem;
    opacity: 0.9;
}

.status-content h2 {
    margin: 0 0 0.5rem 0;
    font-size: 1.8rem;
    font-weight: 600;
}

.status-subtitle {
    margin: 0;
    opacity: 0.9;
    font-size: 1.1rem;
}

.status-body {
    background: white;
    border-radius: 0 0 12px 12px;
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.status-card {
    background: linear-gradient(135deg, #ffffff 0%, #fafbfc 100%);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid #e9ecef;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
}

.status-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--di-primary, #2563EB) 0%, var(--di-primary, #2563EB) 50%, #f093fb 100%);
}

.status-card h3 {
    margin-top: 0;
    margin-bottom: 2rem;
    color: #2c3e50;
    font-size: 1.4rem;
    font-weight: 700;
    position: relative;
    padding-bottom: 0.75rem;
}

.status-card h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--di-primary, #2563EB), var(--di-primary, #2563EB));
    border-radius: 2px;
}

/* Application Steps Timeline 
 * Use .application-step for application status steps (e.g., "Application Under Review")
 * This prevents conflicts with modal/form .step classes used elsewhere
 */
.steps-timeline {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0;
    margin: 1.5rem 0;
}

/* Timeline connector line */
.steps-timeline::before {
    content: '';
    position: absolute;
    left: 24px;
    top: 50px;
    bottom: 50px;
    width: 2px;
    background: linear-gradient(to bottom, #28a745 0%, #28a745 33%, #ffc107 33%, #ffc107 66%, #dee2e6 66%, #dee2e6 100%);
    z-index: 1;
}

.application-step {
    position: relative;
    display: flex;
    align-items: flex-start;
    padding: 1.5rem 1.5rem 1.5rem 4rem;
    margin-bottom: 1rem;
    border-radius: 12px;
    transition: all 0.3s ease;
    background: white;
    border: 1px solid transparent;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    z-index: 2;
}

.application-step:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.application-step.completed {
    background: linear-gradient(135deg, #f8fffe 0%, #e8f5e8 100%);
    border-color: #28a745;
    border-left: 5px solid #28a745;
}

.application-step.active {
    background: linear-gradient(135deg, #fffdf7 0%, #fff8e1 100%);
    border-color: #ffc107;
    border-left: 5px solid #ffc107;
    box-shadow: 0 4px 20px rgba(255, 193, 7, 0.15);
}

.application-step:not(.completed):not(.active) {
    background: linear-gradient(135deg, #fafafa 0%, #f5f5f5 100%);
    border-color: #dee2e6;
    border-left: 5px solid #dee2e6;
}

.application-step-icon {
    position: absolute;
    left: -24px;
    top: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    border: 3px solid white;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.15);
    z-index: 3;
    transition: all 0.3s ease;
}

.application-step.completed .application-step-icon {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.application-step.active .application-step-icon {
    background: linear-gradient(135deg, #ffc107 0%, #ffca2c 100%);
    color: #212529;
    animation: pulse 2s infinite;
}

.application-step:not(.completed):not(.active) .application-step-icon {
    background: linear-gradient(135deg, #dee2e6 0%, #ced4da 100%);
    color: #6c757d;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.application-step-content {
    flex: 1;
    padding-left: 0;
}

.application-step-content h4 {
    margin: 0 0 0.75rem 0;
    color: #2c3e50;
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.3;
}

.application-step.completed .application-step-content h4 {
    color: #155724;
}

.application-step.active .application-step-content h4 {
    color: #856404;
}

.application-step-content p {
    margin: 0;
    color: #6c757d;
    line-height: 1.6;
    font-size: 0.95rem;
}

.application-step.completed .application-step-content p {
    color: #155724;
}

.application-step.active .application-step-content p {
    color: #856404;
}

/* Action List */
.action-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.action-item {
    display: flex;
    align-items: flex-start;
    padding: 1.5rem;
    background: white;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.action-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.action-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--di-primary, #2563EB);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    flex-shrink: 0;
    font-size: 1.2rem;
}

.action-content h4 {
    margin: 0 0 0.5rem 0;
    color: #2c3e50;
    font-size: 1.1rem;
}

.action-content p {
    margin: 0 0 1rem 0;
    color: #6c757d;
    line-height: 1.5;
}

.action-button {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--di-primary, #2563EB);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.action-button:hover {
    background: var(--di-primary, #2563EB);
    text-decoration: none;
    color: white;
}

.action-button.secondary {
    background: #95a5a6;
}

.action-button.secondary:hover {
    background: #7f8c8d;
}

/* Info Grid */
.status-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.info-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.info-card h4 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: #2c3e50;
    font-size: 1.1rem;
    font-weight: 600;
}

.info-card p {
    margin: 0;
    color: #6c757d;
    line-height: 1.5;
}

.info-card ul {
    margin: 0;
    padding-left: 1.2rem;
    color: #6c757d;
}

.info-card li {
    margin-bottom: 0.5rem;
}

.info-card small {
    color: #95a5a6;
    font-size: 0.85rem;
}

/* Suspension Details */
.suspension-details {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: white;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.detail-label {
    font-weight: 600;
    color: #2c3e50;
}

.detail-value {
    color: #6c757d;
}

.detail-value.suspended {
    color: #e74c3c;
    font-weight: 600;
}

/* Status Actions & Notes */
.status-actions {
    text-align: center;
    margin-top: 2rem;
}

.status-note {
    background: #e8f4f8;
    border: 1px solid #bee5eb;
    border-radius: 6px;
    padding: 1rem;
    margin-top: 1.5rem;
}

.status-note p {
    margin: 0;
    color: #0c5460;
    line-height: 1.6;
}

.status-note strong {
    color: #004085;
}

/* Mobile Responsive Styles for Application Steps */
@media (max-width: 768px) {
    .steps-timeline::before {
        left: 20px;
    }
    
    .application-step {
        padding: 1.25rem 1rem 1.25rem 3.5rem;
        margin-bottom: 0.75rem;
    }
    
    .application-step-icon {
        left: -20px;
        top: 20px;
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .application-step-content h4 {
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
    }
    
    .application-step-content p {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .steps-timeline::before {
        left: 16px;
    }
    
    .application-step {
        padding: 1rem 0.75rem 1rem 3rem;
    }
    
    .application-step-icon {
        left: -16px;
        top: 16px;
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .application-step-content h4 {
        font-size: 1rem;
    }
    
    .application-step-content p {
        font-size: 0.85rem;
    }
}

/* OLD RESPONSIVE DESIGN FOR STATUS PAGES - COMMENTED OUT FOR NEW SIDEBAR LAYOUT */
/*
@media (max-width: 768px) {
    .dimi-affiliate-status-container {
        margin: 1rem auto;
        padding: 0 0.5rem;
    }
    
    .status-header {
        flex-direction: column;
        text-align: center;
        padding: 1.5rem;
    }
    
    .status-icon {
        margin-right: 0;
        margin-bottom: 1rem;
    }
    
    .status-body {
        padding: 1.5rem;
    }
    
    .action-item {
        flex-direction: column;
        text-align: center;
    }
    
    .action-icon {
        margin-right: 0;
        margin-bottom: 1rem;
    }
    
    .status-info-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .steps-timeline {
        gap: 0.5rem;
    }
    
    .application-step {
        padding: 0.75rem;
    }
}
*/

/* ========================================
   CUSTOM LOGIN FORM STYLES
   ======================================== */

.dimi-affiliate-login-container {
    max-width: 450px;
    margin: 2rem auto;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    border: 1px solid #e9ecef;
}

.login-header {
    background: var(--di-primary, #2563EB);
    color: white;
    padding: 40px 30px;
    text-align: center;
    position: relative;
}

.login-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="2" fill="rgba(255,255,255,0.1)"/><circle cx="80" cy="80" r="2" fill="rgba(255,255,255,0.1)"/><circle cx="40" cy="60" r="1" fill="rgba(255,255,255,0.1)"/></svg>');
    pointer-events: none;
}

.login-header .login-icon {
    font-size: 48px;
    margin-bottom: 20px;
    opacity: 0.9;
}

.login-header h2 {
    margin: 0 0 12px 0;
    font-size: 28px;
    font-weight: 600;
    color: #fff;
}

.login-header p {
    margin: 0;
    font-size: 16px;
    opacity: 0.9;
    line-height: 1.4;
    color: #fff;
}

.dimi-affiliate-login-form {
    padding: 40px 30px;
}

.login-error-notice {
    display: flex;
    align-items: flex-start;
    padding: 15px 20px;
    margin: 0 30px 20px 30px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    border-radius: 8px;
    color: white;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
    border-left: 4px solid #c0392b;
}

.login-error-notice .error-icon {
    margin-right: 15px;
    font-size: 20px;
    color: #fff;
    opacity: 0.9;
    margin-top: 2px;
}

.login-error-notice .error-content p {
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
    color: #fff;
    opacity: 0.95;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

.form-group label i {
    margin-right: 8px;
    width: 16px;
    text-align: center;
    color: var(--di-primary, #2563EB);
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group input[type="url"],
.form-group input[type="tel"],
.form-group input[type="number"],
.form-group input[type="search"],
.form-group input[type="date"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.6875rem 0.875rem;
    border: 1px solid var(--di-border, #E2E8F0);
    border-radius: 10px;
    font-size: 0.9375rem;
    line-height: 1.4;
    background: var(--di-surface, #FFFFFF);
    color: var(--di-text, #0F172A);
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02);
    transition: border-color 150ms ease-out, box-shadow 150ms ease-out;
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--di-text-subtle, #64748B);
    opacity: 1;
}

.form-group input:hover,
.form-group textarea:hover,
.form-group select:hover {
    border-color: var(--di-border-strong, #CBD5E1);
}

.form-group input[type="text"]:focus,
.form-group input[type="password"]:focus,
.form-group input[type="email"]:focus,
.form-group input[type="url"]:focus,
.form-group input[type="tel"]:focus,
.form-group input[type="number"]:focus,
.form-group input[type="search"]:focus,
.form-group input[type="date"]:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--di-primary, #2563EB);
    box-shadow: 0 0 0 3px var(--di-primary-soft, rgba(37, 99, 235, 0.12));
}

.form-group input:disabled,
.form-group textarea:disabled,
.form-group select:disabled {
    background: var(--di-surface-alt, #F1F5F9);
    color: var(--di-text-subtle, #64748B);
    cursor: not-allowed;
}

.password-field {
    position: relative;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: color 0.3s ease;
}

.toggle-password:hover {
    color: var(--di-primary, #2563EB);
}

.checkbox-group {
    margin: 20px 0;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: #495057;
    margin-bottom: 0 !important;
    position: relative;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.custom-checkbox {
    position: relative;
    width: 20px;
    height: 20px;
    border: 2px solid #dee2e6;
    border-radius: 4px;
    background: #fff;
    margin-right: 12px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.custom-checkbox i {
    color: white;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.checkbox-label:hover .custom-checkbox {
    border-color: var(--di-primary, #2563EB);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--di-primary, #2563EB) 10%, transparent);
}

.checkbox-label input[type="checkbox"]:checked + .custom-checkbox {
    background: var(--di-primary, #2563EB);
    border-color: var(--di-primary, #2563EB);
}

.checkbox-label input[type="checkbox"]:checked + .custom-checkbox i {
    opacity: 1;
}

.checkbox-label input[type="checkbox"]:focus + .custom-checkbox {
    outline: none;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--di-primary, #2563EB) 25%, transparent);
}

.checkbox-text {
    font-weight: 500;
    color: #495057;
    transition: color 0.3s ease;
}

.checkbox-label:hover .checkbox-text {
    color: var(--di-primary, #2563EB);
}

.login-submit-btn {
    width: 100%;
    padding: 14px 20px;
    background: var(--di-primary, #2563EB);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.login-submit-btn:hover {
    background: linear-gradient(135deg, var(--di-primary-hover, #1D4ED8) 0%, var(--di-primary, #2563EB) 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px color-mix(in srgb, var(--di-primary, #2563EB) 30%, transparent);
}

.login-submit-btn:active {
    transform: translateY(0);
}

.login-links {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.forgot-password-link,
.register-link {
    color: var(--di-primary, #2563EB);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.3s ease;
}

.forgot-password-link:hover,
.register-link:hover {
    color: var(--di-primary-hover, #1D4ED8);
    text-decoration: underline;
}


/* ========================================
   Forgot Password Form Styles
   ======================================== */

.dimi-affiliate-forgot-password-form {
    padding: 40px 30px;
    animation: fadeIn 0.3s ease-in-out;
}

.forgot-password-header {
    text-align: center;
    margin-bottom: 30px;
}

/* .forgot-password-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--di-primary, #2563EB);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px auto;
    color: white;
    font-size: 36px;
} */

.forgot-password-header h3 {
    margin: 0 0 10px 0;
    color: #2c3e50;
    font-size: 24px;
    font-weight: 700;
}

.forgot-password-header p {
    margin: 0;
    color: #6c757d;
    font-size: 14px;
    line-height: 1.5;
}

/* Use same form-group spacing as login form */
.dimi-affiliate-forgot-password-form .form-group {
    margin-bottom: 25px;
}

.forgot-password-submit-btn {
    width: 100%;
    padding: 14px 20px;
    background: var(--di-primary, #2563EB);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.forgot-password-submit-btn:hover {
    background: linear-gradient(135deg, var(--di-primary, #2563EB) 0%, var(--di-primary, #2563EB) 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px color-mix(in srgb, var(--di-primary, #2563EB) 40%, transparent);
}

.forgot-password-submit-btn:active {
    transform: translateY(0);
}

.forgot-password-submit-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.forgot-password-links {
    margin-top: 25px;
    text-align: center;
}

.back-to-login-link {
    color: var(--di-primary, #2563EB);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color 0.3s ease;
}

.back-to-login-link:hover {
    color: var(--di-primary, #2563EB);
    text-decoration: none;
}

.login-success-notice {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border-radius: 8px;
    padding: 15px 20px;
    margin: 0 30px 20px 30px;
    display: flex;
    align-items: flex-start;
    gap: 15px;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
    border-left: 4px solid #1e7e34;
    animation: slideInDown 0.5s ease-out;
}

.success-icon {
    font-size: 20px;
    color: white;
    margin-top: 2px;
}

.success-content p {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    opacity: 0.95;
}

/* Animation for success message */
@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animation for form transitions */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Styles for New Sidebar Layout */
@media (max-width: 1024px) {
    .dimi-affiliate-dashboard-container {
        flex-direction: column;
    }
    
    .dashboard-sidebar {
        width: 100%;
        flex-direction: row;
        height: auto;
    }
    
    .sidebar-header {
        flex-shrink: 0;
    }
    
    .sidebar-content {
        flex: 1;
    }
    
    .sidebar-footer {
        flex-shrink: 0;
    }
    
    .nav-tabs {
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        gap: 0.5rem;
        padding: 0.5rem 1rem;
    }
    
    .nav-item {
        flex-shrink: 0;
    }
    
    .nav-link {
        white-space: nowrap;
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
}

/* ========================================
   ENHANCED PROFILE FORM STYLES
   ======================================== */

/* Two-column profile layout: Profile Info (left, sticky) + Payment
   Information (right, scrolls). Min sidebar width 320px keeps the
   profile field grid readable; the right column flexes to fill. */
.profile-tab__layout {
    display: grid;
    grid-template-columns: minmax(0, 360px) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
    margin-top: 1.5rem;
}

.profile-tab__layout .profile-tab__profile {
    position: sticky;
    top: 16px;
    align-self: start;
}

.profile-tab__layout .profile-tab__payment {
    min-width: 0; /* lets long URLs / IBANs inside the payment cards
                     wrap instead of forcing horizontal scroll */
}
.profile-tab__layout .profile-tab__payment-title {
    padding-top: 0;
    margin-top: 0;
}

/* Below 1080px the second column gets cramped — sidebar (~280px) +
   two columns of profile content can no longer share the row
   comfortably. Collapse to single-column stack and drop the sticky
   positioning. Bumped from 960px after a user reported the right
   column being squished on a tablet-width browser. */
@media (max-width: 1080px) {
    .profile-tab__layout {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .profile-tab__layout .profile-tab__profile {
        position: static;
        top: auto;
    }
}

/* ════════════════════════════════════════════════════════════════════
   PROFILE CARD — refined identity-hero design (v1.10.x)
   Three zones (hero / highlights / meta) replace the old label-above-
   value field grid. Tighter rhythm, clearer hierarchy, key fields
   (affiliate code + commission rate) get pill treatment.
   ════════════════════════════════════════════════════════════════════ */
.dimi-affiliate-dashboard-container .profile-card {
    background: var(--di-surface, #FFFFFF);
    border: 1px solid var(--di-border, #E2E8F0);
    border-radius: 14px;
    padding: 22px 22px 18px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

/* ---- Zone 1: identity hero ---- */
.dimi-affiliate-dashboard-container .profile-card__hero {
    display: grid;
    grid-template-columns: 48px 1fr auto;
    gap: 12px;
    align-items: center;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--di-border, #E2E8F0);
    margin: 0;
}
.dimi-affiliate-dashboard-container .profile-card__avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--di-primary, #2563EB) 12%, transparent);
    color: var(--di-primary, #2563EB);
    font-weight: 700;
    font-size: 1.0625rem;
    letter-spacing: 0.02em;
    flex-shrink: 0;
    user-select: none;
}
.dimi-affiliate-dashboard-container .profile-card__identity {
    min-width: 0;
}
.dimi-affiliate-dashboard-container .profile-card__name {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--di-text, #0F172A);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dimi-affiliate-dashboard-container .profile-card__email {
    margin: 2px 0 0;
    font-size: 0.8125rem;
    color: var(--di-text-muted, #475569);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dimi-affiliate-dashboard-container .profile-card__edit-btn {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--di-border, #E2E8F0);
    border-radius: 8px;
    color: var(--di-text-muted, #475569);
    cursor: pointer;
    transition: background 150ms ease-out, color 150ms ease-out, border-color 150ms ease-out;
    padding: 0;
}
.dimi-affiliate-dashboard-container .profile-card__edit-btn:hover {
    background: var(--di-surface-alt, #F1F5F9);
    color: var(--di-primary, #2563EB);
    border-color: color-mix(in srgb, var(--di-primary, #2563EB) 35%, var(--di-border, #E2E8F0));
}
.dimi-affiliate-dashboard-container .profile-card__edit-btn .di-icon {
    width: 15px;
    height: 15px;
}

/* ---- Zone 2: highlight pills ---- */
.dimi-affiliate-dashboard-container .profile-card__highlights {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 10px;
    padding: 14px 0;
    border-bottom: 1px solid var(--di-border, #E2E8F0);
}
.dimi-affiliate-dashboard-container .profile-card__highlight {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 12px;
    background: var(--di-surface-alt, #F8FAFC);
    border: 1px solid var(--di-border, #E2E8F0);
    border-radius: 10px;
    min-width: 0;
}
.dimi-affiliate-dashboard-container .profile-card__highlight--accent {
    background: color-mix(in srgb, var(--di-primary, #2563EB) 6%, var(--di-surface, #FFFFFF));
    border-color: color-mix(in srgb, var(--di-primary, #2563EB) 22%, var(--di-border, #E2E8F0));
}
.dimi-affiliate-dashboard-container .profile-card__highlight-label {
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--di-text-muted, #475569);
}
.dimi-affiliate-dashboard-container .profile-card__highlight-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--di-text, #0F172A);
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dimi-affiliate-dashboard-container .profile-card__highlight--accent .profile-card__highlight-value {
    color: var(--di-primary, #2563EB);
    font-variant-numeric: tabular-nums;
}
.dimi-affiliate-dashboard-container .profile-card__code {
    display: inline-block;
    padding: 0;
    background: transparent;
    color: var(--di-text, #0F172A);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.9375rem;
    font-weight: 700;
}

/* ---- Zone 3: meta rows ---- */
.dimi-affiliate-dashboard-container .profile-card__meta {
    margin: 0;
    padding: 14px 0 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.dimi-affiliate-dashboard-container .profile-card__row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    margin: 0;
}
.dimi-affiliate-dashboard-container .profile-card__row dt {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--di-text-muted, #475569);
    flex-shrink: 0;
}
.dimi-affiliate-dashboard-container .profile-card__row dd {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--di-text, #0F172A);
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}
/* Address tends to be longer — let it wrap on its own line below
   the label rather than ellipsis-truncating. */
.dimi-affiliate-dashboard-container .profile-card__row--stack {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}
.dimi-affiliate-dashboard-container .profile-card__row--stack dd {
    text-align: left;
    white-space: normal;
    word-break: break-word;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.45;
}

@media (max-width: 480px) {
    .dimi-affiliate-dashboard-container .profile-card {
        padding: 18px 16px 14px;
        border-radius: 12px;
    }
    .dimi-affiliate-dashboard-container .profile-card__highlights {
        grid-template-columns: 1fr;
    }
}

/* ════════════════════════════════════════════════════════════════════
   EDIT PROFILE MODAL — refined form layout (v1.10.x)
   Scoped under #edit-profile-modal so it wins against the older,
   broader .modal-overlay / form-control / btn rules in this file.
   ════════════════════════════════════════════════════════════════════ */
#edit-profile-modal .modal-content {
    max-width: 620px;
}
#edit-profile-modal .modal-header h4 {
    margin: 0;
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--di-text, #0F172A);
}

#edit-profile-modal .edit-profile-form__lede {
    margin: 0 0 18px;
    font-size: 0.875rem;
    color: var(--di-text-muted, #475569);
}

/* Two-col grid for name + email on desktop; phone & address are
   full-width via .form-group--full. Below 560px everything stacks. */
#edit-profile-modal .edit-profile-form__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 16px;
}
#edit-profile-modal .edit-profile-form__grid .form-group--full {
    grid-column: 1 / -1;
}
#edit-profile-modal .edit-profile-form__grid .form-group {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

#edit-profile-modal label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--di-text, #0F172A);
    margin: 0;
}
#edit-profile-modal .required-marker {
    color: var(--di-danger, #DC2626);
    font-weight: 400;
}

/* "Locked" pill next to the email label — makes the disabled state
   visually unambiguous without relying on the muted-input alone. */
#edit-profile-modal .locked-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: var(--di-surface-alt, #F1F5F9);
    border: 1px solid var(--di-border, #E2E8F0);
    border-radius: 999px;
    font-size: 0.625rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--di-text-muted, #475569);
    cursor: help;
}
#edit-profile-modal .locked-pill .di-icon {
    width: 10px;
    height: 10px;
}

#edit-profile-modal .form-control {
    width: 100%;
    padding: 10px 12px !important;
    background: var(--di-surface, #FFFFFF) !important;
    border: 1px solid var(--di-border, #E2E8F0) !important;
    border-radius: 8px !important;
    color: var(--di-text, #0F172A) !important;
    font-family: inherit !important;
    font-size: 0.875rem !important;
    line-height: 1.4;
    box-sizing: border-box;
    transition: border-color 150ms ease-out, box-shadow 150ms ease-out, background 150ms ease-out;
}
#edit-profile-modal .form-control:hover {
    border-color: var(--di-border-strong, #CBD5E1) !important;
}
#edit-profile-modal .form-control:focus {
    outline: 0 !important;
    border-color: var(--di-primary, #2563EB) !important;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--di-primary, #2563EB) 16%, transparent) !important;
}
#edit-profile-modal .form-control::placeholder {
    color: var(--di-text-subtle, #94A3B8);
}

/* Locked input variant — muted background + subtle stripe pattern
   so the read-only state reads even without focusing the field. */
#edit-profile-modal .form-control--locked,
#edit-profile-modal .form-control[disabled] {
    background: var(--di-surface-alt, #F1F5F9) !important;
    color: var(--di-text-muted, #475569) !important;
    cursor: not-allowed;
}

#edit-profile-modal .edit-profile-form__textarea {
    min-height: 84px;
    resize: vertical;
    font-family: inherit !important;
}

#edit-profile-modal .form-text {
    margin: 0;
    font-size: 0.75rem;
    color: var(--di-text-muted, #475569);
    line-height: 1.4;
}

/* Footer — Cancel as ghost (text-only), primary action right.
   Aligns visual weight with the modal's purpose: "Save changes"
   is the affirmative action and gets the brand color. */
#edit-profile-modal .modal-footer--split {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
}
#edit-profile-modal .btn-ghost {
    background: transparent !important;
    border: 0 !important;
    color: var(--di-text-muted, #475569) !important;
    padding: 9px 14px !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    border-radius: 8px !important;
    cursor: pointer;
    transition: background 150ms ease-out, color 150ms ease-out;
}
#edit-profile-modal .btn-ghost:hover {
    background: var(--di-surface-alt, #F1F5F9) !important;
    color: var(--di-text, #0F172A) !important;
}
#edit-profile-modal .btn-primary {
    background: var(--di-primary, #2563EB) !important;
    color: #fff !important;
    border: 1px solid var(--di-primary, #2563EB) !important;
    padding: 9px 18px !important;
    font-size: 0.875rem !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: filter 150ms ease-out, box-shadow 150ms ease-out;
}
#edit-profile-modal .btn-primary:hover {
    filter: brightness(0.95);
    box-shadow: 0 4px 10px -4px color-mix(in srgb, var(--di-primary, #2563EB) 55%, transparent);
}
#edit-profile-modal .btn-primary .di-icon {
    width: 14px;
    height: 14px;
}

@media (max-width: 560px) {
    #edit-profile-modal .edit-profile-form__grid {
        grid-template-columns: 1fr;
    }
    #edit-profile-modal .modal-footer--split {
        flex-direction: column-reverse;
        align-items: stretch;
    }
    #edit-profile-modal .modal-footer--split .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ════════════════════════════════════════════════════════════════════
   AFFILIATE LINKS TAB — refined hierarchy (v1.10.x)
   Three zones with distinct visual weight:
     1. Hero card        — primary tool, brand-tinted background
     2. Generator card   — neutral surface, structured form
     3. Guidelines       — collapsible aside (subtle)
   ════════════════════════════════════════════════════════════════════ */

/* ---- Zone 1: hero main-link card ---- */
.dimi-affiliate-dashboard-container .affiliate-link-hero {
    background:
        radial-gradient(circle at 0% 0%, color-mix(in srgb, var(--di-primary, #2563EB) 14%, transparent), transparent 55%),
        linear-gradient(180deg, var(--di-surface, #FFFFFF) 0%, color-mix(in srgb, var(--di-primary, #2563EB) 4%, var(--di-surface, #FFFFFF)) 100%);
    border: 1px solid color-mix(in srgb, var(--di-primary, #2563EB) 22%, var(--di-border, #E2E8F0));
    border-radius: 14px;
    padding: 20px 22px;
    margin: 0 0 18px;
    position: relative;
    overflow: hidden;
}
.dimi-affiliate-dashboard-container .affiliate-link-hero__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}
.dimi-affiliate-dashboard-container .affiliate-link-hero__title-wrap {
    min-width: 0;
}
.dimi-affiliate-dashboard-container .affiliate-link-hero__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: color-mix(in srgb, var(--di-primary, #2563EB) 14%, transparent);
    border: 1px solid color-mix(in srgb, var(--di-primary, #2563EB) 28%, transparent);
    color: var(--di-primary, #2563EB);
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 8px;
}
.dimi-affiliate-dashboard-container .affiliate-link-hero__eyebrow .di-icon {
    width: 11px;
    height: 11px;
}
.dimi-affiliate-dashboard-container .affiliate-link-hero__hint {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--di-text-muted, #475569);
    line-height: 1.45;
}
.dimi-affiliate-dashboard-container .affiliate-link-hero__url-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}
.dimi-affiliate-dashboard-container .affiliate-link-hero__url {
    flex: 1;
    min-width: 0;
    padding: 11px 14px !important;
    background: var(--di-surface, #FFFFFF) !important;
    border: 1px solid var(--di-border, #E2E8F0) !important;
    border-radius: 10px !important;
    color: var(--di-text, #0F172A) !important;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace !important;
    font-size: 0.875rem !important;
    line-height: 1.4;
}
.dimi-affiliate-dashboard-container .affiliate-link-hero__url:focus {
    outline: 0 !important;
    border-color: var(--di-primary, #2563EB) !important;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--di-primary, #2563EB) 16%, transparent) !important;
}
.dimi-affiliate-dashboard-container .affiliate-link-hero__copy {
    flex-shrink: 0;
    padding: 10px 18px !important;
    background: var(--di-primary, #2563EB) !important;
    color: #fff !important;
    border: 0 !important;
    border-radius: 10px !important;
    font-size: 0.875rem !important;
    font-weight: 600 !important;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    transition: filter 150ms ease-out, box-shadow 150ms ease-out;
    box-shadow: 0 4px 10px -4px color-mix(in srgb, var(--di-primary, #2563EB) 55%, transparent);
}
.dimi-affiliate-dashboard-container .affiliate-link-hero__copy:hover {
    filter: brightness(0.95);
}
.dimi-affiliate-dashboard-container .affiliate-link-hero__copy .di-icon {
    width: 14px;
    height: 14px;
}

/* ---- Zone 2: generator card ---- */
.dimi-affiliate-dashboard-container .link-generator-card {
    background: var(--di-surface, #FFFFFF);
    border: 1px solid var(--di-border, #E2E8F0);
    border-radius: 14px;
    padding: 20px 22px;
    margin: 0 0 18px;
}
.dimi-affiliate-dashboard-container .link-generator-card__head {
    margin-bottom: 16px;
}
.dimi-affiliate-dashboard-container .link-generator-card__title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 4px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--di-text, #0F172A);
}
.dimi-affiliate-dashboard-container .link-generator-card__title .di-icon {
    color: var(--di-primary, #2563EB);
}
.dimi-affiliate-dashboard-container .link-generator-card__subtitle {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--di-text-muted, #475569);
    line-height: 1.45;
}
.dimi-affiliate-dashboard-container .link-generator-card .link-generator-form {
    margin: 0;
}
.dimi-affiliate-dashboard-container .link-generator-card .link-generator-form .form-group {
    margin-bottom: 14px;
}
.dimi-affiliate-dashboard-container .link-generator-card .link-generator-form label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--di-text, #0F172A);
    margin-bottom: 6px;
}
.dimi-affiliate-dashboard-container .link-generator-card .link-generator-form label .di-icon {
    color: var(--di-text-muted, #475569);
}
.dimi-affiliate-dashboard-container .link-generator-card #product-url {
    width: 100%;
    padding: 10px 14px !important;
    background: var(--di-surface, #FFFFFF) !important;
    border: 1px solid var(--di-border, #E2E8F0) !important;
    border-radius: 10px !important;
    color: var(--di-text, #0F172A) !important;
    font-size: 0.875rem !important;
    line-height: 1.4;
    font-family: inherit !important;
    box-sizing: border-box;
    transition: border-color 150ms ease-out, box-shadow 150ms ease-out;
}
.dimi-affiliate-dashboard-container .link-generator-card #product-url:focus {
    outline: 0 !important;
    border-color: var(--di-primary, #2563EB) !important;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--di-primary, #2563EB) 16%, transparent) !important;
}

/* Generate button sits inline at the form-bottom — auto-width,
   right-aligned with the form via flex container. */
.dimi-affiliate-dashboard-container .link-generator-card .link-generator-form > .form-group:last-of-type {
    margin-bottom: 0;
    display: flex;
    justify-content: flex-end;
}
.dimi-affiliate-dashboard-container .link-generator-card .btn-primary {
    padding: 10px 20px !important;
    background: var(--di-primary, #2563EB) !important;
    color: #fff !important;
    border: 1px solid var(--di-primary, #2563EB) !important;
    border-radius: 10px !important;
    font-size: 0.875rem !important;
    font-weight: 600 !important;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: filter 150ms ease-out, box-shadow 150ms ease-out;
    box-shadow: 0 4px 10px -4px color-mix(in srgb, var(--di-primary, #2563EB) 55%, transparent);
}
.dimi-affiliate-dashboard-container .link-generator-card .btn-primary:hover {
    filter: brightness(0.95);
}
.dimi-affiliate-dashboard-container .link-generator-card .btn-primary .di-icon {
    width: 14px;
    height: 14px;
}

/* Generated-link result section — separated from form by a hairline,
   inherits the .affiliate-link-hero__url-row layout for consistency. */
.dimi-affiliate-dashboard-container .generated-link-section {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px dashed var(--di-border, #E2E8F0);
}
.dimi-affiliate-dashboard-container .generated-link-section__label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 8px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--di-text, #0F172A);
}
.dimi-affiliate-dashboard-container .generated-link-section__check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: color-mix(in srgb, var(--di-success, #10B981) 14%, transparent);
    color: var(--di-success, #10B981);
    border-radius: 50%;
}
.dimi-affiliate-dashboard-container .generated-link-section__check .di-icon {
    width: 11px;
    height: 11px;
}

/* ---- Zone 3: collapsible guidelines aside ---- */
.dimi-affiliate-dashboard-container .links-guidelines {
    background: var(--di-surface-alt, #F8FAFC);
    border: 1px solid var(--di-border, #E2E8F0);
    border-radius: 10px;
    margin: 0;
    overflow: hidden;
}
.dimi-affiliate-dashboard-container .links-guidelines__summary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    cursor: pointer;
    list-style: none;
    user-select: none;
    color: var(--di-text-muted, #475569);
    font-size: 0.8125rem;
    font-weight: 600;
}
.dimi-affiliate-dashboard-container .links-guidelines__summary::-webkit-details-marker { display: none; }
.dimi-affiliate-dashboard-container .links-guidelines__summary::after {
    content: "▾";
    margin-left: auto;
    font-size: 0.75rem;
    transition: transform 150ms ease-out;
}
.dimi-affiliate-dashboard-container .links-guidelines[open] .links-guidelines__summary::after {
    transform: rotate(180deg);
}
.dimi-affiliate-dashboard-container .links-guidelines__summary .di-icon {
    color: var(--di-success, #10B981);
}
.dimi-affiliate-dashboard-container .links-guidelines__summary small {
    font-weight: 400;
    color: var(--di-text-subtle, #94A3B8);
    font-size: 0.75rem;
}
.dimi-affiliate-dashboard-container .links-guidelines__list {
    margin: 0;
    padding: 4px 16px 14px 32px;
    border-top: 1px solid var(--di-border, #E2E8F0);
    background: var(--di-surface, #FFFFFF);
    font-size: 0.8125rem;
    color: var(--di-text-muted, #475569);
    line-height: 1.5;
}
.dimi-affiliate-dashboard-container .links-guidelines__list li {
    margin: 6px 0;
    padding-left: 0;
    list-style: disc;
}
.dimi-affiliate-dashboard-container .links-guidelines__list li::marker {
    color: var(--di-text-subtle, #94A3B8);
}

@media (max-width: 600px) {
    .dimi-affiliate-dashboard-container .affiliate-link-hero,
    .dimi-affiliate-dashboard-container .link-generator-card {
        padding: 16px;
        border-radius: 12px;
    }
    .dimi-affiliate-dashboard-container .affiliate-link-hero__url-row {
        flex-direction: column;
    }
    .dimi-affiliate-dashboard-container .affiliate-link-hero__copy {
        justify-content: center;
    }
    .dimi-affiliate-dashboard-container .link-generator-card .link-generator-form > .form-group:last-of-type {
        justify-content: stretch;
    }
    .dimi-affiliate-dashboard-container .link-generator-card .btn-primary {
        width: 100%;
        justify-content: center;
    }
}

/* ════════════════════════════════════════════════════════════════════
   OVERVIEW TAB — refined dashboard (v1.10.x)
   Unified KPI cards (was rainbow gradients), payout CTA promoted as
   a single highlighted strip, recent activity as clean list columns.
   ════════════════════════════════════════════════════════════════════ */

/* Friendly greeting accent — affiliate's name picks up the brand color. */
.dimi-affiliate-dashboard-container .overview-tab .tab-title__accent {
    color: var(--di-primary, #2563EB);
}

/* ---- KPI strip ---- */
/* Override the rainbow gradients defined earlier in this file with
   neutral unified cards. Single accent variant (--accent) for the
   one metric we want to draw the eye to (Unpaid earnings). */
.dimi-affiliate-dashboard-container .overview-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin: 0 0 18px;
}
.dimi-affiliate-dashboard-container .overview-kpi {
    background: var(--di-surface, #FFFFFF) !important;
    border: 1px solid var(--di-border, #E2E8F0) !important;
    border-radius: 12px !important;
    padding: 14px 16px !important;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: border-color 150ms ease-out, box-shadow 150ms ease-out;
    /* Override .stat-card-*'s old colored top border (still present
       via the original .stat-card rule chain) */
    box-shadow: none !important;
}
.dimi-affiliate-dashboard-container .overview-kpi::before {
    /* Nukes the old `.stat-card::before` colored top stripe. */
    display: none !important;
}
.dimi-affiliate-dashboard-container .overview-kpi:hover {
    border-color: color-mix(in srgb, var(--di-primary, #2563EB) 30%, var(--di-border, #E2E8F0)) !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05) !important;
}
.dimi-affiliate-dashboard-container .overview-kpi__icon {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--di-surface-alt, #F1F5F9);
    color: var(--di-text-muted, #475569);
    flex-shrink: 0;
}
.dimi-affiliate-dashboard-container .overview-kpi__icon .di-icon {
    width: 16px;
    height: 16px;
}
.dimi-affiliate-dashboard-container .overview-kpi__body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.dimi-affiliate-dashboard-container .overview-kpi__label {
    font-size: 0.6875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--di-text-muted, #475569);
}
.dimi-affiliate-dashboard-container .overview-kpi__value {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--di-text, #0F172A);
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}
/* Accent variant — Unpaid earnings (the one the affiliate cares
   about most). Subtle brand tint on icon + value to pull the eye. */
.dimi-affiliate-dashboard-container .overview-kpi--accent {
    background: color-mix(in srgb, var(--di-primary, #2563EB) 5%, var(--di-surface, #FFFFFF)) !important;
    border-color: color-mix(in srgb, var(--di-primary, #2563EB) 22%, var(--di-border, #E2E8F0)) !important;
}
.dimi-affiliate-dashboard-container .overview-kpi--accent .overview-kpi__icon {
    background: color-mix(in srgb, var(--di-primary, #2563EB) 14%, transparent);
    color: var(--di-primary, #2563EB);
}
.dimi-affiliate-dashboard-container .overview-kpi--accent .overview-kpi__value {
    color: var(--di-primary, #2563EB);
}

/* ---- Payout CTA strip ---- */
.dimi-affiliate-dashboard-container .overview-tab .overview-payout-cta {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background:
        linear-gradient(90deg, color-mix(in srgb, var(--di-success, #10B981) 6%, var(--di-surface, #FFFFFF)) 0%, var(--di-surface, #FFFFFF) 100%);
    border: 1px solid color-mix(in srgb, var(--di-success, #10B981) 25%, var(--di-border, #E2E8F0));
    border-radius: 12px;
    margin: 0 0 18px;
}
.dimi-affiliate-dashboard-container .overview-tab .overview-payout-cta__icon {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: color-mix(in srgb, var(--di-success, #10B981) 14%, transparent);
    color: var(--di-success, #10B981);
    flex-shrink: 0;
}
.dimi-affiliate-dashboard-container .overview-tab .overview-payout-cta__icon .di-icon {
    width: 18px;
    height: 18px;
}
.dimi-affiliate-dashboard-container .overview-tab .overview-payout-cta__body {
    flex: 1;
    min-width: 0;
}
.dimi-affiliate-dashboard-container .overview-tab .overview-payout-cta__title {
    margin: 0 0 2px;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--di-text, #0F172A);
}
.dimi-affiliate-dashboard-container .overview-tab .overview-payout-cta__copy {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--di-text-muted, #475569);
    line-height: 1.4;
}
.dimi-affiliate-dashboard-container .overview-tab .overview-payout-cta__copy strong {
    color: var(--di-text, #0F172A);
    font-weight: 600;
}
.dimi-affiliate-dashboard-container .overview-tab .overview-payout-cta__btn {
    flex-shrink: 0;
    padding: 9px 16px !important;
    background: var(--di-success, #10B981) !important;
    color: #fff !important;
    border: 0 !important;
    border-radius: 9px !important;
    font-size: 0.8125rem !important;
    font-weight: 600 !important;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    transition: filter 150ms ease-out;
}
.dimi-affiliate-dashboard-container .overview-tab .overview-payout-cta__btn:hover {
    filter: brightness(0.95);
}

/* ---- Recent activity columns ---- */
.dimi-affiliate-dashboard-container .overview-tab .overview-activity {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin: 0;
}
.dimi-affiliate-dashboard-container .overview-tab .overview-activity__col {
    background: var(--di-surface, #FFFFFF);
    border: 1px solid var(--di-border, #E2E8F0);
    border-radius: 12px;
    padding: 16px 18px;
}
.dimi-affiliate-dashboard-container .overview-tab .overview-activity__head {
    margin-bottom: 4px;
}
.dimi-affiliate-dashboard-container .overview-tab .overview-activity__title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--di-text, #0F172A);
}
.dimi-affiliate-dashboard-container .overview-tab .overview-activity__title .di-icon {
    color: var(--di-primary, #2563EB);
}

/* List rows inside the activity columns — keep the existing
   .summary-item structure (label-left, status-right) but tighten
   spacing + soften colors via tokens. */
.dimi-affiliate-dashboard-container .overview-tab .overview-activity__col .summary-item {
    padding: 10px 0;
    border-bottom: 1px solid var(--di-border, #E2E8F0);
}
.dimi-affiliate-dashboard-container .overview-tab .overview-activity__col .summary-item:last-child {
    border-bottom: 0;
}
.dimi-affiliate-dashboard-container .overview-tab .overview-activity__col .item-date {
    color: var(--di-text-muted, #475569);
    font-size: 0.75rem;
}
.dimi-affiliate-dashboard-container .overview-tab .overview-activity__col .item-amount {
    color: var(--di-text, #0F172A);
    font-size: 0.875rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.dimi-affiliate-dashboard-container .overview-tab .overview-activity__col .view-all-link {
    display: inline-block;
    margin-top: 12px;
    color: var(--di-primary, #2563EB);
    font-size: 0.8125rem;
    font-weight: 500;
    text-decoration: none;
}
.dimi-affiliate-dashboard-container .overview-tab .overview-activity__col .view-all-link:hover {
    text-decoration: underline;
}
.dimi-affiliate-dashboard-container .overview-tab .overview-activity__col .no-data {
    margin: 8px 0;
    padding: 16px 0;
    color: var(--di-text-muted, #475569);
    font-size: 0.8125rem;
    text-align: center;
}

@media (max-width: 720px) {
    .dimi-affiliate-dashboard-container .overview-tab .overview-activity {
        grid-template-columns: 1fr;
    }
    .dimi-affiliate-dashboard-container .overview-tab .overview-payout-cta {
        flex-wrap: wrap;
    }
    .dimi-affiliate-dashboard-container .overview-tab .overview-payout-cta__btn {
        width: 100%;
        justify-content: center;
    }
}

/* ════════════════════════════════════════════════════════════════════
   PAYOUTS TAB — unified balance hero + KPIs + history (v1.10.x)
   Replaced the prior green/pink dual-card split (looked like a
   marketing banner + error alert) with one balance card that
   conveys current balance, progress toward threshold, eligibility
   state, and primary action in a single block.
   ════════════════════════════════════════════════════════════════════ */

/* ---- Balance hero ---- */
.dimi-affiliate-dashboard-container .payouts-tab .payout-balance {
    background:
        radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--di-primary, #2563EB) 10%, transparent), transparent 55%),
        linear-gradient(180deg, var(--di-surface, #FFFFFF) 0%, color-mix(in srgb, var(--di-primary, #2563EB) 3%, var(--di-surface, #FFFFFF)) 100%);
    border: 1px solid color-mix(in srgb, var(--di-primary, #2563EB) 18%, var(--di-border, #E2E8F0));
    border-radius: 14px;
    padding: 20px 22px;
    margin: 0 0 16px;
}
.dimi-affiliate-dashboard-container .payouts-tab .payout-balance__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}
.dimi-affiliate-dashboard-container .payouts-tab .payout-balance__label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--di-text-muted, #475569);
}
.dimi-affiliate-dashboard-container .payouts-tab .payout-balance__status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1;
}
.dimi-affiliate-dashboard-container .payouts-tab .payout-balance__status--ready {
    background: color-mix(in srgb, var(--di-success, #10B981) 14%, transparent);
    color: var(--di-success, #10B981);
    border: 1px solid color-mix(in srgb, var(--di-success, #10B981) 28%, transparent);
}
.dimi-affiliate-dashboard-container .payouts-tab .payout-balance__status--pending {
    background: color-mix(in srgb, var(--di-warning, #F59E0B) 14%, transparent);
    color: #92400E;
    border: 1px solid color-mix(in srgb, var(--di-warning, #F59E0B) 28%, transparent);
}
.dimi-affiliate-dashboard-container .payouts-tab .payout-balance__status--building {
    background: var(--di-surface-alt, #F1F5F9);
    color: var(--di-text-muted, #475569);
    border: 1px solid var(--di-border, #E2E8F0);
}
.dimi-affiliate-dashboard-container .payouts-tab .payout-balance__status .di-icon {
    width: 10px;
    height: 10px;
}
.dimi-affiliate-dashboard-container .payouts-tab .payout-balance__amount {
    font-size: 2rem;
    font-weight: 700;
    color: var(--di-text, #0F172A);
    line-height: 1.1;
    margin-bottom: 14px;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

/* Progress bar — green fill when at/over threshold, primary blue
   when building up. Subtle inner rail. */
.dimi-affiliate-dashboard-container .payouts-tab .payout-balance__progress {
    height: 6px;
    background: var(--di-surface-alt, #F1F5F9);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 6px;
}
.dimi-affiliate-dashboard-container .payouts-tab .payout-balance__progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--di-primary, #2563EB), color-mix(in srgb, var(--di-primary, #2563EB) 70%, var(--di-success, #10B981)));
    border-radius: 999px;
    transition: width 250ms ease-out;
}
.dimi-affiliate-dashboard-container .payouts-tab .payout-balance__progress-foot {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--di-text-muted, #475569);
}
.dimi-affiliate-dashboard-container .payouts-tab .payout-balance__shortfall {
    color: var(--di-text, #0F172A);
    font-weight: 500;
}

/* CTA row — primary button + a small hint line below when needed. */
.dimi-affiliate-dashboard-container .payouts-tab .payout-balance__cta-row {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}
.dimi-affiliate-dashboard-container .payouts-tab .payout-balance__cta {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    padding: 11px 20px !important;
    background: var(--di-primary, #2563EB) !important;
    color: #fff !important;
    border: 1px solid var(--di-primary, #2563EB) !important;
    border-radius: 10px !important;
    font-size: 0.9375rem !important;
    font-weight: 600 !important;
    cursor: pointer;
    transition: filter 150ms ease-out, box-shadow 150ms ease-out;
    box-shadow: 0 6px 14px -6px color-mix(in srgb, var(--di-primary, #2563EB) 55%, transparent);
}
.dimi-affiliate-dashboard-container .payouts-tab .payout-balance__cta:hover:not(:disabled) {
    filter: brightness(0.95);
}
.dimi-affiliate-dashboard-container .payouts-tab .payout-balance__cta:disabled {
    background: var(--di-surface-alt, #F1F5F9) !important;
    color: var(--di-text-muted, #475569) !important;
    border-color: var(--di-border, #E2E8F0) !important;
    box-shadow: none;
    cursor: not-allowed;
}
.dimi-affiliate-dashboard-container .payouts-tab .payout-balance__cta-hint {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--di-text-muted, #475569);
}
.dimi-affiliate-dashboard-container .payouts-tab .payout-balance__cta-hint a {
    color: var(--di-primary, #2563EB);
    text-decoration: none;
    font-weight: 500;
}
.dimi-affiliate-dashboard-container .payouts-tab .payout-balance__cta-hint a:hover {
    text-decoration: underline;
}
.dimi-affiliate-dashboard-container .payouts-tab .payout-balance__cta-hint--warn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #92400E;
}
.dimi-affiliate-dashboard-container .payouts-tab .payout-balance__cta-hint--warn .di-icon {
    color: var(--di-warning, #F59E0B);
    width: 12px;
    height: 12px;
}

/* ---- Lifetime KPI strip ---- */
.dimi-affiliate-dashboard-container .payouts-tab .payout-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin: 0 0 18px;
}
.dimi-affiliate-dashboard-container .payouts-tab .payout-kpi {
    background: var(--di-surface, #FFFFFF);
    border: 1px solid var(--di-border, #E2E8F0);
    border-radius: 10px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.dimi-affiliate-dashboard-container .payouts-tab .payout-kpi__icon {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--di-surface-alt, #F1F5F9);
    color: var(--di-text-muted, #475569);
    flex-shrink: 0;
}
.dimi-affiliate-dashboard-container .payouts-tab .payout-kpi__icon .di-icon {
    width: 14px;
    height: 14px;
}
.dimi-affiliate-dashboard-container .payouts-tab .payout-kpi__body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.dimi-affiliate-dashboard-container .payouts-tab .payout-kpi__label {
    font-size: 0.6875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--di-text-muted, #475569);
}
.dimi-affiliate-dashboard-container .payouts-tab .payout-kpi__value {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--di-text, #0F172A);
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---- History section header ---- */
.dimi-affiliate-dashboard-container .payouts-tab .payout-history-section__head {
    margin-bottom: 10px;
}
.dimi-affiliate-dashboard-container .payouts-tab .payout-history-section__title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--di-text, #0F172A);
}
.dimi-affiliate-dashboard-container .payouts-tab .payout-history-section__title .di-icon {
    color: var(--di-primary, #2563EB);
}

@media (max-width: 600px) {
    .dimi-affiliate-dashboard-container .payouts-tab .payout-balance {
        padding: 16px;
        border-radius: 12px;
    }
    .dimi-affiliate-dashboard-container .payouts-tab .payout-balance__amount {
        font-size: 1.625rem;
    }
    .dimi-affiliate-dashboard-container .payouts-tab .payout-balance__cta {
        width: 100%;
        justify-content: center;
    }
}

/* ════════════════════════════════════════════════════════════════════
   STATISTICS TAB — refined (v1.10.x)
   Compact period selector + reused .overview-kpi cards + true
   tapering funnel. Section-title bars dropped; card headers carry
   the labels inline.
   ════════════════════════════════════════════════════════════════════ */

/* ---- Period selector ---- */
.dimi-affiliate-dashboard-container .statistics-tab .stats-period {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: var(--di-surface, #FFFFFF);
    border: 1px solid var(--di-border, #E2E8F0);
    border-radius: 12px;
    margin: 0 0 14px;
    flex-wrap: wrap;
}
.dimi-affiliate-dashboard-container .statistics-tab .stats-period__pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    flex: 1;
    min-width: 0;
}
.dimi-affiliate-dashboard-container .statistics-tab .stats-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--di-text-muted, #475569);
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 150ms ease-out, color 150ms ease-out, border-color 150ms ease-out;
}
.dimi-affiliate-dashboard-container .statistics-tab .stats-pill:hover {
    background: var(--di-surface-alt, #F1F5F9);
    color: var(--di-text, #0F172A);
}
/* JS (enhanced-stats.js) toggles `.active` on the button — we keep
   .is-active as our semantic class but mirror it to .active so the
   existing event handler doesn't need touching. Same for translate-
   away of the legacy .period-btn:hover transform. */
.dimi-affiliate-dashboard-container .statistics-tab .stats-pill.is-active,
.dimi-affiliate-dashboard-container .statistics-tab .stats-pill.active {
    background: var(--di-primary, #2563EB) !important;
    color: #fff !important;
    border-color: var(--di-primary, #2563EB) !important;
    box-shadow: none !important;
}
.dimi-affiliate-dashboard-container .statistics-tab .stats-pill--outline {
    border: 1px dashed var(--di-border-strong, #CBD5E1);
}
.dimi-affiliate-dashboard-container .statistics-tab .stats-pill--outline.is-active,
.dimi-affiliate-dashboard-container .statistics-tab .stats-pill--outline.active {
    border-style: solid;
}
/* Neutralise the legacy .period-btn:hover translate that would
   otherwise jitter the row when hovering inside our compact bar. */
.dimi-affiliate-dashboard-container .statistics-tab .stats-pill:hover {
    transform: none !important;
}
.dimi-affiliate-dashboard-container .statistics-tab .stats-pill .di-icon {
    width: 12px;
    height: 12px;
}

/* Compact refresh button — icon-only, sits at the right of the pill row. */
.dimi-affiliate-dashboard-container .statistics-tab .stats-period .stats-refresh-btn {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    padding: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent !important;
    border: 1px solid var(--di-border, #E2E8F0) !important;
    border-radius: 8px !important;
    color: var(--di-text-muted, #475569) !important;
    cursor: pointer;
    transition: background 150ms ease-out, color 150ms ease-out, border-color 150ms ease-out;
}
.dimi-affiliate-dashboard-container .statistics-tab .stats-period .stats-refresh-btn:hover {
    background: var(--di-surface-alt, #F1F5F9) !important;
    color: var(--di-primary, #2563EB) !important;
    border-color: color-mix(in srgb, var(--di-primary, #2563EB) 35%, var(--di-border, #E2E8F0)) !important;
}
.dimi-affiliate-dashboard-container .statistics-tab .stats-period .stats-refresh-btn .di-icon {
    width: 14px;
    height: 14px;
}

/* ---- KPI strip — inherits .overview-kpi styles from Overview tab.
        Statistics-specific tweaks: slightly tighter padding since
        we have 4 cards on most viewports. ---- */
.dimi-affiliate-dashboard-container .statistics-tab .stats-kpis {
    margin: 0 0 16px;
}

/* ---- Analytics row: Traffic + Funnel side by side ---- */
.dimi-affiliate-dashboard-container .statistics-tab .stats-analytics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin: 0 0 18px;
}
.dimi-affiliate-dashboard-container .statistics-tab .stats-card {
    background: var(--di-surface, #FFFFFF);
    border: 1px solid var(--di-border, #E2E8F0);
    border-radius: 12px;
    padding: 16px 18px;
}
.dimi-affiliate-dashboard-container .statistics-tab .stats-card__head {
    margin-bottom: 14px;
}
.dimi-affiliate-dashboard-container .statistics-tab .stats-card__title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--di-text, #0F172A);
}
.dimi-affiliate-dashboard-container .statistics-tab .stats-card__title .di-icon {
    color: var(--di-primary, #2563EB);
}

/* Traffic bars — slim 6px bars, label + value side-by-side above each. */
.dimi-affiliate-dashboard-container .statistics-tab .stats-bars {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.dimi-affiliate-dashboard-container .statistics-tab .stats-bars__row {
    margin: 0;
}
.dimi-affiliate-dashboard-container .statistics-tab .stats-bars__meta {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}
.dimi-affiliate-dashboard-container .statistics-tab .stats-bars__label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8125rem;
    color: var(--di-text-muted, #475569);
}
.dimi-affiliate-dashboard-container .statistics-tab .stats-bars__label .di-icon {
    width: 12px;
    height: 12px;
    color: var(--di-text-subtle, #94A3B8);
}
.dimi-affiliate-dashboard-container .statistics-tab .stats-bars__value {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--di-text, #0F172A);
    font-variant-numeric: tabular-nums;
}
.dimi-affiliate-dashboard-container .statistics-tab .stats-bars__value small {
    margin-left: 4px;
    font-size: 0.6875rem;
    font-weight: 400;
    color: var(--di-text-muted, #475569);
}
.dimi-affiliate-dashboard-container .statistics-tab .stats-bars__track {
    height: 6px;
    background: var(--di-surface-alt, #F1F5F9);
    border-radius: 999px;
    overflow: hidden;
}
.dimi-affiliate-dashboard-container .statistics-tab .stats-bars__fill {
    height: 100%;
    background: linear-gradient(90deg, var(--di-primary, #2563EB), color-mix(in srgb, var(--di-primary, #2563EB) 60%, var(--di-success, #10B981)));
    border-radius: 999px;
    transition: width 250ms ease-out;
}

/* Conversion funnel — true trapezoidal cone (v1.10.x).
   Each segment is a full-width block clipped into a trapezoid via
   clip-path: polygon(...). Segment N's bottom edge matches segment
   N+1's top edge, so the three blocks visually connect into one
   continuous inverted-pyramid shape (like the Mixpanel/Mailchimp
   funnel reference). Label/value/pct stack centered inside each
   segment in white text.

   Polygon points are computed inline (PHP) per segment, since they
   depend on the actual data percentages — passed via inline
   `style="clip-path: polygon(...)"`. */
.dimi-affiliate-dashboard-container .statistics-tab .stats-funnel {
    display: flex;
    flex-direction: column;
    gap: 2px; /* tiny gap so the segments read as connected but distinct */
    margin: 8px auto 4px;
    max-width: 520px;
    padding: 0;
}
.dimi-affiliate-dashboard-container .statistics-tab .stats-funnel__segment {
    position: relative;
    height: 76px;
    width: 100%;
    /* clip-path is inline-styled per segment with its computed polygon */
    background: var(--di-primary, #2563EB);
    transition: filter 200ms ease-out;
}
.dimi-affiliate-dashboard-container .statistics-tab .stats-funnel__segment:hover {
    filter: brightness(1.06);
}

/* Per-step palette — gradient flows brand-primary → primary/success
   blend → success across the 3 steps. Uses vertical gradient for
   subtle depth within each segment. */
.dimi-affiliate-dashboard-container .statistics-tab .stats-funnel__segment--1 {
    background: linear-gradient(180deg,
        var(--di-primary, #2563EB),
        color-mix(in srgb, var(--di-primary, #2563EB) 82%, #000));
}
.dimi-affiliate-dashboard-container .statistics-tab .stats-funnel__segment--2 {
    background: linear-gradient(180deg,
        color-mix(in srgb, var(--di-primary, #2563EB) 55%, var(--di-success, #10B981)),
        color-mix(in srgb, var(--di-primary, #2563EB) 30%, var(--di-success, #10B981)));
}
.dimi-affiliate-dashboard-container .statistics-tab .stats-funnel__segment--3 {
    background: linear-gradient(180deg,
        var(--di-success, #10B981),
        color-mix(in srgb, var(--di-success, #10B981) 82%, #000));
}

/* The label block lives inside the segment, absolutely centered.
   Because clip-path clips visible AREA but content still flows in
   the parent's box, centering with position:absolute + transform
   gives us pixel-perfect placement regardless of segment width. */
.dimi-affiliate-dashboard-container .statistics-tab .stats-funnel__inner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    color: #fff;
    text-align: center;
    line-height: 1.15;
    padding: 0 14px;
    max-width: 90%;
    text-shadow: 0 1px 1px rgba(15, 23, 42, 0.15);
}
.dimi-affiliate-dashboard-container .statistics-tab .stats-funnel__name {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.92;
    margin-bottom: 2px;
}
.dimi-affiliate-dashboard-container .statistics-tab .stats-funnel__num {
    font-size: 1.125rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.dimi-affiliate-dashboard-container .statistics-tab .stats-funnel__pct {
    font-size: 0.6875rem;
    font-weight: 500;
    opacity: 0.85;
    font-variant-numeric: tabular-nums;
    margin-top: 1px;
}
/* wc_price() output adds its own .woocommerce-Price-amount markup —
   strip the default browser link styling if WC wraps the value. */
.dimi-affiliate-dashboard-container .statistics-tab .stats-funnel__num .woocommerce-Price-amount {
    color: inherit;
    font-weight: inherit;
}

@media (max-width: 480px) {
    .dimi-affiliate-dashboard-container .statistics-tab .stats-funnel__segment {
        height: 64px;
    }
    .dimi-affiliate-dashboard-container .statistics-tab .stats-funnel__num {
        font-size: 1rem;
    }
}

/* ════════════════════════════════════════════════════════════════════
   SHARE MODAL — replaces the legacy dropdown menu (v1.10.x)
   Native Web Share API was short-circuiting our custom dropdown on
   Chrome desktop. Modal flow is consistent across browsers.
   ════════════════════════════════════════════════════════════════════ */
#share-modal .modal-content {
    max-width: 480px;
}
/* Generic .modal-overlay .modal-header doesn't flex — without this
   override, the close X button drops onto its own line below the
   title. Mirrors the pattern used by #payment-selection-modal and
   #edit-profile-modal. */
#share-modal .modal-header {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
#share-modal .modal-header h4 {
    margin: 0;
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--di-text, #0F172A);
}
#share-modal .modal-close {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 0;
    border-radius: 8px;
    color: var(--di-text-muted, #475569);
    cursor: pointer;
    transition: background 150ms ease-out, color 150ms ease-out;
}
#share-modal .modal-close:hover {
    background: var(--di-surface-alt, #F1F5F9);
    color: var(--di-text, #0F172A);
}
#share-modal .modal-close .di-icon {
    width: 16px;
    height: 16px;
}

#share-modal .share-modal__lede {
    margin: 0 0 14px;
    font-size: 0.875rem;
    color: var(--di-text-muted, #475569);
}

/* URL + Copy row — same compact pattern as the affiliate-link hero. */
#share-modal .share-modal__url-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
    margin-bottom: 18px;
}
#share-modal .share-modal__url {
    flex: 1;
    min-width: 0;
    padding: 10px 12px !important;
    background: var(--di-surface-alt, #F8FAFC) !important;
    border: 1px solid var(--di-border, #E2E8F0) !important;
    border-radius: 8px !important;
    color: var(--di-text, #0F172A) !important;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace !important;
    font-size: 0.8125rem !important;
    line-height: 1.4;
}
#share-modal .share-modal__url:focus {
    outline: 0 !important;
    border-color: var(--di-primary, #2563EB) !important;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--di-primary, #2563EB) 16%, transparent) !important;
}
#share-modal .share-modal__copy {
    flex-shrink: 0;
    padding: 10px 16px !important;
    background: var(--di-primary, #2563EB) !important;
    color: #fff !important;
    border: 0 !important;
    border-radius: 8px !important;
    font-size: 0.8125rem !important;
    font-weight: 600 !important;
    /* Neutralize the global .copy-btn min-height: 44px so the button
       sits flush with the smaller .share-modal__url input next to it. */
    min-height: 0 !important;
    line-height: 1.2 !important;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    transition: filter 150ms ease-out;
}
#share-modal .share-modal__copy:hover {
    filter: brightness(0.95);
}
#share-modal .share-modal__copy .di-icon {
    width: 13px;
    height: 13px;
}

/* Channels label + grid */
#share-modal .share-modal__channels-label {
    margin: 0 0 8px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--di-text-muted, #475569);
}
#share-modal .share-modal__channels {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 8px;
}
#share-modal .share-channel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 8px;
    background: var(--di-surface, #FFFFFF);
    border: 1px solid var(--di-border, #E2E8F0);
    border-radius: 10px;
    color: var(--di-text, #0F172A);
    text-decoration: none;
    cursor: pointer;
    transition: border-color 150ms ease-out, transform 100ms ease-out, box-shadow 150ms ease-out;
}
#share-modal .share-channel:hover {
    border-color: color-mix(in srgb, var(--di-primary, #2563EB) 35%, var(--di-border, #E2E8F0));
    box-shadow: 0 2px 6px -2px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
}
#share-modal .share-channel:active {
    transform: translateY(0);
}
#share-modal .share-channel__icon {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    color: #fff;
    flex-shrink: 0;
}
#share-modal .share-channel__icon .di-icon {
    width: 16px;
    height: 16px;
}
/* Per-channel brand tints — recognizable at a glance. */
#share-modal .share-channel__icon--facebook { background: #1877F2; }
#share-modal .share-channel__icon--x        { background: #0F172A; }
#share-modal .share-channel__icon--telegram { background: #229ED9; }
#share-modal .share-channel__icon--whatsapp { background: #25D366; }
#share-modal .share-channel__icon--email    { background: var(--di-text-muted, #475569); }

#share-modal .share-channel__name {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--di-text, #0F172A);
}

@media (max-width: 480px) {
    #share-modal .share-modal__url-row {
        flex-direction: column;
    }
    #share-modal .share-modal__copy {
        justify-content: center;
    }
    #share-modal .share-modal__channels {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 760px) {
    .dimi-affiliate-dashboard-container .statistics-tab .stats-analytics {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 520px) {
    .dimi-affiliate-dashboard-container .statistics-tab .stats-period {
        padding: 8px 10px;
    }
    .dimi-affiliate-dashboard-container .statistics-tab .stats-pill {
        font-size: 0.75rem;
        padding: 5px 10px;
    }
}

/* ---- Earnings breakdown — 4-stat strip below traffic/funnel ---- */
.dimi-affiliate-dashboard-container .statistics-tab .stats-earnings {
    background: var(--di-surface, #FFFFFF);
    border: 1px solid var(--di-border, #E2E8F0);
    border-radius: 12px;
    padding: 16px 18px;
    margin: 0 0 14px;
}
.dimi-affiliate-dashboard-container .statistics-tab .stats-earnings__head {
    margin-bottom: 14px;
}
.dimi-affiliate-dashboard-container .statistics-tab .stats-earnings__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}
.dimi-affiliate-dashboard-container .statistics-tab .stats-earnings__item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 0;
    min-width: 0;
}
.dimi-affiliate-dashboard-container .statistics-tab .stats-earnings__item + .stats-earnings__item {
    border-left: 1px dashed var(--di-border, #E2E8F0);
    padding-left: 16px;
}
.dimi-affiliate-dashboard-container .statistics-tab .stats-earnings__icon {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--di-surface-alt, #F1F5F9);
    color: var(--di-text-muted, #475569);
    flex-shrink: 0;
}
.dimi-affiliate-dashboard-container .statistics-tab .stats-earnings__icon .di-icon {
    width: 14px;
    height: 14px;
}
.dimi-affiliate-dashboard-container .statistics-tab .stats-earnings__body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.dimi-affiliate-dashboard-container .statistics-tab .stats-earnings__label {
    font-size: 0.6875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--di-text-muted, #475569);
}
.dimi-affiliate-dashboard-container .statistics-tab .stats-earnings__value {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--di-text, #0F172A);
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dimi-affiliate-dashboard-container .statistics-tab .stats-earnings__note {
    margin-top: 2px;
    font-size: 0.6875rem;
    color: var(--di-text-subtle, #94A3B8);
    line-height: 1.3;
}

@media (max-width: 920px) {
    .dimi-affiliate-dashboard-container .statistics-tab .stats-earnings__grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .dimi-affiliate-dashboard-container .statistics-tab .stats-earnings__item + .stats-earnings__item {
        border-left: 0;
        padding-left: 0;
    }
    .dimi-affiliate-dashboard-container .statistics-tab .stats-earnings__item:nth-child(odd) ~ .stats-earnings__item:nth-child(even) {
        border-left: 1px dashed var(--di-border, #E2E8F0);
        padding-left: 16px;
    }
}
@media (max-width: 480px) {
    .dimi-affiliate-dashboard-container .statistics-tab .stats-earnings__grid {
        grid-template-columns: 1fr;
    }
    .dimi-affiliate-dashboard-container .statistics-tab .stats-earnings__item + .stats-earnings__item,
    .dimi-affiliate-dashboard-container .statistics-tab .stats-earnings__item:nth-child(odd) ~ .stats-earnings__item:nth-child(even) {
        border-left: 0;
        border-top: 1px dashed var(--di-border, #E2E8F0);
        padding-left: 0;
        padding-top: 12px;
    }
}

/* ---- Performance score + Achievements (2-card row) ---- */
.dimi-affiliate-dashboard-container .statistics-tab .stats-performance {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
    gap: 14px;
    margin: 0;
}

.dimi-affiliate-dashboard-container .statistics-tab .stats-score__body {
    display: flex;
    align-items: center;
    gap: 18px;
}

/* Conic progress ring — uses --ring-pct (0..100) custom property
   set inline on the element. Two pseudo-layers: outer conic gradient
   colored by tier, inner white circle that knocks out the centre
   so the numeric value reads cleanly. */
.dimi-affiliate-dashboard-container .statistics-tab .stats-score__ring {
    --ring-color: var(--di-primary, #2563EB);
    position: relative;
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background:
        conic-gradient(
            var(--ring-color) calc(var(--ring-pct, 0) * 1%),
            var(--di-surface-alt, #F1F5F9) 0
        );
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.dimi-affiliate-dashboard-container .statistics-tab .stats-score__ring::before {
    content: "";
    position: absolute;
    inset: 8px;
    background: var(--di-surface, #FFFFFF);
    border-radius: 50%;
}
.dimi-affiliate-dashboard-container .statistics-tab .stats-score--excellent { --ring-color: var(--di-success, #10B981); }
.dimi-affiliate-dashboard-container .statistics-tab .stats-score--good       { --ring-color: var(--di-primary, #2563EB); }
.dimi-affiliate-dashboard-container .statistics-tab .stats-score--average    { --ring-color: var(--di-warning, #F59E0B); }
.dimi-affiliate-dashboard-container .statistics-tab .stats-score--starting   { --ring-color: var(--di-text-subtle, #94A3B8); }

.dimi-affiliate-dashboard-container .statistics-tab .stats-score__value {
    position: relative;
    z-index: 1;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--di-text, #0F172A);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.dimi-affiliate-dashboard-container .statistics-tab .stats-score__total {
    position: relative;
    z-index: 1;
    font-size: 0.6875rem;
    color: var(--di-text-muted, #475569);
    margin-left: 1px;
    line-height: 1;
    margin-top: 6px;
}
.dimi-affiliate-dashboard-container .statistics-tab .stats-score__caption {
    min-width: 0;
}
.dimi-affiliate-dashboard-container .statistics-tab .stats-score__tier {
    display: inline-block;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--di-text, #0F172A);
    margin-bottom: 4px;
}
.dimi-affiliate-dashboard-container .statistics-tab .stats-score__copy {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--di-text-muted, #475569);
    line-height: 1.5;
}

/* Achievements as a clean checklist */
.dimi-affiliate-dashboard-container .statistics-tab .stats-achievements__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 12px;
}
.dimi-affiliate-dashboard-container .statistics-tab .stats-achievements__item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: var(--di-surface-alt, #F8FAFC);
    border: 1px solid var(--di-border, #E2E8F0);
    border-radius: 8px;
    transition: background 150ms ease-out, border-color 150ms ease-out;
}
.dimi-affiliate-dashboard-container .statistics-tab .stats-achievements__item.is-unlocked {
    background: color-mix(in srgb, var(--di-success, #10B981) 6%, var(--di-surface, #FFFFFF));
    border-color: color-mix(in srgb, var(--di-success, #10B981) 25%, var(--di-border, #E2E8F0));
}
.dimi-affiliate-dashboard-container .statistics-tab .stats-achievements__icon {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: var(--di-surface, #FFFFFF);
    color: var(--di-text-subtle, #94A3B8);
    flex-shrink: 0;
    border: 1px solid var(--di-border, #E2E8F0);
}
.dimi-affiliate-dashboard-container .statistics-tab .stats-achievements__item.is-unlocked .stats-achievements__icon {
    background: color-mix(in srgb, var(--di-success, #10B981) 15%, transparent);
    color: var(--di-success, #10B981);
    border-color: color-mix(in srgb, var(--di-success, #10B981) 28%, transparent);
}
.dimi-affiliate-dashboard-container .statistics-tab .stats-achievements__icon .di-icon {
    width: 11px;
    height: 11px;
}
.dimi-affiliate-dashboard-container .statistics-tab .stats-achievements__label {
    flex: 1;
    min-width: 0;
    font-size: 0.8125rem;
    color: var(--di-text-muted, #475569);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dimi-affiliate-dashboard-container .statistics-tab .stats-achievements__item.is-unlocked .stats-achievements__label {
    color: var(--di-text, #0F172A);
    font-weight: 500;
}
.dimi-affiliate-dashboard-container .statistics-tab .stats-achievements__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--di-success, #10B981);
    color: #fff;
    flex-shrink: 0;
}
.dimi-affiliate-dashboard-container .statistics-tab .stats-achievements__badge .di-icon {
    width: 9px;
    height: 9px;
}

@media (max-width: 760px) {
    .dimi-affiliate-dashboard-container .statistics-tab .stats-performance {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 480px) {
    .dimi-affiliate-dashboard-container .statistics-tab .stats-achievements__list {
        grid-template-columns: 1fr;
    }
    .dimi-affiliate-dashboard-container .statistics-tab .stats-score__body {
        flex-direction: column;
        text-align: center;
    }
}

/* Enhanced Profile Section */
.enhanced-profile-section {
    background: #ffffff;
    border-radius: 12px;
    padding: 2rem;
    margin-top: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
}

.enhanced-profile-section h3 {
    color: #1e293b;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.enhanced-profile-section h3::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 1.5rem;
    background: var(--di-primary, #2563EB);
    border-radius: 2px;
}

/* Form Sections */

.form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.form-section h4 {
    color: #475569;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-section h4::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background: var(--di-primary, #2563EB);
    border-radius: 50%;
}

.section-description {
    color: #64748b;
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
    background: #f8fafc;
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid var(--di-primary, #2563EB);
}

/* Form Rows and Groups */
.form-row {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-row:last-child {
    margin-bottom: 0;
}

.form-group {
    flex: 1;
    min-width: 0;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    background: #ffffff;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--di-primary, #2563EB);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--di-primary, #2563EB) 10%, transparent);
}

/* Remove default HTML5 invalid styling since we handle validation with JavaScript */
.form-group input:invalid {
    border-color: #e5e7eb; /* Keep normal border color */
    box-shadow: none; /* Remove any default invalid styling */
}

.field-help {
    display: block;
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 0.5rem;
    line-height: 1.4;
}

/* Image Upload Groups */
.image-upload-group {
    max-width: 300px;
}

.image-upload-container {
    position: relative;
    margin-bottom: 0.5rem;
}

.image-upload-input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 2;
}

.image-upload-preview {
    width: 100%;
    height: 200px;
    border: 3px dashed #cbd5e1;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.image-upload-preview:hover {
    border-color: var(--di-primary, #2563EB);
    background: #f1f5f9;
}

.image-upload-preview.has-image {
    border-style: solid;
    border-color: #10b981;
    background: #ffffff;
}

.image-upload-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.upload-placeholder {
    text-align: center;
    color: #64748b;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.upload-placeholder ion-icon {
    font-size: 2.5rem;
    opacity: 0.6;
}

.upload-placeholder span {
    font-weight: 500;
    font-size: 0.95rem;
}

.remove-image {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 3;
}

.remove-image:hover {
    background: #dc2626;
    transform: scale(1.1);
}

.remove-image ion-icon {
    font-size: 1.2rem;
}

/* Form Actions */
.form-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-top: 2rem;
    border-top: 1px solid #e2e8f0;
    margin-top: 2rem;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 10px;
    background: var(--di-primary, #2563EB);
    border: none;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px color-mix(in srgb, var(--di-primary, #2563EB) 30%, transparent);
}

/* Profile Basic Form Specific Styles */
.profile-basic-form .readonly-field {
    padding: 0.875rem 1rem;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    color: #475569;
    font-size: 0.95rem;
    min-height: 50px;
    display: flex;
    align-items: center;
}

.profile-basic-form .readonly-field span {
    display: block;
}

.profile-basic-form .affiliate-code-display {
    background: #f8fafc;
    padding: 0.875rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    min-height: 50px;
}

.profile-basic-form .affiliate-code {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-weight: 600;
    color: var(--di-primary, #2563EB);
    background: #e0e7ff;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.9rem;
    display: inline-block;
    margin-bottom: 0.5rem;
}

.profile-basic-form .form-help {
    font-size: 0.8rem;
    color: #64748b;
    line-height: 1.4;
}

.profile-basic-form .status-display {
    padding: 0.875rem 1rem;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    min-height: 50px;
    display: flex;
    align-items: center;
}

.profile-basic-form .status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.profile-basic-form .status.status-active {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.profile-basic-form .status.status-pending {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.profile-basic-form .status.status-inactive {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.profile-basic-form .commission-rate {
    font-weight: 600;
    color: #059669;
    font-size: 1rem;
}

/* Section Header with Button */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
}

.btn-edit-profile {
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 8px;
    background: var(--di-primary, #2563EB);
    border: none;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px color-mix(in srgb, var(--di-primary, #2563EB) 20%, transparent);
}

.btn-edit-profile:hover {
    background: var(--di-primary-hover, #1D4ED8);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px color-mix(in srgb, var(--di-primary, #2563EB) 30%, transparent);
}

.btn-edit-profile ion-icon {
    font-size: 1.1rem;
}

/* Responsive section header */
@media (max-width: 768px) {
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .btn-edit-profile {
        align-self: stretch;
        justify-content: center;
    }
}

.btn-large:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px color-mix(in srgb, var(--di-primary, #2563EB) 40%, transparent);
}

.btn-large:active {
    transform: translateY(0);
}

.btn-large ion-icon {
    font-size: 1.2rem;
}

/* Form Status Messages */
.form-status {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-weight: 500;
    display: none;
}

.form-status.success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
    display: block;
}

.form-status.error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
    display: block;
}

.form-status.loading {
    background: #dbeafe;
    color: var(--di-primary-hover, #1D4ED8);
    border: 1px solid #bfdbfe;
    display: block;
}

/* Responsive Design for Profile Form */
@media (max-width: 768px) {
    .enhanced-profile-section {
        padding: 1.5rem;
        margin-top: 1.5rem;
    }
    
    .form-row {
        flex-direction: column;
        gap: 1rem;
    }
    
    .image-upload-group {
        max-width: 100%;
    }
    
    .form-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .btn-large {
        justify-content: center;
        padding: 1.25rem;
    }
}

/* Updated Mobile Responsive - Works with Sidebar Overlay */
@media (max-width: 1040px) {
    /* Show mobile menu toggle */
    .mobile-menu-toggle {
        display: flex;
    }
    
    /* Hide sidebar by default on mobile */
    .dashboard-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 280px;
        z-index: 999;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        flex-direction: column;
    }
    
    /* Main content adjustments */
    .main-content {
        padding: 1rem;
    }
    
    .main-header {
        padding: 0.75rem 1rem;
    }
    
    .breadcrumb {
        font-size: 1rem;
    }
    
    .nav-tabs {
        flex-direction: column;
        gap: 0.25rem;
        padding: 1rem;
    }
    
    .nav-link {
        width: 100%;
        white-space: normal;
    }
}

/* New Payment Flow Styles */

/* Payment Setup Wizard */
.payment-setup-wizard {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 1.5rem;
}

.wizard-header {
    text-align: center;
    margin-bottom: 2rem;
}

.wizard-header h4 {
    color: #1e293b;
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
    font-weight: 600;
}

.wizard-header p {
    color: #64748b;
    font-size: 1rem;
}

.payment-method-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.payment-method-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.payment-method-card:hover {
    border-color: var(--di-primary, #2563EB);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px color-mix(in srgb, var(--di-primary, #2563EB) 15%, transparent);
}

.payment-method-card.selected {
    border-color: var(--di-primary, #2563EB);
    background: var(--di-primary, #2563EB);
    color: white;
}

.payment-method-card .method-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--di-primary, #2563EB);
}

.payment-method-card.selected .method-icon {
    color: white;
}

.payment-method-card .method-info h5 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #1e293b;
}

.payment-method-card.selected .method-info h5 {
    color: white;
}

.payment-method-card .method-info p {
    color: #64748b;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.payment-method-card.selected .method-info p {
    color: rgba(255, 255, 255, 0.9);
}

.method-features {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
}

.method-features li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: #64748b;
}

.payment-method-card.selected .method-features li {
    color: rgba(255, 255, 255, 0.9);
}

.method-features ion-icon {
    color: #10b981;
    font-size: 1rem;
}

.payment-method-card.selected .method-features ion-icon {
    color: white;
}

.select-payment-method {
    width: 100%;
    margin-top: 1rem;
}

/* Current Payment Method Display */
.current-payment-method {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #e2e8f0;
}

.payment-status {
    margin-bottom: 1.5rem;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-weight: 500;
}

.status-indicator.success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.status-indicator ion-icon {
    font-size: 1.25rem;
}

.payment-method-display {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.5rem;
}

.method-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.method-header ion-icon {
    font-size: 1.5rem;
    color: var(--di-primary, #2563EB);
}

.method-header h4 {
    margin: 0;
    color: #1e293b;
    font-size: 1.25rem;
}

.method-details {
    margin-bottom: 1.5rem;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.detail-item:last-child {
    border-bottom: none;
}

.detail-item label {
    font-weight: 500;
    color: #64748b;
    margin: 0;
}

.detail-item span {
    color: #1e293b;
    font-weight: 500;
}

.method-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Payment Setup Modals */
.payment-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.payment-modal .modal-content {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

/* Modal Header */
.payment-modal .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    border-radius: 12px 12px 0 0;
    background: #f8fafc;
    position: sticky;
    top: 0;
    z-index: 10;
}

.payment-modal .modal-header h4 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.4;
}

/* Modal Close Button */
.payment-modal .modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    background: none;
    border: none;
    border-radius: 6px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1.25rem;
    position: relative;
    flex-shrink: 0;
}

.payment-modal .modal-close:hover {
    background: #e2e8f0;
    color: #1e293b;
    transform: scale(1.05);
}

.payment-modal .modal-close:active {
    transform: scale(0.95);
    background: #cbd5e1;
}

.payment-modal .modal-close:focus {
    outline: none;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--di-primary, #2563EB) 20%, transparent);
    background: #e2e8f0;
}

.payment-modal .modal-close:focus-visible {
    box-shadow: 0 0 0 2px var(--di-primary, #2563EB);
}

.payment-modal .modal-close ion-icon {
    width: 1.25rem !important;
    height: 1.25rem !important;
    font-size: 1.25rem !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    transition: transform 0.2s ease;
}

.step-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.step.active {
    opacity: 1;
}

.step-number {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: #e2e8f0;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
}

.step.active .step-number {
    background: var(--di-primary, #2563EB);
    color: white;
}

.step-label {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 500;
}

.step.active .step-label {
    color: #1e293b;
}

.payment-modal .modal-body {
    padding: 1.5rem;
}

.payment-method-info {
    text-align: center;
    margin-bottom: 1.5rem;
}

.payment-method-info .method-icon {
    font-size: 3rem;
    color: var(--di-primary, #2563EB);
    margin-bottom: 0.5rem;
}

.payment-method-info h5 {
    color: #1e293b;
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

.payment-method-info p {
    color: #64748b;
    line-height: 1.5;
}

.confirmation-content {
    text-align: center;
}

.confirmation-icon {
    font-size: 4rem;
    color: #10b981;
    margin-bottom: 1rem;
}

.confirmation-details {
    background: #f8fafc;
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
}

.confirmation-note {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    background: #eff6ff;
    border: 1px solid #dbeafe;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
}

.confirmation-note ion-icon {
    color: var(--di-primary, #2563EB);
    font-size: 1.25rem;
    margin-top: 0.125rem;
}

.confirmation-note p {
    margin: 0;
    color: var(--di-primary-hover, #1D4ED8);
    font-size: 0.875rem;
    line-height: 1.5;
}

.bank-setup-info {
    text-align: center;
    margin-bottom: 1.5rem;
}

.setup-steps {
    background: #f8fafc;
    border-radius: 8px;
    padding: 1.5rem;
}

.step-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    color: #64748b;
}

.step-item:last-child {
    margin-bottom: 0;
}

.step-item ion-icon {
    color: #10b981;
    font-size: 1.25rem;
}

.payment-modal .modal-footer {
    padding: 1.5rem;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

/* Bank Accounts Management Styles */
.bank-accounts-management {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #e2e8f0;
    margin-top: 1rem;
}

.bank-accounts-management .section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 1;
}

.bank-accounts-management .section-title h4 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#close-bank-management {
    font-size: 0.875rem;
    padding: 0.25rem 0.5rem;
}

/* Alert Styles */
.alert {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
}

.alert.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fbbf24;
}

.alert ion-icon {
    font-size: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .payment-method-options {
        grid-template-columns: 1fr;
    }
    
    .method-actions {
        flex-direction: column;
    }
    
    .method-actions .btn {
        width: 100%;
    }
    
    .step-indicator {
        gap: 0.5rem;
    }
    
    .step-label {
        display: none;
    }
    
    .payment-modal .modal-content {
        margin: 0.5rem;
        max-width: none;
    }
    
    .payment-modal .modal-footer {
        flex-direction: column;
    }
    
    .payment-modal .modal-footer .btn {
        width: 100%;
    }
}

/* Payment Methods List - New Design */
.payment-methods-list {
    background: #fff;
    border: 1px solid #e0e4e7;
    border-radius: 8px;
    overflow: hidden;
}

.payment-methods-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e4e7;
}

.payment-methods-header h4 {
    margin: 0;
    color: #1f2937;
    font-size: 18px;
    font-weight: 600;
}

.payment-methods-grid {
    padding: 20px;
    display: grid;
    /* Auto-fit so cards fill the column at any width: when the column
       is wide (>= 600px content) two cards sit side by side; when
       narrow each card gets the full width. Previously hard-coded
       1fr 1fr forced 2 cards across even inside the narrow right
       column of the profile layout, which squeezed each card to
       ~210px and chopped account names character-by-character. */
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
    gap: 15px;
}

.payment-method-item {
    background: #fff;
    border: 1px solid #e0e4e7;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    transition: all 0.2s ease;
}

.payment-method-item:hover {
    border-color: var(--di-primary, #2563EB);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

.method-header {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
}

.method-icon {
    width: 48px;
    height: 48px;
    background: #f3f4f6;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Default: status badge sits on its own row below icon + info. The
   info column then gets the full remaining width and account names /
   bank details wrap at word boundaries instead of char-by-char.
   Override below at wide viewports to put the badge inline again. */
.method-header .method-status {
    order: 99;
    flex: 1 0 100%;
    margin-left: 0;
    margin-top: 0;
    text-align: right;
}
.method-header .method-info {
    flex: 1 1 0;
    min-width: 0;
}

/* Wide viewports — bring the badge back inline with the title. */
@media (min-width: 1280px) {
    .method-header .method-status {
        order: 0;
        flex: 0 0 auto;
        margin-left: 15px;
        text-align: left;
    }
}

.paypal-method .method-icon {
    background: #fff4e6;
    color: #f59e0b;
}

.bank-method .method-icon {
    background: #eff6ff;
    color: var(--di-primary, #2563EB);
}

.method-icon ion-icon {
    font-size: 24px;
}

.method-info {
    flex: 1;
    min-width: 0;
}

.method-info h5 {
    margin: 0 0 5px 0;
    color: #1f2937;
    font-size: 16px;
    font-weight: 600;
    /* Wrap account holder names ("LE NGOC NAM") at word boundaries
       only — never mid-word — so multi-word names stack to multiple
       lines cleanly instead of breaking into single-letter columns. */
    overflow-wrap: break-word;
    word-break: normal;
}

.method-email,
.method-details {
    margin: 0 0 5px 0;
    color: #6b7280;
    font-size: 14px;
    /* break-all chopped "VPbank" into "VPban / k" character-by-character
       on narrow widths. overflow-wrap:anywhere only breaks when there's
       no other option (typical for long emails / IBANs) but leaves
       short labels intact. */
    overflow-wrap: anywhere;
    word-break: normal;
}

.method-account-name {
    overflow-wrap: anywhere;
    word-break: normal;
}

.method-details.no-primary {
    color: #dc2626;
    font-style: italic;
}

.method-account-name {
    display: block;
    color: #9ca3af;
    font-size: 12px;
    margin-top: 2px;
}

.method-account-type {
    display: block;
    color: #6b7280;
    font-size: 11px;
    margin-top: 2px;
    font-weight: 500;
}

.method-status {
    flex-shrink: 0;
    margin-left: 15px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.status-badge.active {
    background: #dcfce7;
    color: #059669;
}

.status-badge.warning {
    background: #fef3c7;
    color: #d97706;
}

.status-badge ion-icon {
    font-size: 14px;
}

.method-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.method-summary {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #f3f4f6;
}

.account-count {
    color: #6b7280;
    font-size: 13px;
}

.payment-methods-info {
    padding: 20px;
    background: #f8f9fa;
    border-top: 1px solid #e0e4e7;
}

.info-card {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    flex-direction: column;
}

.info-card ion-icon {
    font-size: 20px;
    color: var(--di-primary, #2563EB);
    margin-top: 2px;
    flex-shrink: 0;
}

.info-card h5 {
    margin: 0 0 5px 0;
    color: #1f2937;
    font-size: 14px;
    font-weight: 600;
}

.info-card p {
    margin: 0;
    color: #6b7280;
    font-size: 13px;
    line-height: 1.4;
}

/* Setup wizard for no payment methods */
.wizard-header .no-payment-icon {
    width: 64px;
    height: 64px;
    background: #f3f4f6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
}

.wizard-header .no-payment-icon ion-icon {
    font-size: 32px;
    color: #6b7280;
}

/* Responsive design for payment methods list.
 *
 * Breakpoints raised: previously the inner 2-col card grid + the
 * row-style header only collapsed at viewport ≤ 768px, but on a
 * tablet-width browser the dashboard sidebar (~280px) eats the
 * viewport so the right column is already narrow at 1080px. */
@media (max-width: 1080px) {
    .payment-methods-header {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    .payment-methods-header h4 {
        text-align: left;
    }
    .payment-methods-header .btn {
        width: 100%;
        justify-content: center;
        white-space: nowrap;
    }

    .payment-methods-grid {
        gap: 12px;
    }

    /* Tighter gap inside .method-header at narrow widths.
       The status-to-own-row + flex-wrap behaviour now lives in the
       base .method-header rule above so it applies at all widths
       below 1280px (the inline-status override breakpoint), not just
       below 1080px. */
    .method-header {
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .method-icon {
        width: 40px;
        height: 40px;
    }
    .method-icon ion-icon {
        font-size: 20px;
    }
    .method-actions {
        margin-top: 12px;
    }
    .method-actions .btn {
        flex: 1;
        min-width: 0;
        text-align: center;
        justify-content: center;
    }
}

/* ============================================
   ENHANCED PAYMENT METHOD MODALS
   ============================================ */

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    overflow-y: auto;            /* allow modal to scroll OUTSIDE if taller than viewport */
    overscroll-behavior: contain; /* don't bubble scroll to body */
    animation: fadeIn 0.2s ease-out;
}

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

/* Modal Container — markup uses .modal-content (not .modal). */
.modal-overlay .modal,
.modal-overlay .modal-content {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 550px;
    max-height: calc(100vh - 2rem);
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    position: relative;
    margin: auto;                 /* center even when overlay is in scroll mode */
}

/* Body scroll lock — added by JS when any payment modal is open. */
body.dimi-modal-open,
html.dimi-modal-open {
    overflow: hidden !important;
    touch-action: none;
}

/* Modal Header */
.modal-overlay .modal-header {
    padding: 1.25rem 1.5rem;
    border-radius: 8px 8px 0 0;
    position: sticky;
    top: 0;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    z-index: 10;
}

.modal-overlay .modal-header h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.4;
}

/* Modal Body */
.modal-overlay .modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    overscroll-behavior: contain;
    flex: 1 1 auto;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
}

/* Modal footer stays pinned at bottom of the container */
.modal-overlay .modal-footer {
    flex: 0 0 auto;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--di-border, #E2E8F0);
    background: #fff;
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    position: sticky;
    bottom: 0;
    z-index: 1;
}

/* Enhanced Form Layout with 2-Column Grid */
.modal-overlay .form-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.modal-overlay .form-container.single-column {
    grid-template-columns: 1fr;
}

.modal-overlay .form-container .form-group.full-width,
.modal-overlay .form-container .form-group.single-column {
    grid-column: 1 / -1;
}

/* Form Groups */
.modal-overlay .form-group {
    margin-bottom: 0.5rem;
}

.modal-overlay .form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #374151;
    font-size: 0.875rem;
}

.modal-overlay .form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 0.875rem;
    background: white;
    box-sizing: border-box;
}

.modal-overlay .form-control:focus {
    outline: none;
    border-color: var(--di-primary, #2563EB);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.modal-overlay .form-text {
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: #6b7280;
}

/* Simple Grid Layout - Legacy Support */
.modal-overlay .form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.modal-overlay .form-grid.single-column {
    grid-template-columns: 1fr;
}

.modal-overlay .form-grid .full-width {
    grid-column: 1 / -1;
}

/* Form Sections */
.modal-overlay .form-section {
    margin-bottom: 1.5rem;
}

.modal-overlay .form-section:last-child {
    margin-bottom: 0;
}

.modal-overlay .form-section-title {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
}

/* Enhanced Input Styling */
.modal-overlay .form-control.required {
    border-left: 3px solid var(--di-primary, #2563EB);
}

.modal-overlay .form-control.error {
    border-color: #ef4444;
    background-color: #fef2f2;
}

.modal-overlay .form-control.error:focus {
    border-color: #ef4444;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.1);
}

/* Field Groups for Related Inputs */
.modal-overlay .field-group {
    padding: 1rem;
}

.modal-overlay .field-group-title {
    margin: 0 0 0.75rem 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-overlay .field-group .form-container {
    margin-bottom: 0;
}

/* Payment Method Options */
.payment-method-options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.payment-method-options .payment-method-card {
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    padding: 1rem;
    cursor: pointer;
    background: white;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1rem;
    align-items: center;
}

.payment-method-options .payment-method-card:hover {
    border-color: var(--di-primary, #2563EB);
    background: #f8fafc;
}

.payment-method-options .payment-method-card.selected {
    border-color: var(--di-primary, #2563EB);
    background: #eff6ff;
}

.payment-method-options .payment-method-card .method-icon {
    background: var(--di-primary, #2563EB);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.payment-method-options .payment-method-card .method-icon ion-icon {
    font-size: 20px;
}

.payment-method-options .payment-method-card .method-info h5 {
    margin: 0 0 0.25rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
}

.payment-method-options .payment-method-card .method-info p {
    margin: 0;
    color: #6b7280;
    font-size: 0.875rem;
}

.payment-method-options .payment-method-card .btn {
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-weight: 500;
    border: 1px solid var(--di-primary, #2563EB);
    cursor: pointer;
    background: white;
    color: var(--di-primary, #2563EB);
    font-size: 0.875rem;
}

.payment-method-options .payment-method-card .btn:hover {
    background: var(--di-primary, #2563EB);
    color: white;
}

/* Simple Grid Layout */
.modal-overlay .form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.modal-overlay .form-grid.single-column {
    grid-template-columns: 1fr;
}

.modal-overlay .form-grid .full-width {
    grid-column: 1 / -1;
}

/* Modal Footer */
.modal-overlay .modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e5e7eb;
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 0.75rem;
    align-items: center;
}

.modal-overlay .modal-footer .btn {
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-weight: 500;
    border: 1px solid;
    cursor: pointer;
    font-size: 0.875rem;
}

.modal-overlay .modal-footer .btn-secondary {
    background: white;
    color: #374151;
    border-color: #d1d5db;
}

.modal-overlay .modal-footer .btn-secondary:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.modal-overlay .modal-footer .btn-primary {
    background: var(--di-primary, #2563EB);
    color: white;
    border-color: var(--di-primary, #2563EB);
}

.modal-overlay .modal-footer .btn-primary:hover {
    background: var(--di-primary, #2563EB);
    border-color: var(--di-primary, #2563EB);
}

.modal-overlay .modal-footer .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.modal-overlay .modal-footer .footer-info {
    color: #6b7280;
    font-size: 0.75rem;
}

/* PayPal Specific Styling */
.payment-method-card[data-method="paypal"] .method-icon {
    background: #0070ba;
}

.payment-method-card[data-method="paypal"]:hover {
    border-color: #0070ba;
    background: #f0f8ff;
}

/* Bank Transfer Specific Styling */
.payment-method-card[data-method="bank_transfer"] .method-icon {
    background: #059669;
}

.payment-method-card[data-method="bank_transfer"]:hover {
    border-color: #059669;
    background: #f0fdf4;
}

/* Responsive Design */
@media (max-width: 768px) {
    .modal-overlay {
        padding: 0.5rem;
    }
    
    .modal-overlay .modal {
        max-width: 100%;
        max-height: calc(100vh - 1rem);
    }
    
    /* Stack form columns on tablet */
    .modal-overlay .form-container,
    .modal-overlay .form-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .modal-overlay .field-group .form-container {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .payment-method-options .payment-method-card {
        grid-template-columns: auto 1fr;
        grid-template-rows: auto auto;
        gap: 0.75rem;
    }
    
    .payment-method-options .payment-method-card .method-info {
        grid-column: 2;
        grid-row: 1;
    }
    
    .payment-method-options .payment-method-card .btn {
        grid-column: 1 / -1;
        grid-row: 2;
        justify-self: start;
    }
    
    .modal-overlay .modal-footer {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        gap: 0.5rem;
        text-align: center;
    }
    
    .modal-overlay .modal-footer .footer-info {
        grid-row: 1;
    }
    
    .modal-overlay .modal-footer .btn-primary {
        grid-row: 2;
    }
    
    .modal-overlay .modal-footer .btn-secondary {
        grid-row: 3;
    }
}

@media (max-width: 480px) {
    .modal-overlay {
        padding: 0;
    }
    
    .modal-overlay .modal {
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .modal-overlay .modal-header {
        padding: 1rem;
    }
    
    .modal-overlay .modal-body {
        padding: 1rem;
    }
    
    .modal-overlay .modal-footer {
        padding: 1rem;
    }
    
    /* Single column layout on mobile */
    .modal-overlay .form-container,
    .modal-overlay .form-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .modal-overlay .field-group {
        padding: 0.75rem;
    }
    
    .modal-overlay .form-control {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.875rem 0.75rem;
    }
    
    .payment-method-options .payment-method-card {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        text-align: center;
        gap: 0.75rem;
        padding: 1rem;
    }
    
    .payment-method-options .payment-method-card .method-icon {
        justify-self: center;
        grid-row: 1;
    }
    
    .payment-method-options .payment-method-card .method-info {
        grid-row: 2;
        grid-column: 1;
    }
    
    .payment-method-options .payment-method-card .btn {
        grid-row: 3;
        grid-column: 1;
        justify-self: center;
        width: auto;
        min-width: 120px;
    }
}

/* Medium screens - optimized 2-column layout */
@media (min-width: 769px) and (max-width: 1024px) {
    .modal-overlay .form-container {
        gap: 1.25rem;
    }
    
    .modal-overlay .form-control {
        padding: 0.8rem;
    }
}

/* Large screens - enhanced spacing */
@media (min-width: 1025px) {
    .modal-overlay .modal {
        max-width: 600px;
    }
    
    .modal-overlay .form-container {
        gap: 1.5rem;
    }
    
    .modal-overlay .form-control {
        padding: 0.875rem;
    }
}

/* iOS Safari specific fixes */
@supports (-webkit-touch-callout: none) {
    @media (max-width: 480px) {
        .modal-overlay .modal {
            height: 100vh;
            height: -webkit-fill-available;
        }
        
        .modal-overlay .form-control {
            font-size: 16px; /* Prevents zoom on iOS */
        }
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .modal-overlay .modal {
        box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    }
    
    .payment-method-options .payment-method-card:hover {
        box-shadow: 0 6px 16px rgba(59, 130, 246, 0.2);
    }
}

/* ============================================
   PAYOUT MODAL SPECIFIC STYLES
   ============================================ */

/* Payout Amount Display within bank-setup-info */
.bank-setup-info .payout-amount-display {
    text-align: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.bank-setup-info .payout-amount-display p {
    margin: 0 0 0.5rem 0;
    color: #6b7280;
    font-size: 0.875rem;
    font-weight: 500;
}

.bank-setup-info .amount-highlight {
    font-size: 1.75rem;
    font-weight: 700;
    color: #059669;
    margin: 0;
}

/* Payment Method Selection for Payout */
.payout-method-selection {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

.payout-method-selection > label {
    display: block;
    margin-bottom: 1rem;
    font-weight: 600;
    color: #374151;
    font-size: 0.95rem;
}

/* Payment Option Styling */
.payment-option {
    margin-bottom: 0.75rem;
}

.payment-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.payment-option-label {
    display: block;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
}

.payment-option-label:hover {
    border-color: var(--di-primary, #2563EB);
    background: #f8fafc;
}

.payment-option input[type="radio"]:checked + .payment-option-label {
    border-color: var(--di-primary, #2563EB);
    background: #eff6ff;
    box-shadow: 0 0 0 1px var(--di-primary, #2563EB);
}

.payment-option input[type="radio"]:disabled + .payment-option-label {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f9fafb;
}

/* Payment Method Info */
.payment-method-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.payment-method-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    color: #1f2937;
}

.payment-method-header ion-icon {
    font-size: 20px;
    color: var(--di-primary, #2563EB);
}

.payment-method-header ion-icon[name="logo-paypal"] {
    color: #0070ba;
}

.payment-method-header ion-icon[name="card-outline"] {
    color: #059669;
}

.payment-method-details {
    font-size: 0.875rem;
    color: #6b7280;
    margin-left: 2.25rem;
}

.payment-method-warning {
    font-size: 0.875rem;
    color: #dc2626;
    margin-left: 2.25rem;
    font-weight: 500;
}

.default-badge {
    background: #059669;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    margin-left: auto;
}

/* Payout Request Container */
.payout-request-container {
    text-align: center;
}

.payout-description {
    margin-bottom: 1.5rem;
    color: #6b7280;
    font-size: 0.95rem;
}

.payout-description strong {
    color: #059669;
    font-weight: 700;
}

.payout-warning {
    background: #fef3cd;
    border: 1px solid #fbbf24;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1rem;
    color: #92400e;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.payout-warning ion-icon {
    font-size: 18px;
    color: #f59e0b;
}

/* Mobile Responsive for Payout Modal */
@media (max-width: 768px) {
    .bank-setup-info .amount-highlight {
        font-size: 1.5rem;
    }
    
    .payment-method-header {
        gap: 0.5rem;
    }
    
    .payment-method-details,
    .payment-method-warning {
        margin-left: 1.75rem;
    }
}

@media (max-width: 480px) {
    .payment-option-label {
        padding: 0.875rem;
    }
    
    .payment-method-header {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .default-badge {
        margin-left: 0;
        margin-top: 0.25rem;
    }
}

/* ============================================
   ENHANCED PAYOUT REQUEST CONTAINER
   ============================================ */

/* Enhanced Payout Action Card */
.payout-action-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.payout-action-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: var(--di-primary, #2563EB);
}

.payout-card-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--di-primary, #2563EB);
    color: white;
}

.payout-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.payout-icon ion-icon {
    font-size: 24px;
    color: white;
}

.payout-content h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: white;
}

.payout-content .payout-description {
    margin: 0;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
    line-height: 1.5;
}

.payout-action-section {
    padding: 1.5rem;
}

/* Warning Card for No Payment Methods */
.payout-warning-card {
    background: #fef3cd;
    border: 1px solid #fbbf24;
    border-radius: 8px;
    padding: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.payout-warning-card ion-icon {
    font-size: 24px;
    color: #f59e0b;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.warning-content p {
    margin: 0 0 1rem 0;
    color: #92400e;
    font-size: 0.875rem;
    line-height: 1.5;
}

.warning-content .btn {
    margin: 0;
}

/* Payout Ready Section */
.payout-ready-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    text-align: center;
}

.payout-ready-description {
    margin: 0;
    color: #6b7280;
    font-size: 0.95rem;
    line-height: 1.5;
}

.payout-request-btn {
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    border: none;
    color: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.payout-request-btn:hover {
    background: linear-gradient(135deg, #047857 0%, #065f46 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
}

.payout-request-btn ion-icon {
    font-size: 20px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .payout-card-header {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .payout-icon {
        align-self: center;
    }
    
    .payout-warning-card {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .payout-warning-card ion-icon {
        align-self: center;
    }
}

@media (max-width: 480px) {
    .payout-action-section {
        padding: 1rem;
    }
    
    .payout-card-header {
        padding: 1rem;
    }
    
    .payout-request-btn {
        padding: 0.875rem 1rem;
        font-size: 0.95rem;
    }
}

/* ============================================
   ENHANCED PAYOUT REQUEST MODAL
   ============================================ */

/* Enhanced Payout Modal Specific Positioning */
#payout-request-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10001;
    width: 100%;
    max-width: 500px;
    background: none;
    display: none;
}

/* Modal backdrop for enhanced modal */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Enhanced payout amount display styling within bank-setup-info */
#payout-request-modal .bank-setup-info .payout-amount-display {
    text-align: center;
    margin-top: 1rem;
    padding: 1rem;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
}

#payout-request-modal .bank-setup-info .amount-label {
    margin: 0 0 0.5rem 0;
    color: #374151;
    font-size: 0.875rem;
    font-weight: 500;
}

#payout-request-modal .bank-setup-info .amount-highlight {
    font-size: 1.875rem;
    font-weight: 700;
    color: #059669;
    margin: 0;
}

/* Enhanced method selection label */
#payout-request-modal .method-selection-label {
    display: block;
    margin-bottom: 1rem;
    font-weight: 600;
    color: #374151;
    font-size: 0.95rem;
}

/* Mobile responsive for enhanced modal */
@media (max-width: 768px) {
    #payout-request-modal {
        max-width: 95%;
        margin: 1rem;
    }
    
    #payout-request-modal .bank-setup-info .amount-highlight {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    #payout-request-modal {
        max-width: 100%;
        margin: 0.5rem;
    }
    
    #payout-request-modal .modal-content {
        max-height: 95vh;
    }
}

/* Payout Modal Specific Styles */
.payout-amount-info {
    text-align: center;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    border: 1px solid #bbf7d0;
    border-radius: 12px;
}

.payout-amount-info h4 {
    margin: 0 0 0.5rem 0;
    color: #374151;
    font-size: 1rem;
    font-weight: 600;
}

.payout-amount-info .amount-highlight {
    font-size: 2rem;
    font-weight: 700;
    color: #059669;
    margin-bottom: 0.5rem;
}

.payout-amount-info p {
    margin: 0;
    color: #6b7280;
    font-size: 0.9rem;
}

/* No payment methods styling */
.no-payment-methods {
    text-align: center;
    padding: 2rem;
    background: #f8f9fa;
    border-radius: 12px;
    border: 2px dashed #dee2e6;
}

.no-payment-methods ion-icon {
    font-size: 3rem;
    color: #ffc107;
    margin-bottom: 1rem;
}

.no-payment-methods h5 {
    margin: 0 0 0.5rem 0;
    color: #495057;
}

.no-payment-methods p {
    margin: 0 0 1.5rem 0;
    color: #6c757d;
}

.error-message ion-icon {
    font-size: 3rem;
    color: #e53e3e;
    margin-bottom: 1rem;
}

.error-message p {
    margin: 0;
    color: #e53e3e;
}

/* Default badge styling for payout modal */
#payout-request-modal .default-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    background: #10b981;
    color: white;
    border-radius: 12px;
    font-size: 0.65rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    margin-left: 0.5rem;
}

/* Payout modal width override to match payment method selection modal */
#payout-request-modal .payment-modal {
    max-width: 800px;
}

#payout-request-modal .modal-content {
    max-width: 800px;
}

/* Ensure payment method options grid properly in payout modal */
#payout-request-modal .payment-method-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

/* Responsive adjustments for payout modal */
@media (max-width: 768px) {
    #payout-request-modal .payment-modal {
        max-width: 95%;
        margin: 1rem;
    }
    
    #payout-request-modal .payment-method-options {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* ================================
   Toast Notification System
   ================================ */

/* Toast Container */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    max-width: 400px;
    width: 100%;
    pointer-events: none;
}

/* Individual Toast */
.toast {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
    border-left: 4px solid #e0e0e0;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

/* Toast Animation States */
.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast.hide {
    transform: translateX(100%);
    opacity: 0;
}

/* Toast Types */
.toast.success {
    border-left-color: #10b981;
    background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 100%);
}

.toast.error {
    border-left-color: #ef4444;
    background: linear-gradient(135deg, #fef2f2 0%, #ffffff 100%);
}

.toast.warning {
    border-left-color: #f59e0b;
    background: linear-gradient(135deg, #fffbeb 0%, #ffffff 100%);
}

.toast.info {
    border-left-color: var(--di-primary, #2563EB);
    background: linear-gradient(135deg, #eff6ff 0%, #ffffff 100%);
}

.toast.loading {
    border-left-color: var(--di-primary, #2563EB);
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
}

/* Toast Icon */
.toast-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}

.toast.success .toast-icon {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.toast.error .toast-icon {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.toast.warning .toast-icon {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.toast.info .toast-icon {
    background: rgba(59, 130, 246, 0.1);
    color: var(--di-primary, #2563EB);
}

.toast.loading .toast-icon {
    background: rgba(59, 130, 246, 0.1);
    color: var(--di-primary, #2563EB);
}

.toast-icon ion-icon,
.toast-icon svg {
    font-size: 16px !important;
    width: 16px !important;
    height: 16px !important;
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Toast Content */
.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-weight: 600;
    font-size: 14px;
    line-height: 1.3;
    color: #1f2937;
    margin: 0 0 4px 0;
}

.toast-message {
    font-size: 13px;
    line-height: 1.4;
    color: #6b7280;
    margin: 0;
    word-wrap: break-word;
}

/* Toast Close Button */
.toast-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    color: #9ca3af;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-top: -2px;
    margin-right: -4px;
}

.toast-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #6b7280;
}

.toast-close ion-icon,
.toast-close svg {
    font-size: 16px !important;
    width: 16px !important;
    height: 16px !important;
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Toast Progress Bar */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(0, 0, 0, 0.1);
    width: 100%;
    overflow: hidden;
}

.toast-progress-bar {
    height: 100%;
    background: currentColor;
    transform: translateX(-100%);
    transition: transform linear;
}

.toast.success .toast-progress-bar {
    background: #10b981;
}

.toast.error .toast-progress-bar {
    background: #ef4444;
}

.toast.warning .toast-progress-bar {
    background: #f59e0b;
}

.toast.info .toast-progress-bar {
    background: var(--di-primary, #2563EB);
}

/* Toast Animations */
@keyframes toastSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toastSlideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Responsive Toast Styles */
@media (max-width: 768px) {
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .toast {
        margin-bottom: 8px;
        padding: 14px 16px;
    }
    
    .toast-title {
        font-size: 13px;
    }
    
    .toast-message {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .toast-container {
        top: 5px;
        right: 5px;
        left: 5px;
    }
    
    .toast {
        padding: 12px 14px;
        gap: 10px;
    }
    
    .toast-icon {
        width: 20px;
        height: 20px;
    }
    
    .toast-icon ion-icon {
        font-size: 14px !important;
        width: 14px !important;
        height: 14px !important;
    }
}

/* Payment Features Styles */
.payment-features {
    margin: 1.5rem 0;
}

.feature-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    padding: 0.5rem 0;
}

.feature-row:last-child {
    margin-bottom: 0;
}

.feature-row ion-icon {
    color: #10b981;
    font-size: 1rem !important;
    width: 1rem !important;
    height: 1rem !important;
    flex-shrink: 0;
}

.feature-row span {
    color: #374151;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Setup Process Styles */
.setup-process {
    margin: 1.5rem 0;
}

.process-step {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.process-step:last-child {
    margin-bottom: 0;
}

.process-step ion-icon {
    color: var(--di-primary, #2563EB);
    font-size: 1.25rem !important;
    width: 1.25rem !important;
    height: 1.25rem !important;
    flex-shrink: 0;
}

.process-step span {
    color: #374151;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Form Section Title Styles */
.form-section-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e2e8f0;
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
}

.form-section-title ion-icon {
    color: var(--di-primary, #2563EB);
    font-size: 1.25rem !important;
    width: 1.25rem !important;
    height: 1.25rem !important;
}

/* Ensure modal displays correctly and is perfectly centered */
.payment-modal {
    display: none;
}

.payment-modal.show,
.payment-modal[style*="flex"] {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Ensure all modal overlays are centered ONLY when visible */
.modal-overlay.show,
.modal-overlay[style*="flex"]:not([style*="none"]) {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Specific centering for edit profile modal */
#edit-profile-modal.show,
#edit-profile-modal[style*="block"],
#edit-profile-modal[style*="flex"] {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 9999 !important;
}

/* ============================================================
   THEME GUARD — win specificity against host theme rules
   The active theme defines its own .btn-primary etc. with its own
   --primary variable (different from --di-primary), and its
   stylesheet loads AFTER our plugin CSS. Scope brand-critical
   button rules under the plugin container so we win on specificity
   (0,2,0,0 > 0,1,0,0) regardless of source order.
   ============================================================ */
.dimi-affiliate-dashboard-container .btn-primary,
.dimi-affiliate-dashboard-container .copy-btn,
.dimi-affiliate-dashboard-container .login-submit-btn,
.dimi-affiliate-dashboard-container .request-payout-btn,
.dimi-affiliate-dashboard-container .action-btn,
.dimi-affiliate-dashboard-container .add-payment-method,
.dimi-affiliate-dashboard-container button.btn.btn-primary,
.dimi-affiliate-login-container .login-submit-btn,
.dimi-affiliate-register-container .btn-primary {
    background: var(--di-primary, #2563EB);
    background-color: var(--di-primary, #2563EB);
    color: #fff;
    border-color: var(--di-primary, #2563EB);
}

.dimi-affiliate-dashboard-container .btn-primary:hover,
.dimi-affiliate-dashboard-container .copy-btn:hover,
.dimi-affiliate-dashboard-container .login-submit-btn:hover,
.dimi-affiliate-dashboard-container .request-payout-btn:hover,
.dimi-affiliate-dashboard-container .action-btn:hover,
.dimi-affiliate-dashboard-container .add-payment-method:hover,
.dimi-affiliate-dashboard-container button.btn.btn-primary:hover,
.dimi-affiliate-login-container .login-submit-btn:hover,
.dimi-affiliate-register-container .btn-primary:hover {
    background: var(--di-primary-hover, #1D4ED8);
    background-color: var(--di-primary-hover, #1D4ED8);
    color: #fff;
    border-color: var(--di-primary-hover, #1D4ED8);
}

/* Sidebar nav active — same theme-guard pattern */
.dimi-affiliate-dashboard-container .nav-link.active {
    background: var(--di-primary, #2563EB);
    background-color: var(--di-primary, #2563EB);
    color: #fff;
}

/* ============================================================
   PAYOUT REQUEST MODAL
   ============================================================ */
#payment-selection-modal .modal-content {
    max-width: 640px;
}
#payment-selection-modal .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
#payment-selection-modal .modal-header h4 {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--di-text, #0F172A);
}
#payment-selection-modal .modal-header h4 .di-icon {
    color: var(--di-primary, #2563EB);
}
#payment-selection-modal .modal-close {
    width: 32px; height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 0;
    border-radius: 8px;
    color: var(--di-text-muted, #475569);
    cursor: pointer;
    transition: background 150ms ease-out, color 150ms ease-out;
}
#payment-selection-modal .modal-close:hover {
    background: var(--di-surface-alt, #F1F5F9);
    color: var(--di-text, #0F172A);
}

/* Available balance pill */
.payout-balance-pill {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 18px;
    background: color-mix(in srgb, var(--di-primary, #2563EB) 6%, var(--di-surface, #FFFFFF));
    border: 1px solid color-mix(in srgb, var(--di-primary, #2563EB) 22%, var(--di-border, #E2E8F0));
    border-radius: 12px;
    margin-bottom: 14px;
}
.payout-balance-pill__label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--di-text-muted, #475569);
}
.payout-balance-pill__value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--di-primary, #2563EB);
    line-height: 1;
}
.payout-balance-pill__hint {
    margin: 0 0 18px;
    font-size: 0.875rem;
    color: var(--di-text-muted, #475569);
}

/* ─────────────────────────────────────────────────────────────────
   Payout payment-method cards.
   All selectors are scoped under #payment-selection-modal so they
   win against the older `.payment-method-options .payment-method-card .method-icon`
   rule block (specificity 0,0,3,0) that lives earlier in this file.
   ───────────────────────────────────────────────────────────────── */
#payment-selection-modal .payment-method-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
#payment-selection-modal .payout-options-loading {
    padding: 24px;
    text-align: center;
    color: var(--di-text-muted, #475569);
    font-size: 0.875rem;
}
#payment-selection-modal .payment-method-card {
    display: grid;
    grid-template-columns: 48px 1fr auto;
    gap: 16px;
    align-items: center;
    padding: 16px;
    background: var(--di-surface, #FFFFFF);
    border: 1px solid var(--di-border, #E2E8F0);
    border-radius: 12px;
    transition: border-color 150ms ease-out, box-shadow 150ms ease-out;
}
#payment-selection-modal .payment-method-card:hover {
    border-color: color-mix(in srgb, var(--di-primary, #2563EB) 35%, var(--di-border, #E2E8F0));
    background: var(--di-surface, #FFFFFF);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}
#payment-selection-modal .payment-method-card.incomplete-account {
    opacity: 0.75;
}
#payment-selection-modal .payment-method-card .method-icon {
    width: 48px;
    height: 48px;
    margin: 0;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--di-surface-alt, #F1F5F9);
    color: #fff;
    font-size: 1rem;
    flex-shrink: 0;
}
#payment-selection-modal .payment-method-card .method-icon .di-icon {
    width: 22px;
    height: 22px;
    color: inherit;
}
/* The two-pronged hooks below: first targets the BEM modifier on
   the icon (used by the JS-rendered Request Payout modal), second
   targets the parent .paypal-method / .bank-method (used by the
   PHP-rendered Add Payment Method modal). !important wins against
   the older .payment-method-card[data-method=paypal/bank_transfer]
   rules at lines 7770/7780 which set wrong colors. */
#payment-selection-modal .payment-method-card .method-icon--paypal,
#payment-selection-modal .payment-method-card.paypal-method .method-icon {
    background: #003087 !important;
    color: #fff !important;
}
#payment-selection-modal .payment-method-card .method-icon--bank,
#payment-selection-modal .payment-method-card.bank-method .method-icon {
    background: var(--di-primary, #2563EB) !important;
    color: #fff !important;
}

#payment-selection-modal .method-info { min-width: 0; }
#payment-selection-modal .method-info h5 {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: 0 0 2px;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--di-text, #0F172A);
}
#payment-selection-modal .method-info > p {
    margin: 0 0 8px;
    font-size: 0.8125rem;
    color: var(--di-text-muted, #475569);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
#payment-selection-modal .method-features {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
#payment-selection-modal .method-features li {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--di-text-muted, #475569);
}
#payment-selection-modal .method-features li .di-icon {
    color: var(--di-success, #10B981);
    flex-shrink: 0;
}

.default-badge {
    display: inline-block;
    padding: 2px 8px;
    background: var(--di-primary-soft, color-mix(in srgb, var(--di-primary, #2563EB) 12%, transparent));
    color: var(--di-primary, #2563EB);
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.incomplete-badge {
    display: inline-block;
    padding: 2px 8px;
    background: color-mix(in srgb, var(--di-warning, #F59E0B) 14%, transparent);
    color: #92400E;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.incomplete-warning {
    margin: 6px 0 0 !important;
    padding: 6px 10px;
    background: color-mix(in srgb, var(--di-warning, #F59E0B) 12%, transparent);
    color: #92400E;
    border-radius: 8px;
    font-size: 0.75rem;
}

#payment-selection-modal .request-payout-method {
    white-space: nowrap;
    align-self: center;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--di-primary, #2563EB);
    background: var(--di-primary, #2563EB);
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
}
#payment-selection-modal .request-payout-method:hover {
    filter: brightness(0.95);
}
#payment-selection-modal .request-payout-method:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Footer: hint text left, action right */
.modal-footer--split {
    justify-content: space-between !important;
    align-items: center !important;
}
.modal-footer--split .form-text {
    color: var(--di-text-muted, #475569);
    font-size: 0.75rem;
}

@media (max-width: 640px) {
    #payment-selection-modal .payment-method-card {
        grid-template-columns: 48px 1fr;
    }
    #payment-selection-modal .payment-method-card .request-payout-method {
        grid-column: 1 / -1;
        width: 100%;
    }
    .payout-balance-pill {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    .modal-footer--split {
        flex-direction: column;
        align-items: stretch !important;
    }
    .modal-footer--split .btn {
        width: 100%;
    }
}

/* ============================================================
   PAYMENT METHODS — Empty state + info card
   Markup .payment-methods-empty-state existed without any CSS,
   so icon/heading/text rendered left-aligned with zero padding.
   ============================================================ */
.payment-methods-empty-state {
    text-align: center;
    padding: 40px 24px;
    background: var(--di-surface, #FFFFFF);
    border: 1px dashed var(--di-border-strong, #CBD5E1);
    border-radius: 12px;
    margin: 8px 0 20px;
}

.payment-methods-empty-state .empty-state-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin: 0 auto 14px;
    background: var(--di-primary-soft, color-mix(in srgb, var(--di-primary, #2563EB) 10%, transparent));
    color: var(--di-primary, #2563EB);
    border-radius: 50%;
}

.payment-methods-empty-state h4 {
    margin: 0 0 6px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--di-text, #0F172A);
}

.payment-methods-empty-state p {
    margin: 0 auto;
    max-width: 420px;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--di-text-muted, #475569);
}

/* Payment Processing info card — token-driven layout */
.payment-methods-info {
    margin-top: 8px;
}

.payment-methods-info .info-card {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 16px 18px;
    background: color-mix(in srgb, var(--di-primary, #2563EB) 4%, var(--di-surface, #FFFFFF));
    border: 1px solid color-mix(in srgb, var(--di-primary, #2563EB) 18%, var(--di-border, #E2E8F0));
    border-radius: 12px;
}

.payment-methods-info .info-card > .di-icon {
    flex-shrink: 0;
    color: var(--di-primary, #2563EB);
    margin-top: 2px;
}

.payment-methods-info .info-card > div {
    flex: 1;
    min-width: 0;
}

.payment-methods-info .info-card h5 {
    margin: 0 0 4px;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--di-text, #0F172A);
}

.payment-methods-info .info-card p {
    margin: 0;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--di-text-muted, #475569);
}

/* ============================================================
   BUTTON VARIANTS — theme guard
   Generic class names (.btn-secondary, .btn-outline) collide with
   theme classes that use theme-specific tokens (--primary, etc.).
   Plugin never declared rules for these variants, so theme wins by
   default. Add plugin rules scoped under our container so they win
   on specificity AND wire color to our --di-* tokens (brand color).
   ============================================================ */

/* Neutral button — Edit, Cancel, Set Primary, etc. */
.dimi-affiliate-dashboard-container .btn-secondary,
.dimi-affiliate-dashboard-container button.btn.btn-secondary {
    background: var(--di-surface-alt, #F1F5F9) !important;
    background-color: var(--di-surface-alt, #F1F5F9) !important;
    color: var(--di-text, #0F172A) !important;
    border: 1px solid var(--di-border, #E2E8F0) !important;
}
.dimi-affiliate-dashboard-container .btn-secondary:hover,
.dimi-affiliate-dashboard-container button.btn.btn-secondary:hover {
    background: var(--di-border, #E2E8F0) !important;
    background-color: var(--di-border, #E2E8F0) !important;
    color: var(--di-text, #0F172A) !important;
    border-color: var(--di-border-strong, #CBD5E1) !important;
}

/* Outline button — generic */
.dimi-affiliate-dashboard-container .btn-outline,
.dimi-affiliate-dashboard-container button.btn.btn-outline {
    background: transparent !important;
    background-color: transparent !important;
    color: var(--di-text, #0F172A) !important;
    border: 1px solid var(--di-border-strong, #CBD5E1) !important;
}
.dimi-affiliate-dashboard-container .btn-outline:hover,
.dimi-affiliate-dashboard-container button.btn.btn-outline:hover {
    background: var(--di-surface-alt, #F1F5F9) !important;
    background-color: var(--di-surface-alt, #F1F5F9) !important;
    color: var(--di-text, #0F172A) !important;
    border-color: var(--di-border-strong, #CBD5E1) !important;
}

/* Destructive outline — Remove buttons get danger affordance on hover */
.dimi-affiliate-dashboard-container .btn-outline.remove-payment-method,
.dimi-affiliate-dashboard-container .btn-outline.remove-bank-account,
.dimi-affiliate-dashboard-container .btn-outline[class*="remove-"] {
    color: var(--di-danger, #EF4444) !important;
    border-color: color-mix(in srgb, var(--di-danger, #EF4444) 35%, var(--di-border, #E2E8F0)) !important;
}
.dimi-affiliate-dashboard-container .btn-outline.remove-payment-method:hover,
.dimi-affiliate-dashboard-container .btn-outline.remove-bank-account:hover,
.dimi-affiliate-dashboard-container .btn-outline[class*="remove-"]:hover {
    background: var(--di-danger-soft, color-mix(in srgb, var(--di-danger, #EF4444) 10%, transparent)) !important;
    background-color: var(--di-danger-soft, color-mix(in srgb, var(--di-danger, #EF4444) 10%, transparent)) !important;
    color: var(--di-danger, #EF4444) !important;
    border-color: var(--di-danger, #EF4444) !important;
}

/* Size modifier */
.dimi-affiliate-dashboard-container .btn-sm,
.dimi-affiliate-dashboard-container button.btn.btn-sm {
    padding: 0.375rem 0.75rem !important;
    min-height: 32px !important;
    font-size: 0.8125rem !important;
}

/* Theme guard for the Referrals table — Blocksy and similar themes ship
   global table styles that strip plugin styling and constrain table
   width unexpectedly. Force every container in the chain to fill width. */
.dimi-affiliate-dashboard-container .referrals-card,
.referrals-card.referrals-card {
    width: 100% !important;
    overflow: hidden;
}
.referrals-card .referrals-table-wrapper,
.dimi-affiliate-dashboard-container .referrals-table-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    display: block !important;
    overflow-x: auto;
}
.dimi-affiliate-dashboard-container .referrals-card table,
.dimi-affiliate-dashboard-container .referrals-table,
.referrals-card table.referrals-table,
.referrals-card .referrals-table-wrapper table {
    display: table !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 100% !important;
    box-sizing: border-box !important;
    border: 0 !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    background: transparent !important;
    margin: 0 !important;
    box-shadow: none !important;
    outline: 0 !important;
    table-layout: auto;
}
.dimi-affiliate-dashboard-container .referrals-table th,
.dimi-affiliate-dashboard-container .referrals-table td,
.referrals-card .referrals-table th,
.referrals-card .referrals-table td {
    border-left: 0 !important;
    border-right: 0 !important;
    border-top: 0 !important;
    box-shadow: none !important;
    outline: 0 !important;
    background-image: none !important;
}
.referrals-card .referrals-table thead {
    display: table-header-group !important;
}
.referrals-card .referrals-table tbody {
    display: table-row-group !important;
    width: 100% !important;
}
/* `:not([style*="display: none"])` lets the inline filter logic
   (referrals-tab toolbar) actually hide rows. Without this, the
   theme guard's `display: table-row !important` overrode the JS's
   `row.style.display = 'none'`, so filter buttons appeared dead
   and the .referrals-table-empty marker (server-rendered with
   `style="display:none"`) was permanently visible. */
.referrals-card .referrals-table tr:not([style*="display: none"]):not([style*="display:none"]) {
    display: table-row !important;
}
.referrals-card .referrals-table th,
.referrals-card .referrals-table td {
    display: table-cell !important;
}
/* Stretch the last column so the row reaches the card's right edge */
.referrals-card .referrals-table .col-status {
    width: auto !important;
}
.referrals-card .referrals-table .col-date,
.referrals-card .referrals-table .col-order {
    width: 1% !important;
    white-space: nowrap;
}
.dimi-affiliate-dashboard-container .referrals-table tbody tr:last-child td,
.referrals-card .referrals-table tbody tr:last-child td {
    border-bottom: 0 !important;
}

/* ============================================================
   PAYOUT HISTORY / GENERIC DATA TABLE — theme guard
   Themes (Blocksy, recruitment, others) inject default `table`,
   `th`, `td` borders and backgrounds. Our `.data-table` (Payout
   History) and `.payouts-table` were rendering with a double
   border: our `.data-table-container` round outer border PLUS
   the theme's flat border on the inner `<table>` element, plus
   theme cell-borders producing vertical column lines.

   This block neutralises all theme-injected borders/backgrounds
   and forces the single-bottom-border row separator we draw
   ourselves. Selectors are doubled (.dimi-affiliate-dashboard-container
   + .payout-history-section) so it works in BOTH wrapped and
   ad-hoc contexts.
   ============================================================ */
.dimi-affiliate-dashboard-container .data-table-container,
.dimi-affiliate-dashboard-container .payout-history-section .data-table-container,
.payout-history-section .data-table-container {
    background: var(--di-surface, #fff) !important;
    border: 1px solid var(--di-border, #E2E8F0) !important;
    border-radius: 12px !important;
    /* overflow-x:auto so wide tables scroll horizontally on narrow
       viewports — same pattern as .referrals-table-wrapper. The theme
       guard previously used overflow:hidden which clipped silently. */
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch;
    margin-top: 1rem;
    box-shadow: none !important;
}
.dimi-affiliate-dashboard-container .data-table-container .data-table,
.dimi-affiliate-dashboard-container .payout-history-section table.data-table,
.payout-history-section table.data-table {
    display: table !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 100% !important;
    box-sizing: border-box !important;
    border: 0 !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    background: transparent !important;
    margin: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    outline: 0 !important;
    table-layout: auto;
}
.dimi-affiliate-dashboard-container .data-table thead,
.payout-history-section .data-table thead {
    display: table-header-group !important;
}
.dimi-affiliate-dashboard-container .data-table tbody,
.payout-history-section .data-table tbody {
    display: table-row-group !important;
    background: transparent !important;
}
/* See referrals-table guard above for the :not(…) rationale —
   preserves inline display:none so callers can hide rows via JS. */
.dimi-affiliate-dashboard-container .data-table tr:not([style*="display: none"]):not([style*="display:none"]),
.payout-history-section .data-table tr:not([style*="display: none"]):not([style*="display:none"]) {
    display: table-row !important;
    background: transparent !important;
}
.dimi-affiliate-dashboard-container .data-table th,
.dimi-affiliate-dashboard-container .data-table td,
.payout-history-section .data-table th,
.payout-history-section .data-table td {
    display: table-cell !important;
    border-left: 0 !important;
    border-right: 0 !important;
    border-top: 0 !important;
    border-bottom: 1px solid var(--di-border, #E2E8F0) !important;
    box-shadow: none !important;
    outline: 0 !important;
    background-image: none !important;
    padding: 1rem !important;
    text-align: left !important;
    vertical-align: middle !important;
    /* Prevent cell content (dates, currency, status badges) from
       wrapping. Combined with the wrapper's overflow-x:auto this
       lets the table grow wider than its container on narrow
       viewports and triggers a horizontal scrollbar — same trick
       the Referrals table uses on its col-date / col-order cells. */
    white-space: nowrap !important;
}
.dimi-affiliate-dashboard-container .data-table th,
.payout-history-section .data-table th {
    background: var(--di-surface-alt, #F9FAFB) !important;
    color: var(--di-text, #374151) !important;
    font-weight: 600 !important;
    font-size: 0.75rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}
.dimi-affiliate-dashboard-container .data-table td,
.payout-history-section .data-table td {
    background: var(--di-surface, #fff) !important;
    color: var(--di-text, #374151) !important;
    font-size: 0.875rem !important;
}
.dimi-affiliate-dashboard-container .data-table tbody tr:last-child td,
.payout-history-section .data-table tbody tr:last-child td {
    border-bottom: 0 !important;
}
.dimi-affiliate-dashboard-container .data-table tbody tr:hover td,
.payout-history-section .data-table tbody tr:hover td {
    background: var(--di-surface-alt, #F9FAFB) !important;
}

/* Same guard applied to legacy `.payouts-table` markup */
.dimi-affiliate-dashboard-container table.payouts-table,
.payout-history-section table.payouts-table {
    display: table !important;
    width: 100% !important;
    max-width: 100% !important;
    border: 0 !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    background: transparent !important;
    margin: 0 !important;
    box-shadow: none !important;
    outline: 0 !important;
}
.dimi-affiliate-dashboard-container .payouts-table th,
.dimi-affiliate-dashboard-container .payouts-table td,
.payout-history-section .payouts-table th,
.payout-history-section .payouts-table td {
    display: table-cell !important;
    border-left: 0 !important;
    border-right: 0 !important;
    border-top: 0 !important;
    border-bottom: 1px solid var(--di-border, #E2E8F0) !important;
    box-shadow: none !important;
    outline: 0 !important;
    padding: 1rem !important;
    text-align: left !important;
}
.dimi-affiliate-dashboard-container .payouts-table th,
.payout-history-section .payouts-table th {
    background: var(--di-surface-alt, #F9FAFB) !important;
    color: var(--di-text, #374151) !important;
    font-weight: 600 !important;
    font-size: 0.75rem !important;
    text-transform: uppercase !important;
}
.dimi-affiliate-dashboard-container .payouts-table tbody tr:last-child td,
.payout-history-section .payouts-table tbody tr:last-child td {
    border-bottom: 0 !important;
}

/* Section heading inside payout-history-section */
.dimi-affiliate-dashboard-container .payout-history-section,
.payout-history-section {
    margin-top: 1.5rem;
}
.dimi-affiliate-dashboard-container .payout-history-section > h3,
.payout-history-section > h3 {
    margin: 0 0 0.75rem !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    color: var(--di-text, #0F172A) !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
}

/* ============================================================
   REFERRALS TAB — redesigned (summary + filters + clean table)
   ============================================================ */
.referrals-tab .referrals-header {
    margin-bottom: 16px;
}

.referrals-tab .tab-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 6px 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--di-text, #0F172A);
}

.referrals-tab .referrals-subtitle {
    margin: 0;
    color: var(--di-text-muted, #475569);
    font-size: 0.875rem;
}

/* Summary strip — Referrals TAB only. Without the `.referrals-tab`
   scope this rule turned the Overview tab's recent-referrals list
   (same `.referrals-summary` class) into a 180px-min grid, which
   wrapped the list items into a weird multi-column block instead
   of a clean vertical list. Scoping the rule here fixes the
   overview without touching the referrals tab's stat strip. */
.referrals-tab .referrals-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.ref-stat {
    background: var(--di-surface, #FFFFFF);
    border: 1px solid var(--di-border, #E2E8F0);
    border-radius: 12px;
    padding: 16px 18px;
    transition: border-color 150ms ease-out, box-shadow 150ms ease-out;
}

.ref-stat:hover {
    border-color: color-mix(in srgb, var(--di-primary, #2563EB) 25%, var(--di-border, #E2E8F0));
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

.ref-stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--di-text-muted, #475569);
    margin-bottom: 6px;
}

.ref-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--di-text, #0F172A);
    line-height: 1.2;
    margin-bottom: 4px;
}

.ref-stat-meta {
    font-size: 0.75rem;
    color: var(--di-text-subtle, #64748B);
}

.ref-stat-accent {
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--di-primary, #2563EB) 8%, var(--di-surface, #FFFFFF)),
        var(--di-surface, #FFFFFF));
    border-color: color-mix(in srgb, var(--di-primary, #2563EB) 25%, var(--di-border, #E2E8F0));
}

.ref-stat-accent .ref-stat-value {
    color: var(--di-primary, #2563EB);
}

/* Filter toolbar */
.referrals-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
    padding: 10px 14px;
    background: var(--di-surface, #FFFFFF);
    border: 1px solid var(--di-border, #E2E8F0);
    border-radius: 12px;
}

.referrals-filters {
    display: inline-flex;
    gap: 6px;
    flex-wrap: wrap;
}

.ref-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: transparent;
    border: 1px solid var(--di-border, #E2E8F0);
    border-radius: 999px;
    color: var(--di-text-muted, #475569);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background 150ms ease-out, color 150ms ease-out, border-color 150ms ease-out;
}

.ref-pill:hover {
    background: var(--di-surface-alt, #F1F5F9);
    color: var(--di-text, #0F172A);
    text-decoration: none;
}

.referrals-search-form {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
}

/* Date range filter (bootstrap-daterangepicker trigger) */
.referrals-daterange {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    background: var(--di-surface-alt, #F1F5F9);
    border: 1px solid transparent;
    border-radius: 999px;
    transition: background 150ms ease-out, border-color 150ms ease-out;
}

.referrals-daterange:focus-within {
    background: var(--di-surface, #FFFFFF);
    border-color: var(--di-primary, #2563EB);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--di-primary, #2563EB) 12%, transparent);
}

.referrals-daterange .di-icon {
    color: var(--di-text-subtle, #64748B);
    flex-shrink: 0;
}

.referrals-tab .referrals-daterange .referrals-daterange-input {
    flex: 1 !important;
    min-width: 150px !important;
    border: 0 !important;
    background: transparent !important;
    outline: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    height: auto !important;
    font-family: inherit !important;
    font-size: 0.875rem !important;
    font-weight: 400 !important;
    line-height: 1.4 !important;
    color: var(--di-text, #0F172A) !important;
    cursor: pointer;
}

.referrals-tab .referrals-daterange .referrals-daterange-input::placeholder {
    color: var(--di-text-subtle, #64748B) !important;
    opacity: 1 !important;
}

/* Mobile: stack the referrals toolbar. (The date-range picker dropdown itself
   is insulated by daterangepicker-reset.css and skinned in
   referrals-daterange-skin.css — both loaded after the vendor stylesheet.) */
@media (max-width: 600px) {
    /* Stack the toolbar: pills row, then full-width date field + search. */
    .referrals-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .referrals-toolbar .referrals-filters {
        width: 100%;
    }

    .referrals-search-form {
        width: 100%;
    }

    .referrals-search-form .referrals-daterange,
    .referrals-search-form .referrals-search {
        flex: 1 1 100%;
        width: 100%;
        box-sizing: border-box;
    }
}

.ref-pill.is-active {
    background: var(--di-primary, #2563EB);
    background-color: var(--di-primary, #2563EB);
    border-color: var(--di-primary, #2563EB);
    color: #fff;
}

.ref-pill-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 18px;
    padding: 0 6px;
    border-radius: 999px;
    background: color-mix(in srgb, currentColor 12%, transparent);
    font-size: 0.6875rem;
    font-weight: 600;
}

.ref-pill.is-active .ref-pill-count {
    background: rgba(255, 255, 255, 0.22);
}

.referrals-search {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    background: var(--di-surface-alt, #F1F5F9);
    border: 1px solid transparent;
    border-radius: 999px;
    min-width: 220px;
    transition: background 150ms ease-out, border-color 150ms ease-out;
}

.referrals-search:focus-within {
    background: var(--di-surface, #FFFFFF);
    border-color: var(--di-primary, #2563EB);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--di-primary, #2563EB) 12%, transparent);
}

.referrals-search .di-icon {
    color: var(--di-text-subtle, #64748B);
    flex-shrink: 0;
}

/* Custom clear (×) button — replaces the inconsistent native one */
.referrals-search input[type="search"]::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
}

.referrals-search-clear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: color-mix(in srgb, currentColor 12%, transparent);
    color: var(--di-text-subtle, #64748B);
    font-size: 0.9rem;
    line-height: 1;
    text-decoration: none;
    transition: background 150ms ease-out, color 150ms ease-out;
}

.referrals-search-clear:hover {
    background: var(--di-primary, #2563EB);
    color: #fff;
    text-decoration: none;
}

/* Search input — bumped specificity + !important on theme-overridable
   props because Recruitment/main.min.css applies a
   `select, textarea, input:is([type=search]...)` rule at the same
   (0,0,1,1) specificity that wins source order otherwise. */
.referrals-tab .referrals-search input,
.referrals-tab .referrals-search input[type="search"] {
    flex: 1 !important;
    border: 0 !important;
    background: transparent !important;
    outline: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    height: auto !important;
    min-width: 0 !important;
    width: 100% !important;
    font-family: inherit !important;
    font-size: 0.875rem !important;
    font-weight: 400 !important;
    line-height: 1.4 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
    color: var(--di-text, #0F172A) !important;
}

.referrals-tab .referrals-search input::placeholder {
    color: var(--di-text-subtle, #64748B) !important;
    opacity: 1 !important;
}

.referrals-tab .referrals-search input:focus {
    box-shadow: none !important;
    outline: none !important;
}

/* Table card */
.referrals-card {
    background: var(--di-surface, #FFFFFF);
    border: 1px solid var(--di-border, #E2E8F0);
    border-radius: 12px;
    overflow: hidden;
}

/* Result count summary */
.referrals-table-summary {
    padding: 12px 16px;
    font-size: 0.8125rem;
    color: var(--di-text-muted, #475569);
    border-bottom: 1px solid var(--di-border, #E2E8F0);
    background: var(--di-surface-alt, #F1F5F9);
}

/* Pagination */
.referrals-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    border-top: 1px solid var(--di-border, #E2E8F0);
}

.referrals-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border: 1px solid var(--di-border, #E2E8F0);
    border-radius: 8px;
    color: var(--di-text-muted, #475569);
    font-size: 0.8125rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 150ms ease-out, color 150ms ease-out, border-color 150ms ease-out;
}

.referrals-pagination a.page-numbers:hover {
    background: var(--di-surface-alt, #F1F5F9);
    color: var(--di-text, #0F172A);
}

.referrals-pagination .page-numbers.current {
    background: var(--di-primary, #2563EB);
    border-color: var(--di-primary, #2563EB);
    color: #fff;
}

.referrals-pagination .page-numbers.dots {
    border-color: transparent;
}

.referrals-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.referrals-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.875rem;
}

.referrals-table thead th {
    background: var(--di-surface-alt, #F1F5F9);
    color: var(--di-text-muted, #475569);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-align: left;
    padding: 12px 16px;
    border-bottom: 1px solid var(--di-border, #E2E8F0);
    white-space: nowrap;
}

.referrals-table thead th.num {
    text-align: right;
}

.referrals-table tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--di-border, #E2E8F0);
    vertical-align: middle;
    color: var(--di-text, #0F172A);
}

.referrals-table tbody td.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.referrals-table tbody tr:last-child td {
    border-bottom: 0;
}

.referrals-table tbody tr:hover td {
    background: color-mix(in srgb, var(--di-primary, #2563EB) 3%, transparent);
}

.referrals-table .cell-primary {
    font-weight: 500;
    line-height: 1.3;
}

.referrals-table .cell-secondary {
    font-size: 0.75rem;
    color: var(--di-text-subtle, #64748B);
    margin-top: 2px;
}

.referrals-table .order-id {
    display: inline-block;
    padding: 3px 8px;
    background: var(--di-surface-alt, #F1F5F9);
    border-radius: 6px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.8125rem;
    color: var(--di-text, #0F172A);
}

.referrals-table .col-amount,
.referrals-table .col-commission {
    font-weight: 500;
}

.referrals-table .col-commission {
    color: var(--di-primary, #2563EB);
    font-weight: 600;
}

/* Status pills */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.status-pill .status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

.status-pill.status-confirmed {
    background: color-mix(in srgb, var(--di-success, #10B981) 14%, transparent);
    color: #047857;
}

.status-pill.status-pending {
    background: color-mix(in srgb, var(--di-warning, #F59E0B) 16%, transparent);
    color: #92400E;
}

.status-pill.status-cancelled,
.status-pill.status-refunded {
    background: var(--di-surface-alt, #F1F5F9);
    color: var(--di-text-muted, #475569);
}

.status-pill.status-rejected {
    background: color-mix(in srgb, var(--di-danger, #EF4444) 14%, transparent);
    color: #991B1B;
}

/* Empty states */
.referrals-empty {
    text-align: center;
    padding: 48px 24px;
    color: var(--di-text-muted, #475569);
}

.referrals-empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: var(--di-primary-soft, color-mix(in srgb, var(--di-primary, #2563EB) 10%, transparent));
    color: var(--di-primary, #2563EB);
}

.referrals-empty h3 {
    margin: 0 0 6px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--di-text, #0F172A);
}

.referrals-empty p {
    margin: 0;
    font-size: 0.875rem;
    max-width: 360px;
    margin-inline: auto;
    line-height: 1.5;
}

.referrals-empty--inline {
    padding: 32px 16px;
}

.referrals-empty--inline .di-icon {
    color: var(--di-text-subtle, #64748B);
    margin-bottom: 8px;
}

/* ============================================================
   SHARE MENU — dropdown + toast for the header Share button
   ============================================================ */
.share-wrapper {
    position: relative;
    display: inline-block;
}

.share-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    background: var(--di-surface, #FFFFFF);
    border: 1px solid var(--di-border, #E2E8F0);
    border-radius: 12px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14), 0 2px 6px rgba(15, 23, 42, 0.06);
    padding: 6px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 2px;
    animation: dimiShareMenuIn 140ms ease-out;
}

.share-menu[hidden] {
    display: none;
}

@keyframes dimiShareMenuIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.share-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border: 0;
    background: transparent;
    color: var(--di-text, #0F172A);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    width: 100%;
    transition: background 120ms ease-out, color 120ms ease-out;
}

.share-item:hover,
.share-item:focus-visible {
    background: var(--di-surface-alt, #F1F5F9);
    color: var(--di-text, #0F172A);
    outline: none;
    text-decoration: none;
}

.share-item:focus-visible {
    box-shadow: 0 0 0 2px var(--di-primary, #2563EB);
}

.share-item .di-icon {
    color: var(--di-text-muted, #475569);
    flex-shrink: 0;
}

.share-item[data-share-action="copy"] .di-icon {
    color: var(--di-primary, #2563EB);
}

/* Toast */
.dimi-share-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    padding: 12px 16px;
    background: var(--di-text, #0F172A);
    color: #fff;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.25);
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 200ms ease-out, transform 200ms ease-out;
    pointer-events: none;
}

.dimi-share-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.dimi-share-toast--error {
    background: var(--di-danger, #EF4444);
}

@media (max-width: 640px) {
    .share-menu {
        right: 0;
        left: auto;
        min-width: min(280px, calc(100vw - 24px));
    }
    .dimi-share-toast {
        top: auto;
        bottom: 20px;
        left: 50%;
        right: auto;
        transform: translate(-50%, 8px);
    }
    .dimi-share-toast.is-visible {
        transform: translate(-50%, 0);
    }
}

/* Mobile collapse */
@media (max-width: 640px) {
    .referrals-table thead {
        display: none;
    }
    .referrals-table tbody td {
        display: block;
        padding: 6px 14px;
        border: 0;
        text-align: left !important;
    }
    .referrals-table tbody td::before {
        content: attr(data-label);
        display: block;
        font-size: 0.6875rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: var(--di-text-muted, #475569);
        margin-bottom: 2px;
    }
    .referrals-table tbody tr {
        display: block;
        padding: 12px 0;
        border-bottom: 1px solid var(--di-border, #E2E8F0);
    }
    .referrals-table tbody tr:last-child {
        border-bottom: 0;
    }
}

/* ============================================================
   RESPONSIVE CONSOLIDATION — mobile-first overhaul
   Standard breakpoints: 640 / 768 / 1024 / 1280
   Touch targets: ≥44×44 below 768
   ============================================================ */

/* === Mobile base (320-639) === */
.dimi-affiliate-dashboard-container {
    padding: 0;
}

.dashboard-layout {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
    padding: 0.75rem !important;
}

.dashboard-sidebar {
    position: fixed !important;
    top: 0;
    left: 0;
    width: min(85vw, 320px);
    height: 100vh;
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 250ms ease-out;
    border-radius: 0 !important;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.dashboard-sidebar.active {
    transform: translateX(0);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    z-index: 999;
    backdrop-filter: blur(2px);
}

.sidebar-overlay.active {
    display: block;
}

.mobile-menu-toggle {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    border-radius: 8px;
}

/* Grids — single column on mobile */
.stats-grid,
.kpi-grid,
.quick-actions-grid,
.activity-grid {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
}

/* Stat / KPI cards — tighten padding, hide hover lift */
.stat-card,
.kpi-card,
.action-card,
.activity-card {
    padding: 1rem !important;
}

.stat-card:hover,
.kpi-card:hover {
    transform: none !important;
}

.stat-value,
.kpi-value {
    font-size: 1.5rem !important;
}

.stat-title,
.kpi-label {
    font-size: 0.75rem !important;
}

/* Section spacing */
.dashboard-content,
.main-content {
    padding: 0.75rem !important;
}

.section-title,
.tab-title {
    font-size: 1.125rem !important;
    margin-bottom: 0.75rem !important;
}

/* Header — slim sticky bar on mobile (icon | title | action) */
.main-header {
    padding: 0.5rem 0.75rem !important;
    min-height: 56px !important;
    gap: 0.5rem !important;
}

.breadcrumb {
    font-size: 0.9375rem !important;
}

.breadcrumb-home {
    display: none !important; /* free up space on narrow screens */
}

.main-actions,
.header-actions {
    gap: 0.375rem !important;
}

/* Share button collapses to icon-only on mobile */
.share-btn {
    padding: 0 !important;
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px !important;
    justify-content: center !important;
    border-radius: 10px !important;
}

.share-btn-label {
    display: none;
}

/* Dashboard header (alt layout) — keep flex row but tighten */
.dashboard-header {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.5rem !important;
    padding: 0.75rem !important;
}

.header-actions .btn,
.header-actions .logout-btn {
    flex: 1 1 auto;
    min-height: 44px;
    justify-content: center;
}

/* Affiliate link copy block — stack input + button */
.input-group {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.5rem !important;
}

.input-group input {
    width: 100% !important;
    min-height: 44px;
    font-size: 16px !important; /* prevent iOS zoom on focus */
}

.input-group .copy-btn,
.input-group .btn {
    width: 100%;
    min-height: 44px;
    justify-content: center;
}

/* All buttons — touch-sized */
.btn,
.copy-btn,
.login-submit-btn,
button.di-theme-toggle,
.request-payout-btn,
.action-btn {
    min-height: 44px;
    padding: 0.625rem 1rem !important;
    font-size: 0.9375rem !important;
}

/* Forms */
.form-group input,
.form-group select,
.form-group textarea {
    width: 100% !important;
    min-height: 44px;
    font-size: 16px !important;
}

/* Tables — horizontal scroll wrapper */
.dimi-affiliate-dashboard-container table,
.dashboard-content table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
}

/* Quick actions inside action cards */
.action-card .action-header {
    flex-wrap: wrap;
}

/* Recent activity lists */
.recent-activity-section {
    margin-top: 1rem;
}

/* === Tablet portrait (≥640) === */
@media (min-width: 640px) {
    .dashboard-layout {
        padding: 1rem !important;
    }

    .stats-grid,
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem !important;
    }

    .quick-actions-grid {
        grid-template-columns: 1fr !important;
    }

    .activity-grid {
        grid-template-columns: 1fr !important;
    }

    .main-header,
    .dashboard-header {
        flex-direction: row !important;
        align-items: center !important;
    }

    .main-actions,
    .header-actions {
        width: auto;
    }

    .main-actions .btn,
    .header-actions .btn,
    .share-btn,
    .logout-btn {
        flex: 0 0 auto;
    }

    .input-group {
        flex-direction: row !important;
    }

    .input-group .copy-btn,
    .input-group .btn {
        width: auto;
        flex-shrink: 0;
    }

    .stat-value,
    .kpi-value {
        font-size: 1.75rem !important;
    }
}

/* === Tablet landscape (≥768) === */
@media (min-width: 768px) {
    .quick-actions-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .activity-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .dashboard-content,
    .main-content {
        padding: 1.25rem !important;
    }

    .section-title,
    .tab-title {
        font-size: 1.25rem !important;
    }
}

/* === Desktop (≥1024) — flush left sidebar app shell === */
@media (min-width: 1024px) {
    .dimi-affiliate-dashboard-container {
        display: flex !important;
        align-items: stretch;
    }

    .dashboard-sidebar {
        position: sticky !important;
        top: 0 !important;
        left: auto;
        width: 260px !important;
        height: 100vh;
        max-height: 100vh;
        flex-shrink: 0;
        transform: none !important;
        border-radius: 0 !important;
        border-right: 1px solid var(--di-border, #E2E8F0);
        box-shadow: none;
        z-index: auto;
        transition: none;
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    .dashboard-main {
        flex: 1;
        min-width: 0;
    }

    .sidebar-overlay {
        display: none !important;
    }

    .mobile-menu-toggle {
        display: none !important;
    }

    /* Restore desktop main-header (revert mobile-base !important) */
    .main-header {
        padding: 0.75rem 1.5rem !important;
        min-height: 64px !important;
        gap: 1rem !important;
    }

    .breadcrumb {
        font-size: 1rem !important;
    }

    .breadcrumb-home {
        display: inline-flex !important;
    }

    .share-btn {
        width: auto;
        min-width: 0;
        padding: 0.5rem 1rem !important;
        border-radius: 10px !important;
    }

    .share-btn-label {
        display: inline;
    }

    .stats-grid,
    .kpi-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 1.25rem !important;
    }

    .stat-card:hover,
    .kpi-card:hover {
        transform: translateY(-2px) !important;
    }

    .stat-value,
    .kpi-value {
        font-size: 2rem !important;
    }

    .dashboard-content,
    .main-content {
        padding: 2rem !important;
    }
}

/* === Wide desktop (≥1280) === */
@media (min-width: 1280px) {
    .dashboard-sidebar {
        width: 280px !important;
    }
}

/* === Accessibility: respect reduced motion === */
@media (prefers-reduced-motion: reduce) {
    .dashboard-sidebar {
        transition: none !important;
    }
    .stat-card:hover,
    .kpi-card:hover,
    .action-card:hover {
        transform: none !important;
    }
}

/* ════════════════════════════════════════════════════════════════════
   THEME FIREWALL — placed last so it wins source-order ties
   ════════════════════════════════════════════════════════════════════
   Plugins live inside whatever theme the merchant runs (Blocksy, Astra,
   recruitment, etc.). Themes inject styles directly on element selectors
   (`table`, `th`, `td`, `input`, `button`, `a`, `h1-h6`, `ul`, `li`, …)
   which leak into our plugin's UI and cause: double borders, wrong text
   colors, unwanted margins, theme-colored buttons inside our modal, etc.

   Strategy: reset the handful of properties themes commonly set,
   scoped under `.dimi-affiliate-dashboard-container` so it cannot
   touch the rest of the page. Properties our own plugin rules
   explicitly set are reset to `revert-layer`/`unset` so the cascade
   re-applies our values from the previous rules in this file.

   NOTE: modals (`#payment-selection-modal`, `.modal-overlay`) are
   appended to <body> and live OUTSIDE this container — they are
   protected by their own ID/class-scoped rule blocks earlier in
   this file. Do NOT add modal selectors here.
   ════════════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────────────────
   1. Tables — neutralise theme `table`/`th`/`td` border / background.
   Bare element selectors only; plugin's `.referrals-table`,
   `.data-table`, `.payouts-table` already have explicit rules that
   will paint borders where we want them.
   ───────────────────────────────────────────────────────────────── */
.dimi-affiliate-dashboard-container table,
.dimi-affiliate-dashboard-container thead,
.dimi-affiliate-dashboard-container tbody,
.dimi-affiliate-dashboard-container tfoot,
.dimi-affiliate-dashboard-container tr,
.dimi-affiliate-dashboard-container th,
.dimi-affiliate-dashboard-container td {
    border: 0 !important;
    background-image: none !important;
    box-shadow: none !important;
    outline: 0 !important;
}
/* Re-establish the table-collapse + bottom-border-only row separator
   for any table that has a plugin class. Specific table rules later
   (or earlier with !important) override this. */
.dimi-affiliate-dashboard-container table {
    border-collapse: separate !important;
    border-spacing: 0 !important;
}

/* ─────────────────────────────────────────────────────────────────
   2. Form inputs — themes love to add 2px borders, custom focus rings,
   colored backgrounds, oversized padding. We use `:where()` so this
   block contributes ZERO specificity — it's a true default that any
   plugin class rule (e.g. .form-group input[type="text"], which has
   specificity 0,0,2,1) wins against regardless of source order.

   Why: writing the bare `.container input[type="text"]` form gives
   specificity 0,0,2,1 — equal to `.form-group input[type="text"]` —
   and source order would flip the cascade. `:where()` avoids that.
   ───────────────────────────────────────────────────────────────── */
.dimi-affiliate-dashboard-container :where(
    input[type="text"],
    input[type="email"],
    input[type="url"],
    input[type="tel"],
    input[type="password"],
    input[type="number"],
    input[type="search"],
    input[type="date"],
    textarea,
    select
) {
    background: var(--di-surface, #FFFFFF);
    color: var(--di-text, #0F172A);
    border: 1px solid var(--di-border, #E2E8F0);
    border-radius: 8px;
    box-shadow: none;
    outline: 0;
    font-family: inherit;
    font-size: 0.875rem;
    line-height: 1.5;
    padding: 0.5rem 0.75rem;
    box-sizing: border-box;
    max-width: 100%;
}
.dimi-affiliate-dashboard-container :where(
    input[type="text"],
    input[type="email"],
    input[type="url"],
    input[type="tel"],
    input[type="password"],
    input[type="number"],
    input[type="search"],
    input[type="date"],
    textarea,
    select
):focus {
    border-color: var(--di-primary, #2563EB);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--di-primary, #2563EB) 18%, transparent);
    outline: 0;
}

/* ─────────────────────────────────────────────────────────────────
   3. Buttons — themes touch `button`, `input[type=submit]`, sometimes
   `.button`. Plugin's `.btn` already has its own theme-guard block
   (search "BUTTON VARIANTS — theme guard" earlier in this file).

   Here we only reset bare <button> elements with NO class at all —
   anything classed is left alone so plugin/3rd-party class rules
   keep ownership. Wrapped in :where() = zero specificity.
   ───────────────────────────────────────────────────────────────── */
.dimi-affiliate-dashboard-container :where(button:not([class])) {
    background: transparent;
    border: 0;
    color: inherit;
    font-family: inherit;
    font-size: inherit;
    padding: 0;
    margin: 0;
    cursor: pointer;
    outline: 0;
}

/* ─────────────────────────────────────────────────────────────────
   4. Headings — neutralise theme heading margins/colors so they
   don't fight our card/section spacing. Wrapped in :where() so
   plugin heading rules (e.g. .stats-header h2) win regardless of
   source order — this block is a pure default, not an override.
   ───────────────────────────────────────────────────────────────── */
.dimi-affiliate-dashboard-container :where(h1, h2, h3, h4, h5, h6) {
    color: var(--di-text, #0F172A);
    font-family: inherit;
    line-height: 1.3;
    background: transparent;
    border: 0;
    text-shadow: none;
    text-transform: none;
}

/* ─────────────────────────────────────────────────────────────────
   5. Paragraphs / lists — bare elements only via :where().
   ───────────────────────────────────────────────────────────────── */
.dimi-affiliate-dashboard-container :where(p) {
    color: var(--di-text, #0F172A);
    font-family: inherit;
    line-height: 1.5;
}
.dimi-affiliate-dashboard-container :where(ul:not([class]), ol:not([class])) {
    margin: 0 0 1rem;
    padding-left: 1.25rem;
}
.dimi-affiliate-dashboard-container :where(li:not([class])) {
    margin: 0 0 0.25rem;
    color: var(--di-text, #0F172A);
}

/* ─────────────────────────────────────────────────────────────────
   6. Links — themes pick brand colors. Force our token, but only
   for unstyled <a> (so nav/button-shaped links keep their classes).
   Wrapped in :where() so it's a pure default.
   ───────────────────────────────────────────────────────────────── */
.dimi-affiliate-dashboard-container :where(a:not([class])) {
    color: var(--di-primary, #2563EB);
    text-decoration: none;
    transition: color 150ms ease-out;
}
.dimi-affiliate-dashboard-container :where(a:not([class])):hover {
    color: var(--di-primary-hover, #1D4ED8);
    text-decoration: underline;
}

/* ─────────────────────────────────────────────────────────────────
   7. Form / fieldset / legend / label — kill theme borders/legends.
   `form` and `fieldset` borders are KILLED (themes routinely add
   ugly borders), the rest are defaults via :where().
   ───────────────────────────────────────────────────────────────── */
.dimi-affiliate-dashboard-container form,
.dimi-affiliate-dashboard-container fieldset {
    border: 0;
    background: transparent;
    box-shadow: none;
}
.dimi-affiliate-dashboard-container :where(fieldset) {
    margin: 0;
    padding: 0;
}
.dimi-affiliate-dashboard-container :where(legend) {
    padding: 0;
}
.dimi-affiliate-dashboard-container :where(label) {
    color: var(--di-text, #0F172A);
    font-family: inherit;
}

/* ─────────────────────────────────────────────────────────────────
   8. Code / pre — theme may add bg + padding. Default only.
   ───────────────────────────────────────────────────────────────── */
.dimi-affiliate-dashboard-container :where(code, pre) {
    background: var(--di-surface-alt, #F1F5F9);
    color: var(--di-text, #0F172A);
    border: 0;
    border-radius: 4px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.8125rem;
    padding: 0.125rem 0.375rem;
}

/* ─────────────────────────────────────────────────────────────────
   9. Images / SVG — theme may stretch / add filters. Default only.
   ───────────────────────────────────────────────────────────────── */
.dimi-affiliate-dashboard-container :where(img) {
    max-width: 100%;
    height: auto;
    border: 0;
    filter: none;
}
.dimi-affiliate-dashboard-container :where(svg.di-icon) {
    /* Don't force stroke OR fill globally — let each SVG file's
       native attributes drive rendering (Lucide outline icons use
       stroke="currentColor" + fill="none"; brand glyphs like the
       PayPal logo use fill="currentColor"). Forcing stroke here
       drew an unwanted outline on filled icons; forcing fill
       erased outline-only icons. */
    width: 1em;
    height: 1em;
    vertical-align: -0.125em;
}

/* ─────────────────────────────────────────────────────────────────
  10. HR — theme often draws colored 2px rules.
   ───────────────────────────────────────────────────────────────── */
.dimi-affiliate-dashboard-container :where(hr) {
    border: 0;
    border-top: 1px solid var(--di-border, #E2E8F0);
    background: transparent;
    height: 0;
    margin: 1rem 0;
}

/* ─────────────────────────────────────────────────────────────────
  11. Selection / scrollbar polish — match brand.
   ───────────────────────────────────────────────────────────────── */
.dimi-affiliate-dashboard-container ::selection {
    background: color-mix(in srgb, var(--di-primary, #2563EB) 25%, transparent);
    color: var(--di-text, #0F172A);
}

/* ─────────────────────────────────────────────────────────────────
  12. Box-sizing — keep all plugin elements predictable regardless
  of theme reset state.
   ───────────────────────────────────────────────────────────────── */
.dimi-affiliate-dashboard-container,
.dimi-affiliate-dashboard-container *,
.dimi-affiliate-dashboard-container *::before,
.dimi-affiliate-dashboard-container *::after {
    box-sizing: border-box;
}

/* ════════════════════════════════════════════════════════════════════
   UTM TRACKING FIELDS — Product Link Generator (v1.10.x)
   Collapsible <details> block; closed by default.
   Two-column grid on desktop, single column on mobile.
   ════════════════════════════════════════════════════════════════════ */
.dimi-affiliate-dashboard-container .utm-fields {
    margin: 12px 0 16px;
    padding: 0;
    background: var(--di-surface-alt, #F8FAFC);
    border: 1px solid var(--di-border, #E2E8F0);
    border-radius: 10px;
    overflow: hidden;
}
.dimi-affiliate-dashboard-container .utm-fields[open] {
    background: var(--di-surface, #FFFFFF);
}

.dimi-affiliate-dashboard-container .utm-fields__summary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    cursor: pointer;
    list-style: none;
    user-select: none;
    color: var(--di-text, #0F172A);
    font-weight: 600;
    font-size: 0.875rem;
    transition: background-color 150ms ease-out;
}
.dimi-affiliate-dashboard-container .utm-fields__summary:hover {
    background: color-mix(in srgb, var(--di-primary, #2563EB) 4%, transparent);
}
.dimi-affiliate-dashboard-container .utm-fields__summary::-webkit-details-marker {
    display: none;
}
.dimi-affiliate-dashboard-container .utm-fields__summary::after {
    content: "▾";
    margin-left: auto;
    font-size: 0.75rem;
    color: var(--di-text-muted, #475569);
    transition: transform 150ms ease-out;
}
.dimi-affiliate-dashboard-container .utm-fields[open] .utm-fields__summary::after {
    transform: rotate(180deg);
}
.dimi-affiliate-dashboard-container .utm-fields__summary small {
    font-weight: 400;
    color: var(--di-text-muted, #475569);
    font-size: 0.75rem;
}
.dimi-affiliate-dashboard-container .utm-fields__summary .di-icon {
    color: var(--di-primary, #2563EB);
}

.dimi-affiliate-dashboard-container .utm-fields__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    padding: 4px 16px 16px;
    border-top: 1px solid var(--di-border, #E2E8F0);
}
.dimi-affiliate-dashboard-container .utm-fields__grid .form-group {
    margin: 0;
}
.dimi-affiliate-dashboard-container .utm-fields__grid .form-group--full {
    grid-column: 1 / -1;
}
.dimi-affiliate-dashboard-container .utm-fields__grid label {
    display: block;
    margin-bottom: 4px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--di-text, #0F172A);
}
.dimi-affiliate-dashboard-container .utm-fields__grid input[type="text"] {
    width: 100%;
    padding: 8px 12px;
    background: var(--di-surface, #FFFFFF);
    border: 1px solid var(--di-border, #E2E8F0);
    border-radius: 8px;
    color: var(--di-text, #0F172A);
    font-size: 0.875rem;
    font-family: inherit;
    transition: border-color 150ms ease-out, box-shadow 150ms ease-out;
}
.dimi-affiliate-dashboard-container .utm-fields__grid input[type="text"]:focus {
    outline: 0;
    border-color: var(--di-primary, #2563EB);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--di-primary, #2563EB) 16%, transparent);
}
.dimi-affiliate-dashboard-container .utm-fields__grid input::placeholder {
    color: var(--di-text-subtle, #94A3B8);
}
.dimi-affiliate-dashboard-container .utm-fields__grid small {
    display: block;
    margin-top: 4px;
    font-size: 0.75rem;
    color: var(--di-text-muted, #475569);
    line-height: 1.4;
}
.dimi-affiliate-dashboard-container .utm-fields .optional-label {
    font-weight: 400;
    color: var(--di-text-muted, #475569);
    font-size: 0.6875rem;
}

@media (max-width: 640px) {
    .dimi-affiliate-dashboard-container .utm-fields__grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

/* ════════════════════════════════════════════════════════════════════
   CAMPAIGNS TAB — unified card list (v1.10.x)
   One card per generated link. Each card combines: title + UTM tags
   + creation date, the URL with copy button, and a 4-stat row
   (Clicks / Conversions / Revenue / CVR). Replaces the prior split
   of aggregate-table + recent-links-table.
   ════════════════════════════════════════════════════════════════════ */
/* Responsive grid: auto-fit lays out 1/2/3 columns based on viewport.
   Min card width 300px = "compact mobile-sized card" that's also
   readable. Cards fill the row evenly (1fr) so a lone card on a
   half-empty last row stretches rather than orphaning at min-width. */
.dimi-affiliate-dashboard-container .utm-card-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 14px;
    margin-top: 16px;
}

.dimi-affiliate-dashboard-container .utm-card {
    background: var(--di-surface, #FFFFFF);
    border: 1px solid var(--di-border, #E2E8F0);
    border-radius: 12px;
    padding: 14px 16px 16px;
    transition: border-color 150ms ease-out, box-shadow 150ms ease-out;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.dimi-affiliate-dashboard-container .utm-card:hover {
    border-color: color-mix(in srgb, var(--di-primary, #2563EB) 35%, var(--di-border, #E2E8F0));
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

.dimi-affiliate-dashboard-container .utm-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}
.dimi-affiliate-dashboard-container .utm-card__title-wrap {
    min-width: 0;
    flex: 1;
}
.dimi-affiliate-dashboard-container .utm-card__title {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--di-text, #0F172A);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dimi-affiliate-dashboard-container .utm-card__tags {
    display: block;
    margin-top: 2px;
    font-size: 0.6875rem;
    color: var(--di-text-muted, #475569);
    text-transform: lowercase;
    letter-spacing: 0.02em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dimi-affiliate-dashboard-container .utm-card__date {
    flex-shrink: 0;
    font-size: 0.6875rem;
    color: var(--di-text-muted, #475569);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.dimi-affiliate-dashboard-container .utm-card__url-row {
    display: flex;
    gap: 6px;
    align-items: stretch;
    margin-bottom: 12px;
}
.dimi-affiliate-dashboard-container .utm-card__url {
    flex: 1;
    min-width: 0;
    padding: 7px 10px !important;
    background: var(--di-surface-alt, #F8FAFC) !important;
    border: 1px solid var(--di-border, #E2E8F0) !important;
    border-radius: 6px !important;
    color: var(--di-text, #0F172A) !important;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace !important;
    font-size: 0.75rem !important;
    line-height: 1.4;
    text-overflow: ellipsis;
}
.dimi-affiliate-dashboard-container .utm-card__url:focus {
    outline: 0 !important;
    border-color: var(--di-primary, #2563EB) !important;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--di-primary, #2563EB) 16%, transparent) !important;
}
.dimi-affiliate-dashboard-container .utm-card__copy {
    flex-shrink: 0;
    padding: 7px 12px !important;
    font-size: 0.75rem !important;
    border-radius: 6px !important;
    white-space: nowrap;
}
.dimi-affiliate-dashboard-container .utm-card__copy .di-icon {
    width: 13px;
    height: 13px;
}

/* Stats use 2×2 grid (not 4-in-a-row) — fits the now-narrower
   card width without squishing values like "222.000 ₫". */
.dimi-affiliate-dashboard-container .utm-card__stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px 14px;
    margin: 0;
    padding: 12px 0 0;
    border-top: 1px dashed var(--di-border, #E2E8F0);
    margin-top: auto; /* anchors stats to card bottom in grid rows of unequal content */
}
.dimi-affiliate-dashboard-container .utm-card__stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0;
    min-width: 0;
}
.dimi-affiliate-dashboard-container .utm-card__stat dt {
    font-size: 0.625rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--di-text-muted, #475569);
    margin: 0;
}
.dimi-affiliate-dashboard-container .utm-card__stat dd {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--di-text, #0F172A);
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dimi-affiliate-dashboard-container .utm-card__stat-value--good {
    color: var(--di-success, #10B981);
}

.dimi-affiliate-dashboard-container .utm-card-list__actions {
    display: flex;
    justify-content: flex-start;
    margin: 16px 0;
}
.dimi-affiliate-dashboard-container .utm-card-list__actions--top {
    /* Lives above the card list — give it the same top breathing room
       as the header→list transition would have provided. */
    margin: 16px 0 18px;
}
.dimi-affiliate-dashboard-container .utm-card-list__actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Responsive: the card list itself adapts via grid auto-fit
   (minmax(300px, 1fr)) — no breakpoint needed for column count.
   Below 600px we only adjust the inside-the-card layout:
     - header stacks so the date doesn't fight the title
     - URL + Copy go vertical for full-width touch targets
     - CTA button stretches edge-to-edge */
@media (max-width: 600px) {
    .dimi-affiliate-dashboard-container .utm-card-list {
        /* Narrower min on phones so 1 card always fits cleanly,
           even on a 320px-wide device with parent padding. */
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .dimi-affiliate-dashboard-container .utm-card__head {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    .dimi-affiliate-dashboard-container .utm-card__date {
        align-self: flex-start;
    }
    .dimi-affiliate-dashboard-container .utm-card__url-row {
        flex-direction: column;
        gap: 6px;
    }
    .dimi-affiliate-dashboard-container .utm-card__copy {
        align-self: stretch;
        justify-content: center;
    }
    .dimi-affiliate-dashboard-container .utm-card-list__actions .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 360px) {
    /* Very narrow viewports: stats collapse to label/value rows so
       even "222.000 ₫" never wraps under its label. */
    .dimi-affiliate-dashboard-container .utm-card__stats {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .dimi-affiliate-dashboard-container .utm-card__stat {
        flex-direction: row;
        justify-content: space-between;
        align-items: baseline;
    }
}

.dimi-affiliate-dashboard-container .campaigns-tab .empty-state {
    text-align: center;
    padding: 56px 24px;
    background: var(--di-surface, #FFFFFF);
    border: 1px dashed var(--di-border-strong, #CBD5E1);
    border-radius: 12px;
    color: var(--di-text-muted, #475569);
    margin-top: 16px;
}
.dimi-affiliate-dashboard-container .campaigns-tab .empty-state .di-icon {
    width: 40px;
    height: 40px;
    color: var(--di-primary, #2563EB);
    opacity: 0.55;
    margin-bottom: 8px;
}
.dimi-affiliate-dashboard-container .campaigns-tab .empty-state h3 {
    margin: 8px 0 6px;
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--di-text, #0F172A);
}
.dimi-affiliate-dashboard-container .campaigns-tab .empty-state p {
    margin: 0 auto;
    max-width: 48ch;
    font-size: 0.875rem;
    line-height: 1.5;
}

/* Note: the prior .recent-links-section + .link-input--compact rules
   were removed in 1.10.5 when the Campaigns tab moved to the unified
   .utm-card-list layout above. Card layout reuses the .copy-btn JS
   handler from frontend-dashboard.js but applies its own .utm-card__*
   styles instead of the old table-row treatment. */
