:root {
  --bg: #f3f5f4;
  --bg-accent: #d8ebe7;
  --panel: rgba(255, 255, 255, 0.88);
  --panel-strong: #ffffff;
  --text: #14324a;
  --muted: #5f7282;
  --line: rgba(20, 50, 74, 0.12);
  --primary: #0f5d7a;
  --primary-strong: #0a3f59;
  --teal: #12856f;
  --danger: #a14b4b;
  --shadow: 0 18px 40px rgba(15, 63, 89, 0.1);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  font-family: "Manrope", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(18, 133, 111, 0.16), transparent 28%),
    radial-gradient(circle at top right, rgba(15, 93, 122, 0.14), transparent 32%),
    linear-gradient(180deg, #edf6f4 0%, var(--bg) 48%, #eef2f5 100%);
}

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

.page-shell {
  width: min(1200px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 36px 0 48px;
}

.hero {
  display: grid;
  grid-template-columns: 1.7fr 0.95fr;
  gap: 22px;
  align-items: stretch;
  margin-bottom: 24px;
}

.hero-copy,
.hero-note,
.panel,
.stat-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.hero-copy {
  padding: 34px;
  background:
    linear-gradient(135deg, rgba(15, 93, 122, 0.96), rgba(10, 63, 89, 0.96)),
    var(--panel);
  color: #f7fbfc;
}

.hero-note {
  padding: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(240, 248, 246, 0.94)),
    var(--panel);
  position: relative;
  overflow: hidden;
}

.hero-note::after {
  content: "";
  position: absolute;
  inset: auto -10% -30% auto;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(18, 133, 111, 0.18), transparent 70%);
}

.eyebrow,
.panel-kicker,
.note-label,
.stat-label {
  margin: 0 0 8px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.hero h1,
.panel h2 {
  margin: 0;
}

.hero h1 {
  font-size: clamp(2.2rem, 4vw, 3.8rem);
  line-height: 0.96;
  letter-spacing: -0.04em;
}

.hero-text,
.note-text {
  margin: 14px 0 0;
  line-height: 1.65;
  max-width: 58ch;
}

.note-title {
  margin: 6px 0 0;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.stat-card {
  padding: 24px;
}

.stat-card-balance {
  background:
    linear-gradient(135deg, rgba(18, 133, 111, 0.14), rgba(255, 255, 255, 0.96)),
    var(--panel);
}

.stat-value {
  margin: 0;
  font-size: clamp(1.8rem, 2.5vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.04em;
}

.stat-foot,
.panel-caption,
.row-sub,
.empty-state {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(320px, 0.95fr);
  gap: 22px;
}

.primary-column,
.side-column {
  display: grid;
  gap: 22px;
  align-content: start;
}

.panel {
  padding: 24px;
}

.panel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-bottom: 18px;
}

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

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  padding: 0 0 12px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
  text-align: left;
}

tbody td {
  padding: 14px 0;
  border-bottom: 1px solid rgba(20, 50, 74, 0.08);
  vertical-align: top;
}

tbody tr:last-child td {
  border-bottom: none;
}

.row-main {
  font-weight: 700;
}

.amount {
  font-weight: 800;
}

.action-cell {
  width: 1%;
  white-space: nowrap;
  text-align: right;
}

.list-stack {
  display: grid;
  gap: 14px;
}

.list-row,
.category-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(20, 50, 74, 0.08);
}

.list-row:last-child,
.category-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.row-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: end;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.pill-positive {
  background: rgba(18, 133, 111, 0.12);
  color: var(--teal);
}

.pill-negative {
  background: rgba(161, 75, 75, 0.12);
  color: var(--danger);
}

.category-summary {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

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

.stack-form label {
  display: grid;
  gap: 8px;
}

.stack-form span {
  font-size: 0.92rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid rgba(20, 50, 74, 0.14);
  border-radius: var(--radius-md);
  background: var(--panel-strong);
  color: var(--text);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(15, 93, 122, 0.45);
  box-shadow: 0 0 0 4px rgba(15, 93, 122, 0.12);
}

.primary-button,
.ghost-button {
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 160ms ease, background-color 160ms ease, color 160ms ease;
}

.primary-button {
  min-height: 48px;
  padding: 0 18px;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: #f7fbfc;
  font-weight: 800;
}

.secondary-button,
.ghost-button {
  min-height: 34px;
  padding: 0 12px;
  background: rgba(20, 50, 74, 0.06);
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 700;
}

.secondary-button {
  min-height: 42px;
  padding: 0 16px;
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.logout-form {
  position: relative;
  z-index: 1;
  margin-top: 18px;
}

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

.auth-card {
  width: min(100%, 460px);
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(240, 248, 246, 0.94)),
    var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.auth-card h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 2.8rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
}

.auth-text,
.auth-foot {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.auth-error {
  margin: 18px 0 0;
  padding: 12px 14px;
  border: 1px solid rgba(161, 75, 75, 0.22);
  border-radius: var(--radius-md);
  background: rgba(161, 75, 75, 0.08);
  color: var(--danger);
  font-weight: 700;
}

@media (max-width: 1080px) {
  .hero,
  .content-grid,
  .panel-grid,
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100vw - 20px, 100%);
    padding: 18px 0 24px;
  }

  .hero-copy,
  .hero-note,
  .panel,
  .stat-card,
  .auth-card {
    padding: 20px;
    border-radius: 20px;
  }

  .hero h1 {
    font-size: 2.3rem;
  }

  .panel-head,
  .list-row,
  .category-row {
    flex-direction: column;
    align-items: stretch;
  }

  .row-actions {
    align-items: start;
  }

  thead {
    display: none;
  }

  tbody,
  tr,
  td {
    display: block;
    width: 100%;
  }

  tbody td {
    padding: 8px 0;
  }

  tbody tr {
    padding: 10px 0 14px;
    border-bottom: 1px solid rgba(20, 50, 74, 0.08);
  }

  .action-cell {
    text-align: left;
  }
}
