:root {
  --bg-body: #0b0f17;
  --bg-surface: #111827;
  --bg-surface-elevated: #162032;
  --bg-input: #0e1524;
  --border-color: #1f293d;
  --border-focus: #3b82f6;

  --color-primary: #3b82f6;
  --color-primary-hover: #2563eb;
  --color-accent: #06b6d4;
  --color-accent-glow: rgba(6, 182, 212, 0.25);
  --color-success: #10b981;
  --color-success-glow: rgba(16, 185, 129, 0.2);
  --color-purple: #8b5cf6;
  --color-orange: #f59e0b;
  
  --text-main: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;

  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 25px rgba(59, 130, 246, 0.2);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-body);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.font-mono {
  font-family: var(--font-mono);
}

.d-none {
  display: none !important;
}

.d-flex {
  display: flex;
}

.align-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-2 { gap: 8px; }
.gap-3 { gap: 14px; }
.gap-4 { gap: 20px; }

.w-100 { width: 100%; }

.text-muted { color: var(--text-muted); }
.text-success { color: var(--color-success); }
.text-cyan { color: var(--color-accent); }
.text-accent { color: #38bdf8; }

/* ==================== LOGIN VIEW ==================== */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
  background: radial-gradient(circle at 50% 20%, #152238 0%, #0b0f17 80%);
}

.auth-glow {
  position: absolute;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, rgba(6, 182, 212, 0.05) 50%, transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  filter: blur(40px);
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: rgba(17, 24, 39, 0.85);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 38px 32px;
  box-shadow: var(--shadow-card), var(--shadow-glow);
  position: relative;
  z-index: 2;
  animation: slideUp 0.4s ease-out;
}

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

.logo-box {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}

.bot-badge-icon {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 18px rgba(6, 182, 212, 0.35);
  flex-shrink: 0;
}

.bot-badge-icon.sm {
  width: 42px;
  height: 42px;
  border-radius: 10px;
}

.brand-title {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge-version {
  font-size: 0.65rem;
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
  padding: 2px 7px;
  border-radius: 20px;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.brand-sub {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.alert-box {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  margin-bottom: 20px;
  animation: shake 0.3s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  pointer-events: none;
}

.input-wrapper input {
  width: 100%;
  padding: 13px 14px 13px 44px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.95rem;
  font-family: inherit;
  transition: all 0.2s ease;
}

.input-wrapper input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-glow);
}

.pwd-toggle {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}

.pwd-toggle:hover {
  color: var(--text-main);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary {
  background: linear-gradient(135deg, #2563eb, #0284c7);
  color: #fff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #1d4ed8, #0369a1);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.btn-secondary:hover {
  background: #1e2c44;
  color: var(--text-main);
}

.btn-accent {
  background: linear-gradient(135deg, #0284c7, #06b6d4);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(6, 182, 212, 0.3);
}

.btn-accent:hover {
  background: linear-gradient(135deg, #0369a1, #0891b2);
  transform: translateY(-1px);
}

.btn-withdraw {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: not-allowed;
  opacity: 0.65;
  transition: all 0.2s ease;
}

.btn-withdraw:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.2);
}

.tooltip-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.tooltip-wrapper .tooltip-text {
  visibility: hidden;
  opacity: 0;
  width: max-content;
  max-width: 220px;
  background-color: #1e293b;
  color: #f1f5f9;
  text-align: center;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 0.75rem;
  font-weight: 500;
  position: absolute;
  z-index: 100;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  border: 1px solid var(--border-color);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  pointer-events: none;
}

.tooltip-wrapper .tooltip-text::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: #1e293b transparent transparent transparent;
}

.tooltip-wrapper:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.btn-warning-soft {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fbbf24;
}

.btn-warning-soft:hover {
  background: rgba(245, 158, 11, 0.25);
  border-color: #f59e0b;
}

.btn-success-soft {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
}

.btn-success-soft:hover {
  background: rgba(16, 185, 129, 0.25);
  border-color: #10b981;
}

.status-indicator-badge.suspended {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.pulse-dot.suspended {
  background: #f59e0b;
  box-shadow: 0 0 8px #f59e0b;
  animation: none;
}

.pulse-ring.suspended {
  animation: none;
  background: rgba(245, 158, 11, 0.2);
}

.pulse-core.suspended {
  background: #f59e0b;
  box-shadow: 0 0 10px #f59e0b;
}

.text-warning {
  color: #fbbf24;
}

.btn-outline-cyan {
  background: rgba(6, 182, 212, 0.08);
  border: 1px solid rgba(6, 182, 212, 0.3);
  color: #38bdf8;
}

.btn-outline-cyan:hover {
  background: rgba(6, 182, 212, 0.16);
  border-color: #38bdf8;
}

.btn-ghost {
  background: transparent;
  border: none;
  padding: 6px 10px;
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

.btn-sm {
  padding: 8px 14px;
  font-size: 0.84rem;
  border-radius: var(--radius-sm);
}

.btn-xs {
  padding: 5px 8px;
  font-size: 0.78rem;
  border-radius: 6px;
}

.auth-footer {
  margin-top: 24px;
  text-align: center;
}

.info-pill {
  font-size: 0.8rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.03);
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* ==================== DASHBOARD VIEW ==================== */
.dashboard-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: rgba(17, 24, 39, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  padding: 14px 28px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.brand-title-nav {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #ffffff, #cbd5e1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: block;
}

.status-indicator-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.04em;
}

.status-indicator-badge.live {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulseAnimation 1.6s infinite ease-in-out;
}

@keyframes pulseAnimation {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.7; }
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 12px 5px 6px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: 30px;
}

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-meta {
  display: flex;
  flex-direction: column;
}

.username-display {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.1;
}

.user-role {
  font-size: 0.65rem;
  color: var(--text-secondary);
}

.main-content {
  flex: 1;
  padding: 28px;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

/* STATUS BANNER */
.status-banner {
  background: linear-gradient(135deg, rgba(22, 32, 50, 0.95), rgba(15, 23, 42, 0.9));
  border: 1px solid rgba(6, 182, 212, 0.25);
  border-radius: var(--radius-lg);
  padding: 22px 26px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 26px;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.4);
  flex-wrap: wrap;
  gap: 20px;
}

.pulse-circle-container {
  position: relative;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pulse-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.2);
  animation: ripple 2s infinite ease-out;
}

@keyframes ripple {
  0% { transform: scale(0.6); opacity: 1; }
  100% { transform: scale(1.4); opacity: 0; }
}

.pulse-core {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 14px #10b981;
}

.status-banner-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.status-banner-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.countdown-card {
  background: rgba(11, 15, 23, 0.6);
  border: 1px solid var(--border-color);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  text-align: right;
}

.countdown-label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.countdown-value {
  font-size: 1.15rem;
  font-weight: 700;
  color: #38bdf8;
}

/* STATS GRID */
.grid-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-bottom: 26px;
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px;
  transition: transform 0.2s, border-color 0.2s;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(59, 130, 246, 0.35);
}

.stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.stat-title {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.stat-icon-wrap {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-icon-wrap.green { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.stat-icon-wrap.cyan { background: rgba(6, 182, 212, 0.15); color: #06b6d4; }
.stat-icon-wrap.purple { background: rgba(139, 92, 246, 0.15); color: #a78bfa; }
.stat-icon-wrap.orange { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }

.stat-main-value {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 8px;
}

.stat-sub {
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge-growth {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  font-weight: 600;
  font-size: 0.74rem;
  padding: 2px 7px;
  border-radius: 4px;
}

.ping-badge {
  font-size: 0.7rem;
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.2);
  padding: 1px 6px;
  border-radius: 12px;
  font-family: var(--font-mono);
}

/* SECTION CARDS & TABLE */
.section-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 26px;
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.3);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.section-title {
  font-size: 1.15rem;
  font-weight: 700;
}

.bets-count-badge {
  font-size: 0.75rem;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 3px 10px;
  border-radius: 20px;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.bets-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.88rem;
}

.bets-table th {
  background: var(--bg-surface-elevated);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 13px 16px;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  text-align: left;
}

.bets-table th:first-child { border-top-left-radius: 8px; border-bottom-left-radius: 8px; }
.bets-table th:last-child { border-top-right-radius: 8px; border-bottom-right-radius: 8px; }

.bets-table td {
  padding: 15px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

.bets-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.bet-source-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.25);
  padding: 3px 9px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.78rem;
}

.badge-win {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* EMPTY STATE */
.empty-state {
  padding: 50px 20px;
  text-align: center;
  max-width: 580px;
  margin: 0 auto;
}

.empty-icon-wrap {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
}

.empty-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-main);
}

.empty-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 22px;
}

/* TOASTS */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: #1e293b;
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.88rem;
  animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  min-width: 300px;
}

.toast.toast-success {
  border-left: 4px solid var(--color-success);
}

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

@media (max-width: 768px) {
  .topbar { padding: 12px 16px; }
  .main-content { padding: 16px; }
  .status-banner { flex-direction: column; align-items: flex-start; }
  .banner-actions { width: 100%; justify-content: space-between; }
  .countdown-card { text-align: left; }
  .grid-stats { grid-template-columns: 1fr; }
}
