/* Premium Dashboard Styles */
:root {
    --premium-purple: #9d50bb;
    --premium-pink: #6e48aa;
    --premium-blue: #4facfe;
    --premium-teal: #00f2fe;
    --sidebar-bg: #ffffff;
    --sidebar-active: #8e44ad;
    --body-bg: #f4f7f6;
}

.main-layout {
    display: flex !important;
    flex-direction: row !important;
    min-height: 100vh;
    width: 100%;
    align-items: stretch;
}

body {
    background-color: var(--body-bg);
    overflow-x: hidden;
}

.dashboard-sidebar {
    background-color: var(--sidebar-bg) !important;
    border-right: 1px solid #eee;
    padding: 30px 20px !important;
    width: 280px !important;
    height: 100vh;
    display: flex;
    flex-direction: column;
    position: sticky !important;
    top: 0 !important;
    left: 0 !important;
    transform: none !important;
    z-index: 1000;
    transition: all 0.3s ease;
    overflow-y: hidden;
}

@media (max-width: 1199px) {
    .dashboard-sidebar {
        position: fixed !important;
        left: -280px !important;
        flex: none;
    }

    .dashboard-sidebar.active {
        left: 0 !important;
    }

    .dashboard-wrapper {
        padding: 0 20px;
    }
}

.dashboard-wrapper {
    background-color: var(--body-bg);
    flex: 1;
    /* Take all remaining space */
    min-width: 0;
    /* Critical for flex items with scrolling content */
    min-height: 100vh;
    padding: 0 40px;
    width: auto !important;
    margin-left: 0 !important;
}

.dashboard-nav {
    position: relative !important;
    width: 100% !important;
    box-shadow: none !important;
    background: transparent !important;
    padding: 30px 0 !important;
    z-index: 10;
}

.dashboard-sidebar .logo {
    padding: 0 0 30px 0 !important;
    border-bottom: 0 !important;
}

.sidebar-menu {
    margin-top: 20px;
}

.sidebar-menu li {
    margin-bottom: 10px;
}

.sidebar-menu li a {
    padding: 12px 20px !important;
    border-radius: 12px !important;
    font-weight: 500;
    color: #666 !important;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
}

.sidebar-menu li a i {
    font-size: 20px;
}

.sidebar-menu li a.active {
    background: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%) !important;
    color: #fff !important;
    box-shadow: 0 4px 15px rgba(161, 140, 209, 0.4);
}

.sidebar-menu li a:hover:not(.active) {
    background-color: #f8f9fa;
    color: var(--sidebar-active) !important;
}

/* User Profile in Sidebar */
.sidebar-user-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 30px;
    padding: 0;
    text-align: center;
}

.sidebar-user-info img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #f8f9fa;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.sidebar-user-info h6 {
    margin: 0;
    font-weight: 700;
    font-size: 15px;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Main Cards */
.premium-card {
    border-radius: 20px;
    padding: 30px;
    color: #fff;
    position: relative;
    overflow: hidden;
    height: 100%;
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.card-payday {
    background: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%);
}

.card-advance {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.premium-card .logo-img {
    width: 60px;
    margin-bottom: 20px;
    opacity: 0.9;
}

.premium-card h2 {
    color: #fff;
    font-weight: 800;
    margin-bottom: 20px;
}

.premium-card p {
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 30px;
    opacity: 0.9;
}

.premium-card .btn-apply {
    background-color: #fff;
    color: #333;
    border: none;
    padding: 12px 30px;
    border-radius: 30px;
    font-weight: 700;
    transition: all 0.3s ease;
}

.premium-card .btn-apply:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.premium-card .bg-pattern {
    position: absolute;
    right: -20px;
    bottom: -20px;
    opacity: 0.1;
    font-size: 200px;
    transform: rotate(-20deg);
}

/* Why Digaf Card */
.why-digaf-card {
    background: #fff;
    border-radius: 20px;
    padding: 30px;
    height: 100%;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
}

.why-digaf-card h4 {
    color: #333;
    font-weight: 700;
    margin-bottom: 25px;
}

.why-digaf-card ul {
    list-style: none;
    padding: 0;
}

.why-digaf-card ul li {
    margin-bottom: 15px;
    font-size: 14px;
    position: relative;
    padding-left: 20px;
}

.why-digaf-card ul li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--premium-purple);
    font-weight: bold;
}

/* Dashboard Table */
.dashboard-table-card {
    background: #fff;
    border-radius: 20px;
    border: none;
    padding: 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
}

.dashboard-table-card .card-header {
    background: transparent;
    border: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
}

.dashboard-table-card .card-header h5 {
    font-weight: 700;
    margin: 0;
}

.dashboard-table-card .table {
    margin: 0;
}

.dashboard-table-card .table thead th {
    border-top: none;
    background: #f8f9fa;
    color: #888;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    padding: 15px;
}

.dashboard-table-card .table tbody td {
    padding: 15px;
    vertical-align: middle;
    border-bottom: 1px solid #f1f1f1;
}

/* Topbar */
.dashboard-top {
    background-color: transparent !important;
    padding: 20px 0 !important;
}

.dashboard-top h3 {
    font-weight: 800;
    color: #1a1a1a;
    font-size: 32px;
    margin: 0;
    letter-spacing: -1px;
}

.display-4 {
    font-size: 48px;
    line-height: 1.1;
    letter-spacing: -2px;
}

/* Loan Plan Tabs */
.custom-loan-tabs {
    border-bottom: 2px solid #eee;
    justify-content: center;
    gap: 40px;
    margin-bottom: 40px;
}

.custom-loan-tabs .nav-link {
    border: none;
    background: transparent;
    color: #999;
    font-weight: 600;
    padding: 10px 0;
    position: relative;
    transition: all 0.3s ease;
}

.custom-loan-tabs .nav-link.active {
    color: var(--premium-purple);
    background: transparent;
}

.custom-loan-tabs .nav-link.active::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--premium-purple);
    border-top-left-radius: 3px;
    border-top-right-radius: 3px;
}

/* Premium Loan Card */
.premium-loan-container {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 30px;
    padding: 60px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.03);
    max-width: 1000px;
    margin: 0 auto;
}

/* Gross Salary Section */
.gross-salary-box {
    background: #fdfdfd;
    border: 1px solid #f1f1f1;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    gap: 40px;
}

.salary-slider-container {
    flex: 1;
}

.salary-result-box {
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 20px;
    padding: 30px 40px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.04);
    text-align: center;
    min-width: 220px;
}

.salary-result-box .amount {
    font-size: 28px;
    font-weight: 800;
    color: var(--premium-purple);
}

/* Loan Summary Grid */
.loan-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 50px;
}

.summary-item {
    text-align: center;
}

.summary-icon {
    font-size: 28px;
    color: var(--premium-purple);
    margin-bottom: 15px;
    display: block;
}

.summary-label {
    font-size: 13px;
    color: #666;
    font-weight: 600;
    display: block;
    margin-bottom: 10px;
}

.summary-value {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 12px;
    font-weight: 700;
    color: #333;
    font-size: 14px;
}

/* Loan Input Section */
.loan-apply-box {
    text-align: center;
}

.loan-apply-box label {
    font-weight: 600;
    color: #444;
    margin-bottom: 15px;
    display: block;
}

.loan-input-wrapper {
    max-width: 350px;
    margin: 0 auto 30px;
}

.loan-input-wrapper input {
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 15px 20px;
    font-size: 16px;
    text-align: center;
    width: 100%;
}

.btn-premium-apply {
    background: #aab2bd;
    color: #fff;
    padding: 15px 60px;
    border-radius: 30px;
    font-weight: 700;
    border: none;
    transition: all 0.3s ease;
}

.btn-premium-apply:hover {
    background: var(--premium-purple);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(157, 80, 187, 0.3);
}

.loan-notes {
    text-align: left;
    margin-bottom: 40px;
}

.loan-notes p {
    font-size: 13px;
    color: #666;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.loan-notes p i {
    color: var(--premium-purple);
    font-size: 10px;
}

/* Slider Custom Styles */
input[type=range] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    background: transparent;
}

input[type=range]:focus {
    outline: none;
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 8px;
    cursor: pointer;
    background: #eee;
    border-radius: 4px;
}

input[type=range]::-webkit-slider-thumb {
    height: 30px;
    width: 15px;
    border-radius: 5px;
    background: var(--premium-purple);
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    margin-top: -11px;
    box-shadow: 0 4px 10px rgba(157, 80, 187, 0.3);
}

/* Loan Preview Page Premium Styles */
.premium-preview-card {
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 25px;
    padding: 35px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.02);
    height: 100%;
}

.premium-preview-card h5 {
    color: #333;
    font-weight: 800;
    margin-bottom: 25px;
    font-size: 20px;
}

.premium-caption-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.premium-caption-list li {
    display: flex;
    justify-content: space-between;
    padding: 15px 0;
    border-bottom: 1px solid #f8f9fa;
}

.premium-caption-list li:last-child {
    border-bottom: none;
}

.premium-caption-list .caption {
    color: #777;
    font-weight: 600;
}

.premium-caption-list .value {
    color: #333;
    font-weight: 700;
}

.fee-highlight {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 20px;
    margin-top: 25px;
    text-align: center;
}

.fee-highlight h4 {
    margin: 0;
    color: var(--premium-purple);
    font-weight: 800;
}

.insufficient-balance {
    background: #fff5f5;
    color: #e53e3e;
    padding: 15px;
    border-radius: 12px;
    font-size: 13px;
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid #fed7d7;
}

.premium-apply-btn {
    background: linear-gradient(135deg, var(--premium-purple), var(--premium-pink));
    color: #fff;
    border: none;
    padding: 15px;
    border-radius: 15px;
    font-weight: 700;
    width: 100%;
    margin-top: 25px;
    transition: all 0.3s ease;
}

.premium-apply-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(157, 80, 187, 0.3);
}

.premium-apply-btn:disabled {
    background: #e0e0e0;
    color: #a0a0a0;
    cursor: not-allowed;
}