@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/montserrat-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/montserrat-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/montserrat-latin.woff2") format("woff2");
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Montserrat", -apple-system, "Segoe UI", sans-serif;
  background: #f5f6f4;
  color: #22312a;
  font-size: 14px;
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
}
h1, h2, h3 { margin: 0; font-weight: 700; }
p { margin: 0; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; }

.topbar {
  background: #2e7d5b;
  color: #fff;
  padding: 14px 16px 12px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar h1 { font-size: 19px; }
.topbar .sub { font-size: 12px; opacity: 0.85; margin-top: 2px; }
.topbar .row { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.linkbtn {
  background: none; border: none; color: #fff; opacity: 0.9;
  font-size: 12px; text-decoration: underline; padding: 4px 0;
}

.monthbar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  background: #fff;
  border-bottom: 1px solid #e3e6e2;
  position: sticky; top: 58px; z-index: 9;
}
.monthbar label { font-size: 12px; color: #6b7a72; font-weight: 600; }
.monthbar input[type="month"] {
  border: 1px solid #cfd6d0; border-radius: 8px; padding: 6px 8px; background: #fff;
}

.tabs {
  display: flex; gap: 6px; overflow-x: auto;
  padding: 10px 12px 4px;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 0 0 auto;
  border: 1px solid #d7ddd8;
  background: #fff;
  color: #2e7d5b;
  border-radius: 999px;
  padding: 7px 13px;
  font-size: 13px;
  font-weight: 600;
}
.tab.active { background: #2e7d5b; color: #fff; border-color: #2e7d5b; }

.view { padding: 12px 12px 40px; max-width: 720px; margin: 0 auto; }
.view h2 { font-size: 16px; margin: 10px 2px 8px; }

.card {
  background: #fff;
  border: 1px solid #e6e9e6;
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.card .label { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: #7a8a81; font-weight: 600; }
.card .big { font-size: 26px; font-weight: 700; margin-top: 2px; }
.card .small { font-size: 12px; color: #6b7a72; margin-top: 4px; }
.card .date { font-size: 11px; color: #8a978f; margin-top: 2px; }

.hero { background: #2e7d5b; color: #fff; border: none; }
.hero .label { color: rgba(255,255,255,0.8); }
.hero .small { color: rgba(255,255,255,0.85); }
.hero .date { color: rgba(255,255,255,0.7); }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid2 .card { margin-bottom: 0; }
.pos { color: #1e7d46; font-weight: 700; }
.neg { color: #c0392b; font-weight: 700; }
.muted { color: #6b7a72; }

.rowline { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.rowline .t { font-weight: 600; }
.rowline .v { font-weight: 700; white-space: nowrap; }
.note { font-size: 12px; color: #6b7a72; margin-top: 4px; }
.pill {
  display: inline-block; font-size: 11px; font-weight: 700;
  padding: 2px 8px; border-radius: 999px; margin-left: 6px;
}
.pill.green { background: #e2f3e8; color: #1e7d46; }
.pill.amber { background: #fdf3d7; color: #8a6d00; }
.pill.grey { background: #eceeec; color: #5b6a62; }
.pill.red { background: #fdecea; color: #c0392b; }

.badge-order {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: #2e7d5b; color: #fff; font-size: 12px; font-weight: 700;
  margin-right: 6px; flex: 0 0 auto;
}
.kv { display: flex; justify-content: space-between; font-size: 13px; padding: 3px 0; }
.kv span:first-child { color: #6b7a72; }
.kv span:last-child { font-weight: 600; }

.progress { height: 10px; background: #e6e9e6; border-radius: 999px; overflow: hidden; margin: 8px 0 4px; }
.progress > div { height: 100%; background: #2e7d5b; }

.btn {
  background: #2e7d5b; color: #fff; border: none; border-radius: 10px;
  padding: 10px 16px; font-size: 14px; font-weight: 700;
}
.btn.secondary { background: #fff; color: #2e7d5b; border: 1px solid #2e7d5b; }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn.danger { background: #fff; color: #c0392b; border: 1px solid #e8b4ae; }
.btn:disabled { opacity: 0.5; }

form.add { display: grid; gap: 8px; }
form.add input, form.add select {
  width: 100%; border: 1px solid #cfd6d0; border-radius: 9px; padding: 9px 10px; background: #fff;
}
form.add .two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.entry { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid #eef1ee; }
.entry:last-child { border-bottom: none; }
.entry .d { font-size: 11px; color: #8a978f; }
.entry .desc { font-weight: 600; font-size: 13px; }
.entry .cat { font-size: 12px; color: #6b7a72; }
.entry .amt { font-weight: 700; white-space: nowrap; }
.entry .del { background: none; border: none; color: #c0392b; font-size: 16px; padding: 0 2px; }

.auth-wrap { max-width: 420px; margin: 0 auto; padding: 48px 20px; text-align: center; }
.auth-wrap .logo { font-size: 44px; }
.auth-wrap h1 { font-size: 22px; margin: 8px 0 4px; }
.auth-wrap p { color: #6b7a72; font-size: 13px; }
.auth-wrap form { margin-top: 20px; display: grid; gap: 10px; text-align: left; }
.auth-wrap input {
  width: 100%; border: 1px solid #cfd6d0; border-radius: 10px; padding: 12px; background: #fff;
}
.auth-wrap .err { color: #c0392b; font-size: 13px; min-height: 18px; text-align: center; }
.hidden { display: none !important; }
.center { text-align: center; }
.mt8 { margin-top: 8px; }
