/* ============================================================
   PROMOW ONLINE — SHARED DASHBOARD LAYOUT v3.0
   Premium Dark Design System
   ============================================================ */

/* -- CSS Variables ----------------------------------------- */
:root {
  --accent: #7c3aed;
  --accent2: #ec4899;
  --cyan: #06b6d4;
  --bg-deep: #0a0a1a;
  --bg-card: rgba(15, 15, 35, 0.85);
  --border: rgba(124, 58, 237, 0.18);
  --text-primary: #e2e8f0;
  --text-muted: #64748b;
  --text-sec: #94a3b8;
}

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

body.dashboard-body {
  background: var(--bg-deep);
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  min-height: 100vh;
  color: var(--text-primary);
  overflow-x: hidden;
}

body.dashboard-body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% -10%, rgba(124,58,237,0.15) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 110%, rgba(6,182,212,0.10) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 50% 50%, rgba(236,72,153,0.06) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* -- Sidebar ----------------------------------------------- */
.pro-sidebar {
  position: fixed;
  top: 0; left: 0;
  width: 260px;
  height: 100vh;
  background: rgba(8, 8, 22, 0.97);
  border-right: 1px solid var(--border);
  backdrop-filter: blur(24px);
  display: flex;
  flex-direction: column;
  z-index: 50;
  transition: transform 0.3s cubic-bezier(.4,0,.2,1);
}

.sidebar-logo {
  padding: 24px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.logo-icon {
  width: 42px; height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #7c3aed, #ec4899);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 18px; color: white;
  box-shadow: 0 8px 24px rgba(124,58,237,0.35);
  flex-shrink: 0;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #334155;
  text-transform: uppercase;
  padding: 14px 14px 4px;
}

.pro-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 12px;
  color: #94a3b8;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
  position: relative;
  border: 1px solid transparent;
}

.pro-nav-link:hover {
  background: rgba(124,58,237,0.1);
  color: #c4b5fd;
  transform: translateX(2px);
}

.pro-nav-link.active {
  background: linear-gradient(135deg, rgba(124,58,237,0.22), rgba(236,72,153,0.1));
  color: #a78bfa;
  border-color: rgba(124,58,237,0.28);
  box-shadow: inset 0 0 20px rgba(124,58,237,0.08);
}

.pro-nav-link.active::before {
  content: '';
  position: absolute;
  left: 0; top: 20%; height: 60%; width: 3px;
  background: linear-gradient(to bottom, #7c3aed, #ec4899);
  border-radius: 0 2px 2px 0;
}

@media (max-width: 1023px) {
  .pro-sidebar { transform: translateX(-100%); }
  .pro-sidebar.open { transform: translateX(0); box-shadow: 24px 0 80px rgba(0,0,0,0.5); }
}

/* -- Topbar ------------------------------------------------ */
.pro-topbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(10, 10, 26, 0.85);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(20px);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* -- Cards ------------------------------------------------- */
.pro-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  backdrop-filter: blur(12px);
}

.pro-card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255,255,255,0.01);
}

/* -- Inputs ------------------------------------------------ */
.pro-input {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(124,58,237,0.2);
  border-radius: 14px;
  padding: 13px 16px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.pro-input:focus {
  border-color: rgba(124,58,237,0.6);
  background: rgba(124,58,237,0.06);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.12);
}

.pro-input::placeholder { color: #475569; }

.pro-input option {
  background: #0f0f23;
  color: var(--text-primary);
}

.pro-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-sec);
  margin-bottom: 8px;
  letter-spacing: 0.01em;
}

/* -- Buttons ----------------------------------------------- */
.pro-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: 14px;
  background: linear-gradient(135deg, #7c3aed, #ec4899);
  color: white;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  border: none;
  outline: none;
  transition: all 0.2s;
  box-shadow: 0 8px 24px rgba(124,58,237,0.3);
  text-decoration: none;
  font-family: inherit;
}

.pro-btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(124,58,237,0.4);
}

.pro-btn-primary:active { transform: translateY(0); }

.pro-btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 14px;
  border: 1px solid rgba(124,58,237,0.3);
  color: #a78bfa;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  background: transparent;
  transition: all 0.2s;
  text-decoration: none;
  font-family: inherit;
}

.pro-btn-outline:hover {
  background: rgba(124,58,237,0.1);
  border-color: rgba(124,58,237,0.5);
  transform: translateY(-1px);
}

/* -- Stat Cards -------------------------------------------- */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  backdrop-filter: blur(12px);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: -50%; right: -30%;
  width: 160px; height: 160px;
  border-radius: 50%;
  opacity: 0.07;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.3), 0 0 0 1px rgba(124,58,237,0.25);
  border-color: rgba(124,58,237,0.35);
}

.stat-card.purple::before { background: #7c3aed; }
.stat-card.pink::before { background: #ec4899; }
.stat-card.cyan::before { background: #06b6d4; }
.stat-card.green::before { background: #10b981; }

.stat-icon {
  width: 48px; height: 48px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
}

/* -- Status Pills ------------------------------------------ */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.status-pill::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
}

.s-pending { background: rgba(245,158,11,0.12); color: #f59e0b; border: 1px solid rgba(245,158,11,0.2); }
.s-pending::before { background: #f59e0b; animation: pulse-dot 2s infinite; }
.s-completed, .s-active { background: rgba(16,185,129,0.12); color: #10b981; border: 1px solid rgba(16,185,129,0.2); }
.s-completed::before, .s-active::before { background: #10b981; }
.s-cancelled, .s-failed { background: rgba(239,68,68,0.12); color: #ef4444; border: 1px solid rgba(239,68,68,0.2); }
.s-cancelled::before, .s-failed::before { background: #ef4444; }
.s-processing { background: rgba(6,182,212,0.12); color: #06b6d4; border: 1px solid rgba(6,182,212,0.2); }
.s-processing::before { background: #06b6d4; animation: pulse-dot 1.5s infinite; }
.s-partial { background: rgba(139,92,246,0.12); color: #8b5cf6; border: 1px solid rgba(139,92,246,0.2); }
.s-partial::before { background: #8b5cf6; }

/* -- Animations -------------------------------------------- */
@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.5); opacity: 0.7; }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-in { animation: fadeInUp 0.4s ease forwards; }
.delay-1 { animation-delay: 0.1s; opacity: 0; }
.delay-2 { animation-delay: 0.2s; opacity: 0; }
.delay-3 { animation-delay: 0.3s; opacity: 0; }

.shimmer {
  background: linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.03) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}

/* -- Grad Text --------------------------------------------- */
.grad-text {
  background: linear-gradient(135deg, #a78bfa, #ec4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* -- Auth Loader ------------------------------------------- */
.auth-loader-overlay {
  position: fixed; inset: 0;
  background: var(--bg-deep);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  z-index: 9999;
  transition: opacity 0.3s;
}

/* -- Live Balance chip ------------------------------------- */
.balance-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 9999px;
  border: 1px solid var(--border);
  background: rgba(124,58,237,0.08);
}

.pulse-dot { animation: pulse-dot 2s infinite; }

/* -- Scrollbar --------------------------------------------- */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(124,58,237,0.3); border-radius: 4px; }

/* -- Order History Rows ------------------------------------ */
.order-hist-row {
  display: grid;
  grid-template-columns: 100px 1fr 70px 100px 110px 100px;
  gap: 12px;
  padding: 14px 20px;
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  font-size: 13px;
  transition: background 0.15s;
  min-width: 620px;
}

.order-hist-row:hover { background: rgba(124,58,237,0.04); }
.order-hist-row:last-child { border-bottom: none; }

/* -- Transaction Rows -------------------------------------- */
.txn-row {
  display: grid;
  grid-template-columns: 80px 1fr 90px 100px 100px;
  gap: 12px;
  padding: 13px 20px;
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  font-size: 13px;
  transition: background 0.15s;
}

.txn-row:hover { background: rgba(124,58,237,0.04); }
.txn-row:last-child { border-bottom: none; }
