:root {
  --brand: #0b3b3c;
  --brand-2: #12595a;
  --brand-ink: #e9f2f1;
  --gold: #c8a96a;
  --bg: #f4f5f2;
  --surface: #ffffff;
  --ink: #16201f;
  --ink-2: #4d5a59;
  --ink-3: #7c8786;
  --line: #e3e6e2;
  --pos: #137a4b;
  --neg: #16201f;
  --danger: #b4232f;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 32, 31, .06), 0 4px 16px rgba(16, 32, 31, .05);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-2); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; cursor: pointer; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }

/* ---------- Buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 10px; padding: 12px 20px; font-weight: 600;
  background: var(--brand); color: #fff; transition: background .15s, transform .05s;
}
.btn:hover { background: var(--brand-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .75; cursor: progress; }
.btn-ghost { background: transparent; color: var(--brand); border: 1px solid var(--line); }
.btn-ghost:hover { background: #eef2f0; }
.btn-block { width: 100%; }
.spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.35); border-top-color: #fff;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.field { display: block; margin-bottom: 18px; }
.field span { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.field input {
  width: 100%; padding: 13px 14px; border-radius: 10px;
  border: 1px solid #cfd5d1; background: #fff; font: inherit; color: var(--ink);
}
.field input:focus { outline: none; border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(18, 89, 90, .15); }
.error { color: var(--danger); font-size: 13px; margin: -8px 0 14px; min-height: 0; }

/* ---------- Logo ---------- */
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; letter-spacing: -.01em; color: inherit; }
.logo:hover { text-decoration: none; }
.logo svg { width: 32px; height: 32px; flex: none; }
.logo small { display: block; font-size: 10px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; opacity: .7; }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.login-brand {
  background: radial-gradient(1200px 600px at 0% 100%, #155f5f 0%, transparent 60%), var(--brand);
  color: var(--brand-ink); padding: 40px 56px; display: flex; flex-direction: column;
}
.login-brand h1 { font-size: 44px; line-height: 1.1; letter-spacing: -.025em; margin: auto 0 18px; max-width: 12ch; font-weight: 700; }
.login-brand h1 em { font-style: normal; color: var(--gold); }
.login-brand p { max-width: 42ch; opacity: .8; margin: 0 0 40px; font-size: 16px; }
.login-points { display: grid; gap: 14px; margin: 0 0 auto; padding: 0; list-style: none; }
.login-points li { display: flex; gap: 12px; align-items: center; opacity: .9; }
.login-points svg { width: 20px; height: 20px; color: var(--gold); flex: none; }
.login-brand footer { font-size: 12px; opacity: .55; margin-top: 40px; }

.login-panel { display: flex; flex-direction: column; justify-content: center; padding: 40px 24px; }
.login-card { width: 100%; max-width: 400px; margin: 0 auto; }
.login-card h2 { font-size: 26px; letter-spacing: -.02em; margin: 0 0 6px; }
.login-card .lead { color: var(--ink-2); margin: 0 0 28px; }
.login-row { display: flex; justify-content: space-between; align-items: center; margin: -4px 0 22px; font-size: 14px; }
.login-row label { display: flex; gap: 8px; align-items: center; color: var(--ink-2); }
.login-help { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-3); display: flex; gap: 10px; }
.login-help svg { width: 18px; height: 18px; flex: none; color: var(--brand-2); margin-top: 1px; }
.otp-input { letter-spacing: .6em; font-size: 22px !important; text-align: center; font-variant-numeric: tabular-nums; }
.step[hidden] { display: none; }
.back-link { background: none; border: 0; color: var(--brand-2); padding: 0; margin-top: 16px; font-size: 14px; }

/* ---------- App header ---------- */
.topbar { background: var(--brand); color: var(--brand-ink); }
.topbar-inner { max-width: 1180px; margin: 0 auto; padding: 0 24px; height: 68px; display: flex; align-items: center; gap: 32px; }
.nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav a, .nav button {
  color: rgba(233, 242, 241, .78); background: none; border: 0; padding: 8px 14px; border-radius: 8px; font-weight: 500; font-size: 14px; white-space: nowrap;
}
.nav a:hover, .nav button:hover { color: #fff; background: rgba(255,255,255,.08); text-decoration: none; }
.nav a.active { color: #fff; background: rgba(255,255,255,.12); }
.user { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--gold); color: var(--brand); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.logout { background: none; border: 1px solid rgba(255,255,255,.25); color: #fff; border-radius: 8px; padding: 7px 12px; font-size: 13px; }
.logout:hover { background: rgba(255,255,255,.1); }

.page { max-width: 1180px; margin: 0 auto; padding: 32px 24px 64px; }
.greeting { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.greeting h1 { font-size: 28px; letter-spacing: -.02em; margin: 0; }
.greeting p { margin: 4px 0 0; color: var(--ink-3); font-size: 14px; }

.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 22px 24px; }
.card h3 { margin: 0 0 14px; font-size: 15px; }

/* ---------- Accounts ---------- */
.accounts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }
.acct {
  text-align: left; border: 2px solid transparent; padding: 20px 22px; background: var(--surface);
  border-radius: var(--radius); box-shadow: var(--shadow); transition: border-color .15s, transform .15s; color: inherit;
}
.acct:hover { transform: translateY(-1px); }
.acct.selected { border-color: var(--brand-2); }
.acct-name { font-weight: 600; font-size: 14px; }
.acct-num { color: var(--ink-3); font-size: 13px; margin-top: 2px; }
.acct-bal { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin-top: 18px; }
.acct-sub { color: var(--ink-3); font-size: 13px; }
.acct-tag { float: right; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--brand-2); background: #e6efed; padding: 3px 8px; border-radius: 999px; }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.aside { display: grid; gap: 24px; }

.tx-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 22px 24px 16px; border-bottom: 1px solid var(--line); }
.tx-head h2 { margin: 0; font-size: 18px; }
.tx-head p { margin: 2px 0 0; color: var(--ink-3); font-size: 13px; }
.search { position: relative; }
.search input { padding: 9px 12px 9px 34px; border: 1px solid var(--line); border-radius: 9px; font: inherit; font-size: 14px; width: 220px; background: #fafbfa; }
.search input:focus { outline: none; border-color: var(--brand-2); background: #fff; }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--ink-3); }
.tx-day { padding: 10px 24px; background: #fafbfa; font-size: 12px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; border-bottom: 1px solid var(--line); }
.tx { display: flex; align-items: center; gap: 14px; padding: 13px 24px; border-bottom: 1px solid var(--line); }
.tx:last-child { border-bottom: 0; }
.tx-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: #eef2f0; color: var(--brand-2); font-weight: 700; font-size: 13px; flex: none; }
.tx-main { flex: 1; min-width: 0; }
.tx-desc { font-weight: 500; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-cat { font-size: 12px; color: var(--ink-3); }
.tx-amt { font-weight: 600; font-size: 14px; text-align: right; }
.tx-amt.in { color: var(--pos); }
.tx-bal { font-size: 12px; color: var(--ink-3); text-align: right; }
.tx-empty { padding: 40px 24px; text-align: center; color: var(--ink-3); }
.tx-foot { padding: 16px 24px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; font-size: 14px; }

.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.action {
  display: flex; flex-direction: column; gap: 8px; align-items: flex-start; padding: 14px; border-radius: 12px;
  border: 1px solid var(--line); background: #fff; color: var(--ink); font-size: 13px; font-weight: 600; text-align: left;
}
.action:hover { border-color: var(--brand-2); text-decoration: none; }
.action svg { width: 20px; height: 20px; color: var(--brand-2); }

.bars { display: grid; gap: 12px; }
.bar-row { font-size: 13px; }
.bar-label { display: flex; justify-content: space-between; margin-bottom: 5px; }
.bar { height: 8px; background: #eef2f0; border-radius: 999px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--brand-2); border-radius: 999px; }

.promo { background: var(--brand); color: var(--brand-ink); }
.promo h3 { color: #fff; }
.promo p { opacity: .8; font-size: 14px; margin: 0 0 16px; }
.promo .btn { background: var(--gold); color: var(--brand); }

/* ---------- Statements ---------- */
.tabs { display: inline-flex; background: #e8ece9; border-radius: 11px; padding: 4px; gap: 4px; margin-bottom: 20px; flex-wrap: wrap; }
.tabs button { border: 0; background: none; padding: 9px 16px; border-radius: 8px; font-weight: 600; font-size: 14px; color: var(--ink-2); }
.tabs button.active { background: #fff; color: var(--ink); box-shadow: var(--shadow); }
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 18px; background: #e6efed; border-radius: 12px; font-size: 14px; color: var(--brand); margin-bottom: 20px; }
.notice svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.year { padding: 12px 24px; font-size: 13px; font-weight: 700; color: var(--ink-2); background: #fafbfa; border-bottom: 1px solid var(--line); }
.stmt { display: flex; align-items: center; gap: 16px; padding: 16px 24px; border-bottom: 1px solid var(--line); color: inherit; }
.stmt:hover { background: #f7faf9; text-decoration: none; }
.stmt:last-child { border-bottom: 0; }
.stmt-icon { width: 40px; height: 48px; border-radius: 6px; background: #fbeaea; color: #b4232f; display: grid; place-items: center; font-size: 10px; font-weight: 800; flex: none; position: relative; }
.stmt-main { flex: 1; min-width: 0; }
.stmt-title { font-weight: 600; }
.stmt-sub { font-size: 13px; color: var(--ink-3); }
.stmt-bal { text-align: right; font-size: 14px; }
.stmt-bal small { display: block; color: var(--ink-3); font-size: 12px; }
.stmt-go { color: var(--brand-2); font-weight: 600; font-size: 14px; white-space: nowrap; }
.new-badge { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; background: var(--gold); color: var(--brand); padding: 2px 7px; border-radius: 999px; margin-left: 8px; vertical-align: 2px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0;
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 10px; font-size: 14px;
  transition: opacity .2s, transform .2s; pointer-events: none; z-index: 50; max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .login { grid-template-columns: 1fr; }
  .login-brand { padding: 28px 24px; }
  .login-brand h1, .login-brand p, .login-points, .login-brand footer { display: none; }
  .layout { grid-template-columns: 1fr; }
  .accounts { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .topbar-inner { padding: 0 16px; gap: 12px; height: auto; flex-wrap: wrap; padding-top: 12px; }
  .nav { order: 3; flex-basis: 100%; padding-bottom: 8px; }
  .user { margin-left: auto; }
  .user-name { display: none; }
  .page { padding: 24px 16px 48px; }
  .search input { width: 100%; }
  .search { flex-basis: 100%; }
  .tx, .tx-day, .tx-head, .tx-foot, .stmt, .year { padding-left: 16px; padding-right: 16px; }
  .tx-bal, .stmt-bal { display: none; }
}
