/* ═══════════════════════════════════
   NeuroTrade AI — App Panel CSS
═══════════════════════════════════ */

:root {
  --bg:        #0a0e27;
  --bg-panel:  #151b3d;
  --bg-widget: #1e2749;
  --bg-hover:  #212d52;
  --text:      #e0e6ff;
  --muted:     #8b9dc3;
  --border:    rgba(72,149,239,0.15);
  --blue:      #4895ef;
  --green:     #06ffa5;
  --red:       #ff006e;
  --yellow:    #ffbe0b;
  --orange:    #ff9a00;
  --radius:    10px;
  --sb-width:  230px;
  --topbar-h:  60px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: 'Inter', sans-serif; background: var(--bg); color: var(--text); line-height: 1.5; }
a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

/* ── Shared ────────────────────── */
.accent { color: var(--blue); }
.green  { color: var(--green); }
.red    { color: var(--red); }
.yellow { color: var(--yellow); }

/* ═══════════════════════════════════
   AUTH PAGE
═══════════════════════════════════ */
.auth-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; position: relative;
}
.auth-bg {
  position: fixed; inset: 0; z-index: 0;
  background: radial-gradient(ellipse at 20% 50%, rgba(72,149,239,0.08) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 20%, rgba(6,255,165,0.05) 0%, transparent 50%);
}
#auth-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

.auth-wrap {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center; gap: 20px;
  width: 100%; padding: 24px;
}
.auth-card {
  background: rgba(21,27,61,0.85);
  border: 1px solid var(--border);
  border-radius: 18px;
  backdrop-filter: blur(20px);
  padding: 44px 40px;
  width: 100%; max-width: 420px;
}
.auth-logo {
  display: flex; align-items: center; gap: 10px;
  justify-content: center; margin-bottom: 6px;
}
.logo-hex { font-size: 2rem; color: var(--blue); line-height: 1; }
.logo-name { font-size: 1.3rem; font-weight: 800; }
.auth-sub {
  text-align: center; color: var(--muted); font-size: 0.85rem;
  margin-bottom: 32px;
}
.auth-form { display: flex; flex-direction: column; gap: 18px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-size: 0.82rem; font-weight: 600; color: var(--muted);
  display: flex; justify-content: space-between;
}
.field-link { color: var(--blue); font-weight: 500; font-size: 0.8rem; }
.field-link:hover { opacity: 0.8; }

.field input {
  background: var(--bg-widget); border: 1px solid var(--border);
  color: var(--text); border-radius: 8px; padding: 11px 14px;
  font-size: 0.92rem; transition: border-color 0.2s;
  width: 100%;
}
.field input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(72,149,239,0.12); }

.input-wrap { position: relative; }
.input-wrap input { padding-right: 42px; }
.eye-btn {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--muted); opacity: 0.6;
  display: flex; align-items: center; padding: 0;
  transition: opacity 0.2s;
}
.eye-btn:hover { opacity: 1; }

.field-check { display: flex; align-items: center; gap: 10px; }
.field-check input { width: 16px; height: 16px; accent-color: var(--blue); cursor: pointer; }
.field-check label { font-size: 0.85rem; color: var(--muted); cursor: pointer; }

.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(135deg, var(--blue), #5e60ce);
  color: #fff; border: none; border-radius: 8px;
  padding: 12px 24px; font-size: 0.95rem; font-weight: 600;
  transition: opacity 0.2s, transform 0.2s;
  box-shadow: 0 4px 20px rgba(72,149,239,0.3);
}
.btn-primary.full { width: 100%; }
.btn-primary:hover:not(:disabled) { opacity: 0.9; transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.auth-tabs {
  display: flex; gap: 4px;
  background: var(--bg-widget); border-radius: 8px; padding: 4px;
  margin-bottom: 24px;
}
.auth-tab {
  flex: 1; padding: 8px; border: none; background: transparent;
  color: var(--muted); font-size: 0.85rem; font-weight: 600;
  border-radius: 6px; cursor: pointer; transition: all 0.2s;
}
.auth-tab.active { background: var(--bg-panel); color: var(--text); }

.hidden { display: none !important; }
.field-hint { font-weight: 400; font-size: 0.75rem; color: var(--muted); }

.auth-msg {
  text-align: center; font-size: 0.85rem; padding: 10px;
  border-radius: 8px; display: none;
}
.auth-msg.error   { background: rgba(255,0,110,0.1); color: var(--red); border: 1px solid rgba(255,0,110,0.3); display: block; }
.auth-msg.success { background: rgba(6,255,165,0.1); color: var(--green); border: 1px solid rgba(6,255,165,0.3); display: block; }

.auth-footer { text-align: center; font-size: 0.84rem; color: var(--muted); }
.auth-footer a { color: var(--blue); }
.auth-copy { font-size: 0.75rem; color: rgba(139,157,195,0.4); }

/* ═══════════════════════════════════
   APP LAYOUT
═══════════════════════════════════ */
.app-page { display: flex; min-height: 100vh; }

/* ── Sidebar ───────────────────── */
.sidebar {
  width: var(--sb-width); min-height: 100vh;
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; z-index: 50;
  transition: transform 0.25s ease;
}
.sb-logo {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
}
.sb-logo .logo-hex { font-size: 1.4rem; color: var(--blue); }
.sb-logo .logo-name { font-size: 1rem; font-weight: 800; }

.sb-nav {
  flex: 1; padding: 14px 10px; display: flex; flex-direction: column; gap: 2px;
}
.sb-link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px;
  font-size: 0.88rem; font-weight: 500; color: var(--muted);
  transition: background 0.15s, color 0.15s;
  position: relative;
}
.sb-link:hover { background: var(--bg-hover); color: var(--text); }
.sb-link.active {
  background: rgba(72,149,239,0.12);
  color: var(--blue);
  border-left: 2px solid var(--blue);
  margin-left: -10px; padding-left: 20px;
}
.sb-icon {
  width: 18px; height: 18px; flex-shrink: 0;
  stroke: currentColor;
}
.sb-badge {
  margin-left: auto; font-size: 0.7rem; font-weight: 700;
  padding: 2px 7px; border-radius: 10px; font-family: 'JetBrains Mono', monospace;
}
.sb-badge.green  { background: rgba(6,255,165,0.15);   color: var(--green); }
.sb-badge.blue   { background: rgba(72,149,239,0.15);  color: var(--blue); }
.sb-badge.red    { background: rgba(255,0,110,0.15);   color: var(--red); }

.sb-footer {
  padding: 14px 10px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.sb-version { font-size: 0.72rem; color: var(--muted); font-family: 'JetBrains Mono', monospace; }
.sb-logout {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.8rem; color: var(--muted);
  padding: 6px 8px; border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}
.sb-logout:hover { background: rgba(255,0,110,0.1); color: var(--red); }

/* ── Main area ─────────────────── */
.app-main {
  margin-left: var(--sb-width);
  flex: 1; display: flex; flex-direction: column;
  min-height: 100vh;
}

/* ── Topbar ────────────────────── */
.topbar {
  height: var(--topbar-h); display: flex; align-items: center; gap: 16px;
  padding: 0 24px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 40;
}
.topbar-toggle {
  background: none; border: none; color: var(--muted);
  display: flex; align-items: center; padding: 6px;
  border-radius: 6px; transition: background 0.15s, color 0.15s;
}
.topbar-toggle:hover { background: var(--bg-widget); color: var(--text); }
.breadcrumb-page { font-size: 0.95rem; font-weight: 600; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 20px; }

.topbar-status { display: flex; align-items: center; gap: 7px; }
.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  flex-shrink: 0;
}
.status-dot.green { background: var(--green); }
.status-dot.red   { background: var(--red); }
.status-dot.pulse { animation: pulse 1.8s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.4} }
.status-label { font-size: 0.8rem; color: var(--muted); }

.topbar-clock {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem; color: var(--muted); min-width: 70px;
}
.topbar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 12px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--border);
  transition: background 0.15s;
}
.topbar-user:hover { background: var(--bg-widget); }
.user-avatar {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, var(--blue), #5e60ce);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.72rem; font-weight: 800; color: #fff;
}
.user-info { display: flex; flex-direction: column; }
.user-name { font-size: 0.84rem; font-weight: 600; line-height: 1.2; }
.user-plan {
  font-size: 0.68rem; font-weight: 700; color: var(--blue);
  text-transform: uppercase; letter-spacing: 0.5px;
}

/* ── Page content ──────────────── */
.page-content { flex: 1; padding: 28px 28px 40px; display: flex; flex-direction: column; gap: 24px; }

/* ── KPI Cards ─────────────────── */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.kpi-card {
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px 20px;
  transition: border-color 0.2s, transform 0.2s;
}
.kpi-card:hover { border-color: rgba(72,149,239,0.35); transform: translateY(-2px); }
.kpi-label { font-size: 0.78rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 8px; }
.kpi-value { font-size: 1.6rem; font-weight: 800; font-family: 'JetBrains Mono', monospace; line-height: 1; margin-bottom: 8px; }
.kpi-delta { font-size: 0.78rem; color: var(--muted); }

/* ── Section row ───────────────── */
.section-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.panel {
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px 20px;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px;
}
.panel-title { font-size: 0.9rem; font-weight: 700; }
.panel-link { font-size: 0.8rem; color: var(--blue); }
.panel-link:hover { opacity: 0.8; }
.badge-live {
  background: rgba(255,0,110,0.15); color: var(--red);
  font-size: 0.68rem; font-weight: 800; padding: 2px 8px;
  border-radius: 4px; animation: pulse 1s infinite;
}

/* Bot status */
.bot-status-list { display: flex; flex-direction: column; gap: 10px; }
.bot-row { display: flex; align-items: center; justify-content: space-between; }
.bot-label { font-size: 0.85rem; color: var(--muted); }
.bot-chip {
  font-size: 0.7rem; font-weight: 700; padding: 3px 10px;
  border-radius: 20px; font-family: 'JetBrains Mono', monospace;
}
.bot-chip.green  { background: rgba(6,255,165,0.12);  color: var(--green); }
.bot-chip.yellow { background: rgba(255,190,11,0.12); color: var(--yellow); }
.bot-chip.red    { background: rgba(255,0,110,0.12);  color: var(--red); }

/* Signal list */
.signal-list { display: flex; flex-direction: column; gap: 8px; }
.signal-row-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px;
  background: var(--bg-widget); font-size: 0.82rem;
  transition: background 0.15s;
}
.signal-row-item:hover { background: var(--bg-hover); }
.signal-dir {
  font-size: 0.7rem; font-weight: 800; padding: 2px 8px;
  border-radius: 4px; width: 40px; text-align: center;
  font-family: 'JetBrains Mono', monospace;
}
.signal-dir.buy  { background: rgba(6,255,165,0.12); color: var(--green); }
.signal-dir.sell { background: rgba(255,0,110,0.12); color: var(--red); }
.signal-pair { font-weight: 600; width: 80px; }
.signal-conf { color: var(--muted); width: 38px; font-family: 'JetBrains Mono', monospace; font-size: 0.78rem; }
.signal-pnl { font-weight: 700; font-family: 'JetBrains Mono', monospace; margin-left: auto; }
.signal-time { color: var(--muted); font-size: 0.75rem; font-family: 'JetBrains Mono', monospace; }

/* Coming soon placeholder */
.coming-soon {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 12px;
  min-height: 140px; border-style: dashed; opacity: 0.5;
}
.cs-icon { font-size: 2rem; }
.cs-text { font-size: 0.88rem; color: var(--muted); }

/* Overlay (mobile) */
.sidebar-overlay {
  display: none; position: fixed; inset: 0; z-index: 49;
  background: rgba(0,0,0,0.5); backdrop-filter: blur(2px);
}
.sidebar-overlay.show { display: block; }

/* ── Shared utilities ──────────────── */
.mono  { font-family: 'JetBrains Mono', monospace; }
.muted { color: var(--muted); }

.loading-pulse {
  color: var(--muted); font-size: 0.85rem; text-align: center;
  padding: 24px; animation: pulse 1.4s infinite;
}
.empty-state {
  display: flex; align-items: center; justify-content: center;
  min-height: 80px; color: var(--muted); font-size: 0.85rem;
  text-align: center; padding: 24px;
}
.spinner {
  width: 28px; height: 28px; border: 3px solid rgba(72,149,239,0.2);
  border-top-color: var(--blue); border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Signal list (recent trades) ──── */
.signal-exch {
  font-size: 0.72rem; font-weight: 700; color: var(--muted);
  font-family: 'JetBrains Mono', monospace; width: 32px;
}

/* ── Chart panel ───────────────────── */
.chart-panel { display: flex; flex-direction: column; gap: 0; }
.chart-controls { display: flex; align-items: center; gap: 12px; }
.ctrl-select {
  background: var(--bg-widget); border: 1px solid var(--border);
  color: var(--text); border-radius: 6px; padding: 5px 10px;
  font-size: 0.82rem; cursor: pointer;
}
.ctrl-select:focus { outline: none; border-color: var(--blue); }
.chart-days-btns { display: flex; gap: 4px; }
.days-btn {
  background: var(--bg-widget); border: 1px solid var(--border);
  color: var(--muted); border-radius: 6px; padding: 4px 10px;
  font-size: 0.78rem; font-weight: 600; cursor: pointer;
  transition: all 0.15s;
}
.days-btn:hover { border-color: var(--blue); color: var(--text); }
.days-btn.active { background: rgba(72,149,239,0.15); border-color: var(--blue); color: var(--blue); }

.chart-summary {
  display: flex; gap: 24px; padding: 12px 0;
  border-bottom: 1px solid var(--border); margin-bottom: 16px;
}
.chart-stat { display: flex; flex-direction: column; gap: 2px; }
.chart-stat-label { font-size: 0.73rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.chart-stat-value { font-size: 1.15rem; font-weight: 800; font-family: 'JetBrains Mono', monospace; }

.chart-wrap { position: relative; min-height: 260px; }
.chart-spinner {
  position: absolute; inset: 0; display: flex;
  align-items: center; justify-content: center;
}
.chart-empty {
  position: absolute; inset: 0; display: flex;
  align-items: center; justify-content: center;
  color: var(--muted); font-size: 0.85rem;
}
#equityCanvas { width: 100% !important; height: 260px !important; }

/* ── Trades table ──────────────────── */
.filter-bar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 20px;
  padding: 16px 20px;
}
.filter-group { display: flex; flex-direction: column; gap: 4px; }
.filter-label { font-size: 0.74rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }

.tbl-panel { padding: 0; overflow: hidden; }
.tbl-scroll { overflow-x: auto; }
.trades-table {
  width: 100%; border-collapse: collapse; font-size: 0.83rem;
}
.trades-table th {
  padding: 12px 14px; text-align: left;
  font-size: 0.73rem; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.5px;
  background: var(--bg-widget);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.trades-table td {
  padding: 11px 14px; border-bottom: 1px solid rgba(72,149,239,0.06);
  white-space: nowrap;
}
.trades-table tr:last-child td { border-bottom: none; }
.trades-table tr:hover td { background: rgba(72,149,239,0.04); }

.tbl-dir {
  font-size: 0.68rem; font-weight: 800; padding: 2px 8px;
  border-radius: 4px; font-family: 'JetBrains Mono', monospace;
  display: inline-block;
}
.tbl-dir.buy  { background: rgba(6,255,165,0.12); color: var(--green); }
.tbl-dir.sell { background: rgba(255,0,110,0.12); color: var(--red); }

.exch-badge {
  font-size: 0.7rem; font-weight: 700; padding: 2px 7px;
  border-radius: 4px; font-family: 'JetBrains Mono', monospace;
  background: rgba(72,149,239,0.12); color: var(--blue);
  display: inline-block;
}

.res-badge {
  font-size: 0.7rem; font-weight: 800; padding: 2px 8px;
  border-radius: 4px; font-family: 'JetBrains Mono', monospace;
  display: inline-block;
}
.res-badge.win  { background: rgba(6,255,165,0.12);  color: var(--green); }
.res-badge.loss { background: rgba(255,0,110,0.12);  color: var(--red); }

.tbl-footer {
  display: flex; align-items: center; justify-content: center;
  padding: 14px; border-top: 1px solid var(--border);
}
.btn-secondary {
  background: var(--bg-widget); border: 1px solid var(--border);
  color: var(--text); border-radius: 8px; padding: 9px 20px;
  font-size: 0.85rem; font-weight: 600; cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  display: inline-flex; align-items: center;
}
.btn-secondary:hover:not(:disabled) { border-color: var(--blue); background: rgba(72,149,239,0.08); }
.btn-secondary:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Bot Status page ───────────────── */
.platform-card .panel-head { margin-bottom: 20px; }
.stat-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
}
.stat-item { background: var(--bg-widget); border-radius: 8px; padding: 14px; }
.stat-label { font-size: 0.74rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.stat-val { font-size: 1.25rem; font-weight: 800; font-family: 'JetBrains Mono', monospace; }

/* ── Settings page ─────────────────── */
.settings-panel .panel-head { flex-wrap: wrap; gap: 12px; }
.platform-tabs { display: flex; gap: 4px; }
.platform-tab {
  background: var(--bg-widget); border: 1px solid var(--border);
  color: var(--muted); border-radius: 6px; padding: 6px 16px;
  font-size: 0.82rem; font-weight: 600; cursor: pointer;
  transition: all 0.15s;
}
.platform-tab.active { background: rgba(72,149,239,0.15); border-color: var(--blue); color: var(--blue); }

.settings-hint { font-size: 0.82rem; color: var(--muted); margin-bottom: 20px; padding: 10px 14px; background: var(--bg-widget); border-radius: 8px; }
.settings-form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.settings-field { display: flex; flex-direction: column; gap: 6px; }
.settings-field label { font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.settings-field input {
  background: var(--bg-widget); border: 1px solid var(--border);
  color: var(--text); border-radius: 8px; padding: 10px 12px;
  font-size: 0.9rem; transition: border-color 0.2s; width: 100%;
  font-family: 'JetBrains Mono', monospace;
}
.settings-field input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(72,149,239,0.12); }
.settings-form .btn-primary { grid-column: 1 / -1; justify-self: start; margin-top: 8px; }
.settings-status {
  margin-top: 12px; font-size: 0.85rem; min-height: 20px;
}
.settings-status.success { color: var(--green); }
.settings-status.error   { color: var(--red); }

/* ── Settings tabs ─────────────────── */
.settings-tabs {
  display: flex; gap: 6px; flex-wrap: wrap;
  padding: 0 0 20px;
}
.stab {
  background: var(--bg-widget); border: 1px solid var(--border);
  color: var(--muted); border-radius: 8px; padding: 8px 18px;
  font-size: 0.83rem; font-weight: 600; cursor: pointer;
  transition: all 0.15s; white-space: nowrap;
}
.stab:hover { border-color: var(--blue); color: var(--text); }
.stab.active { background: rgba(72,149,239,0.15); border-color: var(--blue); color: var(--blue); }
.settings-panel.hidden { display: none; }

/* ── Messages panel ─────────────────── */
.msg-card {
  border-radius: 10px; padding: 14px 16px; margin-bottom: 10px;
  border: 1px solid var(--border); background: var(--bg-widget);
  transition: opacity 0.2s;
}
.msg-card.msg-read { opacity: 0.55; }
.msg-header {
  display: flex; align-items: center; gap: 8px; margin-bottom: 6px;
}
.msg-icon { font-size: 1rem; flex-shrink: 0; }
.msg-title { flex: 1; font-size: 0.88rem; font-weight: 700; }
.msg-time { font-size: 0.73rem; color: var(--muted); white-space: nowrap; }
.msg-body { font-size: 0.83rem; color: var(--muted); line-height: 1.5; padding-left: 26px; }
.msg-read-btn {
  background: none; border: 1px solid var(--border); color: var(--muted);
  border-radius: 5px; padding: 2px 7px; font-size: 0.75rem; cursor: pointer;
  flex-shrink: 0; transition: all 0.15s;
}
.msg-read-btn:hover { border-color: var(--green); color: var(--green); }
.msg-info         { border-left: 3px solid var(--blue); }
.msg-warning      { border-left: 3px solid var(--yellow); }
.msg-success      { border-left: 3px solid var(--green); }
.msg-error        { border-left: 3px solid var(--red); }
.msg-announcement { border-left: 3px solid var(--orange); }
.msg-badge {
  background: var(--red); color: #fff; border-radius: 10px;
  font-size: 0.7rem; font-weight: 800; padding: 1px 6px;
  display: none; margin-left: 4px; vertical-align: middle;
}

/* ── License gate ───────────────────── */
.license-gate {
  text-align: center; padding: 48px 32px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.gate-icon { font-size: 3rem; margin-bottom: 4px; }
.license-gate h3 { font-size: 1.1rem; font-weight: 700; }
.license-gate p { font-size: 0.88rem; color: var(--muted); }

/* ── Plans page ─────────────────────── */
.plans-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px; margin-top: 8px;
}
.plan-card {
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: 14px; padding: 28px 24px;
  display: flex; flex-direction: column; gap: 14px;
  position: relative; transition: border-color 0.2s;
}
.plan-card:hover { border-color: rgba(72,149,239,0.35); }
.plan-card.plan-featured { border-color: var(--blue); }
.plan-card.plan-featured::before {
  content: '⭐ Recomendado';
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--blue); color: #fff; font-size: 0.72rem; font-weight: 700;
  padding: 3px 12px; border-radius: 20px; white-space: nowrap;
}
.current-plan-badge {
  display: none; background: rgba(6,255,165,0.12); color: var(--green);
  border: 1px solid var(--green); border-radius: 20px;
  font-size: 0.7rem; font-weight: 700; padding: 3px 10px;
  text-align: center; width: fit-content;
}
.plan-name { font-size: 1rem; font-weight: 800; letter-spacing: 0.5px; }
.plan-price { margin: 4px 0; }
.plan-price .price-amount { font-size: 2rem; font-weight: 800; font-family: 'JetBrains Mono', monospace; }
.plan-price .price-period { font-size: 0.8rem; color: var(--muted); }
.plan-features { list-style: none; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.plan-features li { font-size: 0.83rem; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.plan-features li::before { content: '✓'; color: var(--green); font-weight: 700; flex-shrink: 0; }
.plan-features li.disabled { color: rgba(139,157,195,0.4); }
.plan-features li.disabled::before { content: '✗'; color: rgba(255,0,110,0.4); }
.plan-cta-btn {
  width: 100%; padding: 11px; border-radius: 9px;
  font-size: 0.88rem; font-weight: 700; cursor: pointer;
  background: rgba(72,149,239,0.15); border: 1px solid var(--blue);
  color: var(--blue); transition: all 0.15s;
}
.plan-cta-btn:hover:not(:disabled) { background: var(--blue); color: #fff; }
.plan-cta-btn.disabled, .plan-cta-btn:disabled {
  opacity: 0.5; cursor: not-allowed;
  background: var(--bg-widget); border-color: var(--border); color: var(--muted);
}

/* ═══════════════════════════════════
   MESSAGES PAGE
═══════════════════════════════════ */
.msg-source-badge {
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
  padding: 2px 8px; border-radius: 4px;
  background: rgba(72,149,239,0.1); color: var(--blue); border: 1px solid rgba(72,149,239,0.2);
  margin-left: auto; margin-right: 4px;
}
.msg-source-badge + .msg-read-btn { margin-left: 0; }

/* ═══════════════════════════════════
   INVERSIONES PAGE
═══════════════════════════════════ */

/* Quota bar */
.inv-quota-bar {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 20px; margin-bottom: 18px;
}
.inv-quota-label { font-size: 0.8rem; color: var(--muted); }
.inv-quota-used  { font-size: 1rem; font-weight: 800; color: var(--text); font-family: 'JetBrains Mono', monospace; }
.inv-quota-sep   { color: var(--muted); }
.inv-quota-limit { font-size: 0.9rem; color: var(--muted); font-family: 'JetBrains Mono', monospace; }
.inv-quota-dots  { display: flex; gap: 5px; }
.inv-quota-dot   { width: 10px; height: 10px; border-radius: 50%; background: var(--bg-widget); border: 1px solid var(--border); }
.inv-quota-dot.used { background: var(--blue); border-color: var(--blue); box-shadow: 0 0 6px rgba(72,149,239,0.4); }
.inv-quota-reset { font-size: 0.73rem; color: var(--muted); margin-left: auto; }
.inv-quota-info  { display: flex; align-items: center; gap: 6px; }

/* Tabs */
.inv-tabs {
  display: flex; gap: 4px; margin-bottom: 18px;
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 4px; width: fit-content;
}
.inv-tab {
  padding: 8px 20px; border-radius: 8px; font-size: 0.88rem; font-weight: 600;
  border: none; background: transparent; color: var(--muted);
  cursor: pointer; transition: all 0.2s;
}
.inv-tab.active { background: var(--blue); color: #fff; box-shadow: 0 2px 12px rgba(72,149,239,0.3); }
.inv-tab:hover:not(.active) { color: var(--text); background: var(--bg-hover); }

/* Panels */
.inv-panel { }

/* Fear & Greed gauge */
.fg-gauge { padding: 16px 0; text-align: center; }
.fg-value { font-size: 2.8rem; font-weight: 900; font-family: 'JetBrains Mono', monospace; line-height: 1; }
.fg-value.green  { color: var(--green); }
.fg-value.red    { color: var(--red); }
.fg-value.yellow { color: var(--yellow); }
.fg-label { font-size: 0.82rem; color: var(--muted); margin: 4px 0 12px; }
.fg-bar-wrap { height: 8px; background: var(--bg-widget); border-radius: 4px; overflow: hidden; margin: 0 16px 6px; }
.fg-bar-fill { height: 100%; border-radius: 4px; transition: width 0.8s ease; }
.fg-bar-fill.green  { background: linear-gradient(90deg, #06ffa5, #00cc7d); }
.fg-bar-fill.red    { background: linear-gradient(90deg, #ff006e, #cc0050); }
.fg-bar-fill.yellow { background: linear-gradient(90deg, #ffbe0b, #e0a800); }
.fg-scale { display: flex; justify-content: space-between; padding: 0 16px; font-size: 0.65rem; color: var(--muted); }
.fg-value.teal   { color: #06ffa5; }
.fg-value.orange { color: #ff8c00; }
.fg-bar-fill.teal   { background: linear-gradient(90deg, #06ffa5, #00d4a0); }
.fg-bar-fill.orange { background: linear-gradient(90deg, #ff8c00, #e07400); }
.fg-zones { display: flex; justify-content: space-around; padding: 6px 8px 0; gap: 4px; }
.fg-zone { font-size: 0.6rem; font-weight: 700; font-family: 'JetBrains Mono', monospace; padding: 3px 5px; border-radius: 5px; text-align: center; line-height: 1.2; }
.fg-zone.red    { background: rgba(255,0,110,0.15); color: #ff006e; }
.fg-zone.orange { background: rgba(255,140,0,0.15);  color: #ff8c00; }
.fg-zone.yellow { background: rgba(255,190,11,0.15); color: #ffbe0b; }
.fg-zone.green  { background: rgba(6,255,165,0.12);  color: #06ffa5; }
.fg-zone.teal   { background: rgba(6,255,165,0.20);  color: #00d4a0; }

/* Asset rows */
.inv-crypto-grid, .inv-forex-grid { display: flex; flex-direction: column; gap: 6px; }
.inv-asset-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 8px;
  background: var(--bg-widget); border: 1px solid transparent;
  transition: border-color 0.15s;
}
.inv-asset-row:hover { border-color: var(--border); }
.inv-asset-icon { font-size: 1rem; width: 22px; text-align: center; color: var(--muted); }
.inv-asset-name { font-size: 0.82rem; font-weight: 700; width: 52px; }
.inv-asset-price { flex: 1; font-size: 0.88rem; }
.inv-asset-change { font-size: 0.82rem; font-weight: 700; font-family: 'JetBrains Mono', monospace; min-width: 70px; text-align: right; }

/* Chat */
.inv-chat-panel { display: flex; flex-direction: column; min-height: 520px; }
.inv-model-badge {
  font-size: 0.68rem; font-weight: 700; padding: 3px 8px; border-radius: 5px;
  background: rgba(6,255,165,0.1); color: var(--green); border: 1px solid rgba(6,255,165,0.2);
}
.inv-chat-messages {
  flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px;
  min-height: 300px; max-height: 420px;
  background: var(--bg-widget); border-radius: 8px; margin: 0 0 12px;
}
.inv-chat-welcome { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 32px 16px; text-align: center; color: var(--muted); }
.inv-chat-bot-icon { font-size: 2.2rem; }
.inv-chat-msg { display: flex; flex-direction: column; max-width: 85%; }
.inv-chat-user     { align-self: flex-end; }
.inv-chat-assistant { align-self: flex-start; }
.inv-chat-bubble {
  padding: 10px 14px; border-radius: 14px; font-size: 0.86rem; line-height: 1.65;
}
.inv-chat-user .inv-chat-bubble {
  background: linear-gradient(135deg, var(--blue), #5e60ce);
  color: #fff; border-bottom-right-radius: 4px;
}
.inv-chat-assistant .inv-chat-bubble {
  background: var(--bg-panel); border: 1px solid var(--border);
  color: var(--text); border-bottom-left-radius: 4px;
}
/* Typing dots */
.inv-typing .inv-chat-bubble { padding: 14px 18px; }
.inv-dots { display: flex; gap: 4px; align-items: center; }
.inv-dots span {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--muted); animation: inv-bounce 1.2s ease-in-out infinite;
}
.inv-dots span:nth-child(2) { animation-delay: 0.2s; }
.inv-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes inv-bounce { 0%,80%,100%{transform:scale(0.7);opacity:0.5} 40%{transform:scale(1);opacity:1} }

/* Quota warning */
.inv-quota-warning {
  display: flex; align-items: center; gap: 12px;
  background: rgba(255,190,11,0.08); border: 1px solid rgba(255,190,11,0.25);
  border-radius: 8px; padding: 10px 16px;
  font-size: 0.82rem; color: var(--yellow); margin-bottom: 10px;
}
.inv-quota-warning a { color: var(--blue); text-decoration: underline; margin-left: auto; }

/* Quick prompts */
.inv-quick-prompts { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.inv-quick-btn {
  font-size: 0.75rem; padding: 5px 12px; border-radius: 16px;
  background: var(--bg-widget); border: 1px solid var(--border);
  color: var(--muted); transition: all 0.15s;
}
.inv-quick-btn:hover { border-color: var(--blue); color: var(--blue); background: rgba(72,149,239,0.08); }

/* Input row */
.inv-chat-input-row { display: flex; gap: 8px; align-items: flex-end; }
.inv-chat-textarea {
  flex: 1; background: var(--bg-widget); border: 1px solid var(--border);
  color: var(--text); border-radius: 10px; padding: 10px 14px;
  font-size: 0.9rem; resize: none; transition: border-color 0.2s;
  line-height: 1.5;
}
.inv-chat-textarea:focus { outline: none; border-color: var(--blue); }
.inv-send-btn {
  width: 42px; height: 42px; border-radius: 10px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--blue), #5e60ce);
  border: none; color: #fff; display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.inv-send-btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(72,149,239,0.4); }
.inv-send-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.inv-chat-input-area { padding-top: 4px; }
.inv-chat-footer-note { font-size: 0.7rem; color: var(--muted); margin-top: 8px; text-align: center; }

/* ─── Inversiones: Índices ──────────────────────────────────── */
.inv-indices-grid { display: flex; flex-direction: column; gap: 5px; }
.inv-index-row { display: grid; grid-template-columns: 22px 90px 1fr auto auto; gap: 6px; align-items: center; font-size: 0.82rem; }
.inv-index-icon { font-size: 1rem; text-align: center; }
.inv-index-name { color: var(--text); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inv-index-price { color: var(--text); }
.inv-index-change { font-weight: 700; font-size: 0.8rem; text-align: right; }
.inv-index-ytd { font-size: 0.72rem; text-align: right; }

/* ─── Inversiones: Macro ────────────────────────────────────── */
.inv-macro-grid { display: flex; flex-direction: column; gap: 5px; }
.inv-macro-row { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; font-size: 0.82rem; border-bottom: 1px solid var(--border); padding-bottom: 4px; }
.inv-macro-name { color: var(--muted); }
.inv-macro-val { font-weight: 700; }
.inv-macro-date { font-size: 0.7rem; }

/* ─── Inversiones: Sectores ─────────────────────────────────── */
.inv-sectores-grid { display: flex; flex-direction: column; gap: 6px; }
.inv-sector-row { display: grid; grid-template-columns: 90px 1fr 52px; gap: 6px; align-items: center; }
.inv-sector-name { font-size: 0.78rem; color: var(--text); white-space: nowrap; }
.inv-sector-bar-wrap { background: var(--bg-widget); border-radius: 3px; height: 8px; overflow: hidden; }
.inv-sector-bar { height: 100%; border-radius: 3px; min-width: 2px; }
.inv-sector-bar.green { background: var(--green); }
.inv-sector-bar.red   { background: var(--red); }
.inv-sector-pct { font-size: 0.78rem; font-weight: 700; text-align: right; }

/* ─── Inversiones: source badge ─────────────────────────────── */
.inv-data-src { font-size: 0.68rem; color: var(--muted); background: var(--bg-widget); border-radius: 3px; padding: 1px 5px; }

/* ─── Fear & Greed: scale & zones ───────────────────────────── */
.fg-scale { display: flex; justify-content: space-between; font-size: 0.7rem; color: var(--muted); margin-top: 4px; }
.fg-zones { display: flex; gap: 3px; margin-top: 8px; justify-content: center; flex-wrap: wrap; }
.fg-zone { font-size: 0.65rem; padding: 1px 5px; border-radius: 3px; color: #fff; font-weight: 600; }
.fg-zone.red    { background: #c0392b; }
.fg-zone.orange { background: #e67e22; }
.fg-zone.yellow { background: #f39c12; color: #1a1a2e; }
.fg-zone.green  { background: #27ae60; }
.fg-zone.teal   { background: #00b894; }
.fg-value.teal  { color: #00b894; }
.fg-value.orange{ color: #e67e22; }
.fg-bar-fill.teal   { background: linear-gradient(90deg, #27ae60, #00b894); }
.fg-bar-fill.orange { background: linear-gradient(90deg, #e67e22, #f39c12); }

/* ─── Cartera ───────────────────────────────────────────────── */
.crt-form { display: flex; flex-direction: column; gap: 10px; }
.crt-label { font-size: 0.78rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; margin-top: 4px; }
.crt-radio-group { display: flex; flex-direction: column; gap: 4px; }
.crt-radio { display: flex; align-items: center; gap: 6px; font-size: 0.82rem; cursor: pointer; color: var(--text); }
.crt-radio input { accent-color: var(--blue); }
.crt-ticker-row { display: flex; gap: 6px; }
.crt-ticker-list { display: flex; flex-wrap: wrap; gap: 5px; min-height: 24px; }
.crt-ticker-tag { display: inline-flex; align-items: center; gap: 4px; background: var(--bg-widget); border: 1px solid var(--border); border-radius: 4px; padding: 2px 8px; font-size: 0.78rem; color: var(--text); font-weight: 600; }
.crt-ticker-rm { background: none; border: none; cursor: pointer; color: var(--muted); font-size: 1rem; line-height: 1; padding: 0 0 0 2px; }
.crt-ticker-rm:hover { color: var(--red); }
.crt-presets { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.crt-preset-label { font-size: 0.72rem; color: var(--muted); }
.crt-preset-btn { font-size: 0.72rem; padding: 2px 8px; background: var(--bg-widget); border: 1px solid var(--border); border-radius: 4px; color: var(--muted); cursor: pointer; }
.crt-preset-btn:hover { color: var(--text); border-color: var(--blue); }
.crt-status { font-size: 0.78rem; min-height: 18px; }
.crt-status.green { color: var(--green); }
.crt-status.red   { color: var(--red); }
.crt-status.muted { color: var(--muted); }
.crt-metrics-row { display: flex; gap: 10px; flex-wrap: wrap; }
.crt-metric { background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; text-align: center; flex: 1; min-width: 90px; }
.crt-metric-val { font-size: 1.1rem; font-weight: 800; font-family: 'JetBrains Mono', monospace; }
.crt-metric-lbl { font-size: 0.7rem; color: var(--muted); margin-top: 2px; }
.crt-metric-val.blue { color: var(--blue); }

/* ═══════════════════════════════════
   FUNDAMENTAL TAB
═══════════════════════════════════ */
.fund-search-bar {
  display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap;
}
.fund-ticker-input {
  flex: 1; min-width: 160px; max-width: 300px;
  background: var(--bg-widget); border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 12px; color: var(--text); font-size: 0.9rem; outline: none;
}
.fund-ticker-input:focus { border-color: var(--blue); }
.fund-period-sel {
  background: var(--bg-widget); border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 10px; color: var(--text); font-size: 0.85rem; outline: none; cursor: pointer;
}
.fund-search-btn { padding: 8px 18px; font-size: 0.87rem; }
.fund-status      { font-size: 0.82rem; margin-bottom: 8px; min-height: 18px; }
.fund-status-error { color: var(--red); }
.fund-status-warn  { color: var(--yellow); }
.fund-status-info  { color: var(--blue); }

.fund-company-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px;
  padding: 14px 18px; display: flex; justify-content: space-between; align-items: center;
  gap: 12px; margin-bottom: 14px; flex-wrap: wrap;
}
.fund-company-info { flex: 1; }
.fund-company-name { font-size: 1.05rem; font-weight: 700; color: var(--text); }
.fund-company-meta { font-size: 0.78rem; color: var(--muted); margin-top: 3px; }
.fund-price-block  { text-align: right; }
.fund-price-main   { font-size: 1.25rem; font-weight: 700; color: var(--blue); }
.fund-price-range  { font-size: 0.75rem; color: var(--muted); margin-top: 2px; }

.fund-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px; margin-bottom: 14px;
}
.fund-metric-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; text-align: center; transition: border-color 0.2s;
}
.fund-metric-card.fmc-green  { border-color: rgba(6,255,165,0.35); background: rgba(6,255,165,0.05); }
.fund-metric-card.fmc-yellow { border-color: rgba(240,192,64,0.35); background: rgba(240,192,64,0.05); }
.fund-metric-card.fmc-red    { border-color: rgba(255,77,77,0.35);  background: rgba(255,77,77,0.05);  }
.fund-metric-label { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 6px; }
.fund-metric-value { font-size: 1.05rem; font-weight: 700; color: var(--text); font-family: 'JetBrains Mono', monospace; }
.fmc-green  .fund-metric-value { color: var(--green); }
.fmc-yellow .fund-metric-value { color: var(--yellow); }
.fmc-red    .fund-metric-value { color: var(--red); }

.fund-chart-area {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px;
  padding: 14px; margin-bottom: 14px;
}
.fund-chart-controls {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px;
}
.fund-period-btns { display: flex; gap: 4px; }
.fund-pb {
  background: var(--bg-widget); border: 1px solid var(--border); border-radius: 6px;
  padding: 4px 10px; font-size: 0.78rem; color: var(--muted); cursor: pointer; transition: all 0.15s;
}
.fund-pb.active, .fund-pb:hover { background: var(--blue); color: #fff; border-color: var(--blue); }
.fund-sma-toggles { display: flex; gap: 10px; }
.fund-sma-lbl     { font-size: 0.78rem; color: var(--muted); display: flex; align-items: center; gap: 4px; cursor: pointer; }
.fund-sma-lbl input { accent-color: var(--blue); }
.fund-chart-wrap  { height: 260px; position: relative; }

.fund-ai-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px;
  padding: 14px 18px;
}
.fund-ai-header {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px;
}
.fund-ai-title { font-weight: 700; font-size: 0.95rem; color: var(--text); }
.inv-ai-badge {
  font-size: 0.68rem; font-weight: 700; padding: 3px 8px; border-radius: 5px;
  background: rgba(6,255,165,0.1); color: var(--green); border: 1px solid rgba(6,255,165,0.2);
}
.fund-value-btn   { padding: 6px 14px; font-size: 0.82rem; margin-left: auto; }
.fund-value-loading { font-size: 0.85rem; color: var(--muted); font-style: italic; }
.fund-verdict     { font-size: 1.2rem; font-weight: 800; letter-spacing: 0.05em; margin-bottom: 8px; }
.fund-verdict-green  { color: var(--green); }
.fund-verdict-red    { color: var(--red); }
.fund-verdict-neutral { color: var(--yellow); }
.fund-ai-explanation { font-size: 0.88rem; color: var(--muted); line-height: 1.6; white-space: pre-wrap; }

/* ═══════════════════════════════════
   RESPONSIVE
═══════════════════════════════════ */
@media (max-width: 1024px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .app-main { margin-left: 0; }
  .section-row { grid-template-columns: 1fr; }
  .topbar-status { display: none; }
}
@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .page-content { padding: 16px 12px 32px; }
  .auth-card { padding: 32px 24px; }
  .topbar-clock { display: none; }
  .topbar-user .user-info { display: none; }
  /* Trades table mobile */
  .filter-bar { gap: 12px; padding: 12px 14px; }
  .ctrl-select, .ctrl-btn { font-size: 0.8rem; padding: 6px 10px; }
  /* Analytics charts on mobile */
  .chart-wrap canvas { max-width: 100%; }
  /* Settings form */
  .settings-form { padding: 16px; }
  /* Sidebar on mobile */
  .topbar { padding: 0 12px; }
  .topbar-breadcrumb { font-size: 0.85rem; }
  /* KPI value size */
  .kpi-value { font-size: 1.4rem; }
}

/* ═══════════════════════════════════════
   NOTIFICATION TOASTS
═══════════════════════════════════════ */
#nt-toast-wrap {
  position: fixed;
  top: 76px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 320px;
  pointer-events: none;
}

.nt-toast {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #131730;
  border: 1px solid rgba(72,149,239,.22);
  border-radius: 14px;
  padding: 14px 14px 18px;
  pointer-events: all;
  box-shadow: 0 8px 36px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.03);
  opacity: 0;
  transform: translateX(110%);
  transition: opacity .32s ease, transform .36s cubic-bezier(.34,1.56,.64,1);
  overflow: hidden;
}
.nt-toast.nt-show {
  opacity: 1;
  transform: translateX(0);
}
.nt-toast.nt-hide {
  opacity: 0;
  transform: translateX(110%);
  transition: opacity .28s ease, transform .28s ease;
}

/* type borders */
.nt-toast-success     { border-color: rgba(6,255,165,.3); }
.nt-toast-warning     { border-color: rgba(251,189,35,.3); }
.nt-toast-error       { border-color: rgba(255,77,109,.3); }
.nt-toast-achievement { border-color: rgba(245,158,11,.45); background: linear-gradient(135deg,#131730,#1a1028); }
.nt-toast-trade_open  { border-color: rgba(6,255,165,.28); }
.nt-toast-trade_close { border-color: rgba(72,149,239,.28); }

.nt-t-icon {
  font-size: 1.5rem;
  line-height: 1;
  flex-shrink: 0;
  padding-top: 1px;
}
.nt-t-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.nt-t-title {
  font-size: .8rem;
  font-weight: 700;
  color: #e0e4ff;
  line-height: 1.3;
}
.nt-t-text {
  font-size: .73rem;
  color: #8892b0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nt-t-close {
  background: none;
  border: none;
  color: #8892b0;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  flex-shrink: 0;
  padding: 0 2px;
  transition: color .15s;
}
.nt-t-close:hover { color: #e0e4ff; }

/* progress bar at bottom */
.nt-t-progress {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: rgba(255,255,255,.05);
  border-radius: 0 0 14px 14px;
  overflow: hidden;
}
.nt-t-bar {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #4895ef, #7c3aed);
  animation: nt-bar-drain linear forwards;
  transform-origin: left;
}
@keyframes nt-bar-drain {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}

/* achievement glow */
.nt-toast-achievement .nt-t-bar {
  background: linear-gradient(90deg, #f59e0b, #ef4444);
}

@media (max-width: 480px) {
  #nt-toast-wrap { width: calc(100vw - 32px); right: 16px; }
}
