/* ===========================================================================
   Shared account theme — top stat cards + account switcher popup + nav polish.
   Ported from the LDP Analyzer. Loaded AFTER each page's own style.css so the
   .menu-link / .market-menue tweaks win. All other classes are unique (stat-*,
   acct-sw-*) so they never collide with a page's existing styles.
   =========================================================================== */

/* ----- Top account / balance / profit stat cards ----- */
.stat-row {
  display: flex;
  gap: 10px;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 4px;
  box-sizing: border-box;
}

.stat-card {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #ffffff;
  border: 1px solid #e3e6ea;

  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  text-align: left;
}

.stat-card .stat-icon {
  font-size: 1.3em;
  color: #5d5d5d;
  flex-shrink: 0;
}

.stat-body {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  min-width: 0;
}

.stat-key {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #90a0ad;
}

.stat-key-short { display: none; }

.stat-val {
  font-size: 1.15rem;
  font-weight: 700;
  color: #1f2d3a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-caret {
  margin-left: auto;
  color: #90a0ad;
  font-size: 1em;
  flex-shrink: 0;
}

.stat-card.switchable {
  cursor: pointer;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.stat-card.switchable:hover {
  border-color: #406781;
  box-shadow: 0 2px 8px rgba(64, 103, 129, 0.18);
}
.stat-card.switchable:hover .stat-caret { color: #406781; }

@media only screen and (max-width: 992px) {
  .stat-card { padding: 8px 10px; gap: 8px; }
  .stat-val { font-size: 1rem; }
}

@media only screen and (max-width: 600px) {
  .stat-row { gap: 6px; padding: 0; }
  .stat-card {
    flex-direction: column;
    align-items: center;
    gap: 1px;
    padding: 6px 3px;
    text-align: center;
    border-left: 1px solid #e3e6ea;
  }
  .stat-card .stat-icon { font-size: 0.95em; }
  .stat-body { align-items: center; width: 100%; }
  .stat-key-full { display: none; }
  .stat-key-short { display: inline; }
  .stat-key { font-size: 0.6rem; }
  .stat-val { font-size: 0.8rem; max-width: 100%; }
  .stat-caret { display: none !important; }
}

/* ----- Account switcher popup ----- */
.acct-sw-overlay {
  position: fixed;
  inset: 0;
  z-index: 10001;
  background: rgba(15, 23, 32, 0.28);
}

.acct-sw-pop {
  position: absolute;
  background: #ffffff;
  border: 1px solid #d9dee4;
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
  overflow: hidden;
  font-family: 'Arial', sans-serif;
  animation: acctSwIn 0.12s ease-out;
}

@keyframes acctSwIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.acct-sw-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #5b6b7a;
  background: #f4f6f8;
  border-bottom: 1px solid #e6eaee;
}

.acct-sw-close { cursor: pointer; color: #97a3ae; padding: 2px 4px; }
.acct-sw-close:hover { color: #d33; }

.acct-sw-list { max-height: 260px; overflow-y: auto; padding: 4px; }

/* One compact line per account: dot · id · pill · balance · check */
.acct-sw-row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.12s ease;
}
.acct-sw-row:hover { background: #f0f4f8; }
.acct-sw-row.active { background: #eaf1f6; }

.acct-sw-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.acct-sw-dot.real { background: #2ecc71; }
.acct-sw-dot.demo { background: #f39c12; }

.acct-sw-id { font-size: 0.78rem; font-weight: 700; color: #1f2d3a; white-space: nowrap; }

.acct-sw-pill {
  font-size: 0.54rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  padding: 1px 5px;
  border-radius: 8px;
  color: #fff;
  flex-shrink: 0;
}
.acct-sw-pill.real { background: #2ecc71; }
.acct-sw-pill.demo { background: #f39c12; }

.acct-sw-bal {
  margin-left: auto;
  font-size: 0.7rem;
  color: #5f6f7c;
  font-family: monospace;
  white-space: nowrap;
}
.acct-sw-bal.muted { color: #9aa6b1; }

.acct-sw-check { color: #406781; font-size: 0.8rem; flex-shrink: 0; width: 0.9em; text-align: center; }
.acct-sw-check.hidden { visibility: hidden; }

.acct-sw-loading {
  padding: 20px 16px;
  text-align: center;
  font-size: 0.9rem;
  color: #46586a;
  font-family: 'Arial', sans-serif;
}
.acct-sw-loading .fa { margin-right: 6px; color: #406781; }

@media only screen and (max-width: 600px) {
  .acct-sw-id { font-size: 0.74rem; }
  .acct-sw-bal { font-size: 0.66rem; }
}

/* ----- Header logo — unify every page to the exact LDP logo theme ----- */
.header .header-titl,
.header h1 {
  font-size: 36px;
  font-weight: 400;
  letter-spacing: normal;
  line-height: 1.25;
  color: rgb(6, 7, 9);
  font-family: "Segoe UI", Arial, sans-serif;
  margin: 0;
}

/* ----- Nav typography polish (matches LDP) ----- */
.menu-link {
  color: #33414f;
}

/* Smaller market tabs on mobile so all volatility tabs fit one row.
   Only affects pages that actually have a .market-menue. */
@media only screen and (max-width: 600px) {
  .market-menue span,
  .market-menue span.menu-active {
    font-size: 9px;
    padding: 4px 0;
    margin: 0.08em;
    border-radius: 4px;
  }
}
