/*
 * Mewo — Personal Dashboard
 * Dark editorial, no AI slop.
 */

/* ─── Reset & Base ─── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg:       #08080e;
  --surface:  #111118;
  --surface2: #1a1a24;
  --border:   #252530;
  --text:     #e4e4ec;
  --muted:    #8888a0;
  --accent:   #a78bfa;
  --accent2:  #7c3aed;
  --green:    #4ade80;
  --red:      #f87171;
  --yellow:   #fbbf24;
  --radius:   8px;
  --radius-lg: 14px;
}

body {
  font-family: "Geist", "Geist Variable", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  padding: 24px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  max-width: 1200px;
  margin: 0 auto;
}

/* ─── Typography ─── */
h1 { font-size: 1.25em; color: var(--accent); font-weight: 600; letter-spacing: -0.01em; }
h2 { font-size: 1em; color: var(--muted); font-weight: 500; }
.update { font-size: 0.7em; color: var(--muted); margin-top: 2px; }

a { color: var(--accent); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--accent2); }

/* ─── Navigation ─── */
nav { display: flex; gap: 6px; margin: 16px 0; flex-wrap: wrap; }
nav a {
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.8em;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: all 0.2s;
}
nav a:hover, nav a.active {
  border-color: var(--accent);
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
}

/* ─── Stats Cards ─── */
.stats { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.stat, .card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  text-align: center;
  min-width: 72px;
  flex: 1;
  border: 1px solid var(--border);
}
.stat .num, .card .num { font-size: 1.3em; font-weight: 700; color: var(--text); }
.stat .label, .card .label { font-size: 0.65em; color: var(--muted); margin-top: 2px; text-transform: uppercase; letter-spacing: 0.03em; }
.card.win  { border-left: 3px solid var(--green); }
.card.loss { border-left: 3px solid var(--red); }
.card.neutral { border-left: 3px solid var(--accent); }

/* ─── Controls & Filters ─── */
.controls { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; align-items: center; }
.filters, .quick-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filters button, .qf-btn {
  padding: 5px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-size: 0.75em;
  transition: all 0.2s;
  white-space: nowrap;
}
.filters button:hover, .qf-btn:hover { border-color: var(--accent); color: var(--accent); }
.filters button.active, .qf-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  font-weight: 600;
}
.filters .clear {
  padding: 5px 12px; border: 1px solid var(--border); border-radius: 20px;
  background: var(--surface); color: var(--muted); cursor: pointer; font-size: 0.75em;
}
.filters .clear:hover { border-color: var(--red); color: var(--red); }
.filters .count { font-size: 0.7em; color: var(--muted); margin-left: auto; }
.search {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.75em;
  outline: none;
  min-width: 140px;
  transition: border-color 0.2s;
}
.search:focus { border-color: var(--accent); }
.search::placeholder { color: var(--muted); opacity: 0.6; }

/* ─── Date Inputs ─── */
.date-filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.filters label { font-size: 0.75em; color: var(--muted); }
.filters input[type="date"] {
  padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text); font-size: 0.75em; outline: none;
  color-scheme: dark;
}
.filters input[type="date"]:focus { border-color: var(--accent); }

/* ─── Tables ─── */
table { width: 100%; border-collapse: collapse; font-size: 0.78em; }
th {
  background: var(--surface2);
  padding: 8px 10px;
  text-align: left;
  color: var(--muted);
  font-weight: 500;
  position: sticky;
  top: 0;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}
th:hover { color: var(--text); }
th.sorted { color: var(--accent); }
th .arrow { font-size: 0.6em; margin-left: 3px; opacity: 0.4; }
th.sorted .arrow { opacity: 1; color: var(--accent); }
td { padding: 6px 10px; border-bottom: 1px solid var(--border); }
tr:hover { background: var(--surface); }
tr.hidden { display: none; }

/* right-aligned columns */
th.r, td.r { text-align: right; }
th:first-child, td:first-child { text-align: left; }

/* ─── Table Row Highlights ─── */
.deploy { background: color-mix(in srgb, var(--green) 5%, var(--bg)); }
.close  { background: color-mix(in srgb, var(--red) 5%, var(--bg)); }

/* ─── PnL Colors ─── */
.pnl_pos { color: var(--green); }
.pnl_neg { color: var(--red); }

/* ─── Badges ─── */
.badge {
  font-size: 0.65em;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ─── Back Link ─── */
.back { margin-bottom: 14px; }
.back a { color: var(--muted); font-size: 0.8em; }
.back a:hover { color: var(--accent); }

/* ─── Token Name ─── */
.name { font-size: 0.7em; color: var(--muted); margin-left: 4px; }
.desc { font-size: 0.7em; color: var(--muted); max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }

/* ─── Mobile ─── */
@media (max-width: 768px) {
  body { padding: 12px; }
  table { font-size: 0.65em; }
  th, td { padding: 4px 6px; }
  .desc { display: none; }
  nav a { padding: 5px 12px; font-size: 0.75em; }
  h1 { font-size: 1.1em; }
  .stats { gap: 6px; }
  .card { padding: 10px 12px; min-width: 60px; flex: 1 1 28%; }
  .card .num { font-size: 1.1em; }
}
