/* =========================================================
   SIMPLEST MONEY — INTERNAL APP v4
   Matched exactly to trade.html uploaded by user
   Black/dark navy + gold accent, no glows, no boxes
   ========================================================= */

:root {
  --bg:       #05070d;
  --panel:    #0c0f1a;
  --panel-2:  #111827;
  --panel-3:  #1a2233;
  --border:   #1e2a3a;
  --border-2: #2a3850;

  --text:     #f0f3f8;
  --muted:    #8899b4;
  --muted-2:  #5e7090;

  --gold:        #f5b400;
  --gold-dark:   #c98f00;
  --gold-dim:    rgba(245,180,0,.10);
  --gold-border: rgba(245,180,0,.28);

  --green:  #00c853;
  --red:    #ff4569;
  --amber:  #f59e0b;

  /* aliases for old markup */
  --accent:        #f5b400;
  --accent-hover:  #c98f00;
  --yellow:        #f5b400;
}

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

html, body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; }
button { border: none; cursor: pointer; transition: .15s ease; -webkit-appearance: none; appearance: none; background: transparent; }
button:hover { opacity: .88; }
button:active { transform: scale(.984); }
button:disabled, input:disabled { opacity: .48; cursor: not-allowed; }
iframe { border: none; }

::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 4px; }


/* ── TOPBAR ──────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 24px;
  height: 60px;
  background: rgba(5,7,13,.97);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

/* Brand — NO box, NO border, NO background */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.brand:hover { opacity: .80; }

.logo { width: 26px; height: 26px; object-fit: contain; }

.brand-name {
  font-size: 15px;
  font-weight: 900;
  letter-spacing: -.02em;
  color: var(--gold);
}

/* Trade topbar variant (wider logo + name) */
.trade-topbar { padding: 0 22px; height: 60px; }
.brand-large  { gap: 11px; }
.logo-large   { width: 28px; height: 28px; }
.brand-name-large {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -.03em;
  color: var(--gold);
}

/* Balance */
.balance {
  margin-left: auto;
  text-align: right;
}
.balance span  { display: block; font-size: 10px; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; margin-bottom: 2px; }
.balance strong{ display: block; font-size: 17px; font-weight: 800; letter-spacing: -.02em; }

.balance-box {
  padding-left: 18px;
  border-left: 1px solid var(--border-2);
  margin-left: 0;
  margin-right: 0;
}
.balance-box span   { font-size: 10px; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; margin-bottom: 2px; }
.balance-box strong { font-size: 17px; font-weight: 800; letter-spacing: -.02em; }

.top-actions       { display: flex; gap: 7px; flex-wrap: wrap; }
.top-actions-trade { display: flex; gap: 7px; }


/* ── BUTTONS ──────────────────────────────── */
.primary, .secondary, .buy, .sell, .close {
  padding: 8px 15px;
  font-size: 13px;
  font-weight: 800;
  border-radius: 8px;
  border: none;
}

.primary { background: var(--gold); color: #111827; }
.primary:hover { background: #e0a400; }

.secondary {
  background: var(--panel-3);
  color: var(--text);
  border: 1px solid var(--border-2);
}
.secondary:hover { background: #1f2d42; color: var(--text); }

.buy  { background: var(--green); color: #fff; }
.buy:hover  { background: #00b84b; }

.sell { background: var(--red); color: #fff; }
.sell:hover { background: #e63358; }

.close {
  background: var(--panel-3);
  color: var(--text);
  border: 1px solid var(--border-2);
}
.close:hover { border-color: var(--gold-border); color: var(--gold); }

.large-btn { padding: 12px 18px; font-size: 14px; border-radius: 10px; }
.full-btn  { width: 100%; border-radius: 10px; }


/* ── PANELS ──────────────────────────────── */
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

.panel-title {
  font-size: 10px;
  font-weight: 900;
  color: var(--muted);
  letter-spacing: .09em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.subtext, .sub { font-size: 12px; color: var(--muted); }
.info  { font-size: 13px; color: var(--muted); margin-top: 8px; }
.green { color: var(--green); }
.red   { color: var(--red); }
.yellow{ color: var(--gold); }


/* ── TERMINAL LAYOUT (3-column) ──────────── */
.layout {
  max-width: 1480px;
  margin: 0 auto;
  padding: 16px 18px 90px;
  display: grid;
  grid-template-columns: 320px minmax(0,1fr) 290px;
  gap: 14px;
}
.layout.simple-layout {
  display: block;
  max-width: 900px;
  padding: 20px 20px 100px;
}

.left-panel, .center-panel, .right-panel { min-width: 0; }
.left-panel  { height: calc(100vh - 60px); overflow: hidden; }
.center-panel{ height: calc(100vh - 60px); overflow: hidden; display: flex; flex-direction: column; gap: 10px; }
.right-panel { height: calc(100vh - 60px); overflow: hidden; }


/* ── MARKET PANEL (sidebar) ──────────────── */
.market-panel {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 14px;
  border-radius: 14px;
}
.market-panel-large { padding: 15px; }

.market-search-box input {
  width: 100%;
  padding: 10px 12px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text);
  font-size: 13px;
  outline: none;
  margin-top: 0;
}
.market-search-box input:focus { border-color: var(--gold-border); }
.market-search-box input::placeholder { color: var(--muted-2); }

#marketList {
  flex: 1;
  overflow-y: auto;
  margin-top: 8px;
}
#marketList::-webkit-scrollbar { width: 3px; }
#marketList::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 4px; }

.market {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 8px;
  border-radius: 9px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: .12s;
}
.market + .market { margin-top: 3px; }
.market:hover { background: var(--panel-2); border-color: var(--border); }
.market.active {
  background: var(--gold-dim);
  border-color: var(--gold-border);
}

.market-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.market-meta { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.market-symbol { font-size: 13px; font-weight: 700; color: var(--text); display: block; }
.market-venue  { font-size: 10px; color: var(--muted); display: block; }
.market-right  { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex-shrink: 0; }
.market-price  { font-size: 12px; font-weight: 700; color: var(--text); }
.market-change { font-size: 10px; font-weight: 700; }

.coin-circle {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--panel-2);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; overflow: hidden;
}
.coin-circle img { width: 64%; height: 64%; object-fit: contain; }
.coin-dark { background: var(--panel-3); }


/* ── CHART ──────────────────────────────── */
.trade-header-panel  { padding: 0; }
.trade-header-strong { padding: 12px 16px; }

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.symbol strong { font-size: 17px; font-weight: 800; letter-spacing: -.02em; }

.trade-price-box { display: flex; flex-direction: column; align-items: flex-end; }
.trade-price-box strong { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.trade-price-box span   { font-size: 12px; font-weight: 700; margin-top: 2px; }

.chart-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 7px 10px;
  border-radius: 12px;
  overflow-x: auto;
  flex-shrink: 0;
}
.chart-toolbar::-webkit-scrollbar { display: none; }

.toolbar-btn {
  padding: 7px 14px;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
  cursor: pointer;
  transition: .12s;
}
.toolbar-btn:hover { color: var(--text); background: var(--panel-2); }
.toolbar-btn.active { background: var(--gold); color: #111827; }

.mobile-market-switch { display: none; }
.mobile-market-switch select {
  width: 100%;
  padding: 10px 12px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  margin-top: 0;
}

.chart-large {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: #0a0f16;
  min-height: 300px;
}
.chart-large-pro { background: #0a0f16; }
#chartContainer  { width: 100%; height: 100%; min-height: 420px; }


/* ── ORDER PANEL ──────────────────────────── */
.trade-box { height: 100%; display: flex; flex-direction: column; padding: 14px; }
.trade-box-strong { padding: 15px; }

.trade-box > input,
.trade-box-strong > input {
  width: 100%;
  padding: 13px 14px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 15px;
  outline: none;
  flex-shrink: 0;
  margin-top: 0;
}
.trade-box > input:focus,
.trade-box-strong > input:focus { border-color: var(--gold-border); }
.trade-box > input::placeholder,
.trade-box-strong > input::placeholder { color: var(--muted-2); }

.actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  flex-shrink: 0;
}
.trade-box-strong .buy,
.trade-box-strong .sell {
  flex: 1;
  padding: 16px;
  font-size: 15px;
  border-radius: 10px;
  min-height: 54px;
}

.trade-status-card {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.trade-inline-info { font-size: 13px; font-weight: 600; color: var(--muted); line-height: 1.5; }
.status-title {
  font-size: 10px; font-weight: 900; letter-spacing: .09em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 4px;
}
.trade-info { margin-top: 8px; font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }


/* ── POSITION BAR ──────────────────────────── */
.bottom-panel {
  position: fixed;
  left: 14px; right: 14px; bottom: 12px;
  background: rgba(12,15,26,.97);
  border: 1px solid var(--border-2);
  border-radius: 16px;
  padding: 12px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 80;
  backdrop-filter: blur(10px);
}
.bottom-panel-strong { padding: 13px 18px; }
.position { display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.position-bar { flex-direction: row; align-items: center; gap: 36px; }
.position-bar #positionType { font-size: 14px; font-weight: 700; }
.position-bar #pnl { font-size: 13px; font-weight: 800; }
.position-bar #currentBarPrice { font-size: 13px; font-weight: 700; color: var(--gold); }
.bottom-panel-strong .close { padding: 9px 20px; font-size: 13px; border-radius: 8px; }


/* ── HISTORY ROWS ──────────────────────────── */
.history-stack { display: flex; flex-direction: column; gap: 14px; }
.history-block { }

.block-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.block-header .panel-title { margin-bottom: 1px; }

.history-list { display: flex; flex-direction: column; }
.history-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 13px 18px;
  border-top: 1px solid var(--border);
}
.history-row:first-child { border-top: none; }
.history-row:hover { background: rgba(255,255,255,.015); }
.history-left  { font-size: 14px; font-weight: 600; color: var(--text); }
.history-right { font-size: 13px; font-weight: 700; color: var(--text); }
.history-empty { padding: 22px 18px; font-size: 13px; color: var(--muted); text-align: center; }


/* ── WALLET ──────────────────────────────── */
.wallet-shell { max-width: 680px; margin: 0 auto; }
.wallet-panel { padding: 22px; }
.wallet-header h2 { margin: 0 0 6px; font-size: 22px; font-weight: 800; letter-spacing: -.03em; }
.wallet-header .panel-title { margin-bottom: 6px; }

.address-box {
  margin: 14px 0;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid var(--gold-border);
  background: var(--gold-dim);
  cursor: pointer;
  transition: .14s;
}
.address-box:hover { background: rgba(245,180,0,.16); }
.address-box .label {
  font-size: 10px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 6px;
}
.address-box .value { font-size: 13px; font-weight: 600; word-break: break-all; color: var(--text); }

.warning-box {
  border-color: rgba(245,158,11,.28);
  background: rgba(245,158,11,.07);
}
.warning-box .label { color: var(--amber); }

.wallet-form { display: flex; flex-direction: column; }
.wallet-form input {
  width: 100%; padding: 13px 14px; margin-top: 10px;
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 10px; color: var(--text); font-size: 14px; outline: none;
}
.wallet-form input:focus { border-color: var(--gold-border); }
.wallet-form input::placeholder { color: var(--muted-2); }


/* ── GENERIC INPUTS ──────────────────────────── */
input, select {
  width: 100%; padding: 12px 14px; margin-top: 10px;
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 10px; color: var(--text); font-size: 14px; outline: none;
}
input:focus, select:focus { border-color: var(--gold-border); }
input::placeholder { color: var(--muted-2); }
select { cursor: pointer; }


/* ── MOBILE NAV ──────────────────────────── */
.mobile-nav { display: none; }


/* ── MARKETS PAGE ──────────────────────────── */
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.filter-btn {
  padding: 7px 14px; border-radius: 999px;
  background: var(--panel-2); border: 1px solid var(--border);
  color: var(--muted); font-size: 12px; font-weight: 700; cursor: pointer;
}
.filter-btn:hover { color: var(--text); border-color: var(--border-2); }
.filter-btn.active { background: var(--gold); border-color: var(--gold); color: #111827; }

.markets-table { width: 100%; border-collapse: collapse; }
.markets-table th {
  text-align: left; padding: 11px 16px;
  font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); border-bottom: 1px solid var(--border);
}
.markets-table td {
  padding: 13px 16px; border-bottom: 1px solid rgba(255,255,255,.03);
  font-size: 14px; vertical-align: middle;
}
.markets-table tr:last-child td { border-bottom: none; }
.markets-table tbody tr:hover td { background: rgba(255,255,255,.02); }

.type-badge {
  display: inline-block; padding: 3px 9px; border-radius: 999px;
  font-size: 9px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
}
.badge-CRYPTO    { background: rgba(245,180,0,.12); color: var(--gold); }
.badge-FOREX     { background: rgba(245,158,11,.12); color: var(--amber); }
.badge-STOCK     { background: rgba(0,200,83,.12);   color: var(--green); }
.badge-COMMODITY { background: rgba(255,69,105,.12); color: var(--red); }

.search-input {
  width: 100%; padding: 11px 14px; margin: 0 0 14px;
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 10px; color: var(--text); font-size: 14px; outline: none;
}
.search-input:focus { border-color: var(--gold-border); }
.search-input::placeholder { color: var(--muted-2); }

.trade-link {
  padding: 7px 14px; border-radius: 8px;
  background: var(--gold-dim); border: 1px solid var(--gold-border);
  color: var(--gold); font-size: 12px; font-weight: 700; cursor: pointer;
}
.trade-link:hover { background: rgba(245,180,0,.18); }


/* ── MISC ──────────────────────────────── */
.eyebrow {
  display: inline-flex; padding: 6px 13px; border-radius: 999px;
  background: var(--gold-dim); border: 1px solid var(--gold-border);
  color: var(--gold); font-size: 11px; font-weight: 900; letter-spacing: .08em;
  margin-bottom: 12px;
}


/* ══════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════ */

/* Tablet */
@media(max-width:1200px) {
  .layout { grid-template-columns: 280px minmax(0,1fr) 260px; }
}
@media(max-width:1050px) {
  .layout { grid-template-columns: 260px minmax(0,1fr); padding-bottom: 90px; }
  .right-panel { display: none; }
}

/* Mobile */
@media(max-width:900px) {
  .layout {
    grid-template-columns: 1fr;
    padding: 12px 12px 90px;
  }
  .left-panel { display: none; }
  .center-panel { height: auto; }
  .chart-large { height: 300px; min-height: 300px; flex: none; }
  #chartContainer { min-height: 300px; }
  .mobile-market-switch { display: block; margin-bottom: 8px; }
  .layout.simple-layout { padding: 14px 14px 90px; }
  .topbar { padding: 10px 16px; }
  .trade-topbar { padding: 10px 14px; }
  .bottom-panel { left: 10px; right: 10px; bottom: 62px; border-radius: 12px; }
  .top-actions .secondary:nth-child(n+3) { display: none; }
  .top-actions-trade .secondary:nth-child(n+3) { display: none; }

  /* Mobile nav */
  .mobile-nav {
    display: flex;
    position: fixed; left: 0; right: 0; bottom: 0;
    height: 56px;
    background: rgba(5,7,13,.97);
    border-top: 1px solid var(--border);
    justify-content: space-around;
    align-items: stretch;
    z-index: 90;
  }
  .mobile-nav a {
    display: flex; align-items: center; justify-content: center;
    flex: 1; font-size: 13px; font-weight: 700; color: var(--muted);
    text-decoration: none; letter-spacing: .01em;
  }
  .mobile-nav a.active { color: var(--gold); }
}

@media(max-width:600px) {
  .topbar  { height: 54px; padding: 0 14px; }
  .layout.simple-layout { padding: 12px 12px 86px; }
  .wallet-shell { max-width: 100%; }
  .history-row { flex-wrap: wrap; }
  .position-bar { flex-direction: column; align-items: flex-start; gap: 4px; }
  .top-actions .secondary { display: none; }
}
