:root {
  --bg: #f4efe8;
  --panel: #fff9f3;
  --panel-2: #fef3e4;
  --text: #1f1f1f;
  --muted: #5f5f5f;
  --accent: #006d77;
  --accent-2: #d1495b;
  --line: #e1d5c8;
  --ok: #1f8f5f;
  --locked: #8a3b2e;
  --shadow: 0 10px 24px rgba(48, 32, 13, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 20% 20%, #fff7eb, var(--bg));
  position: relative;
}

.bg-shape {
  position: fixed;
  border-radius: 999px;
  filter: blur(28px);
  opacity: 0.33;
  pointer-events: none;
}

.bg-shape-1 {
  width: 280px;
  height: 280px;
  background: #c6d8ff;
  top: -30px;
  right: -80px;
}

.bg-shape-2 {
  width: 280px;
  height: 280px;
  background: #ffd4b7;
  bottom: 40px;
  left: -80px;
}

.app-shell {
  width: min(1024px, 92vw);
  margin: 36px auto;
  display: grid;
  gap: 18px;
  position: relative;
  z-index: 1;
}

.hero h1 {
  margin: 0;
  font-family: "Charter", "Georgia", serif;
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: 0.02em;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.74rem;
  color: var(--muted);
}

.subtitle {
  margin-top: 8px;
  color: var(--muted);
}

.panel {
  background: linear-gradient(145deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow);
  animation: rise 0.35s ease both;
}

@keyframes rise {
  from {
    transform: translateY(8px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.panel h2 {
  margin: 0 0 12px;
  font-size: 1.15rem;
}

.badge {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
}

.badge-locked {
  color: #fff;
  background: var(--locked);
}

.badge-unlocked {
  color: #fff;
  background: var(--ok);
}

.pin-row,
.settings-grid,
.actions-grid {
  display: grid;
  gap: 10px;
}

.pin-row {
  grid-template-columns: 1fr auto auto;
  align-items: end;
}

.settings-grid {
  margin-top: 14px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.admin-settings-grid {
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 12px;
  align-items: end;
}

.rate-field {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffdf9;
  padding: 10px;
  display: grid;
  gap: 8px;
}

.apy-info {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.admin-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(140px, 1fr));
  gap: 10px;
}

.admin-actions .btn {
  width: 100%;
}

.change-pin-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.settings-grid[aria-disabled="true"] {
  opacity: 0.55;
  pointer-events: none;
}

label {
  display: grid;
  gap: 6px;
  font-size: 0.86rem;
  color: var(--muted);
}

input,
select {
  width: 100%;
  padding: 10px 11px;
  border: 1px solid #d6c8b9;
  border-radius: 10px;
  background: #fff;
  color: var(--text);
}

.btn {
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  font-weight: 600;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-ghost {
  background: #fff;
  border-color: var(--line);
  color: var(--text);
}

.btn-danger {
  background: transparent;
  border-color: #e8b5bc;
  color: var(--accent-2);
}

.interest-info {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.84rem;
}

.kid-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.kid-tab {
  border: 1px solid var(--line);
  background: #fff;
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
}

.kid-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.accounts {
  display: grid;
  gap: 12px;
}

.account-card {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 14px;
  padding: 12px;
}

.account-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.account-head h3 {
  margin: 0;
}

.balances {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  margin: 10px 0 8px;
}

.balances p {
  margin: 0;
}

.cd-maturity {
  margin: 4px 0 10px;
  color: var(--muted);
  font-size: 0.82rem;
}

.action-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 7px;
}

.account-error {
  margin: 8px 0 0;
  color: var(--accent-2);
  min-height: 1.2em;
  font-size: 0.82rem;
}

.ledger-section {
  margin-top: 14px;
  border-top: 1px dashed #dfcfbf;
  padding-top: 10px;
}

.ledger-section h4 {
  margin: 0 0 8px;
}

.ledger-list-wrap {
  max-height: 210px;
  overflow-y: auto;
}

.ledger-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 7px;
}

.ledger-item {
  border: 1px solid #ebdecf;
  border-radius: 9px;
  padding: 8px;
  background: #fffcf8;
}

.ledger-main {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.9rem;
}

.ledger-meta {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
}

.hidden {
  display: none;
}

@media (max-width: 760px) {
  .panel-header {
    flex-wrap: wrap;
  }

  .pin-row {
    grid-template-columns: 1fr;
  }

  .admin-settings-grid {
    grid-template-columns: 1fr;
  }

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

  .change-pin-row {
    grid-template-columns: 1fr;
  }
}
