/* Enhanced Mobile-First Responsive Styles for SIGNTECH SACCO */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

/* Enhanced Navigation - Mobile First */
.navbar {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 15px;
    max-width: 1200px;
    margin: 0 auto;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.2rem;
    font-weight: bold;
    padding: 12px 0;
}

.nav-brand i {
    color: #f39c12;
    font-size: 1.5rem;
}

.nav-menu {
    display: flex;
    gap: 0;
    align-items: center;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    font-size: 0.9rem;
    white-space: nowrap;
}

.nav-item:hover {
    background: rgba(255,255,255,0.1);
    border-bottom-color: #f39c12;
}

.nav-item.active {
    background: rgba(255,255,255,0.15);
    border-bottom-color: #f39c12;
}

.nav-item i {
    font-size: 1rem;
}

/* Mobile Navigation Improvements */
@media (max-width: 768px) {
    .nav-container {
        padding: 0 10px;
    }
    
    .nav-brand {
        font-size: 1rem;
    }
    
    .nav-brand i {
        font-size: 1.2rem;
    }
    
    .nav-menu {
        gap: 0;
    }
    
    .nav-item {
        padding: 10px 8px;
        font-size: 0.8rem;
        flex-direction: column;
        gap: 2px;
    }
    
    .nav-item span {
        font-size: 0.7rem;
    }
    
    .nav-item i {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .nav-item span {
        display: none;
    }
    
    .nav-item {
        padding: 12px 6px;
    }
}

/* Main Content - Mobile First */
.main-content {
    margin-top: 70px;
    padding: 15px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

@media (min-width: 768px) {
    .main-content {
        padding: 30px;
        margin-top: 80px;
    }
}

/* Sections - Mobile Responsive */
.section {
    display: none;
    animation: fadeIn 0.3s ease;
}

.section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Welcome Section - Mobile Optimized */
.welcome-section {
    background: white;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    text-align: center;
}

.welcome-section h1 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1.8rem;
}

.welcome-section p {
    color: #7f8c8d;
    font-size: 1rem;
}

@media (min-width: 768px) {
    .welcome-section {
        padding: 40px;
        margin-bottom: 30px;
    }
    
    .welcome-section h1 {
        font-size: 2.5rem;
        margin-bottom: 15px;
    }
    
    .welcome-section p {
        font-size: 1.2rem;
    }
}

/* Dashboard Cards - Mobile First Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

@media (min-width: 480px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 768px) {
    .dashboard-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
        margin-bottom: 30px;
    }
}

.dashboard-card {
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.3s ease;
    min-height: 100px;
}

.dashboard-card:hover {
    transform: translateY(-3px);
}

.card-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: white;
    flex-shrink: 0;
}

.card-content {
    flex: 1;
    min-width: 0;
}

.card-content h3 {
    font-size: 1.3rem;
    color: #2c3e50;
    margin-bottom: 5px;
    word-break: break-word;
}

.card-content p {
    color: #7f8c8d;
    font-size: 0.85rem;
}

@media (min-width: 768px) {
    .dashboard-card {
        padding: 25px;
        gap: 20px;
    }
    
    .card-icon {
        width: 60px;
        height: 60px;
        font-size: 1.4rem;
    }
    
    .card-content h3 {
        font-size: 1.5rem;
    }
    
    .card-content p {
        font-size: 0.9rem;
    }
}

/* Action Buttons - Mobile Optimized */
.action-buttons {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

@media (min-width: 480px) {
    .action-buttons {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 768px) {
    .action-buttons {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
        margin-bottom: 30px;
    }
}

.action-btn {
    padding: 15px 20px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    min-height: 50px;
}

@media (min-width: 768px) {
    .action-btn {
        padding: 18px 25px;
        font-size: 1rem;
        min-height: 55px;
    }
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.btn-primary {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: white;
}

.btn-info {
    background: linear-gradient(135deg, #17a2b8, #138496);
    color: white;
}

/* Forms - Mobile First */
.form-container {
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

@media (min-width: 768px) {
    .form-container {
        padding: 30px;
        margin-bottom: 30px;
    }
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #2c3e50;
    font-weight: 500;
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ecf0f1;
    border-radius: 8px;
    font-size: 16px; /* Prevents zoom on iOS */
    transition: border-color 0.3s ease;
    background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* Form Grid for Desktop */
@media (min-width: 768px) {
    .form-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .form-grid .form-group.full-width {
        grid-column: 1 / -1;
    }
}

/* Buttons - Mobile Optimized */
.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    min-height: 44px; /* Touch-friendly minimum */
    width: 100%;
}

@media (min-width: 768px) {
    .btn {
        width: auto;
        padding: 14px 24px;
        font-size: 1rem;
    }
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}

.btn:active {
    transform: translateY(0);
}

/* Transaction History - Mobile Responsive */
.transaction-history {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.transaction-header {
    background: #34495e;
    color: white;
    padding: 15px 20px;
    font-weight: 600;
}

.transaction-list {
    max-height: 400px;
    overflow-y: auto;
}

.transaction-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #ecf0f1;
    gap: 15px;
}

.transaction-item:last-child {
    border-bottom: none;
}

.transaction-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.transaction-details {
    flex: 1;
    min-width: 0;
}

.transaction-details h4 {
    color: #2c3e50;
    margin-bottom: 3px;
    font-size: 0.9rem;
}

.transaction-details p {
    color: #7f8c8d;
    font-size: 0.8rem;
}

.transaction-amount {
    font-weight: bold;
    color: #27ae60;
    font-size: 0.9rem;
    text-align: right;
    flex-shrink: 0;
}

@media (min-width: 768px) {
    .transaction-header {
        padding: 20px 25px;
    }
    
    .transaction-item {
        padding: 18px 25px;
    }
    
    .transaction-details h4 {
        font-size: 1rem;
    }
    
    .transaction-details p {
        font-size: 0.85rem;
    }
    
    .transaction-amount {
        font-size: 1rem;
    }
}

/* Modals - Mobile Responsive */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s ease;
    padding: 10px;
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 15px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideIn 0.3s ease;
}

@media (max-width: 768px) {
    .modal {
        padding: 5px;
    }
    
    .modal-content {
        margin: 2% auto;
        max-height: 95vh;
        width: calc(100% - 10px);
    }
}

@keyframes slideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #ecf0f1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    color: #2c3e50;
    margin: 0;
    font-size: 1.2rem;
}

@media (min-width: 768px) {
    .modal-header {
        padding: 25px;
    }
    
    .modal-header h3 {
        font-size: 1.4rem;
    }
}

.close {
    color: #aaa;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
    padding: 5px;
    line-height: 1;
}

.close:hover {
    color: #e74c3c;
}

.modal form {
    padding: 20px;
}

@media (min-width: 768px) {
    .modal form {
        padding: 25px;
    }
}

/* Loan Section - Mobile Optimized */
.loan-section {
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.loan-section h2 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

@media (min-width: 768px) {
    .loan-section {
        padding: 30px;
        margin-bottom: 30px;
    }
    
    .loan-section h2 {
        font-size: 2rem;
        margin-bottom: 20px;
    }
}

.loan-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

@media (min-width: 480px) {
    .loan-actions {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 768px) {
    .loan-actions {
        gap: 15px;
    }
}

/* Loan Cards */
.loan-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

@media (min-width: 768px) {
    .loan-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

.loan-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    border-left: 4px solid #3498db;
}

.loan-card h4 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.loan-card p {
    color: #7f8c8d;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

/* Status Badges - Mobile Friendly */
.status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    display: inline-block;
}

@media (min-width: 768px) {
    .status-badge {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
}

.status-completed { background: #d5f4e6; color: #27ae60; }
.status-pending { background: #fef9e7; color: #f39c12; }
.status-failed { background: #fadbd8; color: #e74c3c; }
.status-active { background: #d6eaf8; color: #3498db; }

/* Profile Section - Mobile Optimized */
.profile-section {
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.profile-info {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

@media (min-width: 768px) {
    .profile-section {
        padding: 30px;
    }
    
    .profile-info {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

.info-group {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.info-group label {
    display: block;
    color: #7f8c8d;
    font-size: 0.8rem;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-group span {
    color: #2c3e50;
    font-weight: 500;
    font-size: 0.95rem;
}

/* Loading States */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #ecf0f1;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@media (min-width: 768px) {
    .spinner {
        width: 40px;
        height: 40px;
        border-width: 4px;
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Notifications - Mobile Friendly */
.notification {
    position: fixed;
    top: 80px;
    right: 10px;
    left: 10px;
    padding: 15px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 3000;
    animation: slideInDown 0.3s ease;
    text-align: center;
}

@media (min-width: 768px) {
    .notification {
        right: 20px;
        left: auto;
        width: 300px;
        text-align: left;
        animation: slideInRight 0.3s ease;
    }
}

.notification.success { background: #2ecc71; }
.notification.error { background: #e74c3c; }
.notification.warning { background: #f39c12; }
.notification.info { background: #3498db; }

@keyframes slideInDown {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

@keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

/* Color Scheme */
.dashboard-card:nth-child(1) .card-icon { background: linear-gradient(135deg, #3498db, #2980b9); }
.dashboard-card:nth-child(2) .card-icon { background: linear-gradient(135deg, #2ecc71, #27ae60); }
.dashboard-card:nth-child(3) .card-icon { background: linear-gradient(135deg, #f39c12, #e67e22); }

.transaction-icon.individual { background: linear-gradient(135deg, #3498db, #2980b9); }
.transaction-icon.mpesa { background: linear-gradient(135deg, #2ecc71, #27ae60); }

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-10 { margin-bottom: 10px; }
.mb-15 { margin-bottom: 15px; }
.mb-20 { margin-bottom: 20px; }

.mt-10 { margin-top: 10px; }
.mt-15 { margin-top: 15px; }
.mt-20 { margin-top: 20px; }

.hidden { display: none; }
.block { display: block; }

/* Touch Improvements */
@media (hover: none) and (pointer: coarse) {
    .nav-item:hover,
    .dashboard-card:hover,
    .action-btn:hover,
    .btn:hover {
        transform: none;
    }
    
    .nav-item:active,
    .dashboard-card:active,
    .action-btn:active,
    .btn:active {
        transform: scale(0.98);
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .card-icon,
    .transaction-icon {
        border: 1px solid rgba(255,255,255,0.1);
    }
}

/* Landscape Mobile Optimization */
@media (max-height: 500px) and (orientation: landscape) {
    .main-content {
        margin-top: 60px;
        padding: 10px;
    }
    
    .welcome-section {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .welcome-section h1 {
        font-size: 1.5rem;
        margin-bottom: 5px;
    }
    
    .dashboard-grid {
        gap: 10px;
        margin-bottom: 15px;
    }
    
    .dashboard-card {
        padding: 15px;
        min-height: 80px;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .action-buttons,
    .btn,
    .modal {
        display: none !important;
    }
    
    .main-content {
        margin-top: 0;
        padding: 0;
    }
    
    .section {
        display: block !important;
        page-break-inside: avoid;
    }
}


/* Loan Payment Styles */

.loan-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    margin-bottom: 15px;
    border-left: 4px solid #3498db;
}

.loan-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.loan-header h4 {
    color: #2c3e50;
    margin: 0;
    font-size: 1.2rem;
}

.loan-details {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

@media (min-width: 768px) {
    .loan-details {
        grid-template-columns: 1fr 1fr;
    }
}

.loan-info,
.payment-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
}

.loan-info p,
.payment-info p {
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.loan-info p:last-child,
.payment-info p:last-child {
    margin-bottom: 0;
}

.loan-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.loan-actions .btn {
    flex: 1;
    min-width: 140px;
}

@media (min-width: 480px) {
    .loan-actions .btn {
        flex: none;
    }
}

.loan-completed {
    color: #27ae60;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Payment Modal Styles */
.payment-info {
    background: #e8f4fd;
    border: 1px solid #bee5eb;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.payment-info p {
    margin: 0;
    color: #0c5460;
    display: flex;
    align-items: center;
    gap: 8px;
}

.payment-info i {
    color: #17a2b8;
}

.form-group small {
    display: block;
    color: #6c757d;
    font-size: 0.8rem;
    margin-top: 5px;
}

/* Payment History Styles */
.loan-payment-history {
    padding: 20px;
}

.loan-summary {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 25px;
}

.loan-summary h4 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.summary-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

@media (min-width: 480px) {
    .summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 768px) {
    .summary-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.summary-item {
    text-align: center;
    padding: 10px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.summary-item label {
    display: block;
    color: #7f8c8d;
    font-size: 0.8rem;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-item span {
    color: #2c3e50;
    font-weight: bold;
    font-size: 1rem;
}

.payment-history h4 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.payment-list {
    max-height: 400px;
    overflow-y: auto;
}

.payment-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border: 1px solid #ecf0f1;
    border-radius: 8px;
    margin-bottom: 10px;
    background: white;
    gap: 15px;
}

.payment-item:last-child {
    margin-bottom: 0;
}

.payment-details {
    flex: 1;
    min-width: 0;
}

.payment-amount {
    font-weight: bold;
    color: #2c3e50;
    font-size: 1.1rem;
    margin-bottom: 3px;
}

.payment-method {
    color: #3498db;
    font-size: 0.8rem;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 3px;
}

.payment-date {
    color: #7f8c8d;
    font-size: 0.85rem;
    margin-bottom: 3px;
}

.receipt-number {
    color: #27ae60;
    font-size: 0.8rem;
    font-family: monospace;
}

.payment-status {
    flex-shrink: 0;
}

/* Modal Large Variant */
.modal-content.large {
    max-width: 800px;
    width: 95%;
}

@media (min-width: 768px) {
    .modal-content.large {
        width: 90%;
    }
}

/* Enhanced Status Badges */
.status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    display: inline-block;
    letter-spacing: 0.3px;
}

@media (min-width: 768px) {
    .status-badge {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
}

.status-completed { 
    background: #d5f4e6; 
    color: #27ae60; 
    border: 1px solid #a3e6c1;
}

.status-pending { 
    background: #fef9e7; 
    color: #f39c12; 
    border: 1px solid #f7dc6f;
}

.status-failed { 
    background: #fadbd8; 
    color: #e74c3c; 
    border: 1px solid #f1948a;
}

.status-active { 
    background: #d6eaf8; 
    color: #3498db; 
    border: 1px solid #aed6f1;
}

/* Form Actions Enhancement */
.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 25px;
    flex-wrap: wrap;
}

@media (max-width: 480px) {
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
}

/* Loading State for Payment */
.payment-processing {
    text-align: center;
    padding: 20px;
    color: #7f8c8d;
}

.payment-processing i {
    font-size: 2rem;
    color: #3498db;
    margin-bottom: 10px;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Responsive Improvements */
@media (max-width: 768px) {
    .loan-payment-history {
        padding: 15px;
    }
    
    .loan-summary {
        padding: 15px;
    }
    
    .payment-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .payment-status {
        align-self: flex-end;
    }
}

/* Touch Improvements for Mobile */
@media (hover: none) and (pointer: coarse) {
    .loan-actions .btn {
        min-height: 48px;
        font-size: 0.9rem;
    }
    
    .payment-item {
        padding: 18px 15px;
    }
}

/* Print Styles for Payment History */
@media print {
    .loan-payment-history {
        padding: 0;
    }
    
    .modal-header,
    .form-actions,
    .btn {
        display: none !important;
    }
    
    .payment-list {
        max-height: none;
        overflow: visible;
    }
    
    .payment-item {
        break-inside: avoid;
        border: 1px solid #ddd;
        margin-bottom: 5px;
    }
}








/* Variables for easy theme tweaks */
:root{
  --nav-bg1: #2c3e50;
  --nav-bg2: #34495e;
  --accent: #f39c12;
  --text: #ffffff;
}

/* Strongly target the navbar by id + class (if your nav has id="navbar") */
nav#navbar.navbar {
  background: linear-gradient(135deg, var(--nav-bg1) 0%, var(--nav-bg2) 100%) !important;
  color: var(--text) !important;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1) !important;
}

/* Ensure anchors inside nav-items inherit correct color & remove default link styles */
nav#navbar.navbar .nav-item,
nav#navbar.navbar .nav-item > a {
  color: var(--text) !important;
  background: transparent !important;
  border-bottom-color: transparent !important;
  text-decoration: none !important;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
}

/* Hover and active */
nav#navbar.navbar .nav-item:hover,
nav#navbar.navbar .nav-item:hover > a {
  background: rgba(255,255,255,0.08) !important;
  color: var(--text) !important;
  border-bottom-color: var(--accent) !important;
}

nav#navbar.navbar .nav-item.active,
nav#navbar.navbar .nav-item.active > a {
  background: rgba(255,255,255,0.12) !important;
  color: var(--text) !important;
  border-bottom-color: var(--accent) !important;
}

/* If your nav uses <li><a>, also target that pattern */
nav#navbar.navbar li.nav-item a {
  color: var(--text) !important;
}

/* Per-item colors (Dashboard/Profile/Loans/Logout) - set on hover/active */
.nav-item.dashboard:hover,
.nav-item.dashboard.active { border-bottom-color: #3498db !important; } /* blue */
.nav-item.profile:hover,
.nav-item.profile.active   { border-bottom-color: #2ecc71 !important; } /* green */
.nav-item.loans:hover,
.nav-item.loans.active     { border-bottom-color: #e67e22 !important; } /* orange */
.nav-item.logout:hover,
.nav-item.logout.active    { border-bottom-color: #e74c3c !important; } /* red */

/* Make logout stand out (optional) */
.nav-item.logout:hover,
.nav-item.logout.active > a {
  color: #fff !important;
  background: rgba(231,76,60,0.08) !important;
}

/* Small adjustments for icons */
nav#navbar.navbar .nav-item i {
  color: inherit !important;
}

footer {
  background: #004080;   /* Sacco brand color */
  color: #fff;
  text-align: center;
  padding: 15px 10px;
  font-size: 14px;
}

footer a {
  color: #ffcc00; /* highlight links */
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* Balance Cards */
.balance-cards {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  margin: 30px auto;
  max-width: 900px;
}

.balance-card {
  background: #ffffff;
  border-radius: 15px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  flex: 1 1 250px;
  display: flex;
  align-items: center;
  padding: 20px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border-top: 5px solid #3498db;
}

.balance-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.balance-card.total {
  border-top-color: #f1c40f;
}

.balance-card .balance-icon {
  font-size: 2rem;
  color: #3498db;
  margin-right: 20px;
}

.balance-card .balance-icon.mpesa {
  color: #27ae60;
}

.balance-card .balance-info h3 {
  font-size: 1.1rem;
  color: #2c3e50;
  margin-bottom: 5px;
}

.balance-card .balance-amount {
  font-size: 1.3rem;
  font-weight: bold;
  color: #27ae60;
  margin: 0;
}

/* Responsive layout for mobile */
@media (max-width: 600px) {
  .balance-cards {
    flex-direction: column;
    align-items: center;
  }
  .balance-card {
    width: 90%;
  }
}







/* ===== Welcome Section Styling ===== */
.welcome-section {
    background: linear-gradient(135deg, #f9fbff 0%, #e9efff 100%);
    color: #2c3e50;
    padding: 100px 20px;
    text-align: center;
    font-family: "Poppins", sans-serif;
}

.welcome-section .hero {
    max-width: 900px;
    margin: 0 auto;
}

.welcome-section h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #0052cc;
    margin-bottom: 15px;
}

.welcome-section p {
    font-size: 1.1rem;
    color: #444;
    margin-bottom: 30px;
    line-height: 1.6;
}

.welcome-section .hero-buttons {
    margin-bottom: 50px;
}

.welcome-section .btn {
    padding: 12px 28px;
    border: none;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

/* Primary (Login) Button */
.welcome-section .btn-primary {
    background: linear-gradient(135deg, #0052cc, #003d99);
    color: #fff;
}

.welcome-section .btn-primary:hover {
    background: linear-gradient(135deg, #003d99, #002b80);
    transform: scale(1.05);
}

/* Secondary (Register) Button */
.welcome-section .btn-secondary {
    background: linear-gradient(135deg, #f4b400, #d39e00);
    color: #fff;
}

.welcome-section .btn-secondary:hover {
    background: linear-gradient(135deg, #d39e00, #b38400);
    transform: scale(1.05);
}

/* Features Section */
.hero-features {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 25px;
    margin-top: 40px;
}

.feature {
    background: #ffffff;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    width: 250px;
    transition: all 0.3s ease;
}

.feature:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
}

.feature i {
    font-size: 2rem;
    color: #0052cc;
    margin-bottom: 15px;
}

.feature h3 {
    font-size: 1.2rem;
    color: #2c3e50;
    margin-bottom: 10px;
}

.feature p {
    color: #555;
    font-size: 0.95rem;
    line-height: 1.4;
}


/* Tagline Styling */
.welcome-section .tagline {
    font-size: 1.25rem;
    font-weight: 500;
    color: #003d99;
    background: linear-gradient(90deg, #0052cc, #00b4d8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 35px;
    letter-spacing: 0.3px;
}






/* Enhanced Mobile-First Responsive Styles for SIGNTECH SACCO */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

/* Enhanced Navigation - Mobile First */
.navbar {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 15px;
    max-width: 1200px;
    margin: 0 auto;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.2rem;
    font-weight: bold;
    padding: 12px 0;
}

.nav-brand i {
    color: #f39c12;
    font-size: 1.5rem;
}

.nav-menu {
    display: flex;
    gap: 0;
    align-items: center;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    font-size: 0.9rem;
    white-space: nowrap;
}

.nav-item:hover {
    background: rgba(255,255,255,0.1);
    border-bottom-color: #f39c12;
}

.nav-item.active {
    background: rgba(255,255,255,0.15);
    border-bottom-color: #f39c12;
}

.nav-item i {
    font-size: 1rem;
}

/* Mobile Navigation Improvements */
@media (max-width: 768px) {
    .nav-container {
        padding: 0 10px;
    }
    
    .nav-brand {
        font-size: 1rem;
    }
    
    .nav-brand i {
        font-size: 1.2rem;
    }
    
    .nav-menu {
        gap: 0;
    }
    
    .nav-item {
        padding: 10px 8px;
        font-size: 0.8rem;
        flex-direction: column;
        gap: 2px;
    }
    
    .nav-item span {
        font-size: 0.7rem;
    }
    
    .nav-item i {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .nav-item span {
        display: none;
    }
    
    .nav-item {
        padding: 12px 6px;
    }
}

/* Main Content - Mobile First */
.main-content {
    margin-top: 70px;
    padding: 15px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

@media (min-width: 768px) {
    .main-content {
        padding: 30px;
        margin-top: 80px;
    }
}

/* Sections - Mobile Responsive */
.section {
    display: none;
    animation: fadeIn 0.3s ease;
}

.section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Welcome Section - Mobile Optimized */
.welcome-section {
    background: white;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    text-align: center;
}

.welcome-section h1 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1.8rem;
}

.welcome-section p {
    color: #7f8c8d;
    font-size: 1rem;
}

@media (min-width: 768px) {
    .welcome-section {
        padding: 40px;
        margin-bottom: 30px;
    }
    
    .welcome-section h1 {
        font-size: 2.5rem;
        margin-bottom: 15px;
    }
    
    .welcome-section p {
        font-size: 1.2rem;
    }
}

/* Dashboard Cards - Mobile First Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

@media (min-width: 480px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 768px) {
    .dashboard-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
        margin-bottom: 30px;
    }
}

.dashboard-card {
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.3s ease;
    min-height: 100px;
}

.dashboard-card:hover {
    transform: translateY(-3px);
}

.card-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: white;
    flex-shrink: 0;
}

.card-content {
    flex: 1;
    min-width: 0;
}

.card-content h3 {
    font-size: 1.3rem;
    color: #2c3e50;
    margin-bottom: 5px;
    word-break: break-word;
}

.card-content p {
    color: #7f8c8d;
    font-size: 0.85rem;
}

@media (min-width: 768px) {
    .dashboard-card {
        padding: 25px;
        gap: 20px;
    }
    
    .card-icon {
        width: 60px;
        height: 60px;
        font-size: 1.4rem;
    }
    
    .card-content h3 {
        font-size: 1.5rem;
    }
    
    .card-content p {
        font-size: 0.9rem;
    }
}

/* Action Buttons - Mobile Optimized */
.action-buttons {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

@media (min-width: 480px) {
    .action-buttons {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 768px) {
    .action-buttons {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
        margin-bottom: 30px;
    }
}

.action-btn {
    padding: 15px 20px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    min-height: 50px;
}

@media (min-width: 768px) {
    .action-btn {
        padding: 18px 25px;
        font-size: 1rem;
        min-height: 55px;
    }
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.btn-primary {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: white;
}

.btn-info {
    background: linear-gradient(135deg, #17a2b8, #138496);
    color: white;
}

/* Forms - Mobile First */
.form-container {
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

@media (min-width: 768px) {
    .form-container {
        padding: 30px;
        margin-bottom: 30px;
    }
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #2c3e50;
    font-weight: 500;
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ecf0f1;
    border-radius: 8px;
    font-size: 16px; /* Prevents zoom on iOS */
    transition: border-color 0.3s ease;
    background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* Form Grid for Desktop */
@media (min-width: 768px) {
    .form-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .form-grid .form-group.full-width {
        grid-column: 1 / -1;
    }
}

/* Buttons - Mobile Optimized */
.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    min-height: 44px; /* Touch-friendly minimum */
    width: 100%;
}

@media (min-width: 768px) {
    .btn {
        width: auto;
        padding: 14px 24px;
        font-size: 1rem;
    }
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}

.btn:active {
    transform: translateY(0);
}

/* Transaction History - Mobile Responsive */
.transaction-history {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.transaction-header {
    background: #34495e;
    color: white;
    padding: 15px 20px;
    font-weight: 600;
}

.transaction-list {
    max-height: 400px;
    overflow-y: auto;
}

.transaction-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #ecf0f1;
    gap: 15px;
}

.transaction-item:last-child {
    border-bottom: none;
}

.transaction-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.transaction-details {
    flex: 1;
    min-width: 0;
}

.transaction-details h4 {
    color: #2c3e50;
    margin-bottom: 3px;
    font-size: 0.9rem;
}

.transaction-details p {
    color: #7f8c8d;
    font-size: 0.8rem;
}

.transaction-amount {
    font-weight: bold;
    color: #27ae60;
    font-size: 0.9rem;
    text-align: right;
    flex-shrink: 0;
}

@media (min-width: 768px) {
    .transaction-header {
        padding: 20px 25px;
    }
    
    .transaction-item {
        padding: 18px 25px;
    }
    
    .transaction-details h4 {
        font-size: 1rem;
    }
    
    .transaction-details p {
        font-size: 0.85rem;
    }
    
    .transaction-amount {
        font-size: 1rem;
    }
}

/* Modals - Mobile Responsive */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s ease;
    padding: 10px;
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 15px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideIn 0.3s ease;
}

@media (max-width: 768px) {
    .modal {
        padding: 5px;
    }
    
    .modal-content {
        margin: 2% auto;
        max-height: 95vh;
        width: calc(100% - 10px);
    }
}

@keyframes slideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #ecf0f1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    color: #2c3e50;
    margin: 0;
    font-size: 1.2rem;
}

@media (min-width: 768px) {
    .modal-header {
        padding: 25px;
    }
    
    .modal-header h3 {
        font-size: 1.4rem;
    }
}

.close {
    color: #aaa;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
    padding: 5px;
    line-height: 1;
}

.close:hover {
    color: #e74c3c;
}

.modal form {
    padding: 20px;
}

@media (min-width: 768px) {
    .modal form {
        padding: 25px;
    }
}

/* Loan Section - Mobile Optimized */
.loan-section {
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.loan-section h2 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

@media (min-width: 768px) {
    .loan-section {
        padding: 30px;
        margin-bottom: 30px;
    }
    
    .loan-section h2 {
        font-size: 2rem;
        margin-bottom: 20px;
    }
}

.loan-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

@media (min-width: 480px) {
    .loan-actions {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 768px) {
    .loan-actions {
        gap: 15px;
    }
}

/* Loan Cards */
.loan-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

@media (min-width: 768px) {
    .loan-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

.loan-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    border-left: 4px solid #3498db;
}

.loan-card h4 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.loan-card p {
    color: #7f8c8d;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

/* Status Badges - Mobile Friendly */
.status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    display: inline-block;
}

@media (min-width: 768px) {
    .status-badge {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
}

.status-completed { background: #d5f4e6; color: #27ae60; }
.status-pending { background: #fef9e7; color: #f39c12; }
.status-failed { background: #fadbd8; color: #e74c3c; }
.status-active { background: #d6eaf8; color: #3498db; }

/* Profile Section - Mobile Optimized */
.profile-section {
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.profile-info {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

@media (min-width: 768px) {
    .profile-section {
        padding: 30px;
    }
    
    .profile-info {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

.info-group {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.info-group label {
    display: block;
    color: #7f8c8d;
    font-size: 0.8rem;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-group span {
    color: #2c3e50;
    font-weight: 500;
    font-size: 0.95rem;
}

/* Loading States */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #ecf0f1;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@media (min-width: 768px) {
    .spinner {
        width: 40px;
        height: 40px;
        border-width: 4px;
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Notifications - Mobile Friendly */
.notification {
    position: fixed;
    top: 80px;
    right: 10px;
    left: 10px;
    padding: 15px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 3000;
    animation: slideInDown 0.3s ease;
    text-align: center;
}

@media (min-width: 768px) {
    .notification {
        right: 20px;
        left: auto;
        width: 300px;
        text-align: left;
        animation: slideInRight 0.3s ease;
    }
}

.notification.success { background: #2ecc71; }
.notification.error { background: #e74c3c; }
.notification.warning { background: #f39c12; }
.notification.info { background: #3498db; }

@keyframes slideInDown {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

@keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

/* Color Scheme */
.dashboard-card:nth-child(1) .card-icon { background: linear-gradient(135deg, #3498db, #2980b9); }
.dashboard-card:nth-child(2) .card-icon { background: linear-gradient(135deg, #2ecc71, #27ae60); }
.dashboard-card:nth-child(3) .card-icon { background: linear-gradient(135deg, #f39c12, #e67e22); }

.transaction-icon.individual { background: linear-gradient(135deg, #3498db, #2980b9); }
.transaction-icon.mpesa { background: linear-gradient(135deg, #2ecc71, #27ae60); }

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-10 { margin-bottom: 10px; }
.mb-15 { margin-bottom: 15px; }
.mb-20 { margin-bottom: 20px; }

.mt-10 { margin-top: 10px; }
.mt-15 { margin-top: 15px; }
.mt-20 { margin-top: 20px; }

.hidden { display: none; }
.block { display: block; }

/* Touch Improvements */
@media (hover: none) and (pointer: coarse) {
    .nav-item:hover,
    .dashboard-card:hover,
    .action-btn:hover,
    .btn:hover {
        transform: none;
    }
    
    .nav-item:active,
    .dashboard-card:active,
    .action-btn:active,
    .btn:active {
        transform: scale(0.98);
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .card-icon,
    .transaction-icon {
        border: 1px solid rgba(255,255,255,0.1);
    }
}

/* Landscape Mobile Optimization */
@media (max-height: 500px) and (orientation: landscape) {
    .main-content {
        margin-top: 60px;
        padding: 10px;
    }
    
    .welcome-section {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .welcome-section h1 {
        font-size: 1.5rem;
        margin-bottom: 5px;
    }
    
    .dashboard-grid {
        gap: 10px;
        margin-bottom: 15px;
    }
    
    .dashboard-card {
        padding: 15px;
        min-height: 80px;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .action-buttons,
    .btn,
    .modal {
        display: none !important;
    }
    
    .main-content {
        margin-top: 0;
        padding: 0;
    }
    
    .section {
        display: block !important;
        page-break-inside: avoid;
    }
}


/* Loan Payment Styles */

.loan-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    margin-bottom: 15px;
    border-left: 4px solid #3498db;
}

.loan-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.loan-header h4 {
    color: #2c3e50;
    margin: 0;
    font-size: 1.2rem;
}

.loan-details {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

@media (min-width: 768px) {
    .loan-details {
        grid-template-columns: 1fr 1fr;
    }
}

.loan-info,
.payment-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
}

.loan-info p,
.payment-info p {
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.loan-info p:last-child,
.payment-info p:last-child {
    margin-bottom: 0;
}

.loan-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.loan-actions .btn {
    flex: 1;
    min-width: 140px;
}

@media (min-width: 480px) {
    .loan-actions .btn {
        flex: none;
    }
}

.loan-completed {
    color: #27ae60;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Payment Modal Styles */
.payment-info {
    background: #e8f4fd;
    border: 1px solid #bee5eb;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.payment-info p {
    margin: 0;
    color: #0c5460;
    display: flex;
    align-items: center;
    gap: 8px;
}

.payment-info i {
    color: #17a2b8;
}

.form-group small {
    display: block;
    color: #6c757d;
    font-size: 0.8rem;
    margin-top: 5px;
}

/* Payment History Styles */
.loan-payment-history {
    padding: 20px;
}

.loan-summary {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 25px;
}

.loan-summary h4 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.summary-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

@media (min-width: 480px) {
    .summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 768px) {
    .summary-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.summary-item {
    text-align: center;
    padding: 10px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.summary-item label {
    display: block;
    color: #7f8c8d;
    font-size: 0.8rem;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-item span {
    color: #2c3e50;
    font-weight: bold;
    font-size: 1rem;
}

.payment-history h4 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.payment-list {
    max-height: 400px;
    overflow-y: auto;
}

.payment-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border: 1px solid #ecf0f1;
    border-radius: 8px;
    margin-bottom: 10px;
    background: white;
    gap: 15px;
}

.payment-item:last-child {
    margin-bottom: 0;
}

.payment-details {
    flex: 1;
    min-width: 0;
}

.payment-amount {
    font-weight: bold;
    color: #2c3e50;
    font-size: 1.1rem;
    margin-bottom: 3px;
}

.payment-method {
    color: #3498db;
    font-size: 0.8rem;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 3px;
}

.payment-date {
    color: #7f8c8d;
    font-size: 0.85rem;
    margin-bottom: 3px;
}

.receipt-number {
    color: #27ae60;
    font-size: 0.8rem;
    font-family: monospace;
}

.payment-status {
    flex-shrink: 0;
}

/* Modal Large Variant */
.modal-content.large {
    max-width: 800px;
    width: 95%;
}

@media (min-width: 768px) {
    .modal-content.large {
        width: 90%;
    }
}

/* Enhanced Status Badges */
.status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    display: inline-block;
    letter-spacing: 0.3px;
}

@media (min-width: 768px) {
    .status-badge {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
}

.status-completed { 
    background: #d5f4e6; 
    color: #27ae60; 
    border: 1px solid #a3e6c1;
}

.status-pending { 
    background: #fef9e7; 
    color: #f39c12; 
    border: 1px solid #f7dc6f;
}

.status-failed { 
    background: #fadbd8; 
    color: #e74c3c; 
    border: 1px solid #f1948a;
}

.status-active { 
    background: #d6eaf8; 
    color: #3498db; 
    border: 1px solid #aed6f1;
}

/* Form Actions Enhancement */
.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 25px;
    flex-wrap: wrap;
}

@media (max-width: 480px) {
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
}

/* Loading State for Payment */
.payment-processing {
    text-align: center;
    padding: 20px;
    color: #7f8c8d;
}

.payment-processing i {
    font-size: 2rem;
    color: #3498db;
    margin-bottom: 10px;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Responsive Improvements */
@media (max-width: 768px) {
    .loan-payment-history {
        padding: 15px;
    }
    
    .loan-summary {
        padding: 15px;
    }
    
    .payment-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .payment-status {
        align-self: flex-end;
    }
}

/* Touch Improvements for Mobile */
@media (hover: none) and (pointer: coarse) {
    .loan-actions .btn {
        min-height: 48px;
        font-size: 0.9rem;
    }
    
    .payment-item {
        padding: 18px 15px;
    }
}

/* Print Styles for Payment History */
@media print {
    .loan-payment-history {
        padding: 0;
    }
    
    .modal-header,
    .form-actions,
    .btn {
        display: none !important;
    }
    
    .payment-list {
        max-height: none;
        overflow: visible;
    }
    
    .payment-item {
        break-inside: avoid;
        border: 1px solid #ddd;
        margin-bottom: 5px;
    }
}








/* Variables for easy theme tweaks */
:root{
  --nav-bg1: #2c3e50;
  --nav-bg2: #34495e;
  --accent: #f39c12;
  --text: #ffffff;
}

/* Strongly target the navbar by id + class (if your nav has id="navbar") */
nav#navbar.navbar {
  background: linear-gradient(135deg, var(--nav-bg1) 0%, var(--nav-bg2) 100%) !important;
  color: var(--text) !important;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1) !important;
}

/* Ensure anchors inside nav-items inherit correct color & remove default link styles */
nav#navbar.navbar .nav-item,
nav#navbar.navbar .nav-item > a {
  color: var(--text) !important;
  background: transparent !important;
  border-bottom-color: transparent !important;
  text-decoration: none !important;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
}

/* Hover and active */
nav#navbar.navbar .nav-item:hover,
nav#navbar.navbar .nav-item:hover > a {
  background: rgba(255,255,255,0.08) !important;
  color: var(--text) !important;
  border-bottom-color: var(--accent) !important;
}

nav#navbar.navbar .nav-item.active,
nav#navbar.navbar .nav-item.active > a {
  background: rgba(255,255,255,0.12) !important;
  color: var(--text) !important;
  border-bottom-color: var(--accent) !important;
}

/* If your nav uses <li><a>, also target that pattern */
nav#navbar.navbar li.nav-item a {
  color: var(--text) !important;
}

/* Per-item colors (Dashboard/Profile/Loans/Logout) - set on hover/active */
.nav-item.dashboard:hover,
.nav-item.dashboard.active { border-bottom-color: #3498db !important; } /* blue */
.nav-item.profile:hover,
.nav-item.profile.active   { border-bottom-color: #2ecc71 !important; } /* green */
.nav-item.loans:hover,
.nav-item.loans.active     { border-bottom-color: #e67e22 !important; } /* orange */
.nav-item.logout:hover,
.nav-item.logout.active    { border-bottom-color: #e74c3c !important; } /* red */

/* Make logout stand out (optional) */
.nav-item.logout:hover,
.nav-item.logout.active > a {
  color: #fff !important;
  background: rgba(231,76,60,0.08) !important;
}

/* Small adjustments for icons */
nav#navbar.navbar .nav-item i {
  color: inherit !important;
}

footer {
  background: #004080;   /* Sacco brand color */
  color: #fff;
  text-align: center;
  padding: 15px 10px;
  font-size: 14px;
}

footer a {
  color: #ffcc00; /* highlight links */
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* Balance Cards */
.balance-cards {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  margin: 30px auto;
  max-width: 900px;
}

.balance-card {
  background: #ffffff;
  border-radius: 15px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  flex: 1 1 250px;
  display: flex;
  align-items: center;
  padding: 20px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border-top: 5px solid #3498db;
}

.balance-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.balance-card.total {
  border-top-color: #f1c40f;
}

.balance-card .balance-icon {
  font-size: 2rem;
  color: #3498db;
  margin-right: 20px;
}

.balance-card .balance-icon.mpesa {
  color: #27ae60;
}

.balance-card .balance-info h3 {
  font-size: 1.1rem;
  color: #2c3e50;
  margin-bottom: 5px;
}

.balance-card .balance-amount {
  font-size: 1.3rem;
  font-weight: bold;
  color: #27ae60;
  margin: 0;
}

/* Responsive layout for mobile */
@media (max-width: 600px) {
  .balance-cards {
    flex-direction: column;
    align-items: center;
  }
  .balance-card {
    width: 90%;
  }
}







/* ===== Welcome Section Styling ===== */
.welcome-section {
    background: linear-gradient(135deg, #f9fbff 0%, #e9efff 100%);
    color: #2c3e50;
    padding: 100px 20px;
    text-align: center;
    font-family: "Poppins", sans-serif;
}

.welcome-section .hero {
    max-width: 900px;
    margin: 0 auto;
}

.welcome-section h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #0052cc;
    margin-bottom: 15px;
}

.welcome-section p {
    font-size: 1.1rem;
    color: #444;
    margin-bottom: 30px;
    line-height: 1.6;
}

.welcome-section .hero-buttons {
    margin-bottom: 50px;
}

.welcome-section .btn {
    padding: 12px 28px;
    border: none;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

/* Primary (Login) Button */
.welcome-section .btn-primary {
    background: linear-gradient(135deg, #0052cc, #003d99);
    color: #fff;
}

.welcome-section .btn-primary:hover {
    background: linear-gradient(135deg, #003d99, #002b80);
    transform: scale(1.05);
}

/* Secondary (Register) Button */
.welcome-section .btn-secondary {
    background: linear-gradient(135deg, #f4b400, #d39e00);
    color: #fff;
}

.welcome-section .btn-secondary:hover {
    background: linear-gradient(135deg, #d39e00, #b38400);
    transform: scale(1.05);
}

/* Features Section */
.hero-features {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 25px;
    margin-top: 40px;
}

.feature {
    background: #ffffff;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    width: 250px;
    transition: all 0.3s ease;
}

.feature:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
}

.feature i {
    font-size: 2rem;
    color: #0052cc;
    margin-bottom: 15px;
}

.feature h3 {
    font-size: 1.2rem;
    color: #2c3e50;
    margin-bottom: 10px;
}

.feature p {
    color: #555;
    font-size: 0.95rem;
    line-height: 1.4;
}


/* Tagline Styling */
.welcome-section .tagline {
    font-size: 1.25rem;
    font-weight: 500;
    color: #003d99;
    background: linear-gradient(90deg, #0052cc, #00b4d8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 35px;
    letter-spacing: 0.3px;
}




/* Enhanced Mobile-First Responsive Styles for SIGNTECH SACCO */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

/* Enhanced Navigation - Mobile First */
.navbar {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 15px;
    max-width: 1200px;
    margin: 0 auto;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.2rem;
    font-weight: bold;
    padding: 12px 0;
}

.nav-brand i {
    color: #f39c12;
    font-size: 1.5rem;
}

.nav-menu {
    display: flex;
    gap: 0;
    align-items: center;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    font-size: 0.9rem;
    white-space: nowrap;
}

.nav-item:hover {
    background: rgba(255,255,255,0.1);
    border-bottom-color: #f39c12;
}

.nav-item.active {
    background: rgba(255,255,255,0.15);
    border-bottom-color: #f39c12;
}

.nav-item i {
    font-size: 1rem;
}

/* Mobile Navigation Improvements */
@media (max-width: 768px) {
    .nav-container {
        padding: 0 10px;
    }
    
    .nav-brand {
        font-size: 1rem;
    }
    
    .nav-brand i {
        font-size: 1.2rem;
    }
    
    .nav-menu {
        gap: 0;
    }
    
    .nav-item {
        padding: 10px 8px;
        font-size: 0.8rem;
        flex-direction: column;
        gap: 2px;
    }
    
    .nav-item span {
        font-size: 0.7rem;
    }
    
    .nav-item i {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .nav-item span {
        display: none;
    }
    
    .nav-item {
        padding: 12px 6px;
    }
}

/* Main Content - Mobile First */
.main-content {
    margin-top: 70px;
    padding: 15px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

@media (min-width: 768px) {
    .main-content {
        padding: 30px;
        margin-top: 80px;
    }
}

/* Sections - Mobile Responsive */
.section {
    display: none;
    animation: fadeIn 0.3s ease;
}

.section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Welcome Section - Mobile Optimized */
.welcome-section {
    background: white;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    text-align: center;
}

.welcome-section h1 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1.8rem;
}

.welcome-section p {
    color: #7f8c8d;
    font-size: 1rem;
}

@media (min-width: 768px) {
    .welcome-section {
        padding: 40px;
        margin-bottom: 30px;
    }
    
    .welcome-section h1 {
        font-size: 2.5rem;
        margin-bottom: 15px;
    }
    
    .welcome-section p {
        font-size: 1.2rem;
    }
}

/* Dashboard Cards - Mobile First Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

@media (min-width: 480px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 768px) {
    .dashboard-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
        margin-bottom: 30px;
    }
}

.dashboard-card {
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.3s ease;
    min-height: 100px;
}

.dashboard-card:hover {
    transform: translateY(-3px);
}

.card-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: white;
    flex-shrink: 0;
}

.card-content {
    flex: 1;
    min-width: 0;
}

.card-content h3 {
    font-size: 1.3rem;
    color: #2c3e50;
    margin-bottom: 5px;
    word-break: break-word;
}

.card-content p {
    color: #7f8c8d;
    font-size: 0.85rem;
}

@media (min-width: 768px) {
    .dashboard-card {
        padding: 25px;
        gap: 20px;
    }
    
    .card-icon {
        width: 60px;
        height: 60px;
        font-size: 1.4rem;
    }
    
    .card-content h3 {
        font-size: 1.5rem;
    }
    
    .card-content p {
        font-size: 0.9rem;
    }
}

/* Action Buttons - Mobile Optimized */
.action-buttons {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

@media (min-width: 480px) {
    .action-buttons {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 768px) {
    .action-buttons {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
        margin-bottom: 30px;
    }
}

.action-btn {
    padding: 15px 20px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    min-height: 50px;
}

@media (min-width: 768px) {
    .action-btn {
        padding: 18px 25px;
        font-size: 1rem;
        min-height: 55px;
    }
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.btn-primary {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: white;
}

.btn-info {
    background: linear-gradient(135deg, #17a2b8, #138496);
    color: white;
}

/* Forms - Mobile First */
.form-container {
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

@media (min-width: 768px) {
    .form-container {
        padding: 30px;
        margin-bottom: 30px;
    }
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #2c3e50;
    font-weight: 500;
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ecf0f1;
    border-radius: 8px;
    font-size: 16px; /* Prevents zoom on iOS */
    transition: border-color 0.3s ease;
    background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* Form Grid for Desktop */
@media (min-width: 768px) {
    .form-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .form-grid .form-group.full-width {
        grid-column: 1 / -1;
    }
}

/* Buttons - Mobile Optimized */
.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    min-height: 44px; /* Touch-friendly minimum */
    width: 100%;
}

@media (min-width: 768px) {
    .btn {
        width: auto;
        padding: 14px 24px;
        font-size: 1rem;
    }
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}

.btn:active {
    transform: translateY(0);
}

/* Transaction History - Mobile Responsive */
.transaction-history {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.transaction-header {
    background: #34495e;
    color: white;
    padding: 15px 20px;
    font-weight: 600;
}

.transaction-list {
    max-height: 400px;
    overflow-y: auto;
}

.transaction-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #ecf0f1;
    gap: 15px;
}

.transaction-item:last-child {
    border-bottom: none;
}

.transaction-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.transaction-details {
    flex: 1;
    min-width: 0;
}

.transaction-details h4 {
    color: #2c3e50;
    margin-bottom: 3px;
    font-size: 0.9rem;
}

.transaction-details p {
    color: #7f8c8d;
    font-size: 0.8rem;
}

.transaction-amount {
    font-weight: bold;
    color: #27ae60;
    font-size: 0.9rem;
    text-align: right;
    flex-shrink: 0;
}

@media (min-width: 768px) {
    .transaction-header {
        padding: 20px 25px;
    }
    
    .transaction-item {
        padding: 18px 25px;
    }
    
    .transaction-details h4 {
        font-size: 1rem;
    }
    
    .transaction-details p {
        font-size: 0.85rem;
    }
    
    .transaction-amount {
        font-size: 1rem;
    }
}

/* Modals - Mobile Responsive */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s ease;
    padding: 10px;
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 15px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideIn 0.3s ease;
}

@media (max-width: 768px) {
    .modal {
        padding: 5px;
    }
    
    .modal-content {
        margin: 2% auto;
        max-height: 95vh;
        width: calc(100% - 10px);
    }
}

@keyframes slideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #ecf0f1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    color: #2c3e50;
    margin: 0;
    font-size: 1.2rem;
}

@media (min-width: 768px) {
    .modal-header {
        padding: 25px;
    }
    
    .modal-header h3 {
        font-size: 1.4rem;
    }
}

.close {
    color: #aaa;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
    padding: 5px;
    line-height: 1;
}

.close:hover {
    color: #e74c3c;
}

.modal form {
    padding: 20px;
}

@media (min-width: 768px) {
    .modal form {
        padding: 25px;
    }
}

/* Loan Section - Mobile Optimized */
.loan-section {
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.loan-section h2 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

@media (min-width: 768px) {
    .loan-section {
        padding: 30px;
        margin-bottom: 30px;
    }
    
    .loan-section h2 {
        font-size: 2rem;
        margin-bottom: 20px;
    }
}

.loan-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

@media (min-width: 480px) {
    .loan-actions {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 768px) {
    .loan-actions {
        gap: 15px;
    }
}

/* Loan Cards */
.loan-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

@media (min-width: 768px) {
    .loan-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

.loan-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    border-left: 4px solid #3498db;
}

.loan-card h4 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.loan-card p {
    color: #7f8c8d;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

/* Status Badges - Mobile Friendly */
.status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    display: inline-block;
}

@media (min-width: 768px) {
    .status-badge {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
}

.status-completed { background: #d5f4e6; color: #27ae60; }
.status-pending { background: #fef9e7; color: #f39c12; }
.status-failed { background: #fadbd8; color: #e74c3c; }
.status-active { background: #d6eaf8; color: #3498db; }

/* Profile Section - Mobile Optimized */
.profile-section {
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.profile-info {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

@media (min-width: 768px) {
    .profile-section {
        padding: 30px;
    }
    
    .profile-info {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

.info-group {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.info-group label {
    display: block;
    color: #7f8c8d;
    font-size: 0.8rem;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-group span {
    color: #2c3e50;
    font-weight: 500;
    font-size: 0.95rem;
}

/* Loading States */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #ecf0f1;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@media (min-width: 768px) {
    .spinner {
        width: 40px;
        height: 40px;
        border-width: 4px;
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Notifications - Mobile Friendly */
.notification {
    position: fixed;
    top: 80px;
    right: 10px;
    left: 10px;
    padding: 15px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 3000;
    animation: slideInDown 0.3s ease;
    text-align: center;
}

@media (min-width: 768px) {
    .notification {
        right: 20px;
        left: auto;
        width: 300px;
        text-align: left;
        animation: slideInRight 0.3s ease;
    }
}

.notification.success { background: #2ecc71; }
.notification.error { background: #e74c3c; }
.notification.warning { background: #f39c12; }
.notification.info { background: #3498db; }

@keyframes slideInDown {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

@keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

/* Color Scheme */
.dashboard-card:nth-child(1) .card-icon { background: linear-gradient(135deg, #3498db, #2980b9); }
.dashboard-card:nth-child(2) .card-icon { background: linear-gradient(135deg, #2ecc71, #27ae60); }
.dashboard-card:nth-child(3) .card-icon { background: linear-gradient(135deg, #f39c12, #e67e22); }

.transaction-icon.individual { background: linear-gradient(135deg, #3498db, #2980b9); }
.transaction-icon.mpesa { background: linear-gradient(135deg, #2ecc71, #27ae60); }

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-10 { margin-bottom: 10px; }
.mb-15 { margin-bottom: 15px; }
.mb-20 { margin-bottom: 20px; }

.mt-10 { margin-top: 10px; }
.mt-15 { margin-top: 15px; }
.mt-20 { margin-top: 20px; }

.hidden { display: none; }
.block { display: block; }

/* Touch Improvements */
@media (hover: none) and (pointer: coarse) {
    .nav-item:hover,
    .dashboard-card:hover,
    .action-btn:hover,
    .btn:hover {
        transform: none;
    }
    
    .nav-item:active,
    .dashboard-card:active,
    .action-btn:active,
    .btn:active {
        transform: scale(0.98);
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .card-icon,
    .transaction-icon {
        border: 1px solid rgba(255,255,255,0.1);
    }
}

/* Landscape Mobile Optimization */
@media (max-height: 500px) and (orientation: landscape) {
    .main-content {
        margin-top: 60px;
        padding: 10px;
    }
    
    .welcome-section {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .welcome-section h1 {
        font-size: 1.5rem;
        margin-bottom: 5px;
    }
    
    .dashboard-grid {
        gap: 10px;
        margin-bottom: 15px;
    }
    
    .dashboard-card {
        padding: 15px;
        min-height: 80px;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .action-buttons,
    .btn,
    .modal {
        display: none !important;
    }
    
    .main-content {
        margin-top: 0;
        padding: 0;
    }
    
    .section {
        display: block !important;
        page-break-inside: avoid;
    }
}


/* Loan Payment Styles */

.loan-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    margin-bottom: 15px;
    border-left: 4px solid #3498db;
}

.loan-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.loan-header h4 {
    color: #2c3e50;
    margin: 0;
    font-size: 1.2rem;
}

.loan-details {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

@media (min-width: 768px) {
    .loan-details {
        grid-template-columns: 1fr 1fr;
    }
}

.loan-info,
.payment-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
}

.loan-info p,
.payment-info p {
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.loan-info p:last-child,
.payment-info p:last-child {
    margin-bottom: 0;
}

.loan-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.loan-actions .btn {
    flex: 1;
    min-width: 140px;
}

@media (min-width: 480px) {
    .loan-actions .btn {
        flex: none;
    }
}

.loan-completed {
    color: #27ae60;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Payment Modal Styles */
.payment-info {
    background: #e8f4fd;
    border: 1px solid #bee5eb;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.payment-info p {
    margin: 0;
    color: #0c5460;
    display: flex;
    align-items: center;
    gap: 8px;
}

.payment-info i {
    color: #17a2b8;
}

.form-group small {
    display: block;
    color: #6c757d;
    font-size: 0.8rem;
    margin-top: 5px;
}

/* Payment History Styles */
.loan-payment-history {
    padding: 20px;
}

.loan-summary {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 25px;
}

.loan-summary h4 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.summary-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

@media (min-width: 480px) {
    .summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 768px) {
    .summary-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.summary-item {
    text-align: center;
    padding: 10px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.summary-item label {
    display: block;
    color: #7f8c8d;
    font-size: 0.8rem;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-item span {
    color: #2c3e50;
    font-weight: bold;
    font-size: 1rem;
}

.payment-history h4 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.payment-list {
    max-height: 400px;
    overflow-y: auto;
}

.payment-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border: 1px solid #ecf0f1;
    border-radius: 8px;
    margin-bottom: 10px;
    background: white;
    gap: 15px;
}

.payment-item:last-child {
    margin-bottom: 0;
}

.payment-details {
    flex: 1;
    min-width: 0;
}

.payment-amount {
    font-weight: bold;
    color: #2c3e50;
    font-size: 1.1rem;
    margin-bottom: 3px;
}

.payment-method {
    color: #3498db;
    font-size: 0.8rem;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 3px;
}

.payment-date {
    color: #7f8c8d;
    font-size: 0.85rem;
    margin-bottom: 3px;
}

.receipt-number {
    color: #27ae60;
    font-size: 0.8rem;
    font-family: monospace;
}

.payment-status {
    flex-shrink: 0;
}

/* Modal Large Variant */
.modal-content.large {
    max-width: 800px;
    width: 95%;
}

@media (min-width: 768px) {
    .modal-content.large {
        width: 90%;
    }
}

/* Enhanced Status Badges */
.status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    display: inline-block;
    letter-spacing: 0.3px;
}

@media (min-width: 768px) {
    .status-badge {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
}

.status-completed { 
    background: #d5f4e6; 
    color: #27ae60; 
    border: 1px solid #a3e6c1;
}

.status-pending { 
    background: #fef9e7; 
    color: #f39c12; 
    border: 1px solid #f7dc6f;
}

.status-failed { 
    background: #fadbd8; 
    color: #e74c3c; 
    border: 1px solid #f1948a;
}

.status-active { 
    background: #d6eaf8; 
    color: #3498db; 
    border: 1px solid #aed6f1;
}

/* Form Actions Enhancement */
.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 25px;
    flex-wrap: wrap;
}

@media (max-width: 480px) {
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
}

/* Loading State for Payment */
.payment-processing {
    text-align: center;
    padding: 20px;
    color: #7f8c8d;
}

.payment-processing i {
    font-size: 2rem;
    color: #3498db;
    margin-bottom: 10px;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Responsive Improvements */
@media (max-width: 768px) {
    .loan-payment-history {
        padding: 15px;
    }
    
    .loan-summary {
        padding: 15px;
    }
    
    .payment-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .payment-status {
        align-self: flex-end;
    }
}

/* Touch Improvements for Mobile */
@media (hover: none) and (pointer: coarse) {
    .loan-actions .btn {
        min-height: 48px;
        font-size: 0.9rem;
    }
    
    .payment-item {
        padding: 18px 15px;
    }
}

/* Print Styles for Payment History */
@media print {
    .loan-payment-history {
        padding: 0;
    }
    
    .modal-header,
    .form-actions,
    .btn {
        display: none !important;
    }
    
    .payment-list {
        max-height: none;
        overflow: visible;
    }
    
    .payment-item {
        break-inside: avoid;
        border: 1px solid #ddd;
        margin-bottom: 5px;
    }
}








/* Variables for easy theme tweaks */
:root{
  --nav-bg1: #2c3e50;
  --nav-bg2: #34495e;
  --accent: #f39c12;
  --text: #ffffff;
}

/* Strongly target the navbar by id + class (if your nav has id="navbar") */
nav#navbar.navbar {
  background: linear-gradient(135deg, var(--nav-bg1) 0%, var(--nav-bg2) 100%) !important;
  color: var(--text) !important;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1) !important;
}

/* Ensure anchors inside nav-items inherit correct color & remove default link styles */
nav#navbar.navbar .nav-item,
nav#navbar.navbar .nav-item > a {
  color: var(--text) !important;
  background: transparent !important;
  border-bottom-color: transparent !important;
  text-decoration: none !important;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
}

/* Hover and active */
nav#navbar.navbar .nav-item:hover,
nav#navbar.navbar .nav-item:hover > a {
  background: rgba(255,255,255,0.08) !important;
  color: var(--text) !important;
  border-bottom-color: var(--accent) !important;
}

nav#navbar.navbar .nav-item.active,
nav#navbar.navbar .nav-item.active > a {
  background: rgba(255,255,255,0.12) !important;
  color: var(--text) !important;
  border-bottom-color: var(--accent) !important;
}

/* If your nav uses <li><a>, also target that pattern */
nav#navbar.navbar li.nav-item a {
  color: var(--text) !important;
}

/* Per-item colors (Dashboard/Profile/Loans/Logout) - set on hover/active */
.nav-item.dashboard:hover,
.nav-item.dashboard.active { border-bottom-color: #3498db !important; } /* blue */
.nav-item.profile:hover,
.nav-item.profile.active   { border-bottom-color: #2ecc71 !important; } /* green */
.nav-item.loans:hover,
.nav-item.loans.active     { border-bottom-color: #e67e22 !important; } /* orange */
.nav-item.logout:hover,
.nav-item.logout.active    { border-bottom-color: #e74c3c !important; } /* red */

/* Make logout stand out (optional) */
.nav-item.logout:hover,
.nav-item.logout.active > a {
  color: #fff !important;
  background: rgba(231,76,60,0.08) !important;
}

/* Small adjustments for icons */
nav#navbar.navbar .nav-item i {
  color: inherit !important;
}

footer {
  background: #004080;   /* Sacco brand color */
  color: #fff;
  text-align: center;
  padding: 15px 10px;
  font-size: 14px;
}

footer a {
  color: #ffcc00; /* highlight links */
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* Balance Cards */
.balance-cards {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  margin: 30px auto;
  max-width: 900px;
}

.balance-card {
  background: #ffffff;
  border-radius: 15px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  flex: 1 1 250px;
  display: flex;
  align-items: center;
  padding: 20px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border-top: 5px solid #3498db;
}

.balance-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.balance-card.total {
  border-top-color: #f1c40f;
}

.balance-card .balance-icon {
  font-size: 2rem;
  color: #3498db;
  margin-right: 20px;
}

.balance-card .balance-icon.mpesa {
  color: #27ae60;
}

.balance-card .balance-info h3 {
  font-size: 1.1rem;
  color: #2c3e50;
  margin-bottom: 5px;
}

.balance-card .balance-amount {
  font-size: 1.3rem;
  font-weight: bold;
  color: #27ae60;
  margin: 0;
}

/* Responsive layout for mobile */
@media (max-width: 600px) {
  .balance-cards {
    flex-direction: column;
    align-items: center;
  }
  .balance-card {
    width: 90%;
  }
}







/* ===== Welcome Section Styling ===== */
.welcome-section {
    background: linear-gradient(135deg, #f9fbff 0%, #e9efff 100%);
    color: #2c3e50;
    padding: 100px 20px;
    text-align: center;
    font-family: "Poppins", sans-serif;
}

.welcome-section .hero {
    max-width: 900px;
    margin: 0 auto;
}

.welcome-section h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #0052cc;
    margin-bottom: 15px;
}

.welcome-section p {
    font-size: 1.1rem;
    color: #444;
    margin-bottom: 30px;
    line-height: 1.6;
}

.welcome-section .hero-buttons {
    margin-bottom: 50px;
}

.welcome-section .btn {
    padding: 12px 28px;
    border: none;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

/* Primary (Login) Button */
.welcome-section .btn-primary {
    background: linear-gradient(135deg, #0052cc, #003d99);
    color: #fff;
}

.welcome-section .btn-primary:hover {
    background: linear-gradient(135deg, #003d99, #002b80);
    transform: scale(1.05);
}

/* Secondary (Register) Button */
.welcome-section .btn-secondary {
    background: linear-gradient(135deg, #f4b400, #d39e00);
    color: #fff;
}

.welcome-section .btn-secondary:hover {
    background: linear-gradient(135deg, #d39e00, #b38400);
    transform: scale(1.05);
}

/* Features Section */
.hero-features {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 25px;
    margin-top: 40px;
}

.feature {
    background: #ffffff;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    width: 250px;
    transition: all 0.3s ease;
}

.feature:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
}

.feature i {
    font-size: 2rem;
    color: #0052cc;
    margin-bottom: 15px;
}

.feature h3 {
    font-size: 1.2rem;
    color: #2c3e50;
    margin-bottom: 10px;
}

.feature p {
    color: #555;
    font-size: 0.95rem;
    line-height: 1.4;
}


/* Tagline Styling */
.welcome-section .tagline {
    font-size: 1.25rem;
    font-weight: 500;
    color: #003d99;
    background: linear-gradient(90deg, #0052cc, #00b4d8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 35px;
    letter-spacing: 0.3px;
}




/* --- Desktop & Laptop Styling (min-width: 992px) --- */
@media (min-width: 992px) {

    /* Center and enlarge the form area */
    .auth-container {
        background: radial-gradient(circle at top left, #e0e7ff, #f4f4f9);
        display: flex;
        justify-content: center;
        align-items: center;
        min-height: 100vh;
        padding: 50px;
    }

    /* LOGIN / REGISTER FORM */
    .auth-box {
        width: 480px;
        background: #ffffff;
        border-radius: 20px;
        padding: 50px 40px;
        box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
        transition: all 0.4s ease-in-out;
        transform: scale(1);
    }

    .auth-box:hover {
        transform: scale(1.02);
        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
    }

    .auth-box h2 {
        font-size: 2rem;
        color: #2b2d42;
        text-transform: uppercase;
        letter-spacing: 1px;
        margin-bottom: 20px;
    }

    .auth-box p {
        font-size: 1rem;
        color: #5c5c5c;
        margin-bottom: 35px;
    }

    .auth-form input {
        padding: 15px;
        border: 2px solid #dfe4ea;
        font-size: 1rem;
        border-radius: 10px;
        transition: all 0.3s ease;
    }

    .auth-form input:focus {
        border-color: #4c6ef5;
        box-shadow: 0 0 8px rgba(76, 110, 245, 0.4);
    }

    .auth-btn {
        background: linear-gradient(135deg, #4c6ef5, #364fc7);
        font-size: 1.1rem;
        padding: 14px 0;
        border-radius: 10px;
        transition: all 0.3s ease;
    }

    .auth-btn:hover {
        background: linear-gradient(135deg, #364fc7, #243665);
        transform: translateY(-2px);
    }

    /* LOGOUT BOX */
    .logout-box {
        background: #ffffff;
        border-radius: 20px;
        padding: 60px 40px;
        max-width: 500px;
        margin: 120px auto;
        text-align: center;
        box-shadow: 0 10px 35px rgba(0, 0, 0, 0.1);
        transition: transform 0.3s ease;
    }

    .logout-box:hover {
        transform: scale(1.03);
    }

    .logout-box h2 {
        color: #22223b;
        font-size: 1.8rem;
        margin-bottom: 15px;
    }

    .logout-box p {
        color: #4a4e69;
        font-size: 1rem;
        margin-bottom: 25px;
    }

    .logout-btn {
        padding: 14px 35px;
        background: linear-gradient(135deg, #e63946, #b92b27);
        border-radius: 10px;
        font-size: 1rem;
        color: white;
        font-weight: 600;
        transition: all 0.3s ease;
    }

    .logout-btn:hover {
        background: linear-gradient(135deg, #b92b27, #831d1c);
        transform: translateY(-2px);
    }
}


@media (min-width: 992px) {
  .auth-layout {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 60px;
    min-height: 100vh;
    background: linear-gradient(135deg, #f9fbff, #eaf1ff);
    padding: 60px;
  }

  .auth-form-box {
    background: #fff;
    padding: 50px 40px;
    border-radius: 20px;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.15);
    width: 400px;
  }

  .auth-form-box h2 {
    color: #004aad;
    margin-bottom: 20px;
  }

  .auth-form-box .form-group {
    margin-bottom: 18px;
  }

  .auth-form-box label {
    display: block;
    color: #333;
    margin-bottom: 6px;
    font-weight: 600;
  }

  .auth-form-box input {
    width: 100%;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid #ccc;
    outline: none;
    transition: 0.3s;
  }

  .auth-form-box input:focus {
    border-color: #004aad;
    box-shadow: 0 0 6px rgba(0, 74, 173, 0.2);
  }

  .auth-promo {
    background: linear-gradient(135deg, #004aad, #0078ff);
    color: #fff;
    padding: 40px;
    border-radius: 20px;
    width: 420px;
    text-align: center;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
  }

  .auth-promo h3 {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 10px;
  }

  .auth-promo span {
    color: #ffcb05;
  }

  .auth-promo p {
    font-size: 1rem;
    margin-bottom: 20px;
    color: #f0f5ff;
  }

  .auth-promo img {
    width: 100%;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
  }

  .btn-full {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    border-radius: 10px;
    border: none;
    cursor: pointer;
  }

  .btn-primary {
    background: linear-gradient(135deg, #004aad, #0078ff);
    color: #fff;
  }

  .btn-secondary {
    background: linear-gradient(135deg, #ffcb05, #e6b800);
    color: #003366;
  }

  .btn-primary:hover, .btn-secondary:hover {
    transform: scale(1.05);
    transition: all 0.3s ease;
  }
}



/* --- Mobile Styling (max-width: 991px) --- */
@media (max-width: 991px) {
  .auth-layout {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #f9fbff, #eaf1ff);
    min-height: 100vh;
    padding: 30px 15px;
  }

  .auth-form-box {
    width: 100%;
    max-width: 380px;
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.1);
    padding: 35px 25px;
    margin-bottom: 25px;
  }

  .auth-promo {
    order: 2; /* ensures promo appears BELOW the form */
    width: 100%;
    max-width: 380px;
    background: linear-gradient(135deg, #004aad, #0078ff);
    color: #fff;
    border-radius: 15px;
    text-align: center;
    padding: 30px 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
  }

  .auth-promo h3 {
    font-size: 1.4rem;
    margin-bottom: 8px;
  }

  .auth-promo p {
    font-size: 0.95rem;
    margin-bottom: 15px;
    color: #f0f5ff;
  }

  .auth-promo img {
    width: 100%;
    border-radius: 10px;
    margin-top: 10px;
  }

  .btn-full {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    border-radius: 8px;
    border: none;
  }
}

/* ===== PROFILE SECTION: FULL STYLING (SCOPED) ===== */

.profile-section {
    background: #f8fafc;
    padding: 40px 0;
    min-height: 65vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    font-family: 'Segoe UI', Arial, sans-serif;
}

/* Container for profile */
.profile-container {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.08), 0 1.5px 6px rgba(0, 72, 255, 0.05);
    padding: 38px 44px;
    max-width: 430px;
    width: 100%;
    margin: 0 auto;
    transition: box-shadow 0.2s;
    position: relative;
    animation: fadeInProfile 0.8s cubic-bezier(.4,0,.2,1);
}

/* Heading */
.profile-container h2 {
    font-size: 2.1rem;
    font-weight: 700;
    color: #1769aa;
    margin-bottom: 20px;
    text-align: center;
    letter-spacing: 1px;
}

/* Avatar styling */
.profile-avatar {
    display: block;
    margin: 0 auto 18px auto;
    width: 84px;
    height: 84px;
    border-radius: 50%;
    object-fit: cover;
    border: 2.5px solid #1769aa22;
    box-shadow: 0 2px 8px #1769aa13;
}

/* Profile details */
#profile-details {
    font-size: 0.99rem;
    color: #222c3d;
    line-height: 1.45;
    margin-bottom: 24px;
}

/* Each profile line: label and value */
.profile-detail-row {
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
}

.profile-detail-row label,
#profile-details label,
#profile-details .profile-label {
    font-size: 0.93rem;
    font-weight: 500;
    color: #1769aa;
    margin-bottom: 2px;
    display: block;
    letter-spacing: 0.02em;
}

.profile-detail-row .profile-value,
#profile-details .profile-value {
    font-size: 1.01rem;
    font-weight: 400;
    color: #222c3d;
    margin-bottom: 2px;
    display: block;
    word-break: break-word;
}

/* Divider between details and password change */
#change-password-section {
    border-top: 1px solid #e2e8f0;
    padding-top: 24px;
    margin-top: 18px;
}

/* Password change heading */
#change-password-section h3 {
    font-size: 1.16rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 14px;
    text-align: left;
}

/* Form fields */
.profile-field {
    margin-bottom: 18px;
    display: flex;
    flex-direction: column;
}

.profile-field label {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 6px;
    color: #222c3d;
}

.profile-field input[type="password"], 
.profile-field input, 
.profile-field select {
    padding: 10px 12px;
    border: 1.5px solid #dbeafe;
    border-radius: 7px;
    background: #f1f5fb;
    font-size: 1rem;
    outline: none;
    transition: border 0.2s, background 0.2s;
    width: 100%;
    box-sizing: border-box;
}

.profile-field input[type="password"]:focus, 
.profile-field input:focus, 
.profile-field select:focus {
    border-color: #1769aa;
    background: #eef6fe;
}

/* ✅ SCOPED button styling — only affects buttons inside .profile-section */
.profile-section .btn.btn-primary {
    background: linear-gradient(90deg, #1769aa 0%, #1e88e5 100%);
    color: #fff;
    border: none;
    border-radius: 7px;
    padding: 11px 0;
    font-size: 1.08rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    width: 100%;
    margin-top: 10px;
    box-shadow: 0 2px 8px #1769aa13;
}

.profile-section .btn.btn-primary:hover,
.profile-section .btn.btn-primary:focus {
    background: linear-gradient(90deg, #145a8f 0%, #1769aa 100%);
}

/* Feedback messages */
.profile-message {
    margin-top: 8px;
    font-size: 0.97rem;
    color: #d32f2f;
    background: #fff6f6;
    border-left: 4px solid #d32f2f55;
    padding: 6px 12px;
    border-radius: 3px;
}

.profile-message.success {
    color: #1769aa;
    background: #f1f7ff;
    border-left: 4px solid #1769aa66;
}

/* Responsive adjustments */
@media (max-width: 700px) {
    .profile-section {
        padding: 18px 0;
        min-height: 55vh;
    }
    .profile-container {
        padding: 18px 7px;
        max-width: 98vw;
        box-shadow: 0 4px 16px rgba(0,0,0,0.08), 0 1px 3px rgba(0,72,255,0.04);
    }
    .profile-container h2 {
        font-size: 1.35rem;
        margin-bottom: 12px;
    }
    .profile-avatar {
        width: 65px;
        height: 65px;
        margin-bottom: 10px;
    }
    #change-password-section {
        padding-top: 14px;
        margin-top: 10px;
    }
}

@media (max-width: 440px) {
    .profile-section {
        padding: 8px 0;
    }
    .profile-container {
        padding: 6px 2px;
        border-radius: 7px;
    }
    .profile-field label,
    .profile-detail-row label {
        font-size: 0.85rem;
    }
    .profile-field input,
    .profile-detail-row .profile-value {
        font-size: 0.93rem;
    }
    .profile-section .btn.btn-primary {
        font-size: 0.98rem;
        padding: 8px 0;
    }
}

/* Animation */
@keyframes fadeInProfile {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}
