﻿:root {
  --bg: #f3f5f3;
  --card: #ffffff;
  --ink: #1b1d1f;
  --muted: #7b8087;
  --line: #e3e6e3;
  --accent: #19c15a;
  --accent-dark: #0f8f42;
  --shadow: 0 12px 30px rgba(17, 18, 18, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Manrope", "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

h1, h2, h3 {
  margin: 0;
  font-family: "Manrope", "Segoe UI", sans-serif;
}

.app {
  max-width: 720px;
  margin: 0 auto;
  padding: 18px 18px 40px;
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.topbar h1 {
  text-align: center;
  font-size: 1.2rem;
  font-weight: 700;
}

.back,
.logout {
  font-size: 0.95rem;
  padding: 8px 12px;
  color: var(--accent-dark);
  font-weight: 600;
}

.back::before {
  content: "← ";
}

.logout::after {
  content: "";
}

.back-spacer,
.logout-spacer {
  height: 34px;
}

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.page-title {
  font-size: 1.6rem;
  font-weight: 700;
}

.page-subtitle {
  color: var(--muted);
  margin-top: 4px;
  font-size: 1rem;
}

.icon-button {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.hero-card {
  background: var(--card);
  border-radius: 20px;
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  border: 1px solid var(--line);
}

.hero-total {
  font-size: 2.6rem;
  font-weight: 800;
  letter-spacing: -1px;
  text-align: center;
}

.hero-label {
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 0.85rem;
  color: var(--accent-dark);
  font-weight: 700;
  text-align: center;
}

.hero-chip {
  margin: 12px auto 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: #e5f8ec;
  color: var(--accent-dark);
  font-weight: 600;
  font-size: 0.9rem;
}

.card {
  background: var(--card);
  border-radius: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  margin-bottom: 16px;
}

.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.section-subtitle {
  color: var(--muted);
  font-size: 0.95rem;
}

.child-list {
  display: grid;
  gap: 12px;
}

.child-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #e7f5ee;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--accent-dark);
}

.child-name {
  font-size: 1.1rem;
  font-weight: 700;
}

.child-meta {
  color: var(--muted);
  font-size: 0.95rem;
}

.child-balance {
  color: var(--accent);
  font-weight: 700;
}

.chevron {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f1f3f1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--muted);
}

.action-card {
  border: 2px dashed #cfd6cf;
  background: #f4f6f4;
  box-shadow: none;
  justify-content: center;
  text-align: center;
  gap: 10px;
}

.action-card .avatar {
  background: #e7edf0;
  color: var(--muted);
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}

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

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--card);
  font-weight: 700;
  gap: 8px;
}

.button.primary {
  background: var(--accent);
  color: #ffffff;
  border-color: transparent;
}

.button.secondary {
  background: var(--card);
  border-color: #d7dbd7;
  color: var(--accent-dark);
}

.form {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.form input,
.form select,
.form textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  font-family: inherit;
  font-size: 1rem;
  background: #f8faf8;
}

.form textarea {
  resize: vertical;
  min-height: 70px;
}

.jar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
}

.jar-card {
  background: var(--card);
  border-radius: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  text-align: center;
  box-shadow: var(--shadow);
}

.jar-icon {
  width: 46px;
  height: 46px;
  margin: 0 auto 10px;
  border-radius: 50%;
  background: #e9f1ff;
  color: #3f6fd9;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.jar-card .jar-balance {
  font-size: 1.4rem;
  font-weight: 800;
}

.jar-card .muted {
  font-size: 0.9rem;
}

.history {
  display: grid;
  gap: 0;
  margin-top: 12px;
}

.history-item {
  display: grid;
  gap: 2px;
  padding: 10px 2px 12px;
  border-bottom: 1px solid #e5e9e5;
}

.history-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.history-amount {
  font-weight: 700;
  color: var(--accent-dark);
}

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

.history-amount.negative {
  color: #d04444;
}

.history-concept {
  color: var(--muted);
  font-size: 0.92rem;
  padding-left: 6px;
}

.notice {
  padding: 12px;
  border-radius: 14px;
  background: #e8f7ee;
  border: 1px solid #c9ebd4;
  color: var(--accent-dark);
  margin-bottom: 12px;
}

.empty {
  text-align: center;
  padding: 18px;
  color: var(--muted);
}

.config-list {
  display: grid;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: var(--card);
}

.config-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.config-item:last-child {
  border-bottom: none;
}

.config-item strong {
  font-size: 1rem;
}

.config-item .muted {
  font-size: 0.9rem;
}

.config-item .form {
  margin-top: 0;
  width: 100%;
}

.config-item .form .button {
  width: 100%;
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(20, 18, 16, 0.55);
  z-index: 100;
}

.modal.open {
  display: flex;
}

.modal-card {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border-radius: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.modal-close {
  border: none;
  background: #eef2ee;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.85rem;
}

@media (min-width: 600px) {
  .app {
    padding: 26px 24px 50px;
  }

  .page-title {
    font-size: 1.8rem;
  }
}
