:root {
  color-scheme: dark;
  --bg-base: #05070f;
  --bg-surface: #0b0f1e;
  --bg-panel: rgba(13, 18, 35, 0.92);
  --border: rgba(255,255,255,0.07);
  --border-bright: rgba(255,255,255,0.12);
  --text-primary: #e8edf8;
  --text-secondary: #8892a4;
  --text-muted: #4d5668;
  --indigo: #6366f1;
  --indigo-soft: rgba(99,102,241,0.15);
  --indigo-glow: rgba(99,102,241,0.08);
  --emerald: #10b981;
  --emerald-soft: rgba(16,185,129,0.12);
  --amber: #f59e0b;
  --amber-soft: rgba(245,158,11,0.12);
  --rose: #f43f5e;
  --rose-soft: rgba(244,63,94,0.12);
  --cyan: #06b6d4;
  --cyan-soft: rgba(6,182,212,0.10);
  --radius-sm: 0.75rem;
  --radius-md: 1rem;
  --radius-lg: 1.35rem;
  --radius-xl: 1.75rem;
}

* { box-sizing: border-box; }

body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: var(--text-primary);
  background: var(--bg-base);
}

/* ─── GRID OVERLAY ─── */
.grid-overlay {
  background-image:
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse 100% 60% at 50% 0%, black 40%, transparent 100%);
}

/* ─── GLASS PANELS ─── */
.glass {
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: var(--bg-panel);
  backdrop-filter: blur(24px) saturate(1.4);
  box-shadow: 0 1px 0 rgba(255,255,255,0.04) inset, 0 20px 60px rgba(0,0,0,0.3);
  position: relative;
  overflow: hidden;
}

.glass::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255,255,255,0.04) 0%, transparent 60%);
  pointer-events: none;
}

.glass-soft {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: rgba(255,255,255,.025);
  backdrop-filter: blur(12px);
}

/* ─── STAT CARDS ─── */
.stat-card {
  min-width: 130px;
  border-radius: var(--radius-md);
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
  position: relative;
  overflow: hidden;
  transition: border-color .2s ease, background .2s ease;
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
}

.stat-card span {
  display: block;
  color: var(--text-muted);
  font-size: .68rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  font-weight: 600;
}

.stat-card strong {
  display: block;
  margin-top: .4rem;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -.02em;
}

/* ─── CATEGORY CARDS ─── */
.category-card {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  border-radius: var(--radius-lg);
  padding: 1.35rem 1.5rem;
  text-align: left;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.025);
  cursor: pointer;
  transition: all .25s ease;
  position: relative;
  overflow: hidden;
}

.category-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.03) 0%, transparent 70%);
  opacity: 0;
  transition: opacity .25s ease;
}

.category-card:hover::before { opacity: 1; }
.category-card:hover { border-color: var(--border-bright); background: rgba(255,255,255,0.04); }

.category-card.active {
  border-color: rgba(99,102,241,0.35);
  background: rgba(99,102,241,0.07);
  box-shadow: 0 0 0 1px rgba(99,102,241,0.12) inset, 0 0 40px rgba(99,102,241,0.08);
}

/* ─── CHIPS ─── */
.chip {
  width: fit-content;
  border-radius: 999px;
  padding: .28rem .7rem;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

/* ─── FIELD CARDS ─── */
.field-card {
  display: block;
  border-radius: var(--radius-md);
  padding: 1rem;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
  transition: border-color .2s ease;
}

.field-card:focus-within {
  border-color: rgba(99,102,241,0.3);
  background: rgba(99,102,241,0.03);
}

.field-label {
  display: block;
  margin-bottom: .5rem;
  font-size: .78rem;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: .04em;
  text-transform: uppercase;
}

.field-input {
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(5, 7, 15, 0.7);
  color: var(--text-primary);
  outline: none;
  padding: .8rem 1rem;
  font-size: .92rem;
  transition: all .2s ease;
  font-family: inherit;
}

.field-input:focus {
  border-color: rgba(99,102,241,0.5);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
  background: rgba(5, 7, 15, 0.9);
}

.field-input.locked {
  color: rgba(165,180,252,0.8);
  border-color: rgba(99,102,241,0.18);
  background: rgba(79,70,229,0.08);
  cursor: default;
}

.field-help {
  display: block;
  margin-top: .5rem;
  font-size: .73rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ─── MINI CARDS ─── */
.mini-card {
  border-radius: var(--radius-md);
  padding: .9rem 1rem;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
}

.mini-card dt {
  color: var(--text-muted);
  font-size: .68rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: .35rem;
}

.mini-card dd {
  font-size: .9rem;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text-primary);
}

.mini-strategy {
  border-radius: var(--radius-md);
  padding: .9rem 1rem;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
  color: var(--text-secondary);
  font-size: .85rem;
  line-height: 1.65;
}

/* ─── OFFER BADGES ─── */
.offer-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: .28rem .65rem;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.offer-badge.ignored  { background: rgba(244,63,94,.1);   color: rgb(253,164,175); border: 1px solid rgba(244,63,94,.2); }
.offer-badge.market   { background: rgba(245,158,11,.1);  color: rgb(252,211,77);  border: 1px solid rgba(245,158,11,.2); }
.offer-badge.base     { background: rgba(16,185,129,.1);  color: rgb(110,231,183); border: 1px solid rgba(16,185,129,.2); }
.offer-badge.target   { background: rgba(99,102,241,.12); color: rgb(165,180,252); border: 1px solid rgba(99,102,241,.22); }
.offer-badge.target-lowest { background: rgba(6,182,212,.1); color: rgb(103,232,249); border: 1px solid rgba(6,182,212,.2); }
.offer-badge.valid    { background: rgba(255,255,255,.05); color: var(--text-secondary); border: 1px solid var(--border); }

/* ─── TOGGLE BUTTON ─── */
.toggle-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  width: 90px;
  min-width: 90px;
  height: 46px;
  border-radius: 999px;
  border: 1px solid var(--border-bright);
  background: rgba(255,255,255,.04);
  padding: 0 14px;
  color: var(--text-secondary);
  font-weight: 800;
  font-size: .72rem;
  letter-spacing: .08em;
  transition: all .28s ease;
  cursor: pointer;
}

.toggle-btn.on {
  background: linear-gradient(135deg, rgba(16,185,129,.85), rgba(5,150,105,.9));
  border-color: rgba(16,185,129,.3);
  color: #ecfdf5;
  box-shadow: 0 0 20px rgba(16,185,129,.2);
}

.toggle-btn.off {
  background: rgba(244,63,94,.08);
  border-color: rgba(244,63,94,.15);
  color: rgba(244,63,94,.7);
}

.toggle-knob {
  position: absolute;
  left: 5px;
  top: 5px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 2px 8px rgba(0,0,0,.3), 0 1px 0 rgba(255,255,255,.8) inset;
  transition: transform .28s cubic-bezier(.34,1.56,.64,1);
}

.toggle-btn.on .toggle-knob { transform: translateX(44px); }

/* ─── API STATUS BADGE ─── */
.api-status-bar {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
  padding: .85rem 1.2rem;
  display: flex;
  align-items: center;
  gap: .75rem;
  font-size: .82rem;
}

.api-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--text-muted);
}
.api-status-dot.ok      { background: var(--emerald); box-shadow: 0 0 8px rgba(16,185,129,.5); }
.api-status-dot.warning { background: var(--amber);   box-shadow: 0 0 8px rgba(245,158,11,.5); }
.api-status-dot.error   { background: var(--rose);    box-shadow: 0 0 8px rgba(244,63,94,.5);  }
.api-status-dot.loading { background: var(--cyan);    animation: pulse-dot 1.4s ease-in-out infinite; }

@keyframes pulse-dot {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px rgba(6,182,212,.5); }
  50%       { opacity: .4; box-shadow: 0 0 3px rgba(6,182,212,.2); }
}

/* ─── SIDEBAR NAV BAR ─── */
.sidebar-nav {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 64px;
  background: rgba(5, 7, 15, 0.95);
  border-right: 1px solid var(--border);
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.25rem 0;
  gap: .5rem;
  z-index: 40;
}

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.18); }

/* ─── TABLE ─── */
.offers-table th {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: .75rem 1rem .75rem 0;
  border-bottom: 1px solid var(--border);
}
.offers-table td {
  padding: .9rem 1rem .9rem 0;
  border-bottom: 1px solid rgba(255,255,255,.03);
  font-size: .88rem;
}
.offers-table tr:hover td { background: rgba(255,255,255,.015); }
.offers-table tr:last-child td { border-bottom: none; }

/* ─── RESPONSIVE ─── */
@media (max-width: 640px) {
  .stat-card { min-width: 100%; }
}

/* ─── API STATUS BOX (per-panel) ─── */
.api-status-box-ok {
  border-color: rgba(16,185,129,.2);
  background: rgba(16,185,129,.05);
}
.api-status-box-warning {
  border-color: rgba(245,158,11,.2);
  background: rgba(245,158,11,.05);
}
.api-status-box-error {
  border-color: rgba(244,63,94,.2);
  background: rgba(244,63,94,.05);
}
.api-status-box-idle {
  border-color: rgba(255,255,255,.06);
  background: rgba(255,255,255,.02);
}

/* ── SHARED SUITE NAVBAR (IGV) ── */
.suite-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 52px;
  z-index: 100;
  background: rgba(5,7,15,.92);
  border-bottom: 1px solid rgba(255,255,255,.06);
  backdrop-filter: blur(20px) saturate(1.5);
}
.suite-nav-inner {
  max-width: 1600px; margin: 0 auto; height: 100%;
  padding: 0 1.25rem;
  display: flex; align-items: center; gap: 1rem;
}
.suite-brand { display:flex; align-items:center; gap:.6rem; text-decoration:none; flex-shrink:0; }
.suite-brand-icon { width:28px; height:28px; border-radius:.5rem; background:linear-gradient(135deg,#38bdf8,#a78bfa); display:flex; align-items:center; justify-content:center; color:white; flex-shrink:0; }
.suite-brand-label { font-size:.72rem; font-weight:700; letter-spacing:.1em; text-transform:uppercase; color:#4d5668; }
.suite-switcher { display:flex; align-items:center; gap:.25rem; background:rgba(255,255,255,.04); border:1px solid rgba(255,255,255,.07); border-radius:999px; padding:.2rem; margin-left:.5rem; }
.suite-app-btn { display:flex; align-items:center; gap:.4rem; padding:.3rem .75rem; border-radius:999px; text-decoration:none; font-size:.78rem; font-weight:600; color:#4d5668; transition:all .2s ease; }
.suite-app-btn:hover { color:#e8edf8; background:rgba(255,255,255,.05); }
.suite-app-btn.active { color:white; background:rgba(255,255,255,.09); }
.suite-app-icon { font-size:.85rem; }
.suite-app-active-dot { width:5px; height:5px; border-radius:50%; background:#38bdf8; box-shadow:0 0 6px #38bdf8; flex-shrink:0; }
.suite-app-btn.active .igv-icon ~ .suite-app-active-dot { background:#818cf8; box-shadow:0 0 6px #818cf8; }
.suite-app-btn.active .eldorado-icon ~ .suite-app-active-dot { background:#fbbf24; box-shadow:0 0 6px #fbbf24; }
.suite-user { margin-left:auto; display:flex; align-items:center; gap:.75rem; }
.suite-username { font-size:.75rem; font-weight:600; color:#4d5668; }
.suite-logout-btn { display:flex; align-items:center; gap:.4rem; padding:.35rem .75rem; border-radius:.6rem; border:1px solid rgba(255,255,255,.07); background:rgba(255,255,255,.04); color:#4d5668; font-size:.75rem; font-weight:600; cursor:pointer; transition:all .2s; font-family:inherit; }
.suite-logout-btn:hover { background:rgba(255,255,255,.08); color:#e8edf8; }

/* ─────────────────────────────────────────────────────────────────────────
   LIVE ACTIVITY LOG  (shared styling for the bot action feed)
   ───────────────────────────────────────────────────────────────────────── */
.act-panel-head { display:flex; align-items:center; justify-content:space-between; gap:.75rem; margin-bottom:1rem; }
.act-pulse { display:inline-flex; align-items:center; gap:.45rem; font-size:.7rem; font-weight:700; letter-spacing:.14em; text-transform:uppercase; color:#94a3b8; }
.act-pulse-dot { width:.5rem; height:.5rem; border-radius:999px; background:#10b981; box-shadow:0 0 0 0 rgba(16,185,129,.6); }
.act-pulse.act-pulse-live .act-pulse-dot { animation: actPulse 1.4s ease-out; }
@keyframes actPulse { 0%{ box-shadow:0 0 0 0 rgba(16,185,129,.55);} 100%{ box-shadow:0 0 0 8px rgba(16,185,129,0);} }

.act-feed { display:flex; flex-direction:column; gap:.5rem; max-height:460px; overflow-y:auto; padding-right:.35rem; }
.act-feed::-webkit-scrollbar { width:8px; }
.act-feed::-webkit-scrollbar-thumb { background:rgba(255,255,255,.12); border-radius:999px; }

.act-row { display:flex; gap:.65rem; align-items:flex-start; border-radius:.85rem; border:1px solid rgba(255,255,255,.07); background:rgba(255,255,255,.035); padding:.6rem .75rem; }
.act-row .act-dot { width:.55rem; height:.55rem; margin-top:.3rem; border-radius:999px; flex-shrink:0; background:#64748b; }
.act-row.act-ok .act-dot    { background:#10b981; box-shadow:0 0 8px rgba(16,185,129,.5); }
.act-row.act-warn .act-dot  { background:#f59e0b; box-shadow:0 0 8px rgba(245,158,11,.5); }
.act-row.act-error .act-dot { background:#f43f5e; box-shadow:0 0 8px rgba(244,63,94,.5); }
.act-row.act-skip .act-dot  { background:#64748b; }
.act-row.act-info .act-dot  { background:#38bdf8; box-shadow:0 0 8px rgba(56,189,248,.45); }

.act-body { min-width:0; flex:1; }
.act-line { display:flex; align-items:center; justify-content:space-between; gap:.5rem; }
.act-label { font-size:.85rem; font-weight:600; color:#e2e8f0; }
.act-badge { font-size:.6rem; font-weight:800; letter-spacing:.08em; padding:.12rem .4rem; border-radius:999px; flex-shrink:0; }
.act-badge.act-ok    { background:rgba(16,185,129,.14); color:#6ee7b7; }
.act-badge.act-warn  { background:rgba(245,158,11,.14); color:#fcd34d; }
.act-badge.act-error { background:rgba(244,63,94,.14); color:#fda4af; }
.act-badge.act-skip  { background:rgba(255,255,255,.08); color:#cbd5e1; }
.act-badge.act-info  { background:rgba(56,189,248,.14); color:#7dd3fc; }
.act-note { margin-top:.25rem; font-size:.76rem; line-height:1.45; color:#94a3b8; word-break:break-word; }
.act-meta { margin-top:.3rem; display:flex; align-items:center; justify-content:space-between; gap:.5rem; }
.act-action { font-size:.66rem; font-family:ui-monospace,SFMono-Regular,Menlo,monospace; color:#64748b; }
.act-time { font-size:.68rem; color:#64748b; flex-shrink:0; }
.act-empty { padding:1.25rem; text-align:center; font-size:.8rem; color:#64748b; border:1px dashed rgba(255,255,255,.1); border-radius:.85rem; }

.act-profile { border:1px solid rgba(255,255,255,.08); border-radius:1rem; background:rgba(255,255,255,.025); padding:.6rem .65rem; margin-bottom:.6rem; }
.act-profile-head { display:flex; align-items:center; justify-content:space-between; gap:.5rem; padding:.15rem .25rem .5rem; border-bottom:1px solid rgba(255,255,255,.06); margin-bottom:.5rem; }
.act-profile-name { font-size:.82rem; font-weight:700; color:#fcd34d; }
.act-profile-count { font-size:.66rem; font-weight:600; color:#64748b; }
.act-profile-events { display:flex; flex-direction:column; gap:.4rem; }
