/* ==========================================================================
   صندوق قرض‌الحسنه خانوادگی - Neo-Bank RTL Mobile-First Stylesheet
   100% Offline Compatible - Bundled Local Vazirmatn Fonts
   ========================================================================== */

/* Local Vazirmatn Font Faces (100% Offline) */
@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-SemiBold.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-ExtraBold.woff2') format('woff2');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}

:root {
    --bg-page: #f8fafc;
    --bg-card: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;

    /* Emerald Neo-Bank Palette */
    --emerald-50: #ecfdf5;
    --emerald-100: #d1fae5;
    --emerald-200: #a7f3d0;
    --emerald-500: #10b981;
    --emerald-600: #059669;
    --emerald-700: #047857;
    --emerald-800: #065f46;
    --emerald-900: #064e3b;

    /* Status Colors */
    --success-bg: #ecfdf5;
    --success-text: #047857;
    --warning-bg: #fef3c7;
    --warning-text: #b45309;
    --danger-bg: #fee2e2;
    --danger-text: #b91c1c;
    --info-bg: #e0f2fe;
    --info-text: #0369a1;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
    --shadow-lg: 0 10px 25px -3px rgba(15, 23, 42, 0.1), 0 4px 6px -4px rgba(15, 23, 42, 0.05);
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    direction: rtl;
    text-align: right;
    font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, "Segoe UI", "Tahoma", "Arial", sans-serif;
    background-color: var(--bg-page);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.6;
    min-height: 100vh;
}

/* Centered Mobile Container */
.mobile-wrapper {
    max-width: 420px;
    margin: 0 auto;
    min-height: 100vh;
    background-color: #ffffff;
    box-shadow: 0 0 35px rgba(0, 0, 0, 0.06);
    position: relative;
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
    padding: 16px 16px 90px 16px;
}

/* Header Bar */
.top-navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background-color: #ffffff;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 40;
}

.top-navbar .brand-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--emerald-800);
    display: flex;
    align-items: center;
    gap: 8px;
}

.top-navbar .user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

.logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    color: var(--danger-text);
    background-color: var(--danger-bg);
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: opacity 0.2s;
}

.logout-btn:hover {
    opacity: 0.85;
}

/* Hero Card (Neo-Bank Metallic Emerald) */
.hero-card {
    background: linear-gradient(135deg, var(--emerald-900) 0%, var(--emerald-700) 55%, var(--emerald-600) 100%);
    color: #ffffff;
    border-radius: var(--radius-lg);
    padding: 22px 20px;
    margin-bottom: 20px;
    box-shadow: 0 12px 28px -4px rgba(4, 120, 87, 0.35);
    position: relative;
    overflow: hidden;
}

.hero-card::after {
    content: "";
    position: absolute;
    top: -40px;
    left: -40px;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    pointer-events: none;
}

.hero-card .hero-label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.82);
    margin-bottom: 6px;
    font-weight: 500;
}

.hero-card .hero-amount {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.5px;
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.hero-card .hero-currency {
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
}

.hero-card .hero-meta {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.16);
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.85);
}

/* Metric Cards Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.metric-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    transition: transform 0.15s, box-shadow 0.15s;
}

.metric-card:hover {
    box-shadow: var(--shadow-md);
}

.metric-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.metric-icon-box {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.metric-icon-box.emerald {
    background-color: var(--emerald-50);
    color: var(--emerald-600);
}

.metric-icon-box.amber {
    background-color: var(--warning-bg);
    color: var(--warning-text);
}

.metric-icon-box.rose {
    background-color: var(--danger-bg);
    color: var(--danger-text);
}

.metric-icon-box.blue {
    background-color: var(--info-bg);
    color: var(--info-text);
}

.metric-title {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.metric-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 4px;
}

.metric-unit {
    font-size: 11px;
    font-weight: normal;
    color: var(--text-muted);
}

/* Section Header */
.section-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-link {
    font-size: 12px;
    color: var(--emerald-600);
    text-decoration: none;
    font-weight: 600;
}

/* Card Lists */
.card-item {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px;
    margin-bottom: 10px;
    box-shadow: var(--shadow-sm);
}

.card-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.card-item-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.card-item-meta {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 6px;
}

/* Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
}

.badge-paid, .badge-approved {
    background-color: var(--success-bg);
    color: var(--success-text);
}

.badge-unpaid, .badge-rejected {
    background-color: var(--danger-bg);
    color: var(--danger-text);
}

.badge-partial, .badge-pending {
    background-color: var(--warning-bg);
    color: var(--warning-text);
}

.badge-neutral {
    background-color: var(--border-light);
    color: var(--text-secondary);
}

/* Bottom Navigation Bar */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 420px;
    height: 72px;
    background-color: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0 8px;
    z-index: 50;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.03);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    transition: color 0.15s, transform 0.1s;
    min-width: 64px;
}

.nav-item svg {
    width: 22px;
    height: 22px;
    margin-bottom: 3px;
    stroke-width: 1.8;
}

.nav-item.active {
    color: var(--emerald-600);
    font-weight: 700;
}

.nav-item:active {
    transform: scale(0.95);
}

/* Forms & Inputs */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 12px 14px;
    font-size: 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: #ffffff;
    color: var(--text-primary);
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
    font-family: inherit;
}

.form-input:focus {
    border-color: var(--emerald-500);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 18px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.15s, transform 0.1s;
    font-family: inherit;
    width: 100%;
}

.btn-primary {
    background-color: var(--emerald-600);
    color: #ffffff;
}

.btn-primary:hover {
    background-color: var(--emerald-700);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: var(--radius-sm);
    width: auto;
}

.btn-outline-primary {
    background-color: transparent;
    color: var(--emerald-600);
    border: 1px solid var(--emerald-500);
}

.btn-outline-primary:hover {
    background-color: var(--emerald-50);
}

/* Alerts / Flash Messages */
.flash-container {
    margin-bottom: 16px;
}

.alert {
    padding: 12px 14px;
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert-success {
    background-color: var(--success-bg);
    color: var(--success-text);
    border: 1px solid #a7f3d0;
}

.alert-danger {
    background-color: var(--danger-bg);
    color: var(--danger-text);
    border: 1px solid #fecaca;
}

.alert-warning {
    background-color: var(--warning-bg);
    color: var(--warning-text);
    border: 1px solid #fde68a;
}

.alert-info {
    background-color: var(--info-bg);
    color: var(--info-text);
    border: 1px solid #bae6fd;
}

/* Login Page Styling */
.login-header {
    text-align: center;
    margin: 40px 0 28px 0;
}

.login-logo {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--emerald-600) 0%, var(--emerald-800) 100%);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    box-shadow: 0 8px 20px -2px rgba(4, 120, 87, 0.3);
}

.login-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
}

.login-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.login-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px 20px;
    box-shadow: var(--shadow-md);
}

.pin-inputs {
    display: flex;
    justify-content: center;
    direction: ltr;
    gap: 8px;
    margin-top: 4px;
}

.pin-digit {
    width: 48px;
    height: 52px;
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.pin-digit:focus {
    border-color: var(--emerald-500);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

/* Empty states */
.empty-state {
    text-align: center;
    padding: 30px 16px;
    color: var(--text-muted);
}

.empty-state svg {
    width: 44px;
    height: 44px;
    margin-bottom: 10px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 13px;
}

/* ==========================================================================
   Step 2 Styles: Urgent Banner, Quick Actions, Modals, Lightbox & Receipts
   ========================================================================== */

/* 1. Urgent Pending Receipts Banner */
.urgent-banner {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 1px solid #fde68a;
    border-right: 5px solid #d97706;
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.12);
}

.urgent-banner-text {
    font-size: 13px;
    font-weight: 700;
    color: #92400e;
    display: flex;
    align-items: center;
    gap: 8px;
}

.urgent-banner-btn {
    background-color: #d97706;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.15s;
}

.urgent-banner-btn:hover {
    background-color: #b45309;
}

/* 2. Quick Action Buttons Grid (2x2) */
.actions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

.action-btn-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    text-align: right;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.15s ease;
    box-shadow: var(--shadow-sm);
    font-family: inherit;
    width: 100%;
}

.action-btn-card:hover {
    border-color: var(--emerald-500);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.action-btn-card:active {
    transform: scale(0.97);
}

.action-btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.action-btn-icon.emerald { background: var(--emerald-50); color: var(--emerald-600); }
.action-btn-icon.amber { background: var(--warning-bg); color: var(--warning-text); }
.action-btn-icon.blue { background: var(--info-bg); color: var(--info-text); }
.action-btn-icon.rose { background: var(--danger-bg); color: var(--danger-text); }

.action-btn-text {
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
}

/* 3. Defaulters List */
.defaulter-item {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: border-color 0.15s;
}

.defaulter-info {
    flex: 1;
}

.defaulter-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
}

.defaulter-sub {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.defaulter-amount {
    font-size: 13px;
    font-weight: 700;
    color: var(--danger-text);
}

/* 4. Modals (Mobile Bottom-Sheet) */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background-color: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: none;
    align-items: flex-end;
    justify-content: center;
}

.modal-backdrop.active {
    display: flex;
}

.modal-dialog {
    background: #ffffff;
    width: 100%;
    max-width: 420px;
    border-radius: 24px 24px 0 0;
    padding: 20px 18px 28px 18px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.15);
    animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--border-color);
}

.modal-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-close-btn {
    background: var(--border-light);
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: background 0.15s;
}

.modal-close-btn:hover {
    background: var(--border-color);
}

/* 5. Filter Tabs (Pill style) */
.filter-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.tab-pill {
    padding: 8px 14px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    text-decoration: none;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
}

.tab-pill:hover {
    border-color: var(--emerald-500);
}

.tab-pill.active {
    background: var(--emerald-600);
    border-color: var(--emerald-600);
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(5, 150, 105, 0.25);
}

.tab-pill .tab-count {
    background: rgba(0, 0, 0, 0.08);
    padding: 1px 6px;
    border-radius: 9999px;
    font-size: 10px;
}

.tab-pill.active .tab-count {
    background: rgba(255, 255, 255, 0.25);
}

/* 6. Receipt Card & Lightbox */
.receipt-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px;
    margin-bottom: 14px;
    box-shadow: var(--shadow-sm);
}

.receipt-main-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.receipt-thumb-box {
    width: 68px;
    height: 68px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
    border: 1px solid var(--border-color);
    background-color: var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
}

.receipt-thumb-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.receipt-thumb-box .zoom-icon {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.15s;
}

.receipt-thumb-box:hover .zoom-icon {
    opacity: 1;
}

.receipt-details {
    flex: 1;
}

.preview-chip {
    margin-top: 8px;
    padding: 6px 10px;
    background-color: var(--emerald-50);
    border: 1px dashed var(--emerald-200);
    border-radius: var(--radius-sm);
    font-size: 11px;
    color: var(--emerald-800);
    line-height: 1.5;
}

.lightbox-modal {
    position: fixed;
    inset: 0;
    background: rgba(10, 15, 25, 0.94);
    z-index: 1200;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.lightbox-modal.active {
    display: flex;
}

.lightbox-img {
    max-width: 95%;
    max-height: 80vh;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    object-fit: contain;
}

.lightbox-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #ffffff;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 7. Bottom Nav Badge */
.nav-badge-dot {
    position: absolute;
    top: 4px;
    right: calc(50% - 16px);
    background-color: var(--danger-text);
    color: #ffffff;
    font-size: 9px;
    font-weight: 800;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    box-shadow: 0 2px 5px rgba(185, 28, 28, 0.4);
}

/* ==========================================================================
   Step 3 Styles: Toast, Passbook Switcher, Bank Card Box, Loan Progress & PWA
   ========================================================================== */

/* Toast Notification */
.toast-notification {
    position: fixed;
    bottom: 84px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(15, 23, 42, 0.92);
    color: #ffffff;
    padding: 10px 18px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 600;
    z-index: 2000;
    pointer-events: none;
    opacity: 0;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
    white-space: nowrap;
}

.toast-notification.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Passbook Switcher (Horizontal scrollable pills) */
.passbook-switcher {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 14px;
    scrollbar-width: none;
}

.passbook-switcher::-webkit-scrollbar {
    display: none;
}

.switcher-pill {
    padding: 8px 14px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.switcher-pill:hover {
    border-color: var(--emerald-500);
}

.switcher-pill.active {
    background: var(--emerald-600);
    border-color: var(--emerald-600);
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(5, 150, 105, 0.25);
}

/* Bank Card Box with Copy */
.bank-card-box {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px;
    margin-top: 14px;
    position: relative;
}

.card-number-display {
    font-family: -apple-system, "Segoe UI", Tahoma, sans-serif;
    font-size: 17px;
    font-weight: 800;
    letter-spacing: 2.5px;
    color: #1e293b;
    margin: 8px 0;
    direction: ltr;
    text-align: center;
    background: #ffffff;
    padding: 10px;
    border-radius: var(--radius-sm);
    border: 1px dashed var(--border-color);
}

.btn-copy-card {
    width: 100%;
    padding: 9px;
    font-size: 12px;
    font-weight: 700;
    background: #ffffff;
    border: 1px solid var(--emerald-500);
    color: var(--emerald-700);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    transition: background 0.15s;
    font-family: inherit;
}

.btn-copy-card:hover {
    background: var(--emerald-50);
}

/* Dropzone & Image Upload Preview */
.upload-dropzone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px 16px;
    text-align: center;
    cursor: pointer;
    background: #ffffff;
    transition: border-color 0.15s, background-color 0.15s;
    position: relative;
    overflow: hidden;
}

.upload-dropzone:hover {
    border-color: var(--emerald-500);
    background-color: var(--emerald-50);
}

.upload-dropzone input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.dropzone-preview {
    max-height: 220px;
    border-radius: var(--radius-md);
    margin-top: 10px;
    display: none;
    object-fit: contain;
    width: 100%;
    border: 1px solid var(--border-color);
}

/* Checkbox item in receipt upload */
.checkbox-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    cursor: pointer;
    transition: border-color 0.15s;
}

.checkbox-card.checked {
    border-color: var(--emerald-500);
    background-color: var(--emerald-50);
}

.checkbox-card input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--emerald-600);
    cursor: pointer;
}

/* Loan Progress Bar */
.progress-container {
    width: 100%;
    height: 8px;
    background-color: var(--border-light);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin: 8px 0;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--emerald-600) 0%, var(--emerald-400) 100%);
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
}

/* History Ledger Item */
.ledger-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
}

.ledger-item-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ledger-item-icon.inflow {
    background: var(--success-bg);
    color: var(--success-text);
}

.ledger-item-icon.outflow {
    background: var(--danger-bg);
    color: var(--danger-text);
}

/* ==========================================================================
   Responsive Utilities & Layout Classes
   ========================================================================== */
.responsive-cards-grid {
    display: block;
}

.desktop-two-col {
    display: block;
}

.form-container-centered {
    width: 100%;
}

/* ==========================================================================
   Desktop & Windows Wide Screen Styles (min-width: 768px)
   ========================================================================== */
@media (min-width: 768px) {
    /* 1. Page Background & Expanded Main Container */
    body {
        background-color: #f1f5f9;
        display: flex;
        flex-direction: column;
    }

    .mobile-wrapper,
    .app-container {
        max-width: 1120px;
        margin: 24px auto;
        min-height: calc(100vh - 48px);
        background-color: #ffffff;
        border-radius: var(--radius-lg);
        box-shadow: 0 10px 30px -5px rgba(15, 23, 42, 0.08), 0 0 1px 1px rgba(15, 23, 42, 0.05);
        border: 1px solid var(--border-color);
        position: relative;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    /* 2. Top Header Refinement */
    .top-navbar {
        order: 1;
        padding: 16px 32px;
        background-color: #ffffff;
        border-bottom: 1px solid var(--border-color);
        position: static;
    }

    .top-navbar .brand-title {
        font-size: 18px;
    }

    .top-navbar .brand-title svg {
        width: 24px;
        height: 24px;
    }

    .top-navbar .user-info {
        font-size: 13px;
        gap: 12px;
    }

    /* 3. Transform Bottom Nav into Sleek Top Horizontal Sub-Nav */
    .bottom-nav {
        position: static;
        transform: none;
        order: 2; /* Positioned directly beneath top-navbar! */
        width: 100%;
        max-width: 100%;
        height: auto;
        min-height: 54px;
        background-color: #ffffff;
        border-top: none;
        border-bottom: 1px solid var(--border-color);
        box-shadow: none;
        display: flex;
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
        gap: 8px;
        padding: 6px 32px;
        z-index: 30;
    }

    .nav-item {
        flex-direction: row;
        align-items: center;
        gap: 8px;
        font-size: 13px;
        font-weight: 600;
        padding: 8px 16px;
        border-radius: var(--radius-sm);
        min-width: auto;
        color: var(--text-secondary);
        transition: all 0.15s ease;
    }

    .nav-item svg {
        width: 18px;
        height: 18px;
        margin-bottom: 0;
    }

    .nav-item:hover {
        background-color: var(--border-light);
        color: var(--emerald-700);
    }

    .nav-item.active {
        background-color: var(--emerald-50);
        color: var(--emerald-700);
        font-weight: 700;
    }

    .nav-badge-dot {
        position: static;
        margin-right: 6px;
        box-shadow: none;
    }

    /* 4. Main Content Area Padding */
    .main-content {
        order: 3;
        flex: 1;
        padding: 28px 32px 48px 32px;
    }

    /* 5. 4-Column Horizontal Row for Financial Grid & Actions Grid */
    .metrics-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 16px;
        margin-bottom: 24px;
    }

    .metric-card {
        padding: 16px 18px;
    }

    .metric-value {
        font-size: 20px;
    }

    .actions-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 14px;
        margin-bottom: 24px;
    }

    .action-btn-card {
        padding: 14px 16px;
    }

    /* 6. Multi-Column Responsive Grid (2 or 3 Columns) */
    .responsive-cards-grid,
    #membersContainer {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
        gap: 16px;
        align-items: stretch;
    }

    .responsive-cards-grid > .card-item,
    .responsive-cards-grid > .receipt-card,
    .responsive-cards-grid > .defaulter-item,
    .responsive-cards-grid > .ledger-item,
    #membersContainer > .member-card {
        margin-bottom: 0;
        height: 100%;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }

    /* 7. Two-Column Layout Grid for Balanced Side-by-Side Sections */
    .desktop-two-col {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 20px;
        align-items: start;
    }

    .desktop-two-col > .card-item,
    .desktop-two-col > .hero-card {
        margin-bottom: 0;
        height: 100%;
    }

    /* 8. Centered Modals in Middle of Screen (max-width: 480px) */
    .modal-backdrop {
        align-items: center;
        justify-content: center;
        padding: 24px;
    }

    .modal-dialog {
        max-width: 480px;
        width: 100%;
        border-radius: var(--radius-lg);
        padding: 24px 24px 28px 24px;
        box-shadow: 0 20px 50px -10px rgba(15, 23, 42, 0.3), 0 0 1px 1px rgba(15, 23, 42, 0.1);
        animation: modalFadeIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    }

    /* 9. Lightbox & Toast Refinements */
    .lightbox-img {
        max-width: 85vw;
        max-height: 85vh;
    }

    .toast-notification {
        bottom: 36px;
    }

    /* 10. Passbook Switcher Pills & Form Centering */
    .passbook-switcher {
        flex-wrap: wrap;
        padding-bottom: 0;
        margin-bottom: 20px;
    }

    .form-container-centered {
        max-width: 640px;
        margin: 0 auto;
    }

    .login-header {
        margin: 60px auto 24px auto;
        max-width: 460px;
    }

    .login-card {
        max-width: 460px;
        margin: 0 auto 80px auto;
        padding: 32px 28px;
    }

    .hero-card {
        padding: 26px 24px;
    }

    .hero-card .hero-amount {
        font-size: 30px;
    }
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}


