/* ==========================================================
   IASS Solución
   ========================================================== */
:root {
  color-scheme: dark;
  --bg: #07090d;
  --bg2: #0b0e14;
  --card: #10151d;
  --card2: #151b25;
  --card3: #1b2231;
  --line: rgba(255, 255, 255, .065);
  --line2: rgba(255, 255, 255, .11);
  --text: #e9edf5;
  --muted: #8b94a7;
  --dim: #5d6678;
  --blue: #3b82f6;
  --sky: #38bdf8;
  --up: #21c57a;
  --down: #f2475b;
  --amber: #f5a524;
  --purple: #8b5cf6;
  --cyan: #06b6d4;
  --r: 18px;
  --r-sm: 12px;
  --sidebar: 236px;
  --topbar: 68px;
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: radial-gradient(1100px 520px at 75% -12%, rgba(37, 99, 235, .09), transparent 60%), var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
svg { display: block; flex-shrink: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--sky); outline-offset: 3px; }
.num { font-variant-numeric: tabular-nums; }
.up { color: var(--up); }
.down { color: var(--down); }
.amber { color: var(--amber); }
.purple { color: #a78bfa; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.link { color: var(--sky); font-weight: 600; font-size: 13px; }
.link:hover { text-decoration: underline; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .08); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, .16); }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: var(--sidebar) 1fr; height: 100vh; }
body:not(.authed) .app { visibility: hidden; }
.main { display: flex; flex-direction: column; min-width: 0; height: 100vh; overflow: hidden; }

/* ---------- sidebar ---------- */
.sidebar {
  background: var(--bg2);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 26px;
  padding: 18px 14px;
  min-height: 0;
  overflow-y: auto;
}
.brand { display: flex; flex-direction: column; align-items: flex-start; gap: 9px; padding: 4px 8px; }
.brand-label { font-size: 11.5px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--sky); }
.brand-mark {
  width: 38px; height: 38px; border-radius: 12px;
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  display: grid; place-items: center; font-weight: 800; font-size: 16px;
  box-shadow: 0 8px 24px rgba(37, 99, 235, .35);
}
.brand-mark.lg { width: 54px; height: 54px; border-radius: 16px; font-size: 23px; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a, .nav-btn {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 13px; border-radius: 12px;
  color: var(--muted); font-weight: 600; width: 100%;
  transition: background .15s, color .15s;
}
.nav a:hover, .nav-btn:hover { background: rgba(255, 255, 255, .04); color: var(--text); }
.nav a.active { background: linear-gradient(90deg, rgba(59, 130, 246, .2), rgba(59, 130, 246, .04)); color: #fff; box-shadow: inset 3px 0 0 var(--blue); }
.nav a.active svg { color: var(--sky); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.demo-card {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px; border-radius: 14px;
  background: linear-gradient(135deg, rgba(245, 165, 36, .12), rgba(245, 165, 36, .03));
  border: 1px solid rgba(245, 165, 36, .22);
}
.demo-ic { width: 30px; height: 30px; border-radius: 9px; background: rgba(245, 165, 36, .18); color: var(--amber); display: grid; place-items: center; flex-shrink: 0; }
.demo-card b { display: block; font-size: 13px; color: #fcd58b; }
.demo-card span { font-size: 11.5px; color: var(--muted); line-height: 1.35; display: block; }

/* ---------- topbar ---------- */
.topbar {
  height: var(--topbar); flex-shrink: 0;
  display: flex; align-items: center; gap: 18px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 9, 13, .6);
  backdrop-filter: blur(10px);
  position: relative; z-index: 20;
}
.topbar h1 { font-size: 19px; font-weight: 700; letter-spacing: -.01em; min-width: 110px; }
.search-btn {
  display: flex; align-items: center; gap: 10px;
  height: 40px; padding: 0 12px 0 14px; width: min(340px, 34vw);
  border-radius: 12px; background: var(--card); border: 1px solid var(--line);
  color: var(--dim); font-size: 13px; transition: border-color .15s;
}
.search-btn:hover { border-color: var(--line2); color: var(--muted); }
.search-btn span { flex: 1; text-align: left; }
kbd {
  font-family: inherit; font-size: 11px; font-weight: 700;
  padding: 1px 6px; border-radius: 6px;
  background: rgba(255, 255, 255, .06); border: 1px solid var(--line2); color: var(--muted);
}
.tb-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.acct {
  display: flex; align-items: center; gap: 10px;
  height: 46px; padding: 0 12px 0 14px; border-radius: 13px;
  background: var(--card); border: 1px solid var(--line);
}
.acct:hover { border-color: var(--line2); }
.acct-ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(135deg, #1d4ed8, #38bdf8); color: #fff; }
.acct-txt { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }
.acct-txt small { font-size: 11px; color: #fcd58b; font-weight: 700; white-space: nowrap; }
.acct-txt b { font-size: 16px; }
.tb-transfer { height: 42px; }
.acct-line { display: flex; align-items: center; gap: 10px; padding: 10px; margin-bottom: 6px; border-radius: 12px; background: rgba(255, 255, 255, .03); border: 1px solid var(--line); }
.acct-line div { flex: 1; min-width: 0; }
.acct-line div b { display: block; font-size: 13px; }
.acct-line small { color: var(--muted); font-size: 11.5px; }
.acct-line > b { font-size: 14px; }
.acct-sw { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: var(--c); background: color-mix(in srgb, var(--c) 18%, transparent); flex-shrink: 0; }
.pop-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pop-btns .btn { margin-top: 12px; }
.link-btn { color: var(--sky); font-weight: 700; font-size: 11.5px; }
.link-btn:hover { text-decoration: underline; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center; position: relative;
  background: var(--card); border: 1px solid var(--line); color: var(--muted);
  transition: color .15s, border-color .15s;
}
.icon-btn:hover { color: var(--text); border-color: var(--line2); }
.icon-btn.sm { width: 32px; height: 32px; border-radius: 9px; }
.bell-dot { position: absolute; top: 9px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--down); box-shadow: 0 0 0 2px var(--card); }
.simulation-strip {
  display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between;
  gap: 5px 18px; flex-wrap: wrap; padding: 8px 24px;
  border-bottom: 1px solid rgba(245, 165, 36, .22);
  background: #17140f; color: #fcd58b; font-size: 12px; font-weight: 700;
}
.simulation-strip > span:first-child { display: flex; align-items: center; gap: 7px; }
.simulation-holder { color: #b9b2a6; min-width: 0; overflow-wrap: anywhere; }
.simulation-holder b { margin-left: 5px; color: var(--text); }
.avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: linear-gradient(135deg, #8b5cf6, #3b82f6);
  font-weight: 800; font-size: 16px; display: grid; place-items: center;
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px rgba(139, 92, 246, .5);
}

/* ---------- acceso ---------- */
.auth {
  position: fixed; inset: 0; z-index: 300;
  display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(900px 500px at 50% -10%, rgba(37, 99, 235, .22), transparent 60%),
    radial-gradient(700px 500px at 100% 100%, rgba(139, 92, 246, .14), transparent 60%),
    #05070b;
  overflow: auto;
}
body.authed .auth { display: none; }
.auth-card {
  width: min(400px, 100%);
  background: linear-gradient(180deg, rgba(21, 27, 37, .96), rgba(16, 21, 29, .98));
  border: 1px solid var(--line2); border-radius: 22px;
  padding: 30px 28px 24px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
  animation: fadeIn .4s ease;
}
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.auth-label { font-size: 13px; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; color: var(--sky); }
.auth-sub { text-align: center; color: var(--muted); margin-top: 12px; font-size: 13.5px; }
.auth-title { margin-top: 20px; font-size: 23px; line-height: 1.2; text-align: center; }
.auth-back { padding: 10px 4px; text-align: center; }
.auth-demo {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  margin: 14px auto 0; width: fit-content; padding: 6px 13px; border-radius: 999px;
  background: rgba(245, 165, 36, .12); border: 1px solid rgba(245, 165, 36, .3);
  color: #fcd58b; font-size: 12px; font-weight: 700; text-align: center;
}
.auth-form { display: flex; flex-direction: column; gap: 14px; margin-top: 24px; }
.auth-in { display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 14px; border-radius: 13px; background: var(--card); border: 1px solid var(--line2); color: var(--dim); }
.auth-in:focus-within { border-color: rgba(59, 130, 246, .6); color: var(--sky); }
.auth-in input { flex: 1; min-width: 0; height: 100%; background: none; border: 0; outline: 0; font-weight: 600; font-size: 15px; color: var(--text); }
.auth-err { margin-top: 12px; font-size: 13px; color: #ff9fa9; font-weight: 600; }
.auth-err:empty { margin: 0; }
.auth-go { height: 50px; font-size: 15px; margin-top: 2px; }
.auth-note { margin-top: 20px; font-size: 13px; line-height: 1.5; color: var(--muted); text-align: center; }
.tr-note.simulation-note { color: #fcd58b; }

/* ---------- cuenta y administración de práctica ---------- */
.portal-view { padding-inline: clamp(14px, 3vw, 42px); }
.portal-view > * { max-width: 1040px; margin-inline: auto; }
.portal-header { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 14px 24px; }
.portal-header h2 { font-size: clamp(22px, 3vw, 32px); line-height: 1.2; letter-spacing: -.025em; }
.portal-header p { margin-top: 6px; }
.portal-muted { color: #a9b4c5; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.portal-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.portal-view .btn { min-height: 44px; height: auto; padding-block: 8px; white-space: normal; text-align: center; }
.portal-feedback { margin-block: 12px; min-height: 21px; color: #bfdbfe; font-size: 13px; font-weight: 700; }
.portal-feedback.is-error { color: #ff9fa9; }
.portal-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 5fr); gap: 14px; }
.portal-panel { min-width: 0; padding: 20px; background: var(--card); border: 1px solid var(--line2); border-radius: 15px; }
.portal-panel h3 { margin-bottom: 6px; font-size: 16px; font-weight: 750; }
.portal-credit-panel {
  border-color: #2a4870;
  background: linear-gradient(155deg, #14243a 0%, var(--card) 78%);
}
.portal-credit { display: block; margin-block: 12px 9px; color: #e8f3ff; font-size: clamp(28px, 4.2vw, 48px); line-height: 1.05; overflow-wrap: anywhere; }
.portal-movements { margin-top: 14px; }
.portal-list { margin-top: 12px; list-style: none; }
.portal-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; min-height: 57px; padding-block: 10px; border-top: 1px solid var(--line2); }
.portal-list li > div { min-width: 0; overflow-wrap: anywhere; }
.portal-list strong { display: block; font-size: 13px; }
.portal-list small, .portal-user-summary small { display: block; margin-top: 2px; color: #a9b4c5; font-size: 12px; font-weight: 600; }
.portal-status {
  display: inline-flex; align-items: center; margin-top: 5px; padding: 3px 8px;
  border-radius: 6px; background: #1b2534; color: #c2cada; font-size: 11px; font-weight: 750;
}
.portal-status.status-pending, .portal-status.status-invited { background: #352913; color: #fcd58b; }
.portal-status.status-approved, .portal-status.status-active { background: #123125; color: #8ce6b6; }
.portal-status.status-rejected { background: #382329; color: #ffb1b9; }
.portal-form, .portal-invite-result { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 10px; align-items: end; margin-top: 12px; }
.portal-form .fld-in, .portal-invite-result .fld-in { min-width: 0; }
.portal-form input, .portal-invite-result input { min-width: 0; width: 100%; min-height: 44px; }
.portal-invitation > .portal-muted { margin-top: 10px; }
.portal-invite-result { grid-template-columns: minmax(0, 1fr) auto; border-top: 1px solid var(--line2); padding-top: 14px; }
.portal-invite-result > p { grid-column: 1 / -1; }
.portal-admin-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-block: 18px 10px; }
#adminUsers { display: grid; gap: 9px; }
.portal-user { padding: 0; overflow: hidden; }
.portal-user-summary {
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(100px, auto);
  align-items: center; gap: 12px; min-height: 61px; padding: 12px 16px; cursor: pointer; list-style: none;
}
.portal-user-summary::-webkit-details-marker { display: none; }
.portal-user-summary:focus-visible { outline-offset: -4px; }
.portal-user-summary:hover { background: var(--card2); }
.portal-user-summary > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.portal-user-summary > .portal-status { margin-top: 0; }
.portal-user-credit { display: flex; align-items: center; justify-content: end; gap: 5px; white-space: nowrap; }
.portal-user-credit::after {
  content: ''; width: 6px; height: 6px; margin-left: 6px;
  border-right: 2px solid var(--sky); border-bottom: 2px solid var(--sky); transform: rotate(45deg);
}
.portal-user[open] .portal-user-credit::after { transform: rotate(225deg); }
.portal-user-body { padding: 4px 16px 16px; border-top: 1px solid var(--line2); }
.portal-document-admin:not(:first-child) { margin-top: 20px; }
.portal-document-admin:first-child { margin-top: 10px; }

@media (max-width: 850px) {
  .portal-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 570px) {
  .portal-panel { padding: 14px; }
  .portal-user { padding: 0; }
  .portal-user-summary { grid-template-columns: minmax(0, 1fr) auto; gap: 5px 10px; }
  .portal-user-summary > .portal-status { grid-row: 2; justify-self: start; }
  .portal-user-credit { grid-column: 2; grid-row: 1 / 3; }
  .portal-form { grid-template-columns: minmax(0, 1fr); }
  .portal-document-list li { flex-wrap: wrap; }
}

/* ---------- popovers ---------- */
.dd { position: relative; }
.pop {
  position: absolute; top: calc(100% + 8px); z-index: 50;
  min-width: 270px; padding: 14px;
  background: #121824; border: 1px solid var(--line2); border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .55);
  opacity: 0; transform: translateY(-6px) scale(.98); pointer-events: none;
  transition: opacity .15s, transform .15s;
}
.pop.open { opacity: 1; transform: none; pointer-events: auto; }
.pop-right { right: 0; }
.pop-left { left: 0; }
.pop-wide { width: 340px; }
.pop-title { font-weight: 700; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.pop-row { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 13px; color: var(--muted); }
.pop-row b { color: var(--text); }
.pop-row b.up { color: var(--up); }
.pop-row b.down { color: var(--down); }
.pop .btn { margin-top: 12px; }
.pop-note { margin-top: 10px; font-size: 11.5px; color: var(--dim); line-height: 1.4; }
.notif-list { max-height: 360px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; margin: 0 -6px; }
.nt { display: flex; gap: 10px; padding: 9px 6px; border-radius: 10px; }
.nt:hover { background: rgba(255, 255, 255, .03); }
.nt b { display: block; font-size: 13px; }
.nt small { color: var(--muted); font-size: 11.5px; }
.nt-ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; background: rgba(59, 130, 246, .15); color: var(--sky); }
.nt-ic.win { background: rgba(33, 197, 122, .14); color: var(--up); }
.nt-ic.loss { background: rgba(242, 71, 91, .14); color: var(--down); }
.nt-ic.plan, .nt-ic.refill { background: rgba(245, 165, 36, .14); color: var(--amber); }
.nt-ic.transfer { background: rgba(59, 130, 246, .16); color: var(--sky); }

/* ---------- generic ---------- */
.view { display: none; flex: 1; overflow-y: auto; padding: 26px 28px 48px; min-height: 0; }
.view.active { display: block; animation: fadeIn .25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.card {
  background: linear-gradient(180deg, var(--card2), var(--card));
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 18px;
  position: relative;
}
.card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.card-head h3 { font-size: 15px; font-weight: 700; margin-right: auto; }
.badge { font-size: 10.5px; font-weight: 800; padding: 3px 7px; border-radius: 6px; background: rgba(59, 130, 246, .16); color: #93c5fd; letter-spacing: .03em; }
.badge-amber { background: rgba(245, 165, 36, .16); color: #fcd58b; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-size: 12px; color: var(--muted); font-weight: 600; }
.chip svg { color: var(--dim); }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--up); box-shadow: 0 0 0 0 rgba(33, 197, 122, .6); animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(33, 197, 122, .55); } 70% { box-shadow: 0 0 0 8px rgba(33, 197, 122, 0); } 100% { box-shadow: 0 0 0 0 rgba(33, 197, 122, 0); } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 11px; font-weight: 700; font-size: 13.5px;
  transition: filter .15s, background .15s, transform .08s;
  white-space: nowrap;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: linear-gradient(135deg, #2563eb, #3b82f6); color: #fff; box-shadow: 0 6px 18px rgba(37, 99, 235, .3); }
.btn-primary:hover { filter: brightness(1.1); }
.btn-soft { background: rgba(255, 255, 255, .06); border: 1px solid var(--line2); }
.btn-soft:hover { background: rgba(255, 255, 255, .1); }
.btn-ghost { background: transparent; border: 1px solid var(--line2); color: var(--muted); }
.btn-danger { background: rgba(242, 71, 91, .15); color: #ff8a98; border: 1px solid rgba(242, 71, 91, .3); }
.btn-danger:hover { background: rgba(242, 71, 91, .25); }
.btn-amber { background: var(--amber); color: #1a1205; }
.btn-amber:hover { filter: brightness(1.08); }
.btn-block { width: 100%; }
.btn-sm { height: 32px; padding: 0 12px; border-radius: 9px; font-size: 12.5px; }
.btn-xs { height: 28px; padding: 0 10px; border-radius: 8px; font-size: 12px; }
.btn:disabled { opacity: .55; cursor: default; filter: none; transform: none; }

.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--bg2); border: 1px solid var(--line); border-radius: 11px; }
.seg button { height: 32px; padding: 0 12px; border-radius: 8px; color: var(--muted); font-weight: 600; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; transition: background .15s, color .15s; }
.seg button:hover { color: var(--text); }
.seg button.active { background: var(--card3); color: #fff; box-shadow: 0 1px 0 rgba(255, 255, 255, .06) inset, 0 2px 8px rgba(0, 0, 0, .3); }
.seg.sm button { height: 28px; padding: 0 10px; font-size: 12.5px; }
.seg-full { display: flex; }
.seg-full button { flex: 1; justify-content: center; }
.count { font-size: 11px; font-weight: 800; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: rgba(59, 130, 246, .25); color: #bfdbfe; display: inline-grid; place-items: center; }
.count:empty { display: none; }

.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tab { height: 34px; padding: 0 14px; border-radius: 10px; color: var(--muted); font-weight: 600; font-size: 13px; transition: background .15s, color .15s; }
.tab:hover { color: var(--text); background: rgba(255, 255, 255, .04); }
.tab.active { background: rgba(59, 130, 246, .16); color: #bfdbfe; }

.search { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; background: var(--bg2); border: 1px solid var(--line); border-radius: 11px; color: var(--dim); }
.search:focus-within { border-color: rgba(59, 130, 246, .5); }
.search input { background: none; border: 0; outline: 0; flex: 1; min-width: 0; color: var(--text); }
.search.lg { height: 46px; font-size: 15px; }

.select {
  height: 38px; padding: 0 32px 0 12px; border-radius: 10px;
  background: var(--bg2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b94a7' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 11px center;
  border: 1px solid var(--line); appearance: none; outline: 0; font-size: 13px; font-weight: 600;
}
.select.sm { height: 30px; font-size: 12px; padding-left: 10px; }
.select option { background: #121824; }

.empty { color: var(--muted); padding: 26px 12px; text-align: center; font-size: 13px; }
.empty.sm { padding: 14px 8px; }

.aicon {
  --s: 32px;
  width: var(--s); height: var(--s); min-width: var(--s);
  border-radius: 50%;
  display: inline-grid; place-items: center;
  font-weight: 800; font-size: calc(var(--s) * .34); letter-spacing: -.03em;
  color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
  background: radial-gradient(circle at 30% 25%, color-mix(in srgb, var(--c) 65%, white), var(--c) 55%, color-mix(in srgb, var(--c) 65%, black));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14), 0 2px 6px rgba(0, 0, 0, .3);
}

.bar { height: 7px; border-radius: 6px; background: rgba(255, 255, 255, .06); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, #16a34a, #22c55e); transition: width .4s ease; }
.bar-red i { background: linear-gradient(90deg, #e11d48, #f2475b); }

.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; font-size: 13px; color: var(--muted); user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .sw { width: 40px; height: 23px; border-radius: 12px; background: rgba(255, 255, 255, .1); position: relative; flex-shrink: 0; transition: background .2s; }
.switch .sw::after { content: ''; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch input:checked + .sw { background: var(--blue); }
.switch input:checked + .sw::after { transform: translateX(17px); }
.switch input:focus-visible + .sw { outline: 2px solid var(--sky); outline-offset: 2px; }

/* ---------- tables ---------- */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-size: 11.5px; font-weight: 700; color: var(--dim); text-transform: uppercase; letter-spacing: .04em; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: rgba(255, 255, 255, .02); }
.cell-asset { display: flex; align-items: center; gap: 10px; }
.cell-asset b { font-weight: 700; }
.cell-asset small { display: block; color: var(--muted); font-size: 11.5px; font-weight: 500; }
.tbadge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px 3px 6px; border-radius: 7px; font-weight: 700; font-size: 12px; }
.tbadge.up { background: rgba(33, 197, 122, .12); }
.tbadge.down { background: rgba(242, 71, 91, .12); }
.res { display: inline-block; padding: 3px 9px; border-radius: 7px; font-weight: 700; font-size: 12px; }
.res.win { background: rgba(33, 197, 122, .14); color: var(--up); }
.res.loss { background: rgba(242, 71, 91, .14); color: var(--down); }
.res.tie { background: rgba(255, 255, 255, .08); color: var(--muted); }
.tcell { display: flex; flex-direction: column; gap: 4px; min-width: 70px; }
.mini-prog { height: 4px; border-radius: 3px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.mini-prog i { display: block; height: 100%; background: var(--amber); border-radius: 3px; }

.fl-up { animation: flUp .7s ease; }
.fl-down { animation: flDown .7s ease; }
@keyframes flUp { 0% { background: rgba(33, 197, 122, .25); } 100% { background: transparent; } }
@keyframes flDown { 0% { background: rgba(242, 71, 91, .25); } 100% { background: transparent; } }

/* ==========================================================
   DASHBOARD
   ========================================================== */
.dash-head { margin-bottom: 22px; }
.hello { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.wave { display: inline-block; animation: wave 2.4s ease-in-out 1; transform-origin: 70% 70%; }
@keyframes wave { 0%, 60%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(14deg); } 20% { transform: rotate(-8deg); } 40% { transform: rotate(-4deg); } 50% { transform: rotate(10deg); } }
.sub { color: var(--muted); margin-top: 2px; }
.chips-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 20px; align-items: start; }
.dash-main { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.dash-side { display: flex; flex-direction: column; gap: 20px; }

.row-cards { display: grid; grid-template-columns: 1.15fr 1fr 1fr; gap: 16px; }
.card-grad {
  background:
    radial-gradient(400px 200px at 100% 0%, rgba(255, 255, 255, .22), transparent 60%),
    linear-gradient(135deg, #1d4ed8 0%, #2563eb 35%, #0ea5e9 75%, #38bdf8 100%);
  border: 0; color: #fff; min-height: 168px;
  display: flex; flex-direction: column;
  box-shadow: 0 18px 40px rgba(37, 99, 235, .3);
  overflow: hidden;
}
.card-grad::after { content: ''; position: absolute; right: -60px; bottom: -80px; width: 220px; height: 220px; border-radius: 50%; border: 30px solid rgba(255, 255, 255, .07); }
.cg-top { display: flex; justify-content: space-between; align-items: center; font-size: 13px; font-weight: 600; opacity: .92; }
.cg-eye { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: rgba(255, 255, 255, .16); }
.cg-eye:hover { background: rgba(255, 255, 255, .26); }
.cg-amount { font-size: 34px; font-weight: 800; letter-spacing: -.02em; margin-top: 8px; }
.cg-delta { font-size: 12.5px; opacity: .92; display: flex; align-items: center; gap: 6px; }
.pill-w { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, .18); font-weight: 700; }
.cg-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .2); font-size: 12.5px; font-weight: 700; letter-spacing: .08em; position: relative; z-index: 1; }
.cg-btn { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: rgba(255, 255, 255, .18); }
.cg-btn:hover { background: rgba(255, 255, 255, .3); }

.stat-card { display: flex; flex-direction: column; min-height: 168px; }
.sc-top { display: flex; justify-content: space-between; align-items: center; font-size: 13px; font-weight: 700; }
.sc-amount { font-size: 28px; font-weight: 800; margin-top: 10px; letter-spacing: -.02em; }
.sc-sub { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.sc-sub b { color: var(--text); }
.sc-action {
  position: absolute; right: 16px; bottom: 16px;
  width: 46px; height: 46px; border-radius: 13px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #1d4ed8, #3b82f6); color: #fff;
  box-shadow: 0 8px 20px rgba(37, 99, 235, .35);
  transition: transform .15s;
}
.sc-action:hover { transform: translateY(-2px); }
.sc-action.purple-bg { background: linear-gradient(135deg, #6d28d9, #8b5cf6); box-shadow: 0 8px 20px rgba(139, 92, 246, .35); }
.stat-card .sc-sub + .sc-sub { margin-top: 2px; }

/* ---------- transferencias ---------- */
.tr-box { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.tr-acct { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--line2); }
.tr-acct .acct-sw { width: 38px; height: 38px; border-radius: 11px; }
.tr-acct div { flex: 1; }
.tr-acct small { display: block; color: var(--muted); font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.tr-acct b { display: block; font-size: 14.5px; }
.tr-acct span.num { font-weight: 800; font-size: 15px; }
.tr-swap { align-self: center; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; margin: -18px 0; z-index: 1; background: #1b2231; border: 1px solid var(--line2); color: var(--sky); transition: transform .25s; }
.tr-swap:hover { transform: rotate(180deg); }
.tr-amount { display: flex; align-items: center; gap: 6px; height: 60px; padding: 0 16px; border-radius: 14px; background: var(--bg2); border: 1px solid var(--line2); font-size: 26px; font-weight: 800; margin-top: 6px; }
.tr-amount:focus-within { border-color: rgba(59, 130, 246, .6); }
.tr-amount span { color: var(--muted); }
.tr-amount input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; font-weight: 800; font-size: 26px; -moz-appearance: textfield; }
.tr-amount input::-webkit-outer-spin-button, .tr-amount input::-webkit-inner-spin-button { -webkit-appearance: none; }
.tr-note { font-size: 12px; color: var(--muted); }
.tr-err { font-size: 12.5px; color: #ff8a98; min-height: 18px; }
.tr-done { text-align: center; padding: 10px 0 4px; }
.tr-done .ok { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 14px; background: rgba(33, 197, 122, .15); color: var(--up); box-shadow: 0 0 0 8px rgba(33, 197, 122, .06); }
.tr-done h4 { font-size: 18px; }
.tr-done p { color: var(--muted); margin-top: 4px; font-size: 13px; }
.tr-done .amt { font-size: 30px; font-weight: 800; margin: 12px 0 4px; }

.card-dashed {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  min-height: 168px; background: rgba(255, 255, 255, .015);
  border: 1.5px dashed var(--line2); color: var(--muted); font-weight: 600; font-size: 13px;
  transition: border-color .15s, color .15s, background .15s;
}
.card-dashed:hover { border-color: rgba(59, 130, 246, .55); color: var(--text); background: rgba(59, 130, 246, .05); }
.card-dashed .plus { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: rgba(59, 130, 246, .14); color: var(--sky); }

.quick { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.qa {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 16px; border-radius: 16px; text-align: left;
  background: linear-gradient(180deg, var(--card2), var(--card));
  border: 1px solid var(--line);
  transition: border-color .15s, transform .15s;
}
.qa:hover { border-color: var(--line2); transform: translateY(-2px); }
.qa-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--c); color: #fff; margin-bottom: 10px; box-shadow: 0 6px 16px color-mix(in srgb, var(--c) 40%, transparent); }
.qa b { font-size: 13.5px; }
.qa small { color: var(--muted); font-size: 11.5px; }

.open-banner { border: 1px solid rgba(245, 165, 36, .45); background: linear-gradient(180deg, rgba(245, 165, 36, .06), rgba(245, 165, 36, .015)), var(--card); }
.ob-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 6px; }
.ob-head b { display: block; font-size: 15px; }
.ob-head small { color: var(--muted); font-size: 12.5px; }
.ob-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.ob-row:first-child { border-top: 0; }
.ob-info { flex: 1; min-width: 0; }
.ob-info b { display: block; font-size: 13.5px; }
.ob-info small { color: var(--muted); font-size: 12px; }
.ob-amt { text-align: right; }
.ob-amt b { display: block; font-size: 15px; }
.ob-amt small { color: var(--amber); font-size: 12px; font-weight: 700; }
.ob-empty { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 10px; color: var(--muted); font-size: 13px; }

.row-2 { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 20px; }
.row-2b { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); font-weight: 600; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.perf-sum { display: flex; gap: 28px; margin-bottom: 8px; }
.perf-sum small { display: block; color: var(--muted); font-size: 12px; }
.perf-sum b { font-size: 19px; font-weight: 800; }
.perf-canvas { height: 210px; }
.perf-canvas canvas { width: 100%; height: 100%; display: block; }

.tcard {
  border-radius: 16px; padding: 18px; min-height: 178px;
  display: flex; flex-direction: column; gap: 10px;
  background:
    radial-gradient(300px 140px at 90% 0%, rgba(139, 92, 246, .35), transparent 70%),
    linear-gradient(135deg, #1e293b, #172554 60%, #1e1b4b);
  border: 1px solid rgba(255, 255, 255, .1);
  box-shadow: 0 14px 30px rgba(0, 0, 0, .35);
  position: relative; overflow: hidden;
}
.tcard::before { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(115deg, rgba(255, 255, 255, .025) 0 2px, transparent 2px 12px); pointer-events: none; }
.tc-top { display: flex; justify-content: space-between; align-items: center; }
.tc-chip { width: 34px; height: 26px; border-radius: 6px; background: linear-gradient(135deg, #fde68a, #d97706); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .2); }
.tc-brand { font-weight: 800; font-style: italic; letter-spacing: .06em; font-size: 16px; }
.tc-level { font-size: 13px; color: #c7d2fe; margin-top: 6px; }
.tc-level b { font-size: 20px; color: #fff; }
.tc-xp { display: flex; align-items: center; gap: 10px; font-size: 11.5px; color: #a5b4fc; }
.tc-bar { flex: 1; height: 6px; border-radius: 4px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.tc-bar i { display: block; height: 100%; background: linear-gradient(90deg, #8b5cf6, #38bdf8); border-radius: 4px; }
.tc-foot { margin-top: auto; display: flex; justify-content: space-between; }
.tc-foot small { display: block; font-size: 9.5px; letter-spacing: .1em; color: #94a3b8; }
.tc-foot b { font-size: 13.5px; }
.tc-foot .r { text-align: right; }
.tc-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.tc-stats div { background: rgba(255, 255, 255, .03); border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.tc-stats small { display: block; color: var(--muted); font-size: 11px; }
.tc-stats b { font-size: 14px; }

.feat-list { display: flex; flex-direction: column; }
.feat-row { display: flex; align-items: center; gap: 12px; padding: 10px 6px; border-radius: 12px; text-align: left; width: 100%; transition: background .15s; }
.feat-row:hover { background: rgba(255, 255, 255, .03); }
.feat-name { flex: 1; min-width: 0; }
.feat-name b, .feat-price b { display: block; font-size: 13.5px; }
.feat-name small { color: var(--muted); font-size: 11.5px; }
.feat-spark { width: 96px; }
.feat-price { text-align: right; min-width: 92px; }
.feat-price b { border-radius: 5px; padding: 0 3px; margin-right: -3px; }
.feat-price small { font-size: 12px; font-weight: 700; }
.spark { display: block; overflow: visible; }

.cal-list { display: flex; flex-direction: column; }
.cal-row { display: grid; grid-template-columns: 46px 40px 1fr auto; align-items: center; gap: 8px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 12.5px; }
.cal-row:first-child { border-top: 0; }
.cal-row.past { opacity: .55; }
.cal-time { font-weight: 700; color: var(--muted); }
.cal-cur { font-weight: 800; font-size: 11px; padding: 2px 0; text-align: center; border-radius: 6px; background: rgba(255, 255, 255, .06); }
.cal-name { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.imp { display: flex; gap: 3px; }
.imp i { width: 12px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .1); }
.imp i.on { background: var(--amber); }
.cal-st { font-size: 11.5px; font-weight: 700; color: var(--sky); white-space: nowrap; }
.cal-st.done { color: var(--muted); }

.act-list { display: flex; flex-direction: column; gap: 2px; }
.act { display: flex; align-items: center; gap: 11px; padding: 8px 0; }
.act-ic { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; background: rgba(59, 130, 246, .14); color: var(--sky); }
.act-ic.win { background: rgba(33, 197, 122, .14); color: var(--up); }
.act-ic.loss { background: rgba(242, 71, 91, .14); color: var(--down); }
.act-ic.plan, .act-ic.refill { background: rgba(245, 165, 36, .14); color: var(--amber); }
.act-txt { flex: 1; min-width: 0; }
.act-txt b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.act-txt small { color: var(--muted); font-size: 11.5px; }
.act-amt { font-weight: 800; font-size: 13px; }

.goal-row { display: flex; align-items: center; gap: 11px; margin-bottom: 12px; }
.goal-ic { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: rgba(33, 197, 122, .15); color: var(--up); box-shadow: 0 0 0 4px rgba(33, 197, 122, .07); }
.goal-txt { flex: 1; }
.goal-txt b { display: block; font-size: 14px; }
.goal-txt small { color: var(--muted); font-size: 12px; }
.goal-pct { font-weight: 800; font-size: 15px; }
#goalBox > small { display: block; margin-top: 8px; font-size: 12px; }
.goal-sub { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin: 14px 0 7px; }
.goal-sub b { color: var(--text); }
.goal-sub b.down { color: var(--down); }

.health-body { display: flex; align-items: center; gap: 18px; }
.ring { position: relative; width: 104px; height: 104px; flex-shrink: 0; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-txt { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; line-height: 1.05; }
.ring-txt b { font-size: 26px; font-weight: 800; display: block; }
.ring-txt small { color: var(--muted); font-size: 11px; }
.health-info b { display: block; font-size: 16px; }
.health-info p { color: var(--muted); font-size: 12.5px; margin-top: 4px; }

.lead-list { display: flex; flex-direction: column; }
.lead { display: flex; align-items: center; gap: 10px; padding: 8px 0; font-size: 13px; }
.lead.me { margin-top: 6px; padding: 10px; border-radius: 12px; background: rgba(59, 130, 246, .08); border: 1px solid rgba(59, 130, 246, .2); }
.lead-pos { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; font-weight: 800; font-size: 11.5px; background: rgba(255, 255, 255, .06); color: var(--muted); }
.lead-pos.p1 { background: linear-gradient(135deg, #fde68a, #f59e0b); color: #3b2a05; }
.lead-pos.p2 { background: linear-gradient(135deg, #e5e7eb, #9ca3af); color: #1f2937; }
.lead-pos.p3 { background: linear-gradient(135deg, #fdba74, #c2410c); color: #2a1206; }
.lead-av { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 12px; background: hsl(var(--h, 220) 55% 40%); }
.lead-name { flex: 1; min-width: 0; }
.lead-name b { display: block; font-size: 13px; }
.lead-name small { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .04em; }

/* ==========================================================
   TRADE
   ========================================================== */
.view-trade.active { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.asset-tabs { display: flex; align-items: center; gap: 6px; padding: 9px 14px; border-bottom: 1px solid var(--line); overflow-x: auto; flex-shrink: 0; background: var(--bg2); }
.atab {
  display: flex; align-items: center; gap: 9px;
  height: 44px; padding: 0 10px 0 7px; border-radius: 12px;
  background: var(--card); border: 1px solid var(--line);
  flex-shrink: 0; transition: border-color .15s, background .15s;
}
.atab:hover { border-color: var(--line2); }
.atab.active { background: linear-gradient(180deg, rgba(59, 130, 246, .2), rgba(59, 130, 246, .07)); border-color: rgba(59, 130, 246, .5); }
.atab-txt { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }
.atab-txt b { font-size: 13px; }
.atab-txt small { font-size: 11.5px; color: var(--up); font-weight: 700; }
.atab-x { width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; color: var(--dim); font-size: 16px; margin-left: 2px; }
.atab-x:hover { background: rgba(255, 255, 255, .08); color: var(--text); }
.atab-add { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; border: 1.5px dashed var(--line2); color: var(--muted); flex-shrink: 0; }
.atab-add:hover { color: var(--sky); border-color: rgba(59, 130, 246, .55); }

.trade-body { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 312px; min-height: 0; }
.chart-col { display: flex; flex-direction: column; min-width: 0; min-height: 0; border-right: 1px solid var(--line); }
.chart-toolbar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; position: relative; z-index: 5; }
.tb-sp { flex: 1; }
.tool-btn { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 12px; border-radius: 11px; background: var(--bg2); border: 1px solid var(--line); color: var(--muted); font-weight: 600; font-size: 13px; }
.tool-btn:hover { color: var(--text); border-color: var(--line2); }
.ind { display: flex; align-items: center; gap: 10px; padding: 9px 8px; border-radius: 10px; cursor: pointer; font-size: 13px; font-weight: 600; }
.ind:hover { background: rgba(255, 255, 255, .04); }
.ind small { display: block; color: var(--muted); font-weight: 500; font-size: 11.5px; }
.ind input { width: 16px; height: 16px; accent-color: var(--blue); }
.ind-dot { width: 10px; height: 10px; border-radius: 3px; background: var(--c); }

.chart-host { flex: 1; position: relative; min-height: 260px; overflow: hidden; background: radial-gradient(ellipse at 40% 0%, rgba(37, 99, 235, .05), transparent 65%); }
.chart-host canvas { position: absolute; inset: 0; touch-action: none; cursor: crosshair; }
.to-live {
  position: absolute; right: 92px; bottom: 36px; z-index: 2;
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 12px; border-radius: 9px;
  background: rgba(59, 130, 246, .9); color: #fff; font-weight: 700; font-size: 12.5px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .4);
}

.pos-strip { height: 196px; border-top: 1px solid var(--line); display: flex; flex-direction: column; background: var(--bg2); flex-shrink: 0; transition: height .2s ease; }
.pos-strip.collapsed { height: 49px; }
.pos-strip.collapsed #posToggle svg { transform: rotate(180deg); }
.pos-head { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.pos-sum { margin-left: auto; font-size: 12.5px; color: var(--muted); }
.pos-sum b { color: var(--text); }
.pos-sum b.up { color: var(--up); }
.pos-sum b.down { color: var(--down); }
.pos-body { flex: 1; overflow: auto; }
.pos-body .tbl td, .pos-body .tbl th { padding: 8px 12px; }

.trade-panel { overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 14px; background: var(--bg2); }
.tp-head { display: flex; flex-direction: column; gap: 10px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.tp-asset { display: flex; align-items: center; gap: 11px; }
.tp-name { flex: 1; min-width: 0; }
.tp-name b { display: block; font-size: 16px; }
.tp-name small { color: var(--muted); font-size: 12px; }
.star { color: var(--dim); display: inline-grid; place-items: center; cursor: pointer; }
.star:hover { color: #fcd34d; }
.star.on { color: #fbbf24; }
.star.on svg { fill: currentColor; }
.tp-quote { display: flex; align-items: baseline; gap: 10px; }
.tp-price { font-size: 26px; font-weight: 800; letter-spacing: -.02em; transition: color .2s; }
.tp-chg { font-size: 13px; font-weight: 700; }

.fld { display: flex; flex-direction: column; gap: 8px; }
.fld-label { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.fld-label small { font-weight: 500; font-size: 11.5px; color: var(--dim); }
.fld-label small b { color: var(--muted); }
.amount { display: flex; align-items: stretch; height: 50px; border-radius: 13px; background: var(--card); border: 1px solid var(--line2); overflow: hidden; }
.amount:focus-within { border-color: rgba(59, 130, 246, .6); }
.amount > button { width: 46px; font-size: 22px; color: var(--muted); font-weight: 500; transition: background .15s, color .15s; }
.amount > button:hover { background: rgba(255, 255, 255, .05); color: var(--text); }
.amount-in { flex: 1; display: flex; align-items: center; justify-content: center; gap: 2px; font-size: 20px; font-weight: 800; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
.amount-in span { color: var(--muted); }
.amount-in input { width: 100%; max-width: 130px; background: none; border: 0; outline: 0; font-weight: 800; font-size: 20px; text-align: center; -moz-appearance: textfield; }
.amount-in input::-webkit-outer-spin-button, .amount-in input::-webkit-inner-spin-button { -webkit-appearance: none; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips button, .chip-btn { flex: 1; height: 30px; padding: 0 8px; border-radius: 9px; background: var(--card); border: 1px solid var(--line); color: var(--muted); font-weight: 700; font-size: 12px; transition: all .15s; }
.chips button:hover, .chip-btn:hover { color: var(--text); border-color: var(--line2); }
.chip-btn.active { background: rgba(59, 130, 246, .18); border-color: rgba(59, 130, 246, .6); color: #dbeafe; }
.chips-grid { display: grid; grid-template-columns: repeat(3, 1fr); }
.sec { display: flex; flex-direction: column; gap: 12px; }
.profit-box { display: flex; justify-content: space-between; padding: 12px 14px; border-radius: 13px; background: rgba(33, 197, 122, .07); border: 1px solid rgba(33, 197, 122, .2); }
.profit-box small { display: block; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.profit-box b { font-size: 20px; font-weight: 800; color: var(--up); }
.profit-box .r { text-align: right; }
.trade-btn {
  display: flex; align-items: center; justify-content: space-between;
  height: 62px; padding: 0 20px; border-radius: 15px;
  font-size: 19px; font-weight: 800; color: #fff; text-transform: uppercase; letter-spacing: .03em;
  transition: transform .1s, filter .15s, box-shadow .15s;
}
.trade-btn.up { background: linear-gradient(135deg, #16a34a, #21c57a); box-shadow: 0 10px 24px rgba(33, 197, 122, .25); }
.trade-btn.down { background: linear-gradient(135deg, #e11d48, #f2475b); box-shadow: 0 10px 24px rgba(242, 71, 91, .22); }
.trade-btn:hover { filter: brightness(1.08); }
.trade-btn.up:hover { box-shadow: 0 12px 30px rgba(33, 197, 122, .4); }
.trade-btn.down:hover { box-shadow: 0 12px 30px rgba(242, 71, 91, .38); }
.trade-btn:active { transform: scale(.98); }
.trade-btn.pressed { animation: press .35s ease; }
@keyframes press { 50% { transform: scale(.96); filter: brightness(1.3); } }
.fld.two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fld.two label { display: flex; flex-direction: column; gap: 6px; font-size: 11.5px; font-weight: 700; color: var(--muted); }
.fld.two input, .fld-in input, .fld-in textarea, .fld input {
  height: 40px; padding: 0 12px; border-radius: 10px; background: var(--card); border: 1px solid var(--line2); outline: 0; font-weight: 600; width: 100%;
}
.fld.two input:focus, .fld-in input:focus, .fld-in textarea:focus { border-color: rgba(59, 130, 246, .6); }
.info-line { font-size: 12px; color: var(--muted); line-height: 1.45; }
.info-line b { color: var(--text); }

.sentiment { padding: 12px; border-radius: 13px; background: var(--card); border: 1px solid var(--line); }
.sent-top { display: flex; justify-content: space-between; align-items: center; font-size: 13px; margin-bottom: 8px; }
.sent-top small { color: var(--muted); font-size: 11.5px; }
.sent-bar { height: 6px; border-radius: 4px; background: var(--down); overflow: hidden; }
.sent-bar i { display: block; height: 100%; background: var(--up); transition: width .6s ease; border-right: 2px solid var(--bg2); }

.signals { padding: 12px; border-radius: 13px; background: var(--card); border: 1px solid var(--line); }
.sig-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 9px; }
.sig-head b { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.sig-head b svg { color: var(--amber); }
.sig-badge { font-size: 11.5px; font-weight: 800; padding: 2px 8px; border-radius: 6px; background: rgba(255, 255, 255, .08); color: var(--muted); }
.sig-badge.up { background: rgba(33, 197, 122, .15); color: var(--up); }
.sig-badge.down { background: rgba(242, 71, 91, .15); color: var(--down); }
.sig-meter { height: 6px; border-radius: 4px; background: rgba(255, 255, 255, .07); overflow: hidden; margin-bottom: 8px; }
.sig-meter i { display: block; height: 100%; background: var(--muted); border-radius: 4px; transition: width .5s; }
.sig-meter i.up { background: var(--up); }
.sig-meter i.down { background: var(--down); }
.signals small { font-size: 11.5px; }
.sig-lock { display: flex; align-items: center; gap: 10px; }
.sig-lock > svg { color: var(--amber); }
.sig-lock div { flex: 1; }
.sig-lock b { display: block; font-size: 13px; }
.sig-lock small { color: var(--muted); }
.kbd-hint { font-size: 11.5px; color: var(--dim); text-align: center; margin-top: auto; }

/* ==========================================================
   MARKETS
   ========================================================== */
.hl-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.hl { text-align: left; display: flex; flex-direction: column; gap: 12px; transition: border-color .15s, transform .15s; }
.hl:hover { border-color: var(--line2); transform: translateY(-2px); }
.hl-top { display: flex; align-items: center; gap: 9px; font-size: 12.5px; font-weight: 600; }
.hl-ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: var(--c); background: color-mix(in srgb, var(--c) 16%, transparent); }
.hl-mid { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.hl-val { font-size: 22px; font-weight: 800; }
.mk-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.mk-bar .search { width: 260px; }
.mk-tbl tbody tr { cursor: pointer; }
.mk-tbl td { padding: 12px; }
.mk-tbl td[data-price] { font-weight: 700; border-radius: 6px; }
.mk-tbl .star { margin-right: 2px; }
.sent { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; }
.sent .sent-bar { width: 70px; }
.pay { font-weight: 800; color: var(--up); background: rgba(33, 197, 122, .1); padding: 3px 8px; border-radius: 7px; font-size: 12.5px; }

/* ==========================================================
   HISTORY
   ========================================================== */
.stats-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; margin-bottom: 20px; }
.st { display: flex; flex-direction: column; gap: 4px; padding: 16px; }
.st-ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; color: var(--c); background: color-mix(in srgb, var(--c) 16%, transparent); margin-bottom: 8px; }
.st small { color: var(--muted); font-size: 12px; font-weight: 600; }
.st b { font-size: 20px; font-weight: 800; }
.h-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }

/* ==========================================================
   PLANS
   ========================================================== */
.plans-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 16px; }
.fld-in { display: flex; flex-direction: column; gap: 7px; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.fld-in textarea { height: auto; padding: 10px 12px; resize: vertical; font-weight: 500; line-height: 1.5; }
.full { grid-column: 1 / -1; }
.form-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 6px; }
.prog-item { margin-bottom: 16px; }
.prog-top { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 7px; color: var(--muted); font-weight: 600; }
.prog-top b { color: var(--text); }
.rules { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.rule { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.rule-ic { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; }
.rule-ic.ok { background: rgba(33, 197, 122, .15); color: var(--up); }
.rule-ic.bad { background: rgba(242, 71, 91, .15); color: var(--down); }
.rule-ic.goal { background: rgba(245, 165, 36, .15); color: var(--amber); }
.notes-box { margin-top: 16px; padding: 12px; border-radius: 12px; background: rgba(255, 255, 255, .03); border: 1px solid var(--line); font-size: 12.5px; color: var(--muted); white-space: pre-wrap; }
.notes-box b { display: block; color: var(--text); margin-bottom: 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.sec-title { display: flex; align-items: baseline; gap: 14px; margin: 32px 0 16px; flex-wrap: wrap; }
.sec-title h3 { font-size: 18px; font-weight: 800; }
.tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.tier { display: flex; flex-direction: column; gap: 10px; padding: 22px; }
.tier.featured { border-color: color-mix(in srgb, var(--c) 55%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--c) 30%, transparent), 0 20px 40px rgba(37, 99, 235, .12); }
.tier.current { background: linear-gradient(180deg, color-mix(in srgb, var(--c) 10%, var(--card2)), var(--card)); }
.tier-tag { position: absolute; top: 16px; right: 16px; font-size: 11px; font-weight: 800; padding: 4px 9px; border-radius: 999px; background: var(--c); color: #fff; }
.tier-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 18%, transparent); color: var(--c); }
.tier h4 { font-size: 18px; font-weight: 800; }
.tier p { font-size: 13px; min-height: 38px; }
.tier-price { display: flex; align-items: baseline; gap: 4px; margin: 4px 0; }
.tier-price b { font-size: 32px; font-weight: 800; letter-spacing: -.02em; }
.tier-price span { color: var(--muted); }
.tier ul { list-style: none; display: flex; flex-direction: column; gap: 9px; margin: 6px 0 14px; flex: 1; }
.tier li { display: flex; gap: 9px; align-items: flex-start; font-size: 13px; color: #cbd2df; }
.tier li svg { color: var(--c); margin-top: 2px; }

/* ==========================================================
   MODAL + TOASTS
   ========================================================== */
.overlay { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(3, 5, 9, .7); backdrop-filter: blur(6px); opacity: 0; transition: opacity .18s; }
.overlay.show { opacity: 1; }
.modal { width: min(460px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; background: #111722; border: 1px solid var(--line2); border-radius: 20px; padding: 20px; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); transform: translateY(10px) scale(.98); transition: transform .18s; }
.overlay.show .modal { transform: none; }
.m-picker { width: min(620px, 100%); display: flex; flex-direction: column; gap: 14px; }
.m-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.m-head h3 { font-size: 18px; font-weight: 800; }
.m-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.pk-list { display: flex; flex-direction: column; max-height: 56vh; overflow-y: auto; margin: 0 -8px; }
.pk-row { display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-radius: 12px; text-align: left; width: 100%; }
.pk-row:hover { background: rgba(255, 255, 255, .04); }
.pk-name { flex: 1; min-width: 0; }
.pk-name b { display: block; }
.pk-name small { color: var(--muted); font-size: 12px; }
.pk-price { text-align: right; font-weight: 700; display: flex; flex-direction: column; font-variant-numeric: tabular-nums; }
.pk-price small { font-size: 11.5px; }
.pk-pay { font-weight: 800; color: var(--up); width: 50px; text-align: right; }
.form-col { display: flex; flex-direction: column; gap: 16px; margin-top: 12px; }
.form-col .fld-in input { height: 42px; }
.danger { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 14px; border: 1px solid rgba(242, 71, 91, .25); background: rgba(242, 71, 91, .05); }
.danger div { flex: 1; }
.danger b { display: block; font-size: 13.5px; }
.danger small { color: var(--muted); font-size: 12px; }

#toasts { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; pointer-events: none; }
.toast {
  display: flex; gap: 12px; align-items: center;
  min-width: 280px; max-width: 380px; padding: 12px 16px 12px 12px; border-radius: 14px;
  background: #151c29; border: 1px solid var(--line2);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .5);
  opacity: 0; transform: translateX(30px); transition: opacity .25s, transform .25s;
  pointer-events: auto;
}
.toast.show { opacity: 1; transform: none; }
.toast-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; background: rgba(59, 130, 246, .16); color: var(--sky); }
.toast-body b { display: block; font-size: 13.5px; }
.toast-body span { display: block; color: var(--muted); font-size: 12px; }
.toast-win, .toast-up { border-color: rgba(33, 197, 122, .35); }
.toast-win .toast-ic, .toast-up .toast-ic { background: rgba(33, 197, 122, .16); color: var(--up); }
.toast-loss, .toast-down, .toast-error { border-color: rgba(242, 71, 91, .35); }
.toast-loss .toast-ic, .toast-down .toast-ic, .toast-error .toast-ic { background: rgba(242, 71, 91, .16); color: var(--down); }
.toast-warn { border-color: rgba(245, 165, 36, .35); }
.toast-warn .toast-ic { background: rgba(245, 165, 36, .16); color: var(--amber); }
.toast-win b { color: var(--up); }

/* ==========================================================
   RESPONSIVE
   ========================================================== */
@media (max-width: 1440px) {
  .dash-grid { grid-template-columns: minmax(0, 1fr) 300px; }
  .stats-row { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1280px) {
  .dash-grid { grid-template-columns: 1fr; }
  .dash-side { display: grid; grid-template-columns: repeat(2, 1fr); }
  .row-cards { grid-template-columns: 1.2fr 1fr; }
  .row-cards .card-dashed { display: none; }
  .hl-row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 1100px) {
  :root { --sidebar: 78px; }
  .brand-label, .nav span, .nav-btn span, .demo-card > div { display: none; }
  .brand { align-items: center; padding: 4px 0; }
  .nav a, .nav-btn { justify-content: center; padding: 12px; }
  .demo-card { justify-content: center; padding: 10px; }
  .trade-body { grid-template-columns: minmax(0, 1fr) 280px; }
  .row-2 { grid-template-columns: 1fr; }
  .quick { grid-template-columns: repeat(3, 1fr); }
  .plans-grid, .tiers { grid-template-columns: 1fr; }
  .search-btn span { display: none; }
  .search-btn { width: auto; }
  .search-btn kbd { display: none; }
  .tb-transfer span { display: none; }
  .tb-transfer { padding: 0 12px; }
}
@media (max-width: 760px) {
  body { overflow: hidden; }
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    flex-direction: row; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); gap: 0;
    border-right: 0; border-top: 1px solid var(--line);
    background: rgba(11, 14, 20, .96); backdrop-filter: blur(10px);
  }
  .brand, .side-foot { display: none; }
  .nav { flex-direction: row; flex: 1; justify-content: space-around; }
  .nav a { flex-direction: column; gap: 3px; padding: 7px 4px; font-size: 10.5px; flex: 1; border-radius: 10px; }
  .nav a span { display: block; }
  .nav a[data-route="plans"], .nav a[data-route="admin"] { display: none; }
  .nav a.active { box-shadow: none; }
  .main { padding-bottom: 64px; }
  .topbar { padding: 0 14px; gap: 10px; }
  .topbar h1 { font-size: 17px; min-width: 0; }
  .simulation-strip { padding-inline: 14px; }
  .acct-ic { display: none; }
  .avatar, .search-btn { display: none; }
  .view { padding: 18px 14px 32px; }
  .hello { font-size: 22px; }
  .row-cards { grid-template-columns: 1fr; }
  .quick { grid-template-columns: repeat(2, 1fr); }
  .dash-side { grid-template-columns: 1fr; }
  .row-2b { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .hl-row { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .view-trade.active { overflow-y: auto; display: block; }
  .trade-body { display: flex; flex-direction: column; }
  .chart-col { border-right: 0; }
  .chart-host { flex: none; height: 52vh; }
  .pos-strip { height: auto; max-height: 260px; }
  .trade-panel { overflow: visible; }
  .mk-bar .search { width: 100%; }
  .pop-wide { width: min(340px, calc(100vw - 28px)); }
  #toasts { left: 14px; right: 14px; bottom: 76px; align-items: stretch; }
  .toast { min-width: 0; max-width: none; }
}

@media (max-width: 420px) {
  .topbar { gap: 8px; }
  .topbar h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tb-right { gap: 6px; }
  .acct { padding-inline: 8px; }
  .acct > svg { display: none; }
  .acct-txt b { font-size: 14px; }
  .tb-transfer { padding-inline: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  .portal-view.active { animation: none; }
}
