:root {
  --bg: #06090d;
  --bg-sub: #0b1116;
  --sidebar-w: 260px;
  
  --panel: rgba(14, 21, 27, 0.9);
  --panel-solid: #0e151b;
  --panel-card: rgba(19, 29, 37, 0.8);
  --panel-hover: rgba(25, 39, 50, 0.95);
  
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(233, 189, 94, 0.35);
  --line-focus: rgba(81, 216, 246, 0.6);
  
  --text: #f6f8fa;
  --text-dim: #cbd5e1;
  --muted: #8e9fa5;
  --faint: #5a6b72;
  
  --gold: #e9bd5e;
  --gold-glow: rgba(233, 189, 94, 0.25);
  --cyan: #51d8f6;
  --cyan-glow: rgba(81, 216, 246, 0.25);
  --good: #4fe29a;
  --good-glow: rgba(79, 226, 154, 0.25);
  --bad: #ff6e78;
  --bad-glow: rgba(255, 110, 120, 0.25);
  --warn: #f4c86a;
  --purple: #c49eff;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  
  --shadow-main: 0 20px 60px rgba(0, 0, 0, 0.45);
  --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.25);
  --blur-panel: blur(18px);
}

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

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background-color: var(--bg);
  color: var(--text);
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-image:
    radial-gradient(circle at 12% 10%, rgba(233, 189, 94, 0.12), transparent 32%),
    radial-gradient(circle at 88% 5%, rgba(81, 216, 246, 0.1), transparent 30%),
    linear-gradient(180deg, #070c10 0%, #05080b 100%);
  background-attachment: fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.8), transparent 90%);
}

/* ===================================================
   TYPOGRAPHY & UTILITIES
   =================================================== */
h1, h2, h3, h4 {
  font-family: "Outfit", sans-serif;
  margin: 0;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
}

p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

code {
  font-family: "JetBrains Mono", monospace;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
  color: var(--gold);
}

.gold-txt { color: var(--gold) !important; }
.cyan-txt { color: var(--cyan) !important; }
.good-txt { color: var(--good) !important; }
.bad-txt { color: var(--bad) !important; }

/* ===================================================
   BUTTONS & INPUTS
   =================================================== */
button, input, select {
  font-family: inherit;
  font-size: 14px;
}

button {
  cursor: pointer;
  border: none;
  outline: none;
  transition: all 0.2s ease;
  user-select: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold), #ffebb0);
  color: #0b1116;
  font-weight: 700;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px var(--gold-glow);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
  box-shadow: 0 12px 30px var(--gold-glow);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border: 1px solid var(--line);
  font-weight: 600;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.btn-bad {
  background: rgba(255, 110, 120, 0.15);
  color: var(--bad);
  border: 1px solid rgba(255, 110, 120, 0.35);
  font-weight: 600;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
}

.btn-bad:hover {
  background: rgba(255, 110, 120, 0.25);
  border-color: var(--bad);
}

.btn-full {
  width: 100%;
}

.btn-icon-sm {
  padding: 6px 12px;
  font-size: 12px;
  min-height: 32px;
}

input, select {
  width: 100%;
  min-height: 42px;
  padding: 10px 14px;
  background: rgba(10, 16, 21, 0.85);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  outline: none;
  transition: all 0.2s ease;
}

input:focus, select:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px var(--cyan-glow);
}

/* ===================================================
   APP LAYOUT (SIDEBAR + MAIN CONTENT)
   =================================================== */
.app-layout {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ===================================================
   SIDEBAR STYLING
   =================================================== */
.app-sidebar {
  width: var(--sidebar-w);
  background: rgba(9, 14, 18, 0.95);
  backdrop-filter: var(--blur-panel);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 20px 16px;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.brand-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-badge {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--gold), #ffe599);
  color: #0b1116;
  font-family: "Outfit", sans-serif;
  font-weight: 900;
  font-size: 16px;
  border-radius: 10px;
  box-shadow: 0 6px 18px var(--gold-glow);
}

.brand-text h2 {
  font-size: 16px;
  background: linear-gradient(135deg, #ffffff 40%, var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-text span {
  font-size: 11px;
  color: var(--faint);
}

.sidebar-close-btn {
  display: none;
  background: none;
  color: var(--muted);
  font-size: 24px;
}

.sidebar-user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan), #8fe8fc);
  color: #061015;
  font-weight: 800;
  display: grid;
  place-items: center;
  font-size: 13px;
}

.user-details {
  min-width: 0;
}

.user-details strong {
  display: block;
  font-size: 13px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 5px;
  border-radius: 3px;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

.role-admin {
  background: var(--gold-glow);
  color: var(--gold);
  border: 1px solid rgba(233, 189, 94, 0.4);
}

.role-user {
  background: var(--cyan-glow);
  color: var(--cyan);
  border: 1px solid rgba(81, 216, 246, 0.4);
}

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

.nav-section-label {
  font-size: 10px;
  font-weight: 800;
  color: var(--faint);
  letter-spacing: 1px;
  padding: 12px 10px 4px 10px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
  text-align: left;
  transition: all 0.15s ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(233, 189, 94, 0.15), rgba(81, 216, 246, 0.06));
  color: #fff;
  border-left: 3px solid var(--gold);
}

.nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

/* ===================================================
   MAIN VIEWPORT & TOPBAR
   =================================================== */
.app-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.top-nav-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 28px;
  background: var(--panel);
  backdrop-filter: var(--blur-panel);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}

.top-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.sidebar-toggle-btn {
  display: none;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  color: var(--text);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  place-items: center;
}

.sidebar-toggle-btn svg {
  width: 20px;
  height: 20px;
}

.page-title-wrap h1 {
  font-size: 20px;
}

.server-endpoint {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: var(--muted);
}

.content-wrapper {
  padding: 24px 28px 60px 28px;
  flex: 1;
}

/* TAB PANES TOGGLE */
.tab-pane {
  display: none;
  animation: fadeIn 0.22s ease forwards;
}

.tab-pane.active {
  display: block;
}

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

/* ===================================================
   STATS OVERVIEW CARDS
   =================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.stat-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-card);
  backdrop-filter: var(--blur-panel);
  position: relative;
  overflow: hidden;
}

.stat-card.online-glow::after {
  content: "";
  position: absolute;
  top: -20px;
  right: -20px;
  width: 60px;
  height: 60px;
  background: var(--good-glow);
  border-radius: 50%;
  filter: blur(18px);
}

.stat-label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}

.stat-val {
  font-family: "Outfit", sans-serif;
  font-size: 30px;
  font-weight: 800;
  margin: 6px 0 2px 0;
  line-height: 1;
}

.stat-meta {
  font-size: 11px;
  color: var(--faint);
}

/* ===================================================
   VIEW MODE CONTROLS & FILTERS
   =================================================== */
.view-controls-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
  align-items: center;
}

.search-input-wrap {
  flex: 1;
  min-width: 240px;
  position: relative;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--muted);
  pointer-events: none;
}

.search-input-wrap input {
  padding-left: 42px;
}

.view-mode-group {
  display: flex;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 3px;
}

.view-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.view-btn svg {
  width: 15px;
  height: 15px;
}

.view-btn.active {
  background: var(--panel-hover);
  color: var(--gold);
  border: 1px solid rgba(233, 189, 94, 0.3);
}

.filter-controls {
  display: flex;
  gap: 8px;
}

.filter-controls select {
  min-width: 140px;
}

/* ===================================================
   GRID AGENT CARDS
   =================================================== */
.agent-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.hub-live-section {
  background:
    linear-gradient(145deg, rgba(18, 27, 48, 0.96), rgba(9, 14, 25, 0.98)),
    radial-gradient(circle at 12% 0%, rgba(233, 189, 94, 0.14), transparent 34%);
  border: 1px solid rgba(116, 137, 170, 0.22);
  border-radius: 8px;
  padding: 14px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.34);
}

.hub-live-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.hub-live-head h2 {
  margin: 6px 0 0;
  font-size: 17px;
  line-height: 1.15;
}

.hub-code-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 9px;
  border-radius: 6px;
  background: rgba(233, 189, 94, 0.12);
  border: 1px solid rgba(233, 189, 94, 0.36);
  color: var(--gold);
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  font-weight: 800;
}

.hub-live-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.hub-live-stats span {
  padding: 6px 9px;
  border-radius: 6px;
  border: 1px solid rgba(121, 143, 180, 0.22);
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.hub-account-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(285px, 1fr));
  gap: 12px;
}

.bot-account-card {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  padding: 13px;
  border: 1px solid rgba(106, 128, 164, 0.24);
  background: linear-gradient(180deg, rgba(21, 31, 53, 0.96), rgba(11, 17, 30, 0.98));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 12px 24px rgba(0, 0, 0, 0.24);
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.bot-account-card:hover {
  transform: translateY(-2px);
  border-color: rgba(91, 211, 255, 0.34);
  background: linear-gradient(180deg, rgba(24, 37, 64, 0.98), rgba(12, 19, 33, 0.98));
}

.bot-account-card.offline,
.bot-account-card.revoked {
  opacity: 0.62;
  filter: grayscale(0.25);
}

.bot-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.bot-title {
  min-width: 0;
}

.bot-title strong {
  display: block;
  color: #fff;
  font-size: 17px;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bot-title span,
.bot-map-line {
  color: var(--muted);
  font-size: 11px;
}

.bot-map-line {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
}

.bot-map-line span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bot-map-line b {
  color: var(--good);
  font-weight: 800;
}

.bot-bars {
  display: grid;
  gap: 7px;
  margin-top: 11px;
}

.bot-meter-line {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 5px 8px;
  align-items: center;
}

.bot-meter-line span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.bot-meter-line b {
  justify-self: end;
  color: var(--text);
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px;
  font-weight: 700;
}

.bot-meter-line .meter-track {
  grid-column: 1 / -1;
  height: 8px;
}

.bot-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 11px;
}

.bot-chip {
  min-height: 21px;
  padding: 4px 7px;
  border-radius: 5px;
  border: 1px solid rgba(120, 140, 175, 0.18);
  background: rgba(255, 255, 255, 0.035);
  color: var(--faint);
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
}

.bot-chip.on {
  color: var(--good);
  border-color: rgba(79, 226, 154, 0.24);
  background: rgba(79, 226, 154, 0.08);
}

.bot-wallet {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
}

.bot-growth-line {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-top: 10px;
}

.bot-growth-line span {
  min-height: 30px;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid rgba(91, 211, 255, 0.16);
  background: rgba(91, 211, 255, 0.055);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.bot-growth-line b {
  color: var(--cyan);
  font-family: "JetBrains Mono", monospace;
}

.bot-wallet b {
  color: var(--gold);
  font-family: "JetBrains Mono", monospace;
}

.bot-wallet em {
  margin-left: auto;
  color: var(--good);
  font-size: 11px;
  font-style: normal;
}

.bot-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.bot-action-btn {
  min-height: 34px;
  border: 1px solid rgba(117, 139, 172, 0.24);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.bot-action-btn.primary {
  border-color: rgba(139, 91, 255, 0.42);
  background: linear-gradient(180deg, #854eff, #6230d6);
  color: #fff;
}

.agent-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-card);
  backdrop-filter: var(--blur-panel);
  position: relative;
  overflow: hidden;
  transition: all 0.2s ease;
}

.agent-card:hover {
  transform: translateY(-2px);
  border-color: rgba(233, 189, 94, 0.4);
}

.agent-card-top-stripe {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--cyan), var(--purple));
}

.agent-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
  gap: 10px;
}

.agent-char-title strong {
  display: block;
  font-size: 17px;
  font-weight: 700;
  color: #fff;
}

.agent-char-title span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.agent-bars {
  display: grid;
  gap: 7px;
  margin-bottom: 12px;
}

.meter-row {
  display: grid;
  grid-template-columns: 34px 1fr 65px;
  gap: 8px;
  align-items: center;
  font-size: 11.5px;
}

.meter-label {
  font-weight: 700;
  color: var(--muted);
}

.meter-track {
  height: 7px;
  background: rgba(0, 0, 0, 0.45);
  border-radius: 999px;
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  width: var(--val, 0%);
  border-radius: inherit;
  transition: width 0.35s ease;
}

.meter-fill.hp { background: linear-gradient(90deg, #24c873, var(--good)); }
.meter-fill.hp.low { background: linear-gradient(90deg, #ff4d5e, var(--bad)); }
.meter-fill.mp { background: linear-gradient(90deg, #38aaf5, var(--cyan)); }
.meter-fill.exp { background: linear-gradient(90deg, var(--gold), #ffebb0); }

.meter-val {
  text-align: right;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: var(--text);
}

.agent-metrics-2x2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 10px;
}

.metric-cell {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
  padding: 6px 8px;
  border-radius: var(--radius-sm);
}

.metric-cell span {
  display: block;
  font-size: 10px;
  color: var(--faint);
  text-transform: uppercase;
}

.metric-cell strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.agent-footer-action {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
}

/* ===================================================
   COMPACT MULTI-ACCOUNT VIEW (HIGH DENSITY)
   =================================================== */
.agent-grid.compact-mode {
  grid-template-columns: 1fr;
  gap: 8px;
}

.compact-card {
  display: grid;
  grid-template-columns: 180px 140px 140px 120px 140px auto;
  gap: 12px;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: all 0.15s ease;
}

.compact-card:hover {
  background: var(--panel-hover);
  border-color: rgba(233, 189, 94, 0.3);
}

.compact-char strong {
  display: block;
  font-size: 14px;
  color: #fff;
}

.compact-char span {
  font-size: 11px;
  color: var(--muted);
}

.compact-bar {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.compact-bar span {
  font-size: 10px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
}

.compact-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

/* ===================================================
   REMOTE CONTROLLER & D-PAD
   =================================================== */
.dpad-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 20px auto;
  width: 200px;
}

.dpad-middle-row {
  display: flex;
  gap: 8px;
}

.dpad-btn {
  width: 54px;
  height: 54px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line);
  font-size: 20px;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.dpad-btn:hover {
  background: rgba(233, 189, 94, 0.2);
  border-color: var(--gold);
  transform: scale(1.08);
}

.dpad-center {
  background: rgba(255, 110, 120, 0.15);
  border-color: rgba(255, 110, 120, 0.4);
}

.remote-action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 14px;
}

/* ===================================================
   DATA TABLES
   =================================================== */
.table-wrap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow-x: auto;
  box-shadow: var(--shadow-card);
  backdrop-filter: var(--blur-panel);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th, .data-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.data-table th {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(0, 0, 0, 0.2);
}

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

.data-table td {
  font-size: 13px;
}

/* ===================================================
   SUB-PANEL & GENERATOR FORMS
   =================================================== */
.generator-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 20px;
}

.sub-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-card);
  backdrop-filter: var(--blur-panel);
}

.sub-panel-head {
  margin-bottom: 16px;
}

.sub-panel-head h3 {
  font-size: 17px;
  margin-bottom: 4px;
}

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

.form-group label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 5px;
}

.preset-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.preset-btn {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-dim);
  border: 1px solid var(--line);
  padding: 7px 11px;
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  font-weight: 600;
}

.preset-btn.active, .preset-btn:hover {
  background: var(--gold-glow);
  color: var(--gold);
  border-color: var(--gold);
}

.generated-box {
  margin-top: 16px;
  padding: 14px;
  background: rgba(10, 16, 21, 0.9);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.generated-left span {
  display: block;
  font-size: 11px;
  color: var(--muted);
}

.generated-left strong {
  display: block;
  font-family: "JetBrains Mono", monospace;
  font-size: 22px;
  margin: 3px 0;
  letter-spacing: 1px;
}

.generated-left small {
  display: block;
  font-size: 11px;
  color: var(--faint);
}

.step-guide {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}

.step-guide li {
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.step-guide strong {
  display: block;
  font-size: 13.5px;
  color: #fff;
  margin-bottom: 3px;
}

.step-guide span {
  font-size: 12.5px;
  color: var(--muted);
}

/* ===================================================
   ANALYTICS & CHARTS
   =================================================== */
.hunt-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.hunt-metric-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: var(--shadow-card);
  backdrop-filter: var(--blur-panel);
}

.hunt-metric-card span {
  font-size: 12px;
  color: var(--muted);
}

.hunt-metric-card strong {
  display: block;
  font-family: "Outfit", sans-serif;
  font-size: 24px;
  margin: 5px 0 2px 0;
}

.hunt-metric-card small {
  font-size: 11.5px;
  color: var(--faint);
}

.chart-container-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-card);
  backdrop-filter: var(--blur-panel);
}

.chart-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 10px;
}

.chart-card-header h3 {
  font-size: 15px;
  color: var(--text-dim);
}

.chart-legend {
  font-size: 11.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 10px;
}

.legend-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 4px;
}

.legend-dot.cyan { background: var(--cyan); }
.legend-dot.gold { background: var(--gold); }
.legend-dot.good { background: var(--good); }
.legend-dot.mp { background: #38aaf5; }

.chart-canvas-wrap {
  width: 100%;
}

/* ===================================================
   EVENTS STREAM & DIAGS
   =================================================== */
.events-stream-box {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px;
  min-height: 380px;
  max-height: 560px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  backdrop-filter: var(--blur-panel);
}

.event-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  animation: fadeIn 0.2s ease forwards;
}

.event-badge {
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.event-badge.level_up { background: var(--gold-glow); color: var(--gold); border: 1px solid var(--gold); }
.event-badge.low_hp_warning { background: var(--bad-glow); color: var(--bad); border: 1px solid var(--bad); }
.event-badge.map_changed { background: var(--cyan-glow); color: var(--cyan); border: 1px solid var(--cyan); }
.event-badge.agent_claimed { background: var(--good-glow); color: var(--good); border: 1px solid var(--good); }

.event-time {
  margin-left: auto;
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px;
  color: var(--faint);
}

.diag-list {
  display: grid;
  gap: 8px;
}

.diag-item {
  display: flex;
  justify-content: space-between;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 6px currentColor;
  animation: pulse 1.8s infinite;
}

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

.pill.online { color: var(--good); border-color: rgba(79, 226, 154, 0.4); background: rgba(79, 226, 154, 0.08); }
.pill.offline { color: var(--bad); border-color: rgba(255, 110, 120, 0.4); background: rgba(255, 110, 120, 0.08); }
.pill.stale { color: var(--warn); border-color: rgba(244, 200, 106, 0.4); background: rgba(244, 200, 106, 0.08); }

/* ===================================================
   MODAL DEEP INSPECTOR
   =================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(10px);
  z-index: 999;
  display: grid;
  place-items: center;
  padding: 16px;
}

.modal-card {
  width: min(540px, 100%);
  background: var(--panel-solid);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-main);
  overflow: hidden;
  animation: modalPop 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes modalPop {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.modal-sub {
  font-family: "JetBrains Mono", monospace;
  font-size: 11.5px;
  color: var(--muted);
}

.modal-close-btn {
  background: none;
  color: var(--muted);
  font-size: 24px;
}

.modal-body {
  padding: 18px;
  max-height: 65vh;
  overflow-y: auto;
}

.modal-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  background: rgba(0, 0, 0, 0.2);
}

/* ===================================================
   TOAST NOTIFICATION
   =================================================== */
.toast-notification {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(30px);
  background: rgba(14, 21, 27, 0.95);
  border: 1px solid var(--line-strong);
  color: var(--text);
  padding: 10px 20px;
  border-radius: 999px;
  box-shadow: var(--shadow-main);
  font-size: 13px;
  font-weight: 600;
  z-index: 1000;
  pointer-events: none;
  opacity: 0;
  transition: all 0.25s ease;
}

.toast-notification.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ===================================================
   LIVE FOCUS PANEL (DIRECT DEDICATED CONTROL)
   =================================================== */
.live-focus-panel {
  background: var(--panel-solid);
  border: 1px solid var(--gold);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-bottom: 20px;
  box-shadow: 0 12px 40px rgba(233, 189, 94, 0.15);
  animation: fadeIn 0.25s ease forwards;
}

.live-focus-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.focus-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.focus-indicator-badge {
  background: var(--gold);
  color: #080d11;
  font-size: 11px;
  font-weight: 900;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.focus-level-tag {
  background: rgba(255, 255, 255, 0.08);
  color: var(--cyan);
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(81, 216, 246, 0.3);
}

.live-focus-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 18px;
}

.focus-stats-card, .focus-controls-card {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px;
}

.focus-bars-wrap {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.focus-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.focus-meta-item {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px;
}

.focus-meta-item span {
  display: block;
  font-size: 11px;
  color: var(--faint);
  text-transform: uppercase;
}

.focus-meta-item strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  margin: 3px 0 1px 0;
}

.focus-meta-item small {
  display: block;
  font-size: 11px;
  color: var(--muted);
}

.focus-card-head {
  margin-bottom: 12px;
}

.focus-card-head h3 {
  font-size: 15px;
  margin-bottom: 2px;
}

.focus-card-head span {
  font-size: 11.5px;
  color: var(--muted);
}

.chat-input-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.chat-input-bar input {
  flex: 1;
  min-height: 38px;
}

.focus-dpad-row {
  display: flex;
  gap: 16px;
  align-items: center;
}

.compact-dpad {
  margin: 0;
  width: 150px;
}

.compact-dpad .dpad-btn {
  width: 44px;
  height: 44px;
  font-size: 16px;
}

.focus-action-btns {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.agent-card, .compact-card {
  cursor: pointer;
}

.bot-account-card {
  cursor: pointer;
}

@media (max-width: 900px) {
  .live-focus-grid {
    grid-template-columns: 1fr;
  }
  .focus-dpad-row {
    flex-direction: column;
  }
  .compact-dpad {
    margin: 10px auto;
  }
}

/* ===================================================
   RESPONSIVE MEDIA QUERIES (MOBILE / TABLET)
   =================================================== */
@media (max-width: 900px) {
  .app-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    transform: translateX(-100%);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: var(--shadow-main);
    z-index: 1000;
  }
  .app-sidebar.open {
    transform: translateX(0);
  }
  .sidebar-close-btn {
    display: block;
  }
  .sidebar-toggle-btn {
    display: grid;
  }
  .content-wrapper {
    padding: 16px;
  }
  .compact-card {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .hub-live-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .hub-live-stats {
    justify-content: flex-start;
  }
}

@media (max-width: 600px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }
  .view-controls-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .filter-controls {
    width: 100%;
  }
  .filter-controls select {
    flex: 1;
  }
  .hub-live-section {
    padding: 10px;
  }
  .hub-account-grid {
    grid-template-columns: 1fr;
  }
  .bot-actions {
    grid-template-columns: 1fr;
  }
  .bot-wallet {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }
  .bot-growth-line {
    grid-template-columns: 1fr;
  }
  .bot-wallet em {
    margin-left: 0;
  }
}
