/* AUREA App — dashboard spec implementation (see
   ~/workspace/aurea-brand/ui-dashboard-spec.md). Mobile-first:
   bottom tab bar below 1024px, fixed sidebar at 1024px and up. */

:root {
  --bg: #0A0F1E;
  --bg-deep: #020616;
  --glass: rgba(18, 22, 38, 0.72);
  --glass-border: rgba(255, 255, 255, 0.08);
  --panel: #0F1423;
  --input: #0E1222;
  --gold: #FFD700;
  --violet: #8A2BE2;
  --text: #FFFFFF;
  --muted: #848388;
  --faint: #626066;
  --up: #02B589;
  --down: #E94D7A;
  --radius: 16px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Manrope", system-ui, -apple-system, "Hiragino Sans", sans-serif;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* Ambient ground */
.ambient {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(600px 300px at 50% -80px, rgba(255, 190, 0, 0.10), transparent 70%),
    radial-gradient(500px 500px at 110% 30%, rgba(138, 43, 226, 0.12), transparent 70%),
    radial-gradient(500px 500px at -10% 90%, rgba(138, 43, 226, 0.07), transparent 70%),
    var(--bg);
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ---------- Sidebar (desktop) ---------- */
.sidebar {
  display: none;
}
@media (min-width: 1024px) {
  .sidebar {
    display: flex; flex-direction: column;
    position: fixed; top: 0; left: 0; bottom: 0; width: 232px; z-index: 40;
    background: rgba(10, 15, 30, 0.88);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-right: 1px solid var(--glass-border);
    padding: 16px 12px; overflow-y: auto;
  }
}
.sb-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; }
.sb-brand img { width: 38px; height: 38px; }
.sb-brand .name { font-weight: 800; font-size: 19px; letter-spacing: 0.14em; color: var(--gold); line-height: 1; }
.sb-brand .sub { font-size: 10px; letter-spacing: 0.3em; color: var(--muted); margin-top: 3px; }
.sb-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--faint); padding: 14px 10px 6px; }
.sb-nav { display: flex; flex-direction: column; gap: 2px; }
.sb-item {
  display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 10px;
  border: none; background: transparent; color: var(--text); font-size: 14px; font-weight: 600;
  border-radius: 10px; text-align: left; width: 100%; position: relative;
}
.sb-item svg { width: 18px; height: 18px; flex: none; }
.sb-item:hover { background: rgba(255, 215, 0, 0.04); }
.sb-item.active { background: rgba(255, 215, 0, 0.10); color: var(--gold); }
.sb-item.active::before {
  content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 2px;
  background: var(--gold); border-radius: 2px;
}
.sb-link {
  display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 10px;
  font-size: 13.5px; font-weight: 600; color: var(--text); border-radius: 10px;
}
.sb-link:hover { background: rgba(255, 215, 0, 0.04); }
.sb-link.cta { color: var(--gold); }
.sb-link svg { width: 17px; height: 17px; flex: none; }
.sb-foot { margin-top: auto; padding: 14px 10px 4px; font-size: 12.5px; color: var(--muted); }
.sb-foot a { color: var(--muted); }
.sb-foot a:hover { color: var(--gold); }

/* ---------- Layout ---------- */
.main { padding-bottom: 96px; }
@media (min-width: 1024px) {
  .main { margin-left: 232px; padding-bottom: 32px; }
}
.wrap { max-width: 1100px; margin: 0 auto; padding: 20px 16px 8px; }
@media (min-width: 720px) { .wrap { padding: 24px 24px 8px; } }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30; height: 60px;
  display: flex; align-items: center; gap: 12px; padding: 0 16px;
  background: rgba(10, 15, 30, 0.82);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--glass-border);
}
.topbar .brand-mini { display: flex; align-items: center; gap: 9px; }
.topbar .brand-mini img { width: 30px; height: 30px; }
.topbar .brand-mini .name { font-weight: 800; letter-spacing: 0.14em; color: var(--gold); font-size: 16px; line-height: 1; }
.topbar .brand-mini .sub { font-size: 9px; letter-spacing: 0.3em; color: var(--muted); margin-top: 2px; }
@media (min-width: 1024px) { .topbar .brand-mini { display: none; } }
.topbar .view-title { font-size: 17px; font-weight: 800; display: none; }
@media (min-width: 1024px) { .topbar .view-title { display: block; } }
.topbar .spacer { flex: 1; }
.lang-select {
  background: var(--input); color: var(--text); border: 1px solid var(--glass-border);
  border-radius: 8px; height: 36px; padding: 0 8px; font-size: 13px; font-weight: 600;
}
.install-btn {
  display: none; align-items: center; gap: 7px; height: 38px; padding: 0 14px;
  background: var(--gold); color: #141828; border: none; border-radius: 8px;
  font-weight: 800; font-size: 13.5px;
}
.install-btn.show { display: inline-flex; }
.install-btn svg { width: 16px; height: 16px; }

/* ---------- Cards ---------- */
.card {
  background: var(--glass); border: 1px solid var(--glass-border); border-radius: var(--radius);
  padding: 18px; box-shadow: 0 18px 36px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.card + .card { margin-top: 16px; }
.section-title { font-size: 15px; font-weight: 800; margin: 26px 2px 12px; }
.section-title:first-child { margin-top: 4px; }

/* Price card */
.price-head { display: flex; align-items: center; gap: 12px; }
.price-head img { width: 44px; height: 44px; }
.price-head .pair { font-weight: 800; font-size: 16px; }
.price-head .pair small { display: block; font-weight: 600; font-size: 11.5px; color: var(--muted); letter-spacing: 0.06em; }
.price-value { font-size: 32px; font-weight: 800; margin-top: 12px; letter-spacing: -0.01em; }
.chip {
  display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px;
  font-size: 12.5px; font-weight: 700; margin-left: 10px; vertical-align: middle;
}
.chip.up { background: rgba(2, 181, 137, 0.14); color: var(--up); }
.chip.down { background: rgba(233, 77, 122, 0.14); color: var(--down); }
.chip.flat { background: rgba(255, 215, 0, 0.12); color: var(--gold); }
.price-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.price-stats .stat { background: var(--panel); border-radius: 12px; padding: 10px 12px; }
.price-stats .k { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--faint); }
.price-stats .v { font-size: 15.5px; font-weight: 700; margin-top: 3px; }
.price-note { font-size: 12px; color: var(--muted); margin-top: 12px; min-height: 15px; }

/* Campaign card */
.campaign { border-color: rgba(255, 215, 0, 0.35); position: relative; overflow: hidden; }
.campaign::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(420px 180px at 85% -40px, rgba(255, 215, 0, 0.14), transparent 70%);
}
.camp-badge {
  display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase;
  color: #141828; background: var(--gold); border-radius: 6px; padding: 3px 8px;
}
.camp-title { font-size: 19px; font-weight: 800; margin-top: 10px; }
.camp-pool { margin-top: 6px; color: var(--muted); font-size: 13.5px; }
.camp-pool b { color: var(--gold); font-size: 17px; }
.camp-period { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.countdown { display: flex; gap: 8px; margin-top: 16px; }
.cd-cell { background: var(--panel); border: 1px solid var(--glass-border); border-radius: 12px; padding: 8px 0 6px; min-width: 62px; text-align: center; }
.cd-cell .n { font-size: 21px; font-weight: 800; }
.cd-cell .u { font-size: 10.5px; color: var(--faint); text-transform: uppercase; letter-spacing: 0.08em; }
.camp-status { font-size: 12px; color: var(--muted); margin-top: 14px; text-transform: uppercase; letter-spacing: 0.08em; }
.camp-note { font-size: 12px; color: var(--muted); margin-top: 10px; line-height: 1.55; }
.btn-gold {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; padding: 11px 18px;
  background: var(--gold); color: #141828; font-weight: 800; font-size: 14px; border-radius: 8px; border: none;
}
.btn-glass {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px;
  background: var(--glass); color: var(--text); border: 1px solid var(--glass-border);
  font-weight: 700; font-size: 13.5px; border-radius: 8px;
}

/* Service grid + link lists */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (min-width: 720px) { .grid { grid-template-columns: repeat(4, 1fr); gap: 14px; } }
.svc {
  display: block; background: var(--glass); border: 1px solid var(--glass-border); border-radius: var(--radius);
  padding: 16px 14px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.svc .ic {
  width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  background: rgba(255, 215, 0, 0.08); color: var(--gold); margin-bottom: 10px;
}
.svc .ic svg { width: 19px; height: 19px; }
.svc .t { font-weight: 800; font-size: 14.5px; }
.svc .d { font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.5; }
@media (hover: hover) {
  .svc:hover { transform: translateY(-2px); box-shadow: 0 14px 28px rgba(0, 0, 0, 0.35); }
}
.list { display: flex; flex-direction: column; gap: 10px; }
.link-card {
  display: flex; align-items: center; gap: 14px; background: var(--glass);
  border: 1px solid var(--glass-border); border-radius: var(--radius); padding: 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
}
.link-card .ic {
  width: 42px; height: 42px; flex: none; border-radius: 11px; display: flex; align-items: center; justify-content: center;
  background: rgba(138, 43, 226, 0.14); color: #C9A7F5;
}
.link-card .ic svg { width: 20px; height: 20px; }
.link-card .body { flex: 1; min-width: 0; }
.link-card .t { font-weight: 800; font-size: 15px; }
.link-card .d { font-size: 12.5px; color: var(--muted); margin-top: 3px; line-height: 1.5; }
.link-card .arrow { color: var(--faint); font-size: 18px; flex: none; }
.hero-card .t { font-size: 17px; }

/* Install card */
.install-card { display: none; }
.install-card.show { display: block; }
.install-card p { color: var(--muted); font-size: 13.5px; line-height: 1.6; margin: 8px 0 0; }
.install-card .t { font-weight: 800; font-size: 16px; }

/* More view */
.about-body { color: var(--muted); font-size: 13.5px; line-height: 1.7; margin-top: 8px; }
.lang-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.lang-row .lbl { font-weight: 700; font-size: 14px; }

.foot { text-align: center; color: var(--faint); font-size: 12px; padding: 26px 16px 8px; line-height: 1.7; }
.foot a { color: var(--muted); }

/* ---------- Bottom tab bar (mobile) ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: flex; padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  background: rgba(10, 15, 30, 0.92);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--glass-border);
}
@media (min-width: 1024px) { .tabbar { display: none; } }
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: transparent; border: none; color: var(--muted); padding: 6px 0 4px;
  font-size: 10.5px; font-weight: 700; border-radius: 10px; min-height: 50px;
}
.tab svg { width: 21px; height: 21px; }
.tab.active { color: var(--gold); }

[hidden] { display: none !important; }

:focus-visible { outline: 2px solid rgba(255, 215, 0, 0.55); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ============================================================
   Dashboard density layer (2026-11-29) — Lutherium-density
   grammar per ui-dashboard-spec.md: metric strip with
   sparklines, dense markets table, sticky right rail,
   sidebar watchlist, topbar breadcrumb + search.
   ============================================================ */

/* Wider fluid content per spec §2 */
.wrap { max-width: 1560px; }

/* ---------- Topbar: breadcrumb + search ---------- */
.tb-title { display: none; }
@media (min-width: 1024px) {
  .tb-title { display: block; }
  .topbar .view-title { display: block; font-size: 16px; line-height: 1.15; }
}
.tb-title .crumb {
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--faint); margin-bottom: 2px;
}
.tb-title .crumb .sep { color: var(--gold); margin: 0 2px; }
.search-box {
  display: none; align-items: center; gap: 8px; height: 38px; padding: 0 12px;
  background: var(--input); border: 1px solid var(--glass-border); border-radius: 10px;
  color: var(--faint); min-width: 210px;
}
.search-box svg { width: 16px; height: 16px; flex: none; }
.search-box input {
  background: transparent; border: none; outline: none; color: var(--text);
  font-family: inherit; font-size: 13.5px; font-weight: 600; width: 100%;
}
.search-box input::placeholder { color: var(--faint); }
@media (min-width: 720px) { .search-box { display: flex; } }
@media (min-width: 1280px) { .search-box { min-width: 280px; } }

/* ---------- Sidebar watchlist ---------- */
.watchlist { display: flex; flex-direction: column; gap: 2px; padding: 0 2px; }
.wl-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 7px 8px; border-radius: 10px;
}
.wl-row:hover { background: var(--panel); }
.wl-sym { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 800; }
.wl-sym img { width: 20px; height: 20px; }
.wl-tile, .mc-tile {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 22px; height: 22px; border-radius: 7px; font-size: 8.5px; font-weight: 800;
  letter-spacing: 0.02em; color: var(--gold);
  background: rgba(255, 215, 0, 0.08); border: 1px solid rgba(255, 215, 0, 0.22);
}
.wl-vals { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.25; }
.wl-price { font-size: 13px; font-weight: 700; }
.wl-chg { font-size: 11px; font-weight: 700; }
.wl-chg.up { color: var(--up); }
.wl-chg.down { color: var(--down); }
.wl-chg.flat { color: var(--faint); }
.wl-note { font-size: 11.5px; color: var(--faint); padding: 6px 8px 2px; }

/* ---------- Metric strip ---------- */
.metric-strip {
  display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 16px;
}
@media (min-width: 480px) { .metric-strip { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1280px) { .metric-strip { grid-template-columns: repeat(4, 1fr); } }
.metric-card {
  background: var(--glass); border: 1px solid var(--glass-border); border-radius: 20px;
  padding: 16px 18px 14px;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  min-width: 0;
}
.mc-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mc-pair { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 13.5px; letter-spacing: 0.02em; }
.mc-pair img { width: 24px; height: 24px; }
.mc-tile { width: 24px; height: 24px; border-radius: 8px; font-size: 9px; }
.mc-badge {
  font-size: 10px; font-weight: 800; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--muted); background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border); border-radius: 999px; padding: 3px 8px; white-space: nowrap;
}
.mc-value { font-size: 25px; font-weight: 800; margin-top: 10px; letter-spacing: -0.01em; white-space: nowrap; }
.mc-value .chip { font-size: 12px; margin-left: 8px; }
.mc-spark { display: block; width: 100%; height: 36px; margin-top: 8px; }
.mc-stats {
  display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 8px;
  font-size: 12.5px; color: var(--muted);
}
.mc-stats .k { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--faint); margin-right: 5px; }
.mc-stats b { color: var(--text); font-weight: 700; }
.mc-note { font-size: 11.5px; color: var(--faint); margin-top: 6px; min-height: 14px; }

/* ---------- Dashboard grid: main + rail ---------- */
.dash-grid { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: start; }
@media (min-width: 1100px) {
  .dash-grid { grid-template-columns: minmax(0, 1fr) 320px; }
  .dash-rail { position: sticky; top: 76px; }
}
.dash-main { min-width: 0; }
.dash-rail { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.dash-rail .card + .card { margin-top: 0; }
.rail-title { font-size: 16.5px; font-weight: 800; margin-top: 10px; line-height: 1.35; }
.rail-body { font-size: 13px; color: var(--muted); line-height: 1.6; margin: 8px 0 0; }
.rail-cta { border-color: rgba(138, 43, 226, 0.45); position: relative; overflow: hidden; }
.rail-cta::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(380px 170px at 90% -50px, rgba(138, 43, 226, 0.22), transparent 70%);
}
.btn-gold.wide, .btn-glass.wide { display: flex; justify-content: center; width: 100%; }
.rail-links { display: flex; flex-direction: column; margin-top: 12px; }
.rail-links a {
  padding: 9px 2px; font-size: 13.5px; font-weight: 700; color: var(--muted);
  border-top: 1px solid rgba(255, 255, 255, 0.05); display: flex; justify-content: space-between;
}
.rail-links a::after { content: "→"; color: var(--faint); }
.rail-links a:hover { color: var(--gold); }

/* ---------- Markets table ---------- */
.table-card { padding: 18px 18px 12px; }
.tc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.tc-title { font-size: 16px; font-weight: 800; }
.tc-sub { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.tc-src {
  flex: none; font-size: 10.5px; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--muted); border: 1px solid var(--glass-border); border-radius: 999px; padding: 4px 9px;
}
.tbl-wrap { overflow-x: auto; margin: 0 -18px; padding: 0 18px; }
.mkt-table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 340px; }
.mkt-table th {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--faint);
  font-weight: 700; padding: 8px 8px; border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  white-space: nowrap;
}
.mkt-table td { padding: 10px 8px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); vertical-align: middle; white-space: nowrap; }
.mkt-table tbody tr:last-child td { border-bottom: none; }
.mkt-table tbody tr { transition: background 0.15s ease; }
.mkt-table tbody tr:hover { background: rgba(255, 215, 0, 0.04); }
.mkt-table .l { text-align: left; }
.mkt-table .r { text-align: right; }
.mkt-table .tok { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 14px; }
.mkt-table .tok .mc-tile { width: 28px; height: 28px; border-radius: 9px; font-size: 9.5px; }
.mkt-table .tok img { width: 28px; height: 28px; }
.mkt-table .tok small { display: block; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.mkt-table .tok a { display: flex; align-items: center; gap: 10px; }
.mkt-table .tok a:hover { color: var(--gold); }
.mkt-table .px { font-weight: 700; font-size: 14px; }
.mkt-table .pct { font-weight: 700; }
.mkt-table .pct.up { color: var(--up); }
.mkt-table .pct.down { color: var(--down); }
.mkt-table .pct.flat { color: var(--faint); }
.mkt-table .vol { color: var(--muted); font-weight: 600; }
.mkt-table canvas.spark { width: 84px; height: 28px; display: block; margin-left: auto; }
.mkt-loading td { color: var(--muted); text-align: center; padding: 22px 8px; }
.tc-note { font-size: 11.5px; color: var(--faint); margin-top: 8px; min-height: 14px; }
@media (max-width: 719px) {
  .mkt-table .col-opt, .mkt-table .col-spark { display: none; }
}

/* ---------- Other views: denser two-column lists on wide screens ---------- */
.link-card { transition: transform 0.18s ease, box-shadow 0.18s ease; }
@media (hover: hover) {
  .link-card:hover { transform: translateY(-2px); box-shadow: 0 14px 28px rgba(0, 0, 0, 0.35); }
}
@media (min-width: 1100px) {
  [data-panel="trade"] .list, [data-panel="stake"] .list,
  [data-panel="tools"] .list, [data-panel="more"] .list {
    display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  }
  [data-panel="trade"] .hero-card { grid-column: 1 / -1; }
}
