:root {
  --green: #2f9e44;
  --red: #e03131;
  --blue: #1971c2;
  --bg: #f4f6f5;
  --card-bg: #ffffff;
  --border: #e1e5e3;
  --text: #1c2321;
  --muted: #6b756f;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  display: flex;
  align-items: center;
  gap: 24px;
  background: #14342b;
  color: #fff;
  padding: 12px 24px;
}

.brand { font-weight: 700; font-size: 1.1rem; display: flex; align-items: center; gap: 6px; }
.brand-mark { color: #7bd88f; font-size: 1.3rem; }

.mainnav { display: flex; gap: 18px; flex: 1; }
.mainnav a { color: #cfe8d8; padding: 6px 4px; }
.mainnav a.active, .mainnav a:hover { color: #fff; border-bottom: 2px solid #7bd88f; text-decoration: none; }

.userbox { display: flex; align-items: center; gap: 10px; font-size: 0.9rem; }
.sync-dot { width: 8px; height: 8px; border-radius: 50%; background: #888; display: inline-block; }
.sync-dot.live { background: #7bd88f; }

.container { max-width: 1000px; margin: 0 auto; padding: 24px; }

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
}

.card h2 { margin-top: 0; font-size: 1.05rem; }

.highlight-card { background: #eaf7ee; border-color: #cdeed7; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 720px) { .grid-2 { grid-template-columns: 1fr; } }

.big-number { font-size: 2rem; font-weight: 700; margin: 6px 0; }
.big-number.negative { color: var(--red); }
.big-number.positive { color: var(--green); }

.muted { color: var(--muted); font-size: 0.9rem; }

.list { list-style: none; margin: 0; padding: 0; }
.list-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); }
.list-total { display: flex; justify-content: space-between; font-weight: 700; padding-top: 10px; }

.badge {
  font-size: 0.7rem;
  background: #eef1ef;
  color: var(--muted);
  border-radius: 20px;
  padding: 2px 8px;
  margin-left: 6px;
}

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--border); font-size: 0.92rem; }
.table th { color: var(--muted); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; }
.amount-col { text-align: right; font-variant-numeric: tabular-nums; }
.negative { color: var(--red); }
.positive { color: var(--green); }

.card-header-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.month-nav { display: flex; gap: 8px; }

.btn {
  display: inline-block;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 10px 16px;
  font-size: 0.9rem;
  cursor: pointer;
}
.btn:hover { opacity: 0.9; text-decoration: none; }
.btn-primary { background: var(--green); }
.btn-small { padding: 6px 10px; font-size: 0.8rem; }

.link-btn {
  background: none;
  border: none;
  color: var(--blue);
  cursor: pointer;
  padding: 0;
  font-size: 0.85rem;
}
.link-btn.danger { color: var(--red); }

.stacked-form { display: flex; flex-direction: column; gap: 14px; max-width: 380px; }
.stacked-form label { display: flex; flex-direction: column; gap: 4px; font-size: 0.85rem; color: var(--muted); }
.stacked-form input, .stacked-form select {
  padding: 9px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 0.95rem;
}

.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.inline-form input, .inline-form select {
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 0.9rem;
}

.auth-card {
  max-width: 420px;
  margin: 60px auto;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
}

.alert { padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; font-size: 0.9rem; }
.alert-success { background: #eaf7ee; color: #2b8a3e; border: 1px solid #cdeed7; }
.alert-error { background: #fff0f0; color: #c92a2a; border: 1px solid #ffd8d8; }

.budget-table input[type="number"] {
  width: 100px;
  text-align: right;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.assign-form { display: inline-block; }

.bar-chart { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 160px 1fr 100px; align-items: center; gap: 10px; }
.bar-track { background: #eef1ef; border-radius: 6px; height: 14px; overflow: hidden; }
.bar-fill { background: var(--blue); height: 100%; }
.bar-label { font-size: 0.85rem; }
.bar-amount { text-align: right; font-size: 0.85rem; font-variant-numeric: tabular-nums; }
