:root {
  --bg: #07090c;
  --bg-elev: #0e1218;
  --bg-panel: #121821;
  --line: rgba(255, 255, 255, 0.07);
  --text: #e8edf5;
  --muted: #8b97a8;
  --green: #3dde9a;
  --green-dim: rgba(61, 222, 154, 0.14);
  --red: #ff5d6c;
  --red-dim: rgba(255, 93, 108, 0.14);
  --accent: #6ec8ff;
  --accent-dim: rgba(110, 200, 255, 0.12);
  --warn: #f0c35a;
  --radius: 16px;
  --font: "Syne", "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(110, 200, 255, 0.08), transparent 55%),
    radial-gradient(900px 500px at 90% 0%, rgba(61, 222, 154, 0.06), transparent 50%),
    linear-gradient(180deg, #0a0d12 0%, var(--bg) 40%, #06080b 100%);
  background-attachment: fixed;
}

a { color: inherit; text-decoration: none; }
button, input, select {
  font: inherit;
  color: inherit;
}

.app-shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px 20px 64px;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  animation: rise 0.6s ease both;
}
.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.brand-mark {
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.04em;
}
.brand-mark span { color: var(--accent); }
.brand-sub {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.nav-links {
  display: flex;
  gap: 8px;
}
.nav-links a {
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--muted);
  border: 1px solid transparent;
  transition: 0.2s ease;
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
  border-color: var(--line);
  background: rgba(255,255,255,0.03);
}

.hero-line {
  margin: 0 0 22px;
  max-width: 42rem;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.5;
  animation: rise 0.7s 0.05s ease both;
}

.panel {
  background: linear-gradient(180deg, rgba(255,255,255,0.03), transparent 40%), var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}

.grid-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
@media (max-width: 980px) {
  .grid-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .grid-kpis { grid-template-columns: 1fr; }
}

.kpi {
  position: relative;
  overflow: hidden;
  padding: 16px;
  animation: rise 0.55s ease both;
}
.kpi:nth-child(2) { animation-delay: 0.05s; }
.kpi:nth-child(3) { animation-delay: 0.1s; }
.kpi:nth-child(4) { animation-delay: 0.15s; }
.kpi:nth-child(5) { animation-delay: 0.2s; }
.kpi-label {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.kpi-value {
  font-family: var(--mono);
  font-size: 1.55rem;
  font-weight: 600;
  letter-spacing: -0.03em;
}
.kpi-meta {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.82rem;
}
.pos { color: var(--green); }
.neg { color: var(--red); }

.gauge {
  margin-top: 12px;
  height: 6px;
  border-radius: 99px;
  background: rgba(255,255,255,0.06);
  overflow: hidden;
}
.gauge > i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--green));
  transform-origin: left;
  animation: grow 0.8s ease both;
}

.layout-2 {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 14px;
}
.cal-split {
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 12px;
}
@media (max-width: 900px) {
  .layout-2 { grid-template-columns: 1fr; }
  .cal-split { grid-template-columns: 1fr; }
}

.side-stack { display: grid; gap: 12px; }
.stat-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
}
.stat-row:last-child { border-bottom: 0; }
.stat-row span { color: var(--muted); }
.stat-row strong { font-family: var(--mono); font-weight: 500; }

.profit-hero {
  margin-top: 8px;
  padding: 18px;
  border-radius: 14px;
  background: var(--red-dim);
  border: 1px solid rgba(255,93,108,0.25);
  text-align: center;
}
.profit-hero.good {
  background: var(--green-dim);
  border-color: rgba(61,222,154,0.25);
}
.profit-hero .label { color: var(--muted); font-size: 0.8rem; text-transform: uppercase; }
.profit-hero .value {
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 2rem;
  font-weight: 700;
}

.calendar-wrap { overflow: auto; }
.cal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.cal-head h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(88px, 1fr));
  gap: 8px;
  min-width: 680px;
}
.cal-dow {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-align: center;
}
.cal-cell {
  min-height: 86px;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.02);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.cal-cell:hover { transform: translateY(-1px); border-color: rgba(255,255,255,0.14); }
.cal-cell.empty { opacity: 0.35; }
.cal-cell.up { background: rgba(61,222,154,0.08); border-color: rgba(61,222,154,0.18); }
.cal-cell.down { background: rgba(255,93,108,0.08); border-color: rgba(255,93,108,0.18); }
.cal-day { color: var(--muted); font-size: 0.75rem; }
.cal-pnl {
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 0.86rem;
  font-weight: 600;
}
.cal-sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.35;
}

.charts {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 14px;
  margin-top: 14px;
}
@media (max-width: 900px) {
  .charts { grid-template-columns: 1fr; }
}
.chart-box {
  height: 260px;
  position: relative;
}

.form-grid {
  display: grid;
  grid-template-columns: 1.6fr repeat(4, minmax(0, 1fr)) auto;
  gap: 10px;
  align-items: end;
}
@media (max-width: 1100px) {
  .form-grid { grid-template-columns: 1fr 1fr; }
}
.field label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.field input, .field select {
  width: 100%;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  outline: none;
}
.field input:focus {
  border-color: rgba(110,200,255,0.45);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.btn {
  appearance: none;
  border: 0;
  border-radius: 12px;
  padding: 12px 18px;
  background: linear-gradient(135deg, #7ad0ff, #3dde9a);
  color: #061018;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.05); }
.btn:disabled { opacity: 0.55; cursor: wait; transform: none; }
.btn-ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
}

.table-wrap { overflow: auto; margin-top: 16px; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
th, td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}
th {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}
td.mono { font-family: var(--mono); }
tr.clickable { cursor: pointer; transition: background 0.15s ease; }
tr.clickable:hover { background: rgba(255,255,255,0.03); }

.wallet-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  animation: rise 0.55s ease both;
}
.wallet-addr {
  font-family: var(--mono);
  font-size: 0.95rem;
  word-break: break-all;
}
.search-inline {
  display: flex;
  gap: 8px;
  flex: 1;
  min-width: 240px;
  max-width: 520px;
}
.search-inline input { flex: 1; }

.status {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.9rem;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 0.75rem;
}
.hidden { display: none !important; }
a.wallet-link { color: var(--accent); }

.seg {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: var(--bg-elev);
}
.seg-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 8px 14px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
}
.seg-btn.active {
  background: rgba(110,200,255,0.16);
  color: var(--text);
}
.field-select {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
}
.history-table td, .history-table th { vertical-align: top; }
.pool-cell .pair {
  font-weight: 700;
  letter-spacing: -0.01em;
}
.pool-cell .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.tag {
  font-size: 0.68rem;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: rgba(255,255,255,0.03);
}
.tag.dlmm { color: var(--accent); border-color: rgba(110,200,255,0.35); }
.pool-cell .addr {
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
}
.pnl-stack { display: grid; gap: 2px; }
.pnl-stack .pct { font-family: var(--mono); font-weight: 600; }
.pnl-stack .usd { font-family: var(--mono); font-size: 0.82rem; opacity: 0.9; }
.time-stack { display: grid; gap: 2px; }
.time-stack .rel { color: var(--muted); font-size: 0.75rem; }
.pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.85rem;
}
.pager .pager-btns { display: flex; gap: 8px; }

.bt-summary-card {
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid rgba(61, 222, 154, 0.22);
  background: linear-gradient(135deg, rgba(61,222,154,0.10), rgba(110,200,255,0.06));
}
.bt-summary-title {
  font-weight: 700;
  margin-bottom: 6px;
}
.bt-summary-line {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}
.bt-summary-big {
  margin: 10px 0;
  font-family: var(--mono);
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.check-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 0.88rem;
  text-transform: none;
  letter-spacing: 0;
  cursor: pointer;
}
.check-label input { width: auto; }
.field-hint {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.3;
}
.tag.ok {
  color: var(--green);
  border-color: rgba(61,222,154,0.35);
}
.tag.warn {
  color: var(--warn);
  border-color: rgba(240,195,90,0.35);
}
.token-list {
  display: grid;
  gap: 8px;
  max-height: 280px;
  overflow: auto;
}
.token-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  padding: 10px;
  border-radius: 12px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--line);
  font-size: 0.86rem;
}
.token-item .pair { font-weight: 600; }
.token-item .meta { color: var(--muted); font-family: var(--mono); font-size: 0.78rem; }

.loading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.15);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes grow {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}
@keyframes spin { to { transform: rotate(360deg); } }
