/* Reset e Variáveis */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4a90e2;
    --success-color: #7ed957;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --info-color: #4ecdc4;
    --dark-color: #2c3e50;
    --light-color: #ecf0f1;
    --white: #ffffff;
    --gray: #95a5a6;
    --text-color: #2c3e50;
    --border-radius: 12px;
    --box-shadow: 0 4px 15px rgba(74, 144, 226, 0.15);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #4a90e2 0%, #7ed957 100%);
    min-height: 100vh;
    color: var(--text-color);
}

/* Screens */
.screen {
    display: none;
}

.screen.active {
    display: block;
}

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

.login-card {
    background: var(--white);
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    width: 100%;
    max-width: 400px;
}

.login-card h1 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--primary-color);
}

/* Logo Styles */
.logo-container {
    text-align: center;
    margin-bottom: 30px;
}

.logo {
    width: 120px;
    height: 120px;
    margin-bottom: 15px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.logo-container h1 {
    font-size: 32px;
    font-weight: bold;
    background: linear-gradient(135deg, #4a90e2 0%, #7ed957 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

.header-logo {
    width: 40px;
    height: 40px;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--light-color);
    border-radius: var(--border-radius);
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group input[readonly] {
    background-color: #f8f9fa;
    color: #495057;
    cursor: not-allowed;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Password toggle */
.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrapper input {
    padding-right: 40px;
}

.toggle-password {
    position: absolute;
    right: 12px;
    cursor: pointer;
    color: #6c757d;
    transition: color 0.3s;
    user-select: none;
}

.toggle-password:hover {
    color: var(--primary-color);
}

.toggle-password.active {
    color: var(--primary-color);
}

.toggle-auth {
    text-align: center;
    margin-top: 20px;
}

.toggle-auth a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

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

.btn-primary {
    background: var(--primary-color);
    color: var(--white);
    width: 100%;
}

.btn-primary:hover {
    background: #357abd;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.4);
}

.btn-success {
    background: var(--success-color);
    color: var(--white);
}

.btn-danger {
    background: var(--danger-color);
    color: var(--white);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--white);
    color: var(--white);
}

.btn-outline:hover {
    background: var(--white);
    color: var(--primary-color);
}

.btn-small {
    padding: 6px 12px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    background: var(--primary-color);
    color: var(--white);
    transition: all 0.3s;
    margin-left: 10px;
}

.btn-small:hover {
    background: #2980b9;
    transform: translateY(-1px);
}

/* App Screen */
#app-screen {
    background: var(--light-color);
}

/* Header */
.app-header {
    background: linear-gradient(135deg, #4a90e2 0%, #7ed957 100%);
    color: var(--white);
    padding: 20px;
    box-shadow: var(--box-shadow);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-content h1 {
    font-size: 24px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.mobile-menu-btn {
    display: none;
    background: transparent;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 5px 10px;
}

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

/* Navigation */
.app-nav {
    background: var(--white);
    padding: 0 20px;
    box-shadow: var(--box-shadow);
    overflow-x: auto;
    white-space: nowrap;
}

.nav-btn {
    background: transparent;
    border: none;
    padding: 15px 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

.nav-btn:hover {
    color: var(--primary-color);
}

.nav-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.nav-btn i {
    margin-right: 5px;
}

/* Main Content */
.app-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s;
}

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

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

/* Info Box */
.info-box {
    background: linear-gradient(135deg, #e3f2fd 0%, #f1f8e9 100%);
    border-left: 4px solid var(--primary-color);
    padding: 15px 20px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.info-box i {
    color: var(--primary-color);
    font-size: 24px;
}

.info-box p {
    margin: 0;
    color: var(--text-color);
    font-size: 14px;
}

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

.card {
    background: var(--white);
    padding: 25px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    display: flex;
    align-items: center;
    gap: 20px;
}

.card i {
    font-size: 48px;
}

.card-success {
    border-left: 4px solid var(--success-color);
}

.card-success i {
    color: var(--success-color);
}

.card-danger {
    border-left: 4px solid var(--danger-color);
}

.card-danger i {
    color: var(--danger-color);
}

.card-info {
    border-left: none;
}

.card-info i {
    color: var(--info-color);
}

.card-info p {
    margin: 0;
    color: var(--gray);
    font-size: 14px;
}

.card-info h3 {
    margin: 5px 0 0;
    font-size: 24px;
}

/* Lists */
.recent-transactions,
#transactions-list,
#accounts-list {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 20px;
}

.recent-transactions h3 {
    margin-bottom: 15px;
}

.recurring-section {
    margin-bottom: 40px;
}

.recurring-section h3 {
    margin: 0;
    font-size: 1.3rem;
}

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

.expense-color {
    color: #e74c3c;
}

.income-color {
    color: #7ed957;
}

.transaction-item,
.account-item,
.category-item,
.recurring-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid var(--light-color);
}

.transaction-item:last-child,
.account-item:last-child,
.category-item:last-child,
.recurring-item:last-child {
    border-bottom: none;
}

.transaction-info,
.account-info,
.recurring-info {
    flex: 1;
}

.transaction-info h4,
.account-info h4,
.recurring-info h4 {
    margin: 0 0 5px;
}

.transaction-info p,
.account-info p,
.recurring-info p {
    margin: 0;
    color: var(--gray);
    font-size: 13px;
}

.transaction-amount {
    font-size: 18px;
    font-weight: 700;
}

.transaction-amount.income {
    color: var(--success-color);
}

.transaction-amount.expense {
    color: var(--danger-color);
}

/* Filters */
.filters {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filters select {
    padding: 10px;
    border: 2px solid var(--light-color);
    border-radius: var(--border-radius);
    flex: 1;
    min-width: 200px;
}

/* Categories */
.categories-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.category-section {
    background: var(--white);
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.category-section h3 {
    margin-bottom: 15px;
}

.category-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    border-radius: 20px;
    margin: 5px;
    font-size: 14px;
}

/* Upload Area */
.upload-container {
    background: var(--white);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.upload-area {
    border: 3px dashed var(--primary-color);
    border-radius: var(--border-radius);
    padding: 60px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.upload-area:hover {
    background: var(--light-color);
}

.upload-area i {
    font-size: 64px;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.upload-preview {
    text-align: center;
    margin-top: 20px;
}

.upload-preview img {
    max-width: 100%;
    max-height: 400px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
}

.analysis-result {
    background: var(--light-color);
    padding: 20px;
    border-radius: var(--border-radius);
    margin-top: 20px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    animation: fadeIn 0.3s;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal.modal-over-modal {
    z-index: 1100;
    background: rgba(0, 0, 0, 0.7);
}

.modal-content {
    background: var(--white);
    border-radius: var(--border-radius);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--light-color);
}

.modal-header h3 {
    margin: 0;
}

.close-modal {
    background: transparent;
    border: none;
    font-size: 30px;
    cursor: pointer;
    color: var(--gray);
}

.modal-body {
    padding: 20px;
}

.or-divider {
    text-align: center;
    margin: 20px 0;
    color: var(--gray);
    position: relative;
}

.or-divider::before,
.or-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: var(--light-color);
}

.or-divider::before {
    left: 0;
}

.or-divider::after {
    right: 0;
}

#category-selection {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.category-option {
    padding: 10px 15px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.category-option:hover {
    transform: scale(1.05);
}

.category-option.selected {
    border-color: var(--dark-color);
}

/* Menu Mobile Overlay */
.menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.menu-overlay.active {
    display: block;
    opacity: 1;
}

/* Responsive */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }

    .header-content {
        flex-direction: row;
        gap: 15px;
    }

    .header-content h1 {
        font-size: 18px;
    }

    .header-logo {
        width: 32px;
        height: 32px;
    }

    .header-content h1 i {
        display: none;
    }

    .header-actions span {
        display: none;
    }

    .app-nav {
        position: fixed;
        top: 0;
        left: -100%;
        width: 280px;
        height: 100vh;
        background: var(--white);
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
        padding: 80px 0 20px 0;
        overflow-y: auto;
        transition: left 0.3s ease;
        z-index: 1000;
        display: flex;
        flex-direction: column;
    }

    .app-nav.active {
        left: 0;
    }

    .nav-btn {
        width: 100%;
        text-align: left;
        padding: 15px 20px;
        border-bottom: 1px solid #f0f0f0;
        border-left: 3px solid transparent;
        white-space: normal;
    }

    .nav-btn.active {
        border-bottom-color: #f0f0f0;
        border-left-color: var(--primary-color);
        background: #f8f9fa;
    }

    .cards-grid {
        grid-template-columns: 1fr;
    }

    .transaction-item,
    .account-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .filters {
        flex-direction: column;
    }

    .filters select {
        width: 100%;
    }

    .categories-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: 20px;
    }

    .logo {
        width: 80px;
        height: 80px;
    }

    .logo-container h1 {
        font-size: 24px;
    }

    .app-main {
        padding: 15px;
    }

    .nav-btn {
        padding: 10px 12px;
    }

    .nav-btn i {
        margin-right: 0;
    }

    .nav-btn span {
        display: none;
    }
}

/* Loading State */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--light-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Recurring Expenses Specific */
.recurring-due-badge {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    margin-right: 10px;
}

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

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

.recurring-status-badge.inactive {
    background: #f8d7da;
    color: #721c24;
}

.installment-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
}

.installment-badge.progress {
    background: #cfe2ff;
    color: #084298;
}

.installment-badge.completed {
    background: #7ed957;
    color: white;
}

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

.btn-advance {
    background: #4a90e2;
    color: white;
}

.btn-advance:hover {
    background: #357abd;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Alert Messages */
.alert {
    padding: 15px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
}

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

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* Chart Section */
.chart-section {
    background: var(--white);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin: 20px 0;
}

.chart-section h3 {
    margin-bottom: 20px;
    color: var(--text-color);
}

#expenses-chart {
    max-height: 400px;
}

#income-expense-chart,
#comparative-chart {
    max-height: 400px;
}

#category-distribution-chart {
    max-height: 350px;
}

/* Budget Section */
.budget-section {
    background: var(--white);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin: 20px 0;
}

.budget-section h3 {
    margin-bottom: 20px;
    color: var(--text-color);
}

/* Budget Alerts */
.budget-alerts {
    margin-bottom: 20px;
}

/* Category Item with Budget */
.category-item {
    background: var(--white);
    padding: 15px;
    border-radius: var(--border-radius);
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

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

.category-budget {
    margin-top: 10px;
}

.budget-info {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    margin-bottom: 5px;
    color: var(--text-color);
}

.budget-bar {
    height: 10px;
    background: var(--light-color);
    border-radius: 5px;
    overflow: hidden;
}

.budget-progress {
    height: 100%;
    transition: width 0.3s ease;
}

.budget-progress.success {
    background: var(--success-color);
}

.budget-progress.warning {
    background: #f39c12;
}

.budget-progress.danger {
    background: var(--danger-color);
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Deposits Container */
.deposits-container {
    max-width: 1000px;
    margin: 0 auto;
}

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

.deposit-option-card {
    background: var(--white);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.deposit-option-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(74, 144, 226, 0.2);
}

.deposit-option-card i {
    font-size: 48px;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.deposit-option-card h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: var(--dark-color);
}

.deposit-option-card p {
    color: var(--gray);
    margin-bottom: 20px;
    line-height: 1.5;
}

#deposit-upload-section {
    background: var(--white);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 30px;
}

#deposit-upload-section h3 {
    margin-bottom: 20px;
    color: var(--dark-color);
}

.recent-deposits {
    background: var(--white);
    padding: 25px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.recent-deposits h3 {
    margin-bottom: 20px;
    color: var(--dark-color);
}

.deposit-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid var(--light-color);
    transition: background 0.2s ease;
}

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

.deposit-item:hover {
    background: #f8f9fa;
}

.deposit-info {
    flex: 1;
}

.deposit-info h4 {
    margin-bottom: 5px;
    color: var(--dark-color);
}

.deposit-info p {
    font-size: 0.9rem;
    color: var(--gray);
}

.deposit-amount {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--success-color);
}

.deposit-date {
    font-size: 0.85rem;
    color: var(--gray);
    margin-left: 15px;
}

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

.summary-card {
    background: var(--white);
    padding: 25px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    display: flex;
    align-items: center;
    gap: 20px;
}

.summary-card.success {
    background: linear-gradient(135deg, #7ed957 0%, #5cb85c 100%);
    color: white;
}

.summary-card i {
    font-size: 40px;
    color: var(--primary-color);
}

.summary-card.success i {
    color: white;
}

.summary-card p {
    margin: 0 0 5px 0;
    color: var(--gray);
    font-size: 0.9rem;
}

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

.summary-card h3 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--dark-color);
}

.summary-card.success h3 {
    color: white;
}

.investments-list,
.loans-section {
    background: var(--white);
    padding: 25px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 20px;
}

.investments-list h3,
.loans-section h3 {
    margin-bottom: 20px;
    color: var(--dark-color);
}

.investment-item {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 4px solid var(--primary-color);
    transition: transform 0.2s ease;
}

.investment-item:hover {
    transform: translateX(5px);
}

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

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

.investment-title i {
    font-size: 24px;
    color: var(--primary-color);
}

.investment-title h4 {
    margin: 0;
    color: var(--dark-color);
}

.investment-badge {
    background: var(--primary-color);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
}

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

.investment-detail {
    display: flex;
    flex-direction: column;
}

.investment-detail label {
    font-size: 0.85rem;
    color: var(--gray);
    margin-bottom: 3px;
}

.investment-detail span {
    font-weight: 600;
    color: var(--dark-color);
}

.investment-profit {
    color: var(--success-color);
    font-weight: bold;
}

.investment-loss {
    color: var(--danger-color);
    font-weight: bold;
}

.investment-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

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

.loan-item {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 4px solid var(--warning-color);
    transition: transform 0.2s ease;
}

.loan-item.paid {
    border-left-color: var(--success-color);
    opacity: 0.8;
}

.loan-item:hover {
    transform: translateX(5px);
}

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

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

.loan-person i {
    font-size: 28px;
    color: var(--warning-color);
}

.loan-item.paid .loan-person i {
    color: var(--success-color);
}

.loan-person h4 {
    margin: 0;
    color: var(--dark-color);
}

.loan-status-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.loan-status-badge.pending {
    background: #fff3cd;
    color: #856404;
}

.loan-status-badge.partial {
    background: #d1ecf1;
    color: #0c5460;
}

.loan-status-badge.paid {
    background: #d4edda;
    color: #155724;
}

.loan-status-badge.overdue {
    background: #f8d7da;
    color: #721c24;
}

.loan-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.loan-detail {
    display: flex;
    flex-direction: column;
}

.loan-detail label {
    font-size: 0.85rem;
    color: var(--gray);
    margin-bottom: 3px;
}

.loan-detail span {
    font-weight: 600;
    color: var(--dark-color);
}

.loan-progress {
    margin: 15px 0;
}

.loan-progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 0.9rem;
    color: var(--gray);
}

.loan-progress-bar {
    height: 10px;
    background: #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
}

.loan-progress-fill {
    height: 100%;
    background: var(--success-color);
    transition: width 0.3s ease;
}

.loan-notes {
    background: white;
    padding: 10px;
    border-radius: 5px;
    margin: 10px 0;
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
}

.loan-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

/* Reports Section */
.report-filters {
    display: flex;
    gap: 10px;
    align-items: center;
}

.report-filters select {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: white;
    font-size: 14px;
    cursor: pointer;
}

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

.report-table-section {
    background: white;
    padding: 25px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin: 30px 0;
}

.report-table-section h3 {
    margin-bottom: 20px;
    color: var(--text-color);
}

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

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

.report-table thead {
    background: linear-gradient(135deg, var(--primary-color), #357abd);
    color: white;
}

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

.report-table th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

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

.report-table tfoot {
    background: #f8f9fa;
    font-weight: bold;
    border-top: 2px solid var(--primary-color);
}

.report-table tfoot th {
    color: var(--text-color);
}

.report-table .positive {
    color: var(--success-color);
    font-weight: 600;
}

.report-table .negative {
    color: var(--danger-color);
    font-weight: 600;
}

.report-table .neutral {
    color: var(--info-color);
    font-weight: 600;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .investment-summary,
    .loans-summary {
        grid-template-columns: 1fr;
    }
    
    .investment-details,
    .loan-details {
        grid-template-columns: 1fr;
    }

    .report-summary {
        grid-template-columns: 1fr;
    }

    .report-filters {
        flex-direction: column;
        width: 100%;
    }

    .report-filters select,
    .report-filters button {
        width: 100%;
    }

    .report-table {
        font-size: 12px;
    }

    .report-table th,
    .report-table td {
        padding: 8px 10px;
    }
}
