/* Bayed design system - a self-contained, modern dark theme. */
:root {
  --bg: #0a0e14;
  --bg-grid: #0d131c;
  --surface: #111824;
  --surface-2: #161f2e;
  --elevated: #1b2636;
  --border: #243143;
  --border-soft: #1b2434;
  --text: #e8eef6;
  --muted: #8ba0b6;
  --muted-2: #5f7289;
  --primary: #5b8cff;
  --primary-2: #7aa2ff;
  --primary-ghost: rgba(91, 140, 255, 0.14);
  --accent: #34e0c4;
  --pos: #35d393;
  --neg: #ff6b6b;
  --warn: #ffbf5b;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --shadow-soft: 0 2px 10px rgba(0, 0, 0, 0.25);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: radial-gradient(1200px 600px at 80% -10%, #14203058, transparent 60%),
              radial-gradient(900px 500px at -10% 10%, #0f2a3a40, transparent 55%),
              var(--bg);
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -0.01em; }
small { color: var(--muted); }
[x-cloak] { display: none !important; }

/* ---------- brand ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 750; font-size: 18px; letter-spacing: -0.02em; color: var(--text); }
.brand .logo {
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: grid; place-items: center; color: #06121f; font-weight: 900; font-size: 17px;
  box-shadow: 0 6px 18px rgba(91, 140, 255, 0.35);
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  padding: 9px 15px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); font-weight: 600; font-size: 14px;
  cursor: pointer; transition: all 0.15s ease; white-space: nowrap;
}
.btn:hover { background: var(--elevated); border-color: #31425a; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--primary), #4f7ffb);
  border-color: transparent; color: #061225; box-shadow: 0 6px 16px rgba(91,140,255,0.3);
}
.btn-primary:hover { filter: brightness(1.07); background: linear-gradient(135deg, var(--primary), #4f7ffb); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-sm { padding: 6px 11px; font-size: 13px; }
.btn-danger { color: var(--neg); border-color: transparent; background: transparent; }
.btn-danger:hover { background: rgba(255,107,107,0.1); }

/* ---------- inputs ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12.5px; color: var(--muted); font-weight: 600; }
input, select {
  background: var(--bg-grid); border: 1px solid var(--border); color: var(--text);
  padding: 9px 12px; border-radius: var(--radius-sm); font-size: 14px; font-family: var(--font);
  transition: border 0.15s, box-shadow 0.15s; width: 100%;
}
input:focus, select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ghost); }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238ba0b6' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 30px; }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius); box-shadow: var(--shadow-soft); }
.card-pad { padding: 18px 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border-soft); }
.card-head h3 { font-size: 15px; }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.sidebar { background: #0b1017; border-right: 1px solid var(--border-soft); padding: 18px 14px; display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: 100vh; }
.sidebar .brand { padding: 6px 8px 18px; }
.nav-link { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: var(--radius-sm); color: var(--muted); font-weight: 600; font-size: 14px; transition: all 0.12s; }
.nav-link:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav-link.active { background: var(--primary-ghost); color: var(--primary-2); }
.nav-link svg { width: 18px; height: 18px; stroke-width: 2; }
.nav-spacer { flex: 1; }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 14px 28px; border-bottom: 1px solid var(--border-soft); position: sticky; top: 0; background: rgba(10,14,20,0.8); backdrop-filter: blur(10px); z-index: 20; }
.topbar h1 { font-size: 18px; }
.content { padding: 24px 28px 60px; max-width: 1180px; width: 100%; }

.userchip { display: inline-flex; align-items: center; gap: 9px; padding: 5px 7px 5px 12px; border: 1px solid var(--border-soft); border-radius: 999px; background: var(--surface); font-size: 13px; }
.avatar { width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--accent)); color: #06121f; display: grid; place-items: center; font-weight: 700; font-size: 12px; }

/* bell */
.bell { position: relative; }
.bell .dot { position: absolute; top: -3px; right: -3px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--neg); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; }

/* ---------- stat tiles ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.stat { background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 16px 18px; }
.stat .k { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.stat .v { font-size: 26px; font-weight: 750; margin-top: 6px; letter-spacing: -0.02em; }
.stat .sub { font-size: 12.5px; color: var(--muted-2); margin-top: 2px; }
.stat.accent .v { color: var(--accent); }
.stat.pos .v { color: var(--pos); }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border-soft); }
.badge.pos { color: var(--pos); background: rgba(53,211,147,0.12); border-color: transparent; }
.badge.neg { color: var(--neg); background: rgba(255,107,107,0.12); border-color: transparent; }
.badge.warn { color: var(--warn); background: rgba(255,191,91,0.12); border-color: transparent; }
.badge.info { color: var(--primary-2); background: var(--primary-ghost); border-color: transparent; }

/* ---------- tables ---------- */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.03em; padding: 10px 14px; border-bottom: 1px solid var(--border-soft); }
tbody td { padding: 11px 14px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
tbody tr:hover { background: var(--surface-2); }
.thumb { width: 42px; height: 42px; border-radius: 8px; object-fit: cover; background: var(--surface-2); border: 1px solid var(--border-soft); }
.price { font-variant-numeric: tabular-nums; font-weight: 650; }

/* ---------- charts ---------- */
.chartbox { padding: 10px 6px 4px; }
.uplot { font-family: var(--font) !important; }
.u-legend { color: var(--muted); font-size: 12px; }

/* ---------- histogram (css bars) ---------- */
.hist { display: flex; align-items: flex-end; gap: 4px; height: 120px; padding: 6px 2px 0; }
.hist .bar { flex: 1; background: linear-gradient(180deg, var(--primary), #3a63c7); border-radius: 4px 4px 0 0; min-height: 2px; position: relative; opacity: 0.9; }
.hist .bar:hover { opacity: 1; }

/* ---------- misc ---------- */
.row { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.muted { color: var(--muted); }
.spacer { flex: 1; }
.mt { margin-top: 18px; }
.mt-sm { margin-top: 10px; }
.empty { text-align: center; color: var(--muted); padding: 48px 20px; }
.empty .big { font-size: 15px; color: var(--text); margin-bottom: 4px; font-weight: 600; }
.spinner { width: 18px; height: 18px; border: 2px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.list-reset { list-style: none; margin: 0; padding: 0; }

/* condition pills row */
.pills { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- landing ---------- */
.landing { max-width: 1060px; margin: 0 auto; padding: 0 24px; }
.lnav { display: flex; align-items: center; justify-content: space-between; padding: 22px 0; }
.hero { text-align: center; padding: 80px 0 48px; }
.hero h1 { font-size: 52px; line-height: 1.05; letter-spacing: -0.03em; }
.hero h1 .grad { background: linear-gradient(120deg, var(--primary-2), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { font-size: 18px; color: var(--muted); max-width: 620px; margin: 20px auto 30px; }
.chips { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 34px; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; padding: 30px 0 70px; }
.feature { background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 22px; }
.feature .ic { width: 38px; height: 38px; border-radius: 10px; background: var(--primary-ghost); color: var(--primary-2); display: grid; place-items: center; margin-bottom: 14px; }
.feature h3 { font-size: 16px; margin-bottom: 7px; }
.feature p { color: var(--muted); font-size: 13.5px; margin: 0; }
.footer { border-top: 1px solid var(--border-soft); padding: 26px 0; color: var(--muted-2); font-size: 13px; text-align: center; }

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; overflow-x: auto; }
  .nav-spacer { display: none; }
  .grid-2 { grid-template-columns: 1fr; }
  .hero h1 { font-size: 38px; }
}
