/* ==========================================================================
   Tokvian /billing v3 — Telemetry Bento + Horizontal Quick Top-Up Bar
   Aligned with /usage v2 visual grammar and strictly compliant with AGENTS.md:
   - Minimum font-size: 15px across ALL desktop & mobile elements
   - Unified border-radius: 8px on all /billing cards, controls, badges, tables
   - Dark theme: pure neutral #090a0b / rgba(255,255,255,0.025|0.04|0.08),
     #9aefd2 mint accent ONLY for balance, primary SBP CTA, positive signs, ok dots
   - Light theme: strictly neutral #ffffff / #f8f9fa / #f0f2f5 / #dce1e8,
     #11141a primary text & CTA, #333742/#5e6573 secondary, ZERO green cards/badges
   ========================================================================== */

/* Active state on topbar balance pill while viewing /billing */
.app-shell[data-page="billing"] .topbar-balance {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(255, 255, 255, 0.36) !important;
  color: #f4f4f6 !important;
}

.app-shell[data-page="billing"] .topbar-balance .icon {
  color: #9aefd2 !important;
}

/* Hide duplicate sidebar promo box on /billing (shown cleanly in KPI Card 2) */
.app-shell[data-page="billing"] .sidebar-topup-bonus {
  display: none !important;
}

html.theme-light .app-shell[data-page="billing"] .topbar-balance,
[data-theme="light"] .app-shell[data-page="billing"] .topbar-balance {
  background: #f0f2f5 !important;
  border-color: #11141a !important;
  color: #11141a !important;
}

html.theme-light .app-shell[data-page="billing"] .topbar-balance .icon,
[data-theme="light"] .app-shell[data-page="billing"] .topbar-balance .icon {
  color: #11141a !important;
}

/* --------------------------------------------------------------------------
   1. Page Root & Header
   -------------------------------------------------------------------------- */
.b3-page {
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 100%;
  min-width: 0;
  color: #f4f4f6;
  font-size: 15px;
  line-height: 1.5;
}

.b3-page *,
.b3-page *::before,
.b3-page *::after {
  box-sizing: border-box;
}

.b3-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.b3-head-copy {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.b3-head-copy h1 {
  margin: 0;
  font-size: 26px !important;
  font-weight: 700 !important;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: #f4f4f6;
}

.b3-head-copy p {
  margin: 0;
  font-size: 15px !important;
  line-height: 1.5;
  color: #9da0b3;
}

.b3-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   2. Shared /billing Buttons (Strictly 8px Radius, Neutralized vs Global Pills)
   -------------------------------------------------------------------------- */
.b3-page .b3-btn,
.b3-page button.b3-btn,
.b3-page a.b3-btn,
.b3-page .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 8px !important;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.04);
  color: #f4f4f6;
  font-family: inherit;
  font-size: 15px !important;
  font-weight: 500 !important;
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: none !important;
  cursor: pointer;
  box-shadow: none !important;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

.b3-page .b3-btn:hover:not(:disabled),
.b3-page .btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.32);
  color: #ffffff;
}

.b3-page .b3-btn:disabled,
.b3-page .btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.b3-page .b3-btn .icon,
.b3-page .b3-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.b3-page .b3-btn-sm,
.b3-page .btn.small {
  min-height: 38px !important;
  padding: 0 14px !important;
  font-size: 15px !important;
  font-weight: 500 !important;
}

.b3-page .b3-btn-icon {
  width: 38px !important;
  min-width: 38px !important;
  height: 38px !important;
  min-height: 38px !important;
  padding: 0 !important;
}

.b3-page .b3-btn-primary,
.b3-page button.b3-btn-primary,
.b3-page a.b3-btn-primary {
  background: #9aefd2 !important;
  border-color: #b3f8df !important;
  color: #092019 !important;
  font-weight: 600 !important;
}

.b3-page .b3-btn-primary:hover:not(:disabled),
.b3-page button.b3-btn-primary:hover:not(:disabled),
.b3-page a.b3-btn-primary:hover:not(:disabled) {
  background: #bbf8e2 !important;
  border-color: #bbf8e2 !important;
  color: #092019 !important;
}

.b3-page .b3-btn-pending,
.b3-page button.b3-btn-pending,
.b3-page a.b3-btn-pending {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.38);
  color: #9aefd2;
  font-weight: 600 !important;
}

.b3-page .b3-btn-pending:hover:not(:disabled),
.b3-page button.b3-btn-pending:hover:not(:disabled),
.b3-page a.b3-btn-pending:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
  border-color: #9aefd2;
  color: #bbf8e2;
}

.b3-page .b3-btn-ghost,
.b3-page button.b3-btn-ghost,
.b3-page a.b3-btn-ghost {
  background: transparent;
  border-color: transparent;
  color: #9da0b3;
}

.b3-page .b3-btn-ghost:hover:not(:disabled),
.b3-page button.b3-btn-ghost:hover:not(:disabled),
.b3-page a.b3-btn-ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.06);
  border-color: transparent;
  color: #f4f4f6;
}

/* --------------------------------------------------------------------------
   3. 3-Card Neutral KPI Row (matching /usage v2 usage-kpi-grid)
   -------------------------------------------------------------------------- */
.b3-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.b3-kpi {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  padding: 18px 20px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px !important;
  min-width: 0;
}

.b3-kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 38px;
}

.b3-kpi-label {
  font-size: 15px !important;
  font-weight: 500;
  color: #9da0b3;
  line-height: 1.35;
}

.b3-kpi-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 8px !important;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: #e2e2ea;
  font-size: 15px !important;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}

.b3-kpi-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 8px !important;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: #e2e2ea;
  font-size: 15px !important;
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.b3-kpi-link:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.24);
  color: #ffffff;
}

.b3-kpi-link .icon,
.b3-kpi-link svg {
  width: 15px;
  height: 15px;
  color: #9da0b3;
  flex-shrink: 0;
}

.b3-kpi-val {
  font-family: var(--font);
  font-variant-numeric: tabular-nums;
  font-size: 22px !important;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.015em;
  color: #f4f4f6;
  overflow-wrap: anywhere;
}

.b3-kpi-val.is-balance {
  font-size: 32px !important;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: #9aefd2;
}

.b3-kpi-val.is-muted {
  color: #9da0b3;
}

.b3-kpi-sub {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px !important;
  color: #9da0b3;
  line-height: 1.4;
  flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   4. Compact Horizontal Quick Top-Up Strip
   -------------------------------------------------------------------------- */
.b3-topup-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 20px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px !important;
}

.b3-topup-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  flex-wrap: wrap;
}

.b3-topup-title {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.b3-topup-title h2 {
  margin: 0;
  font-size: 17px !important;
  font-weight: 700 !important;
  line-height: 1.3;
  color: #f4f4f6;
}

.b3-topup-title span {
  font-size: 15px !important;
  color: #9da0b3;
}

.b3-bonus-live {
  font-size: 15px !important;
  color: #9da0b3;
  font-variant-numeric: tabular-nums;
  line-height: 1.4;
}

.b3-bonus-live strong {
  color: #9aefd2;
  font-weight: 600;
}

.b3-bonus-live.is-muted strong {
  color: #e2e2ea;
}

.b3-topup-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0;
}

.b3-amount-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.b3-amount-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 128px;
  flex-shrink: 0;
}

.b3-page .b3-amount-input {
  width: 100%;
  height: 44px !important;
  min-height: 44px !important;
  padding: 0 32px 0 14px !important;
  border-radius: 8px !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  background: rgba(255, 255, 255, 0.04) !important;
  color: #f4f4f6 !important;
  font-family: var(--mono);
  font-size: 16px !important;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  outline: none;
  appearance: textfield;
  -moz-appearance: textfield;
}

.b3-page .b3-amount-input::-webkit-outer-spin-button,
.b3-page .b3-amount-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.b3-page .b3-amount-input:focus {
  border-color: #9aefd2 !important;
  box-shadow: 0 0 0 3px rgba(154, 239, 210, 0.14) !important;
}

.b3-amount-unit {
  position: absolute;
  right: 12px;
  font-size: 15px !important;
  font-weight: 500;
  color: #9da0b3;
  pointer-events: none;
}

.b3-presets {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.b3-page .b3-preset {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px !important;
  min-height: 44px !important;
  padding: 0 12px !important;
  border-radius: 8px !important;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #e2e2ea;
  font-family: inherit;
  font-size: 15px !important;
  font-weight: 500 !important;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.b3-page .b3-preset:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.07);
  color: #ffffff;
}

.b3-page .b3-preset.active,
.b3-page .b3-preset.is-active {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.4);
  color: #ffffff;
  font-weight: 600 !important;
}

.b3-topup-divider {
  width: 1px;
  height: 30px;
  background: rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.b3-methods {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  justify-content: flex-end;
  min-width: 0;
}

.b3-page .b3-pm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px !important;
  min-height: 44px !important;
  padding: 0 14px !important;
  border-radius: 8px !important;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: #f4f4f6;
  font-family: inherit;
  font-size: 15px !important;
  font-weight: 500 !important;
  white-space: nowrap;
  flex: 1 1 0;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

.b3-page .b3-pm:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.34);
  color: #ffffff;
}

.b3-page .b3-pm:disabled,
.b3-page .b3-pm.is-loading {
  opacity: 0.55;
  cursor: wait;
}

.b3-page .b3-pm.b3-pm-sbp {
  background: #9aefd2 !important;
  border-color: #b3f8df !important;
  color: #092019 !important;
  font-weight: 600 !important;
}

.b3-page .b3-pm.b3-pm-sbp:hover:not(:disabled) {
  background: #bbf8e2 !important;
  border-color: #bbf8e2 !important;
  color: #092019 !important;
}

.b3-pm-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.b3-pm.b3-pm-sbp .b3-pm-logo {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: rgba(9, 10, 11, 0.12);
}

.b3-pm-logo img {
  display: block;
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.b3-pm-logo.is-mir {
  width: 34px;
  height: 18px;
}

.b3-pm-logo.is-mir img {
  width: 34px;
  height: 11px;
  object-fit: contain;
}

.b3-topup-error {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 8px !important;
  border: 1px solid rgba(248, 113, 113, 0.35);
  background: rgba(248, 113, 113, 0.08);
  color: #fca5a5;
  font-size: 15px !important;
  line-height: 1.45;
}

.b3-topup-error.visible,
.b3-topup-error.is-visible {
  display: flex;
}

.b3-topup-unavailable {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 8px !important;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #e2e2ea;
  font-size: 15px !important;
  line-height: 1.5;
}

.b3-topup-unavailable .icon {
  width: 18px;
  height: 18px;
  color: #9da0b3;
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   5. Unified History Block: Toolbar + Segmented Tabs + Table Panel
   -------------------------------------------------------------------------- */
.b3-history {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.b3-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px !important;
  flex-wrap: wrap;
}

.b3-tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px !important;
}

.b3-page .b3-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px !important;
  padding: 6px 14px !important;
  border-radius: 8px !important;
  border: 1px solid transparent;
  background: transparent;
  color: #9da0b3;
  font-family: inherit;
  font-size: 15px !important;
  font-weight: 600 !important;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.b3-page .b3-tab:hover {
  color: #f4f4f6;
  background: rgba(255, 255, 255, 0.05);
}

.b3-page .b3-tab.active,
.b3-page .b3-tab.is-active {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
  color: #f4f4f6;
}

.b3-tab-count {
  font-family: var(--mono);
  font-size: 15px !important;
  font-weight: 500;
  opacity: 0.72;
}

.b3-toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.b3-page .b3-filter-select {
  height: 38px !important;
  min-height: 38px !important;
  padding: 0 36px 0 12px !important;
  border-radius: 8px !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  background-color: rgba(255, 255, 255, 0.04) !important;
  color: #f4f4f6 !important;
  font-family: inherit;
  font-size: 15px !important;
  font-weight: 500;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none' stroke='%239da0b3' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m2.5 4.5 3.5 3.5 3.5-3.5'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  cursor: pointer;
}

.b3-page .b3-filter-select:hover {
  background-color: rgba(255, 255, 255, 0.07) !important;
}

.b3-page .b3-filter-select option {
  background: #141518;
  color: #f4f4f6;
}

/* Table Panel */
.b3-panel {
  width: 100%;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px !important;
  overflow: hidden;
}

.b3-page .b3-table-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: 0 !important;
  -webkit-overflow-scrolling: touch;
}

.b3-page .b3-table {
  width: 100%;
  border-collapse: collapse !important;
  border-spacing: 0 !important;
  font-size: 15px !important;
  white-space: nowrap;
}

.b3-page .b3-table thead th {
  text-align: left;
  padding: 12px 18px !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  color: #9da0b3;
  background: rgba(255, 255, 255, 0.04);
  border-top: 0 !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0 !important;
}

.b3-page .b3-table tbody td {
  padding: 14px 18px !important;
  font-size: 15px !important;
  color: #f4f4f6;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0 !important;
  vertical-align: middle;
}

/* Override global styles.css:223-224 & 1203-1218 corner/padding resets */
.b3-page .b3-table th:first-child,
.b3-page .b3-table td:first-child {
  padding-left: 18px !important;
  border-top-left-radius: 0 !important;
  border-bottom-left-radius: 0 !important;
}

.b3-page .b3-table th:last-child,
.b3-page .b3-table td:last-child {
  padding-right: 18px !important;
  border-top-right-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
}

.b3-page .b3-table tbody tr:last-child td {
  border-bottom: 0 !important;
}

.b3-page .b3-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.035);
}

.b3-page .b3-table th.num,
.b3-page .b3-table td.num,
.b3-page .b3-table th.act,
.b3-page .b3-table td.act {
  text-align: right;
}

.b3-cell-date {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.b3-page .b3-inv-id {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 32px;
  padding: 4px 8px;
  border: 1px solid transparent;
  border-radius: 8px !important;
  background: transparent;
  font-family: var(--mono);
  font-size: 15px !important;
  font-weight: 400;
  color: #9da0b3;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.b3-page .b3-inv-id:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  color: #f4f4f6;
}

.b3-page .b3-inv-id .icon {
  width: 14px;
  height: 14px;
  opacity: 0.7;
}

.b3-method-cell {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.b3-method-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px !important;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.b3-method-icon img {
  width: 17px;
  height: 17px;
  object-fit: contain;
  display: block;
}

.b3-method-icon .icon {
  width: 16px;
  height: 16px;
  color: #9da0b3;
}

.b3-method-icon.is-mir {
  width: 38px;
}

.b3-method-icon.is-mir img {
  width: 28px;
  height: 10px;
}

/* Neutral Status Badges & Semantic Dots */
.b3-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: 8px !important;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #e2e2ea;
  font-size: 15px !important;
  font-weight: 500;
  line-height: 1.35;
  white-space: nowrap;
}

.b3-dot {
  width: 8px;
  height: 8px;
  border-radius: 50% !important;
  display: inline-block;
  flex-shrink: 0;
  background: #9da0b3;
}

.b3-dot-ok {
  background: #9aefd2;
}

.b3-dot-warn {
  background: #fbbf24;
}

.b3-dot-err {
  background: #f87171;
}

.b3-dot-muted {
  background: #9da0b3;
}

/* Operations Tab Cells */
.b3-op-kind {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 15px !important;
  font-weight: 500;
  color: #f4f4f6;
}

.b3-op-note {
  display: block;
  font-size: 15px !important;
  color: #9da0b3;
  white-space: normal;
  max-width: 420px;
  line-height: 1.4;
}

/* Tabular Amounts */
.b3-amount-cell {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  white-space: nowrap;
}

.b3-amount {
  font-family: var(--mono);
  font-size: 15px !important;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: #f4f4f6;
}

.b3-amount.is-pos {
  color: #9aefd2;
}

.b3-amount.is-neg {
  color: #e2e2ea;
}

.b3-amount.is-muted {
  color: #9da0b3;
}

.b3-amount-sub {
  font-size: 15px !important;
  color: #9da0b3;
}

.b3-row-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  white-space: nowrap;
}

/* Empty State inside Table Panel */
.b3-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
  gap: 10px;
}

.b3-empty-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px !important;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #9da0b3;
}

.b3-empty h3 {
  margin: 0;
  font-size: 17px !important;
  font-weight: 600;
  color: #f4f4f6;
}

.b3-empty p {
  margin: 0;
  font-size: 15px !important;
  color: #9da0b3;
  max-width: 420px;
  line-height: 1.5;
}

/* Panel Footer & Pagination */
.b3-panel-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px 16px;
  padding: 14px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.015);
  font-size: 15px !important;
  color: #9da0b3;
  flex-wrap: wrap;
}

.b3-foot-note {
  font-size: 15px !important;
  color: #9da0b3;
  line-height: 1.45;
}

.b3-pager,
.b3-panel-foot .finance-pagination,
.b3-panel-foot .pager {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 !important;
  padding: 0 !important;
  font-size: 15px !important;
}

.b3-panel-foot .finance-pagination > div {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.b3-pager-info,
.b3-panel-foot .pager span {
  font-size: 15px !important;
  color: #9da0b3;
  font-variant-numeric: tabular-nums;
}

/* Subtle Loading Spinner */
.b3-spin {
  animation: b3Spin 0.85s linear infinite;
}

@keyframes b3Spin {
  to {
    transform: rotate(360deg);
  }
}

/* --------------------------------------------------------------------------
   6. Light Theme Parity (Strictly Neutral — ZERO Green Cards/Badges/Borders)
   -------------------------------------------------------------------------- */
html.theme-light .b3-page,
[data-theme="light"] .b3-page {
  color: #11141a;
}

html.theme-light .b3-head-copy h1,
[data-theme="light"] .b3-head-copy h1,
html.theme-light .b3-topup-title h2,
[data-theme="light"] .b3-topup-title h2,
html.theme-light .b3-empty h3,
[data-theme="light"] .b3-empty h3 {
  color: #11141a;
}

html.theme-light .b3-head-copy p,
[data-theme="light"] .b3-head-copy p,
html.theme-light .b3-kpi-label,
[data-theme="light"] .b3-kpi-label,
html.theme-light .b3-kpi-sub,
[data-theme="light"] .b3-kpi-sub,
html.theme-light .b3-topup-title span,
[data-theme="light"] .b3-topup-title span,
html.theme-light .b3-bonus-live,
[data-theme="light"] .b3-bonus-live,
html.theme-light .b3-amount-unit,
[data-theme="light"] .b3-amount-unit,
html.theme-light .b3-op-note,
[data-theme="light"] .b3-op-note,
html.theme-light .b3-amount-sub,
[data-theme="light"] .b3-amount-sub,
html.theme-light .b3-empty p,
[data-theme="light"] .b3-empty p,
html.theme-light .b3-foot-note,
[data-theme="light"] .b3-foot-note,
html.theme-light .b3-pager-info,
[data-theme="light"] .b3-pager-info,
html.theme-light .b3-panel-foot .pager span,
[data-theme="light"] .b3-panel-foot .pager span {
  color: #5e6573;
}

/* Light Cards & Containers */
html.theme-light .b3-kpi,
[data-theme="light"] .b3-kpi,
html.theme-light .b3-topup-card,
[data-theme="light"] .b3-topup-card,
html.theme-light .b3-toolbar,
[data-theme="light"] .b3-toolbar,
html.theme-light .b3-panel,
[data-theme="light"] .b3-panel {
  background: #ffffff;
  border-color: #dce1e8;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

html.theme-light .b3-kpi-val,
[data-theme="light"] .b3-kpi-val,
html.theme-light .b3-kpi-val.is-balance,
[data-theme="light"] .b3-kpi-val.is-balance,
html.theme-light .b3-bonus-live strong,
[data-theme="light"] .b3-bonus-live strong {
  color: #11141a;
}

html.theme-light .b3-kpi-val.is-muted,
[data-theme="light"] .b3-kpi-val.is-muted {
  color: #5e6573;
}

html.theme-light .b3-kpi-tag,
[data-theme="light"] .b3-kpi-tag {
  background: #f0f2f5;
  border-color: #dce1e8;
  color: #11141a;
}

html.theme-light .b3-kpi-link,
[data-theme="light"] .b3-kpi-link,
html.theme-light .b3-page article.b3-kpi a.b3-kpi-link,
[data-theme="light"] .b3-page article.b3-kpi a.b3-kpi-link {
  background: #f8f9fa;
  border-color: #dce1e8;
  color: #11141a !important;
  text-decoration: none !important;
  font-weight: 500 !important;
}

html.theme-light .b3-kpi-link:hover,
[data-theme="light"] .b3-kpi-link:hover,
html.theme-light .b3-page article.b3-kpi a.b3-kpi-link:hover,
[data-theme="light"] .b3-page article.b3-kpi a.b3-kpi-link:hover {
  background: #f0f2f5;
  border-color: #c5ccd6;
  color: #11141a !important;
  text-decoration: none !important;
  font-weight: 500 !important;
}

html.theme-light .b3-kpi-link .icon,
[data-theme="light"] .b3-kpi-link .icon {
  color: #333742;
}

/* Light Buttons */
html.theme-light .b3-page .b3-btn,
[data-theme="light"] .b3-page .b3-btn,
html.theme-light .b3-page .btn,
[data-theme="light"] .b3-page .btn {
  background: #f8f9fa !important;
  border-color: #dce1e8 !important;
  color: #11141a !important;
}

html.theme-light .b3-page .b3-btn:hover:not(:disabled),
[data-theme="light"] .b3-page .b3-btn:hover:not(:disabled),
html.theme-light .b3-page .btn:hover:not(:disabled),
[data-theme="light"] .b3-page .btn:hover:not(:disabled) {
  background: #f0f2f5 !important;
  border-color: #c5ccd6 !important;
  color: #11141a !important;
}

html.theme-light .b3-page .b3-btn-primary,
[data-theme="light"] .b3-page .b3-btn-primary {
  background: #11141a !important;
  border-color: #11141a !important;
  color: #ffffff !important;
}

html.theme-light .b3-page .b3-btn-primary:hover:not(:disabled),
[data-theme="light"] .b3-page .b3-btn-primary:hover:not(:disabled) {
  background: #252832 !important;
  border-color: #252832 !important;
  color: #ffffff !important;
}

html.theme-light .b3-page .b3-btn-pending,
[data-theme="light"] .b3-page .b3-btn-pending {
  background: #f0f2f5 !important;
  border-color: #11141a !important;
  color: #11141a !important;
}

html.theme-light .b3-page .b3-btn-pending:hover:not(:disabled),
[data-theme="light"] .b3-page .b3-btn-pending:hover:not(:disabled) {
  background: #e4e7ec !important;
  border-color: #11141a !important;
}

html.theme-light .b3-page .b3-btn-ghost,
[data-theme="light"] .b3-page .b3-btn-ghost {
  background: transparent !important;
  border-color: transparent !important;
  color: #333742 !important;
}

html.theme-light .b3-page .b3-btn-ghost:hover:not(:disabled),
[data-theme="light"] .b3-page .b3-btn-ghost:hover:not(:disabled) {
  background: #f0f2f5 !important;
  border-color: transparent !important;
  color: #11141a !important;
}

/* Light Top-Up Controls */
html.theme-light .b3-page .b3-amount-input,
[data-theme="light"] .b3-page .b3-amount-input {
  background: #ffffff !important;
  border-color: #c5ccd6 !important;
  color: #11141a !important;
}

html.theme-light .b3-page .b3-amount-input:focus,
[data-theme="light"] .b3-page .b3-amount-input:focus {
  border-color: #11141a !important;
  box-shadow: 0 0 0 3px rgba(17, 20, 26, 0.08) !important;
}

html.theme-light .b3-page .b3-preset,
[data-theme="light"] .b3-page .b3-preset {
  background: #f8f9fa;
  border-color: #dce1e8;
  color: #333742;
}

html.theme-light .b3-page .b3-preset:hover:not(:disabled),
[data-theme="light"] .b3-page .b3-preset:hover:not(:disabled) {
  background: #f0f2f5;
  border-color: #c5ccd6;
  color: #11141a;
}

html.theme-light .b3-page .b3-preset.active,
[data-theme="light"] .b3-page .b3-preset.active,
html.theme-light .b3-page .b3-preset.is-active,
[data-theme="light"] .b3-page .b3-preset.is-active {
  background: #11141a;
  border-color: #11141a;
  color: #ffffff;
}

html.theme-light .b3-topup-divider,
[data-theme="light"] .b3-topup-divider {
  background: #dce1e8;
}

html.theme-light .b3-page .b3-pm,
[data-theme="light"] .b3-page .b3-pm {
  background: #f8f9fa;
  border-color: #dce1e8;
  color: #11141a;
}

html.theme-light .b3-page .b3-pm:hover:not(:disabled),
[data-theme="light"] .b3-page .b3-pm:hover:not(:disabled) {
  background: #f0f2f5;
  border-color: #c5ccd6;
  color: #11141a;
}

html.theme-light .b3-page .b3-pm.b3-pm-sbp,
[data-theme="light"] .b3-page .b3-pm.b3-pm-sbp {
  background: #11141a !important;
  border-color: #11141a !important;
  color: #ffffff !important;
}

html.theme-light .b3-page .b3-pm.b3-pm-sbp:hover:not(:disabled),
[data-theme="light"] .b3-page .b3-pm.b3-pm-sbp:hover:not(:disabled) {
  background: #252832 !important;
  border-color: #252832 !important;
  color: #ffffff !important;
}

html.theme-light .b3-pm.b3-pm-sbp .b3-pm-logo,
[data-theme="light"] .b3-pm.b3-pm-sbp .b3-pm-logo {
  background: #ffffff;
}

html.theme-light .b3-topup-error,
[data-theme="light"] .b3-topup-error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

html.theme-light .b3-topup-unavailable,
[data-theme="light"] .b3-topup-unavailable {
  background: #f8f9fa;
  border-color: #dce1e8;
  color: #333742;
}

/* Light Segmented Tabs & Select */
html.theme-light .b3-tabs,
[data-theme="light"] .b3-tabs {
  background: #f0f2f5;
  border-color: #dce1e8;
}

html.theme-light .b3-page .b3-tab,
[data-theme="light"] .b3-page .b3-tab {
  color: #333742;
}

html.theme-light .b3-page .b3-tab:hover,
[data-theme="light"] .b3-page .b3-tab:hover {
  background: #e6e9ef;
  color: #11141a;
}

html.theme-light .b3-page .b3-tab.active,
[data-theme="light"] .b3-page .b3-tab.active,
html.theme-light .b3-page .b3-tab.is-active,
[data-theme="light"] .b3-page .b3-tab.is-active {
  background: #11141a;
  border-color: #11141a;
  color: #ffffff;
}

html.theme-light .b3-page .b3-filter-select,
[data-theme="light"] .b3-page .b3-filter-select {
  background-color: #f8f9fa !important;
  border-color: #dce1e8 !important;
  color: #11141a !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none' stroke='%235e6573' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m2.5 4.5 3.5 3.5 3.5-3.5'/%3E%3C/svg%3E") !important;
}

html.theme-light .b3-page .b3-filter-select:hover,
[data-theme="light"] .b3-page .b3-filter-select:hover {
  background-color: #f0f2f5 !important;
  border-color: #c5ccd6 !important;
}

html.theme-light .b3-page .b3-filter-select option,
[data-theme="light"] .b3-page .b3-filter-select option {
  background: #ffffff;
  color: #11141a;
}

/* Light Table, Neutral Badges, Status Dots */
html.theme-light .b3-page .b3-table thead th,
[data-theme="light"] .b3-page .b3-table thead th {
  background: #f8f9fa !important;
  color: #5e6573 !important;
  border-bottom-color: #dce1e8 !important;
}

html.theme-light .b3-page .b3-table tbody td,
[data-theme="light"] .b3-page .b3-table tbody td {
  color: #11141a !important;
  border-bottom-color: #eceff3 !important;
}

html.theme-light .b3-page .b3-table tbody tr:hover td,
[data-theme="light"] .b3-page .b3-table tbody tr:hover td {
  background: #f8f9fa !important;
}

html.theme-light .b3-page .b3-inv-id,
[data-theme="light"] .b3-page .b3-inv-id {
  color: #5e6573;
}

html.theme-light .b3-page .b3-inv-id:hover,
[data-theme="light"] .b3-page .b3-inv-id:hover {
  background: #f0f2f5;
  border-color: #dce1e8;
  color: #11141a;
}

html.theme-light .b3-method-icon,
[data-theme="light"] .b3-method-icon,
html.theme-light .b3-empty-icon,
[data-theme="light"] .b3-empty-icon {
  background: #f8f9fa;
  border-color: #dce1e8;
  color: #333742;
}

/* Strictly Neutral Status Badges in Light Mode (GREEN ONLY on 8px .b3-dot-ok!) */
html.theme-light .b3-status,
[data-theme="light"] .b3-status {
  background: #f0f2f5;
  border-color: #dce1e8;
  color: #11141a;
}

html.theme-light .b3-dot-ok,
[data-theme="light"] .b3-dot-ok {
  background: #16a34a;
}

html.theme-light .b3-dot-warn,
[data-theme="light"] .b3-dot-warn {
  background: #d97706;
}

html.theme-light .b3-dot-err,
[data-theme="light"] .b3-dot-err {
  background: #dc2626;
}

html.theme-light .b3-dot-muted,
[data-theme="light"] .b3-dot-muted {
  background: #6b7280;
}

html.theme-light .b3-op-kind,
[data-theme="light"] .b3-op-kind,
html.theme-light .b3-amount,
[data-theme="light"] .b3-amount {
  color: #11141a;
}

html.theme-light .b3-amount.is-pos,
[data-theme="light"] .b3-amount.is-pos {
  color: #11141a;
  font-weight: 600;
}

html.theme-light .b3-amount.is-neg,
[data-theme="light"] .b3-amount.is-neg {
  color: #333742;
}

html.theme-light .b3-amount.is-muted,
[data-theme="light"] .b3-amount.is-muted {
  color: #5e6573;
}

html.theme-light .b3-panel-foot,
[data-theme="light"] .b3-panel-foot {
  background: #ffffff;
  border-top-color: #dce1e8;
  color: #5e6573;
}

/* --------------------------------------------------------------------------
   7. Responsive & Mobile Layouts (Strict >= 15px & 8px Radius at All Widths)
   -------------------------------------------------------------------------- */
@media (max-width: 1220px) {
  .b3-topup-row {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .b3-amount-group {
    flex-wrap: wrap;
  }

  .b3-topup-divider {
    display: none;
  }

  .b3-methods {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
  }
}

@media (max-width: 960px) {
  .b3-kpi-grid {
    grid-template-columns: 1fr;
  }

  .b3-methods {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .b3-page {
    gap: 14px;
  }

  .b3-head {
    align-items: flex-start;
    gap: 12px;
  }

  .b3-head-copy h1 {
    font-size: 24px !important;
  }

  .b3-head-actions {
    width: 100%;
  }

  .b3-head-actions .b3-btn {
    flex: 1 1 auto;
  }

  .b3-kpi,
  .b3-topup-card {
    padding: 16px;
  }

  .b3-amount-group {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .b3-amount-wrap {
    width: 100%;
  }

  .b3-presets {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
  }

  .b3-page .b3-preset {
    padding: 0 8px !important;
  }

  .b3-methods {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .b3-page .b3-pm {
    padding: 0 10px !important;
  }

  .b3-toolbar {
    padding: 12px;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .b3-tabs {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .b3-toolbar-right {
    width: 100%;
  }

  .b3-page .b3-filter-select {
    flex: 1 1 auto;
    min-width: 0;
  }

  /* Convert table cleanly into readable 8px mobile cards (>= 15px everywhere) */
  .b3-panel {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    overflow: visible;
  }

  .b3-page .b3-table-wrap {
    overflow: visible;
  }

  .b3-page .b3-table,
  .b3-page .b3-table tbody {
    display: block;
    width: 100%;
    white-space: normal;
  }

  .b3-page .b3-table thead {
    display: none;
  }

  .b3-page .b3-table tbody {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .b3-page .b3-table tbody tr {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px !important;
  }

  html.theme-light .b3-page .b3-table tbody tr,
  [data-theme="light"] .b3-page .b3-table tbody tr {
    background: #ffffff;
    border-color: #dce1e8;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  }

  .b3-page .b3-table tbody tr:hover td {
    background: transparent !important;
  }

  .b3-page .b3-table tbody td,
  .b3-page .b3-table td:first-child,
  .b3-page .b3-table td:last-child {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 !important;
    border: 0 !important;
    text-align: right;
    white-space: normal;
  }

  .b3-page .b3-table tbody td[data-label]::before {
    content: attr(data-label);
    font-size: 15px !important;
    font-weight: 500;
    color: #9da0b3;
    text-align: left;
    flex-shrink: 0;
  }

  html.theme-light .b3-page .b3-table tbody td[data-label]::before,
  [data-theme="light"] .b3-page .b3-table tbody td[data-label]::before {
    color: #5e6573;
  }

  .b3-page .b3-table tbody td.act {
    padding-top: 10px !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
    justify-content: flex-end;
  }

  html.theme-light .b3-page .b3-table tbody td.act,
  [data-theme="light"] .b3-page .b3-table tbody td.act {
    border-top-color: #eceff3 !important;
  }

  .b3-page .b3-table tbody td.act::before {
    display: none;
  }

  .b3-row-actions {
    width: 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
  }

  .b3-row-actions .b3-btn {
    flex: 1 1 auto;
  }

  .b3-cell-date {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
  }

  .b3-panel-foot {
    margin-top: 12px;
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px !important;
    background: rgba(255, 255, 255, 0.025);
  }

  html.theme-light .b3-panel-foot,
  [data-theme="light"] .b3-panel-foot {
    border-color: #dce1e8;
    background: #ffffff;
  }

  .b3-pager,
  .b3-panel-foot .finance-pagination,
  .b3-panel-foot .pager {
    width: 100%;
    justify-content: space-between;
  }
}

@media (max-width: 480px) {
  .b3-presets {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .b3-methods {
    grid-template-columns: 1fr;
  }
}
