:root {
    --primary-color: #4CAF50;
    --primary-dark: #388E3C;
    --secondary-color: #2196F3;
    --danger-color: #EF5350;
    --warning-color: #FFC107;
    --text-color: #333;
    --text-light: #757575;
    --bg-color: #f5f5f5;
    --card-bg: #ffffff;
    --border-color: #e0e0e0;
    --shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    --radius: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    padding-bottom: 80px;
}

/* Header */
.header {
    background-color: var(--primary-color);
    color: white;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

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

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: block;
    cursor: pointer;
}

/* Navigation */
.nav {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 5px;
    scrollbar-width: none;
}

.nav::-webkit-scrollbar {
    display: none;
}

.nav-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
    font-size: 0.9rem;
}

.nav-btn:hover,
.nav-btn.active {
    background: white;
    color: var(--primary-color);
}

/* Main Content */
.main {
    padding: 20px 0;
}

.page {
    display: none;
    animation: fadeIn 0.3s ease;
}

.page.active {
    display: block;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-title {
    margin-bottom: 20px;
    font-size: 1.5rem;
    color: var(--text-color);
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.card-title {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: var(--text-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

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

.metric-icon {
    font-size: 1.5rem;
    background: #f0f0f0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.metric-content {
    flex: 1;
}

.metric-label {
    font-size: 0.8rem;
    color: var(--text-light);
}

.metric-value {
    font-weight: 700;
    font-size: 1.1rem;
}

.metric-card.income .metric-value {
    color: var(--primary-color);
}

.metric-card.expense .metric-value {
    color: var(--danger-color);
}

.metric-card.balance .metric-value {
    color: var(--secondary-color);
}

/* Transactions List */
.transactions-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.transaction-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: white;
    border-radius: var(--radius);
    border-left: 4px solid transparent;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.transaction-item.income {
    border-left-color: var(--primary-color);
}

.transaction-item.expense {
    border-left-color: var(--danger-color);
}

.t-info {
    display: flex;
    flex-direction: column;
}

.t-category {
    font-weight: 600;
    color: var(--text-color);
}

.t-date {
    font-size: 0.8rem;
    color: var(--text-light);
}

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

.transaction-item.income .t-amount {
    color: var(--primary-color);
}

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

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

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

.form-input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: border-color 0.2s;
}

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

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

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

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

.btn-secondary {
    background-color: #f5f5f5;
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

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

.btn-danger:hover {
    background-color: #FFCDD2;
}

.btn-block {
    width: 100%;
}

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

.filter-select,
.filter-input {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: white;
}

/* Reports Grid */
.reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.reports-grid canvas {
    max-height: 300px !important;
    height: 300px !important;
}

/* Table */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    font-weight: 600;
    color: var(--text-light);
    background-color: #f9f9f9;
}

/* Settings */
.settings-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
}

.settings-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.category-list {
    list-style: none;
}

.category-list li {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
}

.category-section-title {
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 2px solid;
}

.category-section-title.income {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.category-section-title.expense {
    border-color: var(--danger-color);
    color: var(--danger-color);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
}

.empty-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 10px;
    opacity: 0.5;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: white;
    padding: 12px 24px;
    border-radius: 50px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.toast.show {
    opacity: 1;
    visibility: visible;
    bottom: 30px;
}

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

.goal-card {
    background: white;
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    position: relative;
}

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

.goal-title {
    font-weight: 600;
    font-size: 1.1rem;
}

.goal-delete {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 5px;
}

.goal-delete:hover {
    color: var(--danger-color);
}

.goal-progress-container {
    height: 10px;
    background: #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 10px;
}

.goal-progress-bar {
    height: 100%;
    background: var(--primary-color);
    width: 0%;
    transition: width 0.5s ease;
}

.goal-progress-bar.warning {
    background: var(--warning-color);
}

.goal-progress-bar.danger {
    background: var(--danger-color);
}

.goal-stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--text-light);
}

.goal-amount {
    font-weight: 700;
    color: var(--text-color);
}

.goal-status {
    font-size: 0.8rem;
    margin-top: 5px;
    text-align: right;
}

.goal-status.over {
    color: var(--danger-color);
    font-weight: 600;
}

/* Utilities */
.text-center {
    text-align: center;
}