* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background: linear-gradient(135deg, #1e88e5, #1565c0);
    color: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

h1 {
    text-align: center;
    margin-bottom: 5px;
}

.subtitle {
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 20px;
    font-size: 1rem;
}

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

.stat {
    background: rgba(255, 255, 255, 0.1);
    padding: 10px 20px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.stat #savings {
    font-size: 2em;
    font-weight: bold;
    display: block;
    margin-top: 5px;
    color: #1e88e5;
}

.stat #savings.positive {
    color: #2ecc71;  
}

.stat #savings.negative {
    color: #ff8c69;  
}

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

h2 {
    color: #1565c0;
    margin-bottom: 15px;
}

.expense-items {
    display: grid;
    gap: 10px;
}

.expense-item {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 5px;
}

.expense-item .expense-name {
    display: flex;
    align-items: center;
    gap: 8px;
}

.expense-item .expense-icon {
    font-size: 1.2em;
}

.income-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 5px;
}

.income-items {
    display: grid;
    gap: 10px;
    margin-top: 10px;
}

.actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 20px 0;
}

.data-actions {
    display: none;
    gap: 10px;
    justify-content: center;
    margin: 20px 0;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    background: #1e88e5;
    color: white;
    cursor: pointer;
    transition: background 0.3s;
}

.btn:hover {
    background: #1565c0;
}

.month-navigation-section {
    background: linear-gradient(135deg, #1e88e5, #1565c0);
    padding: 15px;
    border-radius: 10px;
    margin: 20px 0;
    text-align: center;
}

.month-controls {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 15px;
    border-radius: 8px;
    margin: 0 auto;
}

.month-controls #month {
    font-size: 1.5em;
    font-weight: bold;
    min-width: 30px;
    text-align: center;
}

.month-controls .btn {
    background: rgba(255, 255, 255, 0.2);
    font-size: 1.2em;
    padding: 8px 15px;
    min-width: 45px;
    border-radius: 8px;
    transition: background 0.3s, transform 0.2s;
}

.month-controls .btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.month-selector {
    padding: 8px;
    border: none;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 1em;
    cursor: pointer;
    margin: 0 10px;
}

.month-selector option {
    background: #1e88e5;
    color: white;
}

.message-box {
    padding: 15px;
    margin: 20px 0;
    border-radius: 5px;
    display: none;
}

.message-box.success {
    background: #c8e6c9;
    color: #2e7d32;
    display: block;
}

.message-box.warning {
    background: #fff3e0;
    color: #f57c00;
    display: block;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
}

.modal-content {
    background: white;
    padding: 20px;
    border-radius: 10px;
    max-width: 500px;
    margin: 50px auto;
}

.decision-option {
    padding: 15px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

.decision-option:hover {
    background: #f5f5f5;
}

.edit-icon {
    cursor: pointer;
    margin-left: 10px;
    color: #1565c0;
}

.add-item {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.input-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

input {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.delete-btn {
    color: #e53935;
    cursor: pointer;
    padding: 5px;
}

.positive-amount {
    color: #2e7d32;
    font-weight: 500;
}

.negative-amount {
    color: #e53935;
    font-weight: 500;
}

.total-income {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    margin: 15px 0;
    text-align: right;
    font-weight: bold;
    color: #2e7d32 !important;
}

.total-expenses {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    margin: 15px 0;
    text-align: right;
    font-weight: bold;
    color: #e53935 !important;
}

.total-row td {
    font-weight: bold;
    border-top: 2px solid #ddd;
}

.total-row td:last-child {
    color: #e53935;
}

.total-selected {
    color: #1565c0 !important;
    font-weight: bold;
}

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

.records-table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}

.records-table th,
.records-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.records-table th {
    background: #f5f5f5;
    font-weight: 600;
}

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

.records-table td:first-child {
    width: 40px;
    text-align: center;
}

.records-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.records-summary {
    margin-top: 15px;
    padding: 10px;
    background: #e3f2fd;
    border-radius: 5px;
    font-weight: bold;
}

.partial-sum {
    background: #e3f2fd;
    padding: 15px;
    margin-top: 10px;
    border-radius: 5px;
    font-weight: bold;
    display: none;
}

.partial-sum.visible {
    display: block;
}

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

.expense-modal-content {
    background: white;
    padding: 20px;
    border-radius: 10px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.entries-list {
    margin: 15px 0;
    max-height: 300px;
    overflow-y: auto;
}

.entry-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    background: #f5f5f5;
    margin: 5px 0;
    border-radius: 5px;
}

.entry-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex: 1;
    margin-right: 10px;
}

.entry-actions {
    display: flex;
    gap: 5px;
}

.edit-entry, .delete-entry {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    font-size: 1.1em;
    transition: transform 0.2s;
}

.edit-entry:hover, .delete-entry:hover {
    transform: scale(1.1);
}

.edit-entry {
    color: #1565c0;
}

.delete-entry {
    color: #e53935;
}

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

.add-entry-form {
    display: flex;
    gap: 10px;
    margin: 15px 0;
    flex-wrap: wrap;
}

.add-entry-form input {
    flex: 1;
    min-width: 120px;
}

.total-amount {
    text-align: right;
    font-weight: bold;
    margin: 15px 0;
}

.more-apps-link {
    display: inline-block;
    color: #1e88e5;
    text-decoration: none;
    margin-top: 10px;
    font-weight: 500;
    transition: color 0.3s;
}

.more-apps-link:hover {
    color: #1565c0;
    text-decoration: underline;
}

footer {
    background: #f8f9fa;
    padding: 20px;
    text-align: center;
    border-radius: 10px;
    margin-top: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.footer-content {
    margin-bottom: 15px;
}

.share-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 10px;
}

.share-btn {
    padding: 8px 15px;
    border: none;
    border-radius: 5px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
    font-size: 0.9em;
}

.share-btn.whatsapp {
    background-color: #25D366;
}

.share-btn.linkedin {
    background-color: #0077B5;
}

.share-btn:hover {
    opacity: 0.9;
}

.chart-section {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    height: 400px;
    position: relative;
}

.records-filter-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
}

.records-filter-controls select,
.records-filter-controls input {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 5px;
    min-width: 120px;
}

.records-filter-controls .btn {
    margin-left: 10px;
    min-width: 120px;
}

.totals-section {
    margin: 15px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 5px;
}

.totals-section p {
    margin: 5px 0;
    font-weight: bold;
}

.totals-section .total-expenses {
    color: #e53935;
}

.totals-section .total-income {
    color: #2e7d32;
}

.totals-section .total-selected {
    color: #1565c0;
}

.goal-status {
    background: white;
    padding: 15px;
    border-radius: 10px;
    margin: 15px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

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

.goal-info span {
    color: #1565c0;  
    font-weight: 600;
}

.goal-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0;
}

.progress-bar {
    flex: 1;
    height: 20px;
    background: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
}

.progress {
    height: 100%;
    background: linear-gradient(90deg, #1e88e5, #1565c0);
    transition: width 0.3s ease;
}

.goal-remaining {
    padding: 10px;
    border-radius: 5px;
    text-align: center;
    font-weight: 500;
}

.goal-remaining.success {
    background: #c8e6c9;
    color: #2e7d32;
}

.goal-remaining.warning {
    background: #fff3e0;
    color: #f57c00;
}

.excel-controls {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.excel-controls .btn {
    flex: 1;
}

.records-table th:last-child,
.records-table td:last-child {
    text-align: right;
    padding-right: 15px;
}

.delete-month-btn {
    background: #e53935;
    margin-top: 10px;
}

.delete-month-btn:hover {
    background: #c62828;
}

.month-navigation-section button.delete-month-btn {
    width: auto;
    min-width: 120px;
    margin: 10px auto 0;
    display: block;
}

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

.welcome-modal-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.welcome-modal h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #1e88e5;
}

.welcome-modal p {
    margin: 15px 0;
    line-height: 1.6;
}

.welcome-modal .feature-section {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
}

.welcome-modal .feature-title {
    font-weight: 600;
    color: #1565c0;
    margin-bottom: 10px;
}

.welcome-modal .btn {
    width: 100%;
    margin-top: 20px;
}

.dont-show-again {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
}

@media (max-width: 600px) {
    .container {
        padding: 10px;
    }
    
    .stats {
        flex-direction: column;
        align-items: center;
    }
    
    .actions {
        flex-direction: column;
    }
    
    .data-actions {
        flex-direction: column;
    }
    
    .data-actions .btn {
        width: 100%;
        text-align: center;
    }
    
    .btn {
        width: 100%;
    }
    
    .modal-content {
        margin: 20px;
        max-width: calc(100% - 40px);
    }
    
    .add-item {
        flex-direction: column;
    }
    
    .input-group {
        flex-wrap: wrap;
    }
    
    input {
        width: 100%;
    }
    
    .expense-modal-content {
        width: 95%;
        margin: 10px;
    }
    
    .add-entry-form {
        flex-direction: column;
    }
    
    .month-controls {
        width: 100%;
        justify-content: center;
    }
    
    .month-navigation-section {
        padding: 10px;
    }
    
    .share-buttons {
        flex-direction: column;
        align-items: center;
    }

    .share-btn {
        width: 100%;
        justify-content: center;
    }
    
    .stat {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        text-align: center;
    }
    
    .stat span {
        font-size: 0.9em;
    }
    
    .subtitle {
        font-size: 0.9rem;
        padding: 0 10px;
    }
    
    .chart-section {
        height: 300px;
    }
    
    .records-table {
        font-size: 0.9em;
    }
    
    .records-table th,
    .records-table td {
        padding: 8px;
    }
    
    .records-filter-controls {
        flex-direction: column;
    }
    
    .records-filter-controls select,
    .records-filter-controls input,
    .records-filter-controls .btn {
        width: 100%;
        margin-left: 0;
    }
    
    .month-selector {
        font-size: 0.9em;
        padding: 6px;
        margin: 5px;
    }
    
    .excel-controls {
        flex-direction: column;
    }
    
    .goal-status {
        padding: 10px;
    }
    
    .goal-info {
        flex-direction: column;
        gap: 5px;
    }
    
    .month-navigation-section button.delete-month-btn {
        width: 100%;
    }
}