/* ============================================================
   MonsterSolver — app / dashboard styles
   Loaded AFTER styles.css (reuses tokens + buttons).
   ============================================================ */

.app-shell { display: flex; min-height: 100vh; position: relative; z-index: 1; }

/* ---- Sidebar --------------------------------------------- */
.sidebar {
  width: 250px; flex: none; position: sticky; top: 0; align-self: flex-start;
  height: 100vh; display: flex; flex-direction: column;
  background: color-mix(in srgb, var(--bg-1) 92%, transparent);
  border-right: 1px solid var(--border); padding: 20px 16px;
}
.side-brand { display: flex; align-items: center; gap: 5px; font-family: var(--font-display); font-weight: 700; font-size: 1.08rem; padding: 6px 4px 18px; }
.side-brand .mark { width: 52px; height: 56px; flex: none; }
.side-group { margin-top: 18px; }
.side-group .glabel { font-family: var(--font-mono); font-size: 0.64rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--faint); padding: 0 10px 8px; }
.side-link { display: flex; align-items: center; gap: 11px; padding: 10px 10px; border-radius: 10px; color: var(--muted); font-size: 0.92rem; font-weight: 500; transition: background .16s, color .16s; }
.side-link svg { width: 18px; height: 18px; flex: none; }
.side-link:hover { color: var(--text); background: var(--bg-2); }
.side-link.active { color: #fff; background: var(--acc-1-soft); box-shadow: inset 0 0 0 1px var(--border-2); }
.side-link.active svg { stroke: var(--acc-2); }
.side-bottom { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 2px; }

/* ---- Main ------------------------------------------------ */
.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 66px; flex: none; display: flex; align-items: center; justify-content: space-between; padding: 0 28px; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(12px); position: sticky; top: 0; z-index: 20; }
.topbar h1 { font-size: 1.15rem; font-family: var(--font-display); }
.topbar .crumb { font-family: var(--font-mono); font-size: 0.72rem; color: var(--faint); }
.top-right { display: flex; align-items: center; gap: 14px; }
.balance-pill { display: inline-flex; align-items: center; gap: 9px; font-family: var(--font-mono); font-size: 0.8rem; background: var(--bg-1); border: 1px solid var(--border-2); border-radius: 999px; padding: 8px 14px; }
.balance-pill b { color: var(--acc-2); }
.balance-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--acc-2); box-shadow: 0 0 8px var(--acc-2); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--grad); display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; color: #fff; font-size: 0.82rem; }

.app-body { padding: 30px 28px 60px; max-width: 1120px; width: 100%; }
.app-body > .page-intro { margin-bottom: 24px; }
.page-intro h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
.page-intro p { color: var(--muted); margin-top: 6px; }

/* ---- Cards ----------------------------------------------- */
.acard { background: linear-gradient(180deg, var(--bg-1), var(--bg-2)); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 22px; }
.acard h3 { font-size: 1.05rem; margin-bottom: 4px; }
.acard .sub { color: var(--muted); font-size: 0.86rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.span-2 { grid-column: span 2; }
.row-gap { display: flex; flex-direction: column; gap: 16px; }
.mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }

/* KPI */
.kpi { background: linear-gradient(180deg, var(--bg-1), var(--bg-2)); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px; }
.kpi .k { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); }
.kpi .v { font-family: var(--font-display); font-weight: 700; font-size: 2rem; letter-spacing: -0.02em; margin-top: 8px; }
.kpi .v small { font-size: 0.95rem; color: var(--muted); font-weight: 500; }
.kpi .delta { font-family: var(--font-mono); font-size: 0.74rem; margin-top: 6px; }
.kpi .delta.up { color: var(--call); } .kpi .delta.down { color: var(--raise); }
.kpi .v.good { color: var(--call); } .kpi .v.accent { color: var(--acc-2); }

/* ---- Bar chart ------------------------------------------- */
.chart { display: flex; align-items: flex-end; gap: 6px; height: 180px; padding-top: 10px; }
.chart .col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 8px; height: 100%; }
.chart .bar { width: 100%; max-width: 30px; border-radius: 5px 5px 2px 2px; background: var(--grad); transition: height .5s cubic-bezier(.2,.7,.2,1); min-height: 3px; }
.chart .bar.muted { background: var(--bg-3); }
.chart .xl { font-family: var(--font-mono); font-size: 0.62rem; color: var(--faint); }
.chart-legend { display: flex; gap: 18px; font-family: var(--font-mono); font-size: 0.72rem; color: var(--muted); margin-top: 14px; }
.chart-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: 7px; }

/* line-ish area sparkline via bars */
.spark { display: flex; align-items: flex-end; gap: 3px; height: 60px; }
.spark span { flex: 1; background: var(--acc-2); opacity: .55; border-radius: 2px; min-height: 2px; }

/* ---- Tables ---------------------------------------------- */
.scroll-x { overflow-x: auto; }
.dtable { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.dtable th { text-align: left; font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); font-weight: 500; padding: 0 14px 12px; border-bottom: 1px solid var(--border); }
.dtable td { padding: 14px; border-bottom: 1px solid var(--border); color: var(--text); vertical-align: middle; }
.dtable td.mono, .dtable td .mono { font-family: var(--font-mono); font-size: 0.82rem; }
.dtable td.num { text-align: right; font-family: var(--font-mono); }
.dtable th.num { text-align: right; }
.dtable tbody tr:hover { background: var(--bg-1); }
.muted-txt { color: var(--muted); }
.faint-txt { color: var(--faint); }

/* status badges */
.badge2 { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 0.7rem; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border-2); }
.badge2.ok { color: #7df5b0; background: color-mix(in srgb, var(--call) 16%, transparent); border-color: transparent; }
.badge2.pend { color: #ffd27a; background: color-mix(in srgb, #ffb648 16%, transparent); border-color: transparent; }
.badge2.fail { color: #ff97a3; background: color-mix(in srgb, var(--raise) 16%, transparent); border-color: transparent; }
.badge2.neutral { color: var(--muted); }

/* ---- Forms ----------------------------------------------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); margin-bottom: 8px; }
.field input, .field select { width: 100%; background: var(--bg); border: 1px solid var(--border-2); border-radius: 10px; padding: 13px 15px; color: var(--text); font-family: var(--font-body); font-size: 0.95rem; }
.field input:focus, .field select:focus { outline: none; border-color: var(--acc-2); }
.input-prefix { position: relative; }
.input-prefix span { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--muted); font-family: var(--font-mono); }
.input-prefix input { padding-left: 30px; }

/* credit packs */
.packs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.pack { border: 1px solid var(--border-2); border-radius: var(--r-md); padding: 18px; cursor: pointer; background: var(--bg-1); transition: border-color .16s, box-shadow .16s, transform .12s; position: relative; }
.pack:hover { transform: translateY(-2px); border-color: var(--text); }
.pack.sel { border-color: transparent; box-shadow: 0 0 0 2px var(--acc-1), 0 18px 40px -22px var(--acc-1); }
.pack .amt { font-family: var(--font-display); font-weight: 700; font-size: 1.5rem; }
.pack .cr { font-family: var(--font-mono); font-size: 0.74rem; color: var(--acc-2); margin-top: 4px; }
.pack .rate { font-family: var(--font-mono); font-size: 0.68rem; color: var(--faint); margin-top: 8px; }
.pack .tag { position: absolute; top: -10px; right: 10px; font-family: var(--font-mono); font-size: 0.62rem; background: var(--grad); color: #fff; padding: 3px 9px; border-radius: 999px; }

/* subscription tiers */
.save-banner { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 0.74rem; color: var(--acc-2); border: 1px solid var(--border-2); border-radius: 999px; padding: 7px 14px; }
.subs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.subcard { position: relative; display: flex; flex-direction: column; border: 1px solid var(--border-2); border-radius: var(--r-lg); padding: 24px; background: linear-gradient(180deg, var(--bg-1), var(--bg-2)); transition: transform .16s, box-shadow .16s; }
.subcard:hover { transform: translateY(-3px); }
.subcard.feat { border-color: transparent; box-shadow: 0 0 0 1.5px var(--acc-1), 0 26px 60px -30px var(--acc-1); }
.subcard.feat::before { content:""; position:absolute; inset:0; border-radius: var(--r-lg); background: radial-gradient(70% 50% at 50% 0%, var(--acc-1-soft), transparent 65%); pointer-events:none; }
.subcard > * { position: relative; }
.subcard .badge { position: absolute; top: -11px; left: 50%; transform: translateX(-50%); font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase; background: var(--grad); color: #fff; padding: 5px 12px; border-radius: 999px; white-space: nowrap; }
.subcard .tier { font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--acc-2); }
.subcard .price { display: flex; align-items: baseline; gap: 4px; margin: 12px 0 2px; }
.subcard .price .amt { font-family: var(--font-display); font-weight: 700; font-size: 2.2rem; letter-spacing: -0.03em; }
.subcard .price .per { color: var(--muted); font-size: 0.85rem; }
.subcard .incl { font-family: var(--font-mono); font-size: 0.78rem; color: var(--text); margin-top: 6px; }
.subcard .incl b { color: var(--acc-2); }
.subcard .rate { font-family: var(--font-mono); font-size: 0.7rem; color: var(--faint); margin-top: 4px; }
.subcard ul { list-style: none; display: flex; flex-direction: column; gap: 9px; margin: 16px 0 18px; }
.subcard li { display: flex; gap: 9px; font-size: 0.88rem; align-items: flex-start; color: var(--text); }
.subcard li .tk { color: var(--acc-2); flex: none; margin-top: 1px; }
.subcard .btn { width: 100%; justify-content: center; margin-top: auto; }
@media (max-width: 1100px) { .subs { grid-template-columns: 1fr; } }

/* tariff plans (Essential / Pro) */
.plan-toggle { display: inline-flex; gap: 3px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 999px; padding: 4px; }
.plan-toggle button { font-family: var(--font-body); font-weight: 600; font-size: 0.9rem; color: var(--muted); background: transparent; border: 0; padding: 10px 26px; border-radius: 999px; cursor: pointer; }
.plan-toggle button.active { background: var(--grad); color: #fff; }
.tariffs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; align-items: start; }
.tariff-col { display: flex; flex-direction: column; }
.tariff-banner-slot { min-height: 44px; display: flex; align-items: flex-end; }
.tariff-banner { width: 100%; text-align: center; font-family: var(--font-mono); font-size: 0.74rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: #fff; background: var(--grad); padding: 11px; border-radius: var(--r-lg) var(--r-lg) 0 0; }
.tariff { position: relative; border: 1px solid var(--border-2); border-radius: var(--r-lg); padding: 30px; background: linear-gradient(180deg, var(--bg-1), var(--bg-2)); display: flex; flex-direction: column; }
.tariff.feat { border-color: transparent; box-shadow: 0 0 0 1.5px var(--acc-1), 0 30px 70px -34px var(--acc-1); border-top-left-radius: 0; border-top-right-radius: 0; }
.tariff-name { font-family: var(--font-display); font-weight: 700; font-size: 1.9rem; letter-spacing: -0.02em; }
.tariff-price { display: flex; align-items: baseline; gap: 12px; margin: 14px 0 4px; flex-wrap: wrap; }
.tariff-price .now { font-family: var(--font-display); font-weight: 700; font-size: 2.5rem; letter-spacing: -0.03em; }
.tariff-price .now .per { font-size: 1rem; color: var(--muted); font-weight: 500; }
.tariff-price .was { font-family: var(--font-display); font-weight: 700; font-size: 1.7rem; color: var(--faint); text-decoration: line-through; }
.tariff-save { color: var(--text); font-weight: 600; font-size: 0.98rem; margin-top: 8px; }
.tariff-tax { color: var(--faint); font-size: 0.82rem; margin-top: 2px; }
.tariff .btn { width: 100%; justify-content: center; margin: 22px 0; }
.tariff-flabel { color: var(--muted); font-size: 0.84rem; margin-bottom: 14px; }
.tariff-feats { list-style: none; display: flex; flex-direction: column; gap: 14px; }
.tariff-feats li { display: flex; align-items: center; gap: 12px; font-size: 0.97rem; }
.tariff-feats li.off { color: var(--faint); }
.feat-check { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; flex: none; background: var(--acc-1-soft); color: var(--acc-2); border: 1px solid var(--border-2); font-size: 0.74rem; }
.feat-check.no { background: var(--bg-3); color: var(--faint); }
@media (max-width: 1000px) { .tariffs { grid-template-columns: 1fr; } .tariff-col:not(.tariff-col-feat) .tariff-banner-slot { display: none; } .tariff.feat { border-radius: var(--r-lg); } }

/* key field */
.keybox { display: flex; align-items: center; gap: 10px; background: #08080e; border: 1px solid var(--border-2); border-radius: 10px; padding: 12px 14px; font-family: var(--font-mono); font-size: 0.84rem; }
.keybox .k { color: var(--text); flex: 1; overflow: hidden; text-overflow: ellipsis; }
.keybox button { font-family: var(--font-mono); font-size: 0.7rem; color: var(--muted); border: 1px solid var(--border-2); background: transparent; border-radius: 7px; padding: 5px 10px; cursor: pointer; }
.keybox button:hover { color: #fff; border-color: var(--text); }

/* payment method crypto */
.coins { display: flex; flex-wrap: wrap; gap: 8px; }
.coin { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 0.82rem; color: var(--muted); background: #08080e; border: 1px solid var(--border-2); border-radius: 10px; padding: 10px 14px; cursor: pointer; transition: all .16s; }
.coin:hover { color: var(--text); border-color: var(--text); }
.coin.sel { color: #fff; border-color: transparent; box-shadow: 0 0 0 1.5px var(--acc-1); }
.coin .sym { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 0.66rem; color: #08080e; }
.coin .sym.btc { background: #f7931a; } .coin .sym.eth { background: #627eea; color: #fff; } .coin .sym.trx { background: #ef0027; color: #fff; } .coin .sym.usdc { background: #2775ca; color: #fff; } .coin .sym.usdt { background: #26a17b; color: #fff; }
.crypto-detail { margin-top: 14px; padding: 14px 16px; border-radius: 10px; border: 1px solid var(--border-2); background: #08080e; font-family: var(--font-mono); font-size: 0.78rem; color: var(--muted); }
.crypto-detail b { color: var(--acc-2); }
.crypto-detail .row { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; }
.crypto-detail .addr { color: var(--text); word-break: break-all; }

/* payram processor badge */
.payram { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; padding: 11px 14px; border-radius: 10px; border: 1px solid var(--border-2); background: linear-gradient(180deg, var(--bg-1), #08080e); }
.payram .pl { display: inline-flex; align-items: center; gap: 9px; font-family: var(--font-mono); font-size: 0.8rem; color: var(--text); }
.payram .pl .pi { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; background: var(--grad); color: #fff; font-weight: 700; font-size: 0.7rem; }
.payram .pl b { color: var(--acc-2); }
.payram .ps { font-family: var(--font-mono); font-size: 0.72rem; color: var(--faint); }

/* crypto logos */
.clogo { width: 22px; height: 22px; flex: none; }
.coin .clogo { margin-right: -2px; }
.accepted { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.accepted .lbl { font-family: var(--font-mono); font-size: 0.72rem; color: var(--faint); }
.accepted .logos { display: flex; gap: 7px; }
.accepted .logos .clogo { width: 26px; height: 26px; }

/* checkout modal */
.modal[hidden] { display: none; }
.modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(4,4,9,0.72); backdrop-filter: blur(4px); }
.modal-card { position: relative; width: 100%; max-width: 420px; background: linear-gradient(180deg, var(--bg-1), var(--bg-2)); border: 1px solid var(--border-2); border-radius: var(--r-xl); padding: 28px; box-shadow: 0 40px 100px -30px rgba(0,0,0,0.85); max-height: 90vh; overflow-y: auto; }
.modal-x { position: absolute; top: 16px; right: 16px; width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--border-2); background: transparent; color: var(--muted); cursor: pointer; font-size: 0.9rem; }
.modal-x:hover { color: #fff; border-color: var(--text); }
.modal-title { font-family: var(--font-display); font-size: 1.4rem; font-weight: 700; margin-bottom: 4px; }
.modal-sub { color: var(--muted); font-size: 0.9rem; margin-bottom: 18px; }
.co-amount { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 16px; border-radius: 10px; border: 1px solid var(--border-2); background: #08080e; margin-bottom: 18px; font-family: var(--font-mono); font-size: 0.84rem; color: var(--muted); }
.co-amount b { font-family: var(--font-display); font-size: 1.5rem; color: var(--text); }
.modal-label { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); margin-bottom: 10px; }
.modal-note { font-family: var(--font-mono); font-size: 0.72rem; color: var(--faint); text-align: center; margin-top: 14px; }
.co-check { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; margin: 6px auto 16px; background: color-mix(in srgb, var(--call) 22%, transparent); border: 1px solid var(--call); color: #7df5b0; font-size: 1.6rem; }

/* progress bar */
.progress { height: 10px; border-radius: 6px; background: var(--bg-3); overflow: hidden; margin-top: 12px; }
.progress span { display: block; height: 100%; background: var(--grad); border-radius: 6px; }

/* segmented filter */
.seg { display: inline-flex; gap: 2px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 999px; padding: 3px; }
.seg button { font-family: var(--font-mono); font-size: 0.74rem; color: var(--muted); background: transparent; border: 0; padding: 7px 14px; border-radius: 999px; cursor: pointer; }
.seg button.active { background: var(--grad); color: #fff; }

/* avatar small for tables */
.uav { width: 28px; height: 28px; border-radius: 8px; background: var(--bg-3); display: inline-grid; place-items: center; font-family: var(--font-mono); font-size: 0.7rem; color: var(--acc-2); border: 1px solid var(--border-2); }
.cellflex { display: flex; align-items: center; gap: 10px; }

/* mobile sidebar */
.side-toggle { display: none; }
@media (max-width: 880px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: 60; transform: translateX(-100%); transition: transform .25s; box-shadow: 0 0 60px rgba(0,0,0,0.6); }
  .app-shell.nav-open .sidebar { transform: none; }
  .side-toggle { display: inline-flex; background: none; border: 0; color: var(--text); cursor: pointer; margin-right: 6px; }
  .grid-2, .grid-3, .grid-4, .packs { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .scroll-x { overflow-x: auto; }
  .scroll-x .dtable { min-width: 600px; }
}
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .packs { grid-template-columns: 1fr 1fr; }
}
