:root {
    --primary: #2563eb;
    --success: #16a34a;
    --danger: #dc2626;
    --warning: #d97706;
    --reloan: #7c3aed;
    --bg-gradient: linear-gradient(135deg, #f0f4ff 0%, #e2e8f0 100%);
    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-card: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.6);
    --text-main: #0f172a;
    --text-muted: #475569;
    --shadow-glass: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
}

* { box-sizing: border-box; }

body { 
    font-family: 'Inter', sans-serif; 
    background: var(--bg-gradient); 
    background-attachment: fixed;
    color: var(--text-main);
    padding: 30px 15px; 
    font-size: 15px; 
    margin: 0; 
    min-height: 100vh;
}

body.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    padding: 35px 30px;
    border-radius: 24px;
    width: 100%;
    max-width: 380px;
    box-shadow: var(--shadow-glass);
    text-align: center;
}
.login-card h2 {
    margin-top: 0;
    color: var(--text-main);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.5px;
}
.login-card p {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 25px;
}
.form-group-login {
    margin-bottom: 15px;
    text-align: left;
}
.form-group-login label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}
.form-group-login input[type="text"], .form-group-login input[type="password"] {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.9);
    outline: none;
    color: var(--text-main);
    transition: all 0.2s;
}
.password-wrapper input { padding-right: 45px; }
.form-group-login input:focus, .password-wrapper input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.toggle-password {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: var(--text-muted);
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-login {
    width: 100%;
    background: var(--primary);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.25);
    transition: background 0.2s, transform 0.2s;
}
.btn-login:hover { background: #1d4ed8; transform: translateY(-1px); }
.error-alert {
    background: #fee2e2;
    color: var(--danger);
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 20px;
}

.app-layout {
    display: flex;
    max-width: 1700px;
    margin: 0 auto;
    gap: 30px;
    align-items: flex-start;
}

.sidebar {
    width: 280px;
    flex-shrink: 0;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    padding: 25px 15px;
    border-radius: 24px;
    box-shadow: var(--shadow-glass);
    position: sticky;
    top: 30px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: calc(100vh - 60px);
    z-index: 10;
}

.sidebar-brand {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
    padding: 0 15px 20px 15px;
    border-bottom: 1px solid rgba(203, 213, 225, 0.6);
    margin-bottom: 15px;
    letter-spacing: -0.3px;
}
.sidebar-brand span {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-muted);
    display: block;
    margin-top: 3px;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.sidebar-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 14px;
    border-radius: 12px;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.sidebar-link-content {
    display: flex;
    align-items: center;
    gap: 14px;
}
.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.6);
    color: var(--primary);
}
.sidebar-link.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.25);
}
.sidebar-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #fee2e2;
    color: var(--danger);
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    border-radius: 12px;
    transition: background 0.2s;
    margin-top: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.logout-btn:hover { background: #fecaca; }

.alert-banner-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}
.alert-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    padding: 16px 20px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.02);
    text-decoration: none;
    color: var(--text-main);
    transition: all 0.2s ease;
}
.alert-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.12);
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.95);
}
.alert-card.active-filter {
    border: 2px solid var(--primary);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.2);
}
.alert-icon-box {
    width: 45px; height: 45px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}
.alert-icon-box.due-soon { background: #fef3c7; color: var(--warning); }
.alert-icon-box.overdue { background: #fee2e2; color: var(--danger); }
.alert-info h4 { margin: 0; font-size: 13px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }
.alert-info .alert-count { font-size: 20px; font-weight: 700; color: var(--text-main); margin-top: 2px; }

.filter-reset-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    background: rgba(37, 99, 235, 0.1);
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
}
.filter-reset-bar a { color: var(--danger); text-decoration: none; font-size: 13px; }
.filter-reset-bar a:hover { text-decoration: underline; }

.container { 
    flex: 1;
    width: 100%; 
    background: var(--glass-bg); 
    backdrop-filter: blur(16px); 
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    padding: 35px; 
    border-radius: 24px; 
    box-shadow: var(--shadow-glass); 
    position: relative;
    z-index: 1;
}

h2 { text-align: center; color: var(--text-main); margin-top: 0; font-weight: 700; font-size: 28px; letter-spacing: -0.5px;}

.mobile-header-bar {
    display: none;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    background: rgba(255,255,255,0.7);
    padding: 10px 15px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
}

.mobile-tabs { display: none; }

.form-group { 
    display: flex; gap: 15px; margin-bottom: 30px; 
    background: rgba(255, 255, 255, 0.6); 
    backdrop-filter: blur(10px);
    padding: 22px; 
    border-radius: 16px; 
    align-items: center; 
    border: 1px solid var(--glass-border);
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
    flex-wrap: wrap;
    position: relative;
    z-index: 2;
}
.form-group input, .form-group select { 
    flex: 1; padding: 15px 18px; border: 1px solid #cbd5e1; 
    border-radius: 10px; min-width: 160px; font-size: 15px;
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.2s;
    outline: none;
    color: var(--text-main);
}
.form-group input:focus, .form-group select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15); }

.btn-save { 
    background: var(--primary); 
    color: white; padding: 15px 30px; border: none; 
    border-radius: 10px; cursor: pointer; font-weight: 600; font-size: 15px;
    min-width: 140px; transition: transform 0.2s, background-color 0.2s; 
    position: relative;
    z-index: 3;
}
.btn-save:hover { background: #1d4ed8; transform: translateY(-1px); }

.search-container {
    margin-bottom: 25px;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    padding: 16px 20px;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
    position: relative;
    z-index: 5;
}
.search-input {
    width: 100%;
    padding: 14px 18px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    font-size: 15px;
    background: rgba(255, 255, 255, 0.9);
    outline: none;
    color: var(--text-main);
    transition: all 0.2s;
    position: relative;
    z-index: 3;
}
.search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.table-wrapper { 
    width: 100%; 
    overflow-x: auto; 
    border-radius: 16px; 
    border: 1px solid #e2e8f0; 
    background: rgba(255,255,255,0.5); 
    position: relative;
    z-index: 2;
}
table { width: 100%; border-collapse: collapse; white-space: nowrap; position: relative; z-index: 2; }
th, td { padding: 18px 20px; border-bottom: 1px solid #e2e8f0; text-align: center; position: relative; z-index: 2; }
th { background-color: rgba(241, 245, 249, 0.8); color: var(--text-muted); font-weight: 600; text-transform: uppercase; font-size: 13px; letter-spacing: 0.5px;}

th:nth-child(2) {
    cursor: pointer;
    user-select: none;
}
th:nth-child(2):hover {
    color: var(--primary);
    background-color: rgba(226, 232, 240, 0.9);
}

tr:hover { background-color: rgba(255, 255, 255, 0.8); }

.badge { padding: 6px 14px; border-radius: 30px; font-weight: 600; font-size: 13px; display: inline-block; }
.badge-paid { background-color: #dcfce7; color: #15803d; } 
.badge-unpaid { background-color: #fee2e2; color: var(--danger); }
.badge-reloan { background-color: #f3e8ff; color: var(--reloan); }

.btn-action { 
    text-decoration: none; 
    padding: 10px 16px; 
    border-radius: 8px; 
    font-size: 14px; 
    margin: 3px; 
    display: inline-block; 
    font-weight: 600; 
    transition: all 0.2s; 
    cursor: pointer; 
    border: none;
    position: relative;
    z-index: 5;
}
.btn-mark { background-color: #fef9c3; color: #854d0e; }
.btn-mark:hover { background-color: #fde047; }
.btn-action-reloan { background-color: #ede9fe; color: var(--reloan); }
.btn-action-reloan:hover { background-color: #ddd6fe; }
.btn-del { background-color: #fee2e2; color: var(--danger); }
.btn-del:hover { background-color: #fecaca; }

.client-list { display: flex; flex-direction: column; gap: 20px; position: relative; z-index: 2; }

.client-card {
    background: var(--glass-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
}
.client-card:hover {
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
    border-color: rgba(37, 99, 235, 0.3);
}

.client-header {
    padding: 25px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    position: relative;
    z-index: 3;
}
.client-info h3 { margin: 0; font-size: 21px; color: var(--text-main); font-weight: 700; }
.client-info p { margin: 6px 0 0 0; color: var(--text-muted); font-size: 14px; font-weight: 500; }

.client-toggle-icon {
    font-size: 18px;
    background: rgba(255, 255, 255, 0.8);
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    border: 1px solid #cbd5e1;
    color: var(--text-muted);
    transition: transform 0.3s ease, background 0.2s;
    flex-shrink: 0;
}
.client-card:hover .client-toggle-icon { background: white; color: var(--primary); border-color: var(--primary); }
.client-card.open .client-toggle-icon { transform: rotate(180deg); background: var(--primary); color: white; border-color: var(--primary); }

.client-details {
    display: none; 
    padding: 0 30px 30px 30px;
    border-top: 1px solid rgba(226, 232, 240, 0.8);
    background: rgba(255, 255, 255, 0.4);
    position: relative;
    z-index: 3;
}

.client-stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
    margin-top: 25px;
    margin-bottom: 25px;
}

.stat-box {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    padding: 20px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 4px 15px rgba(0,0,0,0.02);
    position: relative;
    z-index: 3;
}
.stat-label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; font-weight: 600; letter-spacing: 0.5px; margin-bottom: 8px;}
.stat-value { font-size: 22px; font-weight: 700; color: var(--text-main); }
.stat-value.earn { color: var(--success); }
.stat-value.late { color: var(--danger); }

.stat-box.clickable {
    cursor: pointer;
    transition: all 0.2s ease;
}
.stat-box.clickable:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.15);
    border-color: var(--danger);
    background: rgba(254, 226, 226, 0.4);
}

.history-section {
    margin-top: 20px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    overflow: hidden;
}
.history-header {
    padding: 15px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    background: rgba(255, 255, 255, 0.8);
    transition: background 0.2s;
}
.history-header:hover { background: rgba(255, 255, 255, 0.95); }
.history-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
}
.history-toggle-icon {
    font-size: 14px;
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #cbd5e1;
    color: var(--text-muted);
    transition: transform 0.3s ease;
}
.history-section.open .history-toggle-icon {
    transform: rotate(180deg);
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}
.history-content {
    display: none;
    padding: 15px;
    flex-direction: column;
    gap: 10px;
    border-top: 1px solid #e2e8f0;
}
.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.9);
    padding: 10px 15px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    font-size: 14px;
}
.history-date { font-weight: 600; color: var(--text-main); }
.history-amount { font-weight: 700; color: var(--primary); }

.payment-breakdown {
    margin-top: 15px;
    background: rgba(255, 255, 255, 0.6);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.8);
}
.payment-breakdown-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}
.payment-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.payment-tag {
    background: #e2e8f0;
    color: var(--text-main);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.btn-new-loan {
    display: inline-block;
    background: var(--text-main);
    color: white;
    text-decoration: none;
    padding: 14px 28px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 15px;
    transition: background 0.2s, transform 0.2s;
    margin-top: 15px;
    position: relative;
    z-index: 5;
}
.btn-new-loan:hover { background: var(--primary); transform: translateY(-1px); }

.glass-modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.2s ease;
}
.glass-modal {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    padding: 28px 24px;
    border-radius: 22px;
    width: 90%;
    max-width: 480px;
    text-align: left;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    animation: scaleUp 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.glass-modal-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 5px;
    letter-spacing: -0.3px;
}
.glass-modal-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 20px;
}
.glass-modal-text {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 22px;
    line-height: 1.4;
}
.glass-modal-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}
.glass-modal-btn {
    flex: 1;
    padding: 12px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}
.glass-btn-cancel {
    background: rgba(255, 255, 255, 0.7);
    color: var(--text-muted);
    border: 1px solid rgba(203, 213, 225, 0.8);
}
.glass-btn-cancel:hover { background: rgba(255, 255, 255, 0.9); color: var(--text-main); }

.glass-btn-confirm {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}
.glass-btn-confirm:hover { background: #1d4ed8; }
.glass-btn-confirm.danger {
    background: var(--danger);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25);
}
.glass-btn-confirm.danger:hover { background: #b91c1c; }

.glass-select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font-size: 15px;
    background: rgba(255, 255, 255, 0.9);
    margin-bottom: 20px;
    outline: none;
    color: var(--text-main);
}
.glass-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15); }

.admin-settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    margin-top: 10px;
}
.settings-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    padding: 25px;
    border-radius: 18px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
}
.settings-card h3 {
    margin-top: 0;
    font-size: 18px;
    color: var(--text-main);
    margin-bottom: 15px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 10px;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleUp { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }

@media (max-width: 1100px) {
    .client-stats-grid { 
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); 
    }
}

/* Custom Desktop Font Size Adjustment */
@media (min-width: 768px) {
    body {
        font-size: 13.5px;
    }
    
    .container h2 {
        font-size: 22px;
    }

    .table-wrapper table th, 
    .table-wrapper table td {
        font-size: 13px;
        padding: 12px 14px;
    }

    .login-card {
        padding: 30px;
    }

    .login-card h2 {
        font-size: 20px;
    }
}

@media (max-width: 768px) {
    body { padding: 8px 6px; font-size: 13px; }
    .app-layout { display: block; }
    .sidebar { display: none; }
    .mobile-header-bar { display: flex; }
    .mobile-tabs { display: flex; border-bottom: 2px solid rgba(203, 213, 225, 0.6); margin-bottom: 15px; gap: 12px; overflow-x: auto; }
    .mobile-tab-link { 
        padding: 8px 2px; 
        text-decoration: none; 
        color: var(--text-muted); 
        font-weight: 600; 
        font-size: 13px;
        border-bottom: 3px solid transparent; 
        white-space: nowrap;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }
    .mobile-tab-active { border-bottom: 3px solid var(--primary); color: var(--primary); }

    .container { border-radius: 14px; padding: 12px; }
    h2 { font-size: 18px; margin-bottom: 5px; }

    .alert-banner-grid { grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 15px; }
    .alert-card { padding: 10px 12px; border-radius: 12px; gap: 10px; }
    .alert-icon-box { width: 34px; height: 34px; font-size: 15px; border-radius: 10px; }
    .alert-info h4 { font-size: 10px; }
    .alert-info .alert-count { font-size: 14px; }

    .form-group { flex-direction: column; align-items: stretch; padding: 12px; gap: 8px; margin-bottom: 15px; }
    .form-group input, .form-group select, .btn-save { width: 100%; font-size: 13px; padding: 10px 12px; min-width: 0; }

    .search-container { padding: 10px 12px; margin-bottom: 15px; }
    .search-input { padding: 10px 12px; font-size: 13px; }

    .client-header { padding: 14px 16px; }
    .client-info h3 { font-size: 15px; }
    .client-info p { font-size: 11px; }
    .client-toggle-icon { width: 28px; height: 28px; font-size: 12px; }

    .client-details { padding: 0 12px 16px 12px; }
    .client-stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; margin-bottom: 12px; }
    .stat-box { padding: 10px; border-radius: 8px; }
    .stat-label { font-size: 9px; margin-bottom: 3px; }
    .stat-value { font-size: 15px; }

    .history-header { padding: 10px 12px; }
    .history-title { font-size: 11px; }
    .history-item { padding: 8px 10px; font-size: 12px; }

    .payment-breakdown { padding: 10px; margin-top: 10px; }
    .payment-breakdown-title { font-size: 11px; }
    .payment-tag { font-size: 11px; padding: 3px 10px; }

    .btn-new-loan { padding: 10px 14px; font-size: 12px; width: 100%; text-align: center; }
    th, td { padding: 10px 8px; font-size: 12px; }
    .btn-action { padding: 5px 8px; font-size: 11px; }
}