/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    background-color: #f5f5f5;
    color: #333;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    background-color: #fff;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

header h1 {
    color: #2c3e50;
    margin-bottom: 20px;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 20px;
}

nav a {
    text-decoration: none;
    color: #34495e;
    font-weight: 500;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

nav a:hover {
    background-color: #f0f0f0;
}

/* Admin Dashboard */
.admin-dashboard {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.admin-dashboard h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 24px;
}

.admin-stats {
    margin-bottom: 30px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 6px;
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.admin-button {
    text-decoration: none;
}

.admin-button button {
    background-color: #3498db;
    color: #fff;
    padding: 15px 25px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    width: 100%;
    font-size: 16px;
    font-weight: 500;
    transition: background-color 0.3s, transform 0.2s;
}

.admin-button button:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
}

/* Login styles */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #f5f5f5;
}

.login-box {
    background-color: #fff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    margin-bottom: 30px;
    text-align: center;
    color: #2c3e50;
}

/* Form styles */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 5px;
    color: #34495e;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

button {
    background-color: #3498db;
    color: #fff;
    padding: 12px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
    font-size: 16px;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #2980b9;
}

/* Messages */
.error-message {
    background-color: #ff6b6b;
    color: #fff;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 20px;
    text-align: center;
}

.success-message {
    background-color: #51cf66;
    color: #fff;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 20px;
    text-align: center;
}

/* Loans grid */
.loans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.loan-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 20px;
    margin-bottom: 20px;
    transition: transform 0.2s ease;
}

.loan-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.loan-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.loan-header h4 {
    margin: 0;
    color: #333;
    font-size: 1.2em;
}

.loan-status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.9em;
    font-weight: 500;
}

.loan-status.active {
    background: #e3f2fd;
    color: #1976d2;
}

.loan-status.paid {
    background: #e8f5e9;
    color: #388e3c;
}

.loan-details {
    margin-bottom: 15px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    padding: 4px 0;
}

.detail-label {
    color: #666;
    font-size: 0.95em;
}

.detail-value {
    font-weight: 500;
    color: #333;
}

.highlight-row {
    background: #f8f9fa;
    padding: 8px 12px;
    border-radius: 4px;
    margin: 10px -12px;
}

.interest-highlight {
    color: #d32f2f;
    font-weight: bold;
}

.interest-info {
    margin-top: 15px;
    padding: 12px;
    background: #f5f5f5;
    border-radius: 6px;
    font-size: 0.9em;
}

.interest-info p {
    margin: 5px 0;
    color: #555;
}

.interest-tip {
    color: #1976d2;
    font-style: italic;
    margin-top: 8px;
}

.view-payments-btn {
    width: 100%;
    padding: 10px;
    background: #2196f3;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.2s ease;
}

.view-payments-btn:hover {
    background: #1976d2;
}

/* Payment History Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 1000;
}

.modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    position: relative;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.close {
    position: absolute;
    right: 25px;
    top: 20px;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    transition: color 0.3s;
}

.close:hover {
    color: #333;
}

/* Payment History Table */
.payments-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background-color: #fff;
}

.payments-table th {
    background-color: #f8f9fa;
    color: #2c3e50;
    font-weight: 600;
    text-align: left;
    padding: 15px;
    border-bottom: 2px solid #eee;
}

.payments-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    color: #333;
}

.payments-table tr:last-child td {
    border-bottom: none;
}

.payments-table tr:hover td {
    background-color: #f8f9fa;
}

/* Payment Statistics */
.payment-stats {
    margin-top: 30px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.payment-stats h4 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.1em;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.stat-item {
    background-color: #fff;
    padding: 15px;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.stat-label {
    display: block;
    color: #666;
    font-size: 0.9em;
    margin-bottom: 5px;
}

.stat-value {
    display: block;
    color: #2c3e50;
    font-size: 1.2em;
    font-weight: 600;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .loans-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        margin: 10% 15px;
        padding: 20px;
    }
    
    .payments-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    .detail-row {
        flex-direction: column;
        align-items: flex-start;
        padding: 10px 0;
    }
    
    .detail-value {
        margin-top: 4px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
} 