/* ═══════════════════════════════════════════
   BILLING PAGE  — Desktop first, mobile full
   ═══════════════════════════════════════════ */

/* ── Top bar (Stitch pattern) ── */
.bl-top-bar {
  display: flex; align-items: center; gap: 16px;
  padding: 0 24px; height: 56px; flex-shrink: 0;
  border-bottom: 1px solid var(--border);
  background: var(--card);
  overflow: visible; position: relative; z-index: 50;
}
.bl-top-left { display: flex; flex-direction: column; justify-content: center; margin-right: 8px; }
.bl-top-title { font-size: 15px; font-weight: 700; color: var(--text-primary); line-height: 1.2; }
.bl-top-sub   { font-size: 11px; color: var(--text-muted); line-height: 1.2; }
.bl-header-tabs { display: flex; align-items: center; gap: 2px; flex: 1; }
.bl-top-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.bl-icon-btn {
  width: 34px; height: 34px; border-radius: 9px;
  border: 1.5px solid var(--border);
  background: var(--card); color: var(--text-muted);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  transition: border-color .15s, color .15s;
}
.bl-icon-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ── Available Plans header row ── */
.bl-plans-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 20px; flex-wrap: wrap;
  margin: 24px 0 12px;
}
.bl-plans-header-left { display: flex; flex-direction: column; gap: 4px; }
.bl-plans-h2 {
  font-size: 22px; font-weight: 800; color: var(--text-primary);
  margin: 0; font-family: 'Plus Jakarta Sans', sans-serif;
}
.bl-plans-subtext { font-size: 13px; color: var(--text-muted); margin: 0; line-height: 1.4; }

/* Move toggle wrap to inline */
.bl-plans-header .billing-toggle-wrap { margin-bottom: 0; padding-top: 4px; }

/* ── Dark mode ── */
[data-theme="dark"] .bl-top-bar { background: var(--card); border-color: var(--border); }
[data-theme="dark"] .bl-icon-btn { background: var(--card); border-color: var(--border); color: var(--text-muted); }

/* ── Layout ── */
.billing-layout { display: flex; flex-direction: column; height: 100%; overflow: hidden; }
.billing-body {
  flex: 1; overflow-y: auto;
  padding: 24px 28px 40px;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 0 28px;
  align-items: start;
}
.billing-main  { display: flex; flex-direction: column; min-width: 0; }
.billing-sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  padding-top: 4px;
}

/* ── Section titles ── */
.billing-section-title {
  font-size: 11px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .6px;
  margin: 20px 0 10px;
}

/* ══════════════════════════════════════
   OVERVIEW CARD  (desktop: 2-col grid)
   ══════════════════════════════════════ */
.billing-overview-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  padding: 20px 24px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; flex-wrap: wrap;
}
.billing-cancel-btn {
  flex-basis: 100%; margin-left: auto; width: fit-content;
  padding: 7px 14px; border-radius: 8px;
  border: 1.5px solid #fca5a5;
  background: transparent; color: #dc2626;
  font-size: 12px; font-weight: 600; cursor: pointer;
}
.billing-cancel-btn:hover { background: #fef2f2; }

.billing-overview-left  { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.billing-overview-right { display: flex; flex-direction: column; gap: 8px; }

.billing-plan-icon-lg {
  width: 50px; height: 50px; border-radius: 14px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 22px;
}
.billing-overview-plan {
  font-size: 17px; font-weight: 800; color: var(--text-primary);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.billing-overview-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.billing-overview-row { display: flex; justify-content: space-between; gap: 12px; white-space: nowrap; }
.billing-overview-label { font-size: 11px; color: var(--text-muted); font-weight: 500; }
.billing-overview-value { font-size: 12px; font-weight: 600; color: var(--text-primary); }

/* Status badges */
.billing-status-badge { font-size: 11px; font-weight: 700; padding: 2px 10px; border-radius: 99px; }
.billing-status-badge.active    { background: #d1fae5; color: #065f46; }
.billing-status-badge.trial     { background: #dbeafe; color: #1e40af; }
.billing-status-badge.suspended { background: #fee2e2; color: #991b1b; }
.billing-status-badge.cancelled { background: #f3f4f6; color: #6b7280; }

/* Trial progress bar */
.billing-trial-track { background: #f3f4f6; border-radius: 99px; height: 6px; width: 200px; }
.billing-trial-fill  { background: #f59e0b; border-radius: 99px; height: 6px; transition: width .4s; }

/* ══════════════════════════════════════
   USAGE GRID
   ══════════════════════════════════════ */
.billing-usage-head-row {
  display: flex; align-items: center; justify-content: space-between;
  margin: 20px 0 10px;
}
.billing-reset-hint {
  font-size: 11px; font-weight: 600; color: var(--text-muted);
  background: var(--bg); border: 1px solid var(--border);
  padding: 3px 10px; border-radius: 99px;
}
.billing-usage-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
}
.billing-usage-item {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 16px;
}
.billing-usage-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.billing-usage-label  { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.billing-usage-val    { font-size: 12px; font-weight: 700; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.billing-usage-bar    { height: 6px; background: var(--bg); border-radius: 99px; overflow: hidden; }
.billing-usage-fill   { height: 6px; border-radius: 99px; transition: width .4s; }
.billing-usage-hint   { font-size: 10px; color: var(--text-muted); margin-top: 4px; }

/* ══════════════════════════════════════
   TRANSACTION HISTORY
   ══════════════════════════════════════ */
.billing-txn-card  { background: var(--card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.billing-txn-empty { padding: 14px 24px; text-align: center; color: var(--text-muted); font-size: 13px; }
.billing-txn-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.billing-txn-table th {
  padding: 10px 16px; text-align: left;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
  color: var(--text-muted); border-bottom: 1px solid var(--border); background: var(--bg);
}
.billing-txn-table td   { padding: 12px 16px; border-bottom: 1px solid var(--border); color: var(--text-primary); }
.billing-txn-table tr:last-child td { border-bottom: none; }
.billing-txn-table tr:hover td { background: var(--bg); }
.billing-order-id { font-size: 11px; color: var(--text-muted); font-family: monospace; }
.billing-txn-status { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; text-transform: capitalize; }
.billing-txn-status.paid     { background: #d1fae5; color: #065f46; }
.billing-txn-status.failed   { background: #fee2e2; color: #991b1b; }
.billing-txn-status.refunded { background: #fef3c7; color: #92400e; }

/* ══════════════════════════════════════
   BILLING TOGGLE
   ══════════════════════════════════════ */
.billing-toggle-wrap { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.billing-toggle-wrap span { font-size: 13px; color: #6b7280; }
.billing-toggle-wrap span.active { font-weight: 700; color: var(--text-primary); }
.billing-toggle {
  position: relative; width: 44px; height: 24px;
  background: #25D366; border-radius: 99px; cursor: pointer; border: none; padding: 0;
}
.billing-toggle-thumb {
  position: absolute; top: 3px; width: 18px; height: 18px;
  background: #fff; border-radius: 50%; transition: left .2s;
}
.billing-toggle-thumb.monthly { left: 3px; }
.billing-toggle-thumb.annual  { left: 23px; }
.billing-save-badge { background: #d1fae5; color: #065f46; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 99px; }

/* ══════════════════════════════════════
   PLAN CARDS  (desktop: 4-col)
   ══════════════════════════════════════ */
.billing-plans {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 24px; margin-bottom: 24px;
  padding: 18px 12px 12px; /* room for scale-105 + badges */
  overflow: visible;
}
.billing-plan-card {
  background: var(--card); border: 2px solid var(--border);
  border-radius: 16px; padding: 24px 20px;
  display: flex; flex-direction: column; position: relative;
  transition: border-color .2s, transform .15s;
}
.billing-plan-card:hover         { border-color: #25D366; transform: translateY(-2px); }
.billing-plan-card.current       { border-color: #25D366; }
.billing-plan-card.popular       { border-color: #25D366; }
.billing-plan-card.trial-card    { border-color: #25D366; background: #f0fdf4; }
.billing-plan-card.pro-card {
  background: #006d2f;
  border-color: #006d2f;
  color: #fff;
  transform: scale(1.05);
  z-index: 1;
  box-shadow: 0 14px 36px rgba(0,109,47,.35);
}
.billing-plan-card.pro-card:hover { border-color: #25D366; transform: scale(1.05) translateY(-2px); }
.billing-plan-card.pro-card .billing-card-features li         { color: rgba(255,255,255,.9); }
.billing-plan-card.pro-card .billing-card-features li.dim     { color: rgba(255,255,255,.38); }
.billing-plan-card.pro-card .billing-card-price .amount       { color: #fff; }
.billing-plan-card.pro-card .billing-card-price .period       { color: rgba(255,255,255,.6); }
.billing-plan-card.pro-card .billing-card-annual-total        { color: rgba(255,255,255,.55); }
.billing-plan-card.pro-card .billing-card-name                { color: rgba(255,255,255,.75); }
.billing-plan-card.pro-card .billing-card-desc                { color: rgba(255,255,255,.72); }

/* Card badges */
.billing-popular-badge, .billing-current-badge,
.billing-trial-badge, .billing-best-value-badge {
  position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
  font-size: 11px; font-weight: 700; padding: 3px 12px; border-radius: 99px; white-space: nowrap;
}
.billing-popular-badge    { background: #25D366; color: #fff; }
.billing-current-badge    { background: #25D366; color: #fff; }
.billing-trial-badge      { background: #25D366; color: #fff; }
.billing-best-value-badge { background: #f59e0b; color: #fff; }

.billing-card-name  { font-size: 15px; font-weight: 700; color: #111827; margin-bottom: 4px; }
.billing-card-price { margin: 12px 0 16px; }
.billing-card-price .amount   { font-size: 30px; font-weight: 800; color: #111827; }
.billing-card-price .period   { font-size: 12px; color: #6b7280; }
.billing-card-price .original { font-size: 12px; color: #9ca3af; text-decoration: line-through; margin-right: 4px; }
.billing-card-annual-total    { font-size: 11px; color: #6b7280; margin-top: 4px; }
.billing-card-desc  { font-size: 12px; margin-bottom: 16px; }

.billing-card-features      { list-style: none; padding: 0; margin: 0 0 20px; flex: 1; }
.billing-card-features li   { font-size: 12px; color: #374151; padding: 4px 0; display: flex; align-items: center; gap: 7px; }
.billing-card-features li svg { flex-shrink: 0; color: #25D366; }
.billing-card-features li.dim     { color: #9ca3af; }
.billing-card-features li.dim svg { color: #d1d5db; }

.billing-card-btn {
  width: 100%; padding: 11px; border-radius: 9px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  border: 2px solid #25D366; transition: .15s;
}
.billing-card-btn.outline       { background: #fff; color: #374151; border-color: #d1d5db; }
.billing-card-btn.outline:hover { background: #f9fafb; border-color: #9ca3af; }
.billing-card-btn.trial-btn     { background: #fff; color: #128C7E; border-color: #25D366; }
.billing-card-btn.trial-btn:hover  { background: #f0fdf4; }
.billing-card-btn.basic-btn     { background: #0ea5e9; color: #fff; border-color: #0ea5e9; }
.billing-card-btn.basic-btn:hover  { background: #0284c7; border-color: #0284c7; }
.billing-card-btn.pro-btn      { background: linear-gradient(135deg,#25D366,#ef4444); color: #fff; border: none; }
.billing-card-btn.pro-btn:hover{ background: linear-gradient(135deg,#128C7E,#dc2626); }
.billing-card-btn.current-btn  { background: #f3f4f6; border-color: #e5e7eb; color: #6b7280; cursor: default; }

/* ── Tablet ── */
@media (max-width: 700px) {
  .billing-plans { grid-template-columns: 1fr; gap: 12px; }
  .billing-usage-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ══════════════════════════════════════════════════════
   MOBILE  ≤ 768px  — complete layout rebuild
   ══════════════════════════════════════════════════════ */
@media (max-width: 768px) {

  /* Body */
  .billing-body {
    padding: 0 0 80px;
    gap: 0;
  }
  .billing-section-title {
    font-size: 10px; letter-spacing: .7px;
    margin: 0; padding: 18px 16px 8px;
  }

  /* ── Overview card: full-width compact banner ── */
  .billing-overview-card {
    border-radius: 0;
    border-left: none; border-right: none; border-top: none;
    padding: 16px;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
  }
  .billing-overview-left {
    flex-direction: row; align-items: flex-start; gap: 12px;
  }
  .billing-plan-icon-lg {
    width: 42px; height: 42px; font-size: 19px; border-radius: 11px; flex-shrink: 0; margin-top: 2px;
  }
  .billing-overview-plan { font-size: 15px; gap: 6px; }
  .billing-overview-meta { font-size: 11px; margin-top: 2px; }

  /* Right side info: inline chips row below plan name */
  .billing-overview-right {
    display: flex; flex-direction: row; flex-wrap: wrap;
    gap: 6px 16px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    width: 100%;
  }
  .billing-overview-left { flex-direction: column; }

  .billing-overview-row {
    flex-direction: column; gap: 1px; white-space: normal;
  }
  .billing-overview-label { font-size: 10px; }
  .billing-overview-value { font-size: 12px; font-weight: 700; }

  /* Cancel button: full-width red link style */
  .billing-cancel-btn {
    grid-column: unset;
    justify-self: unset;
    margin-top: 10px;
    width: 100%; padding: 9px;
    text-align: center; font-size: 12px;
    border-radius: 8px;
  }

  /* Trial bar */
  .billing-trial-track { width: 100%; }

  /* ── Usage: 2×2 grid ── */
  .billing-usage-grid {
    display: grid; grid-template-columns: repeat(2, 1fr);
    gap: 8px; padding: 0 16px 4px;
  }
  .billing-usage-item { padding: 12px 14px; border-radius: 10px; }
  .billing-usage-label { font-size: 11px; }
  .billing-usage-val   { font-size: 12px; }
  .billing-usage-hint  { font-size: 10px; }

  /* ── Transaction table → stacked card rows ── */
  .billing-txn-card {
    border-radius: 0; border-left: none; border-right: none;
    overflow: visible;
  }
  .billing-txn-table thead { display: none; }
  .billing-txn-table,
  .billing-txn-table tbody { display: block; }
  .billing-txn-table tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto auto;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    gap: 4px 8px;
  }
  .billing-txn-table tr:last-child { border-bottom: none; }
  .billing-txn-table tr:hover td { background: transparent; }
  .billing-txn-table td {
    display: block; padding: 0; border: none;
    font-size: 12px;
  }
  /* Date (col 1, row 1) */
  .billing-txn-table td:nth-child(1) {
    grid-column: 1; grid-row: 1;
    font-size: 11px; color: var(--text-muted);
  }
  /* Plan name (col 1, row 2) */
  .billing-txn-table td:nth-child(2) {
    grid-column: 1; grid-row: 2;
    font-size: 14px;
  }
  /* Billing cycle (col 1, row 3) */
  .billing-txn-table td:nth-child(3) {
    grid-column: 1; grid-row: 3;
    font-size: 11px; color: var(--text-muted); text-transform: capitalize;
  }
  /* Amount (col 2, rows 1-2, right-aligned) */
  .billing-txn-table td:nth-child(4) {
    grid-column: 2; grid-row: 1 / 3;
    text-align: right; align-self: center;
    font-size: 16px; font-weight: 800;
  }
  /* Order ID (col 1+2, row below) */
  .billing-txn-table td:nth-child(5) {
    grid-column: 1; grid-row: 4;
    font-size: 10px;
  }
  /* Status badge (col 2, row 4) */
  .billing-txn-table td:nth-child(6) {
    grid-column: 2; grid-row: 3 / 5;
    text-align: right; align-self: end;
  }
  .billing-txn-empty { padding: 24px 16px; font-size: 12px; }

  /* ── Available Plans: toggle centered ── */
  .billing-toggle-wrap {
    justify-content: center;
    margin: 0 16px 12px;
    padding-top: 4px;
  }

  /* ── Plan cards: full-width horizontal layout ── */
  .billing-plans {
    display: flex; flex-direction: column;
    gap: 0; padding: 0 16px 8px; margin-bottom: 16px;
  }
  /* Dividers between cards instead of gap */
  .billing-plan-card + .billing-plan-card { margin-top: 10px; }

  .billing-plan-card {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto auto auto;
    grid-template-areas:
      "badge  badge"
      "name   btn"
      "price  btn"
      "desc   desc"
      "feats  feats";
    padding: 14px 16px;
    border-radius: 12px;
    gap: 2px 14px;
    align-items: start;
  }
  .billing-plan-card:hover { transform: none; }

  /* Reset badge to in-flow on mobile */
  .billing-popular-badge, .billing-current-badge,
  .billing-trial-badge, .billing-best-value-badge {
    grid-area: badge;
    position: static;
    transform: none;
    left: auto; top: auto;
    width: fit-content;
    margin-bottom: 6px;
    font-size: 10px; padding: 2px 10px;
  }

  .billing-card-name {
    grid-area: name;
    font-size: 13px; font-weight: 700;
    margin-bottom: 0;
  }
  .billing-card-price {
    grid-area: price;
    margin: 0;
  }
  .billing-card-price .amount { font-size: 22px; }
  .billing-card-price .period { font-size: 11px; }
  .billing-card-price .original { font-size: 11px; }
  .billing-card-annual-total { font-size: 10px; margin-top: 2px; }

  .billing-card-desc {
    grid-area: desc;
    margin: 8px 0 6px; font-size: 11px;
  }

  .billing-card-btn {
    grid-area: btn;
    align-self: center;
    width: auto; white-space: nowrap;
    padding: 8px 14px; font-size: 12px;
    border-width: 1.5px;
  }

  .billing-card-features {
    grid-area: feats;
    margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 4px 10px;
  }
  .billing-card-features li {
    font-size: 11px; padding: 2px 0; gap: 5px;
  }
  .billing-card-features li svg { width: 11px; height: 11px; }

}

/* ── Extra small (≤ 380px) ── */
@media (max-width: 380px) {
  .billing-card-btn { padding: 7px 10px; font-size: 11px; }
  .billing-card-price .amount { font-size: 20px; }
  .billing-usage-grid { grid-template-columns: 1fr 1fr; gap: 6px; }
}

/* ══════════════════════════════════════
   OVERVIEW CARD v2  (.bov-*)
   ══════════════════════════════════════ */
.bov-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px 24px;
  margin-bottom: 20px;
}
.bov-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.bov-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: 0;
}
.bov-icon-box {
  width: 52px; height: 52px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.bov-info { flex: 1; min-width: 0; }
.bov-name-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 4px;
}
.bov-plan-name {
  font-size: 18px; font-weight: 800;
  color: var(--text-primary);
  font-family: 'Plus Jakarta Sans', sans-serif;
  line-height: 1.2;
}
.bov-badge {
  font-size: 10px; font-weight: 700;
  padding: 3px 10px; border-radius: 99px;
  letter-spacing: .04em;
}
.bov-badge--active    { background: #25D366; color: #006d2f; }
.bov-badge--trial     { background: #dbeafe; color: #1e40af; }
.bov-badge--suspended { background: #fee2e2; color: #991b1b; }
.bov-badge--cancelled { background: #f3f4f6; color: #6b7280; }
.bov-desc {
  font-size: 12.5px; color: var(--text-muted); line-height: 1.5;
}
.bov-right { flex-shrink: 0; }
.bov-dates {
  display: flex; align-items: center; gap: 0;
}
.bov-date-block {
  padding: 4px 16px; text-align: right;
}
.bov-date-block:first-child { padding-left: 0; text-align: left; }
.bov-date-sep {
  width: 1px; height: 38px;
  background: var(--border); flex-shrink: 0;
}
.bov-date-label {
  font-size: 9px; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; color: var(--text-muted); margin-bottom: 4px;
}
.bov-date-val {
  font-size: 14px; font-weight: 700; color: var(--text-primary);
}
.bov-footer {
  margin-top: 14px; padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end;
}
.bov-cancel-btn {
  padding: 7px 16px; border-radius: 8px;
  border: 1.5px solid #fca5a5;
  background: transparent; color: #dc2626;
  font-size: 12px; font-weight: 600; cursor: pointer;
  transition: background .15s;
}
.bov-cancel-btn:hover { background: #fef2f2; }

@media (max-width: 680px) {
  .bov-top { flex-direction: column; align-items: flex-start; }
  .bov-dates { flex-wrap: wrap; gap: 8px; }
  .bov-date-sep { display: none; }
  .bov-date-block { padding: 0; text-align: left; }
}

[data-theme="dark"] .bov-card { background: var(--card); border-color: var(--border); }
[data-theme="dark"] .bov-badge--active { background: rgba(37,211,102,.2); color: #25D366; }
[data-theme="dark"] .bov-cancel-btn { border-color: rgba(252,165,165,.4); color: #f87171; }
[data-theme="dark"] .bov-cancel-btn:hover { background: rgba(239,68,68,.08); }

/* ══════════════════════════════════════
   USAGE GRID v2  (.bui-*)
   ══════════════════════════════════════ */
.bui-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 6px;
}
.bui-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
}
.bui-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
.bui-label {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  line-height: 1.4;
  padding-top: 3px;
}
.bui-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  font-family: 'Plus Jakarta Sans', sans-serif;
  line-height: 1;
}
.bui-track {
  height: 5px;
  background: var(--bg);
  border-radius: 99px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.bui-fill {
  height: 100%;
  border-radius: 99px;
  transition: width .4s;
}
.bui-hint {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 5px;
  text-align: right;
  font-weight: 600;
}

@media (max-width: 900px) {
  .bui-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .bui-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .bui-value { font-size: 22px; }
}

[data-theme="dark"] .bui-card { background: var(--card); border-color: var(--border); }
[data-theme="dark"] .bui-track { background: var(--surface-container); border-color: var(--border); }

/* ── Plan Insights ── */
.billing-insights-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 4px;
}
.billing-insight-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
}
.billing-insight-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.billing-insight-body { flex: 1; min-width: 0; }
.billing-insight-title {
  font-size: 13px; font-weight: 600; color: var(--text-primary);
  margin-bottom: 2px;
}
.billing-insight-desc {
  font-size: 12px; color: var(--text-muted); line-height: 1.5;
}
.billing-insight-btn {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: 7px;
  border: 1.5px solid;
  background: transparent;
  font-size: 12px; font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity .15s;
}
.billing-insight-btn:hover { opacity: .75; }

/* ── Support & Security (sidebar) ── */
.billing-support-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
}
.billing-support-icon { font-size: 22px; }
.billing-support-info { flex: 1; min-width: 0; }
.billing-support-title { font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: 2px; }
.billing-support-desc  { font-size: 11.5px; color: var(--text-muted); line-height: 1.4; }
.billing-support-actions { display: flex; gap: 8px; }
.billing-support-btn {
  flex: 1;
  padding: 7px 10px;
  border-radius: 7px;
  font-size: 12px; font-weight: 600;
  text-decoration: none;
  text-align: center;
  white-space: nowrap;
  transition: opacity .15s;
}
.billing-support-btn:hover { opacity: .8; }
.billing-support-btn.email    { background: #f3f4f6; color: #374151; border: 1px solid #e5e7eb; }
.billing-support-btn.whatsapp { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.billing-refund-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
}
.billing-refund-icon { font-size: 20px; flex-shrink: 0; margin-top: 1px; }

@media (max-width: 900px) {
  .billing-body { grid-template-columns: 1fr; }
  .billing-sidebar { position: static; }
}

/* ══════════════════════════════════════════════════════════
   MOBILE RESPONSIVE — BILLING (enhanced)
══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .billing-layout { padding: 0; }
  .billing-body { flex-direction: column; padding: 12px; gap: 14px; }
  .billing-main, .billing-sidebar { width: 100%; }
  .billing-plans { grid-template-columns: 1fr !important; gap: 12px; }
  .billing-plan-card { padding: 18px; }
  .billing-toggle-wrap { justify-content: center; margin-bottom: 16px; }
  .billing-overview-card { padding: 16px; }
  .billing-usage-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .billing-txn-row { flex-wrap: wrap; gap: 6px; }
  .billing-insight-cards { grid-template-columns: 1fr 1fr; gap: 10px; }
}

@media (max-width: 480px) {
  .billing-usage-grid, .billing-insight-cards { grid-template-columns: 1fr; }
  .billing-plan-card { padding: 14px; }
}

/* ══════════════════════════════════════
   SERVICE TYPE TABS (WhatsApp / Voice / Combo)
   ══════════════════════════════════════ */
.billing-service-tabs {
  display: flex; gap: 10px; margin-bottom: 4px; flex-wrap: wrap;
}
.billing-service-tab {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 22px; border-radius: 12px;
  border: 2px solid var(--border);
  background: var(--card); color: var(--text-secondary);
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: border-color .15s, background .15s, color .15s, transform .1s;
  position: relative;
}
.billing-service-tab .bst-icon { font-size: 16px; }
.billing-service-tab:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.billing-service-tab.active {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent);
}
.bst-badge {
  font-size: 9px; font-weight: 700; text-transform: uppercase;
  background: var(--accent); color: #fff;
  padding: 2px 7px; border-radius: 99px; letter-spacing: .3px;
  margin-left: 2px;
}
.billing-service-note {
  font-size: 12px; color: var(--text-muted); line-height: 1.5;
  margin: 8px 0 16px; padding: 10px 14px;
  background: var(--bg); border-radius: 9px;
  border-left: 3px solid var(--accent);
}

/* Disclaimer */
.billing-disclaimer {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 11.5px; color: var(--text-muted); line-height: 1.5;
  padding: 10px 14px; border-radius: 9px;
  background: #fef9ec; border: 1px solid #fde68a;
  margin-bottom: 16px;
}
:root[data-theme="dark"] .billing-disclaimer { background: #2d2a1a; border-color: #78640044; }
@media (prefers-color-scheme: dark) { .billing-disclaimer { background: #2d2a1a; border-color: #78640044; } }
.billing-disclaimer svg { flex-shrink: 0; margin-top: 1px; color: #b45309; }

/* ── Dark mode ── */
[data-theme="dark"] .billing-overview-card { background: var(--card); border-color: var(--border); }
[data-theme="dark"] .billing-overview-plan { color: var(--text-primary); }
[data-theme="dark"] .billing-overview-label { color: var(--text-muted); }
[data-theme="dark"] .billing-overview-value { color: var(--text-primary); }
[data-theme="dark"] .billing-usage-item { background: var(--card); border-color: var(--border); }
[data-theme="dark"] .billing-usage-label { color: var(--text-muted); }
[data-theme="dark"] .billing-usage-val   { color: var(--text-primary); }
[data-theme="dark"] .billing-usage-bar   { background: var(--surface-container); }
[data-theme="dark"] .billing-txn-card { background: var(--card); border-color: var(--border); }
[data-theme="dark"] .billing-txn-table th { background: var(--bg-secondary); color: var(--text-muted); border-color: var(--border); }
[data-theme="dark"] .billing-txn-table td { border-color: var(--border); color: var(--text-primary); }
[data-theme="dark"] .billing-txn-table tr:hover td { background: var(--surface-container); }
[data-theme="dark"] .billing-plan-card { background: var(--card); border-color: var(--border); }
[data-theme="dark"] .billing-plan-card.trial-card { background: rgba(37,211,102,.08); border-color: rgba(37,211,102,.3); }
[data-theme="dark"] .billing-plan-card.pro-card { background: #006d2f; border-color: #006d2f; }
[data-theme="dark"] .billing-card-name { color: var(--text-primary); }
[data-theme="dark"] .billing-card-price .amount { color: var(--text-primary); }
[data-theme="dark"] .billing-card-price .period  { color: var(--text-muted); }
[data-theme="dark"] .billing-card-features li { color: var(--text-secondary); }
[data-theme="dark"] .billing-card-features li.dim { color: var(--text-muted); }
[data-theme="dark"] .billing-card-annual-total  { color: var(--text-muted); }
[data-theme="dark"] .billing-card-btn.outline { background: var(--surface-container); color: var(--text-secondary); border-color: var(--border); }
[data-theme="dark"] .billing-card-btn.outline:hover { background: var(--surface-container-high); }
[data-theme="dark"] .billing-card-btn.current-btn { background: var(--surface-container); border-color: var(--border); color: var(--text-muted); }
[data-theme="dark"] .billing-insight-card { background: var(--card); border-color: var(--border); }
[data-theme="dark"] .billing-support-card { background: var(--card); border-color: var(--border); }
[data-theme="dark"] .billing-refund-card  { background: var(--card); border-color: var(--border); }
[data-theme="dark"] .billing-service-tab  { background: var(--card); border-color: var(--border); }
[data-theme="dark"] .billing-section-title { color: var(--text-muted); }

/* sa-badge colors for new plan types */
.sa-badge-whatsapp { background: #dcfce7; color: #166534; }
.sa-badge-voice    { background: #dbeafe; color: #1e40af; }
.sa-badge-combo    { background: #ede9fe; color: #5b21b6; }

@media (max-width: 600px) {
  .billing-service-tabs { gap: 7px; }
  .billing-service-tab  { padding: 8px 14px; font-size: 13px; }
}

/* ══════════════════════════════════════════════════════════
   BILLING — Redesign additions
══════════════════════════════════════════════════════════ */

/* Overview dates row */
.billing-overview-dates {
  display: flex;
  align-items: center;
  gap: 0;
}
.billing-date-block {
  text-align: right;
  padding: 4px 16px;
}
.billing-date-block:first-child { padding-left: 0; text-align: left; }
.billing-date-sep {
  width: 1px;
  height: 36px;
  background: var(--border);
  flex-shrink: 0;
}
.billing-date-label {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: .07em;
  text-transform: uppercase;
  margin-bottom: 3px;
}
.billing-date-val {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

/* Transaction empty state */
.billing-txn-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
}
.billing-txn-empty-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--bg);
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.billing-txn-empty-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.billing-txn-empty-sub {
  font-size: 12px;
  color: var(--text-muted);
  max-width: 320px;
  line-height: 1.6;
}

/* Level Up Your Sales card */
.billing-levelup-card {
  background: #0f172a;
  border-radius: 14px;
  padding: 20px;
  color: #fff;
}
.billing-levelup-title {
  font-size: 17px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 8px;
}
.billing-levelup-desc {
  font-size: 12px;
  color: rgba(255,255,255,.65);
  line-height: 1.6;
  margin-bottom: 14px;
}
.billing-levelup-link {
  font-size: 12px;
  font-weight: 700;
  color: #25D366;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.billing-levelup-link:hover { text-decoration: underline; }

[data-theme="dark"] .billing-txn-empty-icon { background: var(--surface-container); }

/* ══════════════════════════════════════
   SUPPORT CARD v2  (.bs2-*)
   ══════════════════════════════════════ */
.bs2-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.bs2-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.bs2-icon-box {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: rgba(37,211,102,.12);
  color: #006d2f;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.bs2-title {
  font-size: 13px; font-weight: 700;
  color: var(--text-primary); margin-bottom: 2px;
}
.bs2-sub {
  font-size: 11.5px; color: var(--text-muted); line-height: 1.4;
}
.bs2-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.bs2-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 12.5px; font-weight: 600;
  text-decoration: none;
  transition: opacity .15s, transform .1s;
  cursor: pointer;
}
.bs2-btn:hover { opacity: .82; transform: translateY(-1px); }
.bs2-btn-email {
  background: var(--bg);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.bs2-btn-wa {
  background: rgba(37,211,102,.12);
  color: #006d2f;
  border: 1px solid rgba(37,211,102,.3);
}
.bs2-secure-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.bs2-secure-icon {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: rgba(37,211,102,.1);
  color: #006d2f;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* Level Up v2 */
.bs2-levelup-card {
  background: #0b1c30;
  border-radius: 16px;
  padding: 20px;
  margin-top: 10px;
  position: relative;
  overflow: hidden;
}
.bs2-levelup-dots {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,.08) 1px, transparent 1px);
  background-size: 18px 18px;
  pointer-events: none;
}
.bs2-levelup-body { position: relative; z-index: 1; }
.bs2-levelup-title {
  font-size: 16px; font-weight: 800;
  color: #fff;
  font-family: 'Plus Jakarta Sans', sans-serif;
  margin-bottom: 8px;
}
.bs2-levelup-desc {
  font-size: 12px;
  color: rgba(255,255,255,.6);
  line-height: 1.6;
  margin-bottom: 14px;
}
.bs2-levelup-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px; font-weight: 700;
  color: #25D366;
  text-decoration: none;
  background: rgba(37,211,102,.15);
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid rgba(37,211,102,.3);
  transition: background .15s;
}
.bs2-levelup-link:hover { background: rgba(37,211,102,.22); text-decoration: none; }

[data-theme="dark"] .bs2-card          { background: var(--card); border-color: var(--border); }
[data-theme="dark"] .bs2-btn-email     { background: var(--surface-container); color: var(--text-primary); border-color: var(--border); }
[data-theme="dark"] .bs2-secure-card   { background: var(--card); border-color: var(--border); }
[data-theme="dark"] .bs2-icon-box      { background: rgba(37,211,102,.15); color: #25D366; }
[data-theme="dark"] .bs2-secure-icon   { background: rgba(37,211,102,.12); color: #25D366; }
[data-theme="dark"] .bs2-btn-wa        { background: rgba(37,211,102,.15); color: #25D366; border-color: rgba(37,211,102,.25); }

/* ══════════════════════════════════════════════════════════
   BILLING REDESIGN — Visual polish layer
══════════════════════════════════════════════════════════ */

/* Plan cards: smoother hover + gradient shadow */
.billing-plan-card {
  transition: border-color .2s, transform .2s cubic-bezier(.4,0,.2,1), box-shadow .2s;
}
.billing-plan-card:hover {
  box-shadow: 0 8px 28px rgba(37,211,102,.13);
}

/* Pro card: richer gradient green instead of flat dark green */
.billing-plan-card.pro-card {
  background: linear-gradient(145deg, #005f28 0%, #007a34 60%, #00943e 100%);
  border-color: #25D366;
  box-shadow: 0 16px 40px rgba(0,109,47,.38), 0 0 0 1px rgba(37,211,102,.2);
}
.billing-plan-card.pro-card:hover {
  border-color: #25D366;
  box-shadow: 0 20px 48px rgba(0,109,47,.48), 0 0 0 1px rgba(37,211,102,.3);
}

/* Trial card: slight warmth */
.billing-plan-card.trial-card {
  background: linear-gradient(145deg, #f0fdf4 0%, #ecfdf5 100%);
}

/* Card price: tabular nums for crisp alignment */
.billing-card-price .amount {
  font-variant-numeric: tabular-nums;
  letter-spacing: -.5px;
}

/* CTA button: default green fill + hover scale */
.billing-card-btn {
  background: #25D366;
  color: #fff;
  border-color: #25D366;
  transition: background .15s, border-color .15s, transform .1s, box-shadow .15s;
}
.billing-card-btn:not(:disabled):not(.current-btn):hover {
  background: #128C7E;
  border-color: #128C7E;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(37,211,102,.25);
}
.billing-card-btn:active { transform: scale(.97); }

/* Trial button specifically */
.billing-card-btn.trial-btn {
  background: transparent;
  color: #25D366;
}
.billing-card-btn.trial-btn:hover {
  background: #f0fdf4;
  color: #128C7E;
  transform: none;
  box-shadow: none;
}

/* Service tabs: SVG icon alignment fix */
.billing-service-tab .bst-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
}
.billing-service-tab .bst-icon svg {
  width: 16px;
  height: 16px;
  display: block;
}

/* Annual badge: green pill */
.billing-save-badge {
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  color: #065f46;
  font-weight: 700;
  border: 1px solid rgba(6,95,70,.12);
}

/* Dark mode: pro card stays vivid */
[data-theme="dark"] .billing-plan-card.pro-card {
  background: linear-gradient(145deg, #004d22 0%, #006830 60%, #007838 100%);
}
[data-theme="dark"] .billing-plan-card.trial-card {
  background: rgba(37,211,102,.05);
}
[data-theme="dark"] .billing-card-btn.current-btn {
  background: var(--surface-container);
  border-color: var(--border);
  color: var(--text-muted);
}
