/* VaultX — shared stylesheet */
:root {
  --bg:     #080d18;
  --panel:  #10192a;
  --panel2: #162238;
  --line:   #26354d;
  --gold:   #f4c76b;
  --green:  #53d6a0;
  --muted:  #9aabc1;
  --text:   #eef4ff;
  --red:    #f07178;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background:
    radial-gradient(ellipse at 12% 0%, #162a48 0, transparent 36%),
    radial-gradient(ellipse at 92% 14%, #102b31 0, transparent 28%),
    var(--bg);
  color: var(--text);
  font: 15px/1.5 Inter, Roboto, system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  animation: page-enter .3s ease-out both;
}

button, input, select { font: inherit; }

button {
  cursor: pointer; border: 0; border-radius: 11px;
  padding: 12px 20px; min-height: 44px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; transition: background .2s, filter .2s, transform .15s;
}
button:hover  { transform: translateY(-1px); filter: brightness(1.08); }
button:active { transform: translateY(0) scale(.99); }
button:disabled { cursor: not-allowed; opacity: .55; transform: none; filter: none; }

.btn-primary  { background: var(--green); color: #06130b; }
.btn-secondary{ background: #202b24; color: var(--text); border: 1px solid var(--line); }
.btn-danger   { background: #3a1414; color: var(--red); border: 1px solid #703333; }
.btn-gold     { background: var(--gold); color: #111; }
.btn-full     { width: 100%; }
.btn-sm       { padding: 8px 14px; min-height: 36px; font-size: 13px; }

.gold  { color: var(--gold); }
.green { color: var(--green); }
.muted { color: var(--muted); }
.red   { color: var(--red); }
.hidden { display: none !important; }

/* ── Layout ── */
.wrap { max-width: 1180px; margin: auto; padding: 24px; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px; border-bottom: 1px solid var(--line);
  padding: 16px 24px; background: #0a0c0be8;
  position: sticky; top: 0; z-index: 40; backdrop-filter: blur(14px);
}
.menu-toggle {
  width: 44px; min-width: 44px; height: 44px; min-height: 44px; padding: 10px;
  background: #10192a; color: var(--text); border: 1px solid var(--line);
}
.menu-toggle svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.menu-toggle:focus-visible, .dashboard-nav .tab:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
.brand {
  display: flex; align-items: center; gap: 10px;
  font-size: 20px; font-weight: 850; letter-spacing: -.5px; text-decoration: none; color: var(--text);
}
.logo {
  width: 34px; height: 34px; display: grid; place-items: center;
  background: var(--gold); color: #111; border-radius: 10px; font-weight: 900;
}
.pill {
  display: inline-block; border: 1px solid #245c40;
  color: var(--green); background: #10271a;
  padding: 3px 9px; border-radius: 30px; font-size: 11px; font-weight: 700;
}

.nav-right { display: flex; align-items: center; gap: 12px; }
.avatar-wrap { position: relative; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: #28382e; display: grid; place-items: center;
  color: var(--green); font-weight: 800; font-size: 15px;
  border: 2px solid var(--line); overflow: hidden; cursor: pointer;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ── Dashboard navigation ── */
.dashboard-nav {
  position: fixed; inset: 0 auto 0 0; z-index: 30;
  width: 272px; padding: 88px 16px 24px;
  background: linear-gradient(180deg, #10192a, #0b1321);
  border-right: 1px solid var(--line); box-shadow: 16px 0 40px #02071145;
  transform: translateX(-102%); transition: transform .24s ease;
}
.dashboard-nav-heading { display: grid; gap: 3px; padding: 0 12px 18px; font-size: 13px; }
.dashboard-nav .tabs { display: grid; gap: 6px; margin: 0; }
.dashboard-nav .tab {
  width: 100%; justify-content: flex-start; gap: 13px;
  padding: 11px 13px; color: var(--muted); background: transparent;
  border: 1px solid transparent; border-radius: 11px; text-align: left;
}
.dashboard-nav .tab svg {
  width: 20px; height: 20px; flex: 0 0 20px;
  fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}
.dashboard-nav .tab.active { background: #203127; color: var(--green); border-color: #2e6144; }
.dashboard-nav .tab:hover { background: #162238; }
.dashboard-nav .tab.active:hover { background: #203127; }
.nav-backdrop {
  position: fixed; inset: 0; z-index: 20;
  background: #020711a8; opacity: 0; pointer-events: none;
  transition: opacity .24s ease;
}
body.nav-open .dashboard-nav { transform: translateX(0); }
body.nav-open .nav-backdrop { opacity: 1; pointer-events: auto; }
@media (min-width: 769px) {
  body.nav-open .topbar { width: calc(100% - 272px); margin-left: 272px; }
  body.nav-open .wrap {
    max-width: 1180px;
    margin-left: calc(272px + max(24px, (100vw - 272px - 1180px) / 2));
  }
}

/* ── Cards / Grid ── */
.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 18px; }
.card {
  background: linear-gradient(145deg, #121e31, #0e1726);
  border: 1px solid var(--line); border-radius: 18px; padding: 22px; min-width: 0;
  box-shadow: 0 14px 36px #02071125;
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.card:hover { border-color: #3a5273; box-shadow: 0 18px 40px #02071140; }
.tab-panel:not(.hidden) { animation: panel-enter .24s ease-out both; }
.tab-panel:not(.hidden) .card { animation: panel-enter .32s ease-out both; }
.tab-panel:not(.hidden) .card:nth-child(2) { animation-delay: .035s; }
.tab-panel:not(.hidden) .card:nth-child(3) { animation-delay: .07s; }
.card h2, .card h3 { margin-bottom: 14px; }

.col-7  { grid-column: span 7; }
.col-5  { grid-column: span 5; }
.col-6  { grid-column: span 6; }
.col-4  { grid-column: span 4; }
.col-3  { grid-column: span 3; }
.col-12 { grid-column: span 12; }

/* ── Forms ── */
.field { display: flex; flex-direction: column; gap: 7px; margin: 14px 0; }
.field label { font-size: 13px; color: #c1cec6; font-weight: 600; }
.field input, .field select, .field textarea {
  width: 100%; padding: 12px 13px;
  background: #0a1220; color: var(--text);
  border: 1px solid #344862; border-radius: 10px;
  transition: border-color .2s;
}
.field input:focus, .field select:focus { border-color: var(--green); outline: none; }
.field textarea:focus { border-color: var(--green); outline: none; }

.notice { padding: 13px 15px; border-radius: 11px; font-size: 13px; }
.notice-warn    { background: #201e12; border: 1px solid #5b4e19; color: #f4e6a0; }
.notice-success { background: #10271a; border: 1px solid #245c40; color: #9dffc7; }
.notice-error   { background: #2a1414; border: 1px solid #703333; color: #ffb3b3; }

/* ── Tabs ── */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 20px 0; }
.tab {
  background: transparent; color: var(--muted);
  border: 1px solid var(--line); padding: 10px 18px;
}
.tab.active { background: #203127; color: var(--green); border-color: #2e6144; }

/* ── Table ── */
.tx {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line);
}
.tx:last-child { border-bottom: 0; }
.tx-status { font-size: 12px; font-weight: 700; }
.status-completed { color: var(--green); }
.status-pending   { color: var(--gold); }
.status-rejected  { color: var(--red); }

/* ── Admin table ── */
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table-scroll { width: 100%; overflow-x: auto; }
.admin-table textarea {
  display: block; min-width: 190px; width: 100%; margin-top: 8px; padding: 9px 10px;
  background: #0a1220; color: var(--text); border: 1px solid #344862; border-radius: 8px;
  resize: vertical;
}
.admin-table input:not([type="checkbox"]) {
  min-width: 120px; max-width: 100%; padding: 9px 10px;
  background: #0a1220; color: var(--text);
  border: 1px solid #344862; border-radius: 8px;
}
.admin-table input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--green); }
.admin-table th {
  text-align: left; padding: 10px 12px; font-size: 12px;
  color: var(--muted); border-bottom: 1px solid var(--line); font-weight: 600;
  text-transform: uppercase; letter-spacing: .5px;
}
.admin-table td { padding: 12px 12px; border-bottom: 1px solid #1a2420; vertical-align: middle; }
.admin-table tr:hover td { background: #111915; }

/* ── Auth modal ── */
.modal-backdrop {
  position: fixed; inset: 0; background: #000a; backdrop-filter: blur(6px);
  display: grid; place-items: center; z-index: 50; padding: 20px;
}
.modal {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 20px; padding: 32px; width: 100%; max-width: 440px;
}
.modal h2 { margin-bottom: 6px; }
.modal-tabs { display: flex; gap: 0; margin: 20px 0 24px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.modal-tab { flex: 1; padding: 10px; background: transparent; color: var(--muted); border-radius: 0; border: 0; }
.modal-tab.active { background: #203127; color: var(--green); }

.divider { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--muted); font-size: 13px; }
.divider::before, .divider::after { content:''; flex: 1; height: 1px; background: var(--line); }

.google-btn {
  width: 100%; background: #fff; color: #222;
  border: 1px solid #ddd; border-radius: 10px;
  padding: 12px; font-weight: 600; font-size: 14px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.google-btn:hover { background: #f5f5f5; filter: none; }
.google-icon { width: 18px; height: 18px; }

/* ── Balance number ── */
.balance-number {
  font-size: clamp(28px, 5vw, 44px); font-weight: 850;
  letter-spacing: -1.5px; margin: 10px 0;
}

/* ── Flex helpers ── */
.flex { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ── Upload avatar preview ── */
.avatar-upload-wrap { display: flex; align-items: center; gap: 16px; margin: 14px 0; }
.avatar-preview {
  width: 72px; height: 72px; border-radius: 50%;
  background: #28382e; border: 2px solid var(--line);
  display: grid; place-items: center; overflow: hidden;
  color: var(--green); font-size: 24px; font-weight: 800;
}
.avatar-preview img { width: 100%; height: 100%; object-fit: cover; }

/* ── Hero ── */
.hero {
  min-height: 78vh; display: grid; place-items: center;
  text-align: center; padding: 40px 20px;
}
.hero-card { max-width: 680px; }
.eyebrow { color: var(--green); font-weight: 800; letter-spacing: 2px; text-transform: uppercase; font-size: 12px; }
.hero h1 { font-size: clamp(36px, 7vw, 64px); line-height: 1.04; letter-spacing: -2px; margin: 18px 0; }
.hero p  { font-size: 17px; color: var(--muted); max-width: 540px; margin: 0 auto 28px; }

footer { padding: 28px 24px; text-align: center; color: #66756b; font-size: 12px; }

/* ── Live markets ── */
.markets-disclaimer { margin: -4px 0 16px; font-size: 13px; }
.market-stat-card { min-height: 112px; display: flex; flex-direction: column; justify-content: space-between; gap: 12px; }
.market-stat-value { font-size: clamp(18px, 2.5vw, 26px); letter-spacing: -.5px; }
.market-positive { color: var(--green); }
.market-negative { color: var(--red); }
.market-skeleton { height: 112px; overflow: hidden; position: relative; }
.market-skeleton::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 18%, #ffffff12 48%, transparent 76%);
  transform: translateX(-100%); animation: market-shimmer 1.5s infinite;
}
.market-mini-row {
  width: 100%; justify-content: space-between; padding: 10px 0; min-height: 46px;
  color: var(--text); background: transparent; border-radius: 0;
  border-bottom: 1px solid var(--line); text-align: left;
}
.market-mini-row:last-child { border-bottom: 0; }
.market-mini-row:hover { background: #ffffff08; filter: none; transform: none; }
.market-mini-row > span:last-child { display: flex; gap: 10px; align-items: center; white-space: nowrap; }
.market-identity { display: flex; align-items: center; gap: 9px; min-width: 0; }
.market-identity img, .market-asset-button img { width: 25px; height: 25px; border-radius: 50%; }
.market-identity small { color: var(--muted); font-size: 11px; }
.market-mover-group + .market-mover-group { margin-top: 12px; }
.market-asset-button {
  min-height: 40px; padding: 0; background: transparent; color: var(--text);
  text-align: left; justify-content: flex-start;
}
.market-asset-button:hover { background: transparent; filter: none; color: var(--green); transform: none; }
.market-asset-button span { display: grid; }
.market-asset-button small { font-size: 11px; }
.market-table { min-width: 680px; }
.market-sparkline { display: block; width: 104px; height: 30px; }
.market-sparkline polyline { stroke-dasharray: 140; animation: sparkline-reveal .8s ease-out both; }
.price-changed { animation: price-flash .75s ease-out; }
.coin-detail-header { display: flex; align-items: center; gap: 14px; margin: 8px 0 18px; }
.coin-detail-header img { border-radius: 50%; }
.coin-detail-header div { display: grid; }
.coin-detail-header strong { font-size: 24px; }
.coin-detail-header small { font-size: 13px; }
.coin-detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.coin-detail-grid > div { display: grid; gap: 4px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
.coin-description { margin: 18px 0; color: var(--muted); line-height: 1.7; }
progress { accent-color: var(--green); }

@keyframes panel-enter {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes page-enter {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes market-shimmer {
  to { transform: translateX(100%); }
}
@keyframes price-flash {
  0% { background-color: #53d6a055; }
  100% { background-color: transparent; }
}
@keyframes sparkline-reveal {
  from { stroke-dashoffset: 140; }
  to { stroke-dashoffset: 0; }
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .wrap { padding: 16px; }
  .topbar { padding: 12px 16px; }
  .dashboard-nav { width: min(82vw, 320px); }
  .col-7, .col-5, .col-6, .col-4 { grid-column: span 12; }
  .hide-mobile { display: none; }
  .card { padding: 16px; }
  .col-3 { grid-column: span 6; }
  .admin-table-scroll .admin-table { min-width: 720px; }
}
@media (max-width: 460px) {
  .topbar { flex-wrap: wrap; gap: 10px; padding: 10px 12px; }
  .topbar .nav-right { margin-left: auto; gap: 8px; }
  .topbar .btn-secondary { padding: 8px 10px; }
  .brand { gap: 8px; font-size: 18px; }
  .col-3 { grid-column: span 12; }
  .coin-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .market-mini-row > span:last-child { flex-direction: column; align-items: flex-end; gap: 2px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
