:root {
  --bg: linear-gradient(135deg, #f3f6ff 0%, #f8f6fb 40%, #fdf3f7 100%);
  --card: rgba(255, 255, 255, 0.85);
  --text: #0f172a;
  --muted: #596178;
  --accent: #4f8bff;
  --accent-2: #7fd1c9;
  --accent-3: #f7b267;
  --warning: #f97316;
  --radius: 16px;
  --shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
  --border: rgba(15, 23, 42, 0.06);
  font-family: 'Sora', 'Space Grotesk', 'Helvetica Neue', Arial, sans-serif;
  color: var(--text);
  background: #f3f6ff;
}

* { box-sizing: border-box; }

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.page {
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.brand .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--accent), var(--accent-2));
  box-shadow: 0 0 0 6px rgba(79, 139, 255, 0.12);
}

.top-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.content {
  max-width: 1200px;
  margin: 32px auto;
  padding: 0 16px 48px;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  border: 1px solid var(--border);
  backdrop-filter: blur(6px);
}

.card.warning {
  border: 1px solid rgba(249, 115, 22, 0.3);
}

.narrow {
  max-width: 420px;
  margin: 0 auto;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid.overview {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-bottom: 18px;
}

.grid.two {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  margin-bottom: 16px;
}
.label {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 6px;
}

.value {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.4px;
}

.hint {
  font-size: 14px;
  color: var(--muted);
}

.section-actions {
  display: flex;
  gap: 8px;
}

.calendar-head {
  align-items: center;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.calendar-day {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(79, 139, 255, 0.04), rgba(127, 209, 201, 0.03));
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.calendar-day .day-title {
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.calendar-day .events {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.calendar-day .event {
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(79, 139, 255, 0.12);
  color: var(--text);
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.calendar-day .event.overdue {
  background: rgba(249, 115, 22, 0.14);
}

.badge a {
  color: inherit;
  text-decoration: none;
}
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.item {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(135deg, rgba(79, 139, 255, 0.06), rgba(127, 209, 201, 0.05));
}

.item .meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.item .title {
  font-weight: 600;
}

.item .note {
  color: var(--muted);
  font-size: 14px;
}

.note {
  color: var(--muted);
  font-size: 14px;
}

.note.small {
  color: var(--muted);
  font-size: 14px;
}

.badge {
  padding: 4px 8px;
  border-radius: 10px;
  font-size: 12px;
  background: rgba(79, 139, 255, 0.14);
  color: var(--accent);
  font-weight: 600;
}
.badge.warning {
  background: rgba(247, 178, 103, 0.18);
  color: #b45309;
}
.badge.danger {
  background: rgba(239, 68, 68, 0.18);
  color: #b91c1c;
}

button {
  border: none;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(135deg, rgba(79, 139, 255, 0.12), rgba(127, 209, 201, 0.15));
  color: var(--text);
  transition: transform 120ms ease, box-shadow 120ms ease, opacity 120ms ease;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

button.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  box-shadow: 0 12px 28px rgba(79, 139, 255, 0.35);
}

button.ghost {
  background: transparent;
  color: var(--muted);
  box-shadow: none;
}

button:hover { opacity: 0.95; transform: translateY(-1px); }
button:active { transform: translateY(0); opacity: 0.9; }

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field.inline {
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.field.inline select {
  min-width: 220px;
}

.field.inline.small input {
  width: 110px;
}

.balance-editor {
  display: flex;
  align-items: center;
  gap: 10px;
}

.field input, .field textarea, .field select {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  background: #fdfdff;
}

.stack { display: flex; flex-direction: column; gap: 12px; }

.error { color: #b91c1c; font-size: 14px; }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-body { width: min(480px, 100%); }

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.toast {
  position: fixed;
  bottom: 18px;
  right: 18px;
  background: var(--card);
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

@media (max-width: 720px) {
  .topbar { position: static; }
  .content { padding: 0 12px 32px; }
}
