﻿* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: linear-gradient(180deg, #0f172a 0%, #111827 100%);
  color: #e2e8f0;
}

body.app-shell {
  margin: 0;
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 100;
  width: 224px;
  height: 100vh;
  padding: 24px 16px;
  border-right: 1px solid #1f2937;
  background: #0f172a;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.25);
}

.sidebar-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 12px;
}

.sidebar-tagline {
  margin: 0 0 24px;
  font-size: 13px;
  line-height: 1.45;
  color: #94a3b8;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.nav-item {
  display: block;
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid #1f2937;
  background: rgba(17, 24, 39, 0.6);
  color: #e2e8f0;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.nav-item .nav-label {
  display: block;
}

.nav-item .nav-hint {
  display: block;
  margin-top: 4px;
}

.nav-item:hover {
  background: rgba(30, 41, 59, 0.8);
  border-color: #334155;
  color: #f8fafc;
}

.nav-item.is-active {
  background: rgba(37, 99, 235, 0.18);
  border-color: #2563eb;
}

.nav-label {
  font-weight: 700;
}

.nav-hint {
  font-size: 12px;
  color: #94a3b8;
}

.main-area {
  margin-left: 224px;
  min-width: 0;
  min-height: 100vh;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 24px 28px 0;
  border-bottom: 1px solid #1f2937;
}

.topbar-title {
  margin: 0;
  font-size: 28px;
}

.topbar-subtitle {
  margin: 8px 0 0;
  color: #94a3b8;
}

.content-area {
  padding: 24px 28px 40px;
}

.version-line {
  margin: 0 0 16px;
}

.version-badge,
.version-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(34, 197, 94, 0.15);
  color: #86efac;
  border: 1px solid rgba(34, 197, 94, 0.35);
}

.alert-panel {
  border-color: #2563eb;
  background: rgba(37, 99, 235, 0.12);
}

.poll-log-panel {
  border-color: #334155;
}

.poll-live-panel.is-running {
  border-color: #2563eb;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.35);
}

.poll-live-panel.is-running #email-poll-live-status,
.poll-live-panel.is-running #market-sync-live-status {
  color: #93c5fd;
}

.poll-progress-wrap {
  margin-bottom: 14px;
}

.poll-progress-track {
  height: 8px;
  border-radius: 999px;
  background: #1e293b;
  overflow: hidden;
}

.poll-progress-bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #2563eb, #38bdf8);
  transition: width 0.25s ease;
}

.poll-progress-track-indeterminate {
  position: relative;
}

.poll-progress-track-indeterminate .poll-progress-bar {
  width: 35%;
  animation: poll-progress-slide 1.1s ease-in-out infinite;
}

@keyframes poll-progress-slide {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(320%);
  }
}

.poll-progress-label {
  display: block;
  margin-top: 6px;
  font-size: 12px;
}

.poll-journal-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.poll-journal-title-row h3 {
  margin: 0;
}

.log-toggle-btn {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
}

.log-summary-line {
  margin: 0 0 8px;
}

.sync-status-line {
  margin: 0 0 10px;
  font-size: 14px;
}

.sync-status-badge.is-running {
  color: #93c5fd;
}

.sync-status-badge.is-done {
  color: #86efac;
}

.collapsible-log.is-log-collapsed .poll-log {
  display: none;
}

.collapsible-log.is-log-collapsed [data-log-body][hidden] {
  display: none;
}

.action-groups {
  display: grid;
  gap: 16px;
}

@media (min-width: 900px) {
  .action-groups {
    grid-template-columns: 1fr 1fr;
  }
}

.action-group h4 {
  margin: 0 0 10px;
  font-size: 15px;
}

.action-group-sell h4 {
  color: #fca5a5;
}

.action-group-buy h4 {
  color: #86efac;
}

.action-group-hold h4 {
  color: #93c5fd;
}

.action-group-info h4 {
  color: #94a3b8;
}

.portfolio-actions-panel {
  border-color: #334155;
}

.poll-log {
  margin: 12px 0 0;
  padding: 14px 16px;
  max-height: 420px;
  overflow: auto;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  background: #020617;
  border: 1px solid #1e293b;
  border-radius: 12px;
  color: #cbd5e1;
}

.upload-form label.checkbox-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  max-width: 100%;
  cursor: pointer;
}

.checkbox-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.checkbox-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  flex-shrink: 0;
  accent-color: #2563eb;
  cursor: pointer;
}

.checkbox-row span {
  line-height: 1.4;
}

a {
  color: #7dd3fc;
  text-decoration: none;
}

a:hover {
  color: #bae6fd;
}

.page-header {
  border-bottom: 1px solid #1f2937;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(12px);
}

.page-header > div {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #f8fafc;
}

.brand-logo {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.brand-name {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.25;
  max-width: 200px;
}

.tagline {
  margin: 8px 0 0;
  color: #94a3b8;
}

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

.hero,
.grid,
.dashboard,
.metrics-grid,
.chart-grid,
.stats-grid {
  display: grid;
  gap: 20px;
}

.hero,
.two-col,
.two-columns,
.chart-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.metrics-grid,
.stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.panel,
.hero-card,
.metric-card,
.stat-card,
.report-row {
  background: rgba(17, 24, 39, 0.88);
  border: 1px solid #1f2937;
  border-radius: 18px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.35);
}

.panel,
.hero-card {
  padding: 22px;
}

.hero {
  margin-bottom: 24px;
  align-items: start;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.poll-journal-header {
  margin-bottom: 16px;
}

.poll-journal-header h3 {
  margin: 0 0 6px;
}

.poll-journal-at {
  margin: 0;
  text-align: right;
  font-size: 13px;
  line-height: 1.4;
}

.data-table .hint-label {
    cursor: help;
    text-decoration: underline dotted rgba(148, 163, 184, 0.55);
    text-underline-offset: 3px;
}

.data-table th.sortable-th {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.data-table th.sortable-th:hover {
    color: #f8fafc;
}

.data-table th.sort-asc::after {
    content: " ▲";
    font-size: 0.75em;
    opacity: 0.75;
}

.data-table th.sort-desc::after {
    content: " ▼";
    font-size: 0.75em;
    opacity: 0.75;
}

.leaders-panel {
    margin-bottom: 24px;
}

.leaders-panel.is-loading .leaders-loading {
    display: block;
}

.async-panel-loading,
.leaders-loading,
.analytics-loading {
    padding: 4px 0 8px;
}

.async-panel-loading[hidden],
.leaders-loading[hidden],
.analytics-loading[hidden] {
    display: none !important;
}

.async-panel-loading-message,
.leaders-loading-message {
    margin: 0 0 12px;
    color: #93c5fd;
}

.async-panel-progress,
.leaders-progress-wrap {
    margin-bottom: 10px;
}

.async-panel-loading-hint,
.leaders-loading-hint {
    margin: 0;
    font-size: 13px;
}

.analytics-panel.is-loading .async-panel-loading,
.leaders-panel.is-loading .leaders-loading {
    display: block;
}

.leaders-load-error,
.analytics-load-error {
    padding: 8px 0;
}

.dns-panel {
    margin-bottom: 24px;
}

.dns-summary-panel {
    margin-bottom: 20px;
}

.dns-summary-panel-compact {
    padding: 12px 16px;
}

.dns-summary-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 16px;
}

.dns-summary-title {
    display: flex;
    align-items: baseline;
    gap: 10px;
    font-size: 14px;
}

.dns-summary-title strong {
    font-size: 15px;
    color: #e2e8f0;
}

.dns-summary-metrics {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 14px;
    font-size: 13px;
}

.dns-summary-metrics li {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    white-space: nowrap;
}

.dns-summary-metrics li:not(:last-child)::after {
    content: "·";
    margin-left: 14px;
    color: #475569;
}

.dns-summary-metrics-hint {
    font-size: 11px;
}

.dns-summary-details {
    margin-top: 10px;
}

.dns-summary-details > summary {
    cursor: pointer;
    color: #93c5fd;
    font-size: 13px;
    user-select: none;
}

.dns-summary-details[open] > summary {
    margin-bottom: 10px;
}

.dns-narrative-panel {
    margin-bottom: 20px;
}

.dns-summary-lists {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.dns-summary-list h4 {
    margin: 0 0 6px;
    font-size: 12px;
    color: #94a3b8;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.dns-rank-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 4px;
}

.dns-rank-list li {
    display: flex;
    flex-direction: column;
    gap: 1px;
    font-size: 12px;
}

.dns-name-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.dns-name-main {
    min-width: 0;
    flex: 1;
}

.dns-exclude-form {
    flex-shrink: 0;
}

.dns-exclude-btn {
    width: 24px;
    height: 24px;
    padding: 0;
    border: 1px solid #334155;
    border-radius: 6px;
    background: #0f172a;
    color: #94a3b8;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}

.dns-exclude-btn:hover {
    border-color: #f87171;
    color: #f87171;
    background: rgba(248, 113, 113, 0.08);
}

.dns-product-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}

.dns-badge {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: lowercase;
}

.dns-badge-min {
    background: rgba(74, 222, 128, 0.15);
    color: #4ade80;
    border: 1px solid rgba(74, 222, 128, 0.35);
}

.dns-badge-hot {
    background: rgba(248, 113, 113, 0.15);
    color: #f87171;
    border: 1px solid rgba(248, 113, 113, 0.35);
}

.dns-badge-stale {
    background: rgba(148, 163, 184, 0.12);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.35);
}

.dns-badge-target {
    background: rgba(96, 165, 250, 0.15);
    color: #93c5fd;
    border: 1px solid rgba(96, 165, 250, 0.35);
}

.dns-min-flag {
    color: #4ade80;
    font-weight: 700;
    font-size: 15px;
}

.dns-target-form {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
}

.dns-target-input {
    width: 72px;
    padding: 3px 6px;
    border: 1px solid #334155;
    border-radius: 6px;
    background: #0f172a;
    color: #e2e8f0;
    font-size: 12px;
}

.dns-target-save {
    padding: 3px 8px;
    border: 1px solid #334155;
    border-radius: 6px;
    background: #1e293b;
    color: #93c5fd;
    font-size: 12px;
    cursor: pointer;
}

.dns-target-save:hover {
    border-color: #2563eb;
}

.dns-chart-wrap {
    position: relative;
    height: 220px;
    margin-bottom: 12px;
}

.dns-change-down {
    color: #4ade80;
}

.dns-change-up {
    color: #f87171;
}

.dns-change-flat {
    color: #94a3b8;
}

.dns-history-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border: 1px solid #334155;
    border-radius: 8px;
    background: #0f172a;
    color: #93c5fd;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
}

.dns-history-toggle:hover {
    border-color: #2563eb;
    background: #1e293b;
}

.dns-history-toggle-icon {
    font-size: 10px;
    line-height: 1;
}

.dns-history-row td.dns-history-cell {
    padding: 0 12px 14px;
    background: rgba(2, 6, 23, 0.85);
    border-bottom: 1px solid #1e293b;
}

.dns-history-panel {
    overflow-x: auto;
    padding: 10px 0 4px;
}

.dns-history-table {
    width: 100%;
    min-width: 420px;
    table-layout: auto;
}

.dns-history-table th,
.dns-history-table td {
    white-space: nowrap;
}

.recent-events-panel {
    margin-bottom: 24px;
}

.events-feed {
    list-style: none;
    margin: 0 0 20px;
    padding: 0;
    display: grid;
    gap: 12px;
}

.event-item {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 14px;
    align-items: start;
    padding: 14px 16px;
    border: 1px solid #1e293b;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.55);
}

.event-item.is-running {
    border-color: #2563eb;
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.25);
}

.event-item-marker {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.event-marker-svg {
    width: 22px;
    height: 22px;
    display: block;
}

.event-marker-svg-dns {
    width: 24px;
    height: 24px;
}

.event-item-marker-broker {
    background: rgba(56, 189, 248, 0.15);
    color: #7dd3fc;
}

.event-item-marker-dns {
    background: rgba(251, 146, 60, 0.15);
    color: #fdba74;
}

.event-item-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.event-item-title {
    font-size: 15px;
}

.event-item-badge {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #94a3b8;
    padding: 3px 8px;
    border-radius: 999px;
    background: #0f172a;
    border: 1px solid #334155;
}

.event-item-badge.is-running {
    color: #93c5fd;
    border-color: #2563eb;
}

.event-item-badge.is-done {
    color: #86efac;
    border-color: #166534;
}

.event-item-summary {
    margin: 0 0 4px;
    line-height: 1.45;
    word-break: break-word;
}

.event-item-period-stats {
    margin: 0 0 6px;
    font-size: 13px;
    line-height: 1.4;
}

.event-item-time {
    margin: 0;
    font-size: 13px;
}

.events-disclosure {
    border-top: 1px solid #1e293b;
    padding-top: 12px;
    margin-top: 4px;
}

.events-disclosure + .events-disclosure {
    margin-top: 8px;
}

.events-disclosure-summary {
    cursor: pointer;
    color: #93c5fd;
    font-weight: 600;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    user-select: none;
}

.events-disclosure-summary::-webkit-details-marker {
    display: none;
}

.events-disclosure-summary::before {
    content: "▸";
    display: inline-block;
    transition: transform 0.15s ease;
    color: #64748b;
}

.events-disclosure[open] > .events-disclosure-summary::before {
    transform: rotate(90deg);
}

.events-disclosure-body {
    padding: 4px 0 12px 18px;
}

.events-action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 12px 0 16px;
}

.recent-events-panel .poll-live-panel {
    margin-top: 12px;
    padding: 14px 16px;
    border: 1px solid #1e293b;
    border-radius: 12px;
    background: #020617;
}

.recent-events-panel .poll-live-panel h4 {
    margin: 0;
    font-size: 15px;
}

.table-scroll,
.dns-table-wrap,
.leaders-table-wrap,
.report-table-wrap,
.portfolio-market-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}

.table-scroll-sticky {
    overflow-y: auto;
    max-height: min(70vh, 720px);
}

.table-scroll-sticky thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #111827;
    box-shadow: 0 1px 0 #1f2937;
}

.report-chart-wrap {
    position: relative;
    height: 280px;
    max-height: 280px;
}

.report-chart-wrap canvas {
    width: 100% !important;
    height: 100% !important;
    min-height: 0;
}

.portfolio-market-panel {
    margin-bottom: 24px;
}

.signal-summary-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    margin-bottom: 16px;
}

.signal-summary-card {
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid #1f2937;
    background: #020617;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.signal-summary-card span {
    font-size: 12px;
    color: #94a3b8;
}

.signal-summary-card strong {
    font-size: 22px;
}

.signal-summary-sell strong {
    color: #fca5a5;
}

.signal-summary-buy strong {
    color: #86efac;
}

.signal-summary-hold strong {
    color: #93c5fd;
}

.signal-summary-watch strong,
.signal-summary-no_quote strong {
    color: #cbd5e1;
}

.portfolio-market-aside {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #1f2937;
}

.portfolio-market-aside h4 {
    margin: 0 0 8px;
    font-size: 14px;
}

.portfolio-market-aside ul {
    margin: 0;
    padding-left: 18px;
}

.moex-change-up {
    color: #4ade80;
}

.moex-change-down {
    color: #f87171;
}

.moex-change-flat {
    color: #94a3b8;
}

.moex-signal-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid transparent;
    white-space: nowrap;
}

.moex-signal-buy,
.moex-signal-add {
    color: #86efac;
    border-color: rgba(34, 197, 94, 0.35);
    background: rgba(34, 197, 94, 0.12);
}

.moex-signal-hold {
    color: #93c5fd;
    border-color: rgba(59, 130, 246, 0.35);
    background: rgba(59, 130, 246, 0.12);
}

.moex-signal-reduce,
.moex-signal-sell {
    color: #fca5a5;
    border-color: rgba(248, 113, 113, 0.35);
    background: rgba(248, 113, 113, 0.12);
}

.moex-signal-watch {
  color: #cbd5e1;
  border-color: #334155;
  background: rgba(15, 23, 42, 0.8);
}

.moex-confidence-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid transparent;
}

.moex-confidence-low {
  color: #fca5a5;
  border-color: rgba(248, 113, 113, 0.35);
  background: rgba(127, 29, 29, 0.25);
}

.moex-confidence-medium {
  color: #fde68a;
  border-color: rgba(251, 191, 36, 0.35);
  background: rgba(120, 53, 15, 0.25);
}

.moex-confidence-high {
  color: #86efac;
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(22, 101, 52, 0.25);
}

.moex-quality-banner {
  margin: 0 0 16px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid #334155;
  background: rgba(2, 6, 23, 0.85);
}

.moex-quality-banner p {
  margin: 8px 0 0;
}

.moex-quality-low {
  border-color: rgba(248, 113, 113, 0.45);
}

.moex-quality-medium {
  border-color: rgba(251, 191, 36, 0.45);
}

.moex-quality-high {
  border-color: rgba(34, 197, 94, 0.45);
}

.portfolio-market-table {
    min-width: 720px;
}

.portfolio-market-row.row-unmapped td {
    opacity: 0.88;
}

.portfolio-market-details-row td {
    padding-top: 0;
    border-bottom: 1px solid #1f2937;
}

.position-moex-details {
    margin: 4px 0 8px;
}

.position-moex-details summary {
    cursor: pointer;
    color: #7dd3fc;
    font-size: 13px;
}

.moex-details-grid {
    display: grid;
    gap: 6px 16px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    margin: 10px 0 0;
    font-size: 13px;
}

.moex-details-grid dt {
    margin: 0;
    color: #94a3b8;
}

.moex-details-grid dd {
    margin: 0;
}

.data-table td .instrument-subline {
    font-size: 12px;
    margin-top: 2px;
}

.dns-products-table {
    table-layout: fixed;
    width: 100%;
    min-width: 1180px;
}

.leaders-data-table {
    table-layout: fixed;
    width: 100%;
    min-width: 960px;
}

.dns-products-table col.col-dns-name {
    width: 240px;
}

.dns-products-table col.col-dns-num {
    width: 88px;
}

.dns-products-table col.col-dns-flag {
    width: 48px;
}

.dns-products-table col.col-dns-target {
    width: 110px;
}

.dns-products-table col.col-dns-range {
    width: 124px;
}

.dns-products-table col.col-dns-date {
    width: 136px;
}

.dns-products-table col.col-dns-history {
    width: 96px;
}

@media (max-width: 1280px) {
    .dns-products-table {
        min-width: 880px;
    }

    .dns-products-table col.col-dns-name {
        width: 200px;
    }

    .dns-products-table col.col-dns-num {
        width: 92px;
    }

    .dns-products-table col.col-dns-range {
        width: 112px;
    }

    .dns-products-table col.col-dns-date {
        width: 124px;
    }
}

.dns-products-table td.col-dns-name {
    word-break: break-word;
    white-space: normal;
    overflow-wrap: anywhere;
}

.dns-products-table td.col-dns-num,
.dns-products-table td.col-dns-range,
.dns-products-table td.col-dns-date {
    white-space: nowrap;
}

.leaders-data-table col.col-rank {
    width: 2.25rem;
}

.leaders-data-table th.col-rank,
.leaders-data-table td.col-rank {
    width: 2.25rem;
    max-width: 2.75rem;
    padding-left: 6px;
    padding-right: 6px;
    text-align: center;
    white-space: nowrap;
}

.dns-products-table thead th,
.leaders-data-table thead th {
    position: relative;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 0;
}

.dns-products-table thead th.sortable-th,
.leaders-data-table thead th.sortable-th,
.avito-items-table thead th.sortable-th {
    cursor: pointer;
}

.dns-products-table .col-resizer,
.leaders-data-table .col-resizer {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 2;
    width: 8px;
    height: 100%;
    cursor: col-resize;
    user-select: none;
    touch-action: none;
}

.dns-products-table .col-resizer:hover,
.leaders-data-table .col-resizer:hover {
    background: rgba(56, 189, 248, 0.35);
}

body.col-resize-active {
    cursor: col-resize;
    user-select: none;
}

.data-table tr.in-portfolio-row td {
    background: rgba(56, 189, 248, 0.06);
}

.contributions-block {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid #1f2937;
}

.contributions-block h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.contributions-period {
  margin: 0 0 14px;
}

.contributions-stats {
  margin-bottom: 12px;
}

.contributions-split {
  margin: 0 0 12px;
  font-size: 13px;
}

.contributions-details {
  margin-top: 12px;
}

.contributions-details summary {
  cursor: pointer;
  color: #7dd3fc;
  margin-bottom: 10px;
}

.upload-form {
  display: grid;
  gap: 14px;
}

.upload-form label {
  display: grid;
  gap: 8px;
  font-size: 14px;
}

.upload-form input,
.upload-form button {
  width: 100%;
  border-radius: 12px;
  border: 1px solid #334155;
  background: #0f172a;
  color: #e2e8f0;
  padding: 12px 14px;
}

.upload-form button,
.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  background: #2563eb;
  border: 0;
  font-weight: 700;
  color: #eff6ff;
}

.button.secondary.moex-clear-btn {
    border-color: #c45c5c;
    color: #8b2e2e;
}

.button.secondary.moex-clear-btn:hover {
    background: #fff5f5;
}

.button.secondary {
  background: #1e293b;
  color: #e2e8f0;
  padding: 10px 14px;
  border-radius: 12px;
}

.feature-list,
.rich-list {
  margin: 0;
  padding-left: 20px;
}

.feature-list li,
.rich-list li {
  margin-bottom: 10px;
  line-height: 1.5;
}

.rich-list.accent li::marker {
  color: #22c55e;
}

.report-list {
  display: grid;
  gap: 12px;
}

.report-row {
  padding: 16px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.report-row:hover {
  border-color: #334155;
  transform: translateY(-1px);
}

.report-meta {
  display: grid;
  justify-items: end;
  gap: 6px;
}

.metric-card,
.stat-card {
  padding: 18px;
  display: grid;
  gap: 8px;
}

.metric-card span,
.stat-card span {
  font-size: 13px;
  color: #94a3b8;
}

.metric-card strong,
.stat-card strong {
  font-size: 22px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid #1f2937;
  vertical-align: top;
}

.data-table thead th {
  color: #94a3b8;
  font-size: 13px;
}

.compact td:first-child {
  color: #94a3b8;
  width: 45%;
}

.muted {
  color: #94a3b8;
}

.json-block {
  white-space: pre-wrap;
  overflow-x: auto;
  padding: 16px;
  border-radius: 12px;
  background: #020617;
  border: 1px solid #1e293b;
}

.chart-card {
  position: relative;
  min-height: 300px;
  height: 300px;
  padding: 12px 12px 8px;
  border-radius: 12px;
  background: #020617;
  border: 1px solid #1e293b;
}

.chart-title {
  margin: 0 0 8px;
  font-size: 13px;
  color: #94a3b8;
}

.chart-card canvas {
  width: 100% !important;
  height: calc(100% - 28px) !important;
  min-height: 0;
}

.chart-card canvas,
.report-chart-wrap canvas {
  width: 100%;
}

details summary {
  cursor: pointer;
  color: #7dd3fc;
  margin-bottom: 12px;
}

body.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(420px, 100%);
  padding: 28px;
}

.login-brand {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 20px;
}

.login-brand h1 {
  margin: 0 0 4px;
  font-size: 1.25rem;
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-form label {
  display: grid;
  gap: 6px;
}

.login-form input {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #334155;
  background: #0b1220;
  color: #e2e8f0;
}

.login-error {
  color: #fca5a5;
  margin: 0 0 12px;
}

.sidebar-logout {
  margin-top: auto;
  padding-top: 16px;
}

.button.full-width {
  width: 100%;
}

.hint-block {
  margin-top: 12px;
  font-size: 0.9rem;
}

.leaders-filter-form {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
  margin-bottom: 12px;
}

.leaders-filter-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 160px;
}

.leaders-filter-form select,
.leaders-filter-form input[type="date"] {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #334155;
  background: #0b1220;
  color: #e2e8f0;
}

.leader-top-row td:first-child {
  font-weight: 700;
  color: #fbbf24;
}

@media (max-width: 720px) {
  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    border-right: 0;
    border-bottom: 1px solid #1f2937;
    box-shadow: none;
  }

  .main-area {
    margin-left: 0;
  }

  .hero,
  .two-col,
  .two-columns,
  .chart-grid {
    grid-template-columns: 1fr;
  }

  .panel-header,
  .report-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .report-meta {
    justify-items: start;
  }
}

.event-item-marker-avito {
  color: #0ea5e9;
}

.event-subfeed {
  margin: 0.5rem 0 0;
  padding-left: 1.1rem;
  font-size: 0.85rem;
}

.avito-watch-form label,
.compact-form label {
  display: block;
  margin-bottom: 0.5rem;
}

.avito-watch-filter-col,
.avito-watch-filter-cell {
  width: 2.25rem;
  text-align: center;
}

.avito-last-check-at {
  margin-top: 0.35rem;
  white-space: nowrap;
}

.row-alert {
  background: rgba(239, 68, 68, 0.08);
}

.badge-ok {
  color: #16a34a;
}

.badge-alert {
  color: #dc2626;
}

.inline-form {
  display: inline;
}

.inline-details {
  display: inline-block;
  margin-left: 0.25rem;
}

.inline-details summary {
  cursor: pointer;
  color: #93c5fd;
  font-size: 0.85rem;
}

.actions-cell {
  white-space: nowrap;
}

.error-text {
  color: #f87171;
}

.small {
  font-size: 0.85rem;
}
