/* ============================================================
   Bullseye ETH Trading Bot — shared styles
   Minimal, light, financial-app aesthetic
   ============================================================ */

:root {
  /* Type */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Surface */
  --bg: #fafaf9;
  --bg-elev: #ffffff;
  --bg-soft: #f4f4f2;
  --border: #e7e5e4;
  --border-strong: #d6d3d1;

  /* Text */
  --text: #1c1917;
  --text-muted: #57534e;
  --text-subtle: #78716c;

  /* Brand / accents */
  --brand: #c81d25;            /* bullseye red */
  --brand-deep: #a01820;
  --accent: #0f172a;           /* navy ink */

  /* Semantic */
  --green: #15803d;
  --green-soft: #dcfce7;
  --red: #b91c1c;
  --red-soft: #fee2e2;
  --amber: #b45309;
  --amber-soft: #fef3c7;
  --amber-border: #f59e0b;
  --blue: #1d4ed8;
  --blue-soft: #dbeafe;

  /* Geometry */
  --radius: 10px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
}

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

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-feature-settings: "cv11", "ss01", "ss03";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
}

/* ---------- Paper trading banner ---------- */
.paper-banner {
  background: var(--amber-soft);
  border-bottom: 1px solid var(--amber-border);
  color: var(--amber);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: center;
  padding: 8px 16px;
}
.paper-banner strong { font-weight: 700; }
.paper-banner .sep { opacity: 0.5; margin: 0 10px; }

/* ---------- Header ---------- */
.app-header {
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
}
.app-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: inherit;
}
.brand img { height: 44px; width: auto; display: block; }
.brand-text h1 {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.1;
}
.brand-text .sub {
  font-size: 0.78rem;
  color: var(--text-subtle);
  font-weight: 500;
  margin-top: 2px;
}
.header-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.82rem;
}
.eth-price {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
}
.eth-price .label {
  color: var(--text-subtle);
  font-weight: 500;
  margin-right: 6px;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ---------- Nav ---------- */
.nav {
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  gap: 4px;
}
.nav a {
  display: inline-block;
  padding: 12px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-subtle);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.nav a:hover { color: var(--text); }
.nav a.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
}

/* ---------- Layout ---------- */
.content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 24px 56px;
}
.page-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.page-title h2 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.page-title .desc {
  color: var(--text-subtle);
  font-size: 0.85rem;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}
.btn-primary:hover { background: #1e293b; }
.btn-secondary {
  background: var(--bg-elev);
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-secondary:hover { background: var(--bg-soft); }
.btn-brand {
  background: var(--brand);
  color: #ffffff;
  border-color: var(--brand);
}
.btn-brand:hover { background: var(--brand-deep); border-color: var(--brand-deep); }
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}
.btn-ghost:hover { color: var(--text); border-color: var(--border-strong); }

/* ---------- Cards ---------- */
.card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-header h3 {
  font-size: 0.9rem;
  font-weight: 600;
}
.card-body { padding: 18px; }

/* ---------- Stat tiles ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.stat {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}
.stat-label {
  color: var(--text-subtle);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  margin-bottom: 6px;
}
.stat-value {
  font-size: 1.45rem;
  font-weight: 700;
  font-feature-settings: "tnum";
  letter-spacing: -0.01em;
}

/* ---------- Bot list (homepage) ---------- */
.bot-list { display: flex; flex-direction: column; gap: 10px; }
.bot-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 16px 18px;
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  align-items: center;
  gap: 24px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.bot-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}
.bot-id { display: flex; align-items: center; gap: 12px; }
.bot-name {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.005em;
}
.bot-alloc {
  color: var(--text-subtle);
  font-size: 0.78rem;
  margin-top: 2px;
}
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid;
}
.tag-paper {
  color: var(--amber);
  background: var(--amber-soft);
  border-color: var(--amber-border);
}
.tag-live {
  color: var(--green);
  background: var(--green-soft);
  border-color: var(--green);
}
.tag-position-yes {
  color: var(--blue);
  background: var(--blue-soft);
  border-color: var(--blue);
}
.tag-position-no {
  color: var(--text-subtle);
  background: var(--bg-soft);
  border-color: var(--border-strong);
}
.bot-pl {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 700;
  font-feature-settings: "tnum";
  text-align: right;
  letter-spacing: -0.01em;
}
.bot-wl {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: right;
  font-feature-settings: "tnum";
}
.bot-wl .green { color: var(--green); font-weight: 600; }
.bot-wl .red { color: var(--red); font-weight: 600; }

.green { color: var(--green); }
.red { color: var(--red); }
.muted { color: var(--text-subtle); }

/* ---------- Tables ---------- */
.table-wrap {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.table thead th {
  text-align: left;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-subtle);
  font-weight: 600;
  padding: 12px 14px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
}
.table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-feature-settings: "tnum";
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--bg-soft); }
.num { font-family: var(--font-mono); }
.right { text-align: right; }

/* ---------- Action pills ---------- */
.action-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.action-buy { background: var(--green-soft); color: var(--green); }
.action-sell { background: var(--blue-soft); color: var(--blue); }
.action-stop { background: var(--red-soft); color: var(--red); }

/* ---------- Empty state ---------- */
.empty {
  text-align: center;
  padding: 48px 16px;
  color: var(--text-subtle);
  font-size: 0.9rem;
}

/* ---------- Modal ---------- */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal.active { display: flex; }
.modal-content {
  background: var(--bg-elev);
  border-radius: var(--radius);
  padding: 22px;
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 25px -5px rgba(15, 23, 42, 0.15);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.modal-title { font-size: 1.05rem; font-weight: 700; }
.close-btn {
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--text-subtle);
  line-height: 1;
}
.close-btn:hover { color: var(--text); }
.slider-group { margin: 14px 0; }
.slider-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 0.85rem;
  font-weight: 600;
}
.slider-label .num { color: var(--text-muted); }
input[type="range"] {
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  -webkit-appearance: none;
  appearance: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2px solid var(--bg-elev);
  box-shadow: 0 0 0 1px var(--accent);
}
input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2px solid var(--bg-elev);
  box-shadow: 0 0 0 1px var(--accent);
}
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.88rem;
  resize: vertical;
  background: var(--bg-elev);
  color: var(--text);
}
textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
.btn-group { display: flex; gap: 10px; margin-top: 16px; }
.btn-group .btn { flex: 1; }
.label-mini {
  color: var(--text-subtle);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  margin-bottom: 6px;
}

/* ---------- Back link ---------- */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-subtle);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 500;
  margin-bottom: 12px;
}
.back-link:hover { color: var(--text); }

/* ---------- Mobile ---------- */
@media (max-width: 720px) {
  .app-header-inner { flex-direction: column; align-items: flex-start; gap: 10px; }
  .bot-card { grid-template-columns: 1fr; gap: 12px; }
  .bot-pl, .bot-wl { text-align: left; }
  .nav-inner { overflow-x: auto; }
}

