/* ============================================================
   dashboard-wallet.css — Minha Carteira / Credits Wallet
   OLED Monochromatic  |  True black  |  Violet accent
   ============================================================ */

@keyframes pulse-balance { 0%,100% { opacity: 1; } 50% { opacity: .7; } }
@keyframes slide-up { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }

/* ── Page Layout ──────────────────────────────────────────── */
.wl-page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 24px 60px;
}

/* ── Balance Hero ─────────────────────────────────────────── */
.wl-hero {
  position: relative;
  background: var(--bg-secondary, #111);
  border: 1px solid var(--border-color, #222);
  border-radius: var(--radius-lg, 16px);
  overflow: hidden;
  margin-bottom: 28px;
}

.wl-hero-bg {
  height: 120px;
  background: linear-gradient(135deg, #1a0a2e 0%, #0d0d1a 40%, #0a0a14 100%);
  position: relative;
}
.wl-hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 600px 200px at 30% 80%, rgba(139,92,246,.15), transparent),
    radial-gradient(ellipse 400px 150px at 70% 60%, rgba(34,197,94,.08), transparent);
}

.wl-hero-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 32px;
  flex-wrap: wrap;
}

.wl-balance-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.wl-balance-label {
  font-size: 13px;
  color: var(--text-tertiary, #666);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

.wl-balance-value {
  font-size: 42px;
  font-weight: 800;
  color: var(--text-primary, #fff);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.wl-balance-value .wl-currency {
  font-size: 20px;
  color: rgba(139,92,246,.8);
  font-weight: 600;
  margin-right: 4px;
}

.wl-balance-estimate {
  font-size: 13px;
  color: var(--text-secondary, #999);
  margin-top: 4px;
}

.wl-balance-estimate .wl-days {
  color: #22c55e;
  font-weight: 700;
}

.wl-balance-estimate .wl-days.warning { color: #f59e0b; }
.wl-balance-estimate .wl-days.danger { color: #ef4444; }

.wl-hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ── Stats Row ────────────────────────────────────────────── */
.wl-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}

.wl-stat-card {
  background: var(--bg-secondary, #111);
  border: 1px solid var(--border-color, #222);
  border-radius: var(--radius-md, 12px);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.wl-stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.wl-stat-icon.violet { background: rgba(139,92,246,.12); color: #8b5cf6; }
.wl-stat-icon.green { background: rgba(34,197,94,.12); color: #22c55e; }
.wl-stat-icon.amber { background: rgba(245,158,11,.12); color: #f59e0b; }
.wl-stat-icon.red { background: rgba(239,68,68,.12); color: #ef4444; }

.wl-stat-info { display: flex; flex-direction: column; gap: 2px; }
.wl-stat-value { font-size: 20px; font-weight: 700; color: var(--text-primary, #fff); font-variant-numeric: tabular-nums; }
.wl-stat-label { font-size: 12px; color: var(--text-tertiary, #666); text-transform: uppercase; letter-spacing: .5px; }

/* ── Sections ─────────────────────────────────────────────── */
.wl-section {
  background: var(--bg-secondary, #111);
  border: 1px solid var(--border-color, #222);
  border-radius: var(--radius-lg, 16px);
  margin-bottom: 24px;
  overflow: hidden;
}

.wl-section-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color, #222);
}

.wl-section-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.wl-section-icon.violet { background: rgba(139,92,246,.12); color: #8b5cf6; }
.wl-section-icon.green { background: rgba(34,197,94,.12); color: #22c55e; }
.wl-section-icon.amber { background: rgba(245,158,11,.12); color: #f59e0b; }
.wl-section-icon.red { background: rgba(239,68,68,.12); color: #ef4444; }

.wl-section-title { font-size: 16px; font-weight: 700; color: var(--text-primary, #fff); }
.wl-section-desc { font-size: 13px; color: var(--text-tertiary, #666); margin-top: 2px; }
.wl-section-body { padding: 24px; }

/* ── Bottom Grid (Transactions + Auto-Recharge) ───────────── */
.wl-bottom-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  align-items: start;
}

.wl-bottom-main { min-width: 0; }
.wl-bottom-aside { position: sticky; top: 80px; }

/* ── Transactions Table ───────────────────────────────────── */
.wl-tx-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.wl-tx-filter {
  background: var(--bg-tertiary, #0a0a0a);
  border: 1px solid var(--border-color, #222);
  border-radius: 8px;
  padding: 6px 14px;
  color: var(--text-secondary, #999);
  font-size: 13px;
  cursor: pointer;
  transition: all .15s;
}

.wl-tx-filter:hover { border-color: rgba(139,92,246,.3); color: var(--text-primary); }
.wl-tx-filter.active { background: rgba(139,92,246,.12); border-color: #8b5cf6; color: #8b5cf6; font-weight: 600; }

.wl-tx-list {
  display: flex;
  flex-direction: column;
}

.wl-tx-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255,255,255,.04);
}

.wl-tx-item:last-child { border-bottom: none; }

.wl-tx-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 18px;
}

.wl-tx-icon.income { background: rgba(34,197,94,.12); color: #22c55e; }
.wl-tx-icon.expense { background: rgba(239,68,68,.12); color: #ef4444; }
.wl-tx-icon.bonus { background: rgba(245,158,11,.12); color: #f59e0b; }

.wl-tx-info { flex: 1; min-width: 0; }
.wl-tx-desc { font-size: 14px; color: var(--text-primary, #fff); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wl-tx-date { font-size: 12px; color: var(--text-tertiary, #666); margin-top: 2px; }

.wl-tx-amount {
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.wl-tx-amount.positive { color: #22c55e; }
.wl-tx-amount.negative { color: #ef4444; }

.wl-tx-balance {
  font-size: 12px;
  color: var(--text-tertiary, #666);
  text-align: right;
  white-space: nowrap;
}

.wl-tx-empty {
  text-align: center;
  padding: 40px;
  color: var(--text-tertiary, #666);
}

.wl-tx-empty .material-icons {
  font-size: 48px;
  opacity: .3;
  display: block;
  margin-bottom: 12px;
}

/* ── Pagination ───────────────────────────────────────────── */
.wl-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 20px;
}

.wl-page-btn {
  background: var(--bg-tertiary, #0a0a0a);
  border: 1px solid var(--border-color, #222);
  border-radius: 6px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary, #999);
  font-size: 13px;
  cursor: pointer;
  transition: all .15s;
}

.wl-page-btn:hover { border-color: rgba(139,92,246,.3); }
.wl-page-btn.active { background: rgba(139,92,246,.12); border-color: #8b5cf6; color: #8b5cf6; }
.wl-page-btn:disabled { opacity: .3; cursor: not-allowed; }

/* ── Auto Recharge Config ─────────────────────────────────── */
.wl-auto-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 500px;
}

.wl-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.wl-form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary, #999);
}

.wl-form-input {
  background: var(--bg-tertiary, #0a0a0a);
  border: 1px solid var(--border-color, #222);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text-primary, #fff);
  font-size: 14px;
}

.wl-form-input:focus { border-color: rgba(139,92,246,.5); outline: none; }

.wl-form-select {
  background: var(--bg-tertiary, #0a0a0a);
  border: 1px solid var(--border-color, #222);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text-primary, #fff);
  font-size: 14px;
  cursor: pointer;
}

.wl-form-select:focus { border-color: rgba(139,92,246,.5); outline: none; }

.wl-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.wl-toggle {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.wl-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.wl-toggle-track {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--bg-tertiary, #1a1a1a);
  border-radius: 12px;
  border: 1px solid var(--border-color, #333);
  transition: .2s;
}

.wl-toggle-track::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  left: 2px;
  bottom: 2px;
  background: var(--text-tertiary, #666);
  transition: .2s;
}

.wl-toggle input:checked + .wl-toggle-track {
  background: rgba(139,92,246,.2);
  border-color: #8b5cf6;
}

.wl-toggle input:checked + .wl-toggle-track::before {
  transform: translateX(20px);
  background: #8b5cf6;
}

/* ── Buttons ──────────────────────────────────────────────── */
.wl-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  border: none;
}

.wl-btn .material-icons { font-size: 18px; }

.wl-btn-primary {
  background: #8b5cf6;
  color: #fff;
}
.wl-btn-primary:hover { background: #7c3aed; }
.wl-btn-primary:disabled { opacity: .5; cursor: not-allowed; }

.wl-btn-secondary {
  background: var(--bg-tertiary, #1a1a1a);
  border: 1px solid var(--border-color, #333);
  color: var(--text-primary, #fff);
}
.wl-btn-secondary:hover { border-color: rgba(139,92,246,.4); }

.wl-btn-success {
  background: #22c55e;
  color: #fff;
}
.wl-btn-success:hover { background: #16a34a; }
.wl-btn-success:disabled { opacity: .5; cursor: not-allowed; }

.wl-btn-sm {
  padding: 7px 14px;
  font-size: 13px;
}

/* ── Server Billings ──────────────────────────────────────── */
.wl-billings {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wl-billing-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-tertiary, #0a0a0a);
  border: 1px solid var(--border-color, #222);
  border-radius: 10px;
}

.wl-billing-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(139,92,246,.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8b5cf6;
  flex-shrink: 0;
}

.wl-billing-info { flex: 1; }
.wl-billing-name { font-size: 14px; font-weight: 600; color: var(--text-primary, #fff); }
.wl-billing-detail { font-size: 12px; color: var(--text-tertiary, #666); margin-top: 2px; }

.wl-billing-cost {
  font-size: 15px;
  font-weight: 700;
  color: #ef4444;
  text-align: right;
  white-space: nowrap;
}

.wl-billing-cycle {
  font-size: 11px;
  color: var(--text-tertiary, #666);
  font-weight: 400;
}

.wl-billings-empty {
  text-align: center;
  padding: 30px;
  color: var(--text-tertiary, #666);
  font-size: 14px;
}

/* ── Skeleton ─────────────────────────────────────────────── */
.wl-skeleton {
  background: linear-gradient(90deg, var(--bg-tertiary, #111) 25%, rgba(255,255,255,.04) 50%, var(--bg-tertiary, #111) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.8s infinite;
  border-radius: 6px;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
  .wl-page { padding: 16px 12px 40px; }
  .wl-hero-body { padding: 16px 20px; flex-direction: column; align-items: flex-start; }
  .wl-balance-value { font-size: 30px; }
  .wl-stats { grid-template-columns: 1fr 1fr; }
  .wl-packages { grid-template-columns: 1fr 1fr; }
  .wl-checkout-area { flex-direction: column; align-items: stretch; }
  .wl-tx-item { flex-wrap: wrap; }
  .wl-coupon-row { max-width: 100%; }
  .wl-spending-stats { grid-template-columns: 1fr; }
  .wl-bottom-grid { grid-template-columns: 1fr; }
  .wl-bottom-aside { position: static; }
}

@media (max-width: 480px) {
  .wl-balance-value { font-size: 26px; }
  .wl-stats { grid-template-columns: 1fr; }
  .wl-packages { grid-template-columns: 1fr; }
  .wl-hero-actions { width: 100%; }
  .wl-hero-actions .wl-btn { flex: 1; justify-content: center; }
}

/* ═══════════════════════════════════════════════════════════
   Fase 5: Spending Summary Styles
   ═══════════════════════════════════════════════════════════ */
.wl-spending-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.wl-spending-stat {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 14px;
  text-align: center;
}

.wl-spending-stat-label {
  display: block;
  font-size: .7rem;
  color: var(--text-muted, #666);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 6px;
}

.wl-spending-stat-value {
  display: block;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
}

.wl-spending-stat-value.negative { color: #ef4444; }
.wl-spending-stat-value.positive { color: #22c55e; }
.wl-spending-stat-value.bonus { color: #f59e0b; }

.wl-spending-chart-container {
  position: relative;
  height: 200px;
  margin-bottom: 20px;
  background: rgba(255, 255, 255, 0.01);
  border-radius: 10px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.wl-spending-servers {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wl-spending-server-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  transition: background .2s;
}

.wl-spending-server-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.wl-spending-server-info {
  display: flex;
  flex-direction: column;
  min-width: 120px;
  flex-shrink: 0;
}

.wl-spending-server-name {
  font-size: .82rem;
  font-weight: 600;
  color: #fff;
}

.wl-spending-server-txs {
  font-size: .68rem;
  color: var(--text-muted, #666);
}

.wl-spending-server-bar-container {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 3px;
  overflow: hidden;
}

.wl-spending-server-bar {
  height: 100%;
  background: linear-gradient(90deg, #ef4444, #f59e0b);
  border-radius: 3px;
  transition: width .5s cubic-bezier(.4,0,.2,1);
}

.wl-spending-server-amount {
  font-size: .82rem;
  font-weight: 600;
  color: #ef4444;
  white-space: nowrap;
  min-width: 80px;
  text-align: right;
}
