:root {
  --bg: #f4f6ef;
  --bg-alt: #dcebe3;
  --ink: #17241c;
  --muted: #5c6d61;
  --card: #ffffff;
  --line: #d6dfd8;
  --brand: #0f766e;
  --brand-2: #1c8f83;
  --warn: #b45309;
  --danger: #b42318;
  --success-bg: #e4faf4;
  --danger-bg: #feeceb;
  --radius-xl: 18px;
  --radius-md: 12px;
  --shadow-lg: 0 18px 36px rgba(20, 37, 27, 0.09);
  --shadow-sm: 0 4px 14px rgba(20, 37, 27, 0.07);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: radial-gradient(circle at 20% 10%, #f8fceb 0%, var(--bg) 44%, #ecf4ee 100%);
  font-family: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  min-height: 100vh;
}

.ambient {
  position: fixed;
  width: 440px;
  height: 440px;
  filter: blur(48px);
  z-index: -1;
  pointer-events: none;
  opacity: 0.45;
}

.ambient-top {
  top: -180px;
  right: -120px;
  background: radial-gradient(circle, #53c5b8 0%, transparent 72%);
}

.ambient-bottom {
  left: -160px;
  bottom: -200px;
  background: radial-gradient(circle, #e7b56f 0%, transparent 72%);
}

.layout {
  max-width: 1120px;
  margin: 0 auto;
  padding: 22px 16px 42px;
}

.header {
  border: 1px solid rgba(196, 210, 201, 0.65);
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius-xl);
  padding: 16px;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 10px;
  z-index: 20;
}

.branding {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.branding h1 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.2rem;
}

.branding p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-link,
.btn {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  color: var(--ink);
  background: #edf2ec;
  transition: transform 0.16s ease, background-color 0.16s ease, border-color 0.16s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.nav-link:hover,
.btn:hover {
  transform: translateY(-1px);
}

.nav-link.active {
  background: #d9ebe6;
  border-color: rgba(15, 118, 110, 0.4);
}

.btn-primary {
  background: linear-gradient(150deg, var(--brand) 0%, var(--brand-2) 100%);
  color: #fff;
}

.btn-primary:hover {
  background: linear-gradient(150deg, #0d685f 0%, #18796f 100%);
}

.btn-soft {
  background: #e9f4ef;
  color: #17534b;
  border-color: #bee2d7;
}

.btn-danger {
  background: #fdf0ef;
  color: #962111;
  border-color: #f6c8c3;
}

.hero {
  margin: 20px 0 14px;
  display: grid;
  gap: 12px;
  grid-template-columns: 1.35fr 1fr;
}

.hero-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}

.hero-card h2,
.hero-card h3 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
}

.hero-card p {
  color: var(--muted);
  margin: 7px 0 0;
}

.hero-stats {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.hero-stat {
  background: #f6faf6;
  border-radius: var(--radius-md);
  border: 1px solid #d9e6de;
  padding: 10px;
}

.hero-stat small {
  color: var(--muted);
  display: block;
  margin-bottom: 6px;
}

.hero-stat strong {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1rem;
}

.section {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--card);
  box-shadow: var(--shadow-sm);
  margin-top: 14px;
  overflow: hidden;
}

.section-header {
  padding: 14px 16px;
  border-bottom: 1px solid #e8eeea;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.section-header h3,
.section-header h2 {
  margin: 0;
  font-size: 1.03rem;
  font-family: "Space Grotesk", sans-serif;
}

.section-header p {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.grid-3 {
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.grid-2 {
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.card {
  border: 1px solid #dce5df;
  background: #fbfdfb;
  border-radius: var(--radius-md);
  padding: 14px;
}

.card strong {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.16rem;
}

.card small {
  color: var(--muted);
}

.event-card {
  border: 1px solid #dce4de;
  border-radius: var(--radius-md);
  background: linear-gradient(165deg, #ffffff 0%, #f2f7f3 100%);
  padding: 14px;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease;
}

.event-card:hover {
  transform: translateY(-2px);
  border-color: #9dc9bc;
}

.event-card h4 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
}

.event-totals {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.event-total {
  border-radius: 10px;
  padding: 8px;
  font-size: 0.82rem;
  background: #edf7f3;
}

.event-total.expense {
  background: #fbefef;
}

.event-total.balance {
  background: #edf0fb;
}

.event-total strong {
  display: block;
  margin-top: 4px;
  font-size: 0.9rem;
}

.list {
  display: flex;
  flex-direction: column;
}

.list-item {
  border-bottom: 1px solid #edf2ee;
  padding: 12px 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: background-color 0.16s ease;
}

.list-item:hover {
  background: #f4f8f5;
}

.list-item:last-child {
  border-bottom: none;
}

.list-item h4,
.list-item p {
  margin: 0;
}

.list-item p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.86rem;
}

.amount {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1rem;
  text-align: right;
}

.amount.income {
  color: #086452;
}

.amount.expense {
  color: #92221a;
}

.badge {
  display: inline-block;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.badge.income {
  color: #086452;
  background: var(--success-bg);
}

.badge.expense {
  color: #8b2017;
  background: var(--danger-bg);
}

.muted {
  color: var(--muted);
}

.empty {
  padding: 16px;
  color: var(--muted);
  text-align: center;
}

.form-grid {
  display: grid;
  gap: 12px;
  padding: 14px;
}

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

.form-row label {
  font-size: 0.86rem;
  color: #294036;
  font-weight: 600;
}

input,
select,
textarea {
  border: 1px solid #cfdcd2;
  border-radius: 10px;
  padding: 10px 11px;
  font-size: 0.93rem;
  font-family: inherit;
  background: #fff;
  color: var(--ink);
}

textarea {
  min-height: 92px;
  resize: vertical;
}

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

.detail-card {
  margin-top: 14px;
  border: 1px solid #dae4dc;
  border-radius: var(--radius-xl);
  background: #fff;
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.detail-grid {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.detail-grid div {
  border: 1px solid #e5ece7;
  border-radius: 10px;
  padding: 11px;
  background: #f9fcfa;
}

.detail-grid small {
  display: block;
  color: var(--muted);
}

.detail-grid strong {
  font-family: "Space Grotesk", sans-serif;
}

.preview {
  margin-top: 12px;
  border-radius: 12px;
  width: 100%;
  max-height: 340px;
  object-fit: cover;
  border: 1px solid #d7e0da;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 35, 28, 0.38);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 40;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: min(520px, 100vw);
  background: #ffffff;
  border-left: 1px solid #dae4dc;
  box-shadow: -10px 0 34px rgba(18, 35, 26, 0.18);
  transform: translateX(100%);
  transition: transform 0.23s ease;
  z-index: 41;
  display: flex;
  flex-direction: column;
}

.drawer-header {
  border-bottom: 1px solid #e6ede8;
  padding: 14px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.drawer-header h3 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
}

.drawer-body {
  overflow: auto;
}

body.drawer-open .drawer-backdrop {
  opacity: 1;
  pointer-events: auto;
}

body.drawer-open .drawer {
  transform: translateX(0);
}

.footer-note {
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}

.login-wrap {
  max-width: 460px;
  margin: 36px auto 0;
}

.pill {
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  background: #e4f6f1;
  color: #125246;
}

.warning {
  border: 1px solid #f5cc9e;
  background: #fff4e8;
  color: #8a4b0a;
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-size: 0.87rem;
}

@media (max-width: 920px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .grid-3,
  .event-totals {
    grid-template-columns: 1fr;
  }

  .grid-2,
  .hero-stats {
    grid-template-columns: 1fr;
  }

  .header {
    position: static;
  }
}

@media (max-width: 560px) {
  .layout {
    padding: 12px;
  }

  .header {
    padding: 12px;
  }

  .nav-link,
  .btn {
    padding: 9px 12px;
  }

  .list-item {
    grid-template-columns: 1fr;
  }

  .amount {
    text-align: left;
  }
}
