:root {
    --bg-color: #f1f5f9; /* Soft background */
    --surface-color: #ffffff; /* White card backgrounds */
    --text-main: #1e293b; /* Slate 800 */
    --text-muted: #64748b; /* Slate 500 */
    --accent-primary: #10b981; /* Emerald Green */
    --accent-secondary: #3b82f6; /* Blue */
    --accent-danger: #ef4444; /* Red */
    --accent-warning: #f59e0b; /* Amber */
    --border-color: #e2e8f0; /* Slate 200 */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

#app {
    max-width: 600px;
    margin: 0 auto;
    min-height: 100vh;
    background-color: var(--bg-color);
    position: relative;
    padding-bottom: 80px; /* Space for bottom nav */
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 20px 10px 20px;
    background-color: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 10;
}

.back-btn, .settings-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: var(--radius-full);
    transition: background 0.2s;
}

.back-btn:hover, .settings-btn:hover {
    background-color: var(--bg-color);
    color: var(--text-main);
}

.back-btn svg, .settings-btn svg {
    width: 20px;
    height: 20px;
}

.month-selector {
    display: flex;
    align-items: center;
    gap: 15px;
    font-weight: 600;
    font-size: 1.1rem;
}

.month-selector button {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0 10px;
}

/* Dashboard */
.dashboard {
    padding: 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.summary-card {
    background-color: var(--surface-color);
    padding: 20px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-left: 4px solid transparent;
}

.summary-card.cash {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #1e293b, #0f172a);
    color: white;
}

.summary-card.cash .label {
    color: #94a3b8;
}

.summary-card.income {
    border-left-color: var(--accent-primary);
}

.summary-card.expense {
    border-left-color: var(--accent-danger);
}

.summary-card .label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.summary-card h2 {
    font-size: 1.5rem;
    font-weight: 700;
}

/* Tabs Navigation */
.tabs-nav {
    display: flex;
    overflow-x: auto;
    padding: 0 20px 10px 20px;
    gap: 10px;
    scrollbar-width: none; /* Firefox */
}

.tabs-nav::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.tab-btn {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.tab-btn.active {
    background-color: var(--text-main);
    color: white;
    border-color: var(--text-main);
}

/* Tab Content */
.tab-content {
    padding: 10px 20px;
}

.tab-pane {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-pane.active {
    display: block;
}

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

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

.action-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.add-btn {
    background-color: var(--accent-secondary);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: background 0.2s;
}

.add-btn:hover {
    background-color: #2563eb;
}

/* Cards List */
.cards-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.data-card {
    background-color: var(--surface-color);
    border-radius: var(--radius-md);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.data-card .info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.data-card .info .title {
    font-weight: 600;
    font-size: 1rem;
}

.data-card .info .desc {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.data-card .amount {
    font-weight: 700;
    font-size: 1.1rem;
}

.amount.success { color: var(--accent-primary); }
.amount.danger { color: var(--accent-danger); }

/* Report Section */
.report-section {
    background-color: var(--surface-color);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}

.report-section h3 {
    font-size: 1rem;
    margin-bottom: 15px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.report-summary {
    display: flex;
    justify-content: space-between;
}

.report-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.report-item span:first-child {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.report-item .val {
    font-weight: 700;
    font-size: 1.2rem;
}

.val.success { color: var(--accent-primary); }
.val.danger { color: var(--accent-danger); }

/* Modals */
.modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: flex-end;
    z-index: 100;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background-color: var(--surface-color);
    width: 100%;
    max-width: 600px;
    border-radius: 24px 24px 0 0;
    padding: 30px 20px;
    transform: translateY(0);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 90vh;
    overflow-y: auto;
}

.modal.hidden .modal-content {
    transform: translateY(100%);
}

.modal-content h2 {
    font-size: 1.4rem;
    margin-bottom: 20px;
}

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

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-main);
    margin-bottom: 8px;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 1rem;
    background-color: #f8fafc;
    transition: border-color 0.2s;
}

.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: var(--accent-secondary);
    background-color: #fff;
}

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

.btn-cancel, .btn-save {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-cancel {
    background-color: #f1f5f9;
    color: var(--text-main);
}

.btn-cancel:hover {
    background-color: #e2e8f0;
}

.btn-save {
    background-color: var(--text-main);
    color: white;
}

.btn-save:hover {
    background-color: #0f172a;
}

/* Future Statements Inputs */
.future-statement-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
}

.future-statement-row span {
    width: 80px;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Progress bar for charts */
.chart-bar-container {
    margin-bottom: 12px;
}

.chart-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    margin-bottom: 4px;
}

.chart-bar-bg {
    width: 100%;
    height: 8px;
    background-color: var(--border-color);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.chart-bar-fill {
    height: 100%;
    background-color: var(--accent-secondary);
    border-radius: var(--radius-full);
}
