/* ============================================================
   Quick Loan — Premium Mobile-First Design System v2.0
   ============================================================ */

/* --- Google Fonts Import --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* --- CSS Custom Properties (Design Tokens) --- */
:root {
    /* Brand Colors */
    --primary: #4F46E5;
    --primary-dark: #3730A3;
    --primary-light: #818CF8;
    --primary-gradient: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
    --primary-gradient-soft: linear-gradient(135deg, rgba(79, 70, 229, 0.1) 0%, rgba(124, 58, 237, 0.1) 100%);

    /* Accent Colors */
    --accent: #F59E0B;
    --accent-dark: #D97706;
    --accent-light: #FCD34D;
    --accent-gradient: linear-gradient(135deg, #F59E0B 0%, #EF4444 100%);

    /* Status Colors */
    --success: #10B981;
    --success-light: #D1FAE5;
    --danger: #EF4444;
    --danger-light: #FEE2E2;
    --warning: #F59E0B;
    --warning-light: #FEF3C7;
    --info: #3B82F6;
    --info-light: #DBEAFE;
    --pending-color: #8B5CF6;
    --pending-light: #EDE9FE;

    /* Neutral Colors */
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;

    /* Surfaces */
    --bg-page: #F0F2F7;
    --bg-card: #FFFFFF;
    --bg-card-hover: #FAFBFF;

    /* Typography */
    --font-primary: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'SF Mono', 'Fira Code', monospace;

    /* Spacing */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 24px;
    --radius-pill: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.05), 0 10px 15px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.08), 0 20px 40px rgba(0, 0, 0, 0.06);
    --shadow-xl: 0 20px 50px rgba(0, 0, 0, 0.12), 0 40px 60px rgba(0, 0, 0, 0.08);
    --shadow-primary: 0 8px 25px rgba(79, 70, 229, 0.3);
    --shadow-accent: 0 8px 25px rgba(245, 158, 11, 0.3);

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.25s ease;
    --transition-slow: 0.4s ease;
}

/* === Base Reset & Typography === */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-primary);
    background-color: var(--bg-page);
    color: var(--gray-800);
    line-height: 1.6;
    font-size: 15px;
    min-height: 100vh;
    overflow-x: hidden;
}

/* === Mobile App Container (User-Facing Pages) === */
.mobile-app-container {
    max-width: 480px;
    margin: 0 auto;
    background-color: var(--bg-page);
    min-height: 100vh;
    position: relative;
    padding-bottom: 80px;
}

/* Safe area for devices with notch */
.mobile-app-container .app-header {
    padding-top: max(16px, env(safe-area-inset-top));
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
}

/* === The Hero Balance Card === */
.hero-balance-card {
    background: var(--primary-gradient);
    border-radius: var(--radius-2xl);
    padding: 28px 24px 24px;
    color: white;
    position: relative;
    overflow: hidden;
    margin: 0 16px;
    box-shadow: var(--shadow-primary);
}

.hero-balance-card::before {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    top: -80px;
    right: -60px;
}

.hero-balance-card::after {
    content: '';
    position: absolute;
    width: 150px;
    height: 150px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    bottom: -60px;
    left: -40px;
}

.hero-balance-card .card-decorative {
    position: absolute;
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 50%;
    top: 50%;
    left: 40%;
    transform: translateY(-50%);
}

.balance-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 4px;
}

.balance-amount {
    font-size: 38px;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
    margin-bottom: 20px;
}

.balance-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.balance-meta-item {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

.balance-meta-item strong {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: white;
}

/* === Quick Action Grid === */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    padding: 0 16px;
}

.quick-action-btn {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 14px 8px 12px;
    text-align: center;
    text-decoration: none;
    color: var(--gray-700);
    border: 1px solid var(--gray-100);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.quick-action-btn:hover,
.quick-action-btn:active {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    color: var(--primary);
    border-color: rgba(79, 70, 229, 0.15);
}

.quick-action-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all var(--transition-base);
}

.quick-action-text {
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--gray-600);
}

/* === Section Titles === */
.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    margin-bottom: 12px;
}

.section-title h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
}

.section-title a {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 3px;
}

/* === Card Component === */
.app-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    border: 1px solid var(--gray-100);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: all var(--transition-base);
}

.app-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

/* === Loan Status Card === */
.loan-status-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    margin: 0 16px;
    border: 1px solid var(--gray-100);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.loan-status-card .card-inner {
    padding: 20px;
}

/* === Transaction List Items === */
.transaction-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    margin: 0 16px 10px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
    transition: all var(--transition-fast);
    text-decoration: none;
    color: inherit;
}

.transaction-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateX(3px);
}

.transaction-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

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

.transaction-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.transaction-date {
    font-size: 12px;
    color: var(--gray-400);
}

.transaction-amount {
    font-size: 15px;
    font-weight: 700;
    text-align: right;
    white-space: nowrap;
}

.transaction-amount.credit {
    color: var(--success);
}

.transaction-amount.debit {
    color: var(--gray-800);
}

/* === Bottom Navigation Bar === */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background: white;
    border-top: 1px solid var(--gray-100);
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.08);
    display: flex;
    justify-content: space-around;
    padding: 10px 0 max(12px, env(safe-area-inset-bottom));
    z-index: 1000;
}

.bottom-nav-item {
    text-decoration: none;
    color: var(--gray-400);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    font-size: 10px;
    font-weight: 600;
    padding: 4px 16px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    position: relative;
    -webkit-tap-highlight-color: transparent;
}

.bottom-nav-item.active {
    color: var(--primary);
}

.bottom-nav-item i {
    font-size: 22px;
    line-height: 1;
}

.bottom-nav-item .nav-dot {
    position: absolute;
    top: 0;
    width: 4px;
    height: 4px;
    background: var(--primary);
    border-radius: 50%;
    opacity: 0;
    transition: all var(--transition-fast);
}

.bottom-nav-item.active .nav-dot {
    opacity: 1;
}

/* === Status Badge System === */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.status-badge.pending {
    background: var(--pending-light);
    color: var(--pending-color);
}

.status-badge.approved {
    background: var(--success-light);
    color: var(--success);
}

.status-badge.rejected {
    background: var(--danger-light);
    color: var(--danger);
}

.status-badge.disbursed {
    background: var(--info-light);
    color: var(--info);
}

.status-badge.closed {
    background: var(--gray-100);
    color: var(--gray-500);
}

.status-badge.held {
    background: var(--warning-light);
    color: var(--warning);
}

.status-badge.overdue {
    background: var(--danger-light);
    color: var(--danger);
}

.status-badge.paid {
    background: var(--success-light);
    color: var(--success);
}

.status-badge.active {
    background: var(--success-light);
    color: var(--success);
}

.status-badge.suspended {
    background: var(--danger-light);
    color: var(--danger);
}

/* Legacy badge compatibility */
.badge-pending {
    background: var(--pending-light) !important;
    color: var(--pending-color) !important;
    border: none !important;
}

.badge-approved {
    background: var(--success-light) !important;
    color: var(--success) !important;
    border: none !important;
}

.badge-rejected {
    background: var(--danger-light) !important;
    color: var(--danger) !important;
    border: none !important;
}

.badge-disbursed {
    background: var(--info-light) !important;
    color: var(--info) !important;
    border: none !important;
}

.badge-closed {
    background: var(--gray-100) !important;
    color: var(--gray-500) !important;
    border: none !important;
}

.badge-held {
    background: var(--warning-light) !important;
    color: var(--warning) !important;
    border: none !important;
}

.badge-overdue {
    background: var(--danger-light) !important;
    color: var(--danger) !important;
    border: none !important;
}

.badge-paid {
    background: var(--success-light) !important;
    color: var(--success) !important;
    border: none !important;
}

/* === Form Stepper === */
.form-stepper {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    position: relative;
    padding: 0 20px;
    margin: 20px auto 36px;
    max-width: 500px;
}

.form-stepper::before {
    content: '';
    position: absolute;
    top: 18px;
    left: 50px;
    right: 50px;
    height: 2px;
    background: var(--gray-200);
    z-index: 0;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 1;
}

.step-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gray-200);
    color: var(--gray-500);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    transition: all var(--transition-base);
    border: 3px solid white;
    box-shadow: var(--shadow-sm);
}

.step.active .step-circle {
    background: var(--primary);
    color: white;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.2);
    transform: scale(1.1);
}

.step.completed .step-circle {
    background: var(--success);
    color: white;
}

.step-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--gray-400);
    text-align: center;
    white-space: nowrap;
}

.step.active .step-label {
    color: var(--primary);
}

.step.completed .step-label {
    color: var(--success);
}

/* === Gradient Backgrounds (auth pages) === */
.gradient-bg {
    background: linear-gradient(150deg, #1e1b4b 0%, #312e81 40%, #4c1d95 100%);
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

.gradient-bg::before {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: rgba(129, 140, 248, 0.15);
    border-radius: 50%;
    top: -100px;
    right: -100px;
}

.gradient-bg::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background: rgba(167, 139, 250, 0.1);
    border-radius: 50%;
    bottom: -80px;
    left: -80px;
}

/* Glass Card (auth) */
.glass-card {
    background: rgba(255, 255, 255, 0.97);
    border-radius: var(--radius-2xl);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25), 0 8px 25px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.8);
}

/* Premium Form Controls */
.form-control,
.form-select {
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--gray-200);
    padding: 12px 16px;
    font-size: 15px;
    font-family: var(--font-primary);
    transition: all var(--transition-fast);
    background: white;
    color: var(--gray-800);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
    background: white;
    outline: none;
}

.form-control.form-control-lg {
    padding: 14px 18px;
    font-size: 15px;
    border-radius: var(--radius-md);
}

.form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 8px;
}

/* Premium Buttons */
.btn {
    font-family: var(--font-primary);
    font-weight: 600;
    transition: all var(--transition-fast);
}

.btn-primary {
    background: var(--primary-gradient);
    border: none;
    color: white;
    box-shadow: var(--shadow-primary);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, #6D28D9 100%);
    box-shadow: 0 10px 30px rgba(79, 70, 229, 0.4);
    transform: translateY(-1px);
    color: white;
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: var(--shadow-primary);
}

.btn-accent {
    background: var(--accent-gradient);
    border: none;
    color: white;
    box-shadow: var(--shadow-accent);
}

.btn-accent:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 30px rgba(245, 158, 11, 0.4);
    color: white;
}

.btn-outline-primary {
    border: 2px solid var(--primary);
    color: var(--primary);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--primary);
    color: white;
    box-shadow: var(--shadow-primary);
}

.btn-light-primary {
    background: var(--primary-gradient-soft);
    border: 1.5px solid rgba(79, 70, 229, 0.2);
    color: var(--primary);
}

.btn-light-primary:hover {
    background: var(--primary);
    color: white;
    box-shadow: var(--shadow-primary);
}

/* === Loan Cards (loan-select.php) === */
.loan-plan-card {
    background: var(--bg-card);
    border-radius: var(--radius-2xl);
    border: 2px solid var(--gray-100);
    padding: 28px 24px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.loan-plan-card:hover {
    border-color: var(--primary);
    box-shadow: 0 12px 35px rgba(79, 70, 229, 0.15);
    transform: translateY(-4px);
}

.loan-plan-card.featured {
    border-color: var(--primary);
    background: linear-gradient(170deg, rgba(79, 70, 229, 0.03) 0%, rgba(124, 58, 237, 0.03) 100%);
    box-shadow: 0 8px 30px rgba(79, 70, 229, 0.12);
}

.loan-plan-card.featured::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-gradient);
}

.loan-amount-display {
    font-size: 42px;
    font-weight: 800;
    letter-spacing: -0.03em;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-bottom: 4px;
}

.loan-plan-meta {
    display: flex;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid var(--gray-100);
}

.loan-plan-meta:last-of-type {
    border-bottom: none;
}

.loan-meta-label {
    font-size: 13px;
    color: var(--gray-500);
    font-weight: 500;
}

.loan-meta-value {
    font-size: 13px;
    color: var(--gray-800);
    font-weight: 700;
}

/* === EMI Progress Bar === */
.emi-progress-wrap {
    background: var(--gray-100);
    border-radius: var(--radius-pill);
    height: 8px;
    overflow: hidden;
}

.emi-progress-bar {
    height: 100%;
    background: var(--primary-gradient);
    border-radius: var(--radius-pill);
    transition: width 1s ease;
}

/* === Stat Tiles (Admin) === */
.stat-tile {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
    position: relative;
    overflow: hidden;
    transition: all var(--transition-base);
}

.stat-tile:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.stat-tile .tile-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 16px;
}

.stat-tile .tile-value {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
    margin-bottom: 4px;
    color: var(--gray-900);
}

.stat-tile .tile-label {
    font-size: 13px;
    color: var(--gray-500);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-tile .tile-decoration {
    position: absolute;
    font-size: 100px;
    right: -15px;
    bottom: -15px;
    opacity: 0.07;
    line-height: 1;
}

/* === Admin Sidebar === */
.admin-sidebar {
    width: 260px;
    background: linear-gradient(170deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1050;
    transition: transform var(--transition-base);
    display: flex;
    flex-direction: column;
    padding: 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.admin-sidebar::-webkit-scrollbar {
    width: 4px;
}

.admin-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.admin-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.sidebar-brand {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.sidebar-brand-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-gradient);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
    box-shadow: var(--shadow-primary);
    flex-shrink: 0;
}

.sidebar-brand-text {
    font-size: 16px;
    font-weight: 800;
    color: white;
    line-height: 1.1;
}

.sidebar-brand-sub {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 500;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
}

.sidebar-section-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.3);
    padding: 4px 12px 8px;
    margin-top: 8px;
}

.sidebar-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    border-radius: var(--radius-md);
    text-decoration: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition-fast);
    margin-bottom: 2px;
    position: relative;
}

.sidebar-nav-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
}

.sidebar-nav-link.active {
    background: rgba(79, 70, 229, 0.2);
    color: white;
    font-weight: 600;
}

.sidebar-nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--primary-light);
    border-radius: 0 3px 3px 0;
}

.sidebar-nav-link i {
    font-size: 18px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-nav-link .badge-count {
    margin-left: auto;
    background: var(--danger);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: var(--radius-pill);
}

.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.sidebar-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    margin-bottom: 10px;
}

.sidebar-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    color: white;
    flex-shrink: 0;
}

.sidebar-user-name {
    font-size: 14px;
    font-weight: 700;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}

.sidebar-user-role {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
}

/* Admin Content Wrapper */
.admin-content-wrapper {
    margin-left: 260px;
    min-height: 100vh;
    background: var(--bg-page);
    display: flex;
    flex-direction: column;
}

/* Admin Top Bar */
.admin-topbar {
    background: var(--bg-card);
    border-bottom: 1px solid var(--gray-100);
    padding: 16px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.admin-topbar-title h1 {
    font-size: 20px;
    font-weight: 800;
    color: var(--gray-900);
    margin: 0;
    line-height: 1;
}

.admin-topbar-title p {
    font-size: 13px;
    color: var(--gray-400);
    margin: 3px 0 0;
}

/* Tables */
.premium-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.premium-table th {
    background: var(--gray-50);
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--gray-500);
    border-bottom: 1px solid var(--gray-200);
    white-space: nowrap;
}

.premium-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--gray-100);
    font-size: 14px;
    color: var(--gray-700);
    vertical-align: middle;
}

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

.premium-table tbody tr {
    transition: background var(--transition-fast);
}

.premium-table tbody tr:hover {
    background: var(--gray-50);
}

/* Card Table Wrapper */
.card-table {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    border: 1px solid var(--gray-100);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

/* Data List Items (mobile-friendly) */
.data-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid var(--gray-100);
    transition: background var(--transition-fast);
}

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

.data-list-item:hover {
    background: var(--gray-50);
}

/* === Dashboard Promo Card === */
.promo-card {
    background: linear-gradient(135deg, #F59E0B 0%, #EF4444 100%);
    border-radius: var(--radius-xl);
    padding: 20px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 16px;
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.3);
    position: relative;
    overflow: hidden;
}

.promo-card::after {
    content: '';
    position: absolute;
    width: 120px;
    height: 120px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    top: -40px;
    right: -30px;
}

.promo-card h4 {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 4px;
}

.promo-card p {
    font-size: 13px;
    opacity: 0.85;
    margin: 0;
    font-weight: 500;
}

.btn-promo {
    background: white;
    color: #D97706;
    border-radius: var(--radius-pill);
    padding: 10px 20px;
    font-weight: 700;
    font-size: 13px;
    text-decoration: none;
    box-shadow: var(--shadow-sm);
    white-space: nowrap;
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}

/* === KYC Upload Preview === */
.kyc-upload-box {
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    background: var(--gray-50);
    position: relative;
}

.kyc-upload-box:hover {
    border-color: var(--primary);
    background: var(--primary-gradient-soft);
}

.kyc-upload-box.has-file {
    border-color: var(--success);
    background: var(--success-light);
}

.kyc-upload-box .preview-img {
    max-width: 100%;
    max-height: 130px;
    object-fit: cover;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

/* === Page Header Section === */
.page-header {
    padding: 20px 16px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: transparent;
}

.page-header-back {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--gray-700);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
    font-size: 18px;
    transition: all var(--transition-fast);
}

.page-header-back:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.page-header-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
}

/* === EMI Card === */
.emi-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid var(--gray-100);
}

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

.emi-number {
    font-size: 12px;
    font-weight: 700;
    color: var(--gray-400);
    text-transform: uppercase;
}

.emi-date {
    font-size: 13px;
    color: var(--gray-600);
    margin-top: 2px;
}

.emi-amount {
    font-size: 16px;
    font-weight: 700;
    color: var(--gray-900);
}

/* Meta Info Row (profile/details pages) */
.meta-info-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid var(--gray-100);
}

.meta-info-row:last-child {
    border-bottom: none;
}

.meta-info-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-400);
    margin-bottom: 3px;
}

.meta-info-value {
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-800);
}

/* === Alerts Override === */
.alert {
    border-radius: var(--radius-md);
    border: none;
    padding: 14px 18px;
    font-size: 14px;
    font-weight: 500;
}

.alert-success {
    background: var(--success-light);
    color: #065F46;
}

.alert-danger {
    background: var(--danger-light);
    color: #991B1B;
}

.alert-warning {
    background: var(--warning-light);
    color: #92400E;
}

.alert-info {
    background: var(--info-light);
    color: #1E40AF;
}

/* === Notification Badge === */
.notif-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 16px;
    height: 16px;
    background: var(--danger);
    color: white;
    border-radius: 50%;
    font-size: 9px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

/* === Splash Screen === */
.splash-screen {
    background: linear-gradient(160deg, #1e1b4b 0%, #312e81 50%, #4c1d95 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.splash-screen::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(129, 140, 248, 0.2) 0%, transparent 70%);
    top: -100px;
    left: -100px;
}

.splash-screen::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(167, 139, 250, 0.15) 0%, transparent 70%);
    bottom: -100px;
    right: -100px;
}

.splash-logo {
    width: 90px;
    height: 90px;
    background: var(--primary-gradient);
    border-radius: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: white;
    box-shadow: 0 20px 50px rgba(79, 70, 229, 0.4);
    margin-bottom: 28px;
    position: relative;
    z-index: 1;
    animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }
}

.splash-title {
    font-size: 36px;
    font-weight: 900;
    color: white;
    letter-spacing: -0.03em;
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.8s ease forwards;
}

.splash-subtitle {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 8px;
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.8s 0.2s ease both;
}

.splash-loader {
    margin-top: 60px;
    display: flex;
    gap: 8px;
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.8s 0.4s ease both;
}

.splash-loader-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    animation: loaderPulse 1.4s ease infinite;
}

.splash-loader-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.splash-loader-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes loaderPulse {

    0%,
    60%,
    100% {
        transform: scale(1);
        opacity: 0.4;
    }

    30% {
        transform: scale(1.4);
        opacity: 1;
        background: white;
    }
}

@keyframes fadeInUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* === Admin Mobile Hamburger === */
.admin-hamburger {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 1100;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: var(--primary-gradient);
    color: white;
    border: none;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: var(--shadow-primary);
    cursor: pointer;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    backdrop-filter: blur(3px);
}

/* === Utility Classes === */
.text-primary-gradient {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bg-primary-gradient {
    background: var(--primary-gradient);
}

.bg-accent-gradient {
    background: var(--accent-gradient);
}

.hover-lift {
    transition: transform var(--transition-fast);
}

.hover-lift:hover {
    transform: translateY(-3px);
}

.opacity-10 {
    opacity: 0.1;
}

.overflow-hidden {
    overflow: hidden;
}

/* Number input no spinners */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type=number] {
    -moz-appearance: textfield;
}

/* Scrollbar for page */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: var(--radius-pill);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

/* === Responsive — Desktop (admin) === */
@media (min-width: 992px) {
    .bottom-nav {
        display: none !important;
    }

    .mobile-app-container {
        max-width: 420px;
        margin: 30px auto;
        border-radius: 40px;
        border: 10px solid #1a1a2e;
        box-shadow: 0 40px 80px rgba(0, 0, 0, 0.2);
        padding-bottom: 0;
        min-height: auto;
        overflow: hidden;
    }

    .mobile-app-container .bottom-nav {
        display: flex !important;
        border-radius: 0 0 30px 30px;
        max-width: 100%;
        position: sticky;
    }

    body.user-page {
        background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
    }
}

@media (max-width: 991px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }

    .admin-sidebar.show {
        transform: translateX(0);
        box-shadow: 20px 0 50px rgba(0, 0, 0, 0.3);
    }

    .admin-content-wrapper {
        margin-left: 0;
        padding-top: 70px;
    }

    .admin-hamburger {
        display: flex;
    }

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

    .admin-topbar {
        padding: 14px 20px 14px 70px;
    }
}

@media (max-width: 576px) {
    .quick-actions {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }

    .balance-amount {
        font-size: 32px;
    }

    .loan-amount-display {
        font-size: 34px;
    }
}

/* === Input Group Prefix Styling === */
.input-group-text {
    background: var(--gray-50);
    border: 1.5px solid var(--gray-200);
    color: var(--gray-500);
    font-weight: 600;
}

/* Tabs Premium Style */
.premium-tabs .nav-link {
    color: var(--gray-500);
    font-weight: 600;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 10px 20px;
    border-radius: 0;
    background: transparent;
    transition: all var(--transition-fast);
}

.premium-tabs .nav-link.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: transparent;
}

.premium-tabs .nav-link:hover {
    color: var(--primary);
}

/* Loan agreement checklist */
.terms-check {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: var(--gray-50);
    border-radius: var(--radius-md);
    border: 1.5px solid var(--gray-200);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.terms-check:hover {
    border-color: var(--primary);
    background: var(--primary-gradient-soft);
}

.terms-check input[type=checkbox] {
    margin-top: 2px;
}

/* Summary Row (loan agreement) */
.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-100);
    font-size: 14px;
}

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

.summary-row .label {
    color: var(--gray-500);
    font-weight: 500;
}

.summary-row .value {
    color: var(--gray-800);
    font-weight: 700;
}

.summary-row.total .value {
    color: var(--primary);
    font-size: 18px;
}

/* Countdown Timer */
.countdown-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--primary-gradient-soft);
    border: 3px solid rgba(79, 70, 229, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.countdown-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
}

.countdown-label {
    font-size: 11px;
    color: var(--gray-400);
    font-weight: 600;
}

/* === Ripple Effect === */
.btn,
.quick-action-btn,
.transaction-item {
    position: relative;
    overflow: hidden;
}

.ripple-effect {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%);
    background-size: 200% 100%;
    animation: skeleton-load 1.5s ease infinite;
    border-radius: var(--radius-sm);
}

@keyframes skeleton-load {
    from {
        background-position: 200% 0;
    }

    to {
        background-position: -200% 0;
    }
}

/* Support Ticket List */
.ticket-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-100);
    transition: background var(--transition-fast);
    cursor: pointer;
}

.ticket-item:hover {
    background: var(--gray-50);
}

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