/* ==========================================================================
   Totem Control — additions on top of the Fleet Control styles (style.css,
   views.css, pages.css): login, totem-specific panels (orders, stock, market),
   hosts and settings pages, and small fixes.
   ========================================================================== */

.app { padding-bottom: 64px; }
.view { min-height: 60vh; }

/* ---- login ---- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login__card { width: min(400px, 100%); padding: 26px; display: grid; gap: 16px; animation: pop .4s cubic-bezier(.2, 1.1, .3, 1) both; }
.login__card h1 { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.brand__mark--lg { width: 44px; height: 44px; border-radius: 13px; padding: 7px; gap: 4px; }
.login .btn { height: 42px; }

/* ---- top bar extras ---- */
.zoom-hint { cursor: pointer; border-color: var(--warn-line); color: var(--warn); background: var(--warn-soft); }
#wallPill .players__n { color: var(--text); }
#pausePill.is-on { border-color: var(--warn-line); }
#pausePill.is-on svg, #pausePill.is-on .players__n { color: var(--warn); }
#hostPill.is-warn { border-color: var(--warn-line); }
#hostPill.is-warn svg, #hostPill.is-warn .players__n { color: var(--warn); }
#hostPill.is-ok { border-color: var(--ok-line); }
#hostPill.is-ok svg, #hostPill.is-ok .players__n { color: var(--ok); }

/* ---- money ---- */
.pos { color: var(--ok); }
.neg { color: var(--danger); }
.usd { color: var(--ok); font-weight: 600; }
.stat__sub { font-size: 12.5px; color: var(--text-3); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat__sub .usd { font-size: 12.5px; }
.roll__shards small { margin-left: 2px; }
.tag--neg { background: var(--danger-soft); color: var(--danger); }
.tag--grey { background: var(--tile); color: var(--text-2); }
.tag--warn { background: var(--warn-soft); color: var(--warn); }

/* the strip under the tabs uses six tiles; let them wrap evenly */
@media (min-width: 721px) { .statstrip { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); } }
.stat__value small { font-size: 13px; color: var(--text-3); font-weight: 500; margin-left: 4px; }

/* ---- overview: market panel ---- */
.market { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 16px 20px 20px; }
.market .tile__value { font-size: 22px; }
.spread { margin: 0 20px 20px; padding: 12px 14px; border-radius: var(--r-md); background: var(--tile); border: 1px solid var(--tile-border); display: grid; gap: 8px; }
.spread__bar { position: relative; height: 10px; border-radius: 6px; background: var(--track); overflow: visible; }
.spread__fill { position: absolute; top: 0; bottom: 0; border-radius: 6px; background: linear-gradient(90deg, var(--warn), var(--ok)); transition: left .8s cubic-bezier(.2, .8, .25, 1), width .8s cubic-bezier(.2, .8, .25, 1); }
.spread__lbls { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-3); }

/* ---- fleet roster columns ---- */
.order-cell { min-width: 150px; }
.order-cell .minibar { width: 100%; max-width: 150px; margin: 6px 0 0; display: block; }
.stock-cell b { font-weight: 650; }
.cell-muted { color: var(--text-3); }
.bot-table td .acct__name { max-width: 180px; }
.bot-table .badge--stopped { background: var(--tile); color: var(--text-3); }
.bot-table .badge--host { background: var(--danger-soft); color: var(--danger); }
.badge--paused { background: var(--warn-soft); color: var(--warn); }
.badge--paused::before { animation: none; }

/* cards */
.bcard__nums b.pos { color: var(--ok); }
.bcard__meta { display: flex; gap: 6px; flex-wrap: wrap; }
.bcard__meta .meta-pill { font-size: 11.5px; padding: 2px 8px; }

/* ---- account page ---- */
.order-box { display: grid; gap: 14px; padding: 16px 20px 20px; }
.order-main { display: grid; gap: 8px; padding: 14px 16px; border-radius: var(--r-md); background: var(--tile); border: 1px solid var(--tile-border); }
.order-main__top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.order-main__top b { font-size: 20px; font-weight: 700; letter-spacing: -.015em; font-variant-numeric: tabular-nums; }
.order-main .coverage__bar { height: 9px; }
.order-main__meta { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 12.5px; color: var(--text-2); }
.order-list { display: grid; gap: 6px; }
.order-list__row { display: grid; grid-template-columns: 1fr 120px; gap: 12px; align-items: center; font-size: 13px; color: var(--text-2); padding: 6px 0; border-bottom: 1px solid var(--line); }
.order-list__row:last-child { border-bottom: 0; }
.stockbars { display: grid; gap: 10px; padding: 16px 20px 6px; }
.stockbar { display: grid; grid-template-columns: 130px 1fr 56px; align-items: center; gap: 12px; font-size: 13px; color: var(--text-2); }
.stockbar b { color: var(--text); text-align: right; font-variant-numeric: tabular-nums; }
.stockbar .vital__bar i { background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.stockbar--inv .vital__bar i { background: var(--warn); }
.stockbar--ah .vital__bar i { background: var(--ok); }
.sales-table td { padding-top: 9px; padding-bottom: 9px; }
.hero .avatar img { width: 100%; height: 100%; border-radius: inherit; image-rendering: pixelated; }
.hero__actions .btn svg { width: 15px; height: 15px; }

/* ---- menus (account "More") ---- */
.menu-list { display: grid; gap: 6px; }
.menu-list .btn { justify-content: flex-start; height: 42px; }
.menu-list .btn small { margin-left: auto; color: var(--text-3); font-weight: 500; }

/* ---- actions page ---- */
.action-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.action { display: grid; gap: 10px; padding: 18px 20px 20px; }
.action p { color: var(--text-2); font-size: 13px; line-height: 1.55; }
.action .btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.sweep { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; }
@media (max-width: 720px) { .sweep { grid-template-columns: 1fr; } }

/* ---- hosts page ---- */
.panel-connect { display: grid; grid-template-columns: 1.1fr 1.6fr 110px auto; gap: 10px; padding: 16px 20px 20px; }
@media (max-width: 900px) { .panel-connect { grid-template-columns: 1fr; } }
.host-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.console { height: 420px; overflow: auto; background: var(--term); font-family: var(--font-mono); font-size: 12.5px; line-height: 1.55; padding: 12px 20px; white-space: pre-wrap; overflow-wrap: anywhere; }
.joblog { height: 240px; }
.bundle-list { display: grid; padding: 6px 20px 16px; }
.bundle-list > div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.bundle-list > div:last-child { border-bottom: 0; }
.bundle-list code { font-family: var(--font-mono); color: var(--text); }
.bundle-list span { color: var(--text-3); font-variant-numeric: tabular-nums; }

/* ---- settings page ---- */
.set-list { display: grid; }
.set-row { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) 160px auto; gap: 12px; align-items: center; padding: 12px 20px; border-top: 1px solid var(--line); }
.set-row:first-child { border-top: 0; }
.set-row__key { font-family: var(--font-mono); font-size: 13px; color: var(--accent); }
.set-row__about { display: block; font-size: 12.5px; color: var(--text-3); margin-top: 2px; font-family: var(--font-ui); }
.set-row__val b { font-variant-numeric: tabular-nums; }
.set-row__val small { display: block; font-size: 12px; color: var(--text-3); }
.set-row__val .diff { color: var(--warn); font-size: 12.5px; display: block; }
.set-row .input { width: 100%; }
.set-row .btn-row { display: flex; gap: 6px; }
@media (max-width: 900px) { .set-row { grid-template-columns: 1fr; } }
.money-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 16px 20px 20px; }
.money-form .input { width: 140px; }
.money-form .hint { flex: 1 1 100%; }

/* ---- logs: account column and level chips ---- */
.ll__tag { cursor: pointer; }
.ll--sale { border-left-color: var(--ok); } .ll--sale .ll__lvl, .ll--sale .ll__msg { color: var(--ok); }
.ll--order .ll__lvl { color: var(--warn); }
.ll--listing .ll__lvl { color: var(--info); }
.ll--whisper .ll__msg, .ll--whisper .ll__lvl { color: var(--violet); }
.ll--kick { border-left-color: var(--danger); background: var(--danger-soft); } .ll--kick .ll__lvl, .ll--kick .ll__msg { color: var(--danger); }
.feed-line__tag--sale { color: var(--ok); } .feed-line__tag--order { color: var(--warn); } .feed-line__tag--listing { color: var(--info); }
.feed-line__tag--kick { color: var(--danger); } .feed-line__tag--trade { color: var(--text-3); }
.feed-line__who { color: hsl(var(--hue, 240) 70% var(--av-l)); font-weight: 600; flex-shrink: 0; cursor: pointer; }
.feed .feed-line__body { color: var(--text); }

/* ---- generic ---- */
.row-gap { display: grid; gap: 16px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.mt16 { margin-top: 16px; }
.nowrap { white-space: nowrap; }
.link { color: var(--accent); cursor: pointer; }
.link:hover { text-decoration: underline; }
.sk-inline { display: inline-block; width: 6ch; height: 1em; border-radius: 6px; background: linear-gradient(100deg, var(--sk-a) 30%, var(--sk-b) 50%, var(--sk-a) 70%); background-size: 220% 100%; animation: shimmer 1.5s linear infinite; vertical-align: middle; }
.modal .field input, .modal .field select { width: 100%; }
.msa-banner__text a { word-break: break-all; }

/* the overview strip shows on overview and fleet only */
.strip-wrap { display: grid; gap: 12px; margin-bottom: 16px; }
.strip-wrap .rolling { margin-top: 0; }

@media (max-width: 720px) {
  .market { padding: 12px 14px 16px; }
  .spread { margin: 0 14px 16px; }
  .stockbars { padding: 12px 14px 4px; }
  .stockbar { grid-template-columns: 100px 1fr 44px; }
  .order-box { padding: 12px 14px 16px; }
  .set-row { padding: 12px 14px; }
  .console { padding: 10px 14px; }
}

.panel-title { font-size: 16px; font-weight: 650; letter-spacing: -.01em; }
@media (max-width: 720px) { .bot-table .col-up { display: none; } }
/* values inside .kpi tiles keep the value size (views.css styles every .kpi span as a label) */
.kpi b span { display: inline; font-size: inherit; color: inherit; font-weight: inherit; }
.kpi b .pos { color: var(--ok); }
.kpi b .neg { color: var(--danger); }
.tile__value .pos, .stat__value .pos { color: var(--ok); }
.tile__value .neg, .stat__value .neg { color: var(--danger); }
/* the account page's log is a normal panel (style.css makes every .panel--feed a sticky side column) */
.acct-page .panel--feed { grid-area: auto !important; grid-column: 1 / -1 !important; position: static !important; top: auto !important; height: 460px !important; min-height: 0 !important; }
