/* ── Variables ───────────────────────────────────────────────────────────── */
:root {
  --orange:    #f97316;
  --dark:      #0f172a;
  --darker:    #080f1f;
  --nav-h:     52px;
  --hnav-h:    46px;
}

/* ── Base ────────────────────────────────────────────────────────────────── */
body { background: var(--dark); color: #e2e8f0; font-family: 'Segoe UI', sans-serif; margin: 0; }
.bg-darker   { background: var(--darker) !important; }
.text-orange { color: var(--orange) !important; }
.bg-orange   { background: var(--orange) !important; }
.border-orange { border-color: var(--orange) !important; }
.btn-orange  { background: var(--orange); color: #fff; border: none; }
.btn-orange:hover { background: #ea6c0a; color: #fff; }

/* ── Cards ───────────────────────────────────────────────────────────────── */
.card { background: #1e293b; border: 1px solid #334155; border-radius: 12px; }
.card-header { background: #0f172a; border-bottom: 1px solid #334155; font-weight: 600; }

/* ── Tables ──────────────────────────────────────────────────────────────── */
.table-dark { --bs-table-bg: #1e293b; }
.table > :not(caption) > * > * { border-color: #334155; color: #cbd5e1; }
.table > thead > tr > th { color: #94a3b8; font-size: .8rem; text-transform: uppercase; }

/* ── Badges ──────────────────────────────────────────────────────────────── */
.badge-credit  { background: #16a34a22; color: #4ade80; border: 1px solid #16a34a44; }
.badge-debit   { background: #dc262622; color: #f87171; border: 1px solid #dc262644; }
.badge-success { background: #16a34a22; color: #4ade80; border: 1px solid #16a34a44; }
.badge-failed  { background: #dc262622; color: #f87171; border: 1px solid #dc262644; }
.badge-pending { background: #d9770622; color: #fb923c; border: 1px solid #d9770644; }

/* ── Forms ───────────────────────────────────────────────────────────────── */
.form-control, .form-select {
  background: #0f172a; border: 1px solid #334155;
  color: #e2e8f0; border-radius: 8px;
}
.form-control:focus, .form-select:focus {
  background: #0f172a; border-color: var(--orange);
  color: #e2e8f0; box-shadow: 0 0 0 3px #f9731622;
}
.form-control::placeholder { color: #475569; }
input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; }

/* ── Stat cards ──────────────────────────────────────────────────────────── */
.stat-card { border-left: 4px solid var(--orange); }
.stat-card .stat-value { font-size: 1.8rem; font-weight: 700; color: var(--orange); }
.stat-card .stat-label { font-size: .8rem; color: #64748b; text-transform: uppercase; letter-spacing: .05em; }

/* ════════════════════════════════════════════════════════════════════════════
   TOP NAVBAR
══════════════════════════════════════════════════════════════════════════════ */
.top-navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: var(--darker);
  border-bottom: 2px solid var(--orange);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  z-index: 1030;
}

.nav-brand {
  display: flex; align-items: center; gap: .6rem;
  text-decoration: none;
}
.brand-logo {
  width: 34px; height: 34px;
  background: var(--orange);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: .9rem; color: #fff;
  flex-shrink: 0;
}
.brand-name { font-weight: 700; font-size: .92rem; color: #e2e8f0; }

.nav-right { display: flex; align-items: center; gap: .5rem; }

/* Wallet chip in navbar */
.wallet-chip {
  display: flex; align-items: center; gap: .35rem;
  background: #16a34a18;
  color: #4ade80;
  border: 1px solid #16a34a44;
  border-radius: 20px;
  padding: .25rem .7rem;
  font-size: .78rem; font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s;
}
.wallet-chip:hover { background: #16a34a30; color: #4ade80; }

.user-btn {
  display: flex; align-items: center; gap: .35rem;
  background: #1e293b;
  border: 1px solid #334155;
  color: #e2e8f0;
  border-radius: 20px;
  padding: .25rem .65rem;
  font-size: .8rem;
  cursor: pointer;
  transition: border-color .15s;
}
.user-btn:hover { border-color: var(--orange); }
.user-btn::after { margin-left: 2px; } /* Bootstrap dropdown caret */

/* ════════════════════════════════════════════════════════════════════════════
   HORIZONTAL NAV BAR  (Dashboard · Services · API Keys · Recharge · History · Logout)
══════════════════════════════════════════════════════════════════════════════ */
.h-navbar {
  position: fixed;
  top: var(--nav-h);
  left: 0; right: 0;
  height: var(--hnav-h);
  background: #0f172a;
  border-bottom: 1px solid #1e293b;
  display: flex;
  align-items: center;
  overflow-x: auto;
  overflow-y: hidden;
  z-index: 1020;
  scrollbar-width: none;       /* Firefox */
  -ms-overflow-style: none;    /* IE */
  padding: 0 .25rem;
  gap: 2px;
}
.h-navbar::-webkit-scrollbar { display: none; }  /* Chrome/Safari */

.h-nav-link {
  display: flex;
  align-items: center;
  gap: .35rem;
  padding: 0 .75rem;
  height: 100%;
  white-space: nowrap;
  font-size: .8rem;
  font-weight: 500;
  color: #64748b;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
  flex-shrink: 0;
}
.h-nav-link i { font-size: .9rem; }
.h-nav-link:hover { color: #e2e8f0; }
.h-nav-link.active {
  color: var(--orange);
  border-bottom-color: var(--orange);
  font-weight: 600;
}
.h-nav-link.logout-link { color: #f87171; margin-left: auto; }
.h-nav-link.logout-link:hover { color: #fca5a5; }

/* ════════════════════════════════════════════════════════════════════════════
   MAIN CONTENT
══════════════════════════════════════════════════════════════════════════════ */
.page-main {
  margin-top: calc(var(--nav-h) + var(--hnav-h));
  padding: 1.25rem 1.25rem 2.5rem;
  min-height: calc(100vh - var(--nav-h) - var(--hnav-h));
}

/* ── Page title bar ──────────────────────────────────────────────────────── */
.page-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.1rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid #1e293b;
}

/* ── Back button ─────────────────────────────────────────────────────────── */
.back-btn {
  color: var(--orange);
  font-size: 1.4rem;
  line-height: 1;
  text-decoration: none;
  display: flex;
  align-items: center;
  transition: transform .15s;
}
.back-btn:hover { color: #ea6c0a; transform: translateX(-2px); }

/* ── Small wallet chip (title bar, mobile) ───────────────────────────────── */
.wallet-chip-sm {
  font-size: .75rem; font-weight: 700;
  color: #4ade80;
  background: #16a34a15;
  border: 1px solid #16a34a33;
  border-radius: 20px;
  padding: .2rem .6rem;
  text-decoration: none;
  white-space: nowrap;
}

/* ── Footer ──────────────────────────────────────────────────────────────── */
.page-footer {
  text-align: center;
  padding: .75rem 1rem;
  border-top: 1px solid #1e293b;
  font-size: .75rem;
  color: #475569;
}

/* ════════════════════════════════════════════════════════════════════════════
   SERVICE CARDS
══════════════════════════════════════════════════════════════════════════════ */
.service-card {
  cursor: pointer;
  transition: transform .15s, border-color .15s;
}
.service-card:hover { transform: translateY(-3px); border-color: var(--orange) !important; }
.service-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
}

/* ════════════════════════════════════════════════════════════════════════════
   SERVICES PAGE (white cards)
══════════════════════════════════════════════════════════════════════════════ */
.services-wrap { background: #f8fafc; border-radius: 16px; padding: 1.25rem; }
.cat-heading {
  color: #475569 !important; font-size: .72rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  border-bottom: 2px solid #f1f5f9 !important;
  padding-bottom: .5rem; margin-bottom: 1rem !important;
}
.services-wrap .service-card {
  background: #ffffff !important;
  border: 1.5px solid #e2e8f0 !important;
  border-radius: 14px !important;
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
  transition: transform .15s, border-color .15s, box-shadow .15s;
}
.services-wrap .service-card:hover {
  border-color: #f97316 !important;
  box-shadow: 0 6px 20px rgba(249,115,22,.13);
  transform: translateY(-3px);
}
.services-wrap .service-icon { background: #fff7ed !important; border: 1px solid #fed7aa; }
.services-wrap .service-card .fw-semibold { color: #1e293b !important; }
.services-wrap .service-card .text-muted  { color: #64748b !important; }
.services-wrap .service-card .border-top  { border-color: #f1f5f9 !important; }
.services-wrap #service-search {
  background: #fff !important; border: 1.5px solid #e2e8f0 !important;
  color: #1e293b !important; border-radius: 10px;
}
.services-wrap #service-search:focus {
  border-color: #f97316 !important; box-shadow: 0 0 0 3px #f9731622 !important;
}
.services-wrap h5.fw-bold { color: #0f172a; }
.services-wrap .text-muted { color: #64748b; }
.services-wrap .text-success { color: #16a34a !important; }
@media (max-width: 480px) {
  .services-wrap .col-6 { flex: 0 0 100%; max-width: 100%; }
}

/* ════════════════════════════════════════════════════════════════════════════
   LOGIN PAGE
══════════════════════════════════════════════════════════════════════════════ */
.login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #080f1f 0%, #1e293b 50%, #2d1a0e 100%);
}
.login-card {
  background: #1e293b; border: 1px solid #334155;
  border-radius: 16px; padding: 2.5rem;
  max-width: 420px; width: 100%;
}
.login-logo {
  width: 60px; height: 60px; background: var(--orange); border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; font-weight: 900; color: #fff;
  margin: 0 auto 1.2rem;
}

/* ── Nav tabs ────────────────────────────────────────────────────────────── */
.nav-tabs { border-bottom: 1px solid #334155; }
.nav-tabs .nav-link { color: #64748b; border: none; padding: .6rem 1.2rem; }
.nav-tabs .nav-link.active { color: var(--orange); border-bottom: 2px solid var(--orange); background: transparent; }

/* ════════════════════════════════════════════════════════════════════════════
   ADMIN SIDEBAR (unchanged)
══════════════════════════════════════════════════════════════════════════════ */
.sidebar .nav-link { padding: .5rem .75rem; font-size: .9rem; transition: background .2s; }
.sidebar .nav-link:hover:not(.active) { background: #1e293b; }

/* ── Mobile tweaks ───────────────────────────────────────────────────────── */
@media (max-width: 576px) {
  .page-main { padding: 1rem .85rem 2rem; }
  .brand-name { font-size: .82rem; }
  .h-nav-link { padding: 0 .6rem; font-size: .75rem; }
}
