:root {
  --bg: #0B0E1A;
  --bg-2: #111425;
  --card: rgba(22, 26, 45, 0.8);
  --card-solid: #161A2D;
  --card-hover: rgba(30, 35, 60, 0.9);
  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.12);
  --glass: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.08);
  --text: #FFFFFF;
  --text-dim: #8B8FA7;
  --text-mute: #555A73;
  --accent: #00897B;
  --accent-2: #26A69A;
  --accent-grad: linear-gradient(135deg, #00897B, #26A69A);
  --green: #10B981;
  --green-dim: rgba(16, 185, 129, 0.12);
  --green-accent: #25D366;
  --green-accent-grad: linear-gradient(135deg, #00897B, #00695C);
  --purple: #00897B;
  --purple-dim: rgba(0, 137, 123, 0.12);
  --orange: #F59E0B;
  --orange-dim: rgba(245, 158, 11, 0.12);
  --red: #EF4444;
  --red-dim: rgba(239, 68, 68, 0.12);
  --blue: #3B82F6;
  --blue-dim: rgba(59, 130, 246, 0.12);
  --buy: #10B981;
  --sell: #EF4444;
  --warn: #F59E0B;
  --sidebar-bg: #111827;
  --sidebar-text: #9CA3AF;
  --sidebar-active-bg: rgba(0, 137, 123, 0.12);
  --sidebar-active-text: #FFFFFF;
  --sidebar-section: #4B5563;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.2);
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.25);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --blur: blur(20px);
}

[data-theme="light"] {
  --bg: #F5F6FA;
  --bg-2: #FFFFFF;
  --card: #FFFFFF;
  --card-solid: #FFFFFF;
  --card-hover: #F8F9FB;
  --border: rgba(0, 0, 0, 0.07);
  --border-hover: rgba(0, 0, 0, 0.14);
  --glass: rgba(0, 0, 0, 0.02);
  --glass-border: rgba(0, 0, 0, 0.06);
  --text: #1A1D2E;
  --text-dim: #6B7085;
  --text-mute: #9CA0B4;
  --accent: #00796B;
  --accent-2: #26A69A;
  --accent-grad: linear-gradient(135deg, #00796B, #26A69A);
  --green: #059669;
  --green-dim: rgba(5, 150, 105, 0.08);
  --green-accent: #25D366;
  --green-accent-grad: linear-gradient(135deg, #00897B, #00695C);
  --purple: #00897B;
  --purple-dim: rgba(0, 137, 123, 0.08);
  --orange: #D97706;
  --orange-dim: rgba(217, 119, 6, 0.08);
  --red: #DC2626;
  --red-dim: rgba(220, 38, 38, 0.08);
  --blue: #2563EB;
  --blue-dim: rgba(37, 99, 235, 0.08);
  --sidebar-bg: #111827;
  --sidebar-text: #9CA3AF;
  --sidebar-active-bg: rgba(0, 137, 123, 0.15);
  --sidebar-active-text: #FFFFFF;
  --sidebar-section: #4B5563;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  --shadow-sm: 0 1px 6px rgba(0, 0, 0, 0.04);
  --shadow-card: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --blur: blur(16px);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== Sidebar (always dark) ===== */
.sidebar {
  background: var(--sidebar-bg);
  border-right: 1px solid rgba(255,255,255,0.06);
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 50;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.08) transparent;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 10px; }

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 12px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 10px;
}
.logo {
  width: 40px; height: 40px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 8px rgba(0, 137, 123, 0.3));
}
.brand-name { font-weight: 800; font-size: 15px; letter-spacing: -0.3px; color: #fff; }
.brand-sub { font-size: 11px; color: var(--sidebar-text); font-weight: 500; }

/* Mode Switcher */
.mode-switcher {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: rgba(255,255,255,0.04);
  border-radius: 10px;
  margin: 8px 4px 12px;
}
.mode-btn {
  flex: 1;
  padding: 8px 6px;
  border: none;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--sidebar-text);
  background: transparent;
  position: relative;
  letter-spacing: 0.3px;
}
.mode-btn.active-discord {
  background: rgba(0, 137, 123, 0.2);
  color: #26A69A;
}
.mode-btn.active-whatsapp {
  background: rgba(37, 211, 102, 0.2);
  color: #25D366;
}
.mode-btn .coming-badge {
  font-size: 8px;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(37, 211, 102, 0.25);
  color: #25D366;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.mode-btn svg { width: 14px; height: 14px; }

.guild-select {
  width: 100%;
  padding: 10px 14px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-sm);
  color: #E5E7EB;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239CA3AF' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  font-weight: 500;
}
.guild-select:hover { border-color: rgba(255,255,255,0.15); background-color: rgba(255,255,255,0.08); }
.guild-select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(108,92,231,0.2); }

/* Nav Groups */
.nav-section {
  font-size: 10px;
  font-weight: 700;
  color: var(--sidebar-section);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  padding: 16px 14px 6px;
}

.nav { display: flex; flex-direction: column; gap: 1px; flex: 1; }

.nav-item {
  background: transparent;
  border: none;
  color: var(--sidebar-text);
  padding: 9px 14px;
  border-radius: 8px;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.5; transition: var(--transition); }
.nav-item:hover {
  background: rgba(255,255,255,0.06);
  color: #E5E7EB;
}
.nav-item:hover svg { opacity: 0.8; }
.nav-item.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active-text);
  font-weight: 600;
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 55%;
  background: var(--accent-grad);
  border-radius: 0 4px 4px 0;
}
.nav-item.active svg { opacity: 1; color: var(--accent); }

.sidebar-footer {
  font-size: 12px;
  color: rgba(255,255,255,0.35);
  padding: 14px 8px 0;
  border-top: 1px solid rgba(255,255,255,0.06);
  margin-top: 8px;
}
.status { display: flex; align-items: center; gap: 8px; }
.dot {
  width: 8px; height: 8px;
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px rgba(16, 185, 129, 0.5); }
  50% { opacity: 0.6; box-shadow: 0 0 4px rgba(16, 185, 129, 0.3); }
}

/* ===== Main ===== */
.main {
  padding: 28px 36px;
  max-width: 1440px;
  width: 100%;
}

.tab { display: none; animation: fadeIn 0.25s ease; }
.tab.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.page-head h1 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ===== Period Toggle Pills ===== */
.period-pills {
  display: flex;
  gap: 2px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px;
}
.period-pills button {
  padding: 6px 14px;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  background: transparent;
  color: var(--text-dim);
}
.period-pills button.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(108,92,231,0.25);
}
.period-pills button:hover:not(.active) {
  background: var(--glass);
  color: var(--text);
}

/* ===== Buttons ===== */
.btn {
  background: var(--card-solid);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: var(--transition-smooth);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.01em;
  position: relative;
  overflow: hidden;
}
.btn:hover {
  background: var(--card-hover);
  border-color: var(--border-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.btn:active { transform: translateY(0); }
.btn.primary {
  background: var(--accent-grad);
  border: none;
  color: #fff;
  box-shadow: 0 4px 16px rgba(0, 137, 123, 0.3);
}
.btn.primary:hover {
  box-shadow: 0 6px 24px rgba(0, 137, 123, 0.45);
  transform: translateY(-2px);
  filter: brightness(1.1);
}
.btn.danger {
  background: var(--red-dim);
  border-color: rgba(239, 68, 68, 0.2);
  color: var(--red);
}
.btn.danger:hover { background: var(--red); color: #fff; border-color: var(--red); }
.btn.success {
  background: var(--green-dim);
  border-color: rgba(16, 185, 129, 0.2);
  color: var(--green);
}
.btn.success:hover { background: var(--green); color: #fff; border-color: var(--green); }
.btn.small { padding: 7px 14px; font-size: 12px; border-radius: 8px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

/* ===== Hero Banner ===== */
.hero-banner {
  background: var(--green-accent-grad);
  border-radius: var(--radius);
  padding: 28px 32px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 137, 123, 0.2);
}
.hero-banner::before {
  content: '';
  position: absolute;
  top: -50%; right: -10%;
  width: 300px; height: 300px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
}
.hero-banner::after {
  content: '';
  position: absolute;
  bottom: -60%; right: 15%;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
}
.hero-content { position: relative; z-index: 1; flex: 1; }
.hero-content h2 {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 6px;
  letter-spacing: -0.3px;
}
.hero-content p {
  font-size: 13px;
  color: rgba(255,255,255,0.8);
  font-weight: 400;
  margin-bottom: 14px;
}
.hero-content .btn {
  background: #fff;
  color: #128C7E;
  border: none;
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}
.hero-content .btn:hover {
  background: #f0f0f0;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}
.hero-phone {
  position: relative;
  z-index: 1;
  width: 120px;
  height: 160px;
  flex-shrink: 0;
}
.hero-phone-mock {
  width: 100%;
  height: 100%;
  background: rgba(255,255,255,0.15);
  border-radius: 16px;
  border: 2px solid rgba(255,255,255,0.25);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  backdrop-filter: blur(8px);
}
.hero-phone-mock .chat-bubble {
  width: 100%;
  padding: 8px 10px;
  background: rgba(255,255,255,0.9);
  border-radius: 8px 8px 8px 2px;
  font-size: 9px;
  color: #333;
  font-weight: 500;
}
.hero-phone-mock .chat-bubble.sent {
  background: #DCF8C6;
  border-radius: 8px 8px 2px 8px;
  align-self: flex-end;
  width: 85%;
}
.hero-qr {
  position: relative;
  z-index: 1;
  width: 64px; height: 64px;
  background: #fff;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.hero-qr-inner {
  width: 48px; height: 48px;
  background: repeating-conic-gradient(#333 0% 25%, #fff 0% 50%) 0 0 / 8px 8px;
  border-radius: 2px;
}

/* ===== Stats / Metric Cards ===== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  position: relative;
  overflow: hidden;
  transition: var(--transition-smooth);
  box-shadow: var(--shadow-card);
}
[data-theme="light"] .stat {
  background: #fff;
}
.stat:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0,0,0,0.08);
}
[data-theme="dark"] .stat:hover {
  box-shadow: 0 8px 28px rgba(0,0,0,0.3);
}
.stat::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  border-radius: 4px 0 0 4px;
}
.stat:nth-child(1)::before { background: var(--green); }
.stat:nth-child(2)::before { background: var(--accent); }
.stat:nth-child(3)::before { background: var(--orange); }
.stat:nth-child(4)::before { background: var(--blue); }
.stat:nth-child(5)::before { background: var(--red); }

.stat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.stat-label {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.stat-icon {
  width: 32px; height: 32px;
  border-radius: 10px;
  display: grid; place-items: center;
}
.stat-icon svg { width: 16px; height: 16px; }
.stat-icon.green { background: var(--green-dim); color: var(--green); }
.stat-icon.purple { background: var(--purple-dim); color: var(--purple); }
.stat-icon.orange { background: var(--orange-dim); color: var(--orange); }
.stat-icon.blue { background: var(--blue-dim); color: var(--blue); }
.stat-icon.red { background: var(--red-dim); color: var(--red); }

.stat-value {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  margin-bottom: 4px;
}
.stat-trend {
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}
.stat-trend.up { color: var(--green); }
.stat-trend.down { color: var(--red); }
.stat-trend svg { width: 14px; height: 14px; }

/* ===== Card / Grid ===== */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--transition-smooth);
  box-shadow: var(--shadow-card);
}
[data-theme="light"] .card {
  background: #fff;
}
.card:hover { border-color: var(--border-hover); }
.card-head {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-head h3 {
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.card-body { padding: 22px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}

/* ===== Charts ===== */
.chart-container {
  position: relative;
  width: 100%;
}
.chart-container svg {
  width: 100%;
  height: auto;
}
.chart-legend {
  display: flex;
  gap: 18px;
  margin-bottom: 14px;
  font-size: 12px;
  color: var(--text-dim);
}
.chart-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}
.chart-legend-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
}
.chart-summary {
  display: flex;
  gap: 24px;
  margin-bottom: 16px;
  font-size: 13px;
}
.chart-summary b { color: var(--text); font-weight: 700; }

/* ===== Activity List ===== */
.activity-list { list-style: none; }
.activity-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.activity-item:last-child { border-bottom: none; }
.activity-dot {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.activity-dot svg { width: 16px; height: 16px; }
.activity-dot.success { background: var(--green-dim); color: var(--green); }
.activity-dot.pending { background: var(--orange-dim); color: var(--orange); }
.activity-dot.error { background: var(--red-dim); color: var(--red); }
.activity-info { flex: 1; min-width: 0; }
.activity-title { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.activity-sub { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.activity-badge {
  font-size: 11px;
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: 600;
  flex-shrink: 0;
}
.activity-badge.success { background: var(--green-dim); color: var(--green); }
.activity-badge.pending { background: var(--orange-dim); color: var(--orange); }
.activity-badge.error { background: var(--red-dim); color: var(--red); }

/* ===== Item card ===== */
.item-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: var(--transition-smooth);
  cursor: pointer;
  box-shadow: var(--shadow-card);
}
[data-theme="light"] .item-card {
  background: #fff;
}
.item-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0, 137, 123, 0.1);
}
[data-theme="dark"] .item-card:hover {
  box-shadow: 0 8px 28px rgba(0, 137, 123, 0.15);
}
.item-card .preview-img {
  width: 100%; height: 120px;
  background: var(--bg-2);
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
  background-size: cover;
  background-position: center;
}
.item-card .title { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.item-card .meta { font-size: 12px; color: var(--text-dim); }
.item-card .actions {
  display: flex; gap: 8px; margin-top: 14px; padding-top: 14px;
  border-top: 1px solid var(--border);
}
.item-card .badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--glass);
  color: var(--text-dim);
  margin-right: 4px;
  font-weight: 600;
}
.item-card .badge.green { background: var(--green-dim); color: var(--green); }
.item-card .badge.red { background: var(--red-dim); color: var(--red); }
.item-card .badge.warn { background: var(--orange-dim); color: var(--orange); }

/* ===== Table ===== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  text-align: left;
  padding: 12px 18px;
  font-size: 11px;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 700;
  border-bottom: 1px solid var(--border);
  background: var(--glass);
}
tbody td {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}
tbody tr { transition: var(--transition); }
tbody tr:hover { background: var(--glass); }
tbody tr:nth-child(even) { background: rgba(0,0,0,0.008); }
[data-theme="dark"] tbody tr:nth-child(even) { background: rgba(255,255,255,0.01); }
tbody tr:last-child td { border-bottom: none; }
td.empty { text-align: center; color: var(--text-mute); padding: 40px !important; }

.badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: 600;
}
.badge.green { background: var(--green-dim); color: var(--green); }
.badge.red { background: var(--red-dim); color: var(--red); }
.badge.warn { background: var(--orange-dim); color: var(--orange); }

/* ===== Stock panel ===== */
.stock-panel { padding: 22px; }
.stock-textarea {
  width: 100%;
  min-height: 200px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 12px;
  padding: 16px;
  resize: vertical;
  transition: var(--transition);
}
.stock-textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--purple-dim); outline: none; }
.stock-list { margin-top: 18px; max-height: 300px; overflow-y: auto; }
.stock-item {
  padding: 10px 14px;
  background: var(--glass);
  border-radius: var(--radius-sm);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
}
.stock-item.sold { opacity: 0.4; text-decoration: line-through; }

/* ===== Modal ===== */
.modal {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(16px);
  display: grid; place-items: center;
  z-index: 100;
  animation: fadeIn 0.15s ease;
}
.modal.hidden { display: none; }
.modal-content {
  background: var(--card-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 92%;
  max-width: 600px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 32px 64px rgba(0, 0, 0, 0.4);
}
.modal-head {
  padding: 20px 26px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-head h3 { font-size: 17px; font-weight: 700; }
.modal-close {
  background: var(--glass);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 22px;
  cursor: pointer;
  width: 34px; height: 34px;
  border-radius: 10px;
  display: grid; place-items: center;
  transition: var(--transition);
}
.modal-close:hover { background: var(--red-dim); color: var(--red); border-color: rgba(239,68,68,0.2); }
.modal-body { padding: 26px; overflow-y: auto; }

/* ===== Form ===== */
.form-row { margin-bottom: 18px; }
.form-row label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 8px;
  font-weight: 700;
}
.form-row input,
.form-row textarea,
.form-row select {
  width: 100%;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 11px 16px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: var(--transition-smooth);
}
.form-row input:focus,
.form-row textarea:focus,
.form-row select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--purple-dim);
}
.form-row input:hover:not(:focus),
.form-row textarea:hover:not(:focus),
.form-row select:hover:not(:focus) {
  border-color: var(--border-hover);
}
.form-row input::placeholder,
.form-row textarea::placeholder { color: var(--text-mute); }
.form-row textarea { min-height: 90px; resize: vertical; line-height: 1.6; }
.form-hint { font-size: 11px; color: var(--text-mute); margin-top: 6px; }
.form-hint code { background: var(--glass); padding: 2px 8px; border-radius: 6px; font-size: 11px; }

.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.form-actions {
  margin-top: 24px;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* ===== Checkbox ===== */
input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
  max-width: 20px;
  max-height: 20px;
  border: 2px solid var(--border-hover);
  border-radius: 6px;
  background: var(--glass);
  cursor: pointer;
  position: relative;
  transition: var(--transition);
  flex-shrink: 0;
  flex-grow: 0;
  vertical-align: middle;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  line-height: 1;
}
input[type="checkbox"]:hover {
  border-color: var(--accent);
}
input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}
input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border-bottom: 2px solid #fff;
  border-right: 2px solid #fff;
  transform: rotate(45deg);
}
input[type="checkbox"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--purple-dim);
}

/* ===== Checkbox label ===== */
label.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  text-transform: none;
  letter-spacing: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  margin-bottom: 0;
}
label.checkbox-label input[type="checkbox"],
label.checkbox-label input[type="radio"] {
  margin: 0;
}
.form-row label.checkbox-label {
  text-transform: none;
  letter-spacing: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  gap: 10px;
}
.form-row label.checkbox-label input[type="checkbox"] {
  margin: 0;
}

/* ===== Gateway Box ===== */
.gateway-box {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
  transition: var(--transition);
  background: var(--glass);
}
.gateway-box:hover {
  border-color: var(--border-hover);
}
.gateway-box .checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

/* ===== Radio Buttons ===== */
input[type="radio"] {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
  max-width: 20px;
  max-height: 20px;
  border: 2px solid var(--border-hover);
  border-radius: 50%;
  background: var(--glass);
  cursor: pointer;
  position: relative;
  transition: var(--transition);
  flex-shrink: 0;
  flex-grow: 0;
  vertical-align: middle;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
}
input[type="radio"]:hover { border-color: var(--accent); }
input[type="radio"]:checked { border-color: var(--accent); background: var(--accent); }
input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #fff;
}
input[type="radio"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--purple-dim);
}

/* ===== Discord-like preview ===== */
.preview-discord {
  background: #313338;
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 18px;
}
.preview-discord .embed {
  border-left: 4px solid var(--sell);
  background: #2b2d31;
  padding: 18px;
  border-radius: 4px;
}
.preview-discord .embed-title { font-weight: 700; font-size: 16px; margin-bottom: 10px; }
.preview-discord .embed-image {
  width: 100%; max-height: 200px;
  background-size: cover;
  background-position: center;
  border-radius: 4px;
  margin: 10px 0;
}
.preview-discord .embed-desc { font-size: 13px; color: #dbdee1; white-space: pre-wrap; }
.preview-discord .embed-footer { font-size: 11px; color: #949ba4; margin-top: 10px; }
.preview-discord .dropdown-mock {
  background: #383a40;
  border: 1px solid #1e1f22;
  border-radius: 4px;
  padding: 10px 12px;
  margin-top: 10px;
  font-size: 13px;
  color: #dbdee1;
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 28px; right: 28px;
  background: var(--card-solid);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  padding: 16px 24px;
  border-radius: var(--radius-sm);
  z-index: 200;
  box-shadow: var(--shadow);
  font-size: 13px;
  font-weight: 500;
  animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  max-width: 400px;
}
.toast.hidden { display: none; }
.toast.success { border-left-color: var(--green); }
.toast.error { border-left-color: var(--red); }
@keyframes slideUp {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ===== Pie Chart ===== */
.pie-chart-wrap {
  display: flex;
  align-items: center;
  gap: 24px;
}
.pie-chart-wrap svg { flex-shrink: 0; }
.pie-legend { list-style: none; font-size: 13px; }
.pie-legend li { display: flex; align-items: center; gap: 8px; padding: 5px 0; }
.pie-legend .dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.pie-legend .val { color: var(--text-dim); margin-left: auto; padding-left: 12px; font-variant-numeric: tabular-nums; }

/* ===== Dashboard grid ===== */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 20px;
}
.dash-grid .card.full-width { grid-column: 1 / -1; }

/* ===== Status Bar ===== */
.status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 22px;
  margin-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-mute);
}
.status-bar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}
.status-bar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.status-bar .status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
  display: inline-block;
  margin-right: 6px;
  box-shadow: 0 0 6px rgba(16,185,129,0.4);
}
.status-bar .status-dot.offline { background: var(--red); box-shadow: 0 0 6px rgba(239,68,68,0.4); }
.status-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-dim);
}

/* ===== Mobile Bottom Nav ===== */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: #111827;
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 6px 0 env(safe-area-inset-bottom, 6px);
  z-index: 50;
  justify-content: flex-start;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.bottom-nav::-webkit-scrollbar { display: none; }
.bottom-nav button {
  background: transparent;
  border: none;
  color: #6B7280;
  font-size: 9px;
  font-family: inherit;
  cursor: pointer;
  padding: 6px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  transition: var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}
.bottom-nav button svg { width: 18px; height: 18px; }
.bottom-nav button.active { color: var(--accent-2); }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  body { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .main { padding: 16px 16px 80px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .stat { padding: 16px 18px; }
  .stat-value { font-size: 22px; }
  .dash-grid { grid-template-columns: 1fr; }
  .grid { grid-template-columns: 1fr; }
  .form-grid-2 { grid-template-columns: 1fr; }
  .bottom-nav { display: flex; }
  .page-head h1 { font-size: 20px; }
  .hero-banner { padding: 20px; flex-direction: column; text-align: center; }
  .hero-phone { display: none; }
  .hero-qr { display: none; }
  .status-bar { flex-direction: column; gap: 8px; align-items: flex-start; }
}

@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .stat-value { font-size: 20px; }
  .main { padding: 12px 12px 80px; }
  .card-body { padding: 16px; }
}

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

/* ===== Misc helpers ===== */
small { color: var(--text-mute); font-size: 12px; }
code { background: var(--glass); padding: 2px 8px; border-radius: 6px; font-size: 12px; color: var(--accent-2); }
img { max-width: 100%; }

/* ===== Emoji Config Grid ===== */
.emoji-config-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 600px) {
  .emoji-config-grid { grid-template-columns: 1fr; }
}

/* ===== Globe Decoration ===== */
.globe-decor {
  position: absolute;
  right: -40px;
  top: 50%;
  transform: translateY(-50%);
  width: 240px;
  height: 240px;
  opacity: 0.12;
  pointer-events: none;
  animation: globeRotate 60s linear infinite;
}
.globe-decor svg { width: 100%; height: 100%; }
@keyframes globeRotate {
  from { transform: translateY(-50%) rotate(0deg); }
  to { transform: translateY(-50%) rotate(360deg); }
}
[data-theme="light"] .globe-decor { opacity: 0.06; }
@media (max-width: 900px) { .globe-decor { display: none; } }

/* ===== Selection ===== */
::selection {
  background: rgba(0, 137, 123, 0.3);
  color: #fff;
}

/* ===== Traffic Sources (new) ===== */
.traffic-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.traffic-item:last-child { border-bottom: none; }
.traffic-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.traffic-info { flex: 1; }
.traffic-name { font-size: 13px; font-weight: 600; }
.traffic-bar {
  height: 4px;
  background: var(--glass);
  border-radius: 4px;
  margin-top: 4px;
  overflow: hidden;
}
.traffic-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}
.traffic-val {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
