Files
budget-app/client/src/index.css
Christian Hood db541b4147 Add modern UI with light/dark mode
- CSS custom properties design system with full light/dark themes
- ThemeContext with localStorage persistence and system preference detection
- Theme toggle button in nav (moon/sun icon)
- Modern Inter font, card-based layout, sticky nav
- All pages restyled with CSS classes instead of inline styles

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-19 19:47:34 -04:00

785 lines
18 KiB
CSS

/* ─── Google Fonts ─────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');
/* ─── Design tokens ─────────────────────────────────────────────────────────── */
:root {
/* Brand */
--accent: #2563eb;
--accent-hover: #1d4ed8;
--accent-subtle: #eff6ff;
/* Surfaces */
--bg: #f1f5f9;
--surface: #ffffff;
--surface-raised: #f8fafc;
--border: #e2e8f0;
--border-strong: #cbd5e1;
/* Text */
--text: #0f172a;
--text-muted: #64748b;
--text-faint: #94a3b8;
/* Semantic */
--success: #16a34a;
--success-bg: #f0fdf4;
--danger: #dc2626;
--danger-bg: #fef2f2;
--danger-border: #fca5a5;
--warning: #d97706;
/* Misc */
--radius-sm: 4px;
--radius: 8px;
--radius-lg: 12px;
--shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
--shadow: 0 1px 3px 0 rgb(0 0 0 / 0.10), 0 1px 2px -1px rgb(0 0 0 / 0.10);
--shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.10), 0 2px 4px -2px rgb(0 0 0 / 0.10);
--nav-height: 56px;
--transition: 150ms ease;
}
[data-theme="dark"] {
--accent: #3b82f6;
--accent-hover: #60a5fa;
--accent-subtle: #1e3a5f;
--bg: #0f172a;
--surface: #1e293b;
--surface-raised: #273548;
--border: #334155;
--border-strong: #475569;
--text: #f1f5f9;
--text-muted: #94a3b8;
--text-faint: #64748b;
--success: #4ade80;
--success-bg: #052e16;
--danger: #f87171;
--danger-bg: #450a0a;
--danger-border: #991b1b;
--shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
--shadow: 0 1px 3px 0 rgb(0 0 0 / 0.4), 0 1px 2px -1px rgb(0 0 0 / 0.4);
--shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.4);
}
/* ─── Reset & base ───────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html {
font-family: 'Inter', system-ui, -apple-system, sans-serif;
font-size: 16px;
-webkit-font-smoothing: antialiased;
}
body {
margin: 0;
background: var(--bg);
color: var(--text);
transition: background var(--transition), color var(--transition);
min-height: 100vh;
}
/* ─── Layout ─────────────────────────────────────────────────────────────────── */
.app-shell {
display: flex;
flex-direction: column;
min-height: 100vh;
}
.app-nav {
position: sticky;
top: 0;
z-index: 50;
height: var(--nav-height);
background: var(--surface);
border-bottom: 1px solid var(--border);
box-shadow: var(--shadow-sm);
display: flex;
align-items: center;
padding: 0 1.5rem;
gap: 0;
}
.app-nav .nav-brand {
font-size: 1.1rem;
font-weight: 800;
color: var(--accent);
text-decoration: none;
letter-spacing: -0.02em;
margin-right: 2rem;
white-space: nowrap;
}
.app-nav .nav-links {
display: flex;
gap: 0.25rem;
flex: 1;
align-items: center;
}
.app-nav .nav-link {
padding: 0.4rem 0.75rem;
border-radius: var(--radius-sm);
font-size: 0.875rem;
font-weight: 500;
color: var(--text-muted);
text-decoration: none;
transition: color var(--transition), background var(--transition);
white-space: nowrap;
}
.app-nav .nav-link:hover {
color: var(--text);
background: var(--surface-raised);
}
.app-nav .nav-link.active {
color: var(--accent);
background: var(--accent-subtle);
font-weight: 600;
}
.theme-toggle {
margin-left: auto;
width: 36px;
height: 36px;
border-radius: var(--radius);
border: 1px solid var(--border);
background: var(--surface-raised);
color: var(--text-muted);
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
font-size: 1rem;
transition: background var(--transition), color var(--transition), border-color var(--transition);
flex-shrink: 0;
}
.theme-toggle:hover {
background: var(--border);
color: var(--text);
}
.app-main {
flex: 1;
padding: 1.75rem 1.5rem;
max-width: 1100px;
margin: 0 auto;
width: 100%;
}
/* ─── Page header ────────────────────────────────────────────────────────────── */
.page-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 1.5rem;
}
.page-title {
margin: 0;
font-size: 1.5rem;
font-weight: 800;
letter-spacing: -0.02em;
}
/* ─── Cards ──────────────────────────────────────────────────────────────────── */
.card {
background: var(--surface);
border: 1px solid var(--border);
border-radius: var(--radius-lg);
box-shadow: var(--shadow-sm);
}
.card-body {
padding: 1.25rem;
}
/* ─── Stat cards ─────────────────────────────────────────────────────────────── */
.stat-cards {
display: flex;
gap: 1rem;
flex-wrap: wrap;
margin-bottom: 1.25rem;
}
.stat-card {
flex: 1 1 150px;
background: var(--surface);
border: 1px solid var(--border);
border-radius: var(--radius-lg);
padding: 1rem 1.25rem;
box-shadow: var(--shadow-sm);
}
.stat-card__label {
font-size: 0.7rem;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.06em;
color: var(--text-muted);
margin-bottom: 0.4rem;
}
.stat-card__value {
font-size: 1.35rem;
font-weight: 700;
font-variant-numeric: tabular-nums;
color: var(--text);
line-height: 1.2;
}
/* ─── Month / Year nav ───────────────────────────────────────────────────────── */
.period-nav {
display: flex;
align-items: center;
gap: 0.75rem;
margin-bottom: 1.5rem;
}
.period-nav__label {
font-size: 1.2rem;
font-weight: 700;
min-width: 170px;
text-align: center;
letter-spacing: -0.01em;
}
/* ─── Buttons ────────────────────────────────────────────────────────────────── */
.btn {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 0.375rem;
padding: 0.45rem 1rem;
font-size: 0.875rem;
font-weight: 500;
font-family: inherit;
border-radius: var(--radius);
border: 1px solid var(--border-strong);
background: var(--surface);
color: var(--text);
cursor: pointer;
transition: background var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition);
white-space: nowrap;
line-height: 1;
}
.btn:hover {
background: var(--surface-raised);
border-color: var(--border-strong);
}
.btn:disabled {
opacity: 0.5;
cursor: not-allowed;
}
.btn-primary {
background: var(--accent);
color: #fff;
border-color: var(--accent);
}
.btn-primary:hover:not(:disabled) {
background: var(--accent-hover);
border-color: var(--accent-hover);
}
.btn-danger {
background: transparent;
color: var(--danger);
border-color: var(--danger);
}
.btn-danger:hover:not(:disabled) {
background: var(--danger-bg);
}
.btn-ghost {
background: transparent;
border-color: transparent;
color: var(--text-muted);
}
.btn-ghost:hover {
background: var(--surface-raised);
color: var(--text);
border-color: var(--border);
}
.btn-icon {
width: 28px;
height: 28px;
padding: 0;
border-radius: var(--radius-sm);
background: transparent;
border: none;
color: var(--text-faint);
cursor: pointer;
display: inline-flex;
align-items: center;
justify-content: center;
font-size: 1rem;
transition: color var(--transition), background var(--transition);
}
.btn-icon:hover {
color: var(--danger);
background: var(--danger-bg);
}
.btn-nav {
width: 34px;
height: 34px;
padding: 0;
border-radius: var(--radius);
border: 1px solid var(--border);
background: var(--surface);
color: var(--text-muted);
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
font-size: 1rem;
transition: background var(--transition), color var(--transition);
}
.btn-nav:hover {
background: var(--surface-raised);
color: var(--text);
}
.btn-sm {
padding: 0.3rem 0.65rem;
font-size: 0.8rem;
}
/* ─── Forms ──────────────────────────────────────────────────────────────────── */
.form-group {
display: flex;
flex-direction: column;
gap: 0.3rem;
}
.form-label {
font-size: 0.8rem;
font-weight: 600;
color: var(--text-muted);
}
.form-input,
.form-select {
padding: 0.45rem 0.625rem;
font-size: 0.875rem;
font-family: inherit;
color: var(--text);
background: var(--surface);
border: 1px solid var(--border-strong);
border-radius: var(--radius);
transition: border-color var(--transition), box-shadow var(--transition);
outline: none;
width: 100%;
}
.form-input:focus,
.form-select:focus {
border-color: var(--accent);
box-shadow: 0 0 0 3px rgb(37 99 235 / 0.15);
}
.form-input::placeholder {
color: var(--text-faint);
}
.form-error {
font-size: 0.8rem;
color: var(--danger);
margin-top: 0.25rem;
}
/* ─── Tables ─────────────────────────────────────────────────────────────────── */
.data-table {
width: 100%;
border-collapse: collapse;
font-size: 0.875rem;
}
.data-table th {
text-align: left;
padding: 0.6rem 1rem;
background: var(--surface-raised);
font-weight: 600;
font-size: 0.75rem;
text-transform: uppercase;
letter-spacing: 0.04em;
color: var(--text-muted);
border-bottom: 1px solid var(--border);
}
.data-table th.text-right,
.data-table td.text-right {
text-align: right;
}
.data-table td {
padding: 0.65rem 1rem;
color: var(--text);
border-bottom: 1px solid var(--border);
}
.data-table tbody tr:last-child td {
border-bottom: none;
}
.data-table tbody tr:hover td {
background: var(--surface-raised);
}
.data-table tfoot tr td {
border-top: 2px solid var(--border-strong);
border-bottom: none;
font-weight: 700;
background: var(--surface-raised);
}
.data-table .row-muted td {
color: var(--text-faint);
}
/* ─── Alerts ─────────────────────────────────────────────────────────────────── */
.alert {
padding: 0.75rem 1rem;
border-radius: var(--radius);
font-size: 0.875rem;
margin-bottom: 1rem;
}
.alert-error {
background: var(--danger-bg);
border: 1px solid var(--danger-border);
color: var(--danger);
}
.alert-success {
background: var(--success-bg);
color: var(--success);
font-weight: 600;
}
/* ─── Badges ─────────────────────────────────────────────────────────────────── */
.badge {
display: inline-block;
padding: 0.15rem 0.5rem;
border-radius: 999px;
font-size: 0.7rem;
font-weight: 600;
letter-spacing: 0.02em;
}
.badge-category {
background: var(--surface-raised);
color: var(--text-muted);
border: 1px solid var(--border);
}
/* ─── Divider ────────────────────────────────────────────────────────────────── */
.divider {
border: none;
border-top: 1px solid var(--border);
margin: 0.75rem 0;
}
/* ─── Empty state ────────────────────────────────────────────────────────────── */
.empty-state {
color: var(--text-faint);
font-size: 0.875rem;
font-style: italic;
padding: 0.25rem 0;
}
/* ─── Paycheck grid ──────────────────────────────────────────────────────────── */
.paycheck-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 1.25rem;
align-items: start;
}
@media (max-width: 680px) {
.paycheck-grid { grid-template-columns: 1fr; }
.app-nav .nav-link { font-size: 0.8rem; padding: 0.35rem 0.5rem; }
}
.paycheck-card {
background: var(--surface);
border: 1px solid var(--border);
border-radius: var(--radius-lg);
overflow: hidden;
box-shadow: var(--shadow-sm);
}
.paycheck-card__header {
padding: 1rem 1.25rem 0.875rem;
border-bottom: 1px solid var(--border);
background: var(--surface-raised);
}
.paycheck-card__number {
font-size: 0.7rem;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.08em;
color: var(--accent);
margin-bottom: 0.2rem;
}
.paycheck-card__date {
font-size: 1rem;
font-weight: 700;
color: var(--text);
margin-bottom: 0.5rem;
}
.paycheck-card__amounts {
display: flex;
gap: 1.25rem;
font-size: 0.8rem;
color: var(--text-muted);
}
.paycheck-card__amounts strong {
color: var(--text);
}
.paycheck-card__body {
padding: 1rem 1.25rem;
}
.section-title {
font-size: 0.7rem;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.07em;
color: var(--text-muted);
margin-bottom: 0.625rem;
}
/* Bill rows */
.bill-row {
display: flex;
align-items: flex-start;
gap: 0.625rem;
padding: 0.4rem 0;
border-bottom: 1px solid var(--border);
}
.bill-row:last-child { border-bottom: none; }
.bill-row__check {
margin-top: 2px;
accent-color: var(--accent);
cursor: pointer;
flex-shrink: 0;
width: 15px;
height: 15px;
}
.bill-row__info { flex: 1; }
.bill-row__name {
display: flex;
justify-content: space-between;
align-items: baseline;
font-size: 0.875rem;
font-weight: 500;
color: var(--text);
gap: 0.5rem;
}
.bill-row__name.paid {
text-decoration: line-through;
color: var(--text-faint);
}
.bill-row__amount {
font-variant-numeric: tabular-nums;
font-size: 0.875rem;
white-space: nowrap;
}
.bill-row__meta {
font-size: 0.75rem;
color: var(--text-faint);
display: flex;
gap: 0.5rem;
margin-top: 1px;
}
/* OTE rows */
.ote-row {
display: flex;
align-items: center;
gap: 0.5rem;
padding: 0.4rem 0;
border-bottom: 1px solid var(--border);
font-size: 0.875rem;
}
.ote-row:last-child { border-bottom: none; }
.ote-row__check { accent-color: var(--accent); cursor: pointer; flex-shrink: 0; }
.ote-row__name {
flex: 1;
color: var(--text);
}
.ote-row__name.paid {
text-decoration: line-through;
color: var(--text-faint);
}
.ote-row__amount {
font-variant-numeric: tabular-nums;
color: var(--text);
white-space: nowrap;
}
/* Actual rows */
.actual-row {
padding: 0.4rem 0;
border-bottom: 1px solid var(--border);
font-size: 0.875rem;
}
.actual-row:last-child { border-bottom: none; }
.actual-row__main {
display: flex;
justify-content: space-between;
align-items: baseline;
}
.actual-row__category {
font-weight: 500;
color: var(--text);
}
.actual-row__amount {
font-variant-numeric: tabular-nums;
color: var(--text);
}
.actual-row__meta {
display: flex;
gap: 0.5rem;
align-items: center;
font-size: 0.75rem;
color: var(--text-faint);
margin-top: 1px;
}
.actual-row__note { font-style: italic; flex: 1; }
/* Inline add forms */
.inline-add-form {
display: flex;
gap: 0.4rem;
margin-top: 0.625rem;
flex-wrap: wrap;
}
.inline-add-form .form-input {
flex: 1;
min-width: 80px;
}
/* Multi-row form */
.form-rows {
display: flex;
flex-direction: column;
gap: 0.4rem;
margin-top: 0.75rem;
}
.form-row {
display: flex;
gap: 0.4rem;
flex-wrap: wrap;
}
.form-row .form-input,
.form-row .form-select {
flex: 1;
min-width: 80px;
}
/* Remaining balance */
.remaining-row {
display: flex;
justify-content: space-between;
align-items: center;
padding-top: 0.75rem;
margin-top: 0.75rem;
border-top: 2px solid var(--border-strong);
}
.remaining-row__label {
font-size: 0.875rem;
font-weight: 600;
color: var(--text-muted);
}
.remaining-row__amount {
font-size: 1.15rem;
font-weight: 700;
font-variant-numeric: tabular-nums;
}
.remaining-row__amount.positive { color: var(--success); }
.remaining-row__amount.negative { color: var(--danger); }
/* ─── Settings ───────────────────────────────────────────────────────────────── */
.settings-section {
margin-bottom: 2rem;
}
.settings-section__title {
font-size: 1rem;
font-weight: 700;
color: var(--text);
margin: 0 0 1rem;
padding-bottom: 0.5rem;
border-bottom: 2px solid var(--border);
}
.settings-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
gap: 1rem;
}
/* ─── Utilities ──────────────────────────────────────────────────────────────── */
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-faint { color: var(--text-faint); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.font-tabular { font-variant-numeric: tabular-nums; }
.font-bold { font-weight: 700; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.gap-sm { gap: 0.5rem; }
.flex { display: flex; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }