/* Mahaveer Micro Finance - Main Stylesheet */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary: #2563eb;
    --primary-light: #3b82f6;
    --primary-dark: #1d4ed8;
    --secondary: #64748b;
    --success: #10b981;
    --info: #06b6d4;
    --warning: #f59e0b;
    --danger: #ef4444;
    --light: #f8fafc;
    --dark: #1e293b;
    --white: #ffffff;

    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;

    --radius: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    font-family: var(--font-sans);
    background-color: var(--light);
    color: var(--gray-800);
    overflow-x: hidden;
    padding-top: 70px;
    /* Account for fixed navbar */
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--gray-900);
    font-weight: 700;
}

/* Layout & Sidebar */
.navbar {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    box-shadow: var(--shadow-md);
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.025em;
}

/* Admin Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    padding: 70px 0 0;
    /* Match body padding */
    box-shadow: inset -1px 0 0 rgba(0, 0, 0, .05);
    background-color: var(--white);
    overflow-y: auto;
}

.sidebar-sticky {
    position: relative;
    top: 0;
    height: calc(100vh - 70px);
    padding-top: 1rem;
    overflow-x: hidden;
    overflow-y: auto;
}

.sidebar .nav-link {
    font-weight: 500;
    color: var(--gray-600);
    padding: 0.875rem 1.5rem;
    margin: 0.25rem 1rem;
    border-radius: var(--radius);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar .nav-link:hover {
    color: var(--primary);
    background-color: var(--gray-100);
    transform: translateX(3px);
}

.sidebar .nav-link.active {
    color: var(--primary);
    background-color: rgba(37, 99, 235, 0.1);
    font-weight: 600;
    box-shadow: inset 3px 0 0 var(--primary);
}

.sidebar .nav-link i {
    font-size: 1.15rem;
    width: 20px;
    text-align: center;
    opacity: 0.85;
}

.sidebar-heading {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-400);
    padding: 0 1.5rem;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

/* Main Content Area */
main {
    padding-top: 1.5rem;
    padding-bottom: 3rem;
    min-height: calc(100vh - 70px);
}

/* Cards & Stats */
.card {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: var(--white) !important;
    background-image: radial-gradient(var(--gray-300) 1.5px, transparent 1.5px) !important;
    background-size: 20px 20px !important;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid var(--gray-200);
    padding: 1.5rem 2rem;
    font-weight: 600;
}

.card-body {
    padding: 2rem;
}

/* Dashboard Stat Cards */
.stat-card {
    border: none;
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    color: white;
    position: relative;
    overflow: hidden;
    height: 100%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-card-white {
    background-color: white !important;
    background-image: radial-gradient(var(--gray-300) 1.5px, transparent 1.5px) !important;
    background-size: 20px 20px !important;
    border-radius: 10px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    height: 100%;
    color: var(--gray-800);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 100%);
    pointer-events: none;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(rgba(255, 255, 255, 0.2) 1px, transparent 1px);
    background-size: 20px 20px;
    pointer-events: none;
}

.stat-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: var(--shadow-xl);
}

.stat-card.primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.stat-card.success {
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
}

.stat-card.info {
    background: linear-gradient(135deg, var(--info) 0%, #0891b2 100%);
}

.stat-card.warning {
    background: linear-gradient(135deg, var(--warning) 0%, #d97706 100%);
}

.stat-card.danger {
    background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.875rem;
    font-weight: 500;
    opacity: 0.9;
}

.stat-icon {
    position: absolute;
    right: 1.5rem;
    top: 1.5rem;
    font-size: 2.5rem;
    opacity: 0.2;
}

/* Tables */
.table {
    margin-bottom: 0;
    vertical-align: middle;
}

.table thead th {
    background-color: var(--gray-50);
    color: var(--gray-600);
    font-weight: 600;
    font-size: 0.813rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--gray-200);
    padding: 1.125rem 1.25rem;
}

.table tbody td {
    padding: 1.125rem 1.25rem;
    border-bottom: 1px solid var(--gray-100);
    font-size: 0.938rem;
}

.table-hover tbody tr:hover {
    background-color: var(--gray-50);
    transition: background-color 0.2s ease;
}

/* Badges */
.badge {
    padding: 0.35rem 0.75rem;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 0.025em;
}

.badge-success {
    background-color: #dcfce7;
    color: #166534;
}

.badge-warning {
    background-color: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background-color: #fee2e2;
    color: #991b1b;
}

.badge-info {
    background-color: #dbeafe;
    color: #1e40af;
}

.badge-primary {
    background-color: #dbeafe;
    color: #1e40af;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    border-radius: var(--radius);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    box-shadow: var(--shadow-sm);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Forms */
.form-control,
.form-select {
    border-color: var(--gray-300);
    padding: 0.875rem 1.125rem;
    border-radius: var(--radius);
    font-size: 0.938rem;
    transition: all 0.2s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
    outline: none;
}

.form-floating>label {
    padding: 0.875rem 1.125rem;
}

.form-label {
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

/* Utilities */
.hover-lift:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg) !important;
}

.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

/* Client Profile */
.client-photo {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 50%;
    border: 5px solid #dee2e6;
    background-color: #f8f9fa;
}

.client-photo-placeholder {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 5px solid #dee2e6;
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Status variants for borders */
.border-left-primary {
    border-left: 4px solid var(--primary) !important;
}

.border-left-success {
    border-left: 4px solid var(--success) !important;
}

.border-left-info {
    border-left: 4px solid var(--info) !important;
}

.border-left-warning {
    border-left: 4px solid var(--warning) !important;
}

.border-left-danger {
    border-left: 4px solid var(--danger) !important;
}

.border-left-secondary {
    border-left: 4px solid var(--secondary) !important;
}


/* Collection and Daily Entry Styles */
.collection-summary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.collection-summary::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: float 8s ease-in-out infinite;
}

.progress-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: conic-gradient(var(--success) 0deg, var(--success) var(--progress, 0deg), rgba(255, 255, 255, 0.2) var(--progress, 0deg));
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.progress-circle::before {
    content: '';
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: var(--primary);
    position: absolute;
}

.progress-text {
    position: relative;
    z-index: 1;
    font-weight: 700;
    font-size: 1.2rem;
}

.client-card {
    transition: all 0.3s ease;
    border: none;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    cursor: pointer;
    border-left: 4px solid transparent;
}

.client-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1);
}

.client-card.paid {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-left: 4px solid var(--success);
}

.client-card.pending {
    background: linear-gradient(135deg, #fefce8 0%, #fef3c7 100%);
    border-left: 4px solid var(--warning);
}

.payment-btn {
    border-radius: 12px;
    padding: 0.5rem 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.payment-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.filter-tabs {
    background: white;
    border-radius: 16px;
    padding: 0.5rem;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    margin-bottom: 2rem;
}

.filter-tabs .nav-link {
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
}

.filter-tabs .nav-link.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
}

.payment-modal .modal-content {
    border-radius: 15px;
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.payment-modal .modal-header {
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    color: white;
    border-radius: 15px 15px 0 0;
}

.progress-ring {
    width: 80px;
    height: 80px;
}

.progress-ring circle {
    fill: transparent;
    stroke-width: 8;
    stroke-linecap: round;
}

.progress-ring .bg {
    stroke: #e9ecef;
}

.progress-ring .progress {
    stroke: var(--success);
    stroke-dasharray: 251.2;
    stroke-dashoffset: 251.2;
    transition: stroke-dashoffset 0.5s ease;
}

.collection-item {
    border-left: 4px solid var(--success);
    transition: all 0.3s ease;
}

.collection-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.amount-badge {
    font-size: 1.1rem;
    padding: 0.5rem 1rem;
}

.date-selector {
    max-width: 200px;
}

/* Responsive utilities */
@media (max-width: 767.98px) {
    .sidebar {
        top: 70px;
        left: -100%;
        transition: left 0.3s ease-in-out;
        padding-top: 1rem;
        padding-bottom: 80px;
        /* Space for bottom navbar */
        width: 100%;
        max-width: 300px;
        bottom: 70px;
        /* Account for bottom navbar height */
        z-index: 1020;
        position: fixed;
        overflow-y: auto;
        /* Enable scrolling */
        -webkit-overflow-scrolling: touch;
        /* Smooth scrolling on iOS */
    }

    .sidebar.show {
        left: 0;
        box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    }

    main {
        margin-left: 0 !important;
        padding-top: 1rem;
        padding-bottom: 2rem;
    }

    .navbar-toggler {
        display: block;
    }

    .stat-card {
        margin-bottom: 1rem;
    }

    .card-body {
        padding: 1.25rem;
    }

    .card-header {
        padding: 1rem 1.25rem;
    }

    .collection-summary {
        padding: 1.25rem;
    }

    .table thead th,
    .table tbody td {
        padding: 0.875rem 0.5rem;
        font-size: 0.875rem;
    }

    .btn {
        padding: 0.625rem 1.125rem;
    }

    /* Mobile table responsiveness */
    .table-responsive {
        border-radius: 0.5rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table-responsive table {
        min-width: 600px;
    }

    /* Mobile form improvements */
    .form-control,
    .form-select {
        font-size: 16px;
        /* Prevent zoom on iOS */
    }

    /* Mobile modal improvements */
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }

    .modal-body {
        padding: 1rem;
    }

    /* Mobile client cards */
    .client-card {
        margin-bottom: 0.75rem;
    }

    .client-card .card-body {
        padding: 1rem;
    }

    /* Mobile stats cards */
    .stat-card-terracotta {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    /* Mobile navigation improvements */
    .navbar-brand {
        font-size: 1.1rem;
    }

    /* Mobile sidebar improvements */
    .sidebar .nav-link {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    .sidebar .nav-link i {
        font-size: 1rem;
        width: 18px;
    }

    .sidebar-heading {
        padding: 1rem 1rem 0.5rem;
        font-size: 0.7rem;
    }

    .user-info-box {
        margin: 1rem;
        padding: 1rem;
    }

    /* Ensure sidebar content is fully scrollable */
    .sidebar .d-flex.flex-column.h-100 {
        height: 100% !important;
    }

    .sidebar .flex-grow-1.overflow-auto {
        overflow-y: auto !important;
        max-height: calc(100vh - 270px);
        /* Top navbar (70px) + bottom navbar (70px) + user info (130px) */
    }
}

@media (min-width: 768px) {
    .sidebar {
        width: 240px;
    }

    .sidebar~main {
        margin-left: 240px;
    }

    .navbar-toggler {
        display: none;
    }
}

/* Tablet specific styles */
@media (min-width: 768px) and (max-width: 991.98px) {
    .sidebar {
        width: 220px;
    }

    .sidebar~main {
        margin-left: 220px;
    }

    .card-body {
        padding: 1.5rem;
    }

    .table thead th,
    .table tbody td {
        padding: 1rem;
        font-size: 0.9rem;
    }

    .stat-card-terracotta {
        padding: 1.25rem;
    }
}

/* Large desktop styles */
@media (min-width: 1200px) {
    .container-fluid {
        max-width: 1400px;
        margin: 0 auto;
    }

    .sidebar {
        width: 260px;
    }

    .sidebar~main {
        margin-left: 260px;
    }
}

/* Alerts */
#alert-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    max-width: 350px;
    width: 100%;
}

.alert.fade-in {
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ================================
   Mobile Bottom Navigation Bar
   ================================ */
.mobile-bottom-nav {
    display: none;
    /* Hidden by default */
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    border-top: 1px solid rgba(37, 99, 235, 0.2);
    z-index: 1030;
    padding: 0.5rem 0;
    justify-content: space-around;
    align-items: center;
}

/* Show only on mobile devices */
@media (max-width: 767.98px) {
    .mobile-bottom-nav {
        display: flex;
    }

    /* Add bottom padding to body to prevent content being hidden under navbar */
    body {
        padding-bottom: 70px;
    }

    /* Adjust main content bottom padding */
    main {
        padding-bottom: 4rem !important;
    }
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.5rem 0.75rem;
    color: var(--gray-600);
    text-decoration: none;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 12px;
    min-width: 60px;
    position: relative;
}

.mobile-nav-item i {
    font-size: 1.25rem;
    transition: transform 0.3s ease;
}

.mobile-nav-item span {
    font-size: 0.7rem;
    font-weight: 500;
    white-space: nowrap;
}

/* Active state */
.mobile-nav-item.active {
    color: var(--primary);
    background: rgba(37, 99, 235, 0.1);
}

.mobile-nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 3px;
    background: var(--primary);
    border-radius: 0 0 3px 3px;
}

/* Hover/Active effects */
.mobile-nav-item:hover,
.mobile-nav-item:active {
    color: var(--primary);
    background: rgba(37, 99, 235, 0.05);
}

.mobile-nav-item:active i {
    transform: scale(0.95);
}

/* Hamburger menu button specific styles */
#mobileMenuBtn {
    position: relative;
}

#mobileMenuBtn i {
    font-size: 1.5rem;
}

/* Animation for showing navbar */
@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.mobile-bottom-nav {
    animation: slideUp 0.3s ease-out;
}

@media print {

    .card,
    .stat-card,
    .stat-card-white,
    .client-card,
    .report-card,
    .profile-card,
    .doc-card {
        background-image: none !important;
        box-shadow: none !important;
    }
}

/* Action Modal Styles (Moved from dashboard.php) */
.hover-lift {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15) !important;
}

.action-card:hover .card {
    border-color: var(--bs-primary) !important;
}

/* Modal Animation */
.modal.fade .modal-dialog {
    transform: scale(0.8);
    opacity: 0;
    transition: all 0.3s ease-out;
}

.modal.show .modal-dialog {
    transform: scale(1);
    opacity: 1;
}

/* Responsive Modal */
@media (max-width: 576px) {
    .modal-dialog {
        margin: 1rem;
    }

    .action-icon {
        width: 50px !important;
        height: 50px !important;
    }

    .action-icon i {
        font-size: 1.5rem !important;
    }
}

/* Clients Page Styles (Moved from clients.php) */
:root {
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    --glass-bg: rgba(255, 255, 255, 0.95);
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
}

/* Page Header */
.page-header {
    background: white;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1.5rem 0;
    margin-bottom: 2rem;
}

/* Filter Bar */
.filter-bar {
    background: white;
    border-radius: 12px;
    padding: 1rem;
    box-shadow: var(--card-shadow);
    border: 1px solid rgba(0, 0, 0, 0.03);
}

/* Desktop Table Styling */
.custom-table {
    background: white;
    background-image: radial-gradient(#e2e8f0 1px, transparent 1px);
    background-size: 20px 20px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.custom-table th {
    background: #f8fafc;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
    color: #64748b;
}

.custom-table td {
    padding: 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.9rem;
}

.custom-table tr:last-child td {
    border-bottom: none;
}

.custom-table tr:hover td {
    background-color: #f8fafc;
}

/* Mobile Card Styling */
.client-card {
    background: white;
    background-image: radial-gradient(#e2e8f0 1px, transparent 1px);
    background-size: 20px 20px;
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.04);
    box-shadow: var(--card-shadow);
    margin-bottom: 1rem;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s;
}

.client-card:active {
    transform: scale(0.99);
}

.avatar-circle {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--primary-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
}

/* Status Badges */
.badge-soft-success {
    background: #dcfce7;
    color: #166534;
}

.badge-soft-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-soft-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-soft-secondary {
    background: #f1f5f9;
    color: #475569;
}

/* View Client Page Styles (Moved from view_client.php) */

/* Sticky Header */
.sticky-header {
    position: sticky;
    top: 0;
    z-index: 900;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

/* Profile Section */
.profile-card {
    background: white;
    background-image: radial-gradient(#e2e8f0 1px, transparent 1px);
    background-size: 20px 20px;
    border-radius: 20px;
    box-shadow: var(--card-shadow);
    border: 1px solid rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

.client-avatar {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.avatar-placeholder {
    width: 120px;
    height: 120px;
    background: #f1f5f9;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 3rem;
    border: 4px solid #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* Stats Grid Additional Styles */
/* Note: .stat-card is already shared, but specific overrides might be here */
.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

/* Document Cards */
.doc-card {
    background: white;
    background-image: radial-gradient(#e2e8f0 1px, transparent 1px);
    background-size: 20px 20px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
}

.doc-card:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

/* Action Buttons */
.btn-action {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.btn-action:hover {
    transform: scale(1.1);
}

@media print {

    .sticky-header,
    .no-print,
    .sidebar {
        display: none !important;
    }

    .col-md-9 {
        width: 100% !important;
        margin: 0 !important;
    }

    .btn {
        display: none !important;
    }

    .card {
        border: 1px solid #ddd !important;
        box-shadow: none !important;
    }

    .client-card,
    .stat-card,
    .profile-card {
        background-image: none !important;
    }
}

@media (max-width: 768px) {
    .sticky-header {
        position: relative !important;
        top: 0;
    }

    input[type="date"] {
        font-size: 16px !important;
    }
}

/* =========================================
   Daily Entry & Collection Styles
   ========================================= */

/* Sticky Header Global */
.sticky-header {
    position: sticky;
    top: 0;
    z-index: 900;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

/* Enhanced Stat Cards (Daily Entry) */
.stat-card {
    background: white;
    background-image: radial-gradient(#e2e8f0 1px, transparent 1px);
    background-size: 20px 20px;
    border-radius: 20px;
    border: 1px solid rgba(0, 0, 0, 0.04);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
    height: 100%;
    padding: 1.25rem;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.stat-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.stat-card.collected::after {
    background: #198754;
}

.stat-card.target::after {
    background: #0d6efd;
}

.stat-card.pending::after {
    background: #ffc107;
}

/* Client Card (Daily Entry) */
.client-card {
    background: white;
    background-image: radial-gradient(#e2e8f0 1px, transparent 1px);
    background-size: 20px 20px;
    border-radius: 16px;
    margin-bottom: 1rem;
    border: 1px solid rgba(0, 0, 0, 0.03);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    padding: 1rem;
}

.client-card:active {
    transform: scale(0.99);
    background-color: #f8fafc;
}

/* Avatar Circle (Shared) */
.avatar-circle {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}

/* Payment Button */
.pay-btn {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #dcfce7;
    border-radius: 50px;
    padding: 8px 16px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.pay-btn:active {
    background: #dcfce7;
}

/* Payment Modal */
.payment-modal .modal-content {
    border-radius: 24px;
    border: none;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.payment-modal .modal-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    background: #f8fafc;
    padding: 1.5rem;
}

.mode-option:checked+label {
    background-color: #4f46e5;
    color: white;
    border-color: #4f46e5;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.3);
}

.mode-label {
    transition: all 0.2s;
    border: 1px solid #e5e7eb;
    font-weight: 600;
}

@media (max-width: 576px) {
    .pay-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    .avatar-circle.small-mobile {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
}

/* =========================================
   Today Collections
   ========================================= */
.mobile-date-input {
    min-width: 130px;
    background: transparent;
    color: #212529;
    opacity: 1;
    appearance: none;
    -webkit-appearance: none;
    position: relative;
}

.date-container {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 4px 8px;
    display: flex;
    align-items: center;
    box-shadow: 0 .125rem .25rem rgba(0, 0, 0, .075);
}

/* Force browser default appearance for date parts */
::-webkit-datetime-edit {
    padding: 0;
}

::-webkit-datetime-edit-fields-wrapper {
    background: transparent;
}

::-webkit-datetime-edit-text {
    color: #333;
    padding: 0 0.3em;
}

::-webkit-datetime-edit-month-field {
    color: #333;
}

::-webkit-datetime-edit-day-field {
    color: #333;
}

::-webkit-datetime-edit-year-field {
    color: #333;
}

.icon-square {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* =========================================
   Missed Payments
   ========================================= */
.overdue-card {
    background: white;
    border-radius: 16px;
    border: 1px solid rgba(220, 38, 38, 0.1);
    border-left: 4px solid #dc2626;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
    transition: all 0.2s ease;
}

.overdue-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.urgency-high {
    border-left-color: #dc2626;
    background: rgba(220, 38, 38, 0.02);
}

.urgency-medium {
    border-left-color: #f59e0b;
    background: rgba(245, 158, 11, 0.02);
}

.urgency-low {
    border-left-color: #10b981;
    background: rgba(16, 185, 129, 0.02);
}

.days-overdue {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: white;
    padding: 8px 16px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.9rem;
}

/* =========================================
   Reports & Stats
   ========================================= */
.filter-card,
.report-card {
    background: white;
    background-image: radial-gradient(#e2e8f0 1px, transparent 1px);
    background-size: 20px 20px;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.report-card {
    overflow: hidden;
}

/* Tabs */
.nav-pills .nav-link {
    border-radius: 10px;
    padding: 10px 25px;
    font-weight: 600;
    color: #64748b;
    transition: all 0.2s;
    letter-spacing: 0.3px;
}

.nav-pills .nav-link.active {
    background-color: #0f172a;
    color: white;
    box-shadow: 0 4px 12px -2px rgba(15, 23, 42, 0.3);
}

.nav-pills .nav-link:hover:not(.active) {
    background-color: #e2e8f0;
    color: #1e293b;
}

/* =========================================
   Completed Loans & Deleted Clients
   ========================================= */
.stat-widget {
    background: white;
    background-image: radial-gradient(#e2e8f0 1px, transparent 1px);
    background-size: 20px 20px;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.03);
    height: 100%;
    transition: transform 0.2s;
}

.stat-widget:hover {
    transform: translateY(-2px);
}

.custom-table {
    background: white;
    background-image: radial-gradient(#e2e8f0 1px, transparent 1px);
    background-size: 20px 20px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.custom-table th {
    background: #f0fdf4;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    padding: 1rem;
    border-bottom: 1px solid #bbf7d0;
    color: #166534;
}

.custom-table td {
    padding: 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.9rem;
}

.completion-card {
    background: white;
    background-image: radial-gradient(#e2e8f0 1px, transparent 1px);
    background-size: 20px 20px;
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.04);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
    margin-bottom: 1rem;
    position: relative;
    overflow: hidden;
}

.verified-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    color: #10b981;
    opacity: 0.1;
    transform: rotate(-15deg);
    font-size: 4rem;
    pointer-events: none;
}

/* Form Styles (Shared) */
.search-input {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 10px 15px;
    padding-left: 40px;
    transition: all 0.2s;
}

.search-input:focus {
    background-color: white;
    border-color: #cbd5e1;
    box-shadow: 0 0 0 3px rgba(203, 213, 225, 0.2);
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
}

.badge-soft {
    padding: 6px 12px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}


/* =========================================
   ENHANCED MOBILE RESPONSIVENESS
   ========================================= */

/* Mobile-first improvements */
@media (max-width: 767.98px) {
    /* Improved touch targets */
    .btn, .form-control, .form-select, a {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Better spacing for mobile */
    .px-4 {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    /* Mobile-friendly tables */
    .table-responsive {
        border: none;
        box-shadow: none;
    }
    
    /* Stack columns on mobile */
    .row.g-3 > * {
        margin-bottom: 0.75rem;
    }
    
    /* Mobile search improvements */
    .input-group {
        flex-wrap: nowrap;
    }
    
    .input-group .form-control {
        min-width: 0;
        flex: 1;
    }
    
    /* Mobile button groups */
    .btn-group {
        display: flex;
        flex-wrap: wrap;
    }
    
    .btn-group .btn {
        flex: 1 1 auto;
        min-width: 0;
    }
    
    /* Mobile modal improvements */
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }
    
    .modal-content {
        border-radius: 16px;
    }
    
    .modal-body {
        padding: 1.25rem;
    }
    
    /* Mobile card improvements */
    .card {
        margin-bottom: 1rem;
        border-radius: 12px;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    /* Mobile stat cards */
    .stat-card {
        padding: 1rem;
        margin-bottom: 0.75rem;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .stat-label {
        font-size: 0.75rem;
    }
    
    /* Mobile client cards */
    .client-card {
        padding: 0.875rem;
        margin-bottom: 0.75rem;
    }
    
    .avatar-circle {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    /* Mobile filter bar */
    .filter-bar {
        padding: 0.75rem;
        margin-bottom: 1rem;
    }
    
    /* Mobile page header */
    .page-header {
        padding: 1rem 0;
    }
    
    .page-header h3 {
        font-size: 1.25rem;
    }
    
    .page-header p {
        font-size: 0.813rem;
    }
    
    /* Mobile sticky header */
    .sticky-header {
        padding: 0.75rem 1rem !important;
    }
    
    /* Mobile progress bars */
    .progress {
        height: 8px;
    }
    
    /* Mobile badges */
    .badge {
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
    }
    
    /* Mobile icon boxes */
    .icon-box {
        width: 48px !important;
        height: 48px !important;
        font-size: 1.25rem !important;
    }
    
    /* Mobile payment modal */
    .payment-modal .modal-content {
        border-radius: 20px;
    }
    
    .payment-modal .modal-header {
        padding: 1.25rem;
    }
    
    .payment-modal .modal-body {
        padding: 1rem;
    }
    
    /* Mobile form inputs */
    .form-control, .form-select {
        font-size: 16px; /* Prevent zoom on iOS */
        padding: 0.75rem 1rem;
    }
    
    /* Mobile button improvements */
    .btn-sm {
        padding: 0.5rem 0.875rem;
        font-size: 0.813rem;
    }
    
    .btn-lg {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }
    
    /* Mobile WhatsApp buttons */
    .btn-success {
        white-space: nowrap;
    }
    
    /* Mobile action buttons */
    .btn-group .btn {
        padding: 0.5rem 0.75rem;
    }
    
    /* Mobile date inputs */
    input[type="date"] {
        font-size: 16px !important;
        min-height: 44px;
    }
    
    /* Mobile search button */
    .input-group .btn {
        padding: 0.75rem 1rem;
    }
    
    /* Prevent horizontal scroll */
    body {
        overflow-x: hidden;
    }
    
    .container-fluid {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    /* Mobile-friendly hover states (use active instead) */
    .client-card:hover {
        transform: none;
    }
    
    .client-card:active {
        transform: scale(0.98);
        background-color: #f8fafc;
    }
    
    /* Mobile table alternatives */
    .d-md-none .client-card {
        display: block !important;
    }
    
    /* Mobile navigation spacing */
    .navbar {
        padding: 0.5rem 1rem;
    }
    
    .navbar-brand {
        font-size: 1rem;
    }
    
    /* Mobile sidebar adjustments */
    .sidebar {
        width: 280px;
        max-width: 85vw;
    }
    
    .sidebar .nav-link {
        padding: 0.75rem 1rem;
        margin: 0.25rem 0.75rem;
        font-size: 0.875rem;
    }
    
    .sidebar .nav-link i {
        font-size: 1.1rem;
    }
    
    /* Mobile bottom navigation spacing */
    body.has-bottom-nav {
        padding-bottom: 70px;
    }
    
    main.has-bottom-nav {
        padding-bottom: 3rem !important;
    }
}

/* Tablet specific improvements */
@media (min-width: 768px) and (max-width: 991.98px) {
    .container-fluid {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
    
    .card-body {
        padding: 1.5rem;
    }
    
    .stat-card {
        padding: 1.25rem;
    }
    
    .client-card {
        padding: 1rem;
    }
}

/* Landscape mobile improvements */
@media (max-width: 767.98px) and (orientation: landscape) {
    .modal-dialog {
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .sticky-header {
        position: relative;
    }
    
    .sidebar {
        max-height: 100vh;
        overflow-y: auto;
    }
}

/* High DPI screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .avatar-circle,
    .icon-box,
    .stat-icon {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    /* Add dark mode styles if needed */
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print improvements */
@media print {
    .sidebar,
    .mobile-bottom-nav,
    .sticky-header,
    .btn,
    .filter-bar,
    .no-print {
        display: none !important;
    }
    
    main {
        margin-left: 0 !important;
        padding: 0 !important;
    }
    
    .card,
    .client-card,
    .stat-card {
        background-image: none !important;
        box-shadow: none !important;
        border: 1px solid #ddd !important;
        page-break-inside: avoid;
    }
    
    body {
        padding: 0 !important;
    }
}
