/* ================================================================
   BB Token Admin Panel — Main Stylesheet
   Stack: Bootstrap 5 + Custom CSS
   Fonts: Syne (display) + DM Sans (body)
   ================================================================ */

/* ── CSS Variables ──────────────────────────────────────────────── */
:root {
  --sidebar-width: 260px;
  --sidebar-collapsed: 72px;
  --topbar-height: 64px;

  --bg-base:      #f4f6fb;
  --bg-card:      #ffffff;
  --bg-sidebar:   #0f1117;
  --bg-sidebar-hover: #1a1d27;
  --bg-sidebar-active: rgba(99,102,241,0.15);

  --text-primary:  #111827;
  --text-muted:    #6b7280;
  --text-sidebar:  rgba(255,255,255,0.65);
  --text-sidebar-active: #ffffff;

  --accent:        #6366f1;  /* indigo */
  --accent-hover:  #4f46e5;
  --accent-green:  #22c55e;
  --accent-orange: #f97316;
  --accent-purple: #a855f7;
  --accent-red:    #ef4444;
  --accent-blue:   #3b82f6;

  --border:        #e5e7eb;
  --border-light:  rgba(0,0,0,0.06);

  --radius-sm: 8px;
  --radius:    12px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow:    0 4px 16px rgba(0,0,0,0.07);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.1);
}

/* ── Reset / Base ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'DM Sans', -apple-system, sans-serif;
  font-size: 14px;
  background: var(--bg-base);
  color: var(--text-primary);
  margin: 0;
  overflow-x: hidden;
}

h1,h2,h3,h4,h5,h6 { font-family: 'Syne', sans-serif; }

a { text-decoration: none; }

code { font-size: 12px; background: var(--bg-base); padding: 2px 6px; border-radius: 4px; }

/* ── Sidebar ────────────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: transform 0.25s ease, width 0.25s ease;
  overflow: hidden;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}

.brand-logo {
  width: 38px; height: 38px;
  background: var(--accent);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.brand-logo .logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; }
.brand-logo .logo-text { color: #fff; font-family: 'Syne', sans-serif; font-weight: 800; font-size: 15px; }

.brand-name {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 16px;
  color: #fff;
  white-space: nowrap;
}

.sidebar-toggle { background: none; border: none; color: var(--text-sidebar); cursor: pointer; padding: 4px; }

/* Nav */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.25);
  padding: 12px 20px 4px;
}

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  color: var(--text-sidebar);
  border-radius: 0;
  transition: all 0.15s ease;
  position: relative;
  white-space: nowrap;
}

.sidebar-nav .nav-link i {
  font-size: 17px;
  width: 20px;
  flex-shrink: 0;
  transition: color 0.15s;
}

.sidebar-nav .nav-link span { font-size: 13.5px; font-weight: 400; }

.sidebar-nav .nav-link:hover {
  background: var(--bg-sidebar-hover);
  color: #fff;
}

.sidebar-nav .nav-link.active {
  background: var(--bg-sidebar-active);
  color: #fff;
}
.sidebar-nav .nav-link.active::before {
  content: '';
  position: absolute;
  left: 0; top: 6px; bottom: 6px;
  width: 3px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}

.badge-pill {
  margin-left: auto;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 20px;
  flex-shrink: 0;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid rgba(255,255,255,0.07);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.admin-info { display: flex; align-items: center; gap: 10px; flex: 1; overflow: hidden; }
.admin-avatar {
  width: 34px; height: 34px;
  background: var(--accent);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}
.admin-name { font-size: 13px; font-weight: 500; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-role { font-size: 11px; color: rgba(255,255,255,0.4); }

.btn-logout {
  background: none; border: none;
  color: rgba(255,255,255,0.4);
  padding: 6px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
  font-size: 18px;
}
.btn-logout:hover { color: var(--accent-red); background: rgba(239,68,68,0.1); }

/* ── Main Wrapper ───────────────────────────────────────────────── */
.main-wrapper {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  transition: margin-left 0.25s ease;
}

/* ── Top Navbar ─────────────────────────────────────────────────── */
.top-navbar {
  position: sticky;
  top: 0;
  height: var(--topbar-height);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.btn-hamburger {
  background: none; border: none;
  font-size: 22px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 8px;
  transition: all 0.15s;
  display: none;
}
.btn-hamburger:hover { background: var(--bg-base); color: var(--accent); }

.page-title {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 17px;
  flex: 1;
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.price-chip {
  background: rgba(99,102,241,0.08);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-icon-btn {
  position: relative;
  width: 36px; height: 36px;
  background: var(--bg-base);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  transition: all 0.15s;
}
.nav-icon-btn:hover { background: var(--accent); color: #fff; }
.nav-icon-btn .dot {
  position: absolute; top: 6px; right: 6px;
  width: 8px; height: 8px;
  background: var(--accent-red);
  border-radius: 50%;
  border: 2px solid #fff;
}

.admin-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-base);
  padding: 6px 12px 6px 6px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.admin-avatar-sm {
  width: 26px; height: 26px;
  background: var(--accent);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

/* ── Content Area ───────────────────────────────────────────────── */
.content-area {
  padding: 24px;
}

/* ── Panel Card ─────────────────────────────────────────────────── */
.panel-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  overflow: hidden;
}

.panel-card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  background: #fdfdfe;
}
.panel-card-header h6 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
}

.panel-card-body { padding: 20px; }

/* ── KPI Cards ──────────────────────────────────────────────────── */
.kpi-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 80px; height: 80px;
  border-radius: 50%;
  transform: translate(20px, -20px);
  opacity: 0.08;
}

.kpi-blue  { border-top: 3px solid var(--accent-blue);   } .kpi-blue::before  { background: var(--accent-blue);   }
.kpi-green { border-top: 3px solid var(--accent-green);  } .kpi-green::before { background: var(--accent-green);  }
.kpi-orange{ border-top: 3px solid var(--accent-orange); } .kpi-orange::before{ background: var(--accent-orange); }
.kpi-purple{ border-top: 3px solid var(--accent-purple); } .kpi-purple::before{ background: var(--accent-purple); }

.kpi-icon {
  font-size: 22px;
  margin-bottom: 10px;
}
.kpi-blue  .kpi-icon { color: var(--accent-blue);   }
.kpi-green .kpi-icon { color: var(--accent-green);  }
.kpi-orange.kpi-icon { color: var(--accent-orange); }
.kpi-purple .kpi-icon{ color: var(--accent-purple); }
.kpi-orange .kpi-icon{ color: var(--accent-orange); }

.kpi-value { font-family: 'Syne', sans-serif; font-size: 24px; font-weight: 700; color: var(--text-primary); line-height: 1.2; }
.kpi-label { font-size: 12px; color: var(--text-muted); font-weight: 500; margin-top: 2px; }
.kpi-sub   { font-size: 11px; color: var(--text-muted); margin-top: 6px; }

/* ── Tables ─────────────────────────────────────────────────────── */
.table { --bs-table-hover-bg: rgba(99,102,241,0.03); }
.table thead { background: #fafafa; }
.table thead th {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom-width: 1px;
  white-space: nowrap;
  padding: 12px 16px;
}
.table tbody td {
  padding: 12px 16px;
  vertical-align: middle;
  font-size: 13.5px;
  border-color: var(--border-light);
}

/* ── User Mini ──────────────────────────────────────────────────── */
.user-mini { display: flex; align-items: center; gap: 10px; }
.user-mini-avatar {
  width: 32px; height: 32px;
  background: rgba(99,102,241,0.12);
  color: var(--accent);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

/* ── Status Badges ──────────────────────────────────────────────── */
.badge-status-pill {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
}
.bg-success-soft  { background: rgba(34,197,94,0.1); }
.bg-warning-soft  { background: rgba(234,179,8,0.1); }
.bg-danger-soft   { background: rgba(239,68,68,0.1); }
.bg-info-soft     { background: rgba(59,130,246,0.1); }
.bg-secondary-soft{ background: rgba(107,114,128,0.1); }
.bg-purple-soft   { background: rgba(168,85,247,0.1); }
.text-purple      { color: var(--accent-purple); }

.badge-status {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
}
.badge-status.active   { background: rgba(34,197,94,0.1);  color: #16a34a; }
.badge-status.inactive { background: rgba(239,68,68,0.1); color: #dc2626; }

/* ── Buttons ────────────────────────────────────────────────────── */
.btn-primary { background: var(--accent); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

.btn-xs {
  padding: 3px 8px;
  font-size: 12px;
  border-radius: 6px;
}

.btn-link-sm {
  font-size: 12px;
  color: var(--accent);
  font-weight: 500;
}
.btn-link-sm:hover { text-decoration: underline; }

.btn-pass-toggle {
  position: absolute;
  right: 12px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none;
  color: var(--text-muted);
  cursor: pointer;
  z-index: 5;
  font-size: 16px;
}

/* ── Forms ──────────────────────────────────────────────────────── */
.form-control, .form-select {
  border-radius: var(--radius-sm);
  border-color: var(--border);
  font-size: 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-control:focus, .form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}
.form-label { font-size: 13px; font-weight: 500; color: var(--text-primary); margin-bottom: 6px; }
.input-group-text { border-color: var(--border); background: var(--bg-base); font-size: 14px; }

.form-floating label { font-size: 14px; color: var(--text-muted); }
.form-floating .form-control { border-radius: var(--radius-sm); }

.settings-section-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
  margin-top: 4px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-light);
}

/* ── Profile Components ─────────────────────────────────────────── */
.profile-avatar-lg {
  width: 72px; height: 72px;
  background: rgba(99,102,241,0.12);
  color: var(--accent);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 28px;
}

.balance-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.balance-item { text-align: center; padding: 12px; background: var(--bg-base); border-radius: var(--radius-sm); }
.balance-value { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 18px; }
.balance-label { font-size: 11px; color: var(--text-muted); font-weight: 500; margin-top: 2px; }

.stat-mini-val { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 16px; }
.stat-mini-lbl { font-size: 10px; color: var(--text-muted); font-weight: 500; }

.upi-row {
  display: flex;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 14px;
}
.upi-row:last-child { border-bottom: none; }

/* ── Auth Page ──────────────────────────────────────────────────── */
.auth-body {
  background: var(--bg-base);
  min-height: 100vh;
  display: flex;
  align-items: stretch;
}

.auth-wrapper {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

.auth-left {
  flex: 1;
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px;
  position: relative;
  overflow: hidden;
}

.auth-brand { text-align: center; position: relative; z-index: 2; }
.auth-logo-circle {
  width: 72px; height: 72px;
  background: var(--accent);
  border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 28px;
  color: #fff;
  margin: 0 auto 20px;
  box-shadow: 0 8px 30px rgba(99,102,241,0.4);
}
.auth-brand h1 { font-family: 'Syne', sans-serif; font-weight: 800; font-size: 36px; color: #fff; margin-bottom: 8px; }
.auth-brand p  { color: rgba(255,255,255,0.5); font-size: 15px; }

.auth-decoration { position: absolute; inset: 0; pointer-events: none; }
.deco-circle {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.05);
}
.c1 { width: 400px; height: 400px; bottom: -150px; left: -100px; }
.c2 { width: 250px; height: 250px; top: -80px; right: -60px; }
.c3 { width: 150px; height: 150px; bottom: 60px; right: 40px; background: rgba(99,102,241,0.05); }

.auth-right {
  width: 460px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: var(--bg-base);
}

.auth-card {
  width: 100%;
  max-width: 380px;
}

.auth-card-header { margin-bottom: 28px; }
.auth-card-header h2 { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 26px; margin-bottom: 4px; }
.auth-card-header p  { color: var(--text-muted); margin: 0; }

.btn-login {
  height: 46px;
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  letter-spacing: 0.02em;
}

/* ── Misc ───────────────────────────────────────────────────────── */
.fw-500  { font-weight: 500; }
.fw-700  { font-weight: 700; }
.text-xs { font-size: 12px; }
.text-sm { font-size: 13px; }
.font-mono { font-family: 'Courier New', monospace; }
.text-purple { color: var(--accent-purple) !important; }

.logo-placeholder {
  width: 80px; height: 80px;
  background: rgba(99,102,241,0.08);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 28px;
  color: var(--accent);
  margin: 0 auto;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
}

/* ── Sidebar Overlay (mobile) ───────────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 999;
  backdrop-filter: blur(2px);
}

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(-100%);
    z-index: 1001;
  }
  .sidebar.show {
    transform: translateX(0);
  }
  .sidebar-overlay.show { display: block; }
  .main-wrapper { margin-left: 0; }
  .btn-hamburger { display: flex; align-items: center; justify-content: center; }
  .auth-left { display: none; }
  .auth-right { width: 100%; padding: 24px; }
}

@media (max-width: 575.98px) {
  .content-area { padding: 16px; }
  .top-navbar { padding: 0 16px; }
  .price-chip { display: none; }
  .admin-chip { display: none; }
}

/* ── Alert override ─────────────────────────────────────────────── */
.alert {
  border-radius: var(--radius-sm);
  border: none;
  font-size: 14px;
}
.alert-success { background: rgba(34,197,94,0.1);  color: #166534; }
.alert-danger  { background: rgba(239,68,68,0.1);  color: #991b1b; }
.alert-info    { background: rgba(59,130,246,0.1); color: #1e40af; }

/* ── Scrollbar ──────────────────────────────────────────────────── */
::-webkit-scrollbar        { width: 5px; height: 5px; }
::-webkit-scrollbar-track  { background: transparent; }
::-webkit-scrollbar-thumb  { background: var(--border); border-radius: 10px; }
