:root {
  --sbi-navy: #292075;
  --sbi-blue: #00b5ef;
  --sbi-deep: #22409a;
  --surface: #f4f8fc;
  --card: #ffffff;
  --ink: #1a1a2e;
  --muted: #5a6472;
  --success: #0b7a45;
  --danger: #b42318;
  --border: #d7e3f0;
  --radius: 16px;
  --shadow: 0 8px 24px rgba(41, 32, 117, 0.08);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --nav-h: 72px;
  --font: "IBM Plex Sans", system-ui, sans-serif;
  --display: "Source Serif 4", Georgia, serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--surface);
  min-height: 100dvh;
}

a {
  color: var(--sbi-deep);
  text-decoration: none;
}

img {
  max-width: 100%;
}

.app-shell {
  max-width: 720px;
  margin: 0 auto;
  min-height: 100dvh;
  padding-bottom: calc(var(--nav-h) + var(--safe-bottom) + 16px);
}

.topbar {
  background: var(--sbi-navy);
  color: #fff;
  padding: 18px 20px 0;
}

.brand {
  font-family: var(--display);
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  margin: 0;
}

.brand-sub {
  margin: 4px 0 14px;
  font-size: 0.95rem;
  opacity: 0.9;
}

.passbook-strip {
  height: 6px;
  background: linear-gradient(90deg, var(--sbi-blue), var(--sbi-navy));
}

.page {
  padding: 20px;
}

h1,
h2,
h3 {
  font-family: var(--font);
  line-height: 1.25;
  margin: 0 0 12px;
  color: var(--sbi-navy);
}

h1 {
  font-size: 1.6rem;
}

h2 {
  font-size: 1.25rem;
}

.muted {
  color: var(--muted);
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 16px;
}

.card-quiet {
  box-shadow: none;
}

.stat {
  display: grid;
  gap: 4px;
}

.stat-label {
  font-size: 0.95rem;
  color: var(--muted);
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--sbi-navy);
  letter-spacing: -0.02em;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 12px 18px;
  border-radius: 14px;
  border: 2px solid transparent;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 160ms ease, background 160ms ease, opacity 160ms ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--sbi-blue);
  color: #05314a;
  width: 100%;
}

.btn-navy {
  background: var(--sbi-navy);
  color: #fff;
  width: 100%;
}

.btn-ghost {
  background: #fff;
  border-color: var(--border);
  color: var(--sbi-navy);
  width: 100%;
}

.btn-danger {
  background: #fff;
  border-color: var(--danger);
  color: var(--danger);
}

.btn-row {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

label {
  display: block;
  font-weight: 600;
  margin: 0 0 6px;
  color: var(--sbi-navy);
}

input,
select,
textarea {
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: 14px;
  font: inherit;
  background: #fff;
  color: var(--ink);
}

textarea {
  min-height: 140px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(0, 181, 239, 0.35);
  border-color: var(--sbi-blue);
}

.field {
  margin-bottom: 16px;
}

.helper {
  margin-top: 6px;
  font-size: 0.95rem;
  color: var(--muted);
}

.error {
  background: #fff1f0;
  border: 1px solid #f5c2c0;
  color: var(--danger);
  padding: 12px 14px;
  border-radius: 12px;
  margin-bottom: 14px;
}

.success {
  background: #eef9f2;
  border: 1px solid #b7e4c7;
  color: var(--success);
  padding: 12px 14px;
  border-radius: 12px;
  margin-bottom: 14px;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
}

.chip-cash {
  background: #e8f7ee;
  color: var(--success);
}

.chip-cheque {
  background: #eaf0fb;
  color: var(--sbi-deep);
}

.list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.list li {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.list li:last-child {
  border-bottom: 0;
}

.list-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.amount {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--sbi-navy);
  white-space: nowrap;
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(var(--nav-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: #fff;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  z-index: 40;
}

.bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  min-height: var(--nav-h);
}

.bottom-nav a.active {
  color: var(--sbi-navy);
}

.bottom-nav svg {
  width: 24px;
  height: 24px;
}

.login-wrap {
  min-height: 100dvh;
  display: grid;
  align-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at top right, rgba(0, 181, 239, 0.18), transparent 40%),
    linear-gradient(180deg, #eef6fc, var(--surface));
}

.login-card {
  max-width: 440px;
  margin: 0 auto;
  width: 100%;
}

.check-grid {
  display: grid;
  gap: 10px;
}

.check-item {
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 48px;
  padding: 10px 12px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: #fff;
}

.check-item input {
  width: 22px;
  height: 22px;
  min-height: 22px;
}

.table-simple {
  width: 100%;
  border-collapse: collapse;
}

.table-simple th,
.table-simple td {
  text-align: left;
  padding: 12px 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.table-simple th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.95rem;
}

.stack-sm {
  display: grid;
  gap: 8px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}
