:root {
    /* Brand Colors */
    --primary: #667eea;
    --secondary: #764ba2;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #17a2b8;
    
    /* Gradients */
    --bg-gradient: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    --success-gradient: linear-gradient(135deg, #e8f5e8 0%, #f0f8ff 100%);
    --admin-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    
    /* Backgrounds */
    --white-alpha: rgba(255, 255, 255, 0.95);
    --white-alpha-light: rgba(255, 255, 255, 0.1);
    --bg-light: #f8f9fa;
    --card-bg: #ffffff;
    
    /* Borders & Spacing */
    --radius: 10px;
    --radius-sm: 5px;
    --radius-lg: 15px;
    --border: 1px solid #e9ecef;
    --border-primary: 2px solid var(--primary);
    
    /* Shadows */
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.15);
    --shadow-modal: 0 10px 30px rgba(0, 0, 0, 0.3);
    
    /* Transitions */
    --transition: all 0.3s ease;
    --transition-fast: all 0.2s ease;
    
    /* Text Colors */
    --text-primary: #333;
    --text-secondary: #6c757d;
    --text-muted: #9ca3af;
    
    /* Spacing */
    --padding: 20px;
    --padding-sm: 10px;
    --padding-lg: 30px;
    --gap: 15px;
}

/* Security Alert Styles - Multiple Loan Prevention */
.security-alert-section {
    margin: 20px 0;
    padding: 15px;
    background: linear-gradient(135deg, #fff5f5 0%, #ffeaea 100%);
    border: 2px solid #fecaca;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

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

.security-alert-title {
    margin: 0;
    color: var(--danger);
    font-size: 18px;
    font-weight: 600;
}

.security-alert-title i {
    margin-right: 8px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

#multiple-loan-alerts-container {
    margin-top: 15px;
}

.multiple-loan-alert-card {
    background: white;
    border: 1px solid #f87171;
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    transition: var(--transition);
}

.multiple-loan-alert-card:hover {
    border-color: var(--danger);
    box-shadow: var(--shadow-hover);
}

.multiple-loan-alert-card.critical {
    border-color: var(--danger);
    border-width: 2px;
}

.multiple-loan-alert-card .card-header {
    background: linear-gradient(135deg, var(--danger) 0%, #ef4444 100%);
    color: white;
    font-weight: 600;
}

.race-condition-badge {
    background: #7f1d1d !important;
    color: white !important;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 12px;
    animation: blink 1.5s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.6; }
}

/* Column Visibility Panel Styles */
.table-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.table-filters {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.column-controls {
    display: flex;
    align-items: center;
}

.column-visibility-panel {
    background: var(--white-alpha);
    border: var(--border);
    border-radius: var(--radius);
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.column-visibility-panel .panel-header {
    background: var(--bg-gradient);
    color: white;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.column-visibility-panel .panel-header h5 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.column-visibility-panel .panel-header .btn {
    color: white;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 8px;
    border-radius: 4px;
    transition: var(--transition-fast);
}

.column-visibility-panel .panel-header .btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.column-visibility-panel .panel-content {
    padding: 20px;
}

.column-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.column-checkboxes label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-fast);
    font-size: 14px;
    border: 1px solid #e9ecef;
}

.column-checkboxes label:hover {
    background: #e9ecef;
    border-color: var(--primary);
}

.column-checkboxes input[type="checkbox"] {
    margin: 0;
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

.column-checkboxes label:has(input:checked) {
    background: rgba(102, 126, 234, 0.1);
    border-color: var(--primary);
    color: var(--primary);
    font-weight: 500;
}

.panel-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.panel-actions .btn {
    padding: 8px 16px;
    font-size: 13px;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

/* Responsive column visibility */
@media (max-width: 768px) {
    .table-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .table-filters {
        justify-content: center;
    }
    
    .column-checkboxes {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 8px;
    }
    
    .column-checkboxes label {
        padding: 6px 10px;
        font-size: 13px;
    }
    
    .panel-actions {
        flex-direction: column;
    }
    
    .panel-actions .btn {
        width: 100%;
    }
}

/* Table column transition effects */
#usersTable th, #usersTable td {
    transition: all 0.2s ease;
}

#usersTable th[style*="display: none"], 
#usersTable td[style*="display: none"] {
    opacity: 0;
    transform: scaleX(0);
}

/* Column visibility button states */
.btn[onclick*="toggleColumnVisibility"] {
    position: relative;
}

.btn[onclick*="toggleColumnVisibility"]:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.btn[onclick*="toggleColumnVisibility"].active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Enhanced table header for better column identification */
#usersTable th {
    position: relative;
    white-space: nowrap;
}

#usersTable th:hover {
    background: rgba(102, 126, 234, 0.05);
}

/* Current loan display styling */
.current-loan-cell .no-loan {
    color: var(--text-muted);
    font-style: italic;
    font-size: 13px;
}

.current-loan-cell .current-loan {
    font-weight: 600;
    color: var(--primary);
}

/* Modal Styles */
.loan-results-container {
    background: var(--success-gradient); padding: var(--padding-lg);
    border-radius: var(--radius-lg); margin-bottom: var(--padding);
    border: var(--border-primary); box-shadow: var(--shadow-hover);
}

.results-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: var(--padding); margin-bottom: var(--padding);
}
.result-item {
    background: var(--card-bg); padding: var(--gap); border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.result-item.loan-amount { border-right: 4px solid var(--info); }
.result-item.installment { border-right: 4px solid var(--success); }
.result-item.period { border-right: 4px solid var(--warning); }
.result-item.total { border-right: 4px solid var(--danger); }

.result-item label {
    color: #000000 !important; /* Black text for labels */
    font-weight: normal;
    display: block;
    margin-bottom: 5px;
}

.result-item .amount,
.result-item span {
    font-weight: bold;
    color: #28a745 !important; /* Green for amounts/numbers */
    font-size: 1.1em;
}

.important-notes {
    padding: var(--gap); background: #fff3cd; border-radius: var(--radius);
    border-right: 4px solid var(--warning); color: #856404;
}
.confirmation-section {
    background: var(--bg-light); padding: var(--padding); border-radius: var(--radius);
    border: var(--border);
}

.confirmation-checkbox {
    display: flex; align-items: flex-start; gap: 12px; margin-bottom: 15px;
}

.confirmation-checkbox input { margin-top: 4px; transform: scale(1.3); }
.confirmation-checkbox label {
    font-weight: bold; color: #495057; line-height: 1.6;
    cursor: pointer; font-size: 15px;
}

.modal-footer {
    text-align: center; padding: 20px; border-top: 1px solid #ddd;
}

.modal-footer .btn {
    margin: 0 5px; padding: 12px 30px; font-size: 16px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    direction: rtl; text-align: right; background: var(--bg-gradient);
    min-height: 100vh; color: var(--text-primary);
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 var(--padding); }

.header {
    background: var(--white-alpha); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    box-shadow: var(--shadow-hover);
}

.auth-tabs {
    display: flex; justify-content: center; margin-bottom: var(--padding-lg);
    background: var(--white-alpha-light); border-radius: var(--radius);
    padding: 5px; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}

.auth-tab {
    flex: 1; padding: 12px var(--padding); background: transparent; border: none;
    color: white; cursor: pointer; border-radius: var(--radius);
    transition: var(--transition); font-size: 16px; font-weight: 500;
    display: flex; align-items: center; justify-content: center; gap: 8px;
}

.auth-tab:hover { background: var(--white-alpha-light); }
.auth-tab.active { background: var(--white-alpha); color: var(--primary); box-shadow: var(--shadow-hover); }
.auth-tab-content { display: none; }
.auth-tab-content.active { display: block; }

.terms-card, .register-card {
    background: var(--white-alpha); border-radius: 20px;
    padding: var(--padding-lg); box-shadow: var(--shadow-modal);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); max-width: 800px; margin: 0 auto;
}

.terms-content {
    max-height: 400px; overflow-y: auto; padding-right: var(--padding-sm);
}
.terms-section { margin-bottom: 25px; }

.terms-section h3, .terms-section h5 {
    color: #667eea;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.terms-list {
    list-style: none;
    padding: 0;
}

.terms-list li {
    padding: 8px 0;
    border-bottom: 1px solid rgba(102, 126, 234, 0.1);
    position: relative;
    padding-right: 20px;
}

.terms-list li:before {
    content: "•";
    color: #667eea;
    font-weight: bold;
    position: absolute;
    right: 0;
}

.terms-list li:last-child {
    border-bottom: none;
}

/* Registration Form */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 15px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #667eea;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid #667eea;
    border-radius: 3px;
    display: inline-block;
    position: relative;
}

/* Additional Terms in App */
.additional-terms {
    background: rgba(102, 126, 234, 0.05);
    border-radius: 15px;
    padding: 20px;
    margin-top: 20px;
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.additional-terms h4 {
    color: #667eea;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Terms Link in Header */
.terms-link {
    color: #667eea;
    text-decoration: none;
    font-size: 13px;
    margin-left: 0;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: var(--transition-fast);
    background: rgba(102, 126, 234, 0.05);
    font-weight: 500;
    flex-shrink: 0;
}

.terms-link:hover {
    color: #5a6fd8;
    background: rgba(102, 126, 234, 0.1);
    border-color: rgba(102, 126, 234, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

.terms-link i {
    font-size: 16px;
}

/* Terms Modal Specific Styling */
#loanTermsModal .modal-content {
    max-width: 900px;
    max-height: 90vh;
    overflow: hidden;
}

#loanTermsModal .modal-body {
    max-height: 70vh;
    overflow-y: auto;
    padding: 25px;
}

#loanTermsModal .terms-content-modal {
    line-height: 1.6;
}

#loanTermsModal .terms-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
}

#loanTermsModal .terms-section {
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border-right: 4px solid #667eea;
}

#loanTermsModal .terms-section h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 18px;
}

#loanTermsModal .important-notice {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
    color: #856404;
}

#loanTermsModal .terms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

#loanTermsModal .rule-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-right: 4px solid #28a745;
    transition: transform 0.2s ease;
}

#loanTermsModal .rule-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Calculator Shortcut */
.calculator-shortcut {
    color: #f5576c !important;
    background: rgba(245, 87, 108, 0.1);
    padding: 10px;
    border-radius: 50%;
    border: 1px solid rgba(245, 87, 108, 0.2);
    font-weight: 600;
    margin-left: 15px;
    font-size: 16px;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    transition: all 0.3s ease;
}

.calculator-shortcut:hover {
    color: #e74c3c !important;
    background: rgba(245, 87, 108, 0.2);
    transform: translateY(-2px) scale(1.1);
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(245, 87, 108, 0.4);
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-content {
    background: white;
    border-radius: 15px;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px 15px 0 0;
}

.modal-header h2 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 20px;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

/* Will Section */
.will-info {
    background: #e3f2fd;
    border: 1px solid #bbdefb;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.will-info p {
    margin: 0;
    color: #1976d2;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Textarea Styling */
textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    min-height: 120px;
    transition: border-color 0.3s ease;
}

textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* User Info Layout */
.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info span {
    font-weight: 500;
}

/* Admin System Tools */
.admin-system-tools {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    margin-top: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}

.admin-system-tools h3 {
    color: #667eea;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
}

/* Reports Section */
.admin-reports-section {
    margin-bottom: 40px;
}

.admin-reports-section h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    color: #2c3e50;
    font-size: 1.5rem;
}

.reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.report-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border: none;
    border-radius: 15px;
    padding: 25px 20px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3);
}

.report-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.4);
}

.report-btn i {
    font-size: 32px;
    margin-bottom: 5px;
}

.report-btn span {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 5px;
}

.report-btn small {
    font-size: 13px;
    opacity: 0.9;
    font-weight: 400;
}

/* Report Content Styles */
.report-content {
    padding: 20px;
}

.report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 15px;
}

.report-stats {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.stat-item {
    font-size: 14px;
    color: #495057;
    font-weight: 500;
}

.table-responsive {
    overflow-x: auto;
    margin-top: 20px;
}

.report-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    font-size: 14px;
}

.report-table th,
.report-table td {
    border: 1px solid #dee2e6;
    padding: 10px;
    text-align: right;
}

.report-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #495057;
}

.report-table tr:nth-child(even) {
    background-color: #f8f9fa;
}

.report-table tr:hover {
    background-color: #e9ecef;
}

.financial-summary,
.monthly-summary {
    padding: 20px 0;
}

.summary-section {
    margin-bottom: 30px;
}

.summary-section h5 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    color: #2c3e50;
    font-size: 1.2rem;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.summary-item {
    display: flex;
    flex-direction: column;
    padding: 15px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background-color: #f8f9fa;
}

.summary-label {
    font-size: 14px;
    color: #6c757d;
    margin-bottom: 5px;
}

.summary-value {
    font-size: 18px;
    font-weight: 600;
    color: #28a745;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.status-badge.pending {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.status-badge.accepted {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-badge.rejected {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status-badge.approved {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.status-badge.closed {
    background-color: #e2e3e5;
    color: #383d41;
    border: 1px solid #d6d8db;
}

.status-badge.active {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.system-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.system-tool-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 15px;
    padding: 25px 20px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.system-tool-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.system-tool-btn i {
    font-size: 32px;
    margin-bottom: 5px;
}

.system-tool-btn span {
    font-size: 16px;
    font-weight: 600;
}

.system-tool-btn small {
    font-size: 12px;
    opacity: 0.9;
    margin-top: 5px;
}

/* Loan Status Styles */
.loan-status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    margin-left: 10px;
}

.loan-status.pending {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.loan-status.approved {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.loan-status.rejected {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

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

.loan-item {
    margin-bottom: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-right: 4px solid #ddd;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
}

.logo-icon {
    font-size: 24px;
    color: #2c3e50;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo h1 {
    font-size: 20px;
    color: #2c3e50;
    font-weight: bold;
    margin: 0;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    white-space: nowrap;
}

#userName {
    font-weight: bold;
    color: #2c3e50;
    font-size: 14px;
    flex-shrink: 0;
}

.user-info #logoutBtn {
    padding: 6px 12px;
    font-size: 13px;
    flex-shrink: 0;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.4);
}

/* Main Content */
.main-content {
    padding: 40px 0;
    min-height: calc(100vh - 120px);
}

/* Login Section */
.login-section {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    -webkit-backdrop-filter: blur(15px); backdrop-filter: blur(15px);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.login-card h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #2c3e50;
    font-size: 24px;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group small {
    color: #666;
    font-size: 12px;
    margin-top: 5px;
    display: block;
}

/* Dashboard */
.dashboard-section {
    animation: fadeIn 0.5s ease-in-out;
}

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

.dashboard-content h2 {
    text-align: center;
    margin-bottom: 30px;
    color: white;
    font-size: 32px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* Stats Grid */
/* Legacy stats grid - kept for compatibility */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.95);
    -webkit-backdrop-filter: blur(15px); backdrop-filter: blur(15px);
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

/* New compact stats grid */
.compact-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 25px;
}

.compact-stat-card {
    background: rgba(255, 255, 255, 0.95);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.compact-stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.compact-stat-card i {
    font-size: 20px;
    color: #667eea;
    margin-bottom: 8px;
}

.compact-stat-text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.compact-stat-value {
    font-size: 12px;
    font-weight: bold;
    color: #667eea;
}

.compact-stat-label {
    font-size: 12px;
    color: #718096;
    line-height: 1.2;
}

/* Financial Summary Section */
.financial-summary-section {
    background: rgba(255, 255, 255, 0.95);
    -webkit-backdrop-filter: blur(15px); backdrop-filter: blur(15px);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-top: 20px;
}

.section-title {
    color: #2d3748;
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title i {
    color: #667eea;
}

.financial-summary-table {
    overflow-x: auto;
}

.summary-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.summary-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 15px;
    text-align: center;
    font-weight: bold;
    border: none;
}

.summary-table th:first-child {
    border-radius: 8px 0 0 0;
}

.summary-table th:last-child {
    border-radius: 0 8px 0 0;
}

.summary-row {
    transition: background-color 0.3s ease;
}

.summary-row:hover {
    background-color: rgba(102, 126, 234, 0.05);
}

.summary-row td {
    padding: 12px 15px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    vertical-align: middle;
}

.summary-label {
    font-weight: 600;
    color: #2d3748;
    display: flex;
    align-items: center;
    gap: 8px;
}

.summary-value {
    font-weight: bold;
    font-size: 16px;
    color: #2d3748;
    text-align: center;
    font-family: 'Courier New', monospace;
}

.summary-details {
    color: #718096;
    font-size: 13px;
}

.summary-input {
    text-align: center;
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
}

.bank-input {
    width: 150px;
    padding: 8px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Courier New', monospace;
    text-align: center;
    transition: border-color 0.3s ease;
}

.bank-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn-calculate {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-calculate:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.calculation-row {
    background-color: rgba(102, 126, 234, 0.05);
    border-left: 4px solid #667eea;
}

.bank-row {
    background-color: rgba(255, 193, 7, 0.05);
    border-left: 4px solid #ffc107;
}

.difference-row.positive {
    background-color: rgba(16, 185, 129, 0.05);
    border-left: 4px solid #10b981;
}

.difference-row.negative {
    background-color: rgba(239, 68, 68, 0.05);
    border-left: 4px solid #ef4444;
}

.difference-row.zero {
    background-color: rgba(34, 197, 94, 0.05);
    border-left: 4px solid #22c55e;
}

.difference-auto-row {
    background-color: rgba(16, 185, 129, 0.05);
    border-left: 4px solid #10b981;
}

.difference-auto-row .summary-value {
    font-weight: bold;
    font-size: 16px;
}

/* Bank Management Styles */
.banks-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.summary-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    display: flex;
    gap: 30px;
    align-items: center;
}

.summary-info {
    text-align: center;
}

.summary-info .count,
.summary-info .amount {
    display: block;
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 5px;
}

.summary-info .label {
    font-size: 14px;
    opacity: 0.9;
}

.banks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.bank-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.bank-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.bank-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.bank-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

.bank-info h4 {
    margin: 0 0 5px 0;
    color: #2d3748;
    font-size: 18px;
}

.bank-balance {
    color: #10b981;
    font-weight: bold;
    font-size: 16px;
    font-family: 'Courier New', monospace;
}

.bank-description {
    background: #f7fafc;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 15px;
    color: #4a5568;
    font-size: 14px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.bank-description i {
    color: #718096;
    margin-top: 2px;
}

.bank-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 15px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #718096;
    font-size: 13px;
}

.meta-item i {
    width: 14px;
    color: #a0aec0;
}

.bank-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.bank-form {
    max-width: 600px;
    margin: 0 auto;
}

.form-container {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.form-container h4 {
    color: #2d3748;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.summary-section {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.summary-section h4 {
    color: #2d3748;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.summary-card.large {
    padding: 30px;
    text-align: center;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.summary-card.large.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
}

.summary-card.large:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.card-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px auto;
    font-size: 24px;
    color: #10b981;
}

.summary-card.large.primary .card-icon {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.card-content h3 {
    font-size: 32px;
    font-weight: bold;
    margin: 10px 0 5px 0;
    font-family: 'Courier New', monospace;
}

.card-content p {
    color: #718096;
    font-size: 14px;
    margin: 0;
}

.summary-card.large.primary .card-content p {
    color: rgba(255, 255, 255, 0.9);
}

.info-section {
    margin-top: 30px;
}

.info-card {
    background: #f7fafc;
    padding: 20px;
    border-radius: 12px;
    text-align: right;
}

.info-card h5 {
    color: #2d3748;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.info-card li {
    padding: 8px 0;
    color: #4a5568;
    border-bottom: 1px solid #e2e8f0;
}

.info-card li:last-child {
    border-bottom: none;
}

.info-card li:before {
    content: "•";
    color: #10b981;
    font-weight: bold;
    margin-left: 8px;
}

/* Empty state styles */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #718096;
}

.empty-state i {
    color: #cbd5e0;
    margin-bottom: 20px;
}

.empty-state h4 {
    color: #4a5568;
    margin-bottom: 10px;
}

.empty-state p {
    margin-bottom: 20px;
    line-height: 1.6;
}

/* Text color helpers */
.text-success { color: #10b981; }
.text-warning { color: #f59e0b; }
.text-info { color: #3b82f6; }
.text-primary { color: #667eea; }
.text-secondary { color: #6b7280; }
.text-dark { color: #374151; }

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stat-icon.admin {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.stat-info {
    flex: 1;
}

.stat-label {
    display: block;
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
}

.stat-value {
    display: block;
    font-size: 24px;
    font-weight: bold;
    color: #2c3e50;
}

/* Action Buttons */
.action-buttons,
.admin-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.action-btn {
    background: rgba(255, 255, 255, 0.95);
    -webkit-backdrop-filter: blur(15px); backdrop-filter: blur(15px);
    border: none;
    padding: 25px;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.action-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.action-btn.admin {
    background: linear-gradient(135deg, rgba(240, 147, 251, 0.1) 0%, rgba(245, 87, 108, 0.1) 100%);
    border: 2px solid rgba(240, 147, 251, 0.3);
}

.action-btn i {
    display: block;
    font-size: 28px;
    margin-bottom: 10px;
    color: #667eea;
}

.action-btn.admin i {
    color: #f5576c;
}

/* New Admin Section Styles */
.admin-section {
    margin-bottom: 25px;
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.section-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.action-btn.admin.primary {
    background: linear-gradient(135deg, rgba(0, 123, 255, 0.1) 0%, rgba(0, 123, 255, 0.2) 100%);
    border: 2px solid rgba(0, 123, 255, 0.3);
}

.action-btn.admin.primary i {
    color: #007bff;
}

.action-btn.admin.success {
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.1) 0%, rgba(40, 167, 69, 0.2) 100%);
    border: 2px solid rgba(40, 167, 69, 0.3);
}

.action-btn.admin.success i {
    color: #28a745;
}

.action-btn.admin.purple {
    background: linear-gradient(135deg, rgba(111, 66, 193, 0.1) 0%, rgba(111, 66, 193, 0.2) 100%);
    border: 2px solid rgba(111, 66, 193, 0.3);
}

.action-btn.admin.purple i {
    color: #6f42c1;
}

.action-btn.admin.warning {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.1) 0%, rgba(255, 193, 7, 0.2) 100%);
    border: 2px solid rgba(255, 193, 7, 0.3);
}

.action-btn.admin.warning i {
    color: #ffc107;
}

.action-btn small {
    display: block;
    font-size: 12px;
    color: #6c757d;
    margin-top: 5px;
    font-weight: 400;
}

/* Full-screen view styles */
.fullscreen-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: flex;
    flex-direction: column;
}

.fullscreen-header {
    background: #2c3e50;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #34495e;
}

.fullscreen-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
}

.fullscreen-close {
    background: #dc3545;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
}

.fullscreen-close:hover {
    background: #c82333;
}

/* Main Admin Navigation Tabs */
.main-admin-tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
    margin-bottom: 20px;
    border-radius: 8px 8px 0 0;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.main-admin-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px 10px;
    background: #f8f9fa;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #343a40;
    font-weight: 500;
    border-right: 1px solid #e9ecef;
    min-height: 80px;
}

.main-admin-tab:last-child {
    border-right: none;
}

.main-admin-tab:hover {
    background: #e9ecef;
    color: #343a40;
}

.main-admin-tab.active {
    background: #007bff;
    color: white;
    box-shadow: inset 0 -3px 0 #0056b3;
}

.main-admin-tab .tab-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 5px;
    font-size: 16px;
    color: #343a40;
}

.main-admin-tab.active .tab-icon {
    color: white;
}

.main-admin-tab .tab-text {
    font-size: 12px;
    text-align: center;
    line-height: 1.2;
}

.main-admin-content {
    background: #ffffff;
    border-radius: 0 0 8px 8px;
    min-height: 500px;
}

.main-tab-content {
    display: none;
    padding: 20px;
}

.main-tab-content.active {
    display: block;
}

/* Tab styles for combined sections */
.admin-tabs {
    display: flex;
    background: #f8f9fa;
    border-radius: 6px 6px 0 0;
    overflow: hidden;
    border: 1px solid #dee2e6;
    border-bottom: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.admin-tab {
    flex: 1;
    padding: 15px 20px;
    background: #ffffff;
    border: none;
    cursor: pointer;
    font-weight: 500;
    color: #495057;
    border-right: 1px solid #dee2e6;
    transition: all 0.3s ease;
}

.admin-tab:last-child {
    border-right: none;
}

.admin-tab.active {
    background: #007bff;
    color: white;
    border-bottom: 3px solid #0056b3;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(0, 123, 255, 0.3);
}

.admin-tab:hover:not(.active) {
    background: #e9ecef;
    color: #343a40;
}

.admin-tab-content {
    background: rgba(255, 255, 255, 0.95);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    padding: 25px;
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 0 0 15px 15px;
    min-height: 400px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.action-btn span {
    display: block;
    font-weight: 600;
    color: #2c3e50;
}

/* Priority Actions - OLD SYSTEM (DISABLED)
.priority-actions {
    background: rgba(255, 255, 255, 0.95);
    -webkit-backdrop-filter: blur(15px); backdrop-filter: blur(15px);
    padding: 25px;
    border-radius: 20px;
    margin-bottom: 30px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.1);
    border: 2px solid rgba(255, 215, 0, 0.3);
}
*/

/*
.priority-actions h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    text-align: center;
    font-size: 20px;
}

.priority-actions h3 i {
    color: #ffd700;
    margin-left: 10px;
}

.priority-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.action-btn.priority {
    padding: 30px;
    border-radius: 15px;
    transform: scale(1.05);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
    border: 3px solid;
}

.action-btn.priority.loan-payment {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: white;
}

.action-btn.priority.loan-payment i {
    color: #ffd700;
    font-size: 32px;
}

.action-btn.priority.loan-payment span {
    color: white;
    font-size: 16px;
    font-weight: 700;
}

.action-btn.priority.subscription {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    border-color: #11998e;
    color: white;
}

.action-btn.priority.subscription i {
    color: #ffd700;
    font-size: 32px;
}

.action-btn.priority.subscription span {
    color: white;
    font-size: 16px;
    font-weight: 700;
}

.action-btn.priority:hover {
    transform: scale(1.08) translateY(-3px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}
*/

/* Admin Loan Calculator */
.admin-loan-calculator {
    background: rgba(255, 255, 255, 0.95);
    -webkit-backdrop-filter: blur(15px); backdrop-filter: blur(15px);
    padding: 25px;
    border-radius: 20px;
    margin-bottom: 30px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.1);
    border: 2px solid rgba(240, 147, 251, 0.3);
}

.admin-loan-calculator h3 {
    color: #f5576c;
    margin-bottom: 15px;
    text-align: center;
    font-size: 22px;
}

.admin-loan-calculator .calculator-instruction {
    text-align: center;
    color: #666;
    margin-bottom: 20px;
    font-style: italic;
}

.admin-loan-calculator .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.admin-loan-calculator .calculator-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 20px;
}

.admin-loan-calculator .calculation-result {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 20px;
    border-radius: 15px;
    margin-top: 20px;
}

.admin-loan-calculator .result-box h4 {
    margin: 0 0 15px 0;
    text-align: center;
}

.admin-loan-calculator .scenario-text {
    background: rgba(255, 255, 255, 0.2);
    padding: 10px;
    border-radius: 8px;
    margin-top: 15px;
    text-align: center;
    font-weight: bold;
}

/* Loan Calculator */
.loan-calculator {
    background: rgba(255, 255, 255, 0.95);
    -webkit-backdrop-filter: blur(15px); backdrop-filter: blur(15px);
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 2px solid #007bff;
}

.loan-calculator h3 {
    color: #007bff;
    margin-bottom: 20px;
    font-size: 20px;
    text-align: center;
}

.calculator-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.calculator-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.calculation-result {
    margin-top: 15px;
}

.result-box {
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}

.result-box.success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.result-box.error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.result-box h4 {
    margin: 0 0 10px 0;
    font-size: 16px;
}

.result-box p {
    margin: 0;
    font-weight: bold;
}

.calculator-instruction {
    text-align: center;
    color: #007bff;
    font-weight: 600;
    margin-bottom: 20px;
    background: #e7f3ff;
    padding: 10px;
    border-radius: 5px;
    border-left: 4px solid #007bff;
}

.field-hint {
    color: #666;
    font-size: 12px;
    margin-top: 3px;
    display: block;
}

.calculation-summary {
    display: grid;
    gap: 10px;
    margin-bottom: 15px;
}

.calculation-summary .summary-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(40, 167, 69, 0.2);
}

.calculation-summary .summary-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.calculation-summary .summary-item label {
    color: #000000 !important; /* Black text for labels */
    font-weight: normal;
}

.calculation-summary .summary-item .amount,
.calculation-summary .summary-item span {
    font-weight: bold;
    color: #28a745 !important; /* Green for amounts/numbers */
}

.calc-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 5px;
    border: 1px solid #e0e0e0;
}

.calc-label {
    font-weight: 600;
    color: #2c3e50;
}

.calc-value {
    font-weight: bold;
    color: #007bff;
    font-size: 16px;
}

.calculation-note {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 10px;
    border-radius: 5px;
    font-size: 14px;
    margin-top: 10px;
}

.scenario-text {
    text-align: center;
    font-style: italic;
    color: #666;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e0e0e0;
}

.error-message {
    color: #721c24;
    font-weight: bold;
    text-align: center;
}

/* Loan Conditions */
.loan-conditions {
    background: rgba(255, 255, 255, 0.95);
    -webkit-backdrop-filter: blur(15px); backdrop-filter: blur(15px);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.loan-conditions h3,
.loan-conditions h4 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 20px;
}

.conditions-list {
    margin-bottom: 20px;
}

.condition-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 0;
    border-bottom: 1px solid #e9ecef;
}

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

.condition-item i {
    width: 20px;
    font-size: 16px;
}

.condition-item i.fa-check {
    color: #28a745;
}

.condition-item i.fa-times {
    color: #dc3545;
}

.condition-item i.fa-spinner {
    color: #ffc107;
}

.condition-item span {
    flex: 1;
    font-size: 14px;
}

/* Loading Spinner */
.loading-spinner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.spinner {
    text-align: center;
    color: white;
}

.spinner i {
    font-size: 48px;
    margin-bottom: 20px;
    display: block;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 10000;
}

.toast {
    background: rgba(255, 255, 255, 0.95);
    -webkit-backdrop-filter: blur(15px); backdrop-filter: blur(15px);
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    border-right: 4px solid #28a745;
    animation: slideIn 0.3s ease;
    max-width: 300px;
}

.toast.error {
    border-right-color: #dc3545;
}

.toast.warning {
    border-right-color: #ffc107;
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: row;
        gap: 10px;
        justify-content: space-between;
        align-items: center;
    }
    
    .user-info {
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        gap: 6px;
    }
    
    .user-info #logoutBtn {
        padding: 4px 8px;
        font-size: 12px;
    }
    
    .terms-link {
        font-size: 12px;
        padding: 4px 8px;
        gap: 3px;
    }
    
    #userName {
        font-size: 13px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .action-buttons,
    .admin-actions {
        grid-template-columns: 1fr;
    }
    
    .login-card {
        margin: 20px;
        padding: 30px 20px;
    }
    
    .container {
        padding: 0 15px;
    }
}

/* RTL Specific Styles */
[dir="rtl"] .user-info {
    direction: rtl;
}

[dir="rtl"] .btn i {
    margin-left: 8px;
    margin-right: 0;
}

/* Hide elements by default */
#dashboardSection,
#userInfo {
    display: none;
}

/* Form validation styles */
.form-group input.invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.form-group input.valid {
    border-color: #28a745;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 15px;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

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

.modal-header h3 {
    margin: 0;
    color: #2c3e50;
}

.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #666;
    padding: 5px;
}

.modal-close:hover {
    color: #dc3545;
}

.modal-body {
    padding: 20px;
}

/* User Info Modal */
.user-info-modal p {
    margin-bottom: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #f8f9fa;
}

/* Messages Modal */
.messages-modal {
    max-height: 400px;
    overflow-y: auto;
}

.message-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.message-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.message-date {
    font-size: 12px;
    color: #666;
}

.message-status {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 12px;
    color: white;
}

.message-status.pending {
    background: #ffc107;
}

.message-status.read {
    background: #17a2b8;
}

.message-status.answered {
    background: #28a745;
}

.message-content {
    margin-bottom: 10px;
    line-height: 1.5;
}

.message-response {
    background: #e3f2fd;
    padding: 10px;
    border-radius: 5px;
    font-size: 14px;
}

.new-message-form {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #e9ecef;
}

.new-message-form textarea {
    width: 100%;
    min-height: 80px;
    resize: vertical;
    margin-bottom: 10px;
}

/* Admin Modal Styles */
.pending-loans-modal,
.pending-transactions-modal {
    max-height: 500px;
    overflow-y: auto;
}

.loan-item,
.transaction-item {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 15px;
    border: 1px solid #e9ecef;
}

.loan-header,
.transaction-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.loan-header h4,
.transaction-header h4 {
    margin: 0;
    color: #2c3e50;
}

.loan-date,
.transaction-date {
    font-size: 12px;
    color: #666;
}

.loan-details,
.transaction-details {
    margin-bottom: 15px;
}

.loan-details p,
.transaction-details p {
    margin-bottom: 5px;
}

.loan-actions,
.transaction-actions {
    display: flex;
    gap: 10px;
}

.loan-actions button,
.transaction-actions button {
    padding: 8px 16px;
    font-size: 12px;
}

/* Users Table */
.users-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.users-table th,
.users-table td {
    padding: 12px;
    text-align: right;
    border-bottom: 1px solid #e9ecef;
}

.users-table th {
    background: #f8f9fa;
    font-weight: bold;
    color: #2c3e50;
}

.users-table tr:hover {
    background: #f8f9fa;
}

/* Payment and Deposit Forms */
.payment-form,
.deposit-form {
    max-width: 400px;
}

/* Responsive Modal */
@media (max-width: 768px) {
    .modal-content {
        margin: 10px;
        max-height: 90vh;
    }
    
    .loan-header,
    .transaction-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .loan-actions,
    .transaction-actions {
        flex-direction: column;
    }
    
    .users-table {
        font-size: 12px;
    }
    
    .users-table th,
    .users-table td {
        padding: 8px 4px;
    }
}

/* Enhanced Admin Styles */
.user-details-modal {
    max-height: 600px;
    overflow-y: auto;
}

.user-info-section,
.balance-history-section,
.loan-payments-section {
    margin-bottom: 25px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #007bff;
}

.user-basic-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.user-basic-info p {
    margin-bottom: 8px;
    padding: 5px 0;
    border-bottom: 1px solid #e9ecef;
}

.balance-summary {
    display: flex;
    gap: 30px;
    margin-bottom: 15px;
    font-weight: bold;
}

.loan-payments-summary {
    margin-bottom: 15px;
    font-weight: bold;
}

.mini-table {
    width: 100%;
    font-size: 12px;
    border-collapse: collapse;
}

.mini-table th,
.mini-table td {
    padding: 6px 8px;
    text-align: right;
    border-bottom: 1px solid #dee2e6;
}

.mini-table th {
    background: #e9ecef;
    font-weight: bold;
}

.mini-table tbody tr:hover {
    background: #f8f9fa;
}

.status-accepted {
    color: #28a745;
    font-weight: bold;
}

.status-pending {
    color: #ffc107;
    font-weight: bold;
}

.status-rejected {
    color: #dc3545;
    font-weight: bold;
}

.status-approved {
    color: #17a2b8;
    font-weight: bold;
}

.status-closed {
    color: #6c757d;
    font-weight: bold;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    margin: 2px;
    min-width: 80px;
    display: block;
    width: 100%;
    margin-bottom: 5px;
}

.actions-column {
    min-width: 120px;
    text-align: center;
}

/* Make buttons more visible */
.btn-primary.btn-sm {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    border: none;
    color: white;
    font-weight: bold;
}

.btn-primary.btn-sm:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0, 123, 255, 0.3);
}

.btn-warning.btn-sm:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(255, 193, 7, 0.3);
}

/* Password Reset Styles */
.password-reset-form {
    max-width: 400px;
    margin: 0 auto;
}

.password-reset-form .form-group {
    margin-bottom: 15px;
}

/* Balance Tier Indicators */
.balance-tier {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: bold;
    color: white;
}

.balance-tier.premium {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.balance-tier.special {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.balance-tier.medium {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.balance-tier.basic {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.balance-tier.ineligible {
    background: #6c757d;
}

/* Loan Calculator Styles */
.loan-calculator {
    background: #e3f2fd;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
}

.installment-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-top: 15px;
}

.installment-option {
    background: white;
    padding: 10px;
    border-radius: 6px;
    border: 2px solid #e9ecef;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.installment-option:hover,
.installment-option.selected {
    border-color: #007bff;
    background: #f8f9fa;
}

.installment-option h5 {
    margin: 0 0 5px 0;
    color: #007bff;
}

.installment-option p {
    margin: 0;
    font-size: 12px;
    color: #666;
}

/* Enhanced Button Styles */
.btn-warning {
    background: linear-gradient(135deg, #ffc107 0%, #ff8c00 100%);
    color: white;
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 193, 7, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(220, 53, 69, 0.4);
}

/* Small button variants for admin actions */
.btn-warning.btn-sm {
    background: linear-gradient(135deg, #ffc107 0%, #ff8c00 100%);
    border: none;
    color: white;
    font-weight: bold;
}

.btn-danger.btn-sm {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    border: none;
    color: white;
    font-weight: bold;
}

.btn-danger.btn-sm:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(220, 53, 69, 0.3);
}

/* Credentials Modal - Button Enhancement */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn.enabled {
    animation: pulseGreen 2s infinite;
}

@keyframes pulseGreen {
    0% { box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(40, 167, 69, 0); }
    100% { box-shadow: 0 0 0 0 rgba(40, 167, 69, 0); }
}

/* === Table Sorting Styles === */
.sortable {
    cursor: pointer;
    -webkit-user-select: none; user-select: none;
    transition: all 0.2s ease;
    position: relative;
}

.sortable:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.sort-icon {
    margin-right: 8px;
    font-size: 12px;
    opacity: 0.6;
    transition: all 0.2s ease;
}

.sort-icon.active {
    opacity: 1;
    color: #ffc107;
}

.sortable:hover .sort-icon {
    opacity: 0.8;
}

/* Enhanced table header styling for better visibility */
#usersTable th.sortable {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    padding: 12px 8px;
    text-align: center;
    border-bottom: 2px solid #5a6fd8;
}

#usersTable th.sortable:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
    transform: translateY(-1px);
}

/* Active sort column highlighting */
#usersTable th.sortable.sort-active {
    background: linear-gradient(135deg, #ffc107 0%, #ff8c00 100%);
    color: #333;
}

/* Table row hover effect enhancement */
#usersTable tbody tr:hover {
    background-color: rgba(102, 126, 234, 0.05);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Family Management - Member Loan Display */
.stat-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.stat-row .stat-item {
    flex: 1;
    text-align: center;
}

.stat-item .stat-value {
    display: block;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 2px;
}

.stat-item .stat-label {
    display: block;
    font-size: 12px;
    opacity: 0.8;
}

.member-loan-info {
    border-top: 1px solid rgba(0,0,0,0.1);
    padding-top: 12px;
}

.member-card {
    margin-bottom: 16px;
    padding: 16px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Loan Management Styles */
.loan-management-section {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.management-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: var(--padding);
    text-align: center;
}

.management-header h4 {
    margin: 0 0 10px 0;
    font-size: 1.4rem;
}

.management-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 0.95rem;
}

.loan-management-tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.loan-mgmt-tab {
    flex: 1;
    padding: 15px 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
    color: #6c757d;
    position: relative;
}

.loan-mgmt-tab:hover {
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary);
}

.loan-mgmt-tab.active {
    background: white;
    color: var(--primary);
    border-bottom: 3px solid var(--primary);
}

.loan-management-content {
    padding: var(--padding);
}

.loan-mgmt-panel {
    display: none;
}

.loan-mgmt-panel.active {
    display: block;
}

/* Add Loan Form Styles */
.add-loan-form {
    max-width: 800px;
    margin: 0 auto;
}

.form-section {
    background: #f8f9fa;
    border-radius: var(--radius);
    padding: var(--padding);
    margin-bottom: 20px;
    border-left: 4px solid var(--primary);
}

.form-section h5 {
    color: var(--primary);
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.user-search-section {
    margin-bottom: 20px;
}

.search-input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.search-input-group input {
    flex: 1;
    padding: 12px;
    border: 1px solid #dee2e6;
    border-radius: var(--radius);
    font-size: 1rem;
}

.search-input-group button {
    padding: 12px 20px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
}

.search-input-group button:hover {
    background: var(--secondary);
}

.search-results-list {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: var(--radius);
    max-height: 300px;
    overflow-y: auto;
}

.search-results-list h6 {
    background: #f8f9fa;
    padding: 10px 15px;
    margin: 0;
    border-bottom: 1px solid #dee2e6;
    color: var(--primary);
}

.user-result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #f1f1f1;
    cursor: pointer;
    transition: var(--transition);
}

.user-result-item:hover {
    background: #f8f9fa;
}

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

.user-result-item .user-info strong {
    display: block;
    color: #333;
    font-size: 1rem;
    margin-bottom: 5px;
}

.user-result-item .user-details {
    display: flex;
    gap: 15px;
    font-size: 0.85rem;
    color: #6c757d;
}

.user-card.selected {
    background: linear-gradient(135deg, #e8f5e8 0%, #f0f8ff 100%);
    border: 2px solid var(--success);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.user-avatar {
    width: 50px;
    height: 50px;
    background: var(--success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.user-card .user-details h6 {
    margin: 0 0 8px 0;
    color: #333;
    font-size: 1.1rem;
}

.user-card .user-meta {
    display: flex;
    gap: 20px;
    font-size: 0.9rem;
    color: #6c757d;
}

.user-card .user-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.loan-summary {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: var(--radius);
    padding: var(--padding);
    margin-bottom: 20px;
    border-left: 4px solid var(--info);
}

.loan-summary h6 {
    color: var(--info);
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.summary-item {
    background: white;
    padding: 15px;
    border-radius: var(--radius-sm);
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.summary-item label {
    display: block;
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 5px;
}

.summary-item span {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--primary);
}

.loans-management-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.loan-management-card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.loan-management-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.loan-card-header {
    background: #f8f9fa;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #dee2e6;
}

.loan-card-header h6 {
    margin: 0;
    color: #333;
    font-size: 1rem;
}

.loan-actions {
    display: flex;
    gap: 8px;
}

.loan-card-body {
    padding: 15px;
}

.loan-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f1f1f1;
}

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

.detail-item .label {
    font-size: 0.85rem;
    color: #6c757d;
    font-weight: 500;
}

.detail-item .value {
    font-size: 0.9rem;
    color: #333;
    font-weight: 600;
}

/* Edit Loan Modal */
.edit-loan-modal {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
}

.edit-loan-modal h4 {
    background: var(--primary);
    color: white;
    padding: var(--padding);
    margin: 0;
    text-align: center;
}

.edit-loan-modal form {
    padding: var(--padding);
}

/* Loan Summary in Edit Modal */
.loan-summary {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.summary-item .label {
    font-weight: 600;
    color: #495057;
    font-size: 0.9rem;
}

.summary-item .value {
    font-weight: 700;
    font-size: 1rem;
}

.summary-item .value.paid {
    color: #28a745;
}

.summary-item .value.remaining {
    color: #dc3545;
}

.form-text {
    color: #6c757d;
    font-size: 0.875rem;
    margin-top: 5px;
    display: block;
}

/* No Results State */
.no-results {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

.no-results i {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

.no-results p {
    margin: 0;
    font-size: 1.1rem;
}

/* Financial Summary Cards - Top Priority */
.financial-summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
    padding: 20px 0;
}

.financial-card {
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 2px solid transparent;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 20px;
    position: relative;
    overflow: hidden;
}

.financial-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.financial-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.financial-card.clickable-card:hover {
    cursor: pointer;
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.financial-card-icon {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.financial-card-content {
    flex: 1;
}

.financial-card-content h3 {
    margin: 0 0 10px 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
}

.financial-value {
    font-size: 2rem;
    font-weight: 700;
    margin: 10px 0;
    direction: ltr;
    text-align: left;
}

.financial-card.bank-balance .financial-value {
    color: #10b981; /* Green for bank balance */
}

.financial-card.fund-balance .financial-value {
    color: #3b82f6; /* Blue for fund balance */
}

.financial-card.difference .financial-value {
    color: #6366f1; /* Purple for difference */
}

.financial-card.difference.positive .financial-value {
    color: #10b981; /* Green for positive difference */
}

.financial-card.difference.negative .financial-value {
    color: #ef4444; /* Red for negative difference */
}

.financial-card small {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Responsive Design */
@media (max-width: 768px) {
    .financial-summary-cards {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 15px 0;
    }
    
    .financial-card {
        padding: 20px;
        gap: 15px;
    }
    
    .financial-card-icon {
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
    }
    
    .financial-value {
        font-size: 1.6rem;
    }
    
    .financial-card-content h3 {
        font-size: 1.1rem;
    }
}

/* Messages Modal Styles */
.messages-tabs {
    display: flex;
    border-bottom: 1px solid #ddd;
    margin-bottom: 20px;
}

.messages-tab {
    flex: 1;
    padding: 12px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: #667eea;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.messages-tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background-color: #f8f9ff;
}

.messages-tab:hover {
    background-color: #f0f0f0;
}

.messages-tab-content {
    display: none;
}

.messages-tab-content.active {
    display: block;
}

.form-hint {
    display: block;
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

/* Admin Tickets Management Styles */
.tickets-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.tickets-stats-grid .stat-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.tickets-stats-grid .stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.tickets-stats-grid .stat-card.open-tickets .stat-icon {
    background: #fef3c7;
    color: #d97706;
}

.tickets-stats-grid .stat-card.in-progress-tickets .stat-icon {
    background: #dbeafe;
    color: #2563eb;
}

.tickets-stats-grid .stat-card.urgent-tickets .stat-icon {
    background: #fecaca;
    color: #dc2626;
}

.tickets-stats-grid .stat-card.total-tickets .stat-icon {
    background: #e0e7ff;
    color: #667eea;
}

.tickets-filters {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-group label {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.filter-group select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: white;
    min-width: 150px;
}

.admin-ticket-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
}

.admin-ticket-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.ticket-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.ticket-subject {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.ticket-meta {
    display: flex;
    gap: 20px;
    font-size: 13px;
    color: #666;
    flex-wrap: wrap;
}

.ticket-status-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: flex-end;
}

.ticket-content {
    margin: 15px 0;
    line-height: 1.6;
    color: #555;
}

.ticket-admin-notes {
    margin-top: 15px;
    padding: 15px;
    background-color: #e8f4fd;
    border-left: 4px solid #667eea;
    border-radius: 5px;
    font-size: 14px;
}

.ticket-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
}

.status-select {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: white;
    font-size: 14px;
}

/* Message History Styles */
.message-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    transition: box-shadow 0.3s ease;
}

.message-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.message-subject {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.message-meta {
    display: flex;
    gap: 15px;
    font-size: 12px;
    color: #666;
}

.message-status {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.message-status.open {
    background-color: #fef3c7;
    color: #d97706;
}

.message-status.in-progress {
    background-color: #dbeafe;
    color: #2563eb;
}

.message-status.resolved {
    background-color: #d1fae5;
    color: #059669;
}

.message-status.closed {
    background-color: #f3f4f6;
    color: #6b7280;
}

.message-priority {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.message-priority.low {
    background-color: #f3f4f6;
    color: #6b7280;
}

.message-priority.medium {
    background-color: #fef3c7;
    color: #d97706;
}

.message-priority.high {
    background-color: #fed7d7;
    color: #e53e3e;
}

.message-priority.urgent {
    background-color: #fecaca;
    color: #dc2626;
}

.message-content {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e5e5e5;
    line-height: 1.6;
}

.message-admin-notes {
    margin-top: 10px;
    padding: 10px;
    background-color: #e8f4fd;
    border-left: 4px solid #667eea;
    border-radius: 4px;
}

.message-admin-notes strong {
    color: #667eea;
}
