:root {
    /* Tema Biru Modern */
    --primary-blue: #2563eb;
    --sidebar-bg: #2563eb; 
    --sidebar-hover: #1d4ed8;
    --bg-light: #f8fafc;
    --text-dark: #1e293b;
    --text-light: #ffffff;
    --btn-green-start: #10b981;
    --btn-green-end: #059669;
    
    /* Modern Premium Enhancements */
    --primary-hover: #1d4ed8;
    --primary-light: #eff6ff;
    --primary-glow: rgba(37, 99, 235, 0.4);
    
    --sidebar-text: #ffffff;
    --bg-main: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    
    --btn-green-start: #10b981;
    --btn-green-end: #059669;
    
    --border-light: #e2e8f0;
    
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.02);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-float: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
    
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

body {
    background-color: var(--bg-light);
    font-family: 'Inter', 'Open Sans', sans-serif;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    max-width: 100vw;
}

/* Layout */
.dwh-layout {
    display: flex;
    min-height: calc(100vh - 70px);
    padding-top: 70px; /* Offset for fixed header */
}

/* Sidebar */
.dwh-sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    color: var(--text-light);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: fixed;
    top: 70px;
    height: calc(100vh - 70px);
    overflow-y: auto;
    z-index: 999;
}

.dwh-logo {
    display: flex;
    align-items: center;
    margin-right: auto;
    margin-left: 15px;
}

.dwh-logo img {
    max-height: 40px;
}

.dwh-logo a {
    color: var(--primary-blue);
    font-weight: bold;
    font-size: 24px;
    text-decoration: none;
}

.dwh-sidebar-balance {
    padding: 15px 15px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 5px;
}
.dwh-sidebar-balance span {
    font-size: 13px;
    color: #bfdbfe;
    font-weight: 500;
    margin-bottom: 3px;
}
.dwh-sidebar-balance strong {
    font-size: 20px;
    margin: 0 0 10px;
    color: #fff;
    font-weight: 700;
}

.dwh-sidebar-profile {
    padding: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: auto;
}
.dwh-sidebar-profile > a {
    display: block;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 8px;
    padding: 12px;
    text-align: left;
    color: #fff;
    text-decoration: none;
    font-weight: 500;
}
.dwh-sidebar-profile > a:hover {
    background: rgba(255,255,255,0.1);
}

.dwh-profile-menu {
    display: none;
    flex-direction: column;
    margin-top: 10px;
    background: rgba(0,0,0,0.15);
    border-radius: 8px;
    padding: 5px 0;
}
.dwh-profile-menu.show {
    display: flex;
}
.dwh-profile-menu a {
    padding: 15px 25px;
    color: var(--text-light);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    text-align: left;
    transition: all 0.3s ease;
}
.dwh-profile-menu a i {
    width: 20px;
    text-align: center;
    margin-right: 8px;
    opacity: 0.7;
}
.dwh-profile-menu a:hover {
    background: rgba(255,255,255,0.05);
    color: #fff;
    padding-left: 30px;
}
.dwh-profile-menu a.logout {
    color: #fca5a5;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: 5px;
}
.dwh-profile-menu a.logout:hover {
    color: #ffcccc;
}

.dwh-sidebar-buttons {
    padding: 20px 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dwh-sidebar-buttons .btn {
    width: 100%;
    border-radius: 8px;
    font-weight: 600;
    text-align: left;
    padding: 10px 15px;
    border: none;
    transition: all 0.3s ease;
}

.btn-topup {
    width: 100%;
    background: linear-gradient(135deg, var(--btn-green-start), var(--btn-green-end));
    color: #fff !important;
    text-align: center;
    border-radius: 12px;
    padding: 12px 15px;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
    text-transform: uppercase;
    font-size: 14px;
    border: none;
    transition: all 0.3s ease;
    display: block;
    text-decoration: none;
}

.btn-topup:hover {
    background: linear-gradient(135deg, #34d399, #10b981);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.6);
}

.dwh-sidebar-buttons .btn-outline {
    background: #fff;
    color: var(--primary-blue);
    display: flex;
    align-items: center;
    gap: 10px;
}

.dwh-sidebar-buttons .btn-outline:hover {
    background: #f0f0f0;
}

.dwh-nav {
    list-style: none;
    padding: 0;
    margin: 0;
    flex-grow: 1;
}

.dwh-nav li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: #ffffff;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    transition: background 0.2s, padding-left 0.2s;
}

.dwh-nav li a i {
    font-size: 18px;
    width: 20px;
    text-align: center;
    opacity: 0.9;
}

.dwh-nav li a:hover {
    background: var(--sidebar-hover);
    color: #fff;
    padding-left: 25px;
}

/* Main Area */
.dwh-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    margin-left: 260px; /* Offset for fixed sidebar on desktop */
}

/* Top Navbar */
.dwh-topnav {
    height: 70px;
    background: #fff;
    display: flex;
    align-items: center;
    padding: 0 30px;
    border-bottom: 1px solid #eaeaea;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
    width: 100%;
    box-sizing: border-box;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
}

.dwh-topnav-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.dwh-topnav-right a {
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 500;
}

.dwh-topnav-right .btn-logout {
    background: var(--primary-blue);
    color: #fff;
    padding: 8px 20px;
    border-radius: 6px;
    border: none;
}
.dwh-topnav-right .btn-logout:hover {
    background: #2563eb;
    color: #fff;
}

/* Content Area */
.dwh-content {
    padding: 30px;
    flex-grow: 1;
}

/* Client Area Home Customization */
.dwh-welcome-banner {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border-radius: 12px;
    padding: 30px;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.2);
}

.dwh-welcome-text h1 {
    margin: 0 0 10px 0;
    font-size: 28px;
    font-weight: 600;
}
.dwh-welcome-text p {
    margin: 0;
    font-size: 15px;
    opacity: 0.9;
}

.dwh-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.dwh-stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 25px 20px;
    text-align: center;
    border: 1px solid #eaeaea;
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    color: var(--text-dark);
    display: block;
}

.dwh-stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
    text-decoration: none;
    color: var(--text-dark);
}

.dwh-stat-card.unpaid {
    border: 2px solid var(--orange-accent);
}

.dwh-stat-card h2 {
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 5px 0;
    color: var(--text-dark);
}

.dwh-stat-card p {
    margin: 0;
    color: #666;
    font-size: 14px;
    font-weight: 500;
}

/* Search Bar */
.dwh-search-bar {
    margin-bottom: 40px;
}
.dwh-search-bar input {
    width: 100%;
    padding: 15px 25px;
    border-radius: 10px;
    border: 1px solid #eaeaea;
    font-size: 16px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}

/* Guidelines section */
.dwh-section-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-dark);
}

.dwh-guides-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.dwh-guide-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #eaeaea;
    transition: box-shadow 0.2s;
}
.dwh-guide-card:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.dwh-guide-image {
    height: 160px;
    background-color: #f0f0f0;
    background-size: cover;
    background-position: center;
}

.dwh-guide-title {
    padding: 15px 20px;
    font-weight: 600;
    font-size: 15px;
    color: var(--text-dark);
}

/* Hide WHMCS defaults that we replace */
#header, #main-menu, .home-shortcuts {
    display: none !important;
}

/* Domain Search Banner Improvements (ArenHost Style) */
#home-banner {
    background: #ffffff;
    border-radius: 20px;
    margin-top: 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    padding: 30px;
    clear: both;
    position: relative;
    z-index: 10;
}
#home-banner h2 {
    color: #1e3a8a;
    font-weight: bold;
    font-size: 28px;
    margin-bottom: 10px;
    text-align: left;
}
#home-banner p.subtitle {
    color: #6b7280;
    text-align: left;
    margin-bottom: 25px;
    font-size: 15px;
}

#home-banner .domain-search-card {
    background: #2563eb;
    border-radius: 16px;
    padding: 30px;
}

#home-banner .input-group {
    background: #fff;
    padding: 8px;
    border-radius: 12px;
    display: flex !important;
    align-items: center;
    width: 100%;
}

#home-banner .input-group-lg > .form-control, #home-banner .input-group-lg > .input-group-btn > .btn {
    height: 50px;
    border: none;
    box-shadow: none;
}
#home-banner .form-control {
    background: transparent;
    font-size: 16px;
    padding-left: 15px;
    border-radius: 8px;
    flex-grow: 1;
    width: auto !important; /* Fixes overflow on desktop */
}
#home-banner .input-group-btn {
    display: block !important;
    width: auto !important;
    padding-left: 10px;
}
#home-banner .btn.search {
    background: linear-gradient(135deg, var(--btn-green-start), var(--btn-green-end));
    color: #fff;
    font-weight: bold;
    padding: 0 30px;
    border-radius: 8px;
    font-size: 16px;
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
    border: none;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}
#home-banner .btn.search:hover {
    background: linear-gradient(135deg, var(--btn-green-end), var(--btn-green-start));
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

@media (max-width: 768px) {
    #home-banner .input-group {
        flex-direction: column !important;
        background: transparent !important;
        padding: 0 !important;
    }
    #home-banner .form-control {
        background: #fff !important;
        margin-bottom: 10px !important;
        width: 100% !important;
        border-radius: 8px !important;
        padding: 15px !important;
    }
    #home-banner .input-group-btn {
        width: 100% !important;
        display: block !important;
        padding-left: 0 !important;
    }
    #home-banner .btn.search {
        width: 100% !important;
        border-radius: 8px !important;
        height: 50px !important;
    }
}

/* Fix WHMCS main-body */
#main-body {
    padding: 0 !important;
}

/* Mobile Toggle */
.dwh-mobile-toggle {
    display: none;
    background: transparent;
    border: none;
    font-size: 24px;
    color: var(--primary-blue);
    cursor: pointer;
    margin-right: auto;
}

/* Hide native WHMCS sidebar EXCEPT in standard_cart where it is needed for product categories */
#main-body > .container-fluid > .row > .sidebar {
    display: none !important;
}
#main-body > .container-fluid > .row > .main-content {
    width: 100% !important;
    float: none !important;
}

/* Mobile Utility Classes */
.dwh-show-mobile-inline {
    display: none;
}

/* Sidebar Overlay */
.dwh-sidebar-overlay {
    display: none;
    position: fixed;
    top: 70px;
    left: 0;
    width: 100vw;
    height: calc(100vh - 70px);
    background: rgba(0,0,0,0.5);
    z-index: 9998;
}
.dwh-sidebar-overlay.active {
    display: block;
}

/* Responsive */
@media (max-width: 768px) {
    .dwh-hide-mobile {
        display: none !important;
    }
    .dwh-show-mobile-inline {
        display: inline-block;
    }
    .dwh-main {
        margin-left: 0;
    }
    
    .dwh-topnav {
        padding: 0 15px;
    }
    .dwh-topnav-right {
        gap: 10px;
    }
    .dwh-topnav-right a {
        font-size: 13px;
    }
    .dwh-topnav-right .btn-logout {
        padding: 6px 12px;
    }
    
    .dwh-mobile-toggle {
        display: block;
    }
    
    .dwh-sidebar {
        position: fixed;
        top: 70px;
        left: -260px;
        height: calc(100vh - 70px);
        z-index: 9999;
        transition: left 0.3s ease;
        padding-bottom: 100px;
    }
    
    .dwh-sidebar.active {
        left: 0;
    }
    
    .dwh-stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .dwh-guides-grid {
        grid-template-columns: 1fr;
    }
    
    .dwh-welcome-banner {
        flex-direction: column;
        gap: 15px;
        text-align: center;
        padding: 20px !important;
    }
    
    .dwh-content {
        padding: 15px !important;
        overflow-x: hidden;
    }
    
    .panel-body, .panel-heading, .panel-footer {
        padding: 15px !important;
    }
    
    .logincontainer, #registration {
        padding: 20px !important;
    }
    
    #home-banner, #home-banner .domain-search-card {
        padding: 20px !important;
    }

}

/* =========================================================
   MODERN TABLE CARD (used on domains, invoices, tickets, etc.)
   ========================================================= */
.dwh-modern-table-card {
    border-radius: var(--radius-lg, 16px);
    box-shadow: var(--shadow-md, 0 4px 15px rgba(0,0,0,0.05));
    background: #fff;
    margin-bottom: 25px;
    overflow: hidden;
    border: 1px solid var(--border-light, #e2e8f0);
}

.dwh-modern-table-card .card-header {
    padding: 25px 30px;
    border-bottom: 1px solid var(--border-light, #f1f5f9);
    background: #f8fafc;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.dwh-modern-table-card .card-header h3 {
    font-weight: 700;
    color: var(--text-main, #1e293b);
    margin: 0;
    font-size: 18px;
}

.dwh-modern-table-card .card-header p {
    margin: 5px 0 0;
    color: var(--text-muted, #64748b);
    font-size: 14px;
}

.dwh-modern-table-card .table-container {
    padding: 20px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* =========================================================
   MODERN PROFILE CARD (account details, add funds, etc.)
   ========================================================= */
.dwh-modern-profile-card {
    background: #fff;
    border-radius: var(--radius-lg, 16px);
    box-shadow: var(--shadow-md, 0 4px 15px rgba(0,0,0,0.05));
    border: 1px solid var(--border-light, #e2e8f0);
    margin-bottom: 25px;
    overflow: hidden;
}

.dwh-modern-profile-card .card-header {
    padding: 25px 30px;
    border-bottom: 1px solid var(--border-light, #f1f5f9);
    background: #f8fafc;
}

.dwh-modern-profile-card .card-header h3,
.dwh-modern-profile-card .card-header h4 {
    font-weight: 700;
    color: var(--text-main, #1e293b);
    margin: 0;
}

.dwh-modern-profile-card .card-body {
    padding: 30px;
}

/* =========================================================
   PRODUCT DETAILS CARD (service/domain detail pages)
   ========================================================= */
.product-details-card {
    background: #fff;
    border-radius: var(--radius-lg, 16px);
    box-shadow: var(--shadow-md, 0 4px 15px rgba(0,0,0,0.05));
    border: 1px solid var(--border-light, #e2e8f0);
    overflow: hidden;
}

.product-sidebar {
    background: #f8fafc;
    border-right: 1px solid var(--border-light, #e2e8f0);
}

.product-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-main, #1e293b);
    word-break: break-word;
}

.product-group {
    font-size: 14px;
    font-weight: 500;
}

.product-actions .action-btn {
    border-radius: 10px;
    font-weight: 600;
    padding: 10px 20px;
    margin-bottom: 10px;
    text-align: left;
}

.product-actions .action-btn i {
    width: 20px;
    text-align: center;
    margin-right: 8px;
}

/* Profile Section */
.profile-section {
    margin-bottom: 30px;
}

.profile-section .section-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main, #1e293b);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-light, #e2e8f0);
}

/* =========================================================
   TABLE RESPONSIVE FIXES
   ========================================================= */
.table-responsive {
    border: none !important;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-container {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* DataTables global fixes */
.dataTables_wrapper {
    width: 100%;
}

.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_length {
    margin-bottom: 15px;
}

.dataTables_wrapper .dataTables_filter input {
    background-color: #ffffff;
    color: #1e293b;
    border-radius: var(--radius-sm, 8px);
    border: 1px solid #94a3b8;
    padding: 8px 15px;
    margin-left: 8px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.dataTables_wrapper .dataTables_filter input::placeholder {
    color: #64748b;
    opacity: 1;
}

.dataTables_wrapper .dataTables_filter input:focus {
    outline: none;
    border-color: var(--primary-blue, #2563eb);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_length {
    color: #334155;
    font-weight: 500;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: var(--radius-sm, 8px) !important;
    margin: 0 3px;
    padding: 6px 12px !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--primary-blue, #2563eb) !important;
    color: #fff !important;
    border-color: var(--primary-blue, #2563eb) !important;
}

.dataTables_wrapper .dataTables_info {
    padding-top: 15px;
    color: #ffffff !important;
    font-size: 13px;
}

/* Status labels */
.label.status {
    font-weight: 600;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 12px;
    letter-spacing: 0.3px;
}

/* Tab content */
.modern-tab-content .tab-pane {
    padding: 0;
}

/* =========================================================
   UTILITY CLASSES
   ========================================================= */
.p-4 { padding: 25px; }
.mt-1 { margin-top: 5px; }
.mt-2 { margin-top: 10px; }
.mt-3 { margin-top: 15px; }
.mt-4 { margin-top: 25px; }
.mt-5 { margin-top: 40px; }
.mb-3 { margin-bottom: 15px; }
.mb-4 { margin-bottom: 25px; }
.mb-5 { margin-bottom: 40px; }
.px-4 { padding-left: 20px; padding-right: 20px; }
.py-2 { padding-top: 8px; padding-bottom: 8px; }
.m-0 { margin: 0; }
.d-flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.justify-content-between { justify-content: space-between; }
.align-items-center { align-items: center; }
.h-100 { height: 100%; }
.text-primary { color: var(--primary-blue, #2563eb); }
.text-muted { color: var(--text-muted, #64748b) !important; }
.text-danger { color: #dc2626 !important; }
.shadow { box-shadow: 0 10px 25px rgba(0,0,0,0.1) !important; }
.word-break { word-break: break-word; }

@media (min-width: 768px) {
    .mt-md-0 { margin-top: 0 !important; }
}

/* =========================================================
   RESPONSIVE: TABLET (max 992px)
   ========================================================= */
@media (max-width: 992px) {
    /* Product details 2-column to stack */
    .product-details-card .col-md-5,
    .product-details-card .col-md-7 {
        width: 100% !important;
        float: none !important;
    }

    .product-sidebar {
        border-right: none;
        border-bottom: 1px solid var(--border-light, #e2e8f0);
    }

    /* Add funds and similar 2-col layouts */
    .col-md-5.col-md-offset-1,
    .col-md-5 {
        width: 100% !important;
        float: none !important;
        margin-left: 0 !important;
    }

    /* General col override for stacking */
    .dwh-content .col-md-6,
    .dwh-content .col-md-4,
    .dwh-content .col-md-3,
    .dwh-content .col-md-7,
    .dwh-content .col-md-8,
    .dwh-content .col-md-9 {
        width: 100% !important;
        float: none !important;
    }
}

/* =========================================================
   RESPONSIVE: MOBILE (max 768px)
   ========================================================= */
@media (max-width: 768px) {
    /* Table card header stacks */
    .dwh-modern-table-card .card-header {
        flex-direction: column;
        align-items: flex-start !important;
        padding: 20px;
    }

    .dwh-modern-table-card .card-header .btn {
        width: 100%;
        text-align: center;
    }

    .dwh-modern-table-card .table-container,
    .dwh-modern-table-card .p-4 {
        padding: 12px;
    }

    /* Scroll the complete DataTables block so controls and table stay aligned */
    .table-container,
    .table-responsive {
        width: 100%;
        max-width: 100%;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    .dataTables_wrapper {
        width: max-content;
        min-width: 100%;
        max-width: none;
    }

    .dataTables_wrapper .listtable,
    .dataTables_wrapper .dataTables_filter,
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate {
        width: 100%;
    }

    .dataTables_wrapper table.table-list {
        width: max-content !important;
        min-width: 100% !important;
        max-width: none !important;
    }

    .dataTables_wrapper table.table-list th,
    .dataTables_wrapper table.table-list td {
        white-space: nowrap;
        font-size: 12px;
        padding: 8px 6px !important;
    }

    .affiliate-table-container {
        width: 100%;
        max-width: 100%;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    .affiliate-table-container #tableAffiliatesList_wrapper {
        width: 700px;
        min-width: 700px;
        max-width: none;
    }

    .affiliate-table-container #tableAffiliatesList_wrapper .listtable,
    .affiliate-table-container #tableAffiliatesList_wrapper .dataTables_info,
    .affiliate-table-container #tableAffiliatesList_wrapper .dataTables_paginate {
        width: 100%;
    }

    .affiliate-table-container #tableAffiliatesList {
        width: 700px !important;
        min-width: 700px !important;
    }

    /* DataTables search/length */
    .dataTables_wrapper .dataTables_filter,
    .dataTables_wrapper .dataTables_length {
        float: none !important;
        text-align: left !important;
        width: 100%;
        margin-bottom: 10px;
    }

    .dataTables_wrapper .dataTables_filter input {
        width: 100% !important;
        margin-left: 0 !important;
        margin-top: 5px;
    }

    .dataTables_wrapper .dataTables_length select {
        margin: 0 5px;
    }

    .dataTables_wrapper .dataTables_paginate {
        text-align: center !important;
        margin-top: 15px;
    }

    .dataTables_wrapper .dataTables_paginate .paginate_button {
        padding: 5px 10px !important;
        font-size: 13px;
    }

    /* Profile card */
    .dwh-modern-profile-card .card-header {
        padding: 20px;
    }

    .dwh-modern-profile-card .card-body,
    .dwh-modern-profile-card .card-body.p-4 {
        padding: 15px !important;
    }

    /* Product details sidebar */
    .product-sidebar {
        padding: 20px !important;
    }

    .product-title {
        font-size: 18px;
    }

    /* Section titles */
    .profile-section .section-title {
        font-size: 14px;
    }

    /* Btn group fix */
    .btn-group .dropdown-menu {
        right: 0;
        left: auto;
    }

    /* Modals */
    .modal-dialog {
        margin: 15px;
        width: auto !important;
    }

    .modal-body {
        padding: 20px !important;
    }

    /* Row margin fix */
    .row {
        margin-left: -10px;
        margin-right: -10px;
    }
    .row > [class*="col-"] {
        padding-left: 10px;
        padding-right: 10px;
    }

    /* Prevent horizontal overflow */
    .container-fluid {
        padding-left: 10px;
        padding-right: 10px;
    }

    /* Invoice view on mobile */
    .invoice-container {
        padding: 25px 20px !important;
        margin: 15px !important;
        border-radius: 16px !important;
    }

    /* Sub heading */
    .sub-heading span {
        font-size: 16px;
    }

    /* Fix overflow on all content */
    .dwh-main,
    .dwh-content,
    #main-body,
    .main-content {
        max-width: 100%;
        overflow-x: hidden;
    }

    .dwh-stats-grid,
    .dwh-stat-card-modern,
    .domain-search-card-modern,
    .domain-search-group {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
}

/* =========================================================
   RESPONSIVE: SMALL MOBILE (max 480px)
   ========================================================= */
@media (max-width: 480px) {
    .dwh-stats-grid {
        grid-template-columns: 1fr;
    }

    /* Stat cards */
    .dwh-stat-card-modern {
        padding: 15px;
    }

    .stat-icon {
        width: 48px;
        height: 48px;
        font-size: 20px;
        margin-right: 15px;
    }

    .stat-number {
        font-size: 22px;
    }

    .stat-label {
        font-size: 11px;
    }

    /* Welcome banner */
    .dwh-welcome-banner h1,
    .dwh-welcome-text h1 {
        font-size: 22px !important;
    }

    .dwh-welcome-banner p,
    .dwh-welcome-text p {
        font-size: 14px !important;
    }

    /* Table font reduction */
    .table-list th, .table-list td {
        font-size: 12px;
        padding: 10px 8px !important;
    }

    /* Hide less important table columns on very small screens */
    .table-list .hidden-xs-custom {
        display: none !important;
    }

    /* Buttons */
    .btn {
        font-size: 14px;
        padding: 10px 18px;
    }

    .btn-lg {
        font-size: 15px;
        padding: 12px 20px;
    }

    /* Guide cards */
    .dwh-guide-image {
        height: 100px;
    }
}

/* Cart Improvements */
[id^="order-"] {
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.02);
}
[id^="order-"] .title-bar {
    margin-bottom: 25px;
}
[id^="order-"] .product-info {
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}
[id^="order-"] .product-info:hover {
    border-color: var(--primary-blue);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
[id^="order-"] .btn-order-now {
    background-color: var(--primary-blue) !important;
    border-color: var(--primary-blue) !important;
    border-radius: var(--radius-sm);
}
[id^="order-"] .btn-order-now:hover {
    background-color: var(--primary-hover) !important;
    box-shadow: var(--primary-glow);
}
[id^="order-"] .panel-default > .panel-heading {
    background-color: var(--primary-blue) !important;
    color: #fff !important;
}

/* Orderform Categories - Move to Top and Scroll Horizontally */
[id^="order-"] > .row > .sidebar,
[id^="order-"] > .row > .col-md-3 {
    width: 100% !important;
    float: none !important;
    display: block !important;
    margin-bottom: 25px;
    padding-left: 15px;
    padding-right: 15px;
}
[id^="order-"] > .row > .col-md-9 {
    width: 100% !important;
    float: none !important;
}
/* Transform native category dropdown into horizontal pills */
#btnCategoryDropdown {
    display: none !important; /* Hide native select/button */
}
#btnCategoryDropdown + .dropdown-menu,
.dropdown-menu[aria-labelledby="btnCategoryDropdown"],
.categories-collapsed .dropdown-menu {
    display: flex !important;
    position: static !important;
    flex-direction: row;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    gap: 15px;
    padding: 10px 5px 20px 5px !important;
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    margin: 0 !important;
    float: none !important;
    width: 100% !important;
}
#btnCategoryDropdown + .dropdown-menu > li,
.dropdown-menu[aria-labelledby="btnCategoryDropdown"] > li,
.categories-collapsed .dropdown-menu > li {
    display: inline-block;
    float: none;
}
#btnCategoryDropdown + .dropdown-menu > li > a,
.dropdown-menu[aria-labelledby="btnCategoryDropdown"] > li > a,
.categories-collapsed .dropdown-menu > li > a {
    border: 1px solid var(--border-light) !important;
    background: #fff;
    border-radius: 30px !important;
    padding: 12px 25px !important;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-muted) !important;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
}
#btnCategoryDropdown + .dropdown-menu > li > a:hover,
.dropdown-menu[aria-labelledby="btnCategoryDropdown"] > li.active > a,
.categories-collapsed .dropdown-menu > li.active > a,
.categories-collapsed .dropdown-menu > li > a:hover {
    background: var(--primary-blue) !important;
    color: #fff !important;
    border-color: var(--primary-blue) !important;
    box-shadow: 0 4px 15px var(--primary-glow);
    transform: translateY(-2px);
}
/* Style the sidebar panel to be a horizontal list */
[id^="order-"] .sidebar .panel {
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    margin-bottom: 0;
}
[id^="order-"] .sidebar .panel-heading {
    display: none !important;
}
[id^="order-"] .sidebar .list-group {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    gap: 15px;
    padding-bottom: 15px;
    border: none !important;
    margin-bottom: 0;
}
/* Styling the category pills */
[id^="order-"] .sidebar .list-group-item {
    border: 1px solid var(--border-light) !important;
    background: #fff;
    border-radius: 30px !important;
    padding: 12px 25px !important;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-muted);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0 !important;
}
[id^="order-"] .sidebar .list-group-item:hover,
[id^="order-"] .sidebar .list-group-item.active {
    background: var(--primary-blue) !important;
    color: #fff !important;
    border-color: var(--primary-blue) !important;
    box-shadow: 0 4px 15px var(--primary-glow);
    transform: translateY(-2px);
}
[id^="order-"] .sidebar .list-group-item i {
    margin-right: 8px;
    font-size: 16px;
}

@keyframes blink {
    0% { opacity: 1; }
    50% { opacity: 0.2; }
    100% { opacity: 1; }
}

/* Sidebar Nav Dropdown */
.dwh-nav-dropdown .dwh-subnav {
    display: none !important;
    list-style: none;
    padding: 0;
    margin: 0;
    background: rgba(0, 0, 0, 0.15);
}
.dwh-nav-dropdown.active .dwh-subnav {
    display: block !important;
}
.dwh-nav-dropdown .dwh-caret {
    transition: transform 0.3s ease;
}
.dwh-nav-dropdown.active .dwh-caret {
    transform: rotate(180deg);
}
.dwh-subnav li a {
    padding: 10px 20px 10px 45px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: #cbd5e1 !important;
    display: block !important;
}
.dwh-subnav li a:hover {
    color: #fff !important;
    background: rgba(255,255,255,0.05) !important;
}

/* =========================================================
   MODERN PREMIUM WHMCS OVERRIDES
   ========================================================= */

body {
    background-color: var(--bg-main) !important;
    color: var(--text-main) !important;
    font-family: 'Inter', 'Outfit', system-ui, -apple-system, sans-serif !important;
    -webkit-font-smoothing: antialiased;
}

/* Sidebar Modernization */
.dwh-sidebar {
    background-color: var(--sidebar-bg) !important;
    border-right: 1px solid rgba(255,255,255,0.05);
}

.dwh-sidebar-profile {
    border-top: 1px solid rgba(255,255,255,0.05) !important;
}

.dwh-sidebar-balance {
    border-bottom: 1px solid rgba(255,255,255,0.05) !important;
}

.dwh-nav li a {
    color: var(--sidebar-text) !important;
    border-radius: var(--radius-sm);
    margin: 4px 16px;
    padding: 12px 16px !important;
    font-weight: 500 !important;
    transition: var(--transition);
}

.dwh-nav li a:hover, .dwh-nav li a.active {
    background: var(--sidebar-hover) !important;
    color: #fff !important;
    padding-left: 24px !important;
}

/* Top Navbar - Solid White on Scroll */
.dwh-topnav {
    background: #ffffff !important;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-bottom: 1px solid #eaeaea !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

/* Modernizing Forms */
.form-control {
    background-color: #f8fafc;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    height: auto;
    font-size: 15px;
    color: var(--text-main);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.01);
    transition: var(--transition);
}

.form-control:focus {
    background-color: #fff;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 4px var(--primary-light), 0 1px 2px rgba(0,0,0,0.05);
    outline: none;
}

label {
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 8px;
    font-size: 14px;
    letter-spacing: -0.01em;
}

/* Buttons */
.btn {
    border-radius: var(--radius-sm);
    padding: 12px 24px;
    font-weight: 600;
    font-size: 15px;
    transition: var(--transition);
    border: none;
    letter-spacing: 0.2px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-hover)) !important;
    color: #fff !important;
    box-shadow: 0 4px 15px var(--primary-glow) !important;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--primary-glow) !important;
}

.btn-default {
    background: #fff !important;
    color: var(--text-main) !important;
    border: 1px solid var(--border-light) !important;
    box-shadow: var(--shadow-sm);
}

.btn-default:hover {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Cards & Panels (WHMCS native) */
.panel {
    background: var(--card-bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    margin-bottom: 30px;
    transition: var(--transition);
}

.panel:hover {
    box-shadow: var(--shadow-float);
}

.panel-heading {
    background: var(--primary-blue) !important;
    border-bottom: 1px solid var(--border-light) !important;
    padding: 20px 28px;
    font-weight: 700;
    color: #ffffff !important;
    font-size: 18px;
}

.panel-body {
    padding: 28px;
}

.panel-footer {
    background: #f8fafc !important;
    border-top: 1px solid var(--border-light) !important;
    padding: 20px 28px;
}

/* Tables Modernization */
.table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
}

.table th, th, .dataTables_wrapper th, .dataTable th {
    background-color: var(--primary-blue) !important;
    color: #ffffff !important;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 0.5px;
    padding: 16px 20px !important;
    border-bottom: 1px solid var(--border-light) !important;
    border-top: none !important;
}

.table td {
    padding: 16px 20px;
    vertical-align: middle !important;
    border-bottom: 1px solid var(--border-light) !important;
    border-top: none !important;
    color: #1e293b;
    font-size: 14px;
    font-weight: 500;
}

.table-striped > tbody > tr:nth-of-type(odd) {
    background-color: rgba(248, 250, 252, 0.3);
}

.table > tbody > tr {
    transition: var(--transition);
}

.table > tbody > tr:hover {
    background-color: var(--primary-light) !important;
    transform: scale(1.002);
}

/* Alerts */
.alert {
    border: none;
    border-radius: var(--radius-md);
    padding: 16px 24px;
    font-weight: 500;
    box-shadow: var(--shadow-sm);
}

.alert-info {
    background-color: var(--primary-light);
    color: var(--primary-hover);
}

.alert-success {
    background-color: #ecfdf5;
    color: #059669;
}

.alert-warning {
    background-color: #fffbeb;
    color: #d97706;
}

.alert-danger {
    background-color: #fef2f2;
    color: #dc2626;
}

/* Login/Register Container improvements */
.logincontainer, #registration {
    background: var(--card-bg);
    padding: 48px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-float);
    margin: 40px auto;
    border: 1px solid rgba(226, 232, 240, 0.8);
    position: relative;
    overflow: hidden;
}

.logincontainer::before, #registration::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-blue), #60a5fa);
}

/* Sub-headings */
.sub-heading {
    border-bottom: 2px solid var(--border-light);
    margin: 35px 0 25px;
    padding-bottom: 12px;
}
.sub-heading span {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-main);
}

/* Fixes for DWH Stats Cards */
.dwh-stat-card {
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-md) !important;
    border: 1px solid transparent !important;
    background: linear-gradient(to bottom, #ffffff, #f8fafc) !important;
}

.dwh-stat-card:hover {
    box-shadow: var(--shadow-float) !important;
    transform: translateY(-5px) !important;
    border-color: var(--border-light) !important;
}

/* Glassmorphism style for the welcome banner */
.dwh-welcome-banner {
    background: linear-gradient(135deg, rgba(37,99,235,0.9), rgba(29,78,216,0.95)) !important;
    border-radius: var(--radius-xl) !important;
    box-shadow: 0 15px 35px -5px rgba(37,99,235,0.4) !important;
    position: relative;
    overflow: hidden;
    padding: 40px !important;
}

.dwh-welcome-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -20%;
    width: 150%;
    height: 150%;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 60%);
    transform: rotate(20deg);
    pointer-events: none;
}

.dwh-welcome-banner::after {
    content: '';
    position: absolute;
    bottom: -30%;
    right: -10%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

/* Search bar modern */
.dwh-search-bar input {
    border-radius: var(--radius-md) !important;
    padding: 18px 28px !important;
    background-color: #fff !important;
    border: 1px solid var(--border-light) !important;
    box-shadow: var(--shadow-md) !important;
    transition: var(--transition) !important;
}

.dwh-search-bar input:focus {
    box-shadow: var(--shadow-float), 0 0 0 4px var(--primary-light) !important;
    border-color: var(--primary-blue) !important;
}

/* Guide Cards */
.dwh-guide-card {
    border-radius: var(--radius-lg) !important;
    border: none !important;
    box-shadow: var(--shadow-md) !important;
    transition: var(--transition) !important;
}

.dwh-guide-card:hover {
    transform: translateY(-5px) !important;
    box-shadow: var(--shadow-float) !important;
}

.dwh-guide-title {
    font-size: 16px !important;
    padding: 20px !important;
}

/* Domain Search Banner Improvements */
#home-banner {
    border-radius: var(--radius-xl) !important;
    box-shadow: var(--shadow-float) !important;
    padding: 40px !important;
    background: linear-gradient(to right, #ffffff, #f8fafc) !important;
}

#home-banner .domain-search-card {
    border-radius: var(--radius-lg) !important;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1) !important;
    padding: 35px !important;
}

#home-banner .input-group {
    border-radius: var(--radius-md) !important;
    padding: 10px !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1) !important;
}

#home-banner .form-control {
    font-size: 18px !important;
    font-weight: 500 !important;
}

#home-banner .btn.search {
    border-radius: var(--radius-sm) !important;
    padding: 0 35px !important;
    font-size: 16px !important;
    letter-spacing: 0.5px !important;
}

/* General improvements for WHMCS elements */
.badge {
    padding: 6px 10px;
    border-radius: 20px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Client Area Home Domain Search */
.domain-search-group {
    background: #fff;
    border-radius: 50px;
    border: 2px solid var(--primary-blue);
    padding: 5px;
    display: flex;
    width: 100%;
}
.domain-search-group .input-group-addon {
    border: none;
    background: transparent;
    padding-left: 20px;
}
.domain-search-group .form-control {
    border: none !important;
    box-shadow: none !important;
    height: 50px;
    font-size: 16px;
    flex-grow: 1;
    width: auto !important; /* Prevents overflow */
}
.domain-search-group .input-group-btn {
    display: block !important;
    width: auto !important;
}
.domain-search-group .search-btn {
    height: 50px;
    border-radius: 50px !important;
    padding: 0 30px;
    font-weight: 600;
    font-size: 16px;
}

@media (max-width: 768px) {
    .domain-search-group {
        flex-direction: column;
        border-radius: 12px;
        padding: 10px;
    }
    .domain-search-group .input-group-addon {
        display: none; /* Hide icon on mobile to save space */
    }
    .domain-search-group .form-control {
        margin-bottom: 10px;
        border-radius: 8px !important;
        width: 100% !important;
        padding: 15px !important;
    }
    .domain-search-group .input-group-btn {
        width: 100% !important;
    }
    .domain-search-group .search-btn {
        width: 100% !important;
        border-radius: 8px !important;
    }
}

/* Ensure Header and Navbar stay solid white when scrolling */
#header, section#header, #main-menu, .navbar-main, .navbar-default, .is-sticky, .scrolled {
    background-color: #ffffff !important;
    background: #ffffff !important;
    opacity: 1 !important;
    filter: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* =========================================================
   LOGIN PAGE LAYOUT FIX
   Hide sidebar & center content when on login/register page
   ========================================================= */
body.login-page .dwh-sidebar,
body.login-page .dwh-sidebar-overlay {
    display: none !important;
}
body.login-page .dwh-main {
    margin-left: 0 !important;
}
body.login-page .dwh-layout {
    justify-content: center;
}
body.login-page .dwh-content {
    max-width: 960px;
    margin: 0 auto;
    width: 100%;
}
body.login-page .dwh-modern-auth {
    min-height: calc(100vh - 140px);
    padding: 60px 15px;
}

/* Improve readability and search-field contrast across all tables */
.table tbody td,
.dataTable tbody td {
    color: #1e293b !important;
    font-weight: 600;
}

.table tbody td .text-muted,
.dataTable tbody td .text-muted {
    color: #475569 !important;
    font-weight: 600 !important;
}

.dataTables_wrapper .dataTables_info {
    color: #ffffff !important;
    font-weight: 600 !important;
}

.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_length {
    color: #1e293b !important;
    font-weight: 600 !important;
}

.dataTables_wrapper .dataTables_filter input {
    border: 2px solid #64748b !important;
    color: #0f172a !important;
    font-weight: 500;
}

.dataTables_wrapper .dataTables_filter input::placeholder {
    color: #475569 !important;
    opacity: 1;
}

.dataTables_wrapper .dataTables_filter input:focus {
    border-color: var(--primary-blue, #2563eb) !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.22) !important;
}

/* Modern soft-row style for client domain and service tables */
#tableDomainsList,
#tableServicesList {
    border: 0 !important;
    border-collapse: separate !important;
    border-spacing: 0 10px !important;
    background: #ffffff;
}

#tableDomainsList thead th,
#tableServicesList thead th {
    background: #ffffff !important;
    color: #334155 !important;
    font-weight: 600 !important;
    border: 0 !important;
    box-shadow: none !important;
}

#tableDomainsList tbody td,
#tableServicesList tbody td {
    background: #f7f9fc !important;
    color: #1f2937 !important;
    font-weight: 600 !important;
    border: 0 !important;
    padding-top: 16px;
    padding-bottom: 16px;
}

#tableDomainsList tbody tr:hover td,
#tableServicesList tbody tr:hover td {
    background: #eef4fb !important;
}

#tableDomainsList tbody tr td:first-child,
#tableServicesList tbody tr td:first-child {
    border-radius: 12px 0 0 12px;
}

#tableDomainsList tbody tr td:last-child,
#tableServicesList tbody tr td:last-child {
    border-radius: 0 12px 12px 0;
}
