/**
 * LendSwift Modern UI Enhancements
 * Flash messages, sidebar icons, and UI improvements
 */

:root {
    --flash-success-bg: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    --flash-success-border: #10b981;
    --flash-success-icon: #059669;
    --flash-success-text: #065f46;
    --flash-error-bg: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    --flash-error-border: #ef4444;
    --flash-error-icon: #dc2626;
    --flash-error-text: #991b1b;
    --flash-warning-bg: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    --flash-warning-border: #f59e0b;
    --flash-warning-icon: #d97706;
    --flash-warning-text: #92400e;
    --flash-info-bg: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    --flash-info-border: #3b82f6;
    --flash-info-icon: #2563eb;
    --flash-info-text: #1e40af;
}

/* Flash Messages Container */
.flash-messages-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 420px;
    width: calc(100% - 40px);
}

/* Flash Message Base */
.flash-message {
    display: flex;
    align-items: flex-start;
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
    border-left: 4px solid;
    backdrop-filter: blur(10px);
    animation: flashSlideIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.flash-message:hover {
    transform: translateX(-5px);
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.15);
}

.flash-message.flash-hiding { animation: flashSlideOut 0.3s ease forwards; }

.flash-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 14px;
    font-size: 1.25rem;
}

.flash-content { flex: 1; min-width: 0; }
.flash-title { font-weight: 600; font-size: 0.95rem; margin-bottom: 4px; }
.flash-text { font-size: 0.875rem; line-height: 1.5; opacity: 0.9; }

.flash-close {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 10px;
    transition: all 0.2s ease;
    opacity: 0.7;
}

.flash-close:hover { opacity: 1; transform: scale(1.1); background: rgba(255,255,255,0.8); }

/* Success */
.flash-success { background: var(--flash-success-bg); border-left-color: var(--flash-success-border); }
.flash-success .flash-icon { background: rgba(16,185,129,0.2); color: var(--flash-success-icon); }
.flash-success .flash-title, .flash-success .flash-text { color: var(--flash-success-text); }
.flash-success .flash-close { color: var(--flash-success-text); }

/* Error */
.flash-error { background: var(--flash-error-bg); border-left-color: var(--flash-error-border); }
.flash-error .flash-icon { background: rgba(239,68,68,0.2); color: var(--flash-error-icon); }
.flash-error .flash-title, .flash-error .flash-text { color: var(--flash-error-text); }
.flash-error .flash-close { color: var(--flash-error-text); }

/* Warning */
.flash-warning { background: var(--flash-warning-bg); border-left-color: var(--flash-warning-border); }
.flash-warning .flash-icon { background: rgba(245,158,11,0.2); color: var(--flash-warning-icon); }
.flash-warning .flash-title, .flash-warning .flash-text { color: var(--flash-warning-text); }
.flash-warning .flash-close { color: var(--flash-warning-text); }

/* Info */
.flash-info { background: var(--flash-info-bg); border-left-color: var(--flash-info-border); }
.flash-info .flash-icon { background: rgba(59,130,246,0.2); color: var(--flash-info-icon); }
.flash-info .flash-title, .flash-info .flash-text { color: var(--flash-info-text); }
.flash-info .flash-close { color: var(--flash-info-text); }

@keyframes flashSlideIn {
    0% { opacity: 0; transform: translateX(100px) scale(0.9); }
    100% { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes flashSlideOut {
    0% { opacity: 1; transform: translateX(0) scale(1); }
    100% { opacity: 0; transform: translateX(100px) scale(0.9); }
}

.flash-message::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: currentColor;
    opacity: 0.3;
    animation: flashProgress 8s linear forwards;
    border-radius: 0 0 0 8px;
}

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


.alert::before { font-family: "Font Awesome 5 Free"; font-weight: 900; margin-right: 12px; font-size: 1.1rem; }

.alert-success { background: var(--flash-success-bg); border-color: var(--flash-success-border); color: var(--flash-success-text); }
.alert-success::before { content: "\f058"; color: var(--flash-success-icon); }

.alert-error, .alert-danger { background: var(--flash-error-bg); border-color: var(--flash-error-border); color: var(--flash-error-text); }
.alert-error::before, .alert-danger::before { content: "\f06a"; color: var(--flash-error-icon); }

.alert-warning { background: var(--flash-warning-bg); border-color: var(--flash-warning-border); color: var(--flash-warning-text); }
.alert-warning::before { content: "\f071"; color: var(--flash-warning-icon); }

.alert-info { background: var(--flash-info-bg); border-color: var(--flash-info-border); color: var(--flash-info-text); }
.alert-info::before { content: "\f05a"; color: var(--flash-info-icon); }

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

/* ===== Admin Sidebar Enhanced Icons ===== */
.admin-nav ul li a {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: #4b5563;
    text-decoration: none;
    border-radius: 8px;
    margin: 4px 12px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.admin-nav ul li a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.1), transparent);
    transition: width 0.3s ease;
}

.admin-nav ul li a:hover::before {
    width: 100%;
}

.admin-nav ul li a:hover {
    background: linear-gradient(90deg, #f3f4f6, #ffffff);
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.admin-nav ul li.active a {
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.admin-nav ul li.active a:hover {
    transform: translateX(0);
}

.admin-nav ul li a i {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    margin-right: 12px;
    font-size: 1rem;
    transition: all 0.25s ease;
}

/* Icon Colors */
.admin-nav ul li a[href="index.php"] i { background: rgba(99, 102, 241, 0.15); color: #6366f1; }
.admin-nav ul li a[href="users.php"] i { background: rgba(139, 92, 246, 0.15); color: #8b5cf6; }
.admin-nav ul li a[href="applications.php"] i { background: rgba(236, 72, 153, 0.15); color: #ec4899; }
.admin-nav ul li a[href="guest-conversion.php"] i { background: rgba(20, 184, 166, 0.15); color: #14b8a6; }
.admin-nav ul li a[href="loan-products.php"] i { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.admin-nav ul li a[href="transactions.php"] i { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.admin-nav ul li a[href="payment-methods.php"] i { background: rgba(6, 182, 212, 0.15); color: #06b6d4; }
.admin-nav ul li a[href="forms.php"] i { background: rgba(139, 92, 246, 0.15); color: #8b5cf6; }
.admin-nav ul li a[href="statuses.php"] i { background: rgba(249, 115, 22, 0.15); color: #f97316; }
.admin-nav ul li a[href="currencies.php"] i { background: rgba(234, 179, 8, 0.15); color: #eab308; }
.admin-nav ul li a[href="email-templates.php"] i { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.admin-nav ul li a[href="services-content.php"] i { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.admin-nav ul li a[href="support.php"] i { background: rgba(34, 197, 94, 0.15); color: #22c55e; }
.admin-nav ul li a[href="notifications.php"] i { background: rgba(244, 63, 94, 0.15); color: #f43f5e; }
.admin-nav ul li a[href="application-reports.php"] i { background: rgba(99, 102, 241, 0.15); color: #6366f1; }
.admin-nav ul li a[href="settings.php"] i { background: rgba(100, 116, 139, 0.15); color: #64748b; }
.admin-nav ul li a[href="logout.php"] i { background: rgba(239, 68, 68, 0.15); color: #ef4444; }

.admin-nav ul li.active a i {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* Navigation Badge */
.nav-badge {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    margin-left: auto;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
    animation: badgePulse 2s infinite;
}

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

/* ===== Enhanced Buttons ===== */
.button, button[type="submit"], input[type="submit"] {
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.button::after, button[type="submit"]::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.5s, height 0.5s;
}

.button:active::after, button[type="submit"]:active::after {
    width: 200px;
    height: 200px;
}

.button-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.3);
}

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

/* ===== Enhanced Tables ===== */
.data-table {
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.data-table thead th {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: #64748b;
    padding: 16px;
    border-bottom: 2px solid #e2e8f0;
}

.data-table tbody tr {
    transition: all 0.2s ease;
}

.data-table tbody tr:nth-child(even) {
    background-color: #f8fafc;
}

.data-table tbody tr:hover {
    background-color: #e0e7ff;
    transform: scale(1.005);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.data-table tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid #e5e7eb;
}

/* ===== Enhanced Cards ===== */
.card {
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    overflow: hidden;
}

.card:hover {
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

.card-header {
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    border-bottom: 1px solid #e5e7eb;
    padding: 20px 24px;
}

.card-header h2, .card-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ===== Enhanced Form Inputs ===== */
.form-control, input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="tel"], input[type="url"], select, textarea {
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    padding: 12px 16px;
    transition: all 0.25s ease;
    background: #ffffff;
}

.form-control:focus, input:focus, select:focus, textarea:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
    outline: none;
}

.form-control:hover, input:hover, select:hover, textarea:hover {
    border-color: #a5b4fc;
}

/* ===== Status Badges ===== */
.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

/* ===== Page Animations ===== */
.admin-main, .main-content {
    animation: pageSlideIn 0.4s ease;
}

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

/* ===== Mobile Responsive Flash Messages ===== */
@media (max-width: 768px) {
    .flash-messages-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        width: auto;
    }

    .flash-message {
        padding: 12px 16px;
    }

    .flash-icon {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }
}



/* ===== Toggle Switch Styles ===== */
.toggle-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid #e5e7eb;
}

.toggle-group label {
    flex: 1;
}

.toggle-group .toggle-label {
    display: block;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
}

.toggle-group .toggle-description {
    display: block;
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 400;
}

.toggle-switch {
    position: relative;
    width: 56px;
    height: 28px;
    flex-shrink: 0;
    margin-left: 20px;
}

.toggle-input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-label-switch {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #d1d5db;
    transition: all 0.3s ease;
    border-radius: 28px;
}

.toggle-label-switch::before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: all 0.3s ease;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-input:checked + .toggle-label-switch {
    background: linear-gradient(135deg, #4f46e5, #6366f1);
}

.toggle-input:checked + .toggle-label-switch::before {
    transform: translateX(28px);
}

.toggle-input:focus + .toggle-label-switch {
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.2);
}

/* ===== Settings Section Styles ===== */
.settings-section {
    background: #f9fafb;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    border: 1px solid #e5e7eb;
}

.settings-section h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 8px 0;
}

.settings-section h3 i {
    color: #4f46e5;
}

.section-description {
    color: #6b7280;
    font-size: 0.9rem;
    margin-bottom: 20px;
    line-height: 1.6;
}

.form-help {
    font-size: 0.8rem;
    color: #6b7280;
    margin-top: 6px;
}

/* ===== Auto-dismiss Flash Messages ===== */
.flash-message {
    animation: flashSlideIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55), flashAutoHide 0.3s ease 8s forwards;
}

@keyframes flashAutoHide {
    to {
        opacity: 0;
        transform: translateX(100px);
        visibility: hidden;
    }
}



/* ===== Frontend User Sidebar Enhancements ===== */

/* Dashboard Sidebar Container - Enhanced */
.dashboard-sidebar {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border-right: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: sticky;
    top: 0;
    overflow-y: auto;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.03);
}

/* Sidebar Logo Area */
.sidebar-logo {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.03) 0%, transparent 100%);
}

.sidebar-logo img {
    max-height: 48px;
    width: auto;
    transition: transform 0.3s ease;
}

.sidebar-logo:hover img {
    transform: scale(1.02);
}

/* Sidebar Nav Container */
.sidebar-nav {
    padding: 16px 0;
    flex: 1;
}

.sidebar-nav-title {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #9ca3af;
    padding: 20px 24px 10px;
    margin: 0;
    position: relative;
}

.sidebar-nav-title::after {
    content: '';
    position: absolute;
    left: 24px;
    bottom: 4px;
    width: 24px;
    height: 2px;
    background: linear-gradient(90deg, #4f46e5, transparent);
    border-radius: 2px;
}

/* Sidebar Nav Items */
.sidebar-nav-items {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav-item {
    margin: 4px 12px;
}

/* Sidebar Nav Link - Enhanced */
.sidebar-nav-link {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    border-radius: 12px;
    color: #4b5563;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    border: 1px solid transparent;
}

.sidebar-nav-link::before {
    content: '';
    position: absolute;
    left: -100%;
    top: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s ease;
}

.sidebar-nav-link:hover::before {
    left: 100%;
}

.sidebar-nav-link:hover {
    color: #1f2937;
    transform: translateX(6px);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(139, 92, 246, 0.05) 100%);
    border-color: rgba(99, 102, 241, 0.1);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.08);
}

/* Active State - Vibrant Gradient */
.sidebar-nav-link.active {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #a855f7 100%);
    color: white;
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.35), 0 4px 8px rgba(124, 58, 237, 0.2);
    border-color: transparent;
    font-weight: 600;
}

.sidebar-nav-link.active:hover {
    transform: translateX(0) scale(1.01);
    box-shadow: 0 10px 28px rgba(79, 70, 229, 0.4), 0 6px 12px rgba(124, 58, 237, 0.25);
}

.sidebar-nav-link.active .sidebar-nav-icon {
    background: rgba(255, 255, 255, 0.25) !important;
    color: white !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Sidebar Nav Icon - Enhanced with Gradients */
.sidebar-nav-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    margin-right: 14px;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    position: relative;
}

/* Vibrant Colorful Icon Backgrounds with Gradients */
.sidebar-nav-link[href*="dashboard"] .sidebar-nav-icon {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(139, 92, 246, 0.15) 100%);
    color: #6366f1;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.15);
}
.sidebar-nav-link[href*="loan-application"] .sidebar-nav-icon {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.2) 0%, rgba(244, 114, 182, 0.15) 100%);
    color: #ec4899;
    box-shadow: 0 2px 8px rgba(236, 72, 153, 0.15);
}
.sidebar-nav-link[href*="loans"]:not([href*="loan-application"]):not([href*="loan-calculator"]) .sidebar-nav-icon {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(52, 211, 153, 0.15) 100%);
    color: #10b981;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.15);
}
.sidebar-nav-link[href*="transactions"] .sidebar-nav-icon {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2) 0%, rgba(251, 191, 36, 0.15) 100%);
    color: #f59e0b;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.15);
}
.sidebar-nav-link[href*="documents"]:not([href*="history"]) .sidebar-nav-icon {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(96, 165, 250, 0.15) 100%);
    color: #3b82f6;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
}
.sidebar-nav-link[href*="document-history"] .sidebar-nav-icon {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2) 0%, rgba(167, 139, 250, 0.15) 100%);
    color: #8b5cf6;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.15);
}
.sidebar-nav-link[href*="profile"] .sidebar-nav-icon {
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.2) 0%, rgba(45, 212, 191, 0.15) 100%);
    color: #14b8a6;
    box-shadow: 0 2px 8px rgba(20, 184, 166, 0.15);
}
.sidebar-nav-link[href*="notifications"] .sidebar-nav-icon {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2) 0%, rgba(248, 113, 113, 0.15) 100%);
    color: #ef4444;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.15);
}
.sidebar-nav-link[href*="loan-calculator"] .sidebar-nav-icon {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.2) 0%, rgba(34, 211, 238, 0.15) 100%);
    color: #06b6d4;
    box-shadow: 0 2px 8px rgba(6, 182, 212, 0.15);
}
.sidebar-nav-link[href*="support"] .sidebar-nav-icon {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.2) 0%, rgba(74, 222, 128, 0.15) 100%);
    color: #22c55e;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.15);
}
.sidebar-nav-link[href*="kyc"] .sidebar-nav-icon {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.2) 0%, rgba(192, 132, 252, 0.15) 100%);
    color: #a855f7;
    box-shadow: 0 2px 8px rgba(168, 85, 247, 0.15);
}

/* Hover state for icons */
.sidebar-nav-link:hover .sidebar-nav-icon {
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Sidebar User Section - Enhanced */
.sidebar-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    padding: 20px;
    margin-top: auto;
    background: linear-gradient(180deg, transparent 0%, rgba(249, 250, 251, 0.8) 100%);
}

.sidebar-user {
    display: flex;
    align-items: center;
    padding: 14px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 14px;
    margin-bottom: 14px;
    border: 1px solid rgba(0, 0, 0, 0.04);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
}

.sidebar-user:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.sidebar-user-avatar {
    width: 46px;
    height: 46px;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #a855f7 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1.1rem;
    margin-right: 14px;
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.35);
    position: relative;
}

.sidebar-user-avatar::after {
    content: '';
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

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

.sidebar-user-name {
    font-weight: 700;
    color: #1f2937;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.sidebar-user-email {
    font-size: 0.75rem;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Logout Button - Enhanced */
.sidebar-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    color: #dc2626;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(220, 38, 38, 0.1);
}

.sidebar-logout i {
    transition: transform 0.3s ease;
}

.sidebar-logout:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(220, 38, 38, 0.35);
    border-color: transparent;
}

.sidebar-logout:hover i {
    transform: translateX(4px);
}

/* KYC Status Badge in Sidebar */
.sidebar-kyc-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 12px;
}

/* KYC Badge in Sidebar Nav Link */
.sidebar-nav-link .kyc-badge {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    margin-left: auto;
}

.sidebar-nav-link .kyc-badge.approved {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
}

.sidebar-nav-link .kyc-badge.pending {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.sidebar-nav-link .kyc-badge.rejected {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.sidebar-nav-link .kyc-badge.not-submitted {
    background: linear-gradient(135deg, #94a3b8, #64748b);
    color: white;
}

.sidebar-kyc-badge.pending {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.sidebar-kyc-badge.approved {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.sidebar-kyc-badge.rejected {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.sidebar-kyc-badge.not_submitted {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    color: #475569;
    border: 1px solid rgba(100, 116, 139, 0.2);
}

.sidebar-kyc-badge i {
    font-size: 0.9rem;
}


/* ===== Dashboard Main Content Enhancements ===== */
.dashboard-main {
    flex: 1;
    background: #f8fafc;
    min-height: 100vh;
}

.dashboard-header {
    background: white;
    border-bottom: 1px solid #e5e7eb;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

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

/* Dashboard Welcome Section */
.dashboard-welcome {
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 50%, #8b5cf6 100%);
    color: white;
    padding: 32px;
    border-radius: 16px;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}

.dashboard-welcome::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 50%;
    height: 200%;
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(30deg);
}

.dashboard-welcome h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 8px 0;
}

.dashboard-welcome p {
    opacity: 0.9;
    margin: 0;
    font-size: 1rem;
}

/* Dashboard Stats Cards */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    border-radius: 14px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.stat-icon.total { background: rgba(99, 102, 241, 0.12); color: #6366f1; }
.stat-icon.active { background: rgba(16, 185, 129, 0.12); color: #10b981; }
.stat-icon.pending { background: rgba(245, 158, 11, 0.12); color: #f59e0b; }
.stat-icon.completed { background: rgba(59, 130, 246, 0.12); color: #3b82f6; }

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1f2937;
}

/* Dashboard Cards */
.dashboard-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid #e5e7eb;
    margin-bottom: 24px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.dashboard-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.dashboard-card-header {
    padding: 20px 24px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dashboard-card-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.dashboard-card-header h3 i {
    color: #6366f1;
}

.dashboard-card-body {
    padding: 24px;
}

/* Quick Action Buttons */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 14px;
    text-decoration: none;
    color: #1f2937;
    transition: all 0.3s ease;
    border: 1px solid #e5e7eb;
}

.quick-action-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    background: white;
}

.quick-action-btn .icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    margin-bottom: 12px;
}

.quick-action-btn:nth-child(1) .icon { background: rgba(236, 72, 153, 0.12); color: #ec4899; }
.quick-action-btn:nth-child(2) .icon { background: rgba(59, 130, 246, 0.12); color: #3b82f6; }
.quick-action-btn:nth-child(3) .icon { background: rgba(6, 182, 212, 0.12); color: #06b6d4; }
.quick-action-btn:nth-child(4) .icon { background: rgba(34, 197, 94, 0.12); color: #22c55e; }

.quick-action-btn .label {
    font-weight: 600;
    font-size: 0.9rem;
    text-align: center;
}

/* Loan Package Cards */
.loan-packages {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.loan-package-card {
    background: white;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    transition: all 0.3s ease;
}

.loan-package-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
}

.loan-package-header {
    padding: 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid #e5e7eb;
}

.loan-package-header h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 4px 0;
}

.loan-package-rate {
    font-size: 1.5rem;
    font-weight: 700;
    color: #4f46e5;
}

.loan-package-body {
    padding: 20px;
}

.loan-package-info {
    margin-bottom: 16px;
}

.loan-package-info-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px dashed #e5e7eb;
}

.loan-package-info-label {
    color: #6b7280;
    font-size: 0.9rem;
}

.loan-package-info-value {
    font-weight: 600;
    color: #1f2937;
}

.loan-package-apply {
    display: block;
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    color: white;
    text-align: center;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.25s ease;
}

.loan-package-apply:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.3);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 48px 24px;
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    background: #f1f5f9;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 2rem;
    color: #9ca3af;
}

.empty-state h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 8px 0;
}

.empty-state p {
    color: #6b7280;
    margin: 0 0 20px 0;
}

.empty-state .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    color: white;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.25s ease;
}

.empty-state .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.3);
}

/* Page Footer */
.dashboard-footer {
    text-align: center;
    padding: 24px;
    color: #6b7280;
    font-size: 0.85rem;
    border-top: 1px solid #e5e7eb;
    background: white;
}



/* ===== Frontend Form Enhancements ===== */
.form-group {
    margin-bottom: 20px;
}

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

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 0.95rem;
    transition: all 0.25s ease;
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.form-control:hover:not(:focus) {
    border-color: #a5b4fc;
}

/* Frontend Buttons */
.btn-primary, .button-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
}

.btn-primary:hover, .button-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.3);
}

.btn-secondary, .button-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    background: white;
    color: #374151;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
}

.btn-secondary:hover, .button-secondary:hover {
    border-color: #4f46e5;
    color: #4f46e5;
    background: rgba(79, 70, 229, 0.05);
}

/* ===== Mobile Responsive Styles ===== */
@media (max-width: 1024px) {
    .dashboard-sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        width: 280px;
        z-index: 1000;
        transition: left 0.3s ease;
    }

    .dashboard-sidebar.open {
        left: 0;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }

    .sidebar-overlay.active {
        display: block;
    }

    .mobile-sidebar-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        border: none;
        background: #f1f5f9;
        border-radius: 10px;
        cursor: pointer;
        color: #4b5563;
        transition: all 0.25s ease;
    }

    .mobile-sidebar-toggle:hover {
        background: #e5e7eb;
        color: #1f2937;
    }
}

@media (max-width: 768px) {
    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-icon {
        width: 44px;
        height: 44px;
        font-size: 1.2rem;
    }

    .stat-value {
        font-size: 1.25rem;
    }

    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .quick-action-btn {
        padding: 16px 12px;
    }

    .quick-action-btn .icon {
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
    }

    .loan-packages {
        grid-template-columns: 1fr;
    }

    .dashboard-welcome {
        padding: 24px;
    }

    .dashboard-welcome h2 {
        font-size: 1.4rem;
    }

    .dashboard-card-body {
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .dashboard-stats {
        grid-template-columns: 1fr;
    }

    .dashboard-header {
        padding: 12px 16px;
    }

    .dashboard-header h1 {
        font-size: 1.2rem;
    }
}
