/* ═══════════════════════════════════════════════════════════
   লক্ষ্য GPA 5 — BitVista Dark Admin Design System v2
   Premium Dark | Live Charts | Mobile-First
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Hind+Siliguri:wght@400;500;600;700&family=Inter:wght@400;500;600;700;800;900&family=JetBrains+Mono:wght@400;600&display=swap');

:root {
  --primary:        #F97316;
  --primary-dark:   #EA6C0A;
  --primary-glow:   rgba(249,115,22,.3);
  --secondary:      #10B981;
  --accent:         #8B5CF6;
  --gold:           #F59E0B;
  --danger:         #EF4444;
  --info:           #3B82F6;

  --bg-base:        #080B12;
  --bg-surface:     #0F1420;
  --bg-card:        #141927;
  --bg-card2:       #1A2035;
  --bg-elevated:    #202840;
  --bg-input:       #1E2540;

  --text-white:     #FFFFFF;
  --text-primary:   #F0F4FF;
  --text-secondary: #8E9DC0;
  --text-muted:     #4A5580;

  --border:         rgba(255,255,255,.07);
  --border-active:  rgba(249,115,22,.4);

  --radius-xs:  6px;
  --radius-sm:  10px;
  --radius:     14px;
  --radius-lg:  20px;
  --radius-full:9999px;

  --font-bn:      'Hind Siliguri', sans-serif;
  --font-display: 'Inter', sans-serif;
  --font-mono:    'JetBrains Mono', monospace;

  --ease: cubic-bezier(.4,0,.2,1);
  --transition: all .22s var(--ease);
  --sidebar-w: 240px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-bn);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.65;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(249,115,22,.25); border-radius: 2px; }

/* ── LAYOUT ── */
.dash-layout {
  display: flex;
  min-height: 100vh;
  background: var(--bg-base);
}

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  transition: transform .3s var(--ease);
}
.sidebar::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.08); }

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: .95rem;
  color: var(--text-white);
  letter-spacing: -.02em;
}
.brand-logo {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #EF4444, #DC2626);
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem; font-weight: 900; color: white;
  box-shadow: 0 0 20px rgba(239,68,68,.35);
  flex-shrink: 0;
}

.sidebar-section {
  padding: 14px 16px 4px;
  font-size: .58rem; font-weight: 800;
  color: var(--text-muted);
  letter-spacing: .12em;
  text-transform: uppercase;
}

.sidebar-link {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 10px;
  margin: 1px 8px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text-secondary);
  font-size: .81rem; font-weight: 600;
  transition: var(--transition);
}
.sidebar-link:hover {
  background: rgba(255,255,255,.05);
  color: var(--text-white);
}
.sidebar-link.active {
  background: linear-gradient(135deg, rgba(249,115,22,.2), rgba(249,115,22,.06));
  color: var(--primary);
  border: 1px solid rgba(249,115,22,.2);
}
.sidebar-link i { width: 16px; text-align: center; font-size: .85rem; }

.sidebar-badge {
  margin-left: auto;
  background: var(--danger);
  color: white;
  font-size: .58rem; font-weight: 800;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  animation: pulse-badge 2s infinite;
}
@keyframes pulse-badge {
  0%,100% { box-shadow: 0 0 0 0 rgba(239,68,68,.4); }
  50%      { box-shadow: 0 0 0 4px rgba(239,68,68,0); }
}

/* ── MAIN CONTENT ── */
.dash-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* ── TOPBAR ── */
.dash-topbar {
  background: rgba(8,11,18,.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 13px 24px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
}
.dash-topbar h2 {
  font-family: var(--font-display);
  font-size: 1.05rem; font-weight: 800;
  color: var(--text-white);
}

/* ── PAGE CONTENT ── */
.page-content { padding: 22px; display: flex; flex-direction: column; gap: 22px; }

/* ── HAMBURGER ── */
.hamburger {
  display: flex; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 6px;
}
.hamburger span {
  width: 22px; height: 2px;
  background: var(--text-secondary);
  border-radius: 2px; display: block;
  transition: var(--transition);
}
.hamburger:hover span { background: var(--text-white); }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-weight: 700; font-size: .78rem;
  border: none; cursor: pointer;
  font-family: var(--font-bn);
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  box-shadow: 0 4px 16px rgba(249,115,22,.35);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 24px rgba(249,115,22,.5); }
.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
.btn-outline:hover { border-color: rgba(255,255,255,.15); color: var(--text-white); }
.btn-ghost {
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
.btn-ghost:hover { background: rgba(255,255,255,.09); color: var(--text-white); }
.btn-warning {
  background: rgba(245,158,11,.15);
  border: 1px solid rgba(245,158,11,.25);
  color: var(--gold);
}
.btn-warning:hover { background: rgba(245,158,11,.25); }
.btn-danger {
  background: rgba(239,68,68,.15);
  border: 1px solid rgba(239,68,68,.2);
  color: var(--danger);
}
.btn-danger:hover { background: rgba(239,68,68,.25); }
.btn-success {
  background: rgba(16,185,129,.15);
  border: 1px solid rgba(16,185,129,.2);
  color: var(--secondary);
}
.btn-success:hover { background: rgba(16,185,129,.25); }
.btn-sm { padding: 6px 12px; font-size: .73rem; }

/* ── STAT CARDS ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 16px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex; align-items: center; gap: 14px;
  transition: var(--transition);
  position: relative; overflow: hidden;
  cursor: default;
}
.stat-card::after {
  content: ''; position: absolute;
  bottom: 0; left: 0; right: 0; height: 2px;
  opacity: 0; transition: opacity .2s;
}
.stat-card:hover { transform: translateY(-3px); border-color: rgba(255,255,255,.12); }
.stat-card:hover::after { opacity: 1; }

.stat-icon {
  width: 46px; height: 46px; border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; flex-shrink: 0;
}
.stat-icon.blue   { background: rgba(59,130,246,.15); color: #3B82F6; }
.stat-icon.green  { background: rgba(16,185,129,.15); color: #10B981; }
.stat-icon.orange { background: rgba(249,115,22,.15); color: var(--primary); }
.stat-icon.purple { background: rgba(139,92,246,.15); color: #8B5CF6; }
.stat-icon.red    { background: rgba(239,68,68,.15);  color: var(--danger); }
.stat-icon.gold,.stat-icon.yellow { background: rgba(245,158,11,.15); color: var(--gold); }

.stat-card:has(.stat-icon.blue)::after   { background: linear-gradient(90deg, var(--info), #60A5FA); }
.stat-card:has(.stat-icon.green)::after  { background: linear-gradient(90deg, var(--secondary), #34D399); }
.stat-card:has(.stat-icon.orange)::after { background: linear-gradient(90deg, var(--primary), var(--gold)); }
.stat-card:has(.stat-icon.purple)::after { background: linear-gradient(90deg, var(--accent), #A78BFA); }
.stat-card:has(.stat-icon.red)::after    { background: linear-gradient(90deg, var(--danger), #F87171); }
.stat-card:has(.stat-icon.gold)::after,
.stat-card:has(.stat-icon.yellow)::after { background: linear-gradient(90deg, var(--gold), #FCD34D); }

.stat-value {
  font-family: var(--font-display);
  font-size: 1.55rem; font-weight: 900;
  color: var(--text-white);
  letter-spacing: -.03em; line-height: 1.1;
}
.stat-label { font-size: .7rem; color: var(--text-muted); font-weight: 600; margin-top: 3px; }

/* ── CARD ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 20px;
  border-bottom: 1px solid var(--border);
}
.card-header h3 {
  font-family: var(--font-display);
  font-size: .9rem; font-weight: 700;
  color: var(--text-white);
}
.card-body { padding: 20px; }

/* ── TABLE ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead tr { border-bottom: 1px solid var(--border); }
th {
  padding: 10px 16px;
  text-align: left;
  font-size: .65rem; font-weight: 800;
  color: var(--text-muted);
  letter-spacing: .09em; text-transform: uppercase;
  white-space: nowrap;
}
td {
  padding: 12px 16px;
  font-size: .81rem;
  border-bottom: 1px solid rgba(255,255,255,.04);
  vertical-align: middle;
  color: var(--text-secondary);
}
tr:last-child td { border-bottom: none; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: rgba(255,255,255,.025); }
td strong { color: var(--text-white); font-weight: 600; }

/* ── BADGES ── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: var(--radius-full);
  font-size: .64rem; font-weight: 800;
  white-space: nowrap;
}
.badge-approved { background: rgba(16,185,129,.12); color: #10B981; border: 1px solid rgba(16,185,129,.2); }
.badge-pending  { background: rgba(245,158,11,.12); color: #F59E0B; border: 1px solid rgba(245,158,11,.2); }
.badge-rejected { background: rgba(239,68,68,.12);  color: #EF4444; border: 1px solid rgba(239,68,68,.2); }
.badge-info     { background: rgba(59,130,246,.12); color: #3B82F6; border: 1px solid rgba(59,130,246,.2); }
.badge-purple   { background: rgba(139,92,246,.12); color: #8B5CF6; border: 1px solid rgba(139,92,246,.2); }

/* ── FORMS ── */
.form-control {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 9px 13px;
  font-family: var(--font-bn);
  font-size: .84rem;
  transition: var(--transition);
  outline: none;
}
.form-control:focus {
  border-color: rgba(249,115,22,.5);
  box-shadow: 0 0 0 3px rgba(249,115,22,.12);
}
.form-control::placeholder { color: var(--text-muted); }
.form-control option { background: var(--bg-card2); }

.form-label {
  display: block;
  font-size: .77rem; font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.form-group { margin-bottom: 16px; }

/* ── RANK BADGES ── */
.rank-badge {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: .75rem; flex-shrink: 0;
}
.rank-1     { background: linear-gradient(135deg,#F59E0B,#D97706); color: white; box-shadow: 0 4px 12px rgba(245,158,11,.4); }
.rank-2     { background: linear-gradient(135deg,#94A3B8,#64748B); color: white; }
.rank-3     { background: linear-gradient(135deg,#CD7C2F,#A85E1E); color: white; }
.rank-other { background: var(--bg-elevated); color: var(--text-muted); border: 1px solid var(--border); }

/* ── AVATAR ── */
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--gold));
  display: flex; align-items: center; justify-content: center;
  font-size: .82rem; font-weight: 800; color: white; flex-shrink: 0;
}
.avatar-sm { width: 28px; height: 28px; font-size: .68rem; }
.avatar-lg { width: 48px; height: 48px; font-size: 1.1rem; }

/* ── PROGRESS BAR ── */
.progress-bar-wrap {
  background: rgba(255,255,255,.06);
  border-radius: var(--radius-full);
  height: 6px; overflow: hidden;
}
.progress-bar-fill {
  height: 100%; border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--primary), var(--gold));
  transition: width .7s var(--ease);
}

/* ── DATE FILTER (Analytics) ── */
.date-filter {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.qr {
  padding: 5px 13px; border-radius: var(--radius-full);
  font-size: .73rem; font-weight: 700;
  border: 1px solid var(--border);
  background: transparent; cursor: pointer;
  transition: var(--transition); text-decoration: none;
  color: var(--text-muted); font-family: var(--font-bn);
}
.qr:hover { background: rgba(255,255,255,.06); color: var(--text-white); }
.qr.active { background: rgba(249,115,22,.15); color: var(--primary); border-color: rgba(249,115,22,.3); }

/* ── CHART DEFAULTS ── */
canvas { max-width: 100%; }

/* ── ALERT/NOTICE ── */
.alert {
  padding: 12px 16px; border-radius: var(--radius-sm);
  font-size: .82rem; font-weight: 600;
  display: flex; align-items: center; gap: 10px;
  border: 1px solid;
}
.alert-warning { background: rgba(245,158,11,.1); border-color: rgba(245,158,11,.25); color: var(--gold); }
.alert-success { background: rgba(16,185,129,.1); border-color: rgba(16,185,129,.25); color: var(--secondary); }
.alert-danger   { background: rgba(239,68,68,.1);  border-color: rgba(239,68,68,.25);  color: var(--danger); }
.alert-info     { background: rgba(59,130,246,.1); border-color: rgba(59,130,246,.25); color: var(--info); }

/* ── MODAL ── */
.modal-bg {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(6px);
  display: none; align-items: center; justify-content: center;
  z-index: 1000; padding: 20px;
}
.modal-bg.show { display: flex; }
.modal {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 500px;
  animation: modalIn .25s var(--ease);
  overflow: hidden;
}
@keyframes modalIn { from { opacity:0; transform:scale(.95) translateY(16px); } to { opacity:1; transform:none; } }
.modal-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-header h3 { font-family: var(--font-display); font-weight: 700; font-size: .95rem; color: var(--text-white); }
.modal-close {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 1.2rem;
  transition: var(--transition); padding: 2px;
}
.modal-close:hover { color: var(--text-white); }
.modal-body { padding: 22px; }
.modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  display: flex; gap: 10px; justify-content: flex-end;
}

/* ── OVERLAY ── */
.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.6); z-index: 90;
}
.sidebar-overlay.show { display: block; }

/* ── LIVE BADGE ── */
.live-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: var(--radius-full);
  background: rgba(16,185,129,.1); border: 1px solid rgba(16,185,129,.2);
  font-size: .64rem; font-weight: 700; color: var(--secondary);
}
.live-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--secondary);
  animation: blink 1.5s infinite;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.3} }

/* ── GRID HELPERS ── */
.grid-2   { display: grid; grid-template-columns: 2fr 1fr;   gap: 22px; }
.grid-2eq { display: grid; grid-template-columns: 1fr 1fr;   gap: 22px; }
.grid-3   { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 22px; }

/* ── MOBILE ── */
@media(max-width: 900px) {
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    transform: translateX(-100%);
    z-index: 200; box-shadow: 4px 0 40px rgba(0,0,0,.4);
  }
  .sidebar.open { transform: translateX(0); }
  .dash-content { width: 100%; }
  .grid-2   { grid-template-columns: 1fr; }
  .grid-2eq { grid-template-columns: 1fr; }
  .grid-3   { grid-template-columns: 1fr 1fr; }
  .page-content { padding: 16px; gap: 16px; }
}
@media(max-width: 560px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .grid-3     { grid-template-columns: 1fr; }
  .dash-topbar { padding: 12px 16px; }
}

/* ── CHART.JS DARK THEME ── */
.chart-area canvas { background: transparent; }
