:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-soft: #f9fafb;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --line: #eef0f3;
  --primary: #111827;
  --primary-hover: #000000;
  --income: #047857;
  --expense: #b91c1c;
  --warning: #b45309;
  --critical: #7f1d1d;
  --transfer: #1f4f7a;
  --radius-lg: 24px;
  --radius-md: 16px;
  --shadow-soft: 0 20px 60px rgba(15, 23, 42, 0.08);
  --shadow-card: 0 12px 30px rgba(15, 23, 42, 0.05);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }
body { font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif; background: var(--bg); color: var(--text); }
a { color: inherit; text-decoration: none; }
.container { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }
.topbar { position: sticky; top: 0; z-index: 20; backdrop-filter: saturate(180%) blur(18px); background: rgba(245,245,247,.82); border-bottom: 1px solid rgba(229,231,235,.75); }
.nav { height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 720; letter-spacing: -0.02em; }
.brand-mark { width: 34px; height: 34px; border-radius: 11px; background: linear-gradient(145deg, #111827, #374151); box-shadow: inset 0 1px 0 rgba(255,255,255,.18); }
.navlinks { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.navlinks a { font-size: 13px; color: #4b5563; padding: 9px 12px; border-radius: 999px; }
.navlinks a.active, .navlinks a:hover { background: #ffffff; color: #111827; box-shadow: 0 6px 18px rgba(15,23,42,.06); }
.navright { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.page { padding: 34px 0 54px; }
.page-header { display: flex; justify-content: space-between; gap: 24px; align-items: flex-end; margin-bottom: 24px; }
.kicker { margin: 0 0 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .14em; font-size: 12px; font-weight: 700; }
h1 { margin: 0; font-size: clamp(30px, 4vw, 48px); line-height: 1.06; letter-spacing: -0.05em; }
h2 { margin: 0 0 16px; font-size: 21px; line-height: 1.2; letter-spacing: -0.03em; }
h3 { margin: 0 0 10px; font-size: 16px; letter-spacing: -0.02em; }
p { line-height: 1.62; }
.subtle { color: var(--muted); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); }
.card-pad { padding: 22px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.metric { padding: 20px; min-height: 132px; display: flex; flex-direction: column; justify-content: space-between; }
.metric-label { color: var(--muted); font-size: 13px; font-weight: 650; }
.metric-value { font-size: 28px; font-weight: 760; letter-spacing: -0.04em; }
.metric-note { color: var(--muted); font-size: 12px; }
.metric.income { border-left: 4px solid var(--income); }
.metric.expense { border-left: 4px solid var(--expense); }
.metric.warning { border-left: 4px solid var(--warning); }
.metric.transfer { border-left: 4px solid var(--transfer); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 999px; padding: 10px 15px; font-size: 13px; font-weight: 700; cursor: pointer; background: var(--primary); color: #fff; transition: .18s ease; }
.btn:hover { background: var(--primary-hover); }
.btn.secondary { background: #fff; color: #111827; border-color: var(--border); }
.btn.secondary:hover { background: #f9fafb; }
.btn.danger { background: #991b1b; color: #fff; }
.btn.small { padding: 7px 11px; font-size: 12px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.period-filter { display: flex; align-items: end; gap: 10px; padding: 12px; border-radius: 18px; background: #fff; border: 1px solid var(--border); box-shadow: var(--shadow-card); }
.form-row { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0,1fr)); }
.form-field { display: flex; flex-direction: column; gap: 7px; }
label { font-size: 12px; color: #4b5563; font-weight: 700; }
input, select, textarea { width: 100%; border: 1px solid var(--border); background: #fff; border-radius: 14px; padding: 11px 12px; font: inherit; color: var(--text); outline: none; }
textarea { min-height: 92px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: #9ca3af; box-shadow: 0 0 0 4px rgba(17,24,39,.06); }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 18px; background: #fff; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { padding: 14px 15px; text-align: left; border-bottom: 1px solid var(--line); font-size: 13px; vertical-align: middle; }
th { color: #6b7280; font-weight: 750; background: #fbfbfc; }
tr:last-child td { border-bottom: 0; }
.amount { font-variant-numeric: tabular-nums; font-weight: 720; }
.amount.income { color: var(--income); }
.amount.expense { color: var(--expense); }
.amount.transfer { color: var(--transfer); }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 5px 9px; font-size: 11px; font-weight: 750; background: #f3f4f6; color: #374151; border: 1px solid #e5e7eb; text-transform: capitalize; }
.badge.income, .badge.safe, .badge.approved, .badge.active, .badge.completed { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.badge.expense, .badge.rejected, .badge.over { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.badge.warning, .badge.pending, .badge.partial { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.badge.critical { background: #7f1d1d; color: #fff; border-color: #7f1d1d; }
.badge.transfer, .badge.draft { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.alert { border-radius: 18px; padding: 14px 16px; margin-bottom: 16px; border: 1px solid var(--border); background: #fff; color: #374151; }
.alert.error { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.alert.success { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.auth-shell { min-height: 100vh; display:flex; align-items:center; justify-content:center; padding: 32px; background: radial-gradient(circle at top, #ffffff 0, #f5f5f7 55%, #eceff3 100%); }
.auth-card { width: min(460px,100%); padding: 28px; }
.auth-title { font-size: 30px; letter-spacing: -0.04em; margin: 0 0 8px; }
.auth-subtitle { color: var(--muted); margin: 0 0 24px; }
.progress { height: 10px; background: #f3f4f6; border-radius: 999px; overflow: hidden; }
.progress span { display:block; height:100%; background:#111827; border-radius:999px; }
.progress.warning span { background: var(--warning); }
.progress.over span, .progress.critical span { background: var(--expense); }
.section-stack { display:grid; gap:18px; margin-top:18px; }
.split { display:flex; align-items:center; justify-content:space-between; gap:16px; }
.footer-note { padding: 24px 0; color: var(--muted); font-size: 12px; text-align:center; }
@media (max-width: 900px) { .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; } .page-header { align-items: stretch; flex-direction: column; } .nav { height: auto; padding: 14px 0; align-items:flex-start; flex-direction: column; } .navright { width:100%; justify-content:space-between; } .form-row { grid-template-columns: 1fr; } }
