:root {
  --ink: #14211d;
  --muted: #66736e;
  --paper: #f4f2eb;
  --card: #fffdf8;
  --line: #d9ddd8;
  --green: #205c49;
  --green-dark: #153f33;
  --lime: #d9ef89;
  --orange: #e8733a;
  --shadow: 0 18px 55px rgba(25, 48, 39, 0.09);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 80% 0%, rgba(217, 239, 137, 0.35), transparent 28rem),
    var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input, textarea, select { font: inherit; }
button { cursor: pointer; }

.shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }

.topbar {
  height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(20, 33, 29, 0.14);
}

.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 850; letter-spacing: .08em; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; color: white; background: var(--green); border-radius: 10px 10px 10px 3px; letter-spacing: 0; }
.top-actions { display: flex; align-items: center; gap: 12px; }
.local-badge { padding: 8px 12px; background: rgba(255,255,255,.55); border: 1px solid var(--line); border-radius: 999px; font-size: 13px; color: var(--muted); }
.status-dot { display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 50%; background: #4cab72; box-shadow: 0 0 0 4px rgba(76,172,114,.12); }
.icon-button { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%; background: transparent; font-size: 20px; color: var(--green); }

.hero { min-height: 530px; display: grid; grid-template-columns: 1.05fr .95fr; gap: 72px; align-items: center; padding: 72px 0 68px; }
.eyebrow { margin: 0 0 14px; color: var(--green); font-size: 12px; font-weight: 850; letter-spacing: .15em; }
h1 { margin: 0; max-width: 650px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(48px, 6vw, 78px); font-weight: 500; line-height: .98; letter-spacing: -.045em; }
h1 em { color: var(--green); font-weight: 500; }
.hero-text { max-width: 560px; margin: 28px 0 0; color: var(--muted); font-size: 18px; line-height: 1.65; }

.capture-card { padding: 30px; background: var(--card); border: 1px solid rgba(20,33,29,.12); border-radius: 26px; box-shadow: var(--shadow); }
.capture-card > label { display: block; margin-bottom: 16px; font-family: Georgia, serif; font-size: 24px; line-height: 1.2; }
input, textarea, select { width: 100%; color: var(--ink); background: #f7f6f1; border: 1px solid #dce0db; border-radius: 12px; outline: none; transition: border .2s, box-shadow .2s; }
input, select { height: 48px; padding: 0 14px; }
textarea { padding: 13px 14px; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: #78a594; box-shadow: 0 0 0 4px rgba(32,92,73,.08); }
.capture-card > input, .capture-card > textarea { margin-bottom: 12px; }
.form-row { display: grid; grid-template-columns: 1fr 1.25fr; gap: 12px; }
.field > span { display: block; margin: 2px 0 7px; color: var(--muted); font-size: 12px; font-weight: 700; }
.money-input { display: grid; grid-template-columns: 86px 1fr; gap: 7px; }
.primary-button { width: 100%; margin-top: 20px; padding: 15px 18px; display: flex; justify-content: space-between; color: white; background: var(--green); border: 0; border-radius: 13px; font-weight: 750; transition: transform .2s, background .2s; }
.primary-button:hover { transform: translateY(-1px); background: var(--green-dark); }
.primary-button:disabled { opacity: .55; cursor: wait; }
.form-feedback { min-height: 18px; margin: 10px 2px -6px; color: var(--muted); font-size: 13px; }
.form-feedback.error { color: #a33a2d; }

.dashboard { padding: 76px 0 90px; border-top: 1px solid rgba(20,33,29,.14); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
h2 { margin: 0; font-family: Georgia, serif; font-size: clamp(34px, 4vw, 50px); font-weight: 500; letter-spacing: -.025em; }
.summary { display: flex; gap: 30px; }
.summary div { display: flex; flex-direction: column; align-items: flex-end; }
.summary strong { font-family: Georgia, serif; color: var(--green); font-size: 32px; font-weight: 500; line-height: 1; }
.summary span { margin-top: 4px; color: var(--muted); font-size: 12px; }
.filters { display: flex; gap: 8px; margin: 32px 0 22px; }
.filter { padding: 9px 15px; color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; font-weight: 700; }
.filter.active { color: white; background: var(--ink); border-color: var(--ink); }
.loops-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.loop-card { min-height: 260px; display: flex; flex-direction: column; padding: 22px; background: var(--card); border: 1px solid rgba(20,33,29,.11); border-radius: 19px; box-shadow: 0 10px 28px rgba(25,48,39,.055); transition: transform .2s, box-shadow .2s; }
.loop-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.loop-card.closed { opacity: .68; }
.loop-card.closed .loop-title { text-decoration: line-through; }
.loop-topline { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.loop-status { padding: 6px 9px; color: var(--green); background: #e4efe9; border-radius: 999px; font-size: 10px; font-weight: 850; letter-spacing: .08em; }
.close-button { padding: 4px 0; color: var(--muted); background: none; border: 0; font-size: 12px; font-weight: 700; }
.close-button:hover { color: var(--orange); }
.loop-card h3 { margin: 30px 0 9px; font-family: Georgia, serif; font-size: 25px; font-weight: 500; line-height: 1.15; }
.loop-outcome { margin: 0; color: var(--muted); line-height: 1.5; }
.loop-meta { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 20px; }
.meta-pill { padding: 6px 9px; color: #52615b; background: #f0f0e9; border-radius: 7px; font-size: 11px; font-weight: 700; }
.loop-footer { margin-top: auto; padding-top: 22px; display: flex; justify-content: space-between; color: #8a938f; font-size: 11px; }
.loop-arrow { color: var(--green); font-size: 17px; }
.empty-state { padding: 62px 20px; text-align: center; background: rgba(255,255,255,.35); border: 1px dashed #c8cfca; border-radius: 22px; }
.empty-state[hidden] { display: none; }
.empty-icon { width: 54px; height: 54px; display: grid; place-items: center; margin: 0 auto 18px; color: var(--green); background: var(--lime); border-radius: 50%; font-size: 24px; }
.empty-state h3 { margin: 0; font-family: Georgia, serif; font-size: 26px; font-weight: 500; }
.empty-state p { max-width: 470px; margin: 10px auto 0; color: var(--muted); line-height: 1.6; }
footer { min-height: 80px; display: flex; align-items: center; justify-content: space-between; color: var(--muted); border-top: 1px solid rgba(20,33,29,.14); font-size: 12px; }

@media (max-width: 850px) {
  .hero { grid-template-columns: 1fr; gap: 42px; padding-top: 54px; }
  .loops-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 580px) {
  .shell { width: min(100% - 24px, 1180px); }
  .topbar { height: 68px; }
  .local-badge { display: none; }
  .hero { padding: 44px 0 52px; }
  h1 { font-size: 48px; }
  .capture-card { padding: 20px; border-radius: 20px; }
  .form-row { grid-template-columns: 1fr; }
  .section-heading { align-items: start; flex-direction: column; }
  .summary { width: 100%; justify-content: flex-start; }
  .summary div { align-items: flex-start; }
  .loops-grid { grid-template-columns: 1fr; }
  footer { align-items: flex-start; flex-direction: column; justify-content: center; gap: 5px; }
}
