/* ── Standard Capitals — Light theme, blue & red ────────────────────────────────── */
:root {
  /* Brand */
  --brand-blue:  #0b3d91;
  --brand-red:   #c8102e;

  /* Apple-style neutrals: soft gray canvas, near-black ink */
  --bg:          #f5f5f7;
  --bg2:         #ececf0;
  --surface:     #ffffff;
  --surface2:    #f5f5f7;
  --surface3:    #ececf0;
  --border:      #e3e3e8;
  --border2:     #d2d2d7;

  /* Legacy names now point at the brand blue */
  --emerald:     #0b3d91;
  --emerald-dk:  #082659;
  --emerald-lt:  #1d5fd0;
  --emerald-xs:  rgba(11,61,145,.07);
  --emerald-glow:rgba(11,61,145,.14);

  --text:        #1d1d1f;
  --text2:       #424245;
  --text3:       #6e6e73;
  --text-inv:    #ffffff;

  --red:         #c8102e;
  --red-xs:      rgba(200,16,46,.08);
  --amber:       #b45309;
  --amber-xs:    rgba(245,158,11,.12);
  --blue:        #1d5fd0;
  --blue-xs:     rgba(29,95,208,.09);

  /* Generous, continuous radii + a full pill */
  --radius:      14px;
  --radius-sm:   10px;
  --radius-lg:   18px;
  --radius-xl:   22px;
  --radius-pill: 980px;

  --sidebar-w:   260px;
  --topbar-h:    60px;
  /* Soft, diffuse elevation */
  --shadow:      0 10px 40px rgba(0,0,0,.08);
  --shadow-sm:   0 1px 3px rgba(0,0,0,.06);
  --blur:        saturate(180%) blur(20px);
  --transition:  .22s cubic-bezier(.4,0,.2,1);

  /* Chart ink + gridlines, read by the Chart.js theme plugin */
  --chart-ink:   #6e6e73;
  --chart-grid:  rgba(0,0,0,.06);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Display', 'Segoe UI', Roboto, 'Public Sans', Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: var(--emerald); text-decoration: none; }
a:hover { color: var(--emerald-lt); }
svg { flex-shrink: 0; }

/* ── Scrollbar ──────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text3); }

/* ── Layout ─────────────────────────────────────────────────────────────────── */
.app-layout { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  overflow-y: auto;
  transition: transform var(--transition);
}
.sidebar-logo {
  padding: 22px 20px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--emerald), var(--emerald-dk));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: none;
}
.sidebar-logo-icon svg { color: #fff; }
.sidebar-brand { font-size: 16px; font-weight: 700; letter-spacing: -.4px; white-space: nowrap; }
.sidebar-brand span { font-weight: 400; }
.sidebar-role {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text3);
  margin-top: 1px;
}
.sidebar-nav { flex: 1; padding: 10px 12px; overflow-y: auto; }
.sidebar-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text3);
  padding: 14px 8px 6px;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text2);
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition);
  margin-bottom: 2px;
  cursor: pointer;
  text-decoration: none;
}
.sidebar-link svg { opacity: .7; transition: opacity var(--transition); }
.sidebar-link:hover { background: var(--surface2); color: var(--text); }
.sidebar-link:hover svg { opacity: 1; }
.sidebar-link.active {
  background: var(--emerald-xs);
  color: var(--emerald-lt);
  border: 1px solid rgba(11,61,145,.15);
}
.sidebar-link.active svg { opacity: 1; color: var(--emerald); }
.sidebar-badge {
  margin-left: auto;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}
.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: var(--surface2);
}
.sidebar-user-name { font-size: 13px; font-weight: 600; line-height: 1.3; }
.sidebar-user-role { font-size: 11px; color: var(--text3); text-transform: capitalize; }

/* Main content */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Topbar */
.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-title { font-size: 17px; font-weight: 700; flex: 1; }
.topbar-subtitle { font-size: 12px; color: var(--text3); font-weight: 400; margin-top: 1px; }

/* Page content */
.page { padding: 28px 24px; max-width: 1280px; width: 100%; }

/* ── Avatar ─────────────────────────────────────────────────────────────────── */
.avatar {
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--emerald-dk), var(--emerald));
  color: #fff;
  text-transform: uppercase;
}
.avatar-sm { width: 32px; height: 32px; font-size: 12px; }
.avatar-md { width: 40px; height: 40px; }
.avatar-lg { width: 52px; height: 52px; font-size: 18px; }
.avatar-xl { width: 72px; height: 72px; font-size: 24px; }

/* ── Stat Cards ──────────────────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.stat-card::before { display: none; }
.stat-card.green::before { background: var(--emerald); }
.stat-card.red::before { background: var(--red); }
.stat-card.amber::before { background: var(--amber); }
.stat-card.blue::before { background: var(--blue); }
.stat-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
}
.stat-icon.green { background: var(--emerald-xs); color: var(--emerald); }
.stat-icon.red   { background: var(--red-xs);    color: var(--red); }
.stat-icon.amber { background: var(--amber-xs);  color: var(--amber); }
.stat-icon.blue  { background: var(--blue-xs);   color: var(--blue); }
.stat-value { font-size: 26px; font-weight: 800; letter-spacing: -.5px; line-height: 1; margin-bottom: 4px; }
.stat-label { font-size: 12px; color: var(--text3); font-weight: 500; letter-spacing: .3px; text-transform: uppercase; }
.stat-delta { font-size: 12px; margin-top: 8px; display: flex; align-items: center; gap: 4px; }
.stat-delta.up   { color: var(--emerald); }
.stat-delta.down { color: var(--red); }

/* ── Cards / Panels ─────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.card-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}
.card-header-title { font-size: 15px; font-weight: 700; flex: 1; }
.card-header-sub { font-size: 12px; color: var(--text3); margin-top: 2px; }
.card-body { padding: 20px; }

/* Grid layouts */
.grid-2 { display: grid; grid-template-columns: repeat(2,1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; }
.flex-row { display: flex; gap: 20px; }
.flex-row > * { flex: 1; }

/* ── Bank Card Visual ───────────────────────────────────────────────────────── */
.bank-card {
  width: 340px;
  height: 210px;
  border-radius: 18px;
  padding: 24px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  user-select: none;
  box-shadow: 0 14px 30px rgba(2,6,23,.20);
}
.bank-card.visa-green {
  background: linear-gradient(135deg, #082659 0%, #0b3d91 55%, #1d5fd0 100%);
}
.bank-card.visa-dark {
  background: linear-gradient(135deg, #0a0a14 0%, #1a1a3a 60%, #2d3a6a 100%);
}
.bank-card.mastercard {
  background: linear-gradient(135deg, #1a0a0a 0%, #3a1010 60%, #8b1a1a 100%);
}
.bank-card.verve {
  background: linear-gradient(135deg, #0a1a0a 0%, #1a3a1a 60%, #2d6a2d 100%);
}
.bank-card::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: rgba(255,255,255,.04);
}
.bank-card::after {
  content: '';
  position: absolute;
  bottom: -80px; left: -40px;
  width: 220px; height: 220px;
  border-radius: 50%;
  background: rgba(255,255,255,.03);
}
.bank-card-top { display: flex; align-items: center; justify-content: space-between; position: relative; z-index: 1; }
.bank-card-chip {
  width: 36px; height: 28px;
  background: linear-gradient(135deg, #d4a017, #f5c842, #b8860b);
  border-radius: 5px;
  position: relative;
  overflow: hidden;
}
.bank-card-chip::before {
  content: '';
  position: absolute;
  top: 50%; left: 0; right: 0;
  height: 1px; background: rgba(0,0,0,.3);
  transform: translateY(-50%);
}
.bank-card-chip::after {
  content: '';
  position: absolute;
  left: 50%; top: 0; bottom: 0;
  width: 1px; background: rgba(0,0,0,.3);
  transform: translateX(-50%);
}
.bank-card-nfc {
  color: rgba(255,255,255,.6);
}
.bank-card-middle { position: relative; z-index: 1; }
.bank-card-number {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 3px;
  color: rgba(255,255,255,.92);
  font-family: 'Courier New', monospace;
}
.bank-card-bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  position: relative;
  z-index: 1;
}
.bank-card-label { font-size: 9px; color: rgba(255,255,255,.5); letter-spacing: .8px; text-transform: uppercase; margin-bottom: 2px; }
.bank-card-holder { font-size: 13px; font-weight: 600; color: rgba(255,255,255,.9); letter-spacing: .5px; text-transform: uppercase; }
.bank-card-expiry { font-size: 13px; font-weight: 600; color: rgba(255,255,255,.9); }
.bank-card-network { height: 36px; }
.bank-card-frozen-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.65);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  gap: 8px;
  color: var(--text2);
  font-size: 14px;
  font-weight: 600;
  backdrop-filter: blur(2px);
}
.bank-card-sm { width: 100%; max-width: 280px; height: 170px; padding: 18px; }
.bank-card-sm .bank-card-number { font-size: 14px; letter-spacing: 2px; }
.bank-card-sm .bank-card-holder { font-size: 11px; }
.bank-card-sm .bank-card-network { height: 26px; }

/* ── Tables ──────────────────────────────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead th {
  background: var(--surface2);
  padding: 11px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: var(--text3);
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
tbody td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text2);
}
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background var(--transition); }
tbody tr:hover { background: var(--surface2); }
tbody tr:hover td { color: var(--text); }
.td-primary { color: var(--text) !important; font-weight: 600; }
.td-mono { font-family: 'Courier New', monospace; font-size: 12px; color: var(--text3); }

/* ── Badges / Pills ──────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .3px;
  white-space: nowrap;
}
.badge-green  { background: var(--emerald-xs);  color: var(--emerald-lt); border: 1px solid rgba(11,61,145,.2); }
.badge-red    { background: var(--red-xs);       color: #b00d27;           border: 1px solid rgba(239,68,68,.2); }
.badge-amber  { background: var(--amber-xs);     color: #92400e;           border: 1px solid rgba(245,158,11,.2); }
.badge-blue   { background: var(--blue-xs);      color: #1d4ed8;           border: 1px solid rgba(59,130,246,.2); }
.badge-grey   { background: rgba(100,116,139,.12); color: var(--text3);     border: 1px solid rgba(100,116,139,.2); }
.badge-dot::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
}

/* ── Buttons ─────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-pill);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -.01em;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn-primary {
  background: var(--emerald);
  color: var(--text-inv);
}
.btn-primary:hover:not(:disabled) { background: var(--emerald-dk); color: var(--text-inv); box-shadow: 0 4px 14px rgba(11,61,145,.28); }
.btn-secondary {
  background: var(--surface2);
  color: var(--text2);
  border: 1px solid var(--border);
}
.btn-secondary:hover:not(:disabled) { background: var(--surface3); color: var(--text); }
.btn-danger {
  background: var(--red-xs);
  color: #b00d27;
  border: 1px solid rgba(239,68,68,.2);
}
.btn-danger:hover:not(:disabled) { background: var(--red); color: #fff; }
.btn-ghost { background: transparent; color: var(--text2); }
.btn-ghost:hover:not(:disabled) { background: var(--surface2); color: var(--text); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn-icon {
  padding: 8px;
  border-radius: var(--radius-sm);
  aspect-ratio: 1;
}

/* ── Forms ───────────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 6px;
  letter-spacing: 0;
}
.form-control {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  font-family: inherit;
}
.form-control::placeholder { color: var(--text3); }
.form-control:focus { border-color: var(--emerald); box-shadow: 0 0 0 4px var(--emerald-glow); }
.form-control:focus-visible {
  outline: 2px solid var(--brand-blue);
  outline-offset: 1px;
  border-color: var(--emerald);
}
.form-control:disabled { opacity: .5; cursor: not-allowed; }
select.form-control { appearance: none; cursor: pointer; }
.form-hint { font-size: 12.5px; color: var(--text3); margin-top: 5px; }
.form-error { font-size: 11px; color: var(--red); margin-top: 5px; }
.form-row { display: grid; grid-template-columns: repeat(2,1fr); gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }

/* ── Input with icon ─────────────────────────────────────────────────────────── */
.input-group { position: relative; }
.input-group .form-control { padding-left: 40px; }
.input-group-icon {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--text3);
  pointer-events: none;
}
.input-group-right { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); }

/* ── Modals ──────────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  backdrop-filter: saturate(140%) blur(12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
  transform: scale(.95) translateY(10px);
  transition: transform var(--transition);
}
.modal-overlay.open .modal { transform: scale(1) translateY(0); }
.modal-lg { max-width: 720px; }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 16px; font-weight: 700; }
.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ── Alert / Toast ───────────────────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.alert-success { background: var(--emerald-xs); color: var(--emerald-lt); border: 1px solid rgba(11,61,145,.2); }
.alert-error   { background: var(--red-xs);     color: #b00d27;           border: 1px solid rgba(239,68,68,.2); }
.alert-info    { background: var(--blue-xs);    color: #1d4ed8;           border: 1px solid rgba(59,130,246,.2); }
.alert-warning { background: var(--amber-xs);   color: #92400e;           border: 1px solid rgba(245,158,11,.2); }
.alert:empty, .alert[style*="display:none"], .alert:not([class*="-"]) { display: none; }

/* Toast container */
#toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 13.5px;
  min-width: 260px;
  max-width: 360px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toast-in .25s ease;
  pointer-events: all;
}
/* Type is shown by the leading icon's color, not a side bar */
.toast > span:first-child { font-weight: 800; }
.toast.success > span:first-child { color: var(--emerald); }
.toast.error   > span:first-child { color: var(--red); }
.toast.info    > span:first-child { color: var(--blue); }
@keyframes toast-in { from { opacity:0; transform: translateX(20px); } to { opacity:1; transform: translateX(0); } }

/* ── Pagination ──────────────────────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  padding: 16px;
}
.pagination-btn {
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text2);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all var(--transition);
}
.pagination-btn:hover { background: var(--surface3); color: var(--text); }
.pagination-btn.active { background: var(--emerald); color: var(--text-inv); border-color: var(--emerald); }
.pagination-btn:disabled { opacity: .35; cursor: not-allowed; }
.pagination-info { font-size: 12px; color: var(--text3); }

/* ── Transaction Items ───────────────────────────────────────────────────────── */
.txn-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
}
.txn-item:last-child { border-bottom: none; }
.txn-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.txn-icon.credit { background: var(--emerald-xs); color: var(--emerald); }
.txn-icon.debit  { background: var(--red-xs);     color: var(--red); }
.txn-icon.transfer { background: var(--blue-xs);  color: var(--blue); }
.txn-icon.fee    { background: var(--amber-xs);   color: var(--amber); }
.txn-desc { flex: 1; }
.txn-title { font-size: 13.5px; font-weight: 600; }
.txn-sub   { font-size: 11px; color: var(--text3); margin-top: 2px; }
.txn-amount { text-align: right; }
.txn-amount .credit-amt { color: var(--emerald-lt); font-weight: 700; font-size: 14px; }
.txn-amount .debit-amt  { color: #b00d27; font-weight: 700; font-size: 14px; }
.txn-ref { font-size: 10px; color: var(--text3); margin-top: 2px; font-family: monospace; }

/* ── Notification Item ───────────────────────────────────────────────────────── */
.notif-item {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
  cursor: pointer;
}
.notif-item:hover { background: var(--surface2); }
.notif-item.unread { background: var(--emerald-xs); }
.notif-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--emerald);
  flex-shrink: 0;
  margin-top: 6px;
}
.notif-dot.read { background: transparent; border: 1px solid var(--border2); }
.notif-title { font-size: 13px; font-weight: 600; margin-bottom: 3px; }
.notif-msg { font-size: 12px; color: var(--text3); line-height: 1.4; }
.notif-time { font-size: 10px; color: var(--text3); margin-top: 4px; }

/* ── Search & Filter Bar ─────────────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.filter-bar .form-control { max-width: 220px; padding: 8px 12px; font-size: 13px; }
.filter-bar select.form-control { max-width: 140px; }

/* ── Empty state ─────────────────────────────────────────────────────────────── */
.empty-state {
  padding: 60px 20px;
  text-align: center;
  color: var(--text3);
}
.empty-state svg { opacity: .3; margin-bottom: 16px; }
.empty-state h3 { font-size: 16px; color: var(--text2); margin-bottom: 6px; }
.empty-state p { font-size: 13px; }

/* ── Loading skeleton ────────────────────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--surface2) 25%, var(--surface3) 50%, var(--surface2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 6px;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.skeleton-row { height: 48px; margin-bottom: 4px; }

/* ── Login page ──────────────────────────────────────────────────────────────── */
.login-bg {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(11,61,145,.07) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(11,61,145,.05) 0%, transparent 50%),
    var(--bg);
  padding: 24px;
}
.login-card {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-xl);
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow);
}
.login-logo {
  text-align: center;
  margin-bottom: 32px;
}
.login-logo-icon {
  width: 56px; height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--emerald-dk), var(--emerald));
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px;
  box-shadow: none;
}
.login-brand { font-size: 23px; font-weight: 800; letter-spacing: -.5px; }
.login-brand span { font-weight: 400; }
.login-tagline { font-size: 13px; color: var(--text3); margin-top: 4px; }
.login-error {
  background: var(--red-xs);
  border: 1px solid rgba(239,68,68,.2);
  color: #b00d27;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
}
.login-divider {
  text-align: center;
  color: var(--text3);
  font-size: 12px;
  margin: 8px 0;
}

/* ── Topbar notification bell ────────────────────────────────────────────────── */
.notif-bell {
  position: relative;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  color: var(--text2);
  transition: background var(--transition);
}
.notif-bell:hover { background: var(--surface2); color: var(--text); }
.notif-count {
  position: absolute;
  top: 4px; right: 4px;
  width: 16px; height: 16px;
  background: var(--red);
  border-radius: 50%;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--surface);
}

/* ── Balance visibility toggle ───────────────────────────────────────────────── */
.balance-hidden { filter: blur(8px); user-select: none; }

/* ── Progress / meter bar ────────────────────────────────────────────────────── */
.meter-bar {
  height: 6px;
  background: var(--surface3);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 8px;
}
.meter-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--emerald-dk), var(--emerald-lt));
  transition: width .5s ease;
}

/* ── Tier badge ──────────────────────────────────────────────────────────────── */
.tier-bronze  { color: #9a5b1d; background: rgba(205,127,50,.12); border: 1px solid rgba(205,127,50,.25); }
.tier-silver  { color: #6b7280; background: rgba(192,192,192,.1); border: 1px solid rgba(192,192,192,.2); }
.tier-gold    { color: #a16207; background: rgba(255,215,0,.1);   border: 1px solid rgba(255,215,0,.25); }
.tier-platinum{ color: #475569; background: rgba(229,228,226,.08);border: 1px solid rgba(229,228,226,.2); }

/* ── Quick action buttons ────────────────────────────────────────────────────── */
.quick-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.quick-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 80px;
  max-width: 120px;
  padding: 16px 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
  text-decoration: none;
}
.quick-action:hover {
  border-color: var(--emerald);
  background: var(--emerald-xs);
  color: var(--emerald-lt);
}
.quick-action-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--emerald-xs);
  display: flex; align-items: center; justify-content: center;
  color: var(--emerald);
}
.quick-action span { font-size: 11px; font-weight: 600; color: var(--text2); }
.quick-action:hover span { color: var(--emerald-lt); }
.quick-action:hover .quick-action-icon { background: rgba(11,61,145,.2); }

/* ── Utilities ───────────────────────────────────────────────────────────────── */
.text-emerald { color: var(--emerald); }
.text-red     { color: var(--red); }
.text-amber   { color: var(--amber); }
.text-muted   { color: var(--text3); }
.text-sm      { font-size: 12px; }
.text-xs      { font-size: 12px; }
.text-lg      { font-size: 16px; }
.text-xl      { font-size: 20px; }
.font-bold    { font-weight: 700; }
.font-medium  { font-weight: 500; }
.mt-4         { margin-top: 4px; }
.mt-8         { margin-top: 8px; }
.mt-16        { margin-top: 16px; }
.mt-24        { margin-top: 24px; }
.mb-4         { margin-bottom: 4px; }
.mb-16        { margin-bottom: 16px; }
.mb-24        { margin-bottom: 24px; }
.gap-8        { gap: 8px; }
.gap-12       { gap: 12px; }
.flex         { display: flex; }
.flex-col     { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-end  { justify-content: flex-end; }
.flex-1       { flex: 1; }
.w-full       { width: 100%; }
.d-none       { display: none !important; }

/* ── Responsive ──────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  :root { --sidebar-w: 0px; }
  .sidebar { transform: translateX(-260px); }
  .sidebar.open { transform: translateX(0); width: 260px; }
  .main-content { margin-left: 0; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .menu-toggle { display: flex !important; }
  .bank-card { width: 100%; max-width: 320px; }
}
.menu-toggle {
  display: none;
  padding: 8px;
  border-radius: var(--radius-sm);
  background: none;
  border: none;
  color: var(--text2);
  cursor: pointer;
  margin-right: 8px;
}
.menu-toggle:hover { background: var(--surface2); color: var(--text); }

/* ── Spin animation ─────────────────────────────────────────────────────────── */
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin .7s linear infinite; }

/* ── Chart container ─────────────────────────────────────────────────────────── */
.chart-wrap { position: relative; height: 220px; }
.chart-wrap-lg { height: 300px; }

/* ── Light theme overrides ───────────────────────────────────────────────── */
.sidebar-logo-icon, .login-logo-icon {
  position: relative; overflow: hidden;
  background: var(--brand-blue);
  box-shadow: none;
}
.sidebar-logo-icon::after, .login-logo-icon::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0;
  height: 6px; background: var(--brand-red);
}
.login-brand span { font-weight: 400; }
.login-card { border-top: 4px solid var(--brand-red); box-shadow: 0 20px 50px rgba(2,6,23,.12); }
.modal-overlay { background: rgba(2,6,23,.48); }
.login-logo-icon svg, .sidebar-logo-icon svg { color: #fff; position: relative; top: -2px; }

/* ── Navy sidebar: the brand colour frames every signed-in screen ─────────── */
.sidebar { background: #082659; border-right: none; }
.sidebar-logo { border-bottom-color: rgba(255,255,255,.10); }
.sidebar-logo-icon { background: #fff; }
.sidebar-logo-icon svg { color: var(--brand-blue); }
.sidebar-brand { color: #fff; }
.sidebar-brand span { font-weight: 400; color: rgba(255,255,255,.82); }
.sidebar-role, .sidebar-section-label { color: rgba(255,255,255,.55); }
.sidebar-link { color: rgba(255,255,255,.82); border: 1px solid transparent; }
.sidebar-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar-link.active {
  background: rgba(255,255,255,.16);
  color: #fff;
  font-weight: 700;
  border-color: transparent;
}
.sidebar-link.active svg { color: #fff; opacity: 1; }
.sidebar-footer { border-top-color: rgba(255,255,255,.10); }
.sidebar-user { background: rgba(255,255,255,.08); color: #fff; }
.sidebar-user-role { color: rgba(255,255,255,.6); }
.sidebar-user .avatar { background: #fff; color: var(--brand-blue); }
.sidebar-user .btn-ghost { color: rgba(255,255,255,.8); }
.sidebar-user .btn-ghost:hover { background: rgba(255,255,255,.12); color: #fff; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.2); }

.topbar {
  background: rgba(255,255,255,.72);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  box-shadow: none;
  border-bottom: 1px solid var(--border);
  border-image: none;
}
.topbar-title { font-size: 18px; letter-spacing: -.02em; font-weight: 700; }

/* ── Sign-in code step ───────────────────────────────────────────────────── */
.otp-title { font-size: 19px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 6px; }
.otp-sub { font-size: 14px; color: var(--text2); line-height: 1.6; margin-bottom: 20px; }
.otp-sub strong { color: var(--text); }
.otp-input {
  text-align: center;
  font-size: 26px; font-weight: 700;
  letter-spacing: 10px; padding-left: 22px;
  font-variant-numeric: tabular-nums;
  height: 58px;
}
.otp-input::placeholder { color: var(--text3); }
.otp-actions { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.otp-link {
  background: none; border: none; padding: 4px 0; cursor: pointer;
  font: inherit; font-size: 13.5px; font-weight: 600; color: var(--brand-blue);
}
.otp-link:hover:not(:disabled) { text-decoration: underline; }
.otp-link:disabled { color: var(--text3); cursor: default; }
.otp-note { font-size: 13px; color: var(--text2); margin-top: 12px; min-height: 18px; }

/* ── Toggle switch ───────────────────────────────────────────────────────── */
.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: var(--border2); border-radius: 999px; transition: background var(--transition);
}
.switch-slider::before {
  content: ''; position: absolute; height: 18px; width: 18px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: transform var(--transition);
  box-shadow: 0 1px 3px rgba(2,6,23,.28);
}
.switch input:checked + .switch-slider { background: var(--brand-blue); }
.switch input:checked + .switch-slider::before { transform: translateX(18px); }
.switch input:focus-visible + .switch-slider { outline: 2px solid var(--brand-blue); outline-offset: 2px; }

/* ── Segmented control (CRM filters) ─────────────────────────────────────── */
.seg { display: inline-flex; background: var(--surface2); border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button {
  border: none; background: none; cursor: pointer; font: inherit;
  font-size: 13px; font-weight: 600; color: var(--text2);
  padding: 7px 14px; border-radius: 7px; transition: all var(--transition);
}
.seg button:hover { color: var(--text); }
.seg button.active { background: #fff; color: var(--brand-blue); box-shadow: var(--shadow-sm); }

/* ── 4-up KPI grid ───────────────────────────────────────────────────────── */
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 1000px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px)  { .grid-4 { grid-template-columns: 1fr; } }

/* ── Settings rows ───────────────────────────────────────────────────────── */
.set-row { display: flex; align-items: center; gap: 20px; padding: 18px 0; border-bottom: 1px solid var(--border); }
.set-row:last-child { border-bottom: none; }
.set-row-main { flex: 1; min-width: 0; }
.set-row-title { font-size: 14.5px; font-weight: 600; }
.set-row-desc { font-size: 13px; color: var(--text3); margin-top: 2px; line-height: 1.5; }

/* ── Audit timeline marker ───────────────────────────────────────────────── */
.badge-slate { background: rgba(100,116,139,.12); color: #475569; border: 1px solid rgba(100,116,139,.2); }

/* ══════════════════════════════════════════════════════════════════════════
   Admin dark theme — Apple dark mode. Applied through <html data-theme="dark">,
   which only the admin pages set. Marketing and the user dashboard stay light.
   The brand blue is brightened here (navy fails contrast on near-black); deep
   navy is kept only where it fills behind white (the sidebar, the logo chip).
   ══════════════════════════════════════════════════════════════════════════ */
[data-theme="dark"] {
  color-scheme: dark;

  --bg:          #161618;
  --bg2:         #0f0f10;
  --surface:     #1f1f22;
  --surface2:    #2a2a2e;
  --surface3:    #323237;
  --border:      #38383c;
  --border2:     #48484d;

  --emerald:     #5e9dff;
  --emerald-dk:  #4a8bf0;
  --emerald-lt:  #8fbcff;
  --emerald-xs:  rgba(94,157,255,.14);
  --emerald-glow:rgba(94,157,255,.30);

  --text:        #f5f5f7;
  --text2:       #c7c7cc;
  --text3:       #98989d;
  --text-inv:    #ffffff;

  --red:         #ff6b7f;
  --red-xs:      rgba(255,107,127,.14);
  --amber:       #ffb84d;
  --amber-xs:    rgba(255,184,77,.14);
  --blue:        #64a7ff;
  --blue-xs:     rgba(100,167,255,.14);

  --brand-blue:  #5e9dff;
  --brand-red:   #ff5a70;

  --shadow:      0 12px 40px rgba(0,0,0,.5);
  --shadow-sm:   0 1px 3px rgba(0,0,0,.4);

  --chart-ink:   #98989d;
  --chart-grid:  rgba(255,255,255,.08);
}

/* Frosted dark top bar */
[data-theme="dark"] .topbar { background: rgba(22,22,24,.72); border-bottom: 1px solid var(--border); }

/* Primary button: denser fill keeps the white label legible on dark */
[data-theme="dark"] .btn-primary { background: #0a63d6; color: #fff; }
[data-theme="dark"] .btn-primary:hover:not(:disabled) { background: #1a74e8; box-shadow: 0 4px 14px rgba(10,99,214,.45); }
[data-theme="dark"] .btn-secondary { background: var(--surface2); color: var(--text); border-color: var(--border); }
[data-theme="dark"] .btn-secondary:hover:not(:disabled) { background: var(--surface3); color: #fff; }

/* Status text brightened for legibility on dark cards */
[data-theme="dark"] .badge-green, [data-theme="dark"] .alert-success { color: var(--emerald-lt); }
[data-theme="dark"] .badge-red,   [data-theme="dark"] .alert-error,
[data-theme="dark"] .txn-amount .debit-amt { color: #ff8a98; }
[data-theme="dark"] .badge-amber, [data-theme="dark"] .alert-warning { color: #ffce85; }
[data-theme="dark"] .badge-blue,  [data-theme="dark"] .alert-info { color: #8fbcff; }
[data-theme="dark"] .badge-grey,  [data-theme="dark"] .badge-slate { color: #b0b0b6; }

/* Segmented control active chip lifts with surface, not white */
[data-theme="dark"] .seg button.active { background: var(--surface); color: var(--emerald); }
[data-theme="dark"] tbody tr:hover { background: var(--surface2); }

/* ══════════════════════════════════════════════════════════════════════════
   Sign-in / reset: split layout — navy brand panel beside a clean form.
   Shared by index.html and forgot.html. Collapses to a centred card on phones.
   ══════════════════════════════════════════════════════════════════════════ */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; background: var(--surface); }

.auth-brand {
  position: relative; overflow: hidden; color: #fff;
  display: flex; align-items: center; padding: 64px;
  background:
    radial-gradient(900px 520px at 82% -12%, rgba(255,255,255,.10) 0%, transparent 60%),
    linear-gradient(150deg, #082659 0%, #0b3d91 60%, #124aa8 100%);
}
.auth-brand::before, .auth-brand::after {
  content: ''; position: absolute; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.09); pointer-events: none;
}
.auth-brand::before { width: 760px; height: 760px; left: -300px; bottom: -480px; }
.auth-brand::after  { width: 1100px; height: 1100px; left: -470px; bottom: -720px; }
.auth-brand-inner { position: relative; z-index: 1; max-width: 460px; }
.auth-brand-logo {
  display: flex; align-items: center; gap: 12px;
  font-size: 20px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 44px;
}
.auth-brand-logo .login-logo-icon {
  position: relative; overflow: hidden; margin: 0; width: 44px; height: 44px; border-radius: 12px; background: #fff;
}
.auth-brand-logo .login-logo-icon svg { color: var(--brand-blue); }
.auth-brand-logo .b2 { font-weight: 400; color: rgba(255,255,255,.82); }
.auth-brand-title {
  font-size: clamp(1.9rem, 2.6vw, 2.6rem); font-weight: 800;
  letter-spacing: -.03em; line-height: 1.12; margin-bottom: 16px; text-wrap: balance;
}
.auth-brand-sub { font-size: 1.05rem; color: rgba(255,255,255,.84); line-height: 1.6; margin-bottom: 34px; max-width: 420px; }
.auth-brand-points { list-style: none; display: flex; flex-direction: column; gap: 15px; padding-top: 30px; border-top: 1px solid rgba(255,255,255,.16); }
.auth-brand-points li { display: flex; align-items: center; gap: 11px; font-size: 15px; color: rgba(255,255,255,.92); }
.auth-brand-points svg { color: #fff; flex-shrink: 0; }

.auth-main { display: flex; align-items: center; justify-content: center; padding: 48px 24px; }
/* On desktop the form sits clean on white — the brand lives on the left panel */
.auth-main .login-card { background: transparent; border: none; box-shadow: none; padding: 0; width: 100%; max-width: 400px; border-radius: 0; }
.auth-main .login-logo { text-align: left; margin-bottom: 30px; }
.auth-main .login-logo-icon { display: none; }
.auth-main .login-brand { font-size: 24px; }

@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .auth-main { padding: 24px; }
  /* Give the card its chrome back when it stands alone */
  .auth-main .login-card {
    background: var(--surface); border: 1px solid var(--border2);
    box-shadow: var(--shadow);
    padding: 36px; border-radius: var(--radius-xl); max-width: 440px;
  }
  .auth-main .login-logo { text-align: center; }
  .auth-main .login-logo-icon { display: flex; }
}
