/* Finance Dashboard styles */

:root {
  --green: #2ecc71;
  --red: #e74c3c;
  --blue: #3498db;
  --grey: #95a5a6;
}

/* Nav */
nav { border-bottom: 1px solid var(--pico-muted-border-color); margin-bottom: 2rem; }
nav a[aria-current="page"] { font-weight: bold; }

/* Flash messages */
.flash { padding: 0.75rem 1rem; margin-bottom: 1rem; border-radius: 4px; }
.flash-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.flash-error   { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

/* KPI cards */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.kpi-card { background: var(--pico-card-background-color); border: 1px solid var(--pico-muted-border-color); border-radius: 8px; padding: 1.25rem; text-align: center; }
.kpi-card .kpi-label { font-size: 0.8rem; color: var(--pico-muted-color); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.25rem; }
.kpi-card .kpi-value { font-size: 1.8rem; font-weight: bold; line-height: 1; }
.kpi-card .kpi-value.positive { color: var(--green); }
.kpi-card .kpi-value.negative { color: var(--red); }
.kpi-card .kpi-sub { font-size: 0.8rem; color: var(--pico-muted-color); margin-top: 0.25rem; }

/* Charts */
.chart-container { background: var(--pico-card-background-color); border: 1px solid var(--pico-muted-border-color); border-radius: 8px; padding: 1rem; margin-bottom: 1.5rem; }
.chart-title { font-size: 0.9rem; font-weight: 600; margin-bottom: 0.5rem; color: var(--pico-muted-color); text-transform: uppercase; letter-spacing: 0.05em; }
.chart-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
@media (max-width: 768px) { .chart-row { grid-template-columns: 1fr; } }

/* Category badges */
.badge { display: inline-block; padding: 0.2em 0.6em; border-radius: 12px; font-size: 0.75rem; font-weight: 600; color: #fff; white-space: nowrap; }

/* Amounts */
.amount-positive { color: var(--green); font-weight: 600; }
.amount-negative { color: var(--red); }
.amount-transfer { color: var(--grey); }

/* Tables */
table { font-size: 0.9rem; }
td, th { vertical-align: middle; padding: 0.5rem 0.75rem; }

/* Budget bars */
.budget-bar-wrap { width: 120px; display: inline-block; }
.budget-bar-bg { background: #e0e0e0; border-radius: 4px; height: 8px; width: 100%; }
.budget-bar-fill { height: 8px; border-radius: 4px; background: var(--blue); }
.budget-bar-fill.over { background: var(--red); }

/* Upcoming bills */
.bills-list { list-style: none; padding: 0; }
.bills-list li { display: flex; justify-content: space-between; align-items: center; padding: 0.5rem 0; border-bottom: 1px solid var(--pico-muted-border-color); }
.bills-list li:last-child { border-bottom: none; }

/* Section headers */
h2 { font-size: 1.2rem; margin-bottom: 1rem; }
h3 { font-size: 1rem; font-weight: 600; margin-bottom: 0.75rem; }

/* Tabs */
.tabs { display: flex; gap: 0; border-bottom: 2px solid var(--pico-muted-border-color); margin-bottom: 1.5rem; }
.tabs a { padding: 0.5rem 1rem; text-decoration: none; color: var(--pico-muted-color); border-bottom: 2px solid transparent; margin-bottom: -2px; }
.tabs a.active { color: var(--pico-primary); border-bottom-color: var(--pico-primary); font-weight: 600; }

/* Period selector */
.period-bar { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1.5rem; align-items: center; }
.period-bar a { font-size: 0.85rem; }

footer { margin-top: 3rem; padding: 1rem 0; border-top: 1px solid var(--pico-muted-border-color); color: var(--pico-muted-color); font-size: 0.8rem; }
