/* =========================================================
   BakarePay — base components
   Shared by every page: public site, auth, onboarding,
   customer app and admin. Load after tokens.css.
   ========================================================= */

/* ---------- Reset & type ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
.num, .tabular { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }
[x-cloak] { display: none !important; }
::selection { background: var(--primary-soft); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Logo ---------- */
.logo { display: inline-flex; align-items: center; gap: 10px; line-height: 1; flex-shrink: 0; }
.logo .logo-mark { flex-shrink: 0; object-fit: contain; }
:root[data-theme="dark"] .logo .logo-mark { filter: drop-shadow(0 0 1px rgba(255, 255, 255, .55)) drop-shadow(0 0 6px rgba(76, 195, 245, .25)); }
.logo-word {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 21px;
  letter-spacing: -0.03em;
  color: var(--text);
}
.logo-word span {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.logo-word.is-light { color: #fff; }
.logo-word.is-light span { background: none; color: color-mix(in srgb, var(--brand-2) 70%, #fff); }
.logo-img { height: 32px; width: auto; }
.logo-on-dark { display: none; }
:root[data-theme="dark"] .logo-on-light { display: none; }
:root[data-theme="dark"] .logo-on-dark { display: block; }
.logo-sm .logo-mark { width: 28px; height: 28px; }
.logo-sm .logo-word { font-size: 18px; }
.logo-lg .logo-mark { width: 42px; height: 42px; }
.logo-lg .logo-word { font-size: 26px; }

/* ---------- Icon button, theme toggle, avatar ---------- */
.icon-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 19px;
  transition: background .15s, color .15s, border-color .15s;
  flex-shrink: 0;
}
.icon-btn:hover { color: var(--text); background: var(--surface-2); }
.icon-btn .dot {
  position: absolute; top: 8px; right: 9px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--danger); box-shadow: 0 0 0 2px var(--surface);
}
.theme-toggle .bx-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .bx-sun { display: inline; }
:root[data-theme="dark"] .theme-toggle .bx-moon { display: none; }

.avatar {
  display: inline-grid; place-items: center; flex-shrink: 0;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--gradient); color: var(--primary-ink);
  font-weight: 700; font-size: 13px; letter-spacing: .02em;
}
.avatar-sm { width: 30px; height: 30px; font-size: 11.5px; }
.avatar-lg { width: 56px; height: 56px; font-size: 19px; }
.avatar-xl { width: 72px; height: 72px; font-size: 24px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px;
  border-radius: 10px; border: 1px solid transparent;
  font-weight: 600; font-size: 14px; white-space: nowrap; line-height: 1;
  transition: filter .15s, background .15s, border-color .15s, color .15s, transform .15s, box-shadow .15s;
  cursor: pointer; text-decoration: none; user-select: none;
}
.btn i { font-size: 18px; }
.btn-primary { background: var(--primary); color: var(--primary-ink); }
.btn-primary:hover { filter: brightness(1.07); }
.btn-gradient { background: var(--gradient); color: var(--primary-ink); box-shadow: 0 8px 24px var(--glow); }
.btn-gradient:hover { transform: translateY(-2px); box-shadow: 0 12px 30px var(--glow); }
.btn-secondary { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--surface-3); }
.btn-outline { background: transparent; color: var(--text); border-color: var(--border); }
.btn-outline:hover { background: var(--surface-2); border-color: var(--text-dim); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(1.07); }
.btn-danger-soft { background: var(--danger-soft); color: var(--danger); }
.btn-success-soft { background: var(--success-soft); color: var(--success); }
.btn-warning-soft { background: var(--warning-soft); color: var(--warning); }
.btn-primary-soft { background: var(--primary-soft); color: var(--primary); }
.btn-danger-soft:hover, .btn-success-soft:hover, .btn-warning-soft:hover, .btn-primary-soft:hover { filter: brightness(.97); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn-sm i { font-size: 16px; }
.btn-lg { height: 48px; padding: 0 22px; font-size: 15px; border-radius: 12px; }
.btn-xl { height: 54px; padding: 0 28px; font-size: 16px; border-radius: 14px; }
.btn-pill { border-radius: var(--radius-full); }
.btn-block { width: 100%; }
.btn-icon { width: 38px; padding: 0; }
.btn:disabled, .btn[disabled], .btn.is-disabled {
  opacity: .55; cursor: not-allowed; filter: none; transform: none; box-shadow: none;
}
.btn.is-loading { pointer-events: none; opacity: .8; }
.btn.is-loading .bx-loader-alt { animation: spin 1s linear infinite; }
.link { color: var(--primary); font-weight: 600; background: none; border: 0; padding: 0; font-size: inherit; cursor: pointer; }
.link:hover { text-decoration: underline; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap; line-height: 1.5;
  background: var(--surface-2); color: var(--text-muted);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.badge.no-dot::before { display: none; }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger  { background: var(--danger-soft);  color: var(--danger); }
.badge-info    { background: var(--info-soft);    color: var(--info); }
.badge-muted   { background: var(--surface-2);    color: var(--text-muted); }
.badge-accent  { background: var(--accent-soft);  color: var(--accent); }
.badge-primary { background: var(--primary-soft); color: var(--primary); }
.badge.pulse::before { animation: pulse 1.6s ease-in-out infinite; }

/* ---------- Alerts ---------- */
.alert {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px; border-radius: 12px; font-size: 13.5px;
  border: 1px solid transparent;
}
.alert > i { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.alert strong { font-weight: 700; }
.alert .alert-body { color: var(--text); }
.alert .alert-actions { margin-left: auto; flex-shrink: 0; display: flex; gap: 8px; align-self: center; }
.alert-danger  { background: var(--danger-soft);  color: var(--danger);  border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.alert-success { background: var(--success-soft); color: var(--success); border-color: color-mix(in srgb, var(--success) 25%, transparent); }
.alert-warning { background: var(--warning-soft); color: var(--warning); border-color: color-mix(in srgb, var(--warning) 25%, transparent); }
.alert-info    { background: var(--info-soft);    color: var(--info);    border-color: color-mix(in srgb, var(--info) 25%, transparent); }
.alert-primary { background: var(--primary-soft); color: var(--primary); border-color: var(--primary-line); }

/* ---------- Tone tiles ---------- */
.stat-icon, .type-icon, .result-icon { display: grid; place-items: center; flex-shrink: 0; }
.stat-icon   { width: 32px; height: 32px; border-radius: 9px;  font-size: 17px; }
.type-icon   { width: 36px; height: 36px; border-radius: 10px; font-size: 19px; }
.result-icon { width: 64px; height: 64px; border-radius: 50%; font-size: 32px; margin: 0 auto 14px; }
.tone-primary { background: var(--primary-soft); color: var(--primary); }
.tone-accent  { background: var(--accent-soft);  color: var(--accent); }
.tone-success { background: var(--success-soft); color: var(--success); }
.tone-warning { background: var(--warning-soft); color: var(--warning); }
.tone-danger  { background: var(--danger-soft);  color: var(--danger); }
.tone-info    { background: var(--info-soft);    color: var(--info); }
.tone-muted   { background: var(--surface-2);    color: var(--text-muted); }

/* ---------- Cards, stats, grids ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 0;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 15px 20px; border-bottom: 1px solid var(--border-soft);
}
.card-head h3 { font-size: 15px; }
.card-head p { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
.card-head .card-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.card-head > .link, .card-head .card-actions .link { white-space: nowrap; flex-shrink: 0; }
.card-body { padding: 20px; }
.card-foot { padding: 14px 20px; border-top: 1px solid var(--border-soft); }
.card + .card { margin-top: 16px; }
.grid > .card + .card, .cols-main > .card + .card, .kpi-row > .card + .card, .swipe > .card + .card { margin-top: 0; }
.card.card-flat { box-shadow: none; }
.card.card-soft { background: var(--bg-soft); box-shadow: none; }

.stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); min-width: 0;
}
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.stat-label { font-size: 12.5px; color: var(--text-muted); font-weight: 500; }
.stat-value {
  font-family: var(--font-display); font-size: 19px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums;
}
.stat-sub { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.stat-sub.up { color: var(--success); }
.stat-sub.down { color: var(--danger); }

.grid { display: grid; gap: 16px; }
.grid > * { min-width: 0; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.cols-main { display: grid; gap: 16px; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); align-items: start; }
.cols-main > * { min-width: 0; }
.stack > * + * { margin-top: 16px; }
.section-gap { margin-top: 16px; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.form-label .opt { font-weight: 500; color: var(--text-dim); }
.form-control {
  width: 100%; height: 44px; padding: 0 14px;
  font-size: 14px; background: var(--bg-soft);
  border: 1px solid var(--border); border-radius: 10px;
  transition: border-color .15s, box-shadow .15s, background .15s;
  outline: none;
}
.form-control::placeholder { color: var(--text-dim); }
.form-control:focus { border-color: var(--primary); box-shadow: var(--ring); background-color: var(--surface); }
.form-control:disabled, .form-control[readonly] { opacity: .75; }
.form-control.is-invalid { border-color: var(--danger); }
textarea.form-control { height: auto; min-height: 96px; padding: 12px 14px; resize: vertical; }
select.form-control {
  appearance: none; -webkit-appearance: none; padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238A93AB' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
.form-hint { font-size: 12.5px; color: var(--text-muted); margin-top: 6px; }
.form-error { font-size: 12.5px; color: var(--danger); margin-top: 6px; display: flex; gap: 6px; align-items: flex-start; }
.form-error i { margin-top: 2px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.input-group { position: relative; }
.input-group .prefix {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); font-weight: 600; pointer-events: none;
}
.input-group .prefix + .form-control { padding-left: 34px; }
.input-group .prefix.lg { font-size: 22px; font-family: var(--font-display); }
.input-group .prefix.lg + .amount-input { padding-left: 42px; }
.input-group .suffix { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); display: flex; gap: 6px; align-items: center; }
.amount-input {
  height: 62px; font-family: var(--font-display); font-size: 26px; font-weight: 700;
  font-variant-numeric: tabular-nums; letter-spacing: -0.01em;
}
.input-wrap { position: relative; }
.input-wrap .form-control { padding-right: 46px; }
.input-icon-btn {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center;
  color: var(--text-muted); font-size: 18px; background: transparent;
}
.input-icon-btn:hover { background: var(--surface-2); color: var(--text); }
.input-icon-btn:focus-visible { box-shadow: var(--ring); outline: none; }

.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; cursor: pointer; }
.check input { width: 16px; height: 16px; margin-top: 2px; accent-color: var(--primary); flex-shrink: 0; }
.check a { color: var(--primary); font-weight: 600; }

.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13.5px; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track-ui {
  width: 40px; height: 22px; border-radius: 999px; background: var(--surface-3);
  border: 1px solid var(--border); position: relative; transition: background .2s;
}
.switch .track-ui::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s;
}
.switch input:checked + .track-ui { background: var(--primary); border-color: var(--primary); }
.switch input:checked + .track-ui::after { transform: translateX(18px); }
.switch input:focus-visible + .track-ui { box-shadow: var(--ring); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-muted); font-size: 12.5px; font-weight: 600;
  transition: color .15s, border-color .15s, background .15s;
}
.chip:hover { color: var(--text); border-color: var(--text-dim); }
.chip.is-active { color: var(--primary); border-color: var(--primary); background: var(--primary-soft); }

/* File drop (KYC uploads) */
.file-drop {
  display: flex; gap: 12px; align-items: center; padding: 14px;
  border: 1.5px dashed var(--border); border-radius: 12px; background: var(--bg-soft);
  cursor: pointer; transition: border-color .15s, background .15s; position: relative;
}
.file-drop:hover { border-color: var(--primary); }
.file-drop input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-drop > i { font-size: 24px; color: var(--primary); flex-shrink: 0; }
.file-drop strong { display: block; font-size: 13.5px; }
.file-drop small { color: var(--text-muted); font-size: 12px; }
.file-drop .file-thumb { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; flex-shrink: 0; }
.file-drop .file-done-icon { margin-left: auto; color: var(--primary); font-size: 22px; }
.file-drop.is-done { border-style: solid; border-color: var(--primary); background: var(--primary-soft); }
.file-drop.is-uploading { border-style: solid; border-color: var(--info); }
.file-drop.is-failed { border-style: solid; border-color: var(--danger); background: var(--danger-soft); }

/* Searchable select (bank picker, states) */
.combo { position: relative; }
.combo-button { display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: left; cursor: pointer; }
.combo-button .combo-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.combo-button .combo-label.is-placeholder { color: var(--text-dim); }
.combo-button i { color: var(--text-dim); font-size: 18px; }
.combo-panel {
  position: absolute; z-index: 60; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.combo-search { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--border-soft); }
.combo-search i { color: var(--text-dim); font-size: 17px; }
.combo-search input { flex: 1; border: 0; outline: none; background: transparent; height: 26px; }
.combo-list { max-height: 264px; overflow-y: auto; padding: 6px; }
.combo-list li { padding: 9px 10px; border-radius: 8px; cursor: pointer; display: flex; justify-content: space-between; gap: 8px; }
.combo-list li.active { background: var(--surface-2); }
.combo-list li.selected { color: var(--primary); font-weight: 600; }
.combo-list li.selected::after { content: "\ea41"; font-family: boxicons; }
.combo-empty { padding: 14px; text-align: center; color: var(--text-muted); font-size: 13px; }

/* PIN / OTP digit boxes */
.otp { display: flex; gap: 10px; justify-content: center; }
.otp input {
  width: 54px; height: 58px; text-align: center; padding: 0;
  font-family: var(--font-display); font-size: 24px; font-weight: 700;
  background: var(--bg-soft); border: 1.5px solid var(--border); border-radius: 12px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.otp input:focus { border-color: var(--primary); box-shadow: var(--ring); background-color: var(--surface); }
.otp.is-six input { width: 46px; }
.otp.is-error input { border-color: var(--danger); animation: shake .35s; }
.code-input {
  text-align: center; font-family: var(--mono); font-size: 26px; font-weight: 700;
  letter-spacing: .35em; text-indent: .35em; height: 58px;
}

/* ---------- Segmented tabs ---------- */
.tabs {
  display: inline-flex; gap: 2px; padding: 4px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--border-soft); flex-wrap: wrap; max-width: 100%;
}
.tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 9px; color: var(--text-muted); font-weight: 600; font-size: 13px;
  white-space: nowrap; transition: color .15s, background .15s;
}
.tab i { font-size: 16px; }
.tab:hover { color: var(--text); }
.tab.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.tab .count { font-size: 11px; padding: 0 6px; border-radius: 999px; background: var(--warning-soft); color: var(--warning); }
.tabs.tabs-block { display: flex; }
.tabs.tabs-block .tab { flex: 1; justify-content: center; }

/* ---------- Tables, filters, lists ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--border-soft); align-items: center; }
.filters .form-control { height: 38px; min-width: 140px; width: auto; font-size: 13px; }
.filters .search { flex: 1; min-width: 200px; position: relative; }
.filters .search .form-control { width: 100%; padding-left: 36px; }
.filters .search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-dim); font-size: 17px; }
.table-wrap { position: relative; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-dim); padding: 11px 16px; border-bottom: 1px solid var(--border); white-space: nowrap;
  background: var(--surface);
}
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; white-space: nowrap; }
.table td.wrap, .table td[colspan] { white-space: normal; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-2); }
.table tr.clickable { cursor: pointer; }
.table .right, .table th.right { text-align: right; }
.table th.sortable { cursor: pointer; user-select: none; }
.table th.sortable:hover { color: var(--text); }
.table th.sortable i { font-size: 13px; vertical-align: -2px; }
.cell-main { font-weight: 600; }
.cell-sub { font-size: 12px; color: var(--text-dim); }
.cell-flex { display: flex; align-items: center; gap: 10px; min-width: 0; }
.amount-credit { color: var(--success); }
.amount-debit { color: var(--text); }
.amount-loss { color: var(--danger); }
.table-foot { padding: 12px 20px; border-top: 1px solid var(--border-soft); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.list-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 20px;
  border-bottom: 1px solid var(--border-soft); transition: background .15s;
}
.list-row:last-child { border-bottom: 0; }
a.list-row:hover, button.list-row:hover { background: var(--surface-2); }
button.list-row { width: 100%; text-align: left; }
.list-row .grow { min-width: 0; }
.list-row .list-title { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row .list-sub { display: block; font-size: 12px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row .list-end { margin-left: auto; text-align: right; flex-shrink: 0; }

.pagination { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.page-link {
  min-width: 34px; height: 34px; padding: 0 8px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface);
  display: inline-grid; place-items: center; font-size: 13px; font-weight: 600; cursor: pointer;
}
.page-link:hover { background: var(--surface-2); }
.page-link.active { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.page-link:disabled { opacity: .4; cursor: default; }
.pagination-info { font-size: 12.5px; color: var(--text-muted); }

/* ---------- Key/value, copy field, empty, bar ---------- */
.dl { display: grid; grid-template-columns: minmax(120px, 190px) minmax(0, 1fr); gap: 11px 18px; font-size: 13.5px; }
.dl dt { color: var(--text-muted); }
.dl dd { font-weight: 500; overflow-wrap: anywhere; }
.dl.dl-tight { grid-template-columns: minmax(96px, 130px) minmax(0, 1fr); }
.section-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-dim); margin-bottom: 10px; }
.copy-field {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: 12px;
  padding: 10px 10px 10px 14px;
}
.copy-field code, .copy-field .copy-value { flex: 1; font-size: 13px; overflow-wrap: anywhere; font-weight: 600; }
.copy-field .copy-value.big { font-family: var(--font-display); font-size: 20px; letter-spacing: .04em; }
.empty { text-align: center; padding: 44px 20px; color: var(--text-muted); }
.empty > i { font-size: 36px; color: var(--text-dim); display: block; margin: 0 auto 10px; }
.empty h4 { font-size: 15px; color: var(--text); margin-bottom: 4px; }
.empty p { max-width: 360px; margin: 0 auto; font-size: 13.5px; }
.empty .btn { margin-top: 14px; }
.bar { height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--gradient); border-radius: 6px; transition: width .4s ease; }
.bar.is-warning > span { background: var(--warning); }
.bar.is-danger > span { background: var(--danger); }
.divider { height: 1px; background: var(--border-soft); margin: 18px 0; border: 0; }

/* ---------- Notifications list ---------- */
.notif { display: flex; gap: 14px; padding: 14px 20px; border-bottom: 1px solid var(--border-soft); cursor: pointer; transition: background .15s; }
.notif:last-child { border-bottom: 0; }
.notif:hover { background: var(--surface-2); }
.notif.unread { background: color-mix(in srgb, var(--primary-soft) 55%, transparent); }
.notif .notif-title { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.notif.unread .notif-title::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--primary); }
.notif .notif-msg { font-size: 13.5px; color: var(--text-muted); margin-top: 2px; }
.notif .notif-msg p + p { margin-top: 6px; }
.notif .notif-time { font-size: 12px; color: var(--text-dim); margin-top: 3px; }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px;
  background: var(--backdrop); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  opacity: 0; visibility: hidden; transition: opacity .2s, visibility .2s;
}
.modal-backdrop.open { opacity: 1; visibility: visible; }
.modal {
  width: 100%; max-width: 460px; max-height: calc(100vh - 32px); overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-lg);
  transform: translateY(10px) scale(.98); transition: transform .2s ease;
}
.modal-backdrop.open .modal { transform: none; }
.modal-lg { max-width: 760px; }
.modal-xl { max-width: 960px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--border-soft); }
.modal-head h3 { font-size: 16px; }
.modal-close { color: var(--text-muted); font-size: 22px; line-height: 1; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; }
.modal-close:hover { background: var(--surface-2); color: var(--text); }
.modal-body { padding: 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--border-soft); flex-wrap: wrap; }
body.modal-open { overflow: hidden; }

/* ---------- Toast ---------- */
.toast-stack { position: fixed; z-index: 200; top: 18px; right: 18px; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; gap: 10px; align-items: flex-start;
  min-width: 260px; max-width: 380px; padding: 12px 14px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
  font-size: 13.5px; animation: toast-in .25s ease;
}
.toast > i { font-size: 19px; flex-shrink: 0; }
.toast.success > i { color: var(--success); }
.toast.danger > i { color: var(--danger); }
.toast.warning > i { color: var(--warning); }
.toast.info > i { color: var(--info); }
.toast.leaving { animation: toast-out .2s ease forwards; }

/* ---------- Rate calculator (home + dashboard) ---------- */
.rcalc {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 18px;
}
.rcalc--flat { background: none; border: 0; box-shadow: none; padding: 0; border-radius: 0; }
.rcalc-tabs {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
  gap: 4px; padding: 4px; border-radius: 12px; background: var(--bg-soft); margin-bottom: 16px;
}
.rcalc-tab {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 8px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--text-muted);
}
.rcalc-tab i { font-size: 16px; }
.rcalc-tab.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.rcalc-tab.is-active i { color: var(--primary); }
.rcalc-field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }
.rcalc-input {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  background: var(--bg-soft); border: 1.5px solid var(--border); border-radius: 12px;
  transition: border-color .15s, box-shadow .15s;
}
.rcalc-input:focus-within { border-color: var(--primary); box-shadow: var(--ring); }
.rcalc-input input {
  flex: 1; min-width: 0; border: 0; outline: none; background: transparent;
  font-family: var(--font-display); font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.rcalc-unit { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--text-muted); flex-shrink: 0; }
.rcalc-unit .flag { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 800; color: #fff; }
.rcalc-unit .flag.ngn { background: #0E8A4F; }
.rcalc-unit .flag.usd { background: #D72B38; }
.rcalc-swap { display: grid; place-items: center; margin: 8px auto; width: 32px; height: 32px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-size: 18px; }
.rcalc-rate { margin-top: 14px; display: flex; flex-direction: column; gap: 3px; }
.rcalc-rate [data-rate-line] { font-size: 13px; font-weight: 600; }
.rcalc-note { font-size: 12px; color: var(--text-muted); }
.rcalc.is-unavailable [data-rate-line] { color: var(--warning); }
.rcalc-cta { margin-top: 14px; }
@media (max-width: 380px) {
  .rcalc-cta { height: auto; min-height: 48px; padding: 12px 18px; white-space: normal; line-height: 1.25; text-align: center; text-wrap: balance; }
}

/* ---------- WhatsApp float & install bar ---------- */
.wa-float {
  position: fixed; right: 18px; bottom: 18px; z-index: 60;
  display: inline-flex; align-items: center; gap: 9px; height: 54px; padding: 0 18px 0 15px;
  border-radius: 999px; background: #25D366; color: #fff; font-weight: 600; font-size: 14.5px;
  box-shadow: 0 10px 26px rgba(37, 211, 102, .38); transition: transform .15s;
}
.wa-float i { font-size: 27px; }
.wa-float:hover { transform: translateY(-2px); }
.install-bar {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 70;
  width: calc(100% - 32px); max-width: 520px; display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-radius: 16px; background: #10172A; color: #fff; box-shadow: var(--shadow-lg);
  animation: install-up .22s ease-out;
}
.install-bar .grow { flex: 1; min-width: 0; font-size: 13px; }
.install-bar strong { display: block; font-size: 14px; }
.install-bar span { color: #AEB8D0; }
.install-bar .install-cta { background: var(--gradient); color: #fff; }
.install-bar .install-ghost { color: #AEB8D0; }
.install-bar .install-ghost:hover { color: #fff; background: rgba(255,255,255,.08); }

/* ---------- Install app: entries + the how-to sheet (js/pwa.js) ----------
   Any [data-install-app] opens the browser's prompt or the sheet. Inside the installed
   app (html.pwa-installed, set before paint) every entry and its wrapper disappears. */
html.pwa-installed [data-install-app], html.pwa-installed [data-install-app-wrap] { display: none !important; }
html.pwa-sheet-open, html.pwa-sheet-open body { overflow: hidden; }
.pwa-tile { flex-shrink: 0; border-radius: 22%; box-shadow: 0 0 0 1px var(--border-soft), 0 4px 12px var(--glow); }
.pwa-sheet-backdrop {
  position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 16px;
  background: var(--backdrop); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  opacity: 0; transition: opacity .2s ease;
}
.pwa-sheet-backdrop.open { opacity: 1; }
.pwa-sheet {
  width: 100%; max-width: 440px; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow-lg);
  font-family: var(--font); font-size: 14px; line-height: 1.55; text-align: left;
  transform: translateY(10px) scale(.98); transition: transform .2s ease;
}
.pwa-sheet-backdrop.open .pwa-sheet { transform: none; }
.pwa-sheet:focus { outline: none; }
.pwa-sheet-head { display: flex; align-items: center; gap: 14px; padding: 20px 20px 0; }
.pwa-sheet-head h2 { font-size: 17px; }
.pwa-sheet-head p { font-size: 12.5px; color: var(--text-dim); overflow-wrap: anywhere; }
.pwa-sheet-close {
  align-self: flex-start; display: grid; place-items: center; width: 34px; height: 34px; margin: -4px -6px 0 0;
  border-radius: 50%; color: var(--text-muted); font-size: 22px; flex-shrink: 0;
}
.pwa-sheet-close:hover { background: var(--surface-2); color: var(--text); }
.pwa-sheet-body { padding: 16px 20px 0; }
.pwa-lead { color: var(--text-muted); margin-bottom: 16px; }
.pwa-steps { display: flex; flex-direction: column; gap: 14px; }
.pwa-steps li { display: flex; align-items: flex-start; gap: 12px; line-height: 1.75; }
.pwa-steps strong { font-weight: 700; color: var(--text); }
.pwa-nobr { white-space: nowrap; }
.pwa-step-n {
  display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  background: var(--primary-soft); color: var(--primary); font-weight: 700; font-size: 12.5px; line-height: 1;
}
.pwa-key {
  display: inline-grid; place-items: center; width: 26px; height: 26px; margin: 0 1px; vertical-align: middle;
  border-radius: 7px; background: var(--surface-2); border: 1px solid var(--border); color: var(--primary);
}
.pwa-key svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.pwa-key svg circle { fill: currentColor; stroke: none; }
.pwa-note {
  display: flex; gap: 10px; align-items: flex-start; margin-top: 18px; padding: 12px 14px; border-radius: 12px;
  background: var(--bg-soft); border: 1px solid var(--border-soft); color: var(--text-muted); font-size: 13px;
}
.pwa-note i { color: var(--primary); font-size: 17px; flex-shrink: 0; margin-top: 1px; }
.pwa-copy { margin-top: 12px; }
.pwa-sheet-foot { padding: 18px 20px 20px; }
@media (max-width: 640px) {
  /* Phones: a bottom sheet, like the app's own */
  .pwa-sheet-backdrop { place-items: end stretch; padding: 0; }
  .pwa-sheet {
    max-width: none; max-height: 92vh; max-height: 92dvh; border-radius: 24px 24px 0 0; border-bottom: 0;
    padding-bottom: env(safe-area-inset-bottom); transform: translateY(100%); transition: transform .26s cubic-bezier(.2, .8, .2, 1);
  }
  .pwa-sheet::before { content: ""; display: block; width: 40px; height: 5px; border-radius: 3px; background: var(--border); margin: 10px auto 0; }
  .pwa-sheet-head { padding-top: 12px; }
  .pwa-sheet-foot .btn { min-height: 48px; }
}

/* ---------- Utilities ---------- */
.muted { color: var(--text-muted); }
.dim { color: var(--text-dim); }
.small { font-size: 12.5px; }
.xsmall { font-size: 11.5px; }
.warn { color: var(--warning); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-primary { color: var(--primary); }
.strong { font-weight: 700; }
.right { text-align: right; }
.center { text-align: center; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.break { word-break: break-all; }
.flex { display: flex; align-items: center; gap: 10px; min-width: 0; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.col { display: flex; flex-direction: column; gap: 4px; }
.gap-4 { gap: 4px; } .gap-6 { gap: 6px; } .gap-16 { gap: 16px; }
.mt-4 { margin-top: 4px; } .mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-4 { margin-bottom: 4px; } .mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }
.w-full { width: 100%; }
.display { font-family: var(--font-display); }

/* Hidden balances: the pre-paint script adds the class on <html> */
html.balances-hidden .balance-value { filter: blur(8px); user-select: none; }

/* ---------- Motion ---------- */
.spin { animation: spin 1s linear infinite; }
.pulse:not(.badge) { animation: pulse 1.6s ease-in-out infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: .45; } }
@keyframes shake { 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(20px); } }
@keyframes install-up { from { opacity: 0; transform: translate(-50%, 12px); } }
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* ---------- Responsive (shared) ---------- */
@media (max-width: 1200px) {
  .grid-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1000px) {
  .grid-4, .grid-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3, .cols-main { grid-template-columns: minmax(0, 1fr); }
  .hide-md { display: none !important; }
  .wa-float { width: 52px; height: 52px; padding: 0; justify-content: center; right: 16px; }
  .wa-float .wa-float-text { display: none; }
}
@media (max-width: 768px) {
  .modal-backdrop { padding: 12px; }
  .modal { max-width: 100% !important; }
  .card-body { padding: 16px; }
  .card-head { padding: 14px 16px; }
  .filters { padding: 12px 16px; }
  .filters .form-control { flex: 1 1 45%; min-width: 0; }
  .filters .search { flex-basis: 100%; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .copy-field { flex-wrap: wrap; }
  .toast-stack { left: 12px; right: 12px; top: 12px; }
  .toast { max-width: none; min-width: 0; }
}
@media (max-width: 640px) {
  .grid-2, .form-row { grid-template-columns: minmax(0, 1fr); }
  .dl, .dl.dl-tight { grid-template-columns: minmax(0, 1fr); gap: 2px 0; }
  .dl dd { margin-bottom: 10px; }
  .container { padding: 0 16px; }
}
@media (max-width: 480px) {
  /* Install bar: the words get the full width, the two buttons share a row under them */
  .install-bar { flex-wrap: wrap; gap: 10px 8px; }
  .install-bar .grow { flex-basis: 100%; }
  .install-bar .btn { flex: 1; height: 38px; }
  .rcalc { padding: 16px; }
  .rcalc-input input { font-size: 19px; }
  .otp input { width: 48px; height: 54px; }
  .otp.is-six input { width: 42px; }
}
@media print {
  .wa-float, .install-bar, .toast-stack, .pwa-sheet-backdrop, [data-install-app], [data-install-app-wrap] { display: none !important; }
}
