:root {
  --bg: #f5fbf1;
  --surface: #ffffff;
  --surface-strong: #eefbe7;
  --primary: #087339;
  --primary-dark: #00462c;
  --accent: #78df18;
  --warning: #f59e0b;
  --danger: #dc2626;
  --success: #37c92d;
  --text: #13231a;
  --muted: #607266;
  --border: #d9ead3;
  --shadow: 0 18px 45px rgba(0, 70, 44, 0.1);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(120, 223, 24, 0.18), transparent 34rem),
    radial-gradient(circle at bottom right, rgba(0, 70, 44, 0.08), transparent 30rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
}

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

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.app-shell.is-auth {
  display: block;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 28px 20px;
  background: var(--primary-dark);
  color: #ffffff;
}

.app-shell.is-auth .sidebar,
.app-shell.is-auth .bottom-nav {
  display: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 34px;
}

.brand__logo {
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  border-radius: 18px;
  background: #ffffff;
  object-fit: cover;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

.brand small {
  display: block;
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.66);
}

.nav {
  display: flex;
  gap: 8px;
}

.nav--desktop {
  flex-direction: column;
}

.nav__item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: 0;
  border-radius: 14px;
  padding: 14px 16px;
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  text-align: left;
  transition:
    background 0.2s ease,
    color 0.2s ease;
}

.nav__item:hover,
.nav__item:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.nav__item.is-active {
  background: #ffffff;
  color: var(--primary-dark);
  box-shadow: 0 12px 28px rgba(0, 42, 26, 0.18);
}

.app {
  width: 100%;
  max-width: 1220px;
  padding: 36px;
}

.app-shell.is-auth .app {
  max-width: 520px;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.screen {
  display: grid;
  gap: 24px;
}

.screen-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 6px;
  color: var(--primary-dark);
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.05;
}

h2 {
  margin-bottom: 16px;
  color: var(--primary-dark);
  font-size: 22px;
}

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

.grid {
  display: grid;
  gap: 18px;
}

.grid--two {
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
}

.grid--actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card {
  border: 1px solid rgba(217, 234, 211, 0.95);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.card__body {
  padding: 22px;
}

.auth-card {
  width: 100%;
}

.auth-logo {
  display: block;
  width: 112px;
  height: 112px;
  margin: 0 auto 18px;
  border-radius: 28px;
  object-fit: cover;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}

.auth-tab {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 11px;
  background: #fbfff8;
  color: var(--muted);
  font-weight: 800;
}

.auth-tab.is-active {
  background: var(--primary);
  color: #ffffff;
}

.balance-card {
  overflow: hidden;
  background:
    radial-gradient(circle at top right, rgba(120, 223, 24, 0.44), transparent 16rem),
    linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #ffffff;
}

.balance-card .card__body {
  min-height: 210px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.balance-card p,
.balance-card .muted {
  color: rgba(255, 255, 255, 0.72);
}

.balance {
  margin: 10px 0;
  font-size: clamp(36px, 6vw, 58px);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.balance-meta,
.profile-row,
.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.balance-meta {
  margin-top: 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  padding-top: 18px;
}

.profile-row {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.profile-row:last-child {
  border-bottom: 0;
}

.profile-row span {
  color: var(--muted);
}

.action-card {
  min-height: 132px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(0, 70, 44, 0.07);
  text-align: left;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease;
}

.action-card:hover {
  transform: translateY(-3px);
  border-color: rgba(120, 223, 24, 0.6);
  box-shadow: 0 16px 34px rgba(0, 70, 44, 0.13);
}

.action-card__icon {
  display: grid;
  width: 44px;
  height: 44px;
  margin-bottom: 14px;
  place-items: center;
  border-radius: 14px;
  background: rgba(120, 223, 24, 0.16);
  font-size: 22px;
}

.action-card__title {
  display: block;
  margin-bottom: 8px;
  color: var(--primary-dark);
  font-size: 18px;
  font-weight: 800;
}

.action-card__text {
  display: block;
  color: var(--muted);
  line-height: 1.45;
}

.transaction {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.transaction:last-child {
  border-bottom: 0;
}

.transaction__icon {
  display: grid;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 13px;
  background: var(--surface-strong);
}

.list-line {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.list-line p {
  margin-bottom: 3px;
  font-weight: 700;
}

.transaction__side {
  display: grid;
  justify-items: end;
  gap: 7px;
}

.amount {
  color: var(--primary-dark);
  font-weight: 800;
  white-space: nowrap;
}

.amount--positive {
  color: var(--success);
}

.amount--negative {
  color: var(--danger);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(55, 201, 45, 0.1);
  color: var(--success);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.form {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 7px;
}

.field label {
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 800;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 13px 14px;
  background: #fbfff8;
  color: var(--text);
  outline: none;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(120, 223, 24, 0.18);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 14px;
  padding: 13px 16px;
  background: var(--primary);
  color: #ffffff;
  font-weight: 800;
}

.button:hover,
.button:focus-visible {
  background: var(--primary-dark);
  box-shadow: 0 12px 26px rgba(0, 70, 44, 0.24);
}

.button--ghost {
  background: #eefbe7;
  color: var(--primary-dark);
}

.form-error {
  min-height: 20px;
  color: var(--danger);
  font-size: 14px;
  font-weight: 700;
}

.message {
  margin-bottom: 16px;
  border-radius: 14px;
  padding: 12px 14px;
  font-weight: 800;
}

.message--success {
  background: rgba(55, 201, 45, 0.11);
  color: var(--success);
}

.message--error {
  background: rgba(220, 38, 38, 0.1);
  color: var(--danger);
}

.table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid var(--border);
  padding: 14px 12px;
  text-align: left;
  vertical-align: top;
}

.data-table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.bottom-nav {
  display: none;
}

@media (max-width: 980px) {
  .app-shell {
    display: block;
    padding-bottom: 86px;
  }

  .sidebar {
    display: none;
  }

  .app {
    padding: 22px 16px;
  }

  .screen-header {
    display: block;
  }

  .grid--two,
  .grid--actions {
    grid-template-columns: 1fr;
  }

  .bottom-nav {
    position: fixed;
    right: 12px;
    bottom: 12px;
    left: 12px;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    border: 1px solid rgba(217, 234, 211, 0.95);
    border-radius: 22px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 16px 38px rgba(0, 70, 44, 0.2);
    backdrop-filter: blur(16px);
  }

  .bottom-nav .nav__item {
    justify-content: center;
    flex-direction: column;
    gap: 4px;
    padding: 10px 6px;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
  }

  .bottom-nav .nav__item.is-active {
    background: var(--primary);
    color: #ffffff;
    box-shadow: none;
  }

  .data-table,
  .data-table thead,
  .data-table tbody,
  .data-table th,
  .data-table td,
  .data-table tr {
    display: block;
  }

  .data-table {
    min-width: 0;
  }

  .data-table thead {
    display: none;
  }

  .data-table tr {
    margin-bottom: 12px;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 10px 12px;
    background: #fbfff8;
  }

  .data-table td {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid var(--border);
    padding: 10px 0;
    text-align: right;
  }

  .data-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-weight: 800;
    text-align: left;
  }
}

@media (max-width: 560px) {
  .transaction {
    align-items: flex-start;
    flex-direction: column;
  }

  .balance-card .card__body {
    min-height: 180px;
  }
}
