* {
    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;
}

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
}

.login-logo {
    text-align: center;
    margin-bottom: 20px;
}

.login-logo-img {
    width: 100px;
    height: 100px;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15));
    animation: fadeInScale 0.6s ease-out;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.login-box h1 {
    color: #667eea;
    margin-bottom: 10px;
    text-align: center;
    font-size: 28px;
}

.login-box h2 {
    color: #666;
    margin-bottom: 30px;
    text-align: center;
    font-size: 18px;
    font-weight: normal;
}

.form-group {
    margin-bottom: 20px;
}

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

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.btn-primary {
    width: 100%;
    padding: 12px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-secondary {
    padding: 10px 20px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-secondary:hover {
    background: #5a6268;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 12px;
    border-radius: 5px;
    margin-bottom: 20px;
    border: 1px solid #f5c6cb;
}

.success-message {
    background: #d4edda;
    color: #155724;
    padding: 12px;
    border-radius: 5px;
    margin-bottom: 20px;
    border: 1px solid #c3e6cb;
}

.login-info {
    margin-top: 20px;
    text-align: center;
    color: #666;
}

.dashboard {
    min-height: 100vh;
    background: #f5f5f5;
}

.dashboard-header {
    background: white;
    padding: 20px 40px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dashboard-header h1 {
    color: #667eea;
    font-size: 24px;
}

.header-logo-title {
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo-link {
    display: block;
    transition: opacity 0.3s;
}

.logo-link:hover {
    opacity: 0.8;
}

.logo-img {
    height: 60px;
    width: 60px;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.15));
    transition: transform 0.3s;
}

.logo-link:hover .logo-img {
    transform: scale(1.05);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.dashboard-content {
    padding: 40px;
    max-width: 1400px;
    margin: 0 auto;
}

.section {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.section h2 {
    color: #333;
    margin-bottom: 25px;
    font-size: 22px;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

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

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

.table-responsive {
    overflow-x: auto;
}

.loans-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.loans-table th,
.loans-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.loans-table th {
    background: #667eea;
    color: white;
    font-weight: 600;
}

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

.loans-table .highlight {
    color: #28a745;
    font-weight: 600;
}

.loans-table .actions {
    display: flex;
    gap: 10px;
}

.btn-edit {
    padding: 6px 12px;
    background: #ffc107;
    color: #333;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-edit:hover {
    background: #e0a800;
}

.btn-delete {
    padding: 6px 12px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-delete:hover {
    background: #c82333;
}

.no-data {
    text-align: center;
    color: #666;
    padding: 40px;
    font-style: italic;
}

.btn-renegotiate {
    padding: 6px 12px;
    background: #17a2b8;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-renegotiate:hover {
    background: #138496;
}

.btn-pay {
    padding: 6px 12px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-pay:hover {
    background: #218838;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    display: inline-block;
}

.status-ativo {
    background: #d4edda;
    color: #155724;
}

.status-renegociado {
    background: #d1ecf1;
    color: #0c5460;
}

.status-pago {
    background: #cce5ff;
    color: #004085;
}

.status-vencido {
    background: #f8d7da;
    color: #721c24;
}

.status-active {
    background: #d4edda;
    color: #155724;
}

.status-warning {
    background: #fff3cd;
    color: #856404;
}

.status-danger {
    background: #f8d7da;
    color: #721c24;
}

tr.warning {
    background-color: #fff3cd !important;
}

tr.danger {
    background-color: #f8d7da !important;
}

tr.renegotiated {
    background-color: #d1ecf1 !important;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 30px;
    border: 1px solid #888;
    border-radius: 10px;
    width: 90%;
    max-width: 600px;
    position: relative;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    line-height: 20px;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: #000;
}

.installment-preview {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
}

.installment-preview h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 18px;
}

.installment-preview p {
    margin-bottom: 10px;
    font-size: 16px;
}

.notification-actions {
    margin-bottom: 20px;
}

.payment-preview {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
}

.payment-preview.success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
}

.payment-preview.error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
}

.payment-preview.info {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
}

.payment-preview h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 18px;
}

.payment-preview p {
    margin-bottom: 10px;
    font-size: 16px;
}

.payment-message {
    font-weight: 600;
    font-size: 18px;
    margin-bottom: 15px;
}

.final-amount {
    font-size: 20px;
    color: #667eea;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px solid #667eea;
}

.installments-row {
    background: #f8f9fa;
}

.installments-container {
    padding: 20px;
    background: white;
    border-radius: 8px;
    margin: 10px;
}

.installments-container h3 {
    color: #667eea;
    margin-bottom: 15px;
}

.installments-container > p {
    margin-bottom: 10px;
    font-size: 16px;
}

.installments-table {
    width: 100%;
    margin-top: 20px;
    border-collapse: collapse;
}

.installments-table th,
.installments-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.installments-table th {
    background: #667eea;
    color: white;
    font-weight: 600;
}

.installments-table tr:hover {
    background: #f5f5f5;
}

.btn-view {
    padding: 6px 12px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-view:hover {
    background: #5a6268;
}

.btn-pay-installment {
    padding: 6px 12px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-pay-installment:hover {
    background: #218838;
}

.search-form {
    margin-bottom: 30px;
}

.search-container {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 300px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

.search-info {
    margin-bottom: 20px;
    padding: 10px;
    background: #e3f2fd;
    border-left: 4px solid #667eea;
    color: #333;
    font-weight: 500;
}

.paid-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.paid-date {
    color: #28a745;
    font-weight: 600;
    font-size: 14px;
}

.paid-amount {
    color: #667eea;
    font-weight: 600;
    font-size: 14px;
}

.late-interest-info {
    color: #dc3545;
    font-size: 12px;
    font-style: italic;
}

@media (max-width: 768px) {
    .dashboard-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .dashboard-content {
        padding: 20px;
    }
    
    .section {
        padding: 20px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .loans-table {
        font-size: 14px;
    }
    
    .loans-table .actions {
        flex-direction: column;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 20px;
    }
}
