/* Base styles. */

:root {
  --bg: #f4f1ea;
  --surface: #fffdf9;
  --surface2: #f8f5ef;
  --text: #252824;
  --muted: #85877f;
  --line: #e7e2d8;
  --green: #47785e;
  --green-soft: #e2eee6;
  --orange: #d98750;
  --orange-soft: #f7e9dc;
  --yellow: #e9c86b;
  --shadow: 0 12px 35px rgba(70, 62, 46, 0.06);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "DM Sans", "Noto Sans SC", sans-serif;
  -webkit-font-smoothing: antialiased;
}
.shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 32px 22px 24px;
  background: rgba(255, 253, 249, 0.8);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(14px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 18px;
  padding: 0 8px 36px;
}
.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 11px;
  background: var(--green);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: serif;
}
.sidebar nav {
  display: grid;
  gap: 7px;
}
.nav-item {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 12px 14px;
  border-radius: 12px;
  text-align: left;
  font: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 13px;
  text-decoration: none;
}
.nav-item span {
  font-size: 19px;
}
.nav-item:hover,
.nav-item.active {
  background: var(--green-soft);
  color: var(--green);
  font-weight: 600;
}
.sidebar-foot {
  margin-top: auto;
}
.privacy {
  display: flex;
  gap: 10px;
  padding: 14px;
  background: var(--surface2);
  border-radius: 14px;
  margin-bottom: 10px;
}
.privacy > span {
  color: var(--green);
}
.privacy b,
.privacy small {
  display: block;
  font-size: 11px;
}
.privacy small {
  color: var(--muted);
  margin-top: 4px;
}
.text-btn {
  background: none;
  border: 0;
  color: var(--green);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  padding: 8px;
}
main {
  padding: 38px 46px 60px;
  max-width: 1500px;
  width: 100%;
  margin: auto;
}
.topbar,
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 30px;
}
.eyebrow {
  color: var(--muted);
  font-size: 12px;
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
h1 {
  font-size: 25px;
  margin: 0;
  font-weight: 600;
}
h2 {
  font-size: 17px;
  margin: 0 0 6px;
}
p {
  margin: 0;
}
.top-actions {
  display: flex;
  gap: 10px;
}
.icon-btn,
.primary-btn {
  border: 0;
  border-radius: 11px;
  font: inherit;
  cursor: pointer;
}
.icon-btn {
  width: 42px;
  height: 42px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
}
.primary-btn {
  background: var(--green);
  color: #fff;
  padding: 11px 18px;
  font-weight: 500;
}
.primary-btn,
.text-btn {
  text-decoration: none;
}
.stats-grid {
  display: grid;
  grid-template-columns: 1.25fr repeat(3, 1fr);
  gap: 16px;
}
.stat-card,
.panel {
  background: var(--surface);
  border: 1px solid rgba(231, 226, 216, 0.8);
  border-radius: 20px;
  box-shadow: var(--shadow);
}
.stat-card {
  padding: 22px;
  min-height: 154px;
}
.stat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
}
.stat-card > strong {
  display: block;
  font-size: 25px;
  margin: 18px 0 6px;
  letter-spacing: -0.03em;
}
.stat-card small,
.panel-head p,
.section-head p {
  color: var(--muted);
  font-size: 12px;
}
.pill {
  font-size: 11px;
  border-radius: 20px;
  padding: 5px 8px;
}
.pill.positive {
  color: var(--green);
  background: var(--green-soft);
}
.round-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}
.round-icon.income {
  color: var(--green);
  background: var(--green-soft);
}
.round-icon.expense {
  color: var(--orange);
  background: var(--orange-soft);
}
.round-icon.asset {
  color: #957722;
  background: #f5edcf;
}
.content-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 16px;
  margin-top: 16px;
}
.panel {
  padding: 22px;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.transaction-list {
  margin-top: 14px;
}
.transaction {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 13px 4px;
  border-top: 1px solid var(--line);
}
.transaction:first-child {
  border-top: 0;
}
.tx-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--surface2);
  display: grid;
  place-items: center;
  font-size: 17px;
}
.tx-info b,
.tx-info small {
  display: block;
}
.tx-info b {
  font-size: 13px;
  margin-bottom: 3px;
}
.tx-info small {
  font-size: 11px;
  color: var(--muted);
}
.tx-amount {
  text-align: right;
  font-size: 13px;
  font-weight: 600;
}
.tx-amount.income {
  color: var(--green);
}
.tx-amount small {
  display: block;
  color: var(--muted);
  font-weight: 400;
  margin-top: 3px;
}
.empty {
  text-align: center;
  padding: 34px;
  color: var(--muted);
  font-size: 13px;
}
.filters {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}
input,
select {
  font: inherit;
  color: var(--text);
  background: var(--surface2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  outline: none;
}
input:focus,
select:focus {
  border-color: var(--green);
}
.filters input {
  flex: 1;
}

.section-head {
  margin-top: 4px;
}
.section-head h2 {
  font-size: 22px;
}

dialog {
  border: 0;
  border-radius: 22px;
  padding: 0;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.2);
  width: min(520px, calc(100% - 28px));
}
dialog::backdrop {
  background: rgba(30, 31, 28, 0.36);
  backdrop-filter: blur(3px);
}
dialog form {
  padding: 26px;
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 20px;
}
.modal-head p {
  font-size: 12px;
  color: var(--muted);
}
.close-btn {
  border: 0;
  background: var(--surface2);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  cursor: pointer;
  color: var(--text);
  font-size: 20px;
}
.type-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--surface2);
  padding: 4px;
  border-radius: 12px;
}
.type-toggle button {
  border: 0;
  padding: 9px;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.type-toggle button.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}
.amount-field {
  display: block;
  margin: 22px 0;
}
.amount-field > span {
  font-size: 12px;
  color: var(--muted);
}
.amount-field div {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
}
.amount-field i {
  font-size: 28px;
  font-style: normal;
}
.amount-field input {
  font-size: 36px;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 12px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.form-grid label,
#simpleFields label {
  display: grid;
  gap: 7px;
  font-size: 12px;
  color: var(--muted);
}
.submit-btn {
  width: 100%;
  margin-top: 22px;
  padding: 13px;
}
#simpleFields {
  display: grid;
  gap: 14px;
}
#toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 20px);
  background: #252824;
  color: white;
  border-radius: 12px;
  padding: 11px 18px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: 0.25s;
  z-index: 20;
}
#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
body.dark {
  --bg: #181b18;
  --surface: #222621;
  --surface2: #2a2e29;
  --text: #eef1eb;
  --muted: #a1a79e;
  --line: #373c35;
  --green: #79ad8b;
  --green-soft: #2b4133;
  --orange: #e59c6c;
  --orange-soft: #453429;
  --shadow: none;
}
.spark {
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--green), transparent);
  opacity: 0.5;
  margin-top: 10px;
}

.stat-link {
  padding: 4px 0;
}
.stat-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.budget-optional-hint {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

:root {
  --chart-1: #2a78d6;
  --chart-2: #eb6834;
  --chart-3: #1baf7a;
  --chart-4: #eda100;
  --chart-5: #e87ba4;
  --chart-6: #008300;
}
body.dark {
  --chart-1: #3987e5;
  --chart-2: #d95926;
  --chart-3: #199e70;
  --chart-4: #c98500;
  --chart-5: #d55181;
  --chart-6: #008300;
}
