/* Curve Finance read-only dashboard — curve.finance aesthetic */

:root {
  --bg: #07080c;
  --bg-2: #0c0e14;
  --panel: rgba(255,255,255,.022);
  --panel-2: rgba(255,255,255,.04);
  --panel-solid: #10121a;
  --line: rgba(255,255,255,.07);
  --line-strong: rgba(255,255,255,.13);
  --text: #eef0f7;
  --muted: #878da2;
  --muted-2: #5c6274;
  --red: #ff2e63;
  --orange: #ff8a3d;
  --yellow: #ffd23f;
  --green: #2fd77a;
  --blue: #3aa0ff;
  --indigo: #6f7cff;
  --violet: #a06bff;
  --rainbow: linear-gradient(90deg, #ff2e63, #ff8a3d, #ffd23f, #2fd77a, #3aa0ff, #6f7cff);
  --rainbow-soft: linear-gradient(90deg, rgba(255,46,99,.14), rgba(255,138,61,.14), rgba(255,210,63,.14), rgba(47,215,122,.14), rgba(58,160,255,.14));
  --font: "Chakra Petch", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --radius: 16px;
  --radius-sm: 11px;
  --sidebar: 240px;
  --shadow: 0 24px 60px -20px rgba(0,0,0,.75);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; cursor: pointer; border: none; background: none; }
input { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }

/* Background FX */
.bg-fx { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.bg-fx .aurora {
  position: absolute; top: -30%; left: 50%; transform: translateX(-50%);
  width: 1400px; height: 700px;
  background:
    radial-gradient(closest-side, rgba(255,46,99,.18), transparent 70%) -260px 40px / 640px 520px no-repeat,
    radial-gradient(closest-side, rgba(255,210,63,.14), transparent 70%) -40px 0 / 620px 500px no-repeat,
    radial-gradient(closest-side, rgba(47,215,122,.14), transparent 70%) 180px 60px / 640px 520px no-repeat,
    radial-gradient(closest-side, rgba(58,160,255,.18), transparent 70%) 380px 10px / 660px 540px no-repeat;
  filter: blur(32px); opacity: .5;
  animation: drift 22s ease-in-out infinite alternate;
}
@keyframes drift { to { transform: translateX(-50%) translateY(26px) scale(1.05); } }
.bg-fx .grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 46px 46px; opacity: .25;
  mask-image: radial-gradient(circle at 50% 0%, #000 0%, transparent 75%);
}

/* Splash */
.splash {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-items: center;
  background: radial-gradient(120% 100% at 50% 0%, #10121b 0%, #06070b 60%);
  transition: opacity .6s, visibility .6s;
}
.splash.hide { opacity: 0; visibility: hidden; pointer-events: none; }
.splash-inner { display: flex; flex-direction: column; align-items: center; gap: 24px; }
.splash-logo { width: 120px; height: 120px; }
.splash-logo .wave { fill: none; stroke-width: 8.5; stroke-linecap: round; stroke-dasharray: 240; stroke-dashoffset: 240; animation: draw 1.1s cubic-bezier(.6,.05,.2,1) forwards; }
.splash-logo .wave:nth-child(1){ animation-delay:.05s } .splash-logo .wave:nth-child(2){ animation-delay:.16s }
.splash-logo .wave:nth-child(3){ animation-delay:.27s } .splash-logo .wave:nth-child(4){ animation-delay:.38s }
.splash-logo .wave:nth-child(5){ animation-delay:.49s }
@keyframes draw { to { stroke-dashoffset: 0; } }
.splash-word { font-weight: 700; font-size: 28px; letter-spacing: 2.5px; text-transform: uppercase; opacity: 0; animation: rise .7s ease .55s forwards; }
.splash-word b { background: var(--rainbow); -webkit-background-clip: text; background-clip: text; color: transparent; }
.splash-sub { font-family: var(--mono); font-size: 12px; letter-spacing: 4px; text-transform: uppercase; color: var(--muted); opacity: 0; animation: rise .7s ease .72s forwards; }
.splash-bar { width: 200px; height: 3px; border-radius: 3px; overflow: hidden; background: rgba(255,255,255,.08); opacity: 0; animation: rise .6s ease .9s forwards; }
.splash-bar i { display: block; height: 100%; width: 40%; border-radius: 3px; background: var(--rainbow); animation: load 1.4s ease .95s forwards; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes load { to { width: 100%; } }

/* Shell */
.shell { position: relative; z-index: 1; display: flex; min-height: 100vh; opacity: 0; animation: fadeUp .7s ease .2s forwards; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* Sidebar */
.sidebar {
  width: var(--sidebar); flex: none;
  display: flex; flex-direction: column;
  border-right: 1px solid var(--line);
  background: rgba(7,8,12,.85);
  backdrop-filter: blur(12px);
  position: sticky; top: 0; height: 100vh;
  padding: 22px 14px 18px;
}
.side-brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 24px; }
.side-mark {
  width: 42px; height: 42px; border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, #12141d, #0a0b11);
  display: grid; place-items: center;
}
.side-mark svg { width: 30px; height: 30px; }
.side-name { font-weight: 700; font-size: 17px; letter-spacing: .4px; line-height: 1.1; }
.side-sub { font-family: var(--mono); font-size: 10px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted-2); margin-top: 2px; }

.side-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 14px; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 14px; letter-spacing: .3px;
  color: var(--muted); transition: all .18s;
}
.nav-item svg { width: 18px; height: 18px; flex: none; opacity: .7; }
.nav-item:hover { color: var(--text); background: var(--panel-2); }
.nav-item.on { color: var(--text); background: var(--panel-2); border: 1px solid var(--line-strong); }
.nav-item.on svg { opacity: 1; color: var(--blue); }

.side-foot { padding: 16px 8px 0; border-top: 1px solid var(--line); margin-top: 12px; }
.readonly-pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 1px; text-transform: uppercase;
  color: var(--green); border: 1px solid rgba(47,215,122,.28);
  background: rgba(47,215,122,.07); padding: 6px 11px; border-radius: 999px;
}
.readonly-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); }
.side-note { font-family: var(--mono); font-size: 10.5px; color: var(--muted-2); margin-top: 10px; line-height: 1.5; }
.side-note.muted { color: var(--muted-2); opacity: .7; font-size: 10px; }

/* Main */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 0 28px 40px; }

/* Topbar */
.topbar {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 0 14px; flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
  background: rgba(7,8,12,.88);
  backdrop-filter: blur(10px);
}
.menu-btn { display: none; }
.icon-btn {
  width: 42px; height: 42px; border-radius: var(--radius-sm);
  display: grid; place-items: center;
  background: var(--panel-2); border: 1px solid var(--line);
  color: var(--muted); transition: all .18s;
}
.icon-btn:hover { color: var(--text); border-color: var(--line-strong); }
.icon-btn svg { width: 18px; height: 18px; }

.chain-select { position: relative; }
.chain-btn {
  display: flex; align-items: center; gap: 8px;
  height: 42px; padding: 0 14px;
  border-radius: var(--radius-sm);
  background: var(--panel-2); border: 1px solid var(--line);
  font-weight: 600; font-size: 13.5px; transition: border-color .18s;
}
.chain-btn:hover { border-color: var(--line-strong); }
.chain-btn svg { width: 14px; height: 14px; color: var(--muted); }
.chain-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--indigo); box-shadow: 0 0 8px var(--indigo); }
.chain-drop {
  position: absolute; top: calc(100% + 6px); left: 0; min-width: 180px;
  background: var(--panel-solid); border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); padding: 6px; z-index: 60;
  box-shadow: var(--shadow);
}
.chain-opt {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 10px 12px; border-radius: 8px;
  font-weight: 600; font-size: 13px; color: var(--muted); transition: all .15s;
}
.chain-opt:hover { background: var(--panel-2); color: var(--text); }
.chain-opt.on { color: var(--text); background: var(--panel-2); }
.chain-opt .cd { width: 8px; height: 8px; border-radius: 50%; }

.topbar-search {
  flex: 1; min-width: 200px;
  display: flex; align-items: center; gap: 10px;
  height: 42px; padding: 0 14px;
  background: rgba(0,0,0,.35); border: 1px solid var(--line);
  border-radius: var(--radius-sm); transition: border-color .2s, box-shadow .2s;
}
.topbar-search:focus-within { border-color: var(--indigo); box-shadow: 0 0 0 3px rgba(111,124,255,.15); }
.topbar-search svg { flex: none; color: var(--muted); width: 17px; height: 17px; }
.topbar-search input { flex: 1; background: none; border: none; outline: none; font-family: var(--mono); font-size: 13.5px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 20px; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 13.5px; letter-spacing: .3px;
  transition: all .18s; white-space: nowrap;
}
.btn.primary {
  color: #0a0a0f; background: var(--rainbow); background-size: 200% 100%;
  transition: background-position .5s, filter .2s;
}
.btn.primary:hover { background-position: 100% 0; filter: brightness(1.06); }
.btn.primary:disabled { opacity: .5; cursor: not-allowed; }
.btn.ghost { background: var(--panel-2); border: 1px solid var(--line-strong); color: var(--text); }
.btn.ghost:hover { filter: brightness(1.15); }

.page-head {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 22px 0 16px; gap: 12px; flex-wrap: wrap;
}
.page-head h1 { font-size: 24px; font-weight: 700; letter-spacing: .5px; }
.page-upd { font-family: var(--mono); font-size: 11.5px; color: var(--muted-2); }

.content { flex: 1; }

/* Stats grid */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.stat {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 18px 16px; position: relative; overflow: hidden;
  transition: border-color .2s;
}
.stat:hover { border-color: var(--line-strong); }
.stat::before { content: ""; position: absolute; left: 0; top: 0; height: 3px; width: 100%; background: var(--rainbow); opacity: 0; transition: opacity .3s; }
.stat:hover::before { opacity: .85; }
.stat .k { font-family: var(--mono); font-size: 10.5px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--muted-2); }
.stat .v { font-family: var(--mono); font-weight: 600; font-size: 26px; margin-top: 10px; letter-spacing: -.5px; }
.stat .s { font-family: var(--mono); font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.stat .v.gain { color: var(--green); }

/* Section */
.section { margin-top: 24px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; flex-wrap: wrap; gap: 8px; }
.section-head h2 { font-size: 16px; font-weight: 700; letter-spacing: .5px; display: flex; align-items: center; gap: 9px; }
.section-head h2::before { content: ""; width: 4px; height: 16px; border-radius: 2px; background: var(--rainbow); }
.section-head .hint { font-family: var(--mono); font-size: 11.5px; color: var(--muted-2); }

/* Cards / tables */
.cards { display: flex; flex-direction: column; gap: 9px; }
.pos {
  display: grid; grid-template-columns: 1.7fr 1fr 1fr auto;
  align-items: center; gap: 16px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; transition: border-color .2s, transform .2s, background .2s;
}
.pos:hover { border-color: var(--line-strong); background: var(--panel-2); transform: translateY(-1px); }
.pos .id { display: flex; align-items: center; gap: 13px; min-width: 0; }
.coins { display: flex; align-items: center; }
.coin {
  width: 30px; height: 30px; border-radius: 50%; margin-left: -9px;
  border: 2px solid #0a0b11; display: grid; place-items: center;
  font-family: var(--mono); font-size: 10px; font-weight: 600; color: #06070b; flex: none;
}
.coin:first-child { margin-left: 0; }
.pos .name { min-width: 0; }
.pos .name .t { font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pos .name .sub { font-family: var(--mono); font-size: 11px; color: var(--muted); margin-top: 3px; display: flex; align-items: center; gap: 7px; }
.chain-tag { font-family: var(--mono); font-size: 10px; letter-spacing: .8px; text-transform: uppercase; padding: 2px 7px; border-radius: 5px; border: 1px solid var(--line-strong); }
.col-k { font-family: var(--mono); font-size: 10.5px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--muted-2); }
.col-v { font-family: var(--mono); font-weight: 600; font-size: 15px; margin-top: 4px; }
.col-v small { font-weight: 400; color: var(--muted); font-size: 11.5px; }
.apy { color: var(--green); }
.pos .val { text-align: right; }
.pos .val .usd { font-family: var(--mono); font-weight: 600; font-size: 18px; }
.rewards { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 5px; }
.rtag { font-family: var(--mono); font-size: 10px; padding: 2px 6px; border-radius: 5px; background: var(--rainbow-soft); border: 1px solid var(--line); }
.split { display: flex; gap: 6px; margin-top: 5px; flex-wrap: wrap; }
.split span { font-family: var(--mono); font-size: 10px; padding: 2px 6px; border-radius: 5px; border: 1px solid var(--line); color: var(--muted); }
.split .stk { color: var(--green); border-color: rgba(47,215,122,.3); }

/* Allocation */
.alloc { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.alloc-bar { height: 14px; border-radius: 8px; overflow: hidden; display: flex; background: rgba(255,255,255,.04); }
.alloc-bar > span { height: 100%; transition: width .6s cubic-bezier(.6,.05,.2,1); }
.alloc-legend { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 15px; }
.alloc-legend .li { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.alloc-legend .li b { color: var(--text); font-weight: 600; }
.alloc-legend .sw { width: 10px; height: 10px; border-radius: 3px; }

/* Dashboard grid */
.dash-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 18px; }
.dash-panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }

/* Pool table header */
.table-head {
  display: grid; grid-template-columns: 1.7fr 1fr 1fr auto;
  gap: 16px; padding: 10px 18px;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 1.2px;
  text-transform: uppercase; color: var(--muted-2);
  border-bottom: 1px solid var(--line); margin-bottom: 4px;
}

/* Controls row */
.controls-row { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.search-field {
  flex: 1; min-width: 200px; display: flex; align-items: center; gap: 9px;
  height: 42px; padding: 0 14px;
  background: rgba(0,0,0,.3); border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.search-field input { flex: 1; background: none; border: none; outline: none; font-family: var(--mono); font-size: 13.5px; }
.search-field svg { color: var(--muted); width: 16px; height: 16px; }
.sortsel {
  font-family: var(--mono); font-size: 12px; color: var(--text);
  background: rgba(0,0,0,.3); border: 1px solid var(--line);
  border-radius: var(--radius-sm); height: 42px; padding: 0 12px; cursor: pointer;
}

/* States */
.state { text-align: center; padding: 60px 20px; }
.state .ic { width: 66px; height: 66px; margin: 0 auto 20px; opacity: .9; }
.state h3 { font-size: 20px; font-weight: 700; letter-spacing: .4px; }
.state p { color: var(--muted); font-family: var(--mono); font-size: 13px; margin-top: 10px; line-height: 1.6; max-width: 480px; margin-left: auto; margin-right: auto; }
.state.err h3 { color: var(--red); }

.skel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); height: 78px; position: relative; overflow: hidden; }
.skel::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.05), transparent); animation: shimmer 1.3s infinite; }
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

.scanline { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.scanpill { font-family: var(--mono); font-size: 11px; padding: 6px 11px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); display: inline-flex; align-items: center; gap: 7px; }
.scanpill .s { width: 7px; height: 7px; border-radius: 50%; background: var(--muted-2); }
.scanpill.loading .s { background: var(--yellow); animation: pulse 1s infinite; }
.scanpill.done .s { background: var(--green); }
.scanpill.err .s { background: var(--red); }
@keyframes pulse { 50% { opacity: .3; } }

/* Footer */
.foot { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); }
.foot p { font-family: var(--mono); font-size: 11px; color: var(--muted-2); }
.rainbow-line { height: 3px; width: 100%; border-radius: 3px; background: var(--rainbow); opacity: .7; margin-top: 14px; }

.hidden { display: none !important; }

/* Sidebar overlay (mobile) */
.sidebar-overlay {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(0,0,0,.6); backdrop-filter: blur(2px);
}

/* Responsive */
@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .dash-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .sidebar {
    position: fixed; left: 0; top: 0; z-index: 100;
    transform: translateX(-100%); transition: transform .25s ease;
  }
  .sidebar.open { transform: translateX(0); }
  .menu-btn { display: grid; }
  .main { padding: 0 16px 32px; }
  .pos { grid-template-columns: 1fr auto; }
  .pos .col-lp, .pos .col-apy { grid-column: 1 / -1; }
  .table-head { display: none; }
  .topbar-search { order: 10; flex: 1 1 100%; }
  .btn.primary { flex: 1; }
}
