/* ============================================================
   Bank of Baroda — design system
   A light retail-banking theme with orange/red Baroda
   accents, warm off-white surfaces, and ledger-grade
   monospace numerals for every figure of money.
   Fully self-contained — no runtime CSS framework dependency.
   ============================================================ */

:root {
  /* Canvas + surfaces */
  --ink: #FFFFFF;
  --ink-2: #FFF6F1;
  --surface: #FFFFFF;
  --surface-2: #FBF3EE;
  --surface-3: #F4E9E2;
  --line: #ECDDD4;
  --line-soft: #F3E7E0;

  /* Text */
  --text: #1A1410;
  --muted: #6B5E55;
  --faint: #A2938A;

  /* Bank of Baroda accent */
  --aurora-a: #F15A29;
  --aurora-b: #C8102E;
  --aurora: linear-gradient(120deg, #F15A29 0%, #E8431F 45%, #C8102E 100%);
  --aurora-soft: linear-gradient(120deg, rgba(241,90,41,0.12), rgba(200,16,36,0.12));

  /* Semantics */
  --credit: #1E8E5A;
  --debit: #C8102E;
  --warn: #C77A11;

  /* Type */
  --font-display: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, sans-serif;
  --font-mono: "Space Mono", "SFMono-Regular", ui-monospace, monospace;

  /* Geometry */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-pill: 999px;
  --shadow: 0 18px 40px -24px rgba(60,20,10,0.28);
  --shadow-lg: 0 30px 70px -30px rgba(60,20,10,0.32);

  --sidebar-w: 248px;
  --maxw: 1180px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--ink);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--aurora-a); outline-offset: 2px; border-radius: 4px; }

.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.muted { color: var(--muted); }
.credit { color: var(--credit); }
.debit { color: var(--debit); }
.center { text-align: center; }

/* ---------- Auth screen ---------- */
.auth-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
}
.auth-aside {
  position: relative;
  padding: 56px 52px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  background:
    radial-gradient(700px 500px at 20% 20%, rgba(200, 16, 36, 0.28), transparent 60%),
    radial-gradient(600px 500px at 90% 90%, rgba(241, 90, 41, 0.22), transparent 60%),
    var(--ink-2);
  border-right: 1px solid var(--line);
}
.auth-aside::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(600px 400px at 30% 40%, #000, transparent 75%);
  pointer-events: none;
}
.auth-aside .brand-lg { position: relative; z-index: 1; }
.aurora-headline {
  position: relative;
  z-index: 1;
  font-family: var(--font-display);
  font-size: clamp(34px, 4.4vw, 58px);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin: 0 0 18px;
}
.aurora-headline .accent {
  background: var(--aurora);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.auth-aside p { position: relative; z-index: 1; color: var(--muted); max-width: 30ch; }
.auth-stats { position: relative; z-index: 1; display: flex; gap: 32px; }
.auth-stats .k { font-family: var(--font-mono); font-size: 26px; color: var(--text); }
.auth-stats .l { font-size: 12px; color: var(--faint); text-transform: uppercase; letter-spacing: 0.14em; }

.auth-main { display: flex; align-items: center; justify-content: center; padding: 32px; }
.auth-card { width: 100%; max-width: 392px; }
.auth-card h2 { font-family: var(--font-display); font-size: 26px; margin: 0 0 4px; letter-spacing: -0.02em; }
.auth-card .sub { color: var(--muted); margin: 0 0 26px; font-size: 14px; }
.demo-hint {
  margin-top: 18px;
  padding: 12px 14px;
  border: 1px dashed var(--line);
  border-radius: var(--r-md);
  font-size: 13px;
  color: var(--muted);
}
.demo-hint b { color: var(--text); font-family: var(--font-mono); }

/* ---------- Brand ---------- */
.brand { display: flex; align-items: center; gap: 11px; }
.brand .mark {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--aurora-soft);
  border: 1px solid var(--line);
}
.brand .mark svg { width: 20px; height: 20px; }
.brand .name { font-family: var(--font-display); font-weight: 700; font-size: 18px; letter-spacing: -0.01em; }
.brand-lg .name { font-size: 22px; }

/* ---------- App shell ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; align-self: start;
  height: 100vh;
  display: flex; flex-direction: column;
  padding: 22px 16px;
  background: linear-gradient(180deg, rgba(20,26,46,0.9), rgba(9,13,26,0.9));
  border-right: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
.sidebar .brand { padding: 4px 8px 22px; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-section { font-size: 11px; text-transform: uppercase; letter-spacing: 0.16em; color: var(--faint); padding: 16px 12px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--r-md);
  color: var(--muted); font-size: 14px; font-weight: 500;
  border: 1px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.nav-item svg { width: 18px; height: 18px; flex: none; }
.nav-item:hover { color: var(--text); background: rgba(255,255,255,0.03); }
.nav-item.active {
  color: var(--text);
  background: var(--aurora-soft);
  border-color: rgba(200,16,36,0.35);
}
.nav-item.active svg { color: var(--aurora-a); }

.sidebar-foot { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 8px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-md); }
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; flex: none;
  font-family: var(--font-display); font-weight: 700; font-size: 14px; color: var(--ink);
  background: var(--aurora);
}
.user-chip .nm { font-size: 13px; font-weight: 600; }
.user-chip .em { font-size: 11px; color: var(--faint); }

/* ---------- Main / topbar ---------- */
.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 28px;
  background: rgba(11,16,32,0.72);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}
.topbar .page-title { font-family: var(--font-display); font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
.topbar .page-eyebrow { font-size: 12px; color: var(--faint); text-transform: uppercase; letter-spacing: 0.14em; }
.menu-btn { display: none; }
.content { padding: 28px; max-width: var(--maxw); width: 100%; margin: 0 auto; }

/* ---------- Panels & cards ---------- */
.panel {
  background: linear-gradient(180deg, var(--surface), rgba(20,26,46,0.6));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}
.panel-pad { padding: 22px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line-soft); }
.panel-head h3 { margin: 0; font-family: var(--font-display); font-size: 16px; font-weight: 600; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.cols-main { grid-template-columns: 1.6fr 1fr; align-items: start; }

/* Balance hero */
.hero {
  position: relative; overflow: hidden;
  border-radius: var(--r-lg);
  border: 1px solid rgba(200,16,36,0.35);
  background:
    radial-gradient(600px 220px at 8% -40%, rgba(241,90,41,0.35), transparent 60%),
    radial-gradient(600px 240px at 100% -30%, rgba(200,16,36,0.4), transparent 60%),
    linear-gradient(180deg, var(--surface-2), var(--surface));
  padding: 26px 28px;
}
.hero::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--aurora);
  filter: blur(0.4px);
}
.hero .label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.16em; color: var(--muted); }
.hero .amount {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-size: clamp(38px, 5.4vw, 56px); font-weight: 700; letter-spacing: -0.03em;
  margin: 8px 0 2px; line-height: 1;
}
.hero .sub { color: var(--muted); font-size: 13px; }
.hero-actions { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }

/* Account / bank card visual */
.bankcard {
  position: relative; overflow: hidden;
  border-radius: var(--r-md);
  padding: 20px;
  min-height: 168px;
  display: flex; flex-direction: column; justify-content: space-between;
  border: 1px solid var(--line);
  background:
    radial-gradient(400px 200px at 110% -20%, rgba(200,16,36,0.4), transparent 55%),
    radial-gradient(380px 200px at -10% 120%, rgba(241,90,41,0.32), transparent 55%),
    linear-gradient(135deg, var(--surface-2), var(--surface));
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
}
.bankcard:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: rgba(200,16,36,0.45); }
.bankcard.frozen { filter: grayscale(0.55) brightness(0.82); }
.bankcard .ctype { font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.bankcard .cnum { font-family: var(--font-mono); font-size: 18px; letter-spacing: 0.06em; }
.bankcard .cbal { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 26px; font-weight: 700; }
.bankcard .crow { display: flex; align-items: flex-end; justify-content: space-between; }

.stat-card { padding: 18px 20px; }
.stat-card .label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted); }
.stat-card .val { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 24px; font-weight: 700; margin-top: 6px; }

/* chips / badges */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--r-pill); font-size: 12px; font-weight: 600; border: 1px solid var(--line); }
.badge.checking { color: #9fd0ff; border-color: rgba(95,200,230,0.4); }
.badge.savings { color: var(--aurora-a); border-color: rgba(241,90,41,0.4); }
.badge.active { color: var(--credit); border-color: rgba(61,220,151,0.4); }
.badge.frozen { color: var(--warn); border-color: rgba(255,206,107,0.4); }

/* ---------- Transactions list / table ---------- */
.txn { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
.txn:last-child { border-bottom: 0; }
.txn-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: none; background: var(--surface-2); border: 1px solid var(--line); }
.txn-icon svg { width: 18px; height: 18px; }
.txn-icon.in { color: var(--credit); } .txn-icon.out { color: var(--debit); }
.txn-main { flex: 1; min-width: 0; }
.txn-desc { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.txn-meta { font-size: 12px; color: var(--faint); }
.txn-amt { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-weight: 700; text-align: right; }
.txn-bal { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 12px; color: var(--faint); text-align: right; }

/* ---------- Forms ---------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 500; color: var(--muted); margin-bottom: 7px; }
.input, .select {
  width: 100%; padding: 12px 14px;
  background: var(--ink-2); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--r-md);
  font-family: inherit; font-size: 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input::placeholder { color: var(--faint); }
.input:focus, .select:focus { outline: none; border-color: var(--aurora-a); box-shadow: 0 0 0 3px rgba(241,90,41,0.14); }
.input.mono { font-family: var(--font-mono); }
.field-row { display: flex; gap: 12px; }
.field-row > * { flex: 1; }

/* segmented toggle */
.segment { display: inline-flex; padding: 4px; background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--r-pill); gap: 4px; }
.segment button { border: 0; background: transparent; color: var(--muted); padding: 8px 18px; border-radius: var(--r-pill); font-weight: 600; font-size: 13px; }
.segment button.on { color: var(--ink); background: var(--aurora); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: var(--r-md);
  font-weight: 600; font-size: 14px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--text);
  transition: transform 0.12s, border-color 0.15s, background 0.15s, opacity 0.15s;
}
.btn svg { width: 16px; height: 16px; }
.btn:hover { border-color: var(--aurora-a); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--aurora); color: #06131a; border-color: transparent; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--debit); border-color: rgba(255,107,129,0.4); }
.btn.sm { padding: 8px 13px; font-size: 13px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }

.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Alerts ---------- */
.alert { padding: 12px 14px; border-radius: var(--r-md); font-size: 13px; margin-bottom: 14px; border: 1px solid; }
.alert.err { color: #ffd2d9; background: rgba(255,107,129,0.1); border-color: rgba(255,107,129,0.4); }
.alert.ok { color: #c9f7e3; background: rgba(61,220,151,0.1); border-color: rgba(61,220,151,0.4); }

/* ---------- Empty / loading ---------- */
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty svg { width: 40px; height: 40px; color: var(--faint); margin-bottom: 10px; }
.skeleton { color: var(--faint); padding: 40px; text-align: center; }
.spinner {
  width: 26px; height: 26px; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--aurora-a);
  animation: spin 0.8s linear infinite; margin: 0 auto 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* page heading */
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.section-title { font-family: var(--font-display); font-size: 15px; font-weight: 600; margin: 0 0 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; }

/* filters */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.filters .select, .filters .input { width: auto; min-width: 150px; padding: 9px 12px; }

/* detail header */
.detail-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.detail-head .num { font-family: var(--font-mono); color: var(--muted); letter-spacing: 0.08em; }
.detail-head .big { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 40px; font-weight: 700; letter-spacing: -0.02em; }

/* toast */
#toast-host { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: flex; flex-direction: column; gap: 10px; }
.toast {
  padding: 13px 16px; border-radius: var(--r-md); font-size: 14px; font-weight: 500;
  background: var(--surface-2); border: 1px solid var(--line); box-shadow: var(--shadow-lg);
  min-width: 240px; animation: toast-in 0.22s ease;
}
.toast.ok { border-color: rgba(61,220,151,0.5); }
.toast.err { border-color: rgba(255,107,129,0.5); }
@keyframes toast-in { from { transform: translateY(10px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.fade { animation: fade 0.25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* utility spacing */
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.list-reset { list-style: none; margin: 0; padding: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 920px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .cols-main, .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  :root { --sidebar-w: 0px; }
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; z-index: 40; left: 0; top: 0; width: 264px;
    transform: translateX(-100%); transition: transform 0.22s ease;
  }
  .sidebar.open { transform: translateX(0); }
  .menu-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); }
  .menu-btn svg { width: 20px; height: 20px; }
  .scrim { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 30; }
  .content { padding: 18px; }
  .topbar { padding: 14px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
