@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Fraunces:opsz,wght@9..144,600&display=swap");

:root {
  color-scheme: light;
  --bg: #f6f3ee;
  --card: #ffffff;
  --ink: #1c1a17;
  --muted: #6b6257;
  --accent: #ff8a00;
  --accent-2: #187a6b;
  --line: #e3dcd2;
  --shadow: 0 18px 45px rgba(28, 26, 23, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top left, #fff3db 0%, #f6f3ee 55%, #efe7d7 100%);
}

main.app {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 20px 80px;
}

.hero {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 12px;
  color: var(--accent-2);
  margin: 0 0 12px;
}

.hero h1 {
  font-family: "Fraunces", serif;
  font-size: clamp(28px, 3.2vw, 44px);
  margin: 0 0 8px;
}

.sub {
  margin: 0;
  color: var(--muted);
}

.month {
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 16px 20px;
  background: var(--card);
  border-radius: 18px;
  box-shadow: var(--shadow);
  min-width: 220px;
}

.month label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
}

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

input, select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fffdfa;
}

button {
  border: none;
  border-radius: 999px;
  padding: 12px 20px;
  background: var(--accent);
  color: #1b1200;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(255, 138, 0, 0.25);
}

button.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
}

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

.card {
  background: var(--card);
  border-radius: 22px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.card h2 {
  margin-top: 0;
}

.summary-grid {
  display: grid;
  gap: 18px;
}

.summary-grid strong {
  display: block;
  font-size: 20px;
  margin-top: 4px;
}

.label {
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

.form form {
  display: grid;
  gap: 14px;
}

.row {
  display: grid;
  gap: 6px;
}

.table {
  margin-top: 26px;
}

.table-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.table-wrap {
  overflow-x: auto;
  margin-top: 16px;
}

.templates {
  margin-top: 26px;
}

.template-list {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  display: grid;
  gap: 8px;
}

.template-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px dashed var(--line);
  color: var(--muted);
  font-size: 14px;
}

.inline-form {
  display: grid;
  gap: 10px;
}

.inline-form button {
  justify-self: start;
}

.reports {
  margin-top: 26px;
}

.reports-grid {
  display: grid;
  gap: 20px;
  margin-top: 16px;
}

.reports-grid h3 {
  margin: 0 0 10px;
  font-size: 16px;
}

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

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  text-align: left;
  padding: 12px 8px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

th.right, td.right {
  text-align: right;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.badge.income {
  background: rgba(24, 122, 107, 0.14);
  color: #145a4f;
}

.badge.expense {
  background: rgba(255, 138, 0, 0.16);
  color: #8a4300;
}

.delete {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 6px 12px;
  font-size: 12px;
}

@media (max-width: 720px) {
  main.app {
    padding: 32px 16px 60px;
  }

  .table-head {
    flex-direction: column;
    align-items: flex-start;
  }
}
