/* ============ QuoteBoard — тёмная финтех-тема ============ */

:root {
  --bg: #070b13;
  --panel: #0d1524;
  --panel-2: #111c30;
  --border: #1c2a44;
  --text: #e8eefc;
  --muted: #8ba0c0;
  --faint: #5b6f92;
  --accent: #4f7cff;
  --accent-2: #38bdf8;
  --grad: linear-gradient(135deg, #4f7cff, #38bdf8);
  --up: #16c784;
  --down: #f6465d;
  --amber: #f5a524;
  --radius: 14px;
  --mono: ui-monospace, 'SF Mono', 'Cascadia Code', Consolas, 'Roboto Mono', monospace;
}

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

html { scroll-behavior: smooth; }

body {
  background:
    radial-gradient(900px 400px at 85% -10%, rgba(79, 124, 255, .13), transparent 60%),
    radial-gradient(700px 380px at -10% 10%, rgba(56, 189, 248, .08), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  min-height: 100vh;
}

/* ---------- шапка ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(7, 11, 19, .82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1240px; margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.brand { display: flex; align-items: baseline; gap: 8px; }
.brand-mark {
  color: #fff; font-size: 13px; font-weight: 800;
  background: var(--grad); padding: 5px 7px; border-radius: 8px;
  box-shadow: 0 0 18px rgba(79, 124, 255, .45);
}
.brand-name { font-size: 19px; font-weight: 800; letter-spacing: .2px; }
.brand-accent { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-sub { color: var(--faint); font-size: 12px; }

.status-row { display: flex; align-items: center; gap: 12px; }
.status-pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  border: 1px solid var(--border); background: var(--panel);
}
.status-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.status-pill.open { color: var(--up); border-color: rgba(22, 199, 132, .35); }
.status-pill.open .dot { background: var(--up); box-shadow: 0 0 8px var(--up); }
.status-pill.closed { color: var(--muted); }
.clock { font-family: var(--mono); color: var(--muted); font-size: 13px; }

/* ---------- контейнер ---------- */
.container { max-width: 1240px; margin: 0 auto; padding: 20px 20px 40px; }

.card {
  background: linear-gradient(180deg, var(--panel), rgba(13, 21, 36, .6));
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* ---------- фильтры ---------- */
.filters { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 14px; margin-bottom: 16px; align-items: start; }
.filters.two-col { grid-template-columns: 1fr 1.7fr; }
.filters .step { min-width: 0; }
@media (max-width: 980px) {
  .filters { grid-template-columns: 1fr; }
  .filters.two-col { grid-template-columns: 1fr; }
}
.step-title-sm { font-weight: 700; font-size: 13px; }
.sub-head { margin-bottom: 8px; }
.sub-step { border-top: 1px dashed var(--border); padding-top: 12px; margin-top: 4px; }

.step { padding: 14px 16px 16px; }
.step-head { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; }
.step-num {
  width: 22px; height: 22px; border-radius: 7px; flex: none;
  background: var(--grad); color: #fff; font-size: 12px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 0 14px rgba(79, 124, 255, .4);
}
.step-title { font-weight: 700; font-size: 14px; }
.step-hint { margin-left: auto; color: var(--faint); font-size: 11.5px; }

.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chips-scroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.chips-scroll::-webkit-scrollbar { height: 5px; }
.chips-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* вертикальный список секторов */
.chips-col {
  flex-direction: column;
  gap: 6px;
  max-height: 330px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 5px;
  scrollbar-width: thin;
}
.chips-col::-webkit-scrollbar { width: 5px; }
.chips-col::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.chips-col .chip {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 10px;
  padding: 7px 13px;
  font-size: 13px;
}
.chips-col .chip .cnt { margin-left: 8px; font-size: 12px; }

.chip {
  cursor: pointer; user-select: none;
  padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--panel-2);
  color: var(--muted); font-size: 12.5px; font-weight: 600;
  white-space: nowrap; transition: all .15s;
}
.chip:hover { border-color: rgba(79, 124, 255, .6); color: var(--text); }
.chip:active { transform: scale(.95); }
.chip:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.chip.active {
  background: var(--grad); color: #fff; border-color: transparent;
  box-shadow: 0 2px 14px rgba(79, 124, 255, .35);
  transform: none;
}
.chip.active::before { content: '✓ '; font-weight: 800; }
.chip .cnt { opacity: .75; font-weight: 500; margin-left: 5px; font-size: 11.5px; }
.chip.active .cnt { opacity: .9; }
.chip-loading { color: var(--faint); font-size: 12.5px; }

/* строка «Выбрано: …» */
.selection-summary {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  margin: 0 0 14px; padding: 10px 16px;
  border: 1px solid rgba(79, 124, 255, .35);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(79, 124, 255, .10), rgba(79, 124, 255, .03));
  font-size: 13px;
  animation: fadeIn .25s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.selection-summary .ss-label {
  color: var(--faint); font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px;
}
.selection-summary .ss-value { font-weight: 700; color: var(--text); }
.selection-summary .ss-sep { color: var(--faint); }
.selection-summary .ss-reset {
  margin-left: auto; cursor: pointer;
  background: none; border: 1px solid var(--border); border-radius: 999px;
  color: var(--muted); font-size: 12px; font-weight: 600;
  padding: 4px 12px; transition: all .15s;
}
.selection-summary .ss-reset:hover {
  color: var(--down); border-color: rgba(246, 70, 93, .5); background: rgba(246, 70, 93, .08);
}

/* ---------- ошибки ---------- */
.error-banner {
  background: rgba(246, 70, 93, .12); border: 1px solid rgba(246, 70, 93, .4);
  color: #ff9aa8; padding: 10px 14px; border-radius: 10px; margin-bottom: 14px;
  font-size: 13px; display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
.error-banner button {
  background: rgba(246, 70, 93, .2); color: #ff9aa8; border: 1px solid rgba(246, 70, 93, .4);
  border-radius: 8px; padding: 4px 12px; cursor: pointer; font-size: 12px;
}

/* ---------- таблица ---------- */
.table-card { overflow: hidden; }
.table-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
}
.table-title { display: flex; align-items: baseline; gap: 10px; }
.table-title h2 { font-size: 16px; font-weight: 800; }
.result-count { color: var(--faint); font-size: 12.5px; }
.toolbar-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.search {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px;
  padding: 7px 12px; color: var(--faint);
}
.search:focus-within { border-color: rgba(79, 124, 255, .6); }
.search input { background: none; border: none; outline: none; color: var(--text); font-size: 13px; width: 200px; }
.search input::placeholder { color: var(--faint); }

.live-badge {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--up); font-size: 11.5px; font-weight: 800; letter-spacing: 1.5px;
}
.live-badge .pulse {
  width: 7px; height: 7px; border-radius: 50%; background: var(--up);
  animation: pulse 1.6s ease-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(22, 199, 132, .55); }
  70% { box-shadow: 0 0 0 7px rgba(22, 199, 132, 0); }
  100% { box-shadow: 0 0 0 0 rgba(22, 199, 132, 0); }
}
.updated { color: var(--faint); font-size: 12px; font-family: var(--mono); }
.updated.stale-note { color: var(--amber); font-weight: 700; }

.table-wrap { overflow-x: auto; }
table.quotes { width: 100%; border-collapse: collapse; min-width: 860px; }

table.quotes th {
  text-align: right; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px;
  color: var(--faint); padding: 10px 14px; border-bottom: 1px solid var(--border);
  cursor: pointer; user-select: none; white-space: nowrap;
}
table.quotes th:hover { color: var(--text); }
table.quotes th.th-ticker, table.quotes th.th-name { text-align: left; }
table.quotes th.sorted { color: var(--accent-2); }

table.quotes td {
  padding: 9px 14px; border-bottom: 1px solid rgba(28, 42, 68, .5);
  text-align: right; font-size: 13.5px; white-space: nowrap;
}
table.quotes td.td-ticker { text-align: left; font-weight: 700; font-family: var(--mono); font-size: 13px; }
table.quotes td.td-name { text-align: left; color: var(--muted); max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
table.quotes tr { cursor: pointer; transition: background .12s; }
table.quotes tbody tr:hover { background: rgba(79, 124, 255, .07); }
table.quotes tbody tr.selected { background: rgba(79, 124, 255, .12); box-shadow: inset 3px 0 0 var(--accent); }

.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.up { color: var(--up); }
.down { color: var(--down); }
.flat { color: var(--muted); }
.muted { color: var(--muted); }

.row-skeleton td { padding: 0; }
.skeleton-line {
  height: 12px; border-radius: 6px; margin: 14px 16px 0;
  background: linear-gradient(90deg, var(--panel-2) 25%, #182742 50%, var(--panel-2) 75%);
  background-size: 200% 100%; animation: shimmer 1.4s infinite;
}
.skeleton-line.short { width: 40%; margin-bottom: 14px; }
@keyframes shimmer { to { background-position: -200% 0; } }

.table-foot {
  display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 16px; color: var(--faint); font-size: 12px;
}
.table-foot .hint { color: var(--faint); }
@media (max-width: 700px) { .table-foot .hint { display: none; } }

/* ---------- статистика ---------- */
.stats { margin-top: 18px; padding: 18px 20px 20px; scroll-margin-top: 90px; }
.stats-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-bottom: 16px;
}
.stats-ticker-row { display: flex; align-items: center; gap: 10px; }
.stats-ticker { font-family: var(--mono); font-size: 24px; font-weight: 800; letter-spacing: .5px; }
.stats-sector {
  font-size: 11px; font-weight: 700; color: var(--accent-2);
  background: rgba(56, 189, 248, .1); border: 1px solid rgba(56, 189, 248, .3);
  padding: 2px 9px; border-radius: 999px;
}
.stats-name { color: var(--muted); font-size: 13px; margin-top: 3px; }
.stats-desc {
  color: var(--muted); font-size: 13px; line-height: 1.55;
  margin-top: 8px; max-width: 640px;
  border-left: 3px solid rgba(79, 124, 255, .45);
  padding-left: 12px;
}
.stats-price-block { text-align: right; }
.stats-price { font-family: var(--mono); font-size: 26px; font-weight: 800; }
.stats-change { font-family: var(--mono); font-size: 14px; font-weight: 600; }

.period-toggle {
  display: inline-flex; gap: 4px; background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 4px;
}

/* выбор периода анализа в карточке компании */
.analyze-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.period-select {
  appearance: none;
  background: var(--panel-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238ba0c0' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 12px center;
  border: 1px solid var(--border); border-radius: 10px;
  color: var(--text); font-size: 13px; font-weight: 700;
  padding: 8px 34px 8px 14px; cursor: pointer;
  transition: border-color .15s;
}
.period-select:hover { border-color: rgba(79, 124, 255, .6); }
.period-select:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.period-select option { background: var(--panel-2); color: var(--text); }

.custom-range {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: 4px 8px;
}
.custom-range[hidden] { display: none; }
.date-input {
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); font-size: 12.5px; font-family: var(--mono);
  padding: 5px 8px; color-scheme: dark;
}
.date-input:focus-visible { outline: 2px solid var(--accent-2); }
.cr-sep { color: var(--faint); font-size: 12px; }
.cr-apply {
  cursor: pointer; background: var(--grad); color: #fff; border: none;
  border-radius: 8px; font-size: 12px; font-weight: 700; padding: 6px 12px;
  transition: opacity .15s;
}
.cr-apply:hover { opacity: .85; }
.period-btn {
  background: none; border: none; color: var(--muted); font-size: 13px; font-weight: 700;
  padding: 6px 16px; border-radius: 8px; cursor: pointer; transition: all .15s;
}
.period-btn:hover { color: var(--text); }
.period-btn.active { background: var(--grad); color: #fff; }

.stats-cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-bottom: 16px;
}
.stat-card {
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 12px;
  padding: 11px 14px;
}
.stat-card .k { color: var(--faint); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.stat-card .v { font-family: var(--mono); font-size: 16px; font-weight: 700; margin-top: 4px; }
.stat-card .s { font-size: 11.5px; color: var(--faint); margin-top: 2px; }

.chart-block { }
.chart-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.chart-title { font-weight: 800; font-size: 14px; }
.chart-sub { color: var(--faint); font-size: 12px; }
.chart-legend { margin-left: auto; font-size: 11.5px; color: var(--faint); }
.legend-up { color: var(--up); margin-right: 10px; }
.legend-down { color: var(--down); }

.chart-wrap { position: relative; background: var(--panel-2); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.chart-wrap svg { display: block; width: 100%; height: auto; }
.chart-empty { padding: 60px 20px; text-align: center; color: var(--faint); }
.chart-tip { color: var(--faint); font-size: 11.5px; margin-top: 6px; }

/* панель индикаторов тех. анализа */
.indicator-bar {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin-bottom: 10px; padding: 7px 10px;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 12px;
}
.ind-label { color: var(--faint); font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; margin-right: 2px; }
.ind-btn {
  cursor: pointer; user-select: none;
  background: none; border: 1px solid var(--border); border-radius: 8px;
  color: var(--muted); font-size: 11.5px; font-weight: 700;
  padding: 4px 10px; transition: all .15s; font-family: var(--mono);
}
.ind-btn:hover { border-color: rgba(79,124,255,.6); color: var(--text); }
.ind-btn.on {
  color: #fff; border-color: transparent;
  background: linear-gradient(135deg, rgba(79,124,255,.85), rgba(56,189,248,.75));
  box-shadow: 0 0 10px rgba(79,124,255,.3);
}
.ind-hint { margin-left: auto; color: var(--faint); font-size: 11px; }
@media (max-width: 700px) { .ind-hint { display: none; } }

/* панель инструментов рисования */
.draw-bar {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin-bottom: 10px; padding: 7px 10px;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 12px;
}
.draw-btn {
  cursor: pointer; user-select: none;
  background: none; border: 1px solid var(--border); border-radius: 8px;
  color: var(--muted); font-size: 11.5px; font-weight: 700;
  padding: 4px 10px; transition: all .15s;
}
.draw-btn:hover { border-color: rgba(79,124,255,.6); color: var(--text); }
.draw-btn.on {
  color: #fff; border-color: transparent;
  background: linear-gradient(135deg, rgba(245,165,36,.9), rgba(251,146,60,.8));
  box-shadow: 0 0 10px rgba(245,165,36,.35);
}
.draw-btn.danger:hover { border-color: rgba(246,70,93,.6); color: var(--down); background: rgba(246,70,93,.08); }
.draw-sep { width: 1px; height: 18px; background: var(--border); margin: 0 3px; }
.chart-wrap.tool-active { cursor: crosshair; }

.chart-tooltip {
  position: absolute; pointer-events: none; z-index: 5;
  background: rgba(10, 16, 28, .94); border: 1px solid var(--border); border-radius: 10px;
  padding: 9px 12px; font-family: var(--mono); font-size: 12px; line-height: 1.55;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .5); white-space: nowrap;
  transform: translate(-50%, calc(-100% - 14px));
}
.chart-tooltip .tt-date { color: var(--faint); }
.chart-tooltip .tt-row { display: flex; justify-content: space-between; gap: 14px; }
.chart-tooltip .tt-up { color: var(--up); }
.chart-tooltip .tt-down { color: var(--down); }

/* ---------- личный кабинет ---------- */
.user-btn {
  display: inline-flex; align-items: center; gap: 7px;
  cursor: pointer; white-space: nowrap;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 999px;
  color: var(--text); font-size: 13px; font-weight: 700;
  padding: 7px 14px; transition: all .15s;
}
.user-btn:hover { border-color: rgba(79, 124, 255, .7); box-shadow: 0 0 12px rgba(79, 124, 255, .2); }
.user-btn.logged {
  background: linear-gradient(135deg, rgba(22, 199, 132, .16), rgba(56, 189, 248, .12));
  border-color: rgba(22, 199, 132, .45); color: var(--up);
}

/* звёздочка избранного */
.th-star { width: 34px; padding: 0 6px !important; }
.td-star { width: 34px; padding: 0 4px !important; text-align: center; }

/* логотипы компаний */
.co-logo {
  object-fit: contain;
  background: #fff;
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .35);
  flex: none;
}
.co-logo-sm { width: 20px; height: 20px; border-radius: 5px; padding: 1px; }
.co-logo.flag-img { object-fit: cover; border-radius: 3px; padding: 0; border: 1px solid rgba(255,255,255,.18); }
.co-logo-lg.flag-img { border-radius: 6px; }
.co-logo-md { width: 24px; height: 24px; border-radius: 6px; padding: 2px; }
.co-logo-lg { width: 38px; height: 38px; border-radius: 10px; padding: 3px; }
.logo-cell {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-weight: 700; font-size: 13px;
}
.td-ticker { text-align: left; }
.logo-cell .sec-text { color: var(--text); }
.wl-logo { display: inline-flex; align-items: center; gap: 7px; }
.wl-logo .wl-ticker { display: inline; }
.star-btn {
  background: none; border: none; cursor: pointer;
  font-size: 17px; line-height: 1; color: var(--faint);
  padding: 4px 5px; border-radius: 6px; transition: all .12s;
}
.star-btn:hover { color: var(--amber); transform: scale(1.18); background: rgba(245, 165, 36, .12); }
.star-btn.on { color: var(--amber); text-shadow: 0 0 10px rgba(245, 165, 36, .5); }

/* модалки */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(4, 7, 13, .72); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-backdrop[hidden] { display: none; }
.modal {
  position: relative;
  background: linear-gradient(180deg, var(--panel), #0a1120);
  border: 1px solid var(--border); border-radius: 18px;
  width: 100%; max-width: 440px;
  padding: 24px 26px 22px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .6);
  animation: modalIn .22s ease;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-cabinet { max-width: 640px; max-height: 86vh; overflow-y: auto; }
.modal-close {
  position: absolute; top: 12px; right: 14px;
  background: none; border: none; cursor: pointer;
  color: var(--faint); font-size: 15px; padding: 4px 8px; border-radius: 8px;
}
.modal-close:hover { color: var(--text); background: var(--panel-2); }
.modal-head { margin-bottom: 14px; padding-right: 30px; }
.modal-title { font-size: 19px; font-weight: 800; }
.modal-sub { color: var(--faint); font-size: 12.5px; margin-top: 3px; word-break: break-word; }

.auth-tabs {
  display: inline-flex; gap: 4px; background: var(--panel-2);
  border: 1px solid var(--border); border-radius: 10px; padding: 4px; margin-bottom: 14px;
}
.auth-tab {
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 13px; font-weight: 700;
  padding: 6px 18px; border-radius: 8px; transition: all .15s;
}
.auth-tab.active { background: var(--grad); color: #fff; }
.field-label { display: block; color: var(--muted); font-size: 12px; font-weight: 600; margin: 10px 0 5px; }
.text-input {
  width: 100%; background: var(--bg); border: 1px solid var(--border);
  border-radius: 10px; color: var(--text); font-size: 14px;
  padding: 10px 13px; outline: none; transition: border-color .15s;
}
.text-input:focus { border-color: rgba(79, 124, 255, .7); }
.text-input::placeholder { color: var(--faint); }
.btn-primary {
  width: 100%; margin-top: 14px; cursor: pointer;
  background: var(--grad); color: #fff; border: none; border-radius: 10px;
  font-size: 14px; font-weight: 800; padding: 11px; transition: opacity .15s;
}
.btn-primary:hover { opacity: .88; }
.btn-primary:disabled { opacity: .5; cursor: wait; }
.btn-secondary {
  cursor: pointer; background: var(--panel-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
  font-size: 13px; font-weight: 700; padding: 10px 16px; white-space: nowrap;
}
.btn-secondary:hover { border-color: rgba(79, 124, 255, .6); }
.form-msg { margin-top: 10px; font-size: 13px; line-height: 1.4; min-height: 0; }
.form-msg.ok { color: var(--up); }
.form-msg.err { color: var(--down); }
.auth-hint { color: var(--faint); font-size: 12px; margin-top: 10px; text-align: center; }

.cabinet-section { margin-bottom: 18px; }
.cabinet-section-title { font-size: 13px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; margin-bottom: 8px; }
.watchlist-wrap {
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 12px; overflow: auto; max-height: 300px;
}
table.watchlist { width: 100%; border-collapse: collapse; min-width: 520px; }
table.watchlist th {
  text-align: left; font-size: 11px; color: var(--faint); font-weight: 700;
  text-transform: uppercase; letter-spacing: .5px; padding: 8px 12px;
  border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--panel-2);
}
table.watchlist th:nth-child(4), table.watchlist th:nth-child(5) { text-align: right; }
table.watchlist td { padding: 7px 12px; font-size: 13px; border-bottom: 1px solid rgba(28,42,68,.4); }
table.watchlist td:nth-child(4), table.watchlist td:nth-child(5) { text-align: right; font-family: var(--mono); }
table.watchlist tr { cursor: pointer; }
table.watchlist tr:hover { background: rgba(79,124,255,.07); }
.wl-ticker { font-family: var(--mono); font-weight: 800; }
.wl-ex { color: var(--faint); font-size: 11px; font-weight: 700; }
.wl-remove {
  cursor: pointer; background: none; border: none; color: var(--faint);
  font-size: 14px; padding: 2px 8px; border-radius: 6px;
}
.wl-remove:hover { color: var(--down); background: rgba(246,70,93,.12); }
.watchlist-empty { color: var(--faint); font-size: 13px; text-align: center; padding: 22px 12px; }

/* админ-панель */
.admin-table th:nth-child(2), .admin-table th:nth-child(3), .admin-table th:nth-child(4) { text-align: left; }
.admin-table td:nth-child(2), .admin-table td:nth-child(3), .admin-table td:nth-child(4) { text-align: left; font-family: inherit; }
.admin-table td { cursor: default; }
.admin-table tr:hover { background: transparent; }
.badge {
  display: inline-block; font-size: 10.5px; font-weight: 800; letter-spacing: .4px;
  padding: 2px 8px; border-radius: 999px; text-transform: uppercase;
}
.badge-admin { color: var(--accent-2); background: rgba(56, 189, 248, .12); border: 1px solid rgba(56, 189, 248, .3); }
.badge-ok { color: var(--up); background: rgba(22, 199, 132, .1); border: 1px solid rgba(22, 199, 132, .3); }
.badge-blocked { color: var(--down); background: rgba(246, 70, 93, .1); border: 1px solid rgba(246, 70, 93, .35); }
.btn-block, .btn-unblock, .btn-balance {
  cursor: pointer; border-radius: 8px; font-size: 12px; font-weight: 700;
  padding: 5px 11px; border: 1px solid var(--border); background: var(--panel-2); color: var(--text);
  transition: all .15s; white-space: nowrap;
}
.btn-balance:hover { border-color: rgba(245,165,36,.7); color: var(--amber); background: rgba(245,165,36,.08); }
.btn-block:hover { border-color: rgba(246, 70, 93, .6); color: var(--down); background: rgba(246, 70, 93, .1); }
.btn-unblock:hover { border-color: rgba(22, 199, 132, .6); color: var(--up); background: rgba(22, 199, 132, .08); }
.admin-note { color: var(--faint); font-size: 11.5px; margin-top: 7px; }

/* виртуальный портфель */
.pf-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-bottom: 8px; }
.pf-cards .stat-card { padding: 9px 12px; }
.pf-cards .v { font-size: 14.5px; }
.pf-perf { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.pf-perf-chip {
  cursor: default; border: 1px solid var(--border); border-radius: 999px;
  background: var(--panel-2); padding: 3px 11px; font-size: 11.5px; font-weight: 700;
}
.pf-perf-chip .lbl { color: var(--faint); margin-right: 4px; }
.pf-perf-chip .up { color: var(--up); }
.pf-perf-chip .down { color: var(--down); }
.pf-perf-chip .na { color: var(--faint); }
table.watchlist.pf-t td { text-align: left; }
table.watchlist.pf-t td:nth-child(3), table.watchlist.pf-t td:nth-child(4),
table.watchlist.pf-t td:nth-child(5), table.watchlist.pf-t td:nth-child(6),
table.watchlist.pf-t td:nth-child(7) { text-align: right; font-family: var(--mono); }
table.watchlist.pf-t th:nth-child(3), table.watchlist.pf-t th:nth-child(4),
table.watchlist.pf-t th:nth-child(5), table.watchlist.pf-t th:nth-child(6),
table.watchlist.pf-t th:nth-child(7) { text-align: right; }
.pf-sell-btn {
  cursor: pointer; background: none; border: 1px solid var(--border); border-radius: 7px;
  color: var(--muted); font-size: 11px; font-weight: 700; padding: 3px 9px;
}
.pf-sell-btn:hover { border-color: rgba(246,70,93,.6); color: var(--down); }

/* панель торговли в карточке */
.trade-panel {
  display: flex; flex-direction: column; gap: 9px;
  background: linear-gradient(180deg, rgba(79,124,255,.09), rgba(56,189,248,.03));
  border: 1px solid rgba(79,124,255,.3); border-radius: 12px;
  padding: 11px 14px; margin-bottom: 14px;
}
.tp-info { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.tp-title { font-weight: 800; font-size: 13px; }
.tp-balance { color: var(--muted); font-size: 12.5px; font-family: var(--mono); }
.tp-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tp-qty { width: 130px; padding: 8px 11px; }
.tp-est { color: var(--faint); font-size: 12.5px; font-family: var(--mono); }
.btn-buy, .btn-sell {
  cursor: pointer; border: none; border-radius: 9px;
  color: #fff; font-size: 13px; font-weight: 800; padding: 9px 20px; transition: opacity .15s;
}
.btn-buy { background: linear-gradient(135deg, #16c784, #0ea5e9); }
.btn-sell { background: linear-gradient(135deg, #f6465d, #f97316); }
.btn-buy:hover, .btn-sell:hover { opacity: .85; }
.btn-buy:disabled, .btn-sell:disabled { opacity: .45; cursor: not-allowed; }
.btn-sell-all {
  cursor: pointer;
  border: 1px solid rgba(246, 70, 93, .45);
  border-radius: 9px;
  background: rgba(246, 70, 93, .1);
  color: var(--down);
  font-size: 13px; font-weight: 800;
  padding: 9px 16px;
  transition: all .15s;
}
.btn-sell-all:hover {
  background: rgba(246, 70, 93, .2);
  border-color: rgba(246, 70, 93, .75);
  box-shadow: 0 2px 14px rgba(246, 70, 93, .3);
}
.btn-sell-all:active { transform: scale(.96); }
.btn-sell-all:disabled { opacity: .45; cursor: not-allowed; }
.tp-login-hint { color: var(--faint); font-size: 12.5px; }
.wl-date { color: var(--faint); font-size: 12px; white-space: nowrap; }

.pass-row { display: flex; gap: 8px; flex-wrap: wrap; }
.pass-row .text-input { flex: 1 1 150px; width: auto; }
.btn-logout {
  cursor: pointer; width: 100%;
  background: rgba(246, 70, 93, .1); border: 1px solid rgba(246, 70, 93, .4);
  color: var(--down); border-radius: 10px; font-size: 13px; font-weight: 700;
  padding: 10px; transition: all .15s;
}
.btn-logout:hover { background: rgba(246, 70, 93, .2); }

/* ---------- футер ---------- */
.footer { border-top: 1px solid var(--border); margin-top: 10px; background: linear-gradient(180deg, rgba(13,21,36,.2), rgba(13,21,36,.55)); }
.footer-inner { max-width: 1240px; margin: 0 auto; padding: 26px 20px 18px; color: var(--faint); font-size: 12.5px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1.4fr; gap: 30px; align-items: start; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr; gap: 22px; } }

.f-brand-row { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.f-brand-row .brand-mark { font-size: 12px; }
.f-brand-row .brand-name { font-size: 16px; }
.f-disclaimer {
  margin: 0; max-width: 520px; line-height: 1.55;
  color: var(--faint); opacity: .88;
  border-left: 2px solid rgba(79,124,255,.4); padding-left: 12px;
}

.f-title {
  font-size: 11px; font-weight: 800; letter-spacing: 1.1px; text-transform: uppercase;
  color: var(--muted); margin-bottom: 12px;
}
.f-links { list-style: none; display: grid; gap: 8px; padding: 0; margin: 0; }
.f-links a {
  color: var(--faint); text-decoration: none; transition: color .15s;
  border-bottom: 1px dashed transparent;
}
.f-links a:hover { color: var(--text); border-bottom-color: rgba(79,124,255,.5); }

.f-socials { display: grid; gap: 8px; }
.soc {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--faint); text-decoration: none; transition: color .15s;
  width: fit-content; padding: 2px 0;
}
.soc:hover { color: var(--text); }
.soc-ic {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 8px; flex: none;
  color: #fff; font-size: 13px; font-weight: 800;
  transition: transform .15s, box-shadow .15s;
}
.soc:hover .soc-ic { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,.35); }
.soc-ic.tg { background: #2AABEE; }
.soc-ic.mx { background: linear-gradient(135deg, #4f7cff, #38bdf8); }
.soc-ic.vk { background: #0077FF; }
.soc-ic.hb { background: #62A0C4; font-family: var(--mono); }
.soc-ic.yt { background: #FF0000; }
.soc-ic.dz { background: #1A1B22; font-size: 10px; letter-spacing: -.4px; }

.f-bottom { margin-top: 22px; padding-top: 14px; border-top: 1px solid rgba(28,42,68,.7); color: var(--faint); opacity: .75; font-size: 11.5px; }


/* ---------- мелкие экраны ---------- */
@media (max-width: 860px) {
  .th-cap { display: none; }
  td.td-cap { display: none; }
}
@media (max-width: 680px) {
  .th-value, td.td-value { display: none; }
  .brand-sub { display: none; }
  .stats-price-block { text-align: left; }
  .stats-head { flex-direction: column; }
}

/* ---------- облигации: теги в таблице ---------- */
.bond-tag {
  display: inline-block; margin-left: 6px; padding: 1px 7px;
  border-radius: 999px; font-size: 10px; font-weight: 700;
  letter-spacing: .4px; text-transform: uppercase; vertical-align: 1px;
  border: 1px solid transparent; white-space: nowrap;
}
.bond-tag.tag-ofz {
  color: #7dd3fc; background: rgba(56, 189, 248, .1);
  border-color: rgba(56, 189, 248, .35);
}
.bond-tag.risk-low {
  color: #6ee7b7; background: rgba(22, 199, 132, .1);
  border-color: rgba(22, 199, 132, .35);
}
.bond-tag.risk-med {
  color: #fcd34d; background: rgba(245, 165, 36, .1);
  border-color: rgba(245, 165, 36, .35);
}
.bond-tag.risk-high {
  color: #fda4af; background: rgba(246, 70, 93, .1);
  border-color: rgba(246, 70, 93, .35);
}

/* ---------- фундаментальные метрики + дивиденды ---------- */
.stock-fund {
  margin-top: 14px; padding-top: 14px;
  border-top: 1px dashed var(--border);
}
.fund-title {
  font-weight: 800; font-size: 13.5px; margin-bottom: 10px;
  display: flex; align-items: center; gap: 8px;
}
.fund-title-sm {
  font-weight: 700; font-size: 12.5px; margin: 12px 0 8px;
  color: var(--muted);
}
.fund-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
}
.fund-cell {
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 12px; padding: 10px 12px; min-width: 0;
}
.fund-cell .fk {
  color: var(--faint); font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .5px;
}
.fund-cell .fv {
  font-family: var(--mono); font-size: 17px; font-weight: 700;
  margin-top: 4px;
}
.fund-cell .fn { font-size: 11px; color: var(--faint); margin-top: 3px; }
.fund-divs { margin-top: 4px; }
.fund-divs-none {
  font-size: 12.5px; color: var(--muted);
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 12px;
}
.div-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 7px 12px; margin-bottom: 6px;
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 10px; font-size: 12.5px;
}
.div-row:last-child { margin-bottom: 0; }
.div-amt { font-family: var(--mono); font-weight: 700; color: var(--up); }
.div-date { color: var(--muted); font-family: var(--mono); font-size: 12px; }
.div-yr { margin-left: auto; color: var(--faint); font-size: 11.5px; font-weight: 600; }
.fund-note {
  margin-top: 10px; font-size: 11px; color: var(--faint);
  line-height: 1.5;
}

/* график выплат по облигации */
.bond-coupons { margin-bottom: 18px; }
.bc-layout { display: grid; grid-template-columns: 1.15fr 1fr; gap: 14px; margin-top: 8px; }
.bc-chart { min-width: 0; }
.bc-row { display: flex; align-items: center; gap: 10px; margin-bottom: 7px; }
.bc-year { width: 44px; flex: none; font-family: var(--mono); font-size: 11.5px; color: var(--faint); }
.bc-track { flex: 1; min-width: 0; }
.bc-bar {
  height: 15px; border-radius: 5px; overflow: hidden; display: flex;
  background: rgba(79, 124, 255, .08); border: 1px solid var(--border);
}
.bc-seg-coup { height: 100%; background: linear-gradient(90deg, rgba(79,124,255,.85), rgba(56,189,248,.85)); }
.bc-seg-red { height: 100%; background: linear-gradient(90deg, rgba(22,199,132,.85), rgba(22,199,132,.6)); }
.bc-val { flex: none; font-family: var(--mono); font-size: 11.5px; font-weight: 700; color: var(--text); min-width: 86px; text-align: right; }
.bc-legend { display: flex; gap: 16px; margin-top: 10px; font-size: 11px; color: var(--faint); }
.bc-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; }
.bc-legend .lg-coup { background: linear-gradient(135deg, #4f7cff, #38bdf8); }
.bc-legend .lg-red { background: #16c784; }
.bc-side { min-width: 0; }
.bc-next { margin-bottom: 10px; }
.bc-next-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 12px; margin-bottom: 6px;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px;
  font-size: 12.5px;
}
.bc-next-row.is-next { border-color: rgba(79, 124, 255, .55); box-shadow: 0 0 0 1px rgba(79, 124, 255, .15); }
.bc-kind { color: var(--faint); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.bc-date { font-family: var(--mono); font-weight: 700; }
.bc-amt { margin-left: auto; font-family: var(--mono); font-weight: 700; color: var(--up); }
.bc-in { color: var(--faint); font-size: 11.5px; min-width: 74px; text-align: right; }
.bc-total {
  font-size: 12.5px; color: var(--muted); line-height: 1.65;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px;
}
.bc-total b { font-family: var(--mono); color: var(--text); }
.bc-note { margin-top: 9px; font-size: 11px; color: var(--faint); line-height: 1.5; }

@media (max-width: 720px) {
  .fund-grid { grid-template-columns: repeat(2, 1fr); }
  .bc-layout { grid-template-columns: 1fr; }
}
