:root {
  --bg-dark: #090d16;
  --bg-card: rgba(16, 23, 38, 0.75);
  --bg-card-hover: rgba(23, 33, 54, 0.85);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-neon: rgba(0, 242, 254, 0.4);
  
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-neon: #00f2fe;
  --text-success: #00e676;
  --text-danger: #ff5252;
  --text-warning: #ffb300;

  --accent-cyan: #00f2fe;
  --accent-purple: #7928ca;
  --accent-gradient: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
  --accent-btn-gradient: linear-gradient(135deg, #00e676 0%, #00b0ff 100%);
  --danger-gradient: linear-gradient(135deg, #ff5252 0%, #ff1744 100%);

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
}

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

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

/* LOGIN SCREEN */
.login {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 30%, #151d30 0%, var(--bg-dark) 70%);
  z-index: 100;
}

.login-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.mark {
  font-size: 28px;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.mark-name {
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 1px;
}

.mark-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.login-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 4px;
}

.login-lede {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 20px;
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.field input {
  width: 100%;
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 14px;
  transition: border-color 0.2s;
}

.field input:focus {
  outline: none;
  border-color: var(--accent-cyan);
}

.input-affix {
  position: relative;
}

.affix-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  border: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary {
  background: var(--accent-btn-gradient);
  color: #000;
  box-shadow: 0 4px 20px rgba(0, 230, 118, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 25px rgba(0, 230, 118, 0.4);
}

.btn-danger {
  background: var(--danger-gradient);
  color: #fff;
  box-shadow: 0 4px 20px rgba(255, 82, 82, 0.3);
}

.btn-danger:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 25px rgba(255, 82, 82, 0.4);
}

.btn-block {
  width: 100%;
}

.btn-quiet {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

.btn-quiet:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* HEADER BAR */
.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: rgba(10, 14, 23, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 50;
}

.bar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.terminal-title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 1px;
}

.ident-sub {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.text-neon {
  color: var(--text-neon) !important;
  font-weight: 700;
}

.bar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chip {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
}

.chip-neon {
  background: rgba(0, 242, 254, 0.1);
  color: var(--accent-cyan);
  border-color: var(--border-neon);
}

.chip-dot {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-success);
}

.pulse {
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.2); }
  100% { opacity: 1; transform: scale(1); }
}

/* HERO ACTION & CONFIG PANEL */
.hero-panel {
  padding: 24px;
  max-width: 1400px;
  margin: 0 auto;
}

.actions-sniper {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.btn-sniper-toggle {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 28px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(0, 230, 118, 0.15) 0%, rgba(0, 176, 255, 0.15) 100%);
  border: 1px solid var(--text-success);
  color: #fff;
  cursor: pointer;
  text-align: left;
  transition: all 0.3s;
  box-shadow: 0 8px 30px rgba(0, 230, 118, 0.15);
}

.btn-sniper-toggle.active {
  background: linear-gradient(135deg, rgba(0, 230, 118, 0.25) 0%, rgba(0, 176, 255, 0.25) 100%);
  box-shadow: 0 10px 40px rgba(0, 230, 118, 0.3);
}

.act-icon {
  font-size: 32px;
}

.act-text b {
  display: block;
  font-size: 18px;
  font-weight: 700;
}

.act-text i {
  font-style: normal;
  font-size: 13px;
  color: var(--text-muted);
}

.config-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.config-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  backdrop-filter: blur(12px);
}

.config-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.config-value-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.config-value-wrap input[type="range"] {
  flex: 1;
  accent-color: var(--accent-cyan);
}

.config-val {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 16px;
  color: var(--text-neon);
}

.config-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}

.config-pill-grid {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.chip-metric {
  background: rgba(255, 255, 255, 0.05);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  border: 1px solid var(--border-color);
}

.wallet-balance {
  font-size: 22px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-success);
}

/* MAIN CONTENT WRAPPER */
.wrap {
  padding: 0 24px 40px;
  max-width: 1400px;
  margin: 0 auto;
}

.panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 24px;
  backdrop-filter: blur(12px);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.panel-head h2 {
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge-count {
  background: var(--accent-cyan);
  color: #000;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
}

.dim {
  color: var(--text-muted);
  font-size: 13px;
}

.live-pill {
  background: rgba(255, 82, 82, 0.2);
  color: var(--text-danger);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
}

/* ACTIVE POSITIONS GRID */
.positions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.empty-positions {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-md);
  border: 1px dashed var(--border-color);
}

.empty-positions .icon {
  font-size: 36px;
  display: block;
  margin-bottom: 8px;
}

.empty-positions p {
  font-weight: 600;
  margin-bottom: 4px;
}

.empty-positions .sub {
  color: var(--text-muted);
  font-size: 13px;
}

.position-card {
  background: rgba(20, 30, 50, 0.6);
  border: 1px solid var(--border-neon);
  border-radius: var(--radius-md);
  padding: 16px;
  position: relative;
  overflow: hidden;
}

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

.pos-mint {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 14px;
  color: #fff;
}

.pos-pnl {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 16px;
}

.pos-pnl.positive { color: var(--text-success); }
.pos-pnl.negative { color: var(--text-danger); }

.pos-timer-bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 12px;
}

.pos-timer-fill {
  height: 100%;
  background: var(--accent-cyan);
  width: 100%;
  transition: width 0.1s linear;
}

.pos-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  font-size: 12px;
  margin-bottom: 12px;
}

.pos-metrics div span {
  color: var(--text-muted);
  display: block;
}

.pos-metrics div b {
  font-family: var(--font-mono);
}

/* TABLES */
.split {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.tbl th {
  text-align: left;
  padding: 10px 12px;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
}

.tbl td {
  padding: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

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

.status-tag {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
}

.status-tag.sniped {
  background: rgba(0, 230, 118, 0.2);
  color: var(--text-success);
}

.status-tag.skipped {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
}

.scroll.tall {
  max-height: 400px;
  overflow-y: auto;
}

/* STATS LIST */
.stats-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 14px;
}

.strategy-note {
  background: rgba(0, 242, 254, 0.05);
  border: 1px solid var(--border-neon);
  border-radius: var(--radius-md);
  padding: 14px;
  font-size: 12px;
  color: var(--text-muted);
}

.strategy-note h3 {
  color: var(--accent-cyan);
  font-size: 13px;
  margin-bottom: 6px;
}

.empty.static {
  text-align: center;
  padding: 30px;
  color: var(--text-muted);
}

/* TOASTS */
.toasts {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 200;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--accent-cyan);
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: 13px;
  animation: slideIn 0.3s forwards;
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
