:root {
    /* Finance-inspired palette: deep navy, gold accents */
    --primary: #1a56db;
    --primary-hover: #1648b8;
    --primary-light: #e8eefb;
    --primary-gradient: linear-gradient(135deg, #1a56db 0%, #1e40af 100%);
    --accent: #d4a017;
    --accent-light: #fef7e0;
    --accent-hover: #b8890f;
    --danger: #dc2626;
    --danger-hover: #b91c1c;
    --danger-light: #fef2f2;
    --success: #059669;
    --success-light: #ecfdf5;
    --warning: #d97706;
    --warning-light: #fffbeb;
    --bg: #f0f2f5;
    --surface: #ffffff;
    --surface-alt: #f7f8fa;
    --surface-dark: #0f172a;
    --text: #111827;
    --text-secondary: #374151;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --border-light: #f3f4f6;
    --radius: 10px;
    --radius-sm: 6px;
    --radius-lg: 14px;
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
    --transition: 0.15s ease;
    --font-mono: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
}

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

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.55;
    min-height: 100vh;
    font-size: 14px;
}

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-hover); text-decoration: none; }

button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 18px;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.8125rem;
    cursor: pointer;
    transition: all var(--transition);
    letter-spacing: 0.01em;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 1px 2px rgba(26, 86, 219, 0.3);
}
.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 2px 6px rgba(26, 86, 219, 0.35);
    transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }

.btn-accent {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 1px 2px rgba(212, 160, 23, 0.3);
}
.btn-accent:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}
.btn-danger:hover {
    background: var(--danger-hover);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1.5px solid var(--border);
}
.btn-outline:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border: none;
}
.btn-ghost:hover {
    background: var(--surface-alt);
    color: var(--text);
}

.btn-sm {
    padding: 5px 12px;
    font-size: 0.75rem;
    border-radius: var(--radius-sm);
}

.btn-icon {
    padding: 7px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.btn-icon:hover {
    background: var(--surface-alt);
    color: var(--text);
}

/* ---------- Inputs ---------- */
.input {
    width: 100%;
    padding: 9px 13px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    transition: all var(--transition);
    font-size: 0.875rem;
}
.input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.1);
}
.input::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

/* ---------- Cards ---------- */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 24px;
    transition: box-shadow var(--transition);
}
.card:hover {
    box-shadow: var(--shadow-md);
}

/* ---------- Badges ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-success { background: var(--success-light); color: var(--success); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-accent { background: var(--accent-light); color: var(--accent-hover); }

.hidden { display: none !important; }

/* ---------- Toasts ---------- */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    color: #fff;
    font-weight: 500;
    font-size: 0.8125rem;
    animation: toastSlideIn 0.3s ease;
    max-width: 380px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 8px;
}
.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }

@keyframes toastSlideIn {
    from { transform: translateX(120%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ---------- Spinner ---------- */
.spinner {
    width: 28px;
    height: 28px;
    border: 2.5px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin: 40px auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ---------- Empty State ---------- */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}
.empty-state svg {
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
    opacity: 0.3;
}
.empty-state p {
    font-size: 0.875rem;
}

/* ---------- Utility ---------- */
.text-mono {
    font-family: var(--font-mono);
}
.text-muted {
    color: var(--text-muted);
}
.text-accent {
    color: var(--accent);
}
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

/* Section heading style */
.section-title {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 12px;
}

/* Finance-style amount display */
.amount {
    font-family: var(--font-mono);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.amount-positive { color: var(--success); }
.amount-negative { color: var(--danger); }
.amount-neutral { color: var(--primary); }

/* Scrollbar styling */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
