/* Dashboard + marketing + generic app pages */

.hero {
  position: relative; padding: 96px 0 80px;
  background:
    radial-gradient(ellipse at 15% 10%, rgba(47,111,237,.20), transparent 50%),
    radial-gradient(ellipse at 85% 30%, rgba(123,63,242,.16), transparent 45%);
  text-align: center;
}
.hero h1 { font-size: clamp(30px, 5vw, 52px); line-height: 1.1; max-width: 780px; margin: 0 auto var(--sp-4); }
.hero p { font-size: var(--fs-lg); color: var(--text-secondary); max-width: 560px; margin: 0 auto var(--sp-6); }
.hero-cta { display: flex; gap: var(--sp-3); justify-content: center; flex-wrap: wrap; }

.ticker-strip { display: flex; gap: var(--sp-3); overflow-x: auto; padding: var(--sp-4) 0; }
.ticker-pill {
  flex: 0 0 auto; min-width: 170px; background: var(--bg-card);
  border: 1px solid var(--border-color); border-radius: var(--radius); padding: var(--sp-3) var(--sp-4);
}
.ticker-pill .sym { font-weight: 700; font-size: var(--fs-md); }
.ticker-pill .px { font-family: var(--font-mono); font-size: var(--fs-lg); margin-top: 4px; }
.ticker-pill .chg { font-size: var(--fs-sm); font-family: var(--font-mono); }

.section { padding: var(--sp-10) 0; }
.section h2 { font-size: var(--fs-2xl); text-align: center; margin-bottom: var(--sp-2); }
.section .section-lead { text-align: center; color: var(--text-muted); margin-bottom: var(--sp-8); }

.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px,1fr)); gap: var(--sp-4); }
.feature { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: var(--sp-6); }
.feature .fi { width: 40px; height: 40px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-hover); display: grid; place-items: center; font-size: 20px; margin-bottom: var(--sp-3); }
.feature h3 { font-size: var(--fs-lg); margin-bottom: var(--sp-2); }
.feature p { color: var(--text-secondary); font-size: var(--fs-md); }

.stats-band { display: grid; grid-template-columns: repeat(auto-fit,minmax(160px,1fr)); gap: var(--sp-4); text-align: center; }
.stats-band .n { font-size: var(--fs-3xl); font-weight: 800; font-family: var(--font-mono); color: var(--accent-hover); }
.stats-band .l { color: var(--text-muted); }

.faq-item { border: 1px solid var(--border-color); border-radius: var(--radius); margin-bottom: var(--sp-2); background: var(--bg-card); }
.faq-q { width: 100%; text-align: left; padding: var(--sp-4); font-weight: 600; display: flex; justify-content: space-between; }
.faq-a { padding: 0 var(--sp-4); max-height: 0; overflow: hidden; transition: max-height .2s ease, padding .2s ease; color: var(--text-secondary); }
.faq-item.open .faq-a { max-height: 320px; padding: 0 var(--sp-4) var(--sp-4); }

.preview-frame { border: 1px solid var(--border-strong); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-lg); }
.preview-frame img { width: 100%; }

/* ============================================================ *
 *  Dashboard Pro
 * ============================================================ */
.dash {
  --dash-gap: var(--sp-4);
  --dash-pad: var(--sp-5);
  --dash-radius: var(--radius-lg);
  max-width: 1600px; margin: 0 auto; padding: var(--sp-6);
  display: flex; flex-direction: column; gap: var(--dash-gap);
}
/* author display: rules would otherwise beat the [hidden] attribute */
.dash [hidden] { display: none !important; }

/* ---- shared card shell ---- */
.dash-card {
  background: var(--bg-card); border: 1px solid var(--border-color);
  border-radius: var(--dash-radius); overflow: hidden;
}
.dash-card-hd {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  padding: var(--sp-4) var(--dash-pad); border-bottom: 1px solid var(--border-color);
}
.dash-card-hd h2 { font-size: var(--fs-lg); font-weight: 600; display: flex; align-items: center; gap: var(--sp-2); }
.dash-link { color: var(--accent); font-size: var(--fs-sm); white-space: nowrap; display: inline-flex; align-items: center; gap: 5px; }
.dash-link:hover { color: var(--accent-hover); }
.dash-link i { font-size: 11px; }
.dash-muted { color: var(--text-muted); }
.dash-count { background: var(--accent-soft); color: var(--accent-hover); border-radius: var(--radius-pill); padding: 1px 8px; font-size: var(--fs-xs); font-weight: 700; }
.dash-live { display: inline-flex; align-items: center; gap: 5px; font-size: var(--fs-xs); color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }

/* number-update flash (respect reduced motion) */
@keyframes dash-flash { from { opacity: .3; } to { opacity: 1; } }
.dash-tick { animation: dash-flash .5s ease; }
@media (prefers-reduced-motion: reduce) { .dash-tick { animation: none; } }

/* ---- top: greeting + status ---- */
.dash-top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-4); flex-wrap: wrap; }
.dash-greeting { font-size: var(--fs-2xl); font-weight: 700; line-height: 1.2; }
.dash-greeting-sub { color: var(--text-muted); font-size: var(--fs-md); margin-top: 3px; }
.dash-statusline { display: flex; align-items: center; gap: var(--sp-3); font-size: var(--fs-sm); color: var(--text-secondary); flex-wrap: wrap; }
.dash-status-item { display: inline-flex; align-items: center; gap: 6px; }
.dash-status-sys i { color: var(--success); }
.dash-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-faint); display: inline-block; flex: 0 0 auto; }
.dash-dot[data-state="live"] { background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); animation: dash-pulse 2.4s ease infinite; }
.dash-dot[data-state="down"] { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.dash-dot[data-state="loading"] { background: var(--warning); }
@keyframes dash-pulse { 0%,100% { box-shadow: 0 0 0 3px var(--success-soft); } 50% { box-shadow: 0 0 0 5px transparent; } }
@media (prefers-reduced-motion: reduce) { .dash-dot { animation: none !important; } }

/* ---- portfolio overview ---- */
.dash-portfolio { padding: var(--dash-pad); display: flex; flex-direction: column; gap: var(--sp-5); }
.dash-pf-body { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--sp-5) var(--sp-6); }
.dash-pf-primary { min-width: 0; }
.dash-pf-label { font-size: var(--fs-xs); color: var(--text-muted); text-transform: uppercase; letter-spacing: .07em; }
.dash-pf-value { font-family: var(--font-mono); font-weight: 700; font-size: clamp(28px, 4.4vw, 40px); letter-spacing: -.02em; line-height: 1.15; margin-top: 6px; }
.dash-pf-note { font-size: var(--fs-sm); color: var(--text-muted); margin-top: 6px; }
.dash-pf-approx { font-size: var(--fs-xs); color: var(--warning); margin-top: 6px; display: flex; align-items: center; gap: 5px; }

.dash-pf-pnl { display: grid; grid-template-columns: repeat(3, minmax(120px, 168px)); gap: var(--sp-2); flex: 0 1 auto; }
.dash-pnl-item {
  display: flex; flex-direction: column; gap: 3px;
  padding: var(--sp-3); border: 1px solid var(--border-color);
  border-radius: var(--radius); background: var(--bg-elevated);
}
.dash-pnl-k { font-size: var(--fs-xs); color: var(--text-muted); }
.dash-pnl-v { font-family: var(--font-mono); font-weight: 600; font-size: var(--fs-lg); }
.dash-pnl-v.up, .dash-act-amt.up, .dash-ft-pnl.up, .dash-pf-value.up { color: var(--success); }
.dash-pnl-v.down, .dash-act-amt.down, .dash-ft-pnl.down, .dash-pf-value.down { color: var(--danger); }
.dash-pnl-sub { font-size: 10px; }
.dash-pnl-sub.up { color: var(--success); }
.dash-pnl-sub.down { color: var(--danger); }

.dash-pf-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-2); }
.dash-qa {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 8px; border-radius: var(--radius);
  background: var(--bg-elevated); border: 1px solid var(--border-color);
  color: var(--text-secondary); font-size: var(--fs-sm); font-weight: 600;
  transition: var(--transition);
}
.dash-qa:hover { color: var(--text-primary); background: var(--bg-hover); border-color: var(--border-strong); }
.dash-qa i { color: var(--accent-hover); font-size: 14px; }

.dash-pf-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-3); border-top: 1px solid var(--border-color); padding-top: var(--sp-4); }
.dash-pf-metrics > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.dash-pf-metrics dt { font-size: var(--fs-xs); color: var(--text-muted); }
.dash-pf-metrics dd { font-family: var(--font-mono); font-size: var(--fs-md); color: var(--text-primary); }
.dash-metric-asset { font-size: var(--fs-xs); color: var(--text-faint); font-family: var(--font-sans); }

/* ---- KYC banner ---- */
.dash-kyc {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--warning-soft); border: 1px solid rgba(243,175,74,.3);
  border-radius: var(--dash-radius);
}
.dash-kyc-ico { flex: 0 0 34px; width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: rgba(243,175,74,.18); color: var(--warning); }
.dash-kyc-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.dash-kyc-text strong { font-size: var(--fs-md); }
.dash-kyc-text span { font-size: var(--fs-sm); color: var(--text-secondary); }
.dash-kyc-x { color: var(--text-muted); font-size: 20px; line-height: 1; padding: 2px 6px; flex: 0 0 auto; }
.dash-kyc-x:hover { color: var(--text-primary); }

/* ---- main / aside grid ---- */
.dash-cols { display: grid; grid-template-columns: minmax(0, 1fr) 336px; gap: var(--dash-gap); align-items: start; }
.dash-main, .dash-aside { display: flex; flex-direction: column; gap: var(--dash-gap); min-width: 0; }

/* ---- section error / empty ---- */
.dash-section-err {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  padding: var(--sp-3) var(--dash-pad); font-size: var(--fs-sm); color: var(--text-secondary);
  background: var(--danger-soft); border-bottom: 1px solid rgba(240,97,109,.25);
}
.dash-empty { text-align: center; padding: var(--sp-8) var(--sp-4); color: var(--text-muted); }
.dash-empty .dash-empty-ico { display: block; font-size: 26px; opacity: .4; margin-bottom: var(--sp-2); }
.dash-empty p { font-size: var(--fs-md); margin-bottom: var(--sp-3); }
.dash-empty p:last-child { margin-bottom: 0; }
.dash-empty--chart { padding: var(--sp-10) var(--sp-4); }

/* ---- markets ---- */
.dash-mkt-tabs { display: flex; gap: 4px; padding: var(--sp-3) var(--dash-pad) 0; flex-wrap: wrap; }
.dash-tab {
  padding: 5px 12px; border-radius: var(--radius-pill);
  font-size: var(--fs-sm); color: var(--text-muted); border: 1px solid transparent;
}
.dash-tab:hover { color: var(--text-primary); }
.dash-tab.active { color: var(--text-primary); background: var(--bg-hover); border-color: var(--border-color); }
.dash-mkt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--sp-3); padding: var(--sp-4); }

/* ---- active Fixed-Time trades ---- */
.dash-ft-cards { display: flex; flex-direction: column; gap: var(--sp-2); padding: var(--sp-3) var(--dash-pad); }
.dash-ft {
  display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: var(--sp-3); align-items: center;
  padding: var(--sp-3); border: 1px solid var(--border-color);
  border-radius: var(--radius); background: var(--bg-elevated);
}
.dash-ring { position: relative; width: 56px; height: 56px; }
.dash-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.dash-ring .track { stroke: var(--border-color); }
.dash-ring .prog { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset .95s linear, stroke .3s ease; }
.dash-ring.urgent .prog { stroke: var(--danger); }
.dash-ring.done .prog { stroke: var(--warning); }
.dash-ring-t { position: absolute; inset: 0; display: grid; place-items: center; font-size: var(--fs-xs); font-weight: 700; font-family: var(--font-mono); }
.dash-ring.urgent .dash-ring-t { color: var(--danger); }
.dash-ft-b { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.dash-ft-sym { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: var(--fs-md); }
.dash-ft-sym > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-ft-dir { font-size: var(--fs-xs); font-weight: 700; padding: 1px 6px; border-radius: var(--radius-sm); }
.dash-ft-dir.up { color: var(--success); background: var(--success-soft); }
.dash-ft-dir.down { color: var(--danger); background: var(--danger-soft); }
.dash-ft-meta { display: flex; gap: var(--sp-3); font-size: var(--fs-xs); color: var(--text-muted); flex-wrap: wrap; }
.dash-ft-meta b { font-family: var(--font-mono); color: var(--text-secondary); font-weight: 500; }
.dash-ft-pnl { font-size: var(--fs-xs); font-family: var(--font-mono); color: var(--text-secondary); }
.dash-ft-go {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: var(--bg-hover); color: var(--text-secondary); flex: 0 0 auto;
}
.dash-ft-go:hover { background: var(--accent-soft); color: var(--accent-hover); }

/* ---- tables inside dash cards ---- */
.dash-tablewrap { width: 100%; overflow-x: auto; }
.dash-tablewrap table.data { width: 100%; }
.dash-tablewrap table.data th { position: static; }
.mini-table td, .mini-table th { padding: 8px 10px; font-size: var(--fs-sm); }

/* ---- recent activity ---- */
.dash-activity { list-style: none; }
.dash-act-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--sp-3); align-items: center;
  padding: var(--sp-3) var(--dash-pad); border-bottom: 1px solid var(--border-color);
}
.dash-activity li:last-child { border-bottom: none; }
.dash-act-ico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--bg-hover); color: var(--text-secondary); font-size: 12px; flex: 0 0 auto; }
.dash-act-main { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.dash-act-title { font-size: var(--fs-sm); font-weight: 500; text-transform: capitalize; }
.dash-act-sub { font-size: var(--fs-xs); color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-act-amt { font-family: var(--font-mono); font-size: var(--fs-sm); white-space: nowrap; text-align: right; }

/* ---- account status ---- */
.dash-acct { list-style: none; }
.dash-acct li { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-3) var(--dash-pad); border-bottom: 1px solid var(--border-color); }
.dash-acct li:last-child { border-bottom: none; }
.dash-acct-k { font-size: var(--fs-md); color: var(--text-secondary); }
.dash-acct-v { flex: 0 0 auto; }
.dash-pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: var(--radius-pill); font-size: var(--fs-xs); font-weight: 600; }
.dash-pill i { font-size: 10px; }
.dash-pill--ok { background: var(--success-soft); color: var(--success); }
.dash-pill--warn { background: var(--warning-soft); color: var(--warning); }
.dash-pill--pending { background: var(--bg-hover); color: var(--text-secondary); }
a.dash-pill--warn:hover { filter: brightness(1.12); }

/* ---- quick trade ---- */
.dash-qt { padding: var(--dash-pad); display: flex; flex-direction: column; gap: var(--sp-3); }
.dash-qt-field { display: flex; flex-direction: column; gap: 6px; }
.dash-qt-field > span { font-size: var(--fs-xs); color: var(--text-muted); }
.dash-qt .seg { width: 100%; }
.dash-qt .seg button { flex: 1; }
.dash-qt-hint { font-size: var(--fs-xs); margin-top: -2px; }

/* ---- responsive ---- */
@media (max-width: 1024px) {
  .dash-cols { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .dash-pf-body { align-items: stretch; }
  .dash-pf-pnl { flex: 1 1 100%; grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 720px) {
  .dash { padding: var(--sp-4); }
  .dash-mkt-grid {
    display: flex; overflow-x: auto; gap: var(--sp-3);
    scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none;
  }
  .dash-mkt-grid::-webkit-scrollbar { display: none; }
  .dash-mkt-grid > .mkt-card { flex: 0 0 68%; max-width: 260px; scroll-snap-align: start; }
  .dash-mkt-grid > .dash-empty { min-width: 100%; }
}
@media (max-width: 560px) {
  .dash-pf-actions { grid-template-columns: repeat(2, 1fr); }
  .dash-pf-metrics { grid-template-columns: repeat(2, 1fr); }
  .dash-pf-metrics > div:last-child { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
  .dash { padding: var(--sp-3); }
  .dash-greeting { font-size: var(--fs-xl); }
  .dash-pf-pnl { grid-template-columns: 1fr; }
  .dash-pf-value { font-size: 26px; }
  .dash-ft { grid-template-columns: 48px minmax(0, 1fr) auto; gap: var(--sp-2); }
  .dash-ring, .dash-ring svg { width: 48px; height: 48px; }
  .dash-card-hd { padding: var(--sp-3) var(--sp-4); }
  .dash-pf-actions .dash-qa span { font-size: var(--fs-xs); }
}

/* ============================================================ *
 *  Reusable market card (also used by markets.php via NX.marketCardHTML)
 * ============================================================ */
.mkt-card {
  display: block; padding: 13px 14px; border-radius: var(--radius); text-decoration: none;
  background: var(--bg-elevated); border: 1px solid var(--border-color);
  transition: border-color .14s ease, transform .14s ease, box-shadow .14s ease;
}
.mkt-card:hover { border-color: var(--border-strong); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.mkt-card--skel { pointer-events: none; }
.mkt-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mkt-card-sym { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: var(--fs-md); color: var(--text-primary); min-width: 0; }
.mkt-card-sym > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mkt-card-chg { font-family: var(--font-mono); font-size: var(--fs-sm); font-weight: 600; white-space: nowrap; }
.mkt-card-price { display: block; font-family: var(--font-mono); font-size: var(--fs-xl); margin: 9px 0 11px; color: var(--text-primary); }
.mkt-card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.mkt-card-grid > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mkt-card-grid > span > span { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .03em; }
.mkt-card-grid b { font-family: var(--font-mono); font-size: var(--fs-sm); font-weight: 500; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; }
.mkt-card .up { color: var(--success); }
.mkt-card .down { color: var(--danger); }

/* Generic inline state block (dashboard + funds.php) */
.dash-state { grid-column: 1 / -1; text-align: center; padding: var(--sp-8) var(--sp-4); color: var(--text-muted); font-size: var(--fs-md); }
.dash-state .btn { margin-top: 12px; }

/* ---- Wallet totals (wallet.php) ---- */
.wallet-total { display: grid; grid-template-columns: repeat(auto-fit,minmax(180px,1fr)); gap: var(--sp-4); margin-bottom: var(--sp-5); }
.asset-row-logo { width: 26px; height: 26px; border-radius: 50%; background: var(--bg-hover); display: grid; place-items: center; font-size: var(--fs-xs); font-weight: 700; }

/* QR placeholder (deposit.php / security.php) */
.qr-box { width: 168px; height: 168px; background: #fff; border-radius: var(--radius); display: grid; place-items: center; padding: 10px; }
.qr-box svg { width: 100%; height: 100%; }
.address-box { display: flex; align-items: center; gap: 8px; background: var(--bg-input); border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); padding: 10px 12px; font-family: var(--font-mono); font-size: var(--fs-sm); word-break: break-all; }

/* Notifications list (notifications.php / support.php) */
.notif-item { display: flex; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--border-color); }
.notif-item.unread { background: var(--accent-soft); }
.notif-item .ni-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; background: var(--text-faint); flex-shrink: 0; }
.notif-item.unread .ni-dot { background: var(--accent); }
.notif-item .ni-time { color: var(--text-muted); font-size: var(--fs-xs); margin-left: auto; white-space: nowrap; }
