/* CSMOM Console — стиль «Shares» (DESIGN.md): белый холст, один акцент
   #594ff4, карточки 36px/#f6f6f6, pill-кнопки, без теней и градиентов.
   Осознанное отступление: приглушённые зелёный/красный для знака PnL. */

:root {
  --accent: #594ff4;        /* Signal Violet — действия, активные состояния, серии */
  --ink: #1f1f1f;           /* Inkstone — заголовки, основной текст */
  --ink2: #333333;          /* Graphite */
  --slate: #5d5d5d;         /* вторичный текст, подписи осей */
  --muted: #888888;         /* Smoke — третичный текст */
  --ash: #b0b0b0;           /* линии-волоски */
  --mist: #e7e7e7;          /* разделители, сетка графиков */
  --cloud: #f6f6f6;         /* поверхность карточек */
  --surface: #ffffff;       /* холст */
  --pos: #0e8345;           /* PnL + (4.8:1 на белом) */
  --neg: #c23434;           /* PnL − (5.5:1 на белом) */
  --grid: #ececec;
  --radius-card: 36px;
  --radius-input: 16px;
  --radius-pill: 99px;
  --font: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font); font-weight: 500; font-size: 15px;
  color: var(--ink); background: var(--surface); line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-weight: 700; line-height: 1.15; margin: 0; }
h2 { font-size: 26px; letter-spacing: .01em; }
h3 { font-size: 18px; }
a { color: var(--accent); text-decoration: none; }
button { font-family: inherit; font-weight: 500; cursor: pointer; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px 64px; }

/* ─── навигация ─── */
.nav { background: var(--surface); border-bottom: 1px solid var(--mist);
  position: sticky; top: 0; z-index: 20; }
.nav-inner { max-width: 1200px; margin: 0 auto; height: 64px; padding: 0 24px;
  display: flex; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700;
  font-size: 17px; letter-spacing: .02em; white-space: nowrap; }
.brand .logo { width: 26px; height: 26px; border-radius: 8px;
  background: var(--accent); display: inline-flex; align-items: center;
  justify-content: center; color: #fff; font-size: 13px; font-weight: 700; }
.brand span.dim { color: var(--muted); font-weight: 500; }
nav#tabs { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
nav#tabs button { border: 0; background: transparent; color: var(--ink);
  font-size: 15px; padding: 8px 14px; border-radius: var(--radius-pill);
  white-space: nowrap; }
nav#tabs button:hover { background: var(--cloud); }
nav#tabs button.active { background: var(--accent); color: #fff; }
.nav-right { display: flex; align-items: center; gap: 12px; }

/* ─── кнопки ─── */
.btn { border: 0; background: var(--accent); color: #fff; font-size: 15px;
  padding: 12px 28px; border-radius: var(--radius-pill); }
.btn:hover { opacity: .92; }
.btn-ghost { background: transparent; border: 1px solid var(--ash);
  color: var(--ink2); font-size: 14px; padding: 7px 18px;
  border-radius: var(--radius-pill); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.chip { border: 0; background: var(--cloud); color: var(--ink); font-size: 13.5px;
  padding: 5px 14px; border-radius: var(--radius-pill); }
.chip.active { background: var(--accent); color: #fff; }

/* ─── карточки и плитки ─── */
.card { background: var(--cloud); border-radius: var(--radius-card);
  padding: 32px; margin-top: 24px; }
.card > h3 { margin-bottom: 16px; }
.card .sub { color: var(--muted); font-size: 13.5px; margin-top: -12px;
  margin-bottom: 16px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px; margin-top: 24px; }
.tile { background: var(--cloud); border-radius: 20px; padding: 18px 22px; }
.tile .lbl { color: var(--muted); font-size: 12.5px; letter-spacing: .06em;
  text-transform: uppercase; }
.tile .val { font-size: 26px; font-weight: 700; margin-top: 4px;
  font-variant-numeric: tabular-nums; }
.tile .sub { color: var(--slate); font-size: 13px; margin-top: 2px; }

/* карточки позиций на главной */
.poscards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px; margin-top: 16px; }
.poscard { background: var(--surface); border: 1px solid var(--mist);
  border-radius: 20px; padding: 14px 16px; }
.poscard .row1 { display: flex; align-items: center; gap: 8px; }
.poscard .sym { font-weight: 700; font-size: 15px; }
.poscard .pnl { font-size: 22px; font-weight: 700; margin-top: 6px;
  font-variant-numeric: tabular-nums; }
.poscard .meta { color: var(--muted); font-size: 12.5px; margin-top: 2px; }

/* ─── таблицы ─── */
.tablewrap { overflow-x: auto; }
table.data { border-collapse: collapse; width: 100%; font-size: 13.5px; }
table.data th { text-align: left; color: var(--muted); font-weight: 500;
  font-size: 12px; letter-spacing: .05em; text-transform: uppercase;
  padding: 8px 10px; border-bottom: 1px solid var(--ash); white-space: nowrap; }
table.data td { padding: 8px 10px; border-bottom: 1px solid var(--mist);
  white-space: nowrap; font-variant-numeric: tabular-nums; }
table.data tr:hover td { background: rgba(89, 79, 244, .04); }
table.data td.num, table.data th.num { text-align: right; }
table.data td.reason { white-space: normal; min-width: 260px; color: var(--slate);
  font-size: 12.5px; }

.pos { color: var(--pos); } .neg { color: var(--neg); }

/* бейджи */
.badge { display: inline-block; padding: 2px 10px; border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 500; }
.badge.long { background: rgba(14, 131, 69, .1); color: var(--pos); }
.badge.short { background: rgba(194, 52, 52, .1); color: var(--neg); }
.badge.neutral { background: var(--cloud); color: var(--ink2); }
.badge.violet { background: var(--accent); color: #fff; }
.badge.outline { border: 1px solid var(--ash); color: var(--slate); }

/* иконки монет */
.coin { display: inline-flex; align-items: center; gap: 7px; }
.coin img, .coin .mono { width: 20px; height: 20px; border-radius: 50%;
  flex: 0 0 20px; }
.coin .mono { background: var(--mist); color: var(--ink2); font-size: 8px;
  font-weight: 700; display: inline-flex; align-items: center;
  justify-content: center; letter-spacing: 0; }

/* ─── баннер здоровья ─── */
#banner:empty { display: none; }
#banner { max-width: 1200px; margin: 16px auto 0; padding: 0 24px; }
.banner-warn { background: #fdf3e7; color: #7a4a12; border-radius: 16px;
  padding: 12px 20px; font-size: 14px; }

/* ─── графики ─── */
.chartbox { margin-top: 8px; }
.scrollx { overflow-x: auto; }
.tooltip { position: fixed; z-index: 50; background: var(--ink); color: #fff;
  border-radius: 10px; padding: 8px 12px; font-size: 12.5px; pointer-events: none;
  max-width: 320px; }
.tooltip .tt-title { font-weight: 700; margin-bottom: 4px; }
.tooltip .tt-row { display: flex; align-items: center; gap: 6px; }
.tooltip .tt-key { width: 10px; border-top: 3px solid; display: inline-block; }
.tooltip .tt-lbl { color: #b8b8b8; }

/* ─── сетка секций ─── */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 900px) { .grid2 { grid-template-columns: 1fr; } }
.section-head { display: flex; align-items: baseline; gap: 16px; margin-top: 40px;
  flex-wrap: wrap; }
.section-head .spacer { flex: 1; }
.controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  margin-top: 12px; }
select, input[type="text"] { font-family: inherit; font-size: 14px;
  padding: 8px 14px; border: 1px solid var(--ash); border-radius: var(--radius-input);
  background: var(--surface); color: var(--ink); }

/* пагинация */
.pager { display: flex; gap: 8px; align-items: center; margin-top: 12px;
  color: var(--slate); font-size: 13.5px; }

/* ─── блоттер ─── */
.rb-row { border-bottom: 1px solid var(--mist); padding: 14px 4px; cursor: pointer; }
.rb-row:hover { background: rgba(89, 79, 244, .03); }
.rb-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.rb-head .date { font-weight: 700; min-width: 110px; }
.rb-head .kv { color: var(--slate); font-size: 13.5px; }
.rb-detail { padding: 12px 4px 20px; }
.rb-detail h4 { margin: 16px 0 8px; font-size: 14px; letter-spacing: .05em;
  text-transform: uppercase; color: var(--slate); }

/* ─── логин ─── */
.login-wrap { min-height: 100vh; display: flex; align-items: center;
  justify-content: center; background: var(--surface); }
.login-card { background: var(--cloud); border-radius: var(--radius-card);
  padding: 48px; width: 380px; text-align: center; }
.login-card .logo { width: 48px; height: 48px; border-radius: 14px;
  background: var(--accent); color: #fff; font-weight: 700; font-size: 22px;
  display: inline-flex; align-items: center; justify-content: center; }
.login-card h1 { font-size: 26px; margin: 20px 0 6px; }
.login-card p { color: var(--slate); margin: 0 0 24px; }
.login-card input { width: 100%; padding: 13px 18px; font-size: 15px;
  border: 1px solid var(--ash); border-radius: var(--radius-input);
  margin-bottom: 14px; background: var(--surface); }
.login-card .btn { width: 100%; }
.login-err { color: var(--neg); font-size: 13.5px; min-height: 20px;
  margin-top: 10px; }

/* ─── футер ─── */
.footer { border-top: 1px solid var(--mist); margin-top: 64px; }
.footer-inner { max-width: 1200px; margin: 0 auto; padding: 20px 24px;
  color: var(--muted); font-size: 12.5px; }

.msg { color: var(--muted); padding: 24px; text-align: center; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.ok { background: var(--pos); } .dot.bad { background: var(--neg); }
.dot.na { background: var(--ash); }
