* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", "Liberation Sans", sans-serif;
  color: #0f172a;
  background: radial-gradient(1000px 600px at 10% 0%, #e0f2fe 0%, rgba(224,242,254,0) 60%),
              radial-gradient(1000px 600px at 90% 0%, #ede9fe 0%, rgba(237,233,254,0) 60%),
              #f8fafc;
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 16px; }

.topbar {
  position: sticky;
  top: 0;
  backdrop-filter: blur(10px);
  background: rgba(248, 250, 252, 0.75);
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  z-index: 10;
}
.topbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
}
.brand__title { font-weight: 800; letter-spacing: -0.02em; }
.brand__subtitle { font-size: 12px; color: #475569; margin-top: 2px; }

.main { padding: 18px 16px 36px; display: grid; gap: 14px; }

.card {
  background: rgba(255,255,255,0.75);
  border: 1px solid rgba(15, 23, 42, 0.10);
  border-radius: 16px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
  padding: 14px;
}
.card__title { font-weight: 750; margin-bottom: 10px; }

.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .grid { grid-template-columns: 1fr; }
}

.row { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }

.field { display: grid; gap: 6px; }
.field--inline { min-width: 160px; }
.field--grow { flex: 1; min-width: 220px; }
.field__label { font-size: 12px; color: #475569; }

input, select {
  height: 38px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  background: rgba(255,255,255,0.95);
  outline: none;
}
input:focus, select:focus { border-color: rgba(59, 130, 246, 0.65); box-shadow: 0 0 0 4px rgba(59,130,246,0.12); }

.btn {
  height: 38px;
  padding: 0 14px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  background: linear-gradient(180deg, #2563eb, #1d4ed8);
  color: white;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.25);
}
.btn--secondary {
  background: rgba(15,23,42,0.06);
  color: #0f172a;
  box-shadow: none;
  border: 1px solid rgba(15,23,42,0.10);
}
.btn:active { transform: translateY(1px); }

.summary { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.pill {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  background: rgba(255,255,255,0.7);
}
.pill span { font-size: 12px; color: #475569; }
.pill b { font-size: 18px; letter-spacing: -0.01em; }
.pill--green b { color: #16a34a; }
.pill--red b { color: #dc2626; }
.pill--blue b { color: #2563eb; }

.tableWrap { overflow: auto; border-radius: 12px; border: 1px solid rgba(15,23,42,0.08); }
.table { width: 100%; border-collapse: collapse; min-width: 860px; background: rgba(255,255,255,0.75); }
.table th, .table td { padding: 10px 10px; border-bottom: 1px solid rgba(15,23,42,0.06); vertical-align: top; }
.table th { text-align: left; font-size: 12px; color: #475569; background: rgba(15,23,42,0.03); position: sticky; top: 0; }
.table td.num, .table th.num { text-align: right; }

.summaryTableWrap { overflow: auto; margin-top: 12px; border-radius: 12px; border: 1px solid rgba(15,23,42,0.08); }
.summaryTable { width: 100%; border-collapse: collapse; min-width: 560px; background: rgba(255,255,255,0.75); }
.summaryTable th, .summaryTable td { padding: 10px 10px; border-bottom: 1px solid rgba(15,23,42,0.06); }
.summaryTable thead th { text-align: left; font-size: 12px; color: #475569; background: rgba(15,23,42,0.03); }
.summaryTable tfoot th { background: rgba(37,99,235,0.06); }
.summaryTable td.num, .summaryTable th.num { text-align: right; }
.muted { color: #64748b; font-size: 12px; }
.error { color: #dc2626; font-size: 12px; min-height: 16px; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid rgba(15,23,42,0.10);
  background: rgba(255,255,255,0.65);
}
.tag--income { border-color: rgba(22,163,74,0.30); color: #16a34a; }
.tag--expense { border-color: rgba(220,38,38,0.30); color: #dc2626; }

.linkDanger {
  border: none;
  background: transparent;
  color: #dc2626;
  cursor: pointer;
  padding: 0;
  font-weight: 700;
}
.linkDanger:hover { text-decoration: underline; }

.footer { padding: 18px 0 26px; }

.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tab {
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(15,23,42,0.12);
  background: rgba(255,255,255,0.7);
  cursor: pointer;
  font-weight: 700;
  color: #0f172a;
}
.tab--active {
  background: rgba(37,99,235,0.10);
  border-color: rgba(37,99,235,0.25);
}

