
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --green: #176b45;
  --green-dark: #104b33;
  --green-light: #eaf4ed;
  --background: #f5f7f4;
  --text: #18251e;
  --muted: #77847b;
  --border: #e7ece7;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
}

button, input, select { font: inherit; }
button { cursor: pointer; }

.app { min-height: 100vh; display: flex; }

.sidebar {
  width: 235px;
  background: white;
  border-right: 1px solid var(--border);
  padding: 30px 18px;
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
}

.brand {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -1px;
  display: flex;
  align-items: center;
  gap: 9px;
}

.brand-icon {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--green);
  color: white;
  font-size: 25px;
}

nav {
  display: grid;
  gap: 8px;
  margin-top: 55px;
}

.nav {
  border: 0;
  background: transparent;
  color: #718077;
  text-align: left;
  padding: 13px;
  border-radius: 10px;
  font-weight: 600;
}

.nav.active, .nav:hover {
  background: var(--green-light);
  color: var(--green);
}

.sidebar-note {
  margin-top: auto;
  color: var(--green);
  font-weight: 700;
  line-height: 1.6;
  padding: 12px;
}

main {
  margin-left: 235px;
  width: calc(100% - 235px);
  max-width: 1500px;
  padding: 35px 5%;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
}

h1 {
  font-size: 29px;
  margin: 4px 0;
  letter-spacing: -1px;
}

h2, h3, p { margin-top: 0; }

h3 {
  font-size: 18px;
  margin-bottom: 18px;
}

.eyebrow {
  font-size: 10px;
  letter-spacing: 1.5px;
  font-weight: 800;
  color: var(--muted);
  margin-bottom: 8px;
}

.avatar {
  width: 40px;
  height: 40px;
  background: var(--green-light);
  color: var(--green);
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-weight: 800;
}

.welcome {
  background: var(--green-dark);
  color: white;
  border-radius: 18px;
  padding: 28px 32px;
  min-height: 190px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  overflow: hidden;
}

.welcome h2 {
  font-size: 30px;
  line-height: 1.15;
  letter-spacing: -1px;
  margin: 10px 0;
}

.welcome p:last-child {
  color: #d0e1d6;
  margin: 0;
  font-size: 13px;
}

.light { color: #b6d8c2; }

.welcome-mark {
  font-size: 130px;
  font-weight: 800;
  color: #ffffff16;
  transform: rotate(-10deg);
}

.stats {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 15px;
  margin: 18px 0;
}

.stat, .panel {
  background: white;
  border: 1px solid var(--border);
  border-radius: 15px;
  padding: 22px;
}

.stat p {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 12px;
}

.stat h2 {
  font-size: 25px;
  margin-bottom: 8px;
  letter-spacing: -1px;
}

.stat small {
  color: var(--muted);
  font-size: 11px;
}

.positive { color: var(--green) !important; }
.negative { color: #c26b5b !important; }

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-bottom: 18px;
}

.panel { margin-bottom: 18px; }

.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.panel-heading h3 { margin-bottom: 18px; }

.pill {
  background: var(--green-light);
  color: var(--green);
  padding: 6px 10px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
}

.big-number {
  font-size: 34px;
  letter-spacing: -1.5px;
  margin: 8px 0;
}

.muted {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.progress {
  height: 8px;
  background: #edf1ed;
  border-radius: 10px;
  overflow: hidden;
  margin: 20px 0 12px;
}

.progress div {
  height: 100%;
  width: 0;
  background: var(--green);
  border-radius: 10px;
  transition: width .3s;
}

.split {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11px;
}

.split strong { color: var(--text); }

label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  margin: 12px 0 6px;
}

input, select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 11px;
  background: #fff;
  outline: none;
}

input:focus, select:focus { border-color: var(--green); }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.primary {
  background: var(--green);
  color: white;
  border: 0;
  padding: 12px 17px;
  border-radius: 9px;
  font-weight: 700;
  margin-top: 14px;
}

.primary:hover { background: var(--green-dark); }

.text-button {
  border: 0;
  background: none;
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
}

.transaction {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
  gap: 10px;
}

.transaction:last-child { border-bottom: 0; }

.transaction strong { font-size: 13px; }

.transaction small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-top: 4px;
}

.amount {
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.amount.income { color: var(--green); }
.amount.expense { color: #c26b5b; }

.delete {
  border: 0;
  background: #f7eeee;
  color: #a64d4d;
  border-radius: 7px;
  padding: 6px 9px;
}

.goal-form {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 10px;
  align-items: end;
  margin: 20px 0;
}

.goal-form .primary {
  margin: 0;
  white-space: nowrap;
}

.goal {
  border-top: 1px solid var(--border);
  padding: 18px 0;
}

.goal-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
}

.goal-top span { color: var(--muted); }

.goal-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.goal-actions input { max-width: 140px; }
.goal-actions button { margin: 0; }

.forecast-tabs {
  display: flex;
  gap: 8px;
  margin: 20px 0;
}

.period {
  border: 1px solid var(--border);
  background: white;
  border-radius: 20px;
  padding: 9px 15px;
  font-size: 12px;
}

.period.active {
  background: var(--green);
  color: white;
  border-color: var(--green);
}

footer {
  text-align: center;
  font-size: 9px;
  letter-spacing: 1px;
  color: #9aa59c;
  padding: 18px;
}

.hidden { display: none; }

@media(max-width: 800px) {
  .sidebar {
    width: 100%;
    height: auto;
    position: static;
    padding: 13px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .app { display: block; }
  .brand { font-size: 18px; }

  nav {
    display: flex;
    overflow-x: auto;
    margin-top: 12px;
    gap: 4px;
  }

  .nav {
    white-space: nowrap;
    font-size: 11px;
    padding: 10px;
  }

  .sidebar-note { display: none; }

  main {
    margin: 0;
    width: 100%;
    padding: 22px 15px;
  }

  .stats { grid-template-columns: 1fr 1fr; }
  .balance { grid-column: span 2; }
  .grid { grid-template-columns: 1fr; }
}

@media(max-width: 430px) {
  .welcome {
    padding: 23px;
    min-height: 165px;
  }

  .welcome h2 { font-size: 25px; }
  .welcome-mark { font-size: 85px; }

  .stat, .panel { padding: 17px; }
  .stat h2 { font-size: 21px; }

  .goal-form { grid-template-columns: 1fr 1fr; }
  .goal-form .primary { grid-column: span 2; }
}
